A Project for Chronicle 4 based on L2JServer.


    Three questions

    Share

    dragos73

    Posts : 14
    Join date : 2012-12-21

    Three questions

    Post  dragos73 on 21st December 2012, 16:46

    Hello guys , so i started using this pack and try lookin' out for bugs and etc.Let me tell about my questions:
    1.Is here any work plan or something about how the develop is going ?
    2.Does anyone has a clean c4 patch ?
    3.How do i load custom scripts on server. I put it on jscript added the code in the _init_.py but the server is not loading it nor erros.
    Thx
    avatar
    DnR
    Admin
    Admin

    Posts : 1027
    Join date : 2012-12-03

    Re: Three questions

    Post  DnR on 21st December 2012, 19:38

    dragos73 wrote:Hello guys , so i started using this pack and try lookin' out for bugs and etc.Let me tell about my questions:
    1.Is here any work plan or something about how the develop is going ?
    2.Does anyone has a clean c4 patch ?
    3.How do i load custom scripts on server. I put it on jscript added the code in the _init_.py but the server is not loading it nor erros.
    Thx

    Hello dragos73, thank you for letting me know about your questions.
    1. There is a straight answer here: http://l2jlisvus.great-forum.com/t16-question-work-plan
    At the moment, i' m working on Zone system, where many changes are going to be made.
    2. You can download a patch right here
    3. The most reasonable explanation is that the script is not loaded because the pack uses a specific outdated quest engine.
    However, you can upload your script here and let me try to adapt it.

    I hope i helped enough.

    dragos73

    Posts : 14
    Join date : 2012-12-21

    Re: Three questions

    Post  dragos73 on 24th December 2012, 14:53

    here it is , i tried but i dont get it . help me with this one if u want.
    Code:
    import sys
    from net.sf.l2j.gameserver.network.serverpackets import CreatureSay
    from java.lang import System
    from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance
    from net.sf.l2j.gameserver.model.base import Experience
    from net.sf.l2j.gameserver.model.quest        import State
    from net.sf.l2j.gameserver.model.quest        import QuestState
    from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest
    from java.util import Iterator
    from net.sf.l2j.gameserver.datatables import SkillTable
    from net.sf.l2j import L2DatabaseFactory
    from net.sf.l2j.gameserver.network.serverpackets import SetupGauge

    qn = "7105_Delevel"

    NPC=[71080]
    MEDAL = 57
    QuestId    = 7105
    QuestName  = "Delevel"
    QuestDesc  = "custom"
    InitialHtml = "1.htm"

    print "INFO Loaded: Delevel Manager"

    class Quest (JQuest) :

       def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)


       def onEvent(self,event,st):
          htmltext = event

          if  st.getPlayer().getLevel() < 41 :
             st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Ban khong du level!"))
          
          elif st.getQuestItemsCount(MEDAL) < 10000000 :   
                                 st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Ban khong co du adena !"))

          elif st.getPlayer().getKarma() > 0 :
             st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Diem karma cua ban qua cao!"))

          elif st.getPlayer().getPvpFlag() != 0 :
             st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Ban dang trong tinh trang chien dau!"))

          elif st.getPlayer().isAttackingNow() == True :
             st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Dont hit me, Plz!!!!"))

          elif st.getPlayer().getLevel() < 48 :
             SkillTable.getInstance().getInfo(1389,3).getEffects(st.getPlayer(),st.getPlayer())
             st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Ban  khong the su dung tiep tuc neu ban duoi cap 48"))

          else:
             st.getPlayer().setTarget(st.getPlayer())
             
             if event == "2":
                st.takeItems(MEDAL,10000000)
                                    st.getPlayer().getStat().removeExpAndSp((st.getPlayer().getExp() - Experience.LEVEL[st.getPlayer().getStat().getLevel() - 1]),0)
                st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 3, "Delevel Manager", "Ban da duoc giam di 1 level"))
                return "1.htm"
                st.setState(State.COMPLETED)
                st.exitQuest(1)
       
                
             if htmltext != event:
                st.setState(State.COMPLETED)
                st.exitQuest(1)
          return htmltext

       def onTalk (self,npc,player):
         st = player.getQuestState(qn)
         htmltext = "<html><head><body> I dont have anything to say .</body></html>"
         st.setState(State.STARTED)
         return InitialHtml

    QUEST      = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)

    for npcId in NPC:
     QUEST.addStartNpc(npcId)
     QUEST.addTalkId(npcId)
    Thank you and Merry Christmas
    avatar
    DnR
    Admin
    Admin

    Posts : 1027
    Join date : 2012-12-03

    Re: Three questions

    Post  DnR on 24th December 2012, 19:39

    I did some very small changes.
    Please test it and let me know.
    Merry christmas Smile

    Code:
    import sys
    from net.sf.l2j.gameserver.serverpackets import CreatureSay
    from java.lang import System
    from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance
    from net.sf.l2j.gameserver.model.base import Experience
    from net.sf.l2j.gameserver.model.quest        import State
    from net.sf.l2j.gameserver.model.quest        import QuestState
    from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest
    from java.util import Iterator
    from net.sf.l2j.gameserver.datatables import SkillTable
    from net.sf.l2j import L2DatabaseFactory
    from net.sf.l2j.gameserver.serverpackets import SetupGauge

    qn = "7105_Delevel"

    NPC=[71080]
    MEDAL = 57
    QuestId = 7105
    QuestName = "Delevel"
    QuestDesc = "custom"
    InitialHtml = "1.htm"

    print "INFO Loaded: Delevel Manager"

    class Quest (JQuest):

      def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)


      def onEvent(self,event,st):
          htmltext = event

          if st.getPlayer().getLevel() < 41 :
            st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Ban khong du level!"))

          elif st.getQuestItemsCount(MEDAL) < 10000000 : 

            st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Ban khong co du adena !"))

          elif st.getPlayer().getKarma() > 0 :
            st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Diem karma cua ban qua cao!"))

          elif st.getPlayer().getPvpFlag() != 0 :
            st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Ban dang trong tinh trang chien dau!"))
          elif st.getPlayer().isAttackingNow() == True :
            st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Dont hit me, Plz!!!!"))
          elif st.getPlayer().getLevel() < 48 :
            SkillTable.getInstance().getInfo(1389,3).getEffects(st.getPlayer(),st.getPlayer())
            st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 2, "Delevel Manager", "Ban  khong the su dung tiep tuc neu ban duoi cap 48"))
          else:
            st.getPlayer().setTarget(st.getPlayer())


            if event == "2":
                st.takeItems(MEDAL,10000000)
                st.getPlayer().getStat().removeExpAndSp((st.getPlayer().getExp() - Experience.LEVEL[st.getPlayer().getStat().getLevel() - 1]),0)
                st.getPlayer().sendPacket(CreatureSay(st.getPlayer().getObjectId(), 3, "Delevel Manager", "Ban da duoc giam di 1 level"))
                return "1.htm"
                st.setState(COMPLETED)
                st.exitQuest(1)



            if htmltext != event:
                st.setState(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.setState(STARTED)
          return InitialHtml

    QUEST = Quest(QuestId,str(QuestId) + "_" + QuestName,QuestDesc)
    CREATED = State('Start', QUEST)

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

    dragos73

    Posts : 14
    Join date : 2012-12-21

    Re: Three questions

    Post  dragos73 on 24th December 2012, 19:44

    yep it worked. thx

    dragos73

    Posts : 14
    Join date : 2012-12-21

    Re: Three questions

    Post  dragos73 on 25th December 2012, 19:40

    sorry for disturbing. but i dont get it how should i add a custom script. I set it in custom folder >changed the imports>add it in __init__ .py but the server dosen't load it, i tried chaning to quest state but is isn't workin' idk maybe i do somth wrong. Thx
    avatar
    DnR
    Admin
    Admin

    Posts : 1027
    Join date : 2012-12-03

    Re: Three questions

    Post  DnR on 26th December 2012, 15:39

    dragos73 wrote:sorry for disturbing. but i dont get it how should i add a custom script. I set it in custom folder >changed the imports>add it in __init__ .py but the server dosen't load it, i tried chaning to quest state but is isn't workin' idk maybe i do somth wrong. Thx

    Well, let me point out two differences between your old script and the fixed one.
    First of all, onTalk and addTalkId methods are different in our files.

    How it is in your script:

    def onTalk (self,npc,player):
    st = player.getQuestState(qn)


    How it has to be:

    def onTalk (self,npc,st):

    There is no need for st = player.getQuestState(qn) as it' s given by def onTalk
    Here is the second method i' m talking about:
    Code:

    +CREATED = State('Start', QUEST)

    for npcId in NPC:
     QUEST.addStartNpc(npcId)
    -QUEST.addTalkId(npcId)
    +CREATED.addTalkId(npcId)
    Have a try, and please let me know.

    Sponsored content

    Re: Three questions

    Post  Sponsored content


      Current date/time is 19th November 2017, 03:06