Перейти к содержанию
Авторизация  
maxiFrost

Как Вставить Херо?

Рекомендуемые сообщения

Народ подскажите плиз как вставить в донат шоп продажу геройства???Всё поставил геройство хз как

У как есть скрипт под сборку l2jfrozen поделитесь!!!

:(

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

могу попробовать сделать тебе на сколько дней чтоб выдавало ?

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

у меня на сервере есть дон шоп там есть выдача хиро всё работает вот скрипт

 

 

import sys

from 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

 

qn = "8019_SetHero"

 

NPC=[300300]

ADENA_ID=15555

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)

st.getPlayer().setHero(True)

st.giveItems(9999,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 день - цена

7 дней - цена

1 месяц - цена

 

:(

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
l2jfrozen

щас выложу нпц хиро который выдает хиро на

 

1 день

3 дня

7 дней

30 дней

365 дней

 

=))

 

но не фокт что подойдет но если немного подредактирувать то и на фрозен пойдет

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

так как я не успел сделать вот поправил под фрозенов херо нпц лакосты

Скрытый текст

import sys

from java.lang import Integer

from com.l2jfrozen.gameserver.model.quest import State

from com.l2jfrozen.gameserver.model.quest import QuestState

from com.l2jfrozen.gameserver.model.quest import Quest

from com.l2jfrozen.gameserver.datatables import SkillTable

from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

from com.l2jfrozen.util.database import L2DatabaseFactory

from com.l2jfrozen.gameserver.ai import CtrlIntention

from java.lang import System

 

###################

qn = "50301_Hero" #

NPC = 300300 #

###################

QuestDesc = "custom" # Папка хранения скрипта #

QuestName = "Hero" # Название квеста #

QuestId = 50301 # ID Квеста #

##############################################################

Item = 9401 # ID валюты #

Count = 1 # Цена на хиро за 1 день #

Count2 = 7 # Цена на хиро за 7 дней #

Count3 = 13 # Цена на хиро за 14 дней #

Count4 = 30 # Цена на хиро за месяц #

Count5 = 100 # Цена на хиро за год #

 

 

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)

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
так как я не успел сделать вот поправил под фрозенов херо нпц лакосты

Скрытый текст

import sys

from java.lang import Integer

from com.l2jfrozen.gameserver.model.quest import State

from com.l2jfrozen.gameserver.model.quest import QuestState

from com.l2jfrozen.gameserver.model.quest import Quest

from com.l2jfrozen.gameserver.datatables import SkillTable

from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

from com.l2jfrozen.util.database import L2DatabaseFactory

from com.l2jfrozen.gameserver.ai import CtrlIntention

from java.lang import System

 

###################

qn = "50301_Hero" #

NPC = 300300 #

###################

QuestDesc = "custom" # Папка хранения скрипта #

QuestName = "Hero" # Название квеста #

QuestId = 50301 # ID Квеста #

##############################################################

Item = 9401 # ID валюты #

Count = 1 # Цена на хиро за 1 день #

Count2 = 7 # Цена на хиро за 7 дней #

Count3 = 13 # Цена на хиро за 14 дней #

Count4 = 30 # Цена на хиро за месяц #

Count5 = 100 # Цена на хиро за год #

 

 

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)

Красным ошибка надо записывать в characters_custom_data + там столбец Donator

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Красным ошибка надо записывать в characters_custom_data + там столбец Donator

сейчас доделаем

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Скрытый текст

import sys
from java.lang import Integer
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model.quest import Quest
from com.l2jfrozen.gameserver.datatables import SkillTable
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest
from com.l2jfrozen.util.database import L2DatabaseFactory
from com.l2jfrozen.gameserver.ai import CtrlIntention
from java.lang import System

###################
qn = "50301_Hero" #
NPC = 300300 #
###################
QuestDesc = "custom" # Папка хранения скрипта #
QuestName = "Hero" # Название квеста #
QuestId = 50301 # ID Квеста #
##############################################################
Item = 9401 # ID валюты #
Count = 1 # Цена на хиро за 1 день #
Count2 = 7 # Цена на хиро за 7 дней #
Count3 = 13 # Цена на хиро за 14 дней #
Count4 = 30 # Цена на хиро за месяц #
Count5 = 100 # Цена на хиро за год #


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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")
write.setString(1, obj_Id)
write.setString(2, char_name)
write.setInt(3, 1)
write.setInt(4, 1)
write.setInt(5, 0)
write.setLong(6, 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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")
write.setString(1, obj_Id)
write.setString(2, char_name)
write.setInt(3, 1)
write.setInt(4, 1)
write.setInt(5, 0)
write.setLong(6, 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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")
write.setString(1, obj_Id)
write.setString(2, char_name)
write.setInt(3, 1)
write.setInt(4, 1)
write.setInt(5, 0)
write.setLong(6, 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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")
write.setString(1, obj_Id)
write.setString(2, char_name)
write.setInt(3, 1)
write.setInt(4, 1)
write.setInt(5, 0)
write.setLong(6, 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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")
write.setString(1, obj_Id)
write.setString(2, char_name)
write.setInt(3, 1)
write.setInt(4, 1)
write.setInt(5, 0)
write.setLong(6, 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)

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Скрытый текст

import sys

from java.lang import Integer

from com.l2jfrozen.gameserver.model.quest import State

from com.l2jfrozen.gameserver.model.quest import QuestState

from com.l2jfrozen.gameserver.model.quest import Quest

from com.l2jfrozen.gameserver.datatables import SkillTable

from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

from com.l2jfrozen.util.database import L2DatabaseFactory

from com.l2jfrozen.gameserver.ai import CtrlIntention

from java.lang import System

 

###################

qn = "50301_Hero" #

NPC = 300300 #

###################

QuestDesc = "custom" # Папка хранения скрипта #

QuestName = "Hero" # Название квеста #

QuestId = 50301 # ID Квеста #

##############################################################

Item = 9401 # ID валюты #

Count = 1 # Цена на хиро за 1 день #

Count2 = 7 # Цена на хиро за 7 дней #

Count3 = 13 # Цена на хиро за 14 дней #

Count4 = 30 # Цена на хиро за месяц #

Count5 = 100 # Цена на хиро за год #

 

 

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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")

write.setString(1, obj_Id)

write.setString(2, char_name)

write.setInt(3, 1)

write.setInt(4, 1)

write.setInt(5, 0)

write.setLong(6, 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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")

write.setString(1, obj_Id)

write.setString(2, char_name)

write.setInt(3, 1)

write.setInt(4, 1)

write.setInt(5, 0)

write.setLong(6, 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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")

write.setString(1, obj_Id)

write.setString(2, char_name)

write.setInt(3, 1)

write.setInt(4, 1)

write.setInt(5, 0)

write.setLong(6, 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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")

write.setString(1, obj_Id)

write.setString(2, char_name)

write.setInt(3, 1)

write.setInt(4, 1)

write.setInt(5, 0)

write.setLong(6, 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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")

write.setString(1, obj_Id)

write.setString(2, char_name)

write.setInt(3, 1)

write.setInt(4, 1)

write.setInt(5, 0)

write.setLong(6, 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)

 

 

Error on: C:\frozen\gameserver\data\scripts\custom\50301_Hero\__init__.py.error.log

Line: -1 - Column: -1

 

Traceback (innermost last):

(no code object) at line 0

SyntaxError: ('invalid syntax', ('__init__.py', 35, 1, 'def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)'))

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Я ща делаю хиронпц на любое время для своей сборки выложу (насчёт этого нажми там таб и всё)

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Скрытый текст

import sys

from java.lang import Integer

from com.l2jfrozen.gameserver.model.quest import State

from com.l2jfrozen.gameserver.model.quest import QuestState

from com.l2jfrozen.gameserver.model.quest import Quest

from com.l2jfrozen.gameserver.datatables import SkillTable

from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

from com.l2jfrozen.util.database import L2DatabaseFactory

from com.l2jfrozen.gameserver.ai import CtrlIntention

from java.lang import System

 

###################

qn = "50301_Hero" #

NPC = 300300 #

###################

QuestDesc = "custom" # Папка хранения скрипта #

QuestName = "Hero" # Название квеста #

QuestId = 50301 # ID Квеста #

##############################################################

Item = 9401 # ID валюты #

Count = 1 # Цена на хиро за 1 день #

Count2 = 7 # Цена на хиро за 7 дней #

Count3 = 13 # Цена на хиро за 14 дней #

Count4 = 30 # Цена на хиро за месяц #

Count5 = 100 # Цена на хиро за год #

 

 

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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")

write.setString(1, obj_Id)

write.setString(2, char_name)

write.setInt(3, 1)

write.setInt(4, 1)

write.setInt(5, 0)

write.setLong(6, 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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")

write.setString(1, obj_Id)

write.setString(2, char_name)

write.setInt(3, 1)

write.setInt(4, 1)

write.setInt(5, 0)

write.setLong(6, 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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")

write.setString(1, obj_Id)

write.setString(2, char_name)

write.setInt(3, 1)

write.setInt(4, 1)

write.setInt(5, 0)

write.setLong(6, 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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")

write.setString(1, obj_Id)

write.setString(2, char_name)

write.setInt(3, 1)

write.setInt(4, 1)

write.setInt(5, 0)

write.setLong(6, 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 characters_custom_data (obj_Id,char_name,hero,noble,donator,hero_end_date) VALUES (?,?,?,?,?,?)")

write.setString(1, obj_Id)

write.setString(2, char_name)

write.setInt(3, 1)

write.setInt(4, 1)

write.setInt(5, 0)

write.setLong(6, 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)

Красным опять ошибка) Зачем делать чара героем ещё + нублом?

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
Красным опять ошибка) Зачем делать чара героем ещё + нублом?

Я что вам мего скриптер)

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты
iznviz можешь сделать норм скрипт робящий

Он в принципе рабочий) Просто если чар захочет стать херо а он без нубла, то помима херо он получит и статус нубла

Поделиться сообщением


Ссылка на сообщение
Поделиться на другие сайты

Для публикации сообщений создайте учётную запись или авторизуйтесь

Вы должны быть пользователем, чтобы оставить комментарий

Создать учетную запись

Зарегистрируйте новую учётную запись в нашем сообществе. Это очень просто!

Регистрация нового пользователя

Войти

Уже есть аккаунт? Войти в систему.

Войти
Авторизация  

  • Последние посетители   0 пользователей онлайн

    Ни одного зарегистрированного пользователя не просматривает данную страницу

×
×
  • Создать...