MeteorlAl 1 Опубликовано 30 апреля, 2012 Скрытый текстimport sysfrom net.sf.l2j.gameserver.model.actor.instance import L2PcInstancefrom net.sf.l2j.gameserver.model.quest import Statefrom net.sf.l2j.gameserver.model.quest import QuestStatefrom net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuestqn = "8019_SetHero"NPC=[300300]ADENA_ID=57COUNT=40class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onEvent(self,event,st): htmltext = event count=st.getQuestItemsCount(ADENA_ID) if count < 1 : htmltext = "<html><head><body>You dont have enough adena.</body></html>" else: if event == "1": if st.getPlayer().isHero() : return "hero.htm" st.setState(State.COMPLETED) if not st.getPlayer().isHero() : st.takeItems(ADENA_ID,COUNT) st.getPlayer().setHero(True) st.giveItems(6842,1) return "grat.htm" st.setState(COMPLETED) if htmltext != event: st.setState(State.COMPLETED) st.exitQuest(1) return htmltext def onTalk (self,npc,st): htmltext = "<html><head><body>I have nothing to say to you</body></html>" st = st.getQuestState(qn) st.setState(State.STARTED) return "1.htm"QUEST = Quest(8019,qn,"custom")for npcId in NPC: QUEST.addStartNpc(npcId) QUEST.addTalkId(npcId) Этот скрипт выдает Геройство нв то время пока вы в игре. т.е. делаете рестарт и вы уже не герой.Прошу помогите настроить его на выдачу геройства (1 день, 3дня, неделя) Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
(D)uality 700 Опубликовано 30 апреля, 2012 А что если такой Скрытый текстimport sysfrom java.lang import Integer from net.sf.l2j.gameserver.model.quest import State from net.sf.l2j.gameserver.model.quest import QuestState from net.sf.l2j.gameserver.model.quest import Quest from net.sf.l2j.gameserver.datatables import SkillTable from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest from net.sf.l2j import L2DatabaseFactory from net.sf.l2j.gameserver.ai import CtrlIntention from java.lang import System ################### qn = "50301_Hero" # NPC = 300300 # ################### QuestDesc = "custom" # Папка хранения скрипта # QuestName = "Hero" # Название квеста # QuestId = 50301 # ID Квеста # ############################################################## Item = 3478 # ID валюты # Count = 30 # Цена на хиро за 1 день # Count2 = 30 # Цена на хиро за 7 дней # Count3 = 30 # Цена на хиро за 14 дней # Count4 = 30 # Цена на хиро за месяц # Count5 = 30 # Цена на хиро за год # Iname = "Wmz Coin" # Имя валюты # ############################################################## day = [] # Тут не трогаем class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onAdvEvent(self,event,npc,player) : global day st = player.getQuestState(qn) htmltext = event xHRx = 0 eventSplit = event.split(" ") event = eventSplit[0] if event == "setHero1den" : if not player.isNoble() : htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0433\u0435\u0440\u043e\u0439\u0441\u0442\u0432\u043e,<br>\u041d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0434\u0432\u043e\u0440\u044f\u043d\u0438\u043d\u043e\u043c !</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext elif player.isHero(): htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0412\u044b \u0438 \u0442\u0430\u043a \u0433\u0435\u0440\u043e\u0439 !</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext elif st.getQuestItemsCount(Item) >= Count : st.takeItems(Item,Count) player.setHero(True) heroTime = 86400000 heroTime2 = System.currentTimeMillis() heroTime3 = heroTime2 + heroTime obj_Id = str(player.getObjectId()) char_name = str(player.getName()) writelog=L2DatabaseFactory.getInstance().getConnection() write=writelog.prepareStatement("INSERT INTO hero_custom_data (obj_Id,char_name,hero,hero_end_date) VALUES (?,?,?,?)") write.setString(1, obj_Id) write.setString(2, char_name) write.setInt(3, 1) write.setLong(4, heroTime3) try : write.executeUpdate() write.close() writelog.close() except : try : writelog.close() except : pass st.giveItems(6842,1) st.playSound("ItemSound.quest_finish") htmltext = "<html><title> HEROOUUU</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0412\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u043B\u0438 \u0445\u0438\u0440\u043E \u043D\u0430 1 \u0434\u0435\u043D\u044C.</font><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br><table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" st.exitQuest(1) day = [] return htmltext elif st.getQuestItemsCount(Item) < Count : htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0423 \u0432\u0430\u0441 \u043D\u0435\u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043F\u0440\u0435\u0434\u043C\u0435\u0442\u043E\u0432 \u0434\u043B\u044F \u0445\u0438\u0440\u043E !</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext if event == "setHero7den" : if not player.isNoble() : htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0433\u0435\u0440\u043e\u0439\u0441\u0442\u0432\u043e,<br>\u041d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0434\u0432\u043e\u0440\u044f\u043d\u0438\u043d\u043e\u043c !</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext elif player.isHero(): htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0412\u044b \u0438 \u0442\u0430\u043a \u0433\u0435\u0440\u043e\u0439 !</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext elif st.getQuestItemsCount(Item) >= Count2 : st.takeItems(Item,Count) player.setHero(True) heroTime = 604800000 heroTime2 = System.currentTimeMillis() heroTime3 = heroTime2 + heroTime obj_Id = str(player.getObjectId()) char_name = str(player.getName()) writelog=L2DatabaseFactory.getInstance().getConnection() write=writelog.prepareStatement("INSERT INTO hero_custom_data (obj_Id,char_name,hero,hero_end_date) VALUES (?,?,?,?)") write.setString(1, obj_Id) write.setString(2, char_name) write.setInt(3, 1) write.setLong(4, heroTime3) try : write.executeUpdate() write.close() writelog.close() except : try : writelog.close() except : pass st.giveItems(6842,1) st.playSound("ItemSound.quest_finish") htmltext = "<html><title> HEROOUUU</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0412\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u043B\u0438 \u0445\u0438\u0440\u043E \u043D\u0430 1 \u0434\u0435\u043D\u044C.</font><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br><table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" st.exitQuest(1) day = [] return htmltext elif st.getQuestItemsCount(Item) < Count2 : htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0412\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u043B\u0438 \u0445\u0438\u0440\u043E \u043D\u0430 7 \u0434\u043D\u0435\u0439.</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext if event == "setHero14den" : if not player.isNoble() : htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0433\u0435\u0440\u043e\u0439\u0441\u0442\u0432\u043e,<br>\u041d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0434\u0432\u043e\u0440\u044f\u043d\u0438\u043d\u043e\u043c !</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext elif player.isHero(): htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0412\u044b \u0438 \u0442\u0430\u043a \u0433\u0435\u0440\u043e\u0439 !</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext elif st.getQuestItemsCount(Item) >= Count3 : st.takeItems(Item,Count) player.setHero(True) heroTime = 1209600000 heroTime2 = System.currentTimeMillis() heroTime3 = heroTime2 + heroTime obj_Id = str(player.getObjectId()) char_name = str(player.getName()) writelog=L2DatabaseFactory.getInstance().getConnection() write=writelog.prepareStatement("INSERT INTO hero_custom_data (obj_Id,char_name,hero,hero_end_date) VALUES (?,?,?,?)") write.setString(1, obj_Id) write.setString(2, char_name) write.setInt(3, 1) write.setLong(4, heroTime3) try : write.executeUpdate() write.close() writelog.close() except : try : writelog.close() except : pass st.giveItems(6842,1) st.playSound("ItemSound.quest_finish") htmltext = "<html><title> HEROOUUU</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0412\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u043B\u0438 \u0445\u0438\u0440\u043E \u043D\u0430 14 \u0434\u043D\u0435\u0439.</font><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br><table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" st.exitQuest(1) day = [] return htmltext elif st.getQuestItemsCount(Item) < Count3 : htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0423 \u0432\u0430\u0441 \u043D\u0435\u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043F\u0440\u0435\u0434\u043C\u0435\u0442\u043E\u0432 \u0434\u043B\u044F \u0445\u0438\u0440\u043E !</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext if event == "setHero31den" : if not player.isNoble() : htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0433\u0435\u0440\u043e\u0439\u0441\u0442\u0432\u043e,<br>\u041d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0434\u0432\u043e\u0440\u044f\u043d\u0438\u043d\u043e\u043c !</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext elif player.isHero(): htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0412\u044b \u0438 \u0442\u0430\u043a \u0433\u0435\u0440\u043e\u0439 !</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext elif st.getQuestItemsCount(Item) >= Count4 : st.takeItems(Item,Count) player.setHero(True) heroTime = 2678400000 heroTime2 = System.currentTimeMillis() heroTime3 = heroTime2 + heroTime obj_Id = str(player.getObjectId()) char_name = str(player.getName()) writelog=L2DatabaseFactory.getInstance().getConnection() write=writelog.prepareStatement("INSERT INTO hero_custom_data (obj_Id,char_name,hero,hero_end_date) VALUES (?,?,?,?)") write.setString(1, obj_Id) write.setString(2, char_name) write.setInt(3, 1) write.setLong(4, heroTime3) try : write.executeUpdate() write.close() writelog.close() except : try : writelog.close() except : pass st.giveItems(6842,1) st.playSound("ItemSound.quest_finish") htmltext = "<html><title> HEROOUUU</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0412\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u043B\u0438 \u0445\u0438\u0440\u043E \u043D\u0430 \u043C\u0435\u0441\u044F\u0446.</font><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br><table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" st.exitQuest(1) day = [] return htmltext elif st.getQuestItemsCount(Item) < Count4 : htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0423 \u0432\u0430\u0441 \u043D\u0435\u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043F\u0440\u0435\u0434\u043C\u0435\u0442\u043E\u0432 \u0434\u043B\u044F \u0445\u0438\u0440\u043E !</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext if event == "setHeroGod" : if not player.isNoble() : htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0433\u0435\u0440\u043e\u0439\u0441\u0442\u0432\u043e,<br>\u041d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0434\u0432\u043e\u0440\u044f\u043d\u0438\u043d\u043e\u043c !</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext elif player.isHero(): htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0412\u044b \u0438 \u0442\u0430\u043a \u0433\u0435\u0440\u043e\u0439 !</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext elif st.getQuestItemsCount(Item) >= Count5 : st.takeItems(Item,Count) player.setHero(True) heroTime = 31536000000 heroTime2 = System.currentTimeMillis() heroTime3 = heroTime2 + heroTime obj_Id = str(player.getObjectId()) char_name = str(player.getName()) writelog=L2DatabaseFactory.getInstance().getConnection() write=writelog.prepareStatement("INSERT INTO hero_custom_data (obj_Id,char_name,hero,hero_end_date) VALUES (?,?,?,?)") write.setString(1, obj_Id) write.setString(2, char_name) write.setInt(3, 1) write.setLong(4, heroTime3) try : write.executeUpdate() write.close() writelog.close() except : try : writelog.close() except : pass st.giveItems(6842,1) st.playSound("ItemSound.quest_finish") htmltext = "<html><title> HEROOUUU</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0412\u044B \u043F\u043E\u043B\u0443\u0447\u0438\u043B\u0438 \u0445\u0438\u0440\u043E \u043D\u0430 \u0433\u043E\u0434.</font><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br><table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" st.exitQuest(1) day = [] return htmltext elif st.getQuestItemsCount(Item) < Count5 : htmltext = "<html><title>Exclusive Shop</title><body><center><br><br>" htmltext += "<img src=\"L2UI_CH3.onscrmsg_pattern01_1\" width=300 height=32><img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br>" htmltext += u"<font color=\"LEVEL\">\u0423 \u0432\u0430\u0441 \u043D\u0435\u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u043F\u0440\u0435\u0434\u043C\u0435\u0442\u043E\u0432 \u0434\u043B\u044F \u0445\u0438\u0440\u043E !</font>" htmltext += u"<img src=\"L2UI_CH3.herotower_deco\" width=256 height=32><br><img src=\"L2UI_CH3.onscrmsg_pattern01_2\" width=300 height=32><br>" htmltext += u"<table><tr><td align=center><button value=\"\u0412\u044b\u0445\u043e\u0434\" action=\"bypass -h npc_%objectId%_Close\" width=75 height=22 back=\"L2UI_ch3.Btn1_normalOn\" fore=\"L2UI_ch3.Btn1_normal\"></td></tr></table>" htmltext += "</center></body></html>" return htmltext def onTalk(self,npc,player) : htmltext = "Sorry !" st = player.getQuestState(qn) if not st : st = self.newQuestState(player) htmltext = "start.htm" return htmltext QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc) QUEST.addStartNpc(NPC) QUEST.addTalkId(NPC) Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
MeteorlAl 1 Опубликовано 1 мая, 2012 Не выходит Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
AlexMan 27 Опубликовано 1 мая, 2012 (изменено) st.heroget.getPlayer(30)(true) вместо стандарт попробуй не зная сборки я хз как происходит выдача хиро Изменено 1 мая, 2012 пользователем AlexMan Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
MeteorlAl 1 Опубликовано 1 мая, 2012 сборка l2jx Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
AlexMan 27 Опубликовано 1 мая, 2012 пробуй должен пахать, выложил бы раньше инет ток не пахал) и спасибку ставь Скрытый текстimport sysfrom net.sf.l2j.gameserver.model.actor.instance import L2PcInstance from net.sf.l2j.gameserver.model.quest import State from net.sf.l2j.gameserver.model.quest import QuestState from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest from net.sf.l2j.gameserver.model.entity.events.Heroes qn = "8019_SetHero" NPC=[300300] ADENA_ID=57 COUNT=40 class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) def onEvent(self,event,st): htmltext = event count=st.getQuestItemsCount(ADENA_ID) if count < 1 : htmltext = "<html><head><body>You dont have enough adena.</body></html>" else: if event == "1": if st.getPlayer().isHero() : return "hero.htm" st.setState(State.COMPLETED) if not st.getPlayer().isHero() : st.takeItems(ADENA_ID,COUNT) Heroes.getInstance().addHero(player, 30) st.giveItems(6842,1) return "grat.htm" st.setState(COMPLETED) if htmltext != event: st.setState(State.COMPLETED) st.exitQuest(1) return htmltext def onTalk (self,npc,st): htmltext = "<html><head><body>I have nothing to say to you</body></html>" st = st.getQuestState(qn) st.setState(State.STARTED) return "1.htm" QUEST = Quest(8019,qn,"custom") for npcId in NPC: QUEST.addStartNpc(npcId) QUEST.addTalkId(npcId) Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
MeteorlAl 1 Опубликовано 1 мая, 2012 (изменено) Надо же 1, 3 и 7 дней настроить, чтоб выбор был Изменено 1 мая, 2012 пользователем MeteorlAl Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты
AlexMan 27 Опубликовано 1 мая, 2012 (изменено) эт уже сам делай по аналогу тока if event == "2": евент 3 и тд а в линке поставишь 8019_SetHero 1 1 это event первый Изменено 1 мая, 2012 пользователем AlexMan Поделиться сообщением Ссылка на сообщение Поделиться на другие сайты