Persidarinejau nobless manageri failus ir pagrindinem persidarinejau kokio item reikia kad pasimti nobless tai pasidariau kad jei nori nobless reikia tureti 15 fa irasiau viskas normaliai pasileido be erroru bet paciam zaidime jei turi 15fa ten su 2sub viskas tvarkoj ir imi nobless raso kad arba neturi subo arba 15fa bet jeigu turi 16fa tada gali pasiimti nobless ir ir issminusuoja tik 15 fa ir 1 lieka imetu koda kaip perdarytas gal pats ka praleidau jus uzmatysite naudinga bet kokia pagalba :)
import sys
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
from com.l2jfrozen.gameserver.model.actor.instance import L2NpcInstance
from java.util import Iterator
from com.l2jfrozen.util.database import L2DatabaseFactory
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest
qn = "6666_NoblessTrader"
NPC = [31434]
NOBLESS_TIARA = 7694
FESTIVAL_ADENA = 6673
QuestId = 6666
QuestName = "NoblessTrade"
QuestDesc = "custom"
InitialHtml = "31739-1.htm"
print "Nobless Trader (31434) Enabled..."
class Quest (JQuest) :
def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)
def onEvent(self,event,st):
htmltext = "I have nothing to say you"
cond = st.getInt("cond")
count=st.getQuestItemsCount(FESTIVAL_ADENA)
if event == "31739-3.htm" :
if cond == 0 and st.getPlayer().isSubClassActive() :
if st.getPlayer().getLevel() >= 80 and count > 15:
htmltext=event
st.set("cond","0")
st.getPlayer().setNoble(True)
st.giveItems(NOBLESS_TIARA,1)
st.playSound("ItemSound.quest_finish")
st.setState(COMPLETED)
st.takeItems(FESTIVAL_ADENA,15)
else :
htmltext="31739-2.htm"
st.exitQuest(1)
else :
htmltext="31739-2.htm"
st.exitQuest(1)
return htmltext
def onTalk (self,npc,player):
htmltext = "I have nothing to say you"
st = player.getQuestState(qn)
if not st : return htmltext
npcId = npc.getNpcId()
id = st.getState()
if id == CREATED :
st.set("cond","0")
htmltext="31739-1.htm"
elif id == COMPLETED :
htmltext = "This quest have already been completed."
else :
st.exitQuest(1)
return htmltext
QUEST = Quest(6666,qn,"custom")
CREATED = State('Start', QUEST)
STARTING = State('Starting', QUEST)
STARTED = State('Started', QUEST)
COMPLETED = State('Completed', QUEST)
QUEST.setInitialState(CREATED)
for npcId in NPC:
QUEST.addStartNpc(npcId)
QUEST.addTalkId(npcId)