import sys
from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance
from net.sf.l2j.gameserver.model.actor.appearance import PcAppearance
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 = "7800_Namecolor"
NPC=[7802]
QuestId = 7800
QuestName = "Namecolor"
QuestDesc = "custom"
InitialHtml = "1.htm"
print "Loaded Custom: 7001 Namecolor"
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent(self,event,st) :
htmltext = event
if event == "1":
if st.getQuestItemsCount(57) > 250000:
st.takeItems(57,250000)
st.getPlayer().getAppearance().setNameColor(0x009900)
st.getPlayer().broadcastUserInfo();
return "1.htm"
if st.getQuestItemsCount(57) <= 250000:
return "Announcements: No Enought Adena To Select Color!"
st.exitQuest(0)
if event == "2":
if st.getQuestItemsCount(57) > 250000:
st.takeItems(57,250000)
st.getPlayer().getAppearance().setNameColor(0xff7f00)
st.getPlayer().broadcastUserInfo();
return "1.htm"
if st.getQuestItemsCount(57) <= 250000:
return "Announcements: No Enought Adena To Select Color!"
if event == "3":
if st.getQuestItemsCount(57) > 250000:
st.takeItems(57,250000)
st.getPlayer().getAppearance().setNameColor(0xff00ff)
st.getPlayer().broadcastUserInfo();
return "1.htm"
if st.getQuestItemsCount(57) <= 250000:
return "Announcements: No Enought Adena To Select Color!"
if event == "4":
if st.getQuestItemsCount(57) > 250000:
st.takeItems(57,250000)
st.getPlayer().getAppearance().setNameColor(0x00ffff)
st.getPlayer().broadcastUserInfo();
return "1.htm"
if st.getQuestItemsCount(57) <= 250000:
return "Announcements: No Enought Adena To Select Color!"
if event == "5":
if st.getQuestItemsCount(57) > 250000:
st.takeItems(57,250000)
st.getPlayer().getAppearance().setNameColor(0x0000ff)
st.getPlayer().broadcastUserInfo();
return "1.htm"
if st.getQuestItemsCount(57) <= 250000:
return "Announcements: No Enought Adena To Select Color!"
if event == "6":
if st.getQuestItemsCount(57) > 250000:
st.takeItems(57,250000)
st.getPlayer().getAppearance().setNameColor(0x0099ff)
st.getPlayer().broadcastUserInfo();
return "1.htm"
if st.getQuestItemsCount(57) <= 250000:
return "Announcements: No Enought Adena To Select Color!"
if event == "7":
if st.getQuestItemsCount(57) > 250000:
st.takeItems(57,250000)
st.getPlayer().getAppearance().setNameColor(0x70db93)
st.getPlayer().broadcastUserInfo();
return "1.htm"
if st.getQuestItemsCount(57) <= 250000:
return "Announcements: No Enought Adena To Select Color!"
if event == "8":
if st.getQuestItemsCount(57) > 250000:
st.takeItems(57,250000)
st.getPlayer().getAppearance().setNameColor(0x9f9f9f)
st.getPlayer().broadcastUserInfo();
return "1.htm"
if st.getQuestItemsCount(57) <= 250000:
return "Announcements: No Enought Adena To Select Color!"
if event == "9":
if st.getQuestItemsCount(57) > 250000:
st.takeItems(57,250000)
st.getPlayer().getAppearance().setNameColor(0xffff00)
st.getPlayer().broadcastUserInfo();
return "1.htm"
if st.getQuestItemsCount(57) <= 250000:
return "Announcements: No Enought Adena To Select Color!"
def onTalk (self,npc,player):
st = player.getQuestState(qn)
htmltext = "<html><head><body><center>Nao tenho nada para dizer agora.</center></body></html>"
st.setState(STARTED)
return InitialHtml
QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)
CREATED=State('Start',QUEST)
STARTED=State('Started',QUEST)
COMPLETED=State('Completed',QUEST)
QUEST.setInitialSt ate(CREATED)
for npcId in NPC:
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)