A Project for Chronicle 4 based on L2JServer.


    Someone can help me to fix it?

    Share

    torsello

    Posts : 50
    Join date : 2015-08-18

    Someone can help me to fix it?

    Post  torsello on 21st September 2015, 07:29

    Hi friends, well yesterday DnR says me , that some custom scripts can crash anothers scripts, i have a problem with this script, that crash my noblesse teleport. My script give nobless to chars. Someone can help me to check the code for any problem?

    Thanks of all!

    Code:
    import sys
    from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance
    from java.util import Iterator
    from net.sf.l2j.gameserver.datatables import SkillTable
    from net.sf.l2j               import L2DatabaseFactory
    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.actor.appearance import PcAppearance
    from net.sf.l2j.gameserver.model.quest import QuestState
    from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest

    qn = "1998_NpcNoblesse"

    NPC=[99999]
    GOLDBAR= 3470
    NOBLESS_TIARA = 7694
    QuestId    = 1998
    QuestName  = "NpcNoblesse"
    QuestDesc  = "custom"
    InitialHtml = "1.htm"

    print "L2Cry INFO Loaded: Noblesse Manager"

    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(GOLDBAR)
          if count < 100  and st.getPlayer().getLevel() < 78 :
             htmltext = "Error2.htm"

          elif st.getPlayer().isNoble() == 1 :
             htmltext = "Error1.htm"
          
          elif st.getQuestItemsCount(GOLDBAR) < 100 :   
                            htmltext = "Error2.htm"

          elif st.getPlayer().getLevel() < 78 :
             htmltext = "Error2.htm"

          else:
             st.getPlayer().setTarget(st.getPlayer())
             
             if event == "2":
                st.takeItems(GOLDBAR,100)
                                    st.getPlayer().setNoble(True)
                                    st.giveItems(NOBLESS_TIARA,1)
                                    st.playSound("ItemSound.quest_finish")
                st.setState(COMPLETED)
                return "End.htm"
                                    st.exitQuest(1)   
       
                
             if htmltext != event:
                st.setState(COMPLETED)
                st.exitQuest(1)
          return htmltext


       def onTalk (self,npc,st):
         htmltext = "<html><head><body>No tengo nada para decirte</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.setInitialState(CREATED)

    for npcId in NPC:
     QUEST.addStartNpc(npcId)
     QUEST.addTalkId(npcId)

      Current date/time is 19th November 2017, 18:09