Jump to content

sakisd

Members
  • Posts

    187
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by sakisd

  1. I just fastchecked, but most probably your npc is null at a line. Be sure all events "camera" refer to a real, existing object.

     

    As you cancel the timer "start" inside "start", most probably references are lost time the next event is fired. All in one, as an event, it's idiot to cancel yourself (cancel got a meaning when regular behavior must be aborted, otherwise nope). And "grandmaster" cancels "round4" which isn't existing.

     

    Following variables got no uses, you can simply check via npcId (since you already store the npcId and don't use the variables to despawn NPCs).

      self.vlc = []
       self.ptr = []
       self.trx = []
       self.slrn = []

    "vkrovatku" timer use is probably wrong, until you want your boss to be killed before a specific time (and even if it's the case, there is no cancel of that timer anywhere except by itself - see my second paragraph -, so it will be fired anyway).

    problem solved thank for your help mate, someone close topic

  2. Hi all !
    i have a problem i was trying to make a custom quest  i want a npc teleport to a raidboss ,when char is there i want to spawn 4 bosses 1 by one with cinematic ,so i copied and adapt sailren .py but i have a problem that i cant understand.i am getting error at line 48 "getObjectId"  the python code is below.i use l2jfrozen.

    import sys
    from com.l2jfrozen.gameserver.ai import CtrlIntention
    from com.l2jfrozen.gameserver.managers import GrandBossManager
    from com.l2jfrozen.gameserver.model.actor.position import L2CharPosition
    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
    from com.l2jfrozen.gameserver.network.serverpackets import SocialAction
    from com.l2jfrozen.gameserver.network.serverpackets import SpecialCamera
    from com.l2jfrozen.util.random import Rnd
    from java.lang import System
    
    STATUE = 50000
    SAILREN = 35646
    VELO = 35647
    PTERO = 90000
    TREX = 35648
    
    STONE = 6673
    
    class Grandmaster (JQuest) :
    
     def __init__(self,id,name,descr):
       self.vlc = []
       self.ptr = []
       self.trx = []
       self.slrn = []
       JQuest.__init__(self,id,name,descr)
    
     def onAdvEvent (self,event,npc,player):
       if event == "start" :
         self.vlc = self.addSpawn(VELO,96452,159940,-3275,45000,False,0)
         self.startQuestTimer("camera",2000, self.vlc, player)
         self.cancelQuestTimer("start",npc,None)
       if event == "round2" :
         self.ptr = self.addSpawn(PTERO,96409,160011,-3261,45000,False,0)
         self.startQuestTimer("camera",2000, self.ptr, player)
         self.cancelQuestTimer("round2",npc,None)
       if event == "round3" :
         self.trx = self.addSpawn(TREX,96500,159998,-3275,45000,False,0)
         self.startQuestTimer("camera",2000, self.trx, player)
         self.cancelQuestTimer("round3",npc,None)
       if event == "grandmaster" :
         self.slrn = self.addSpawn(SAILREN,96403,160011,-3299,45000,False,0)
         self.startQuestTimer("camera",2000, self.slrn, player)
         self.startQuestTimer("vkrovatku",1200000, self.slrn, None)
         self.cancelQuestTimer("round4",npc,None)
       elif event == "camera" :
         player.broadcastPacket(SpecialCamera(npc.getObjectId(),400,-75,3,-150,5000))
         npc.broadcastPacket(SocialAction(npc.getObjectId(),1))
       elif event == "open" :
         self.deleteGlobalQuestVar("close")  
         self.cancelQuestTimer("open",npc,None)
       elif event == "vkrovatku" :
         npc.deleteMe()
         self.deleteGlobalQuestVar("close")
         self.cancelQuestTimer("open",npc,None)
         self.cancelQuestTimer("vkrovatku",npc,None)
       return
            
     def onTalk (self,npc,player):
       st = player.getQuestState("grandmaster")  
       npcId = npc.getNpcId()
       close = self.loadGlobalQuestVar("close")
       time = self.loadGlobalQuestVar("time")
       party = player.getParty()
       if npcId == STATUE :
         if st.getQuestItemsCount(STONE) >= 1 :
           if close == "" :
             if party:
               for player in party.getPartyMembers() :
                 st.takeItems(STONE,1)
                 self.saveGlobalQuestVar("close", "1")
                 zone = GrandBossManager.getInstance().getZone(97235,160539,-3312)
                 if zone:
                   zone.allowPlayerEntry(player, 3600)
                 player.teleToLocation(97235,160539,-3312)
                 self.startQuestTimer("start",30000,npc,player)
                 self.startQuestTimer("open",1800000,npc,None)
             else :
               return "<html><body><font color=LEVEL>Only with party...</font></body></html>"
           else :
             return "<html><body><font color=LEVEL>Some one else is inside...</font></body></html>"
         else :
           return "<html><body>You need quest item: <font color=LEVEL>Gazkh...</font></body></html>"
       return
    
     def onKill(self,npc,player,isPet):
       if npc == self.vlc :
         self.startQuestTimer("round2",30000,npc,player)
       if npc == self.ptr :
         self.startQuestTimer("round3",60000,npc,player)
       if npc == self.trx :
         self.startQuestTimer("grandmaster",180000,npc,player)
       if npc == self.slrn :
         self.deleteGlobalQuestVar("close")
         self.cancelQuestTimer("open",npc,None)
       return
    
    QUEST = Grandmaster(-1,"grandmaster","ai")
    CREATED = State('Start',QUEST)
    
    QUEST.setInitialState(CREATED)
    
    QUEST.addStartNpc(STATUE)
    QUEST.addTalkId(STATUE)
    QUEST.addKillId(VELO)
    QUEST.addKillId(PTERO)
    QUEST.addKillId(TREX)
    QUEST.addKillId(SAILREN)
    
    
    
    
  3. When you delete an object it is supposed to return something. Use that returned value wisely and you won't have problem.

     

    destroyItem() != null means the operation was successful, otherwise it means it couldn't be made (no items or incorrect items).

     

    Which means from all your checks, you simply need to destroy the item, if it returns something it was ok, else you can send message. The good stuff is you can make the operation and the check in same time.

     

    // Destroy item
    if (player.destroyItem(param, param param, ...) == null)
    {
          player.sendMessage("blabla or send a sysstring it's better");
          return;
    }
    
    // Regular code if object has been destroyed goes here.

     

    If Frozen hasn't such method, or method returns nothing, then I'm sorry for you and you have to use coinItem.getCount() for the number check then destroy the item from the method Frozen makes to destroy items (which I got no clue).

     

    Thanks!! for your help i fix it like this

     

      if (coinItem == null && player.getInventory().getItemByItemId(3481).getCount() <= 199)

     

    Problem solved someone lock it

  4. Hi mates I need some help

    I try my players when add a new sub village master take from them 200 coin's...i manage to do that: when a player have 0 coins the master work just i want but when player have at least 1 coin village master print "message incorrect item count" and he add the sub class here is the code any help will be appreciate..

     

                   if (Config.SUBCLASS_WITH_ITEM_AND_NO_QUEST)
                         {
                            L2ItemInstance coinItem = player.getInventory().getItemByItemId(3481);
                            if (coinItem == null)
                            {
                               player.sendMessage("Sorry you must give me \"200 Coin's\" for each subclass and you dont have.");
                               player.setLocked(false);
                          return;
                            }                     
                            if (allowAddition)
                            {
                               player.destroyItemByItemId("Quest", 3481, 200, this, true);
                            }
                         }

  5. Hello all i am trying to fix a Interlude server and is almost Rd i am useing l2j last interlude rev.but i have 1 problem

    can anyone help to find what cause this problem so i can fix it?

     

    java.lang.ClassCastException: net.sf.l2j.gameserver.model.L2ItemInstance cannot
    be cast to net.sf.l2j.gameserver.model.L2Character
            at net.sf.l2j.gameserver.model.L2Skill.getTargetList(L2Skill.java:1431)
            at net.sf.l2j.gameserver.model.L2Skill.getTargetList(L2Skill.java:2124)
            at net.sf.l2j.gameserver.model.L2Character.doCast(L2Character.java:1218)
    
            at net.sf.l2j.gameserver.model.L2Character$AIAccessor.doCast(L2Character
    .java:3158)
            at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance$AIAccessor.do
    Cast(L2PcInstance.java:290)
            at net.sf.l2j.gameserver.ai.L2PlayerAI.thinkCast(L2PlayerAI.java:231)
            at net.sf.l2j.gameserver.ai.L2PlayerAI.onEvtThink(L2PlayerAI.java:277)
            at net.sf.l2j.gameserver.ai.AbstractAI.notifyEvent(AbstractAI.java:350)
            at net.sf.l2j.gameserver.ai.AbstractAI.notifyEvent(AbstractAI.java:324)
            at net.sf.l2j.gameserver.ai.L2CharacterAI.onIntentionCast(L2CharacterAI.
    java:285)
            at net.sf.l2j.gameserver.ai.AbstractAI.setIntention(AbstractAI.java:278)
    
            at net.sf.l2j.gameserver.model.L2Character.useMagic(L2Character.java:158
    9)
            at net.sf.l2j.gameserver.model.actor.instance.L2PcInstance.useMagic(L2Pc
    Instance.java:7604)
            at net.sf.l2j.gameserver.model.L2Character$QueuedMagicUseTask.run(L2Char
    acter.java:1979)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source
    )
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)

     

    ty in advance

    sakisd

     

     

    ps: plz post only  if you know ty!

  6. code is working but i cant find  how a char activete and de activate it  i fix skillgrp and skillname-e like that :

    9010    1    3    7    -1    0    0.000000    0            icon.skill1262    0    0    0    0    -1    -1

    and

    9010    1    AntiBuff Shield    Protect you from over buff . This skill Protect you Be buff with out your will.    none    none

    i fix xml like that

    <skill id="9010" levels="1" name="AntiBuff-Shield">
    <set name="power" val="0.0"/>
    <set name="target" val="TARGET_SELF"/>
    <set name="skillType" val="CONT"/>
    <set name="operateType" val="OP_TOGGLE"/>
    <set name="castRange" val="-1"/>
    <set name="effectRange" val="-1"/>
     <for>
       <effect count="0x7fffffff" name="DeflectBuff" time="3" val="0"/>
     </for>
    </skill>
    

    i give to gm and to non gm char the skill but i cant see it in my skills :( so it is always active !!!!

    can anyone help, what i miss here????

     

     

    any way code is working ty !!!!

  7. Hello all i need my aio buffer dont join olympiad i try this :

     

    	    if (!noble.isAio())
    	{
    	noble.sendMessage("Aio are not allowed to participate to olympiad games.");
    	return false;
    	}

     

    but the result is only aio register in oly  :D

     

    plz can you give some ideas to fix it ?????

     

    Oppps soz gia ta aglkika mperdeutika :P

    Edit: 8elw oi aio buffer  tou server mou na min mpenoun oly dokimasa ton kodika apo panw alla katefera na mpenoun oi aio kai kanenas allos char :D

    exete kamia idea pws na to ftiaxw???

  8. hi all i need to put this in my intrlude server and i getting errors in armor.dat and itemname

     

    63000	Spell Books Of Midas		a,Two really powerfull books cursed with black magic.These are the books that Midas used to turn everyhting to gold.\0	-1	0	0						a,	0	0		a,	0	0	0	0	0	0	0	0	0	0	a,	1

     

    0	63000	1	1	6	1	0	LineageWeapons.apprentices_spellbook_m00_wp	LineageWeapons.apprentices_spellbook_m00_wp		book.midas	book.midas			0	0	0	0	0	1	1	0	book.weapon_apprentices_spellbook_i01	book.weapon_apprentices_spellbook_i01	book.weapon_apprentices_spellbook_i01			-1	2080	47	1	0	0		1		7	3	2	LineageWeapons.apprentices_spellbook_m00_wp	LineageWeapons.apprentices_spellbook_m00_wp	1	1	2	book.midas	book.midas			4	ItemSound.public_sword_shing_8	ItemSound.sword_great_4	ItemSound.sword_mid_2	ItemSound.public_sword_shing_4	ItemSound.itemdrop_dualsword	ItemSound.itemequip_dualsword		10	342	132	8	5	8	0	0	0	0	325	0	1	1	1000	0	1	0	LineageEffect.e_u092_h	LineageEffect.e_u092_h	0.00000000	0.00000000	0.00000000	0.00000000	0.00000000	0.00000000	1.00000000	1.00000000	1.00000000	1.00000000	LineageWeapons.rangesample	LineageWeapons.rangesample	1.29999995	1.29999995	1.29999995	1.29999995	1.29999995	1.29999995	0.00000000	0.30000001	0.00000000	0.00000000	0.30000001	0.00000000	6	4	-1	-1				

     

     

     

    can any one help me to adapt it to interlude plz!!!?!?!?!

  9. kalispera prospa8w na fixarw 1 server interlude tis l2j alla exw 1 problem otan xekinaei o server kai fortonei to Q manager h consola mou dinei auto to error:

    Initializing QuestManager
    Exception :
    java.security.PrivilegedActionException: org.apache.bsf.BSFException: exception
    from Jython:
    Traceback (innermost last):
      File "<string>", line 1, in ?
    ImportError: no module named data
    
            at java.security.AccessController.doPrivileged(Native Method)
            at org.apache.bsf.BSFManager.exec(BSFManager.java:491)
            at net.sf.l2j.gameserver.model.quest.jython.QuestJython.init(QuestJython
    .java:48)
            at net.sf.l2j.gameserver.instancemanager.QuestManager.load(QuestManager.
    java:94)
            at net.sf.l2j.gameserver.instancemanager.QuestManager.getInstance(QuestM
    anager.java:42)
            at net.sf.l2j.gameserver.GameServer.<init>(GameServer.java:415)
            at net.sf.l2j.gameserver.GameServer.main(GameServer.java:688)
    Caused by: org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
      File "<string>", line 1, in ?
    ImportError: no module named data
    
            at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146
    )
            at org.apache.bsf.BSFManager$6.run(BSFManager.java:493)
            ... 7 more
    
    exception from Jython:
    Traceback (innermost last):
      File "<string>", line 1, in ?
    ImportError: no module named data
    : Traceback (innermost last):
      File "<string>", line 1, in ?
    ImportError: no module named data

    Opoios Gnwrizei kati as helparei ligo

    euxaristo!!!

     

×
×
  • Create New...