Jump to content

IvanLabonia

Members
  • Posts

    113
  • Credits

  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by IvanLabonia

  1. Hi, i've got this event  "Raid Event" from Freya, which automatic respawns a random raid and then gives a reward.

     

    import math
    import sys
    from com.l2jserver.gameserver              import Announcements
    from com.l2jserver.util                    import Rnd
    from java.lang                      import System
    from com.l2jserver.gameserver.model.actor.appearance   import PcAppearance
    from com.l2jserver.gameserver              import GameTimeController
    from com.l2jserver.gameserver.model.quest          import State
    from com.l2jserver.gameserver.model.quest          import QuestState
    from com.l2jserver.gameserver.model.quest.jython       import QuestJython as JQuest
    from com.l2jserver.gameserver.model.actor.instance     import L2PcInstance
    from com.l2jserver.gameserver.model.actor.instance     import L2NpcInstance
     
     
    
    qn = "2002_EventRaid"
    QuestDesc   = "custom"
    
    Raids =  [ 22799,18792,18863 ] 
     
    
     
    #time between events in milliseconds
    eventInterval = 7200000  # 2 hours after the first event there is the second one and the others after are 2 hours too
    FirstStart = 60000  #1 minute after each restart there is the first event
     
     
    class Quest (JQuest):
     
        def __init__(self,id,name,descr):
            JQuest.__init__(self,id,name,descr)
            self.RaidBosses ={
                    0: {'name':"Gabriel" , 'id':22799},
                    1: {'name':"Draken" , 'id':18792},
                    2: {'name':"Ugoros" , 'id':18863},
                    }
            self.RbCoords ={
                    0: {'name':"in A Raid Zone" , 'X':115191 , 'Y':16607 , 'Z':10085},
                    1: {'name':"in A Raid Zone" , 'X':115191 , 'Y':16607 , 'Z':10085},
                    2: {'name':"in A Raid Zone" , 'X':115191 , 'Y':16607 , 'Z':10085},
                    }
            self.startQuestTimer("EventTrigger", FirstStart, None, None)
            self.RbSpawn = []
            self.rewards ={
                    0: {'prize':7609 , 'number':1}, 
                    }
            self.Event = []
     
     
        def onAdvEvent (self,event,npc,player):
            if event == "EventTrigger" :
                    self.Event = 1
                    #the spawn coords and which raidboss are both random and
                    #independant from each other
                    ra = int(Rnd.get(3))
                    rb = int(Rnd.get(3))
                    raidboss = self.RaidBosses[ra]['name']
                    location = self.RbCoords[rb]['name']
                    Announcements.getInstance().announceToAll(raidboss + " spawned " + location + " you have 30 minutes!")
                    self.RbSpawn = self.addSpawn(self.RaidBosses[ra]['id'],self.RbCoords[rb]['X'],self.RbCoords[rb]['Y'],self.RbCoords[rb]['Z'],0,False,0)
                    self.startQuestTimer("RbDespawn", 1800000, npc, player)                           
                             
            if event == "RbDespawn":
                self.RbSpawn.deleteMe()
                Announcements.getInstance().announceToAll("The Raid has survived!")
                self.startQuestTimer("EventTrigger", eventInterval, npc, player)
    
     
     
        def onKill (self,npc,player,isPet):
            npcId = npc.getNpcId()
            if npcId in Raids:
                Announcements.getInstance().announceToAll("RaidBoss event ended, the Raid has been killed, good job!")
                self.cancelQuestTimer("RbDespawn", None, None)
                self.startQuestTimer("EventTrigger", eventInterval, npc, player)
     
    # Quest class and state definition
    QUEST     = Quest(-1,qn,QuestDesc)
     
    for i in Raids:
        QUEST.addKillId(i)
     
     
    print "Event Manager loaded!!!"

     

     

    i need something like this for Interlude (Frozen) .. more specific, what i just need is the auto spawn/despawn of a certain NPC every xxxxx time with an announcement.

    Does somebody has this?

  2. 31 minutes ago, tazerman2 said:

    config/head/altsettings.properties
    # ---------------------------------------------- #
    #                      Npc                       #
    # ---------------------------------------------- #
    # Npc Attackable
    # True: You can attack Npcs
    # False: Npc/Mobs don't take damages
    NpcAttackable = True from False

     

    Ok, im blind. I saw that file like 3 times.. thanks

  3. I downloaded this files just to test some features and i saw this error.

     

    When attacking monsters.. with or without lvl difference, they take damage but their health bar wont go down.

    In other words they are unkillable. Also tryed //kill etc. Nothing works.

     

    Is it L2AttackableAI error? what should i do?

    Sin título.jpg

  4. I would like to see

     

    this is why i hate this post count policy, its full of spammers!

     

    well, on toppic.

    Never first of, thanks for share.

    second, i've a doubt, i created on my server a rotating custom pvp zones with teleports to them in 4 diffrent spawns.

    i would like to add this to my system. the question is this, when i create this new pvp zone, when i asign coords after the comand .res the player will spawn anywhere those coords? within the zone? or i sould hardcode different spawn cords?

     

    then: some not-so-but-in-a-way-noobish question.

     

    1) i cannot find any guide of how to create new zones, can anyone share a link or so?

    2) as for this code, i think it would be a nice addon an animation onKill, let us say, when a pvp is done or a pk, the player gets the skill animation of for eg shield fortress. i understand this part is not rocket cience, (but for me its not a peace of cake)

     

     

  5. hi, and what if..

     

    1) Deaths are not erased

    2) You add in your NPC PVP Ranker the deaths too

     

    so, in the NPC you ser..  "Xx_player_xX  1241 29 688  (PVP/PK/DEATHS)

     

    im a little to noobish to code that myself, but as you are more experienced, if you feel like doing it i will appreciate it very mutch.

  6. Hey I am trying to create a potion with 100%Resistance for Cancel skills

    here is my code but it doesnt work ..

     

            <skill id="2011" levels="1" name="Haste Potion">
                <set name="isMagic" val="1" /> <!-- Static Skill -->
                <set name="itemConsumeCount" val="1" />
                <set name="target" val="TARGET_SELF" />
                <set name="skillType" val="BUFF" />
                <set name="operateType" val="A2" />
                <set name="canBeDispeled" val="false" />
                <for>
                    <effect name="Buff" abnormalTime="1200" val="0" abnormalLvl="3" abnormalType="resist_debuff_dispel">
                        <sub order="0x40" stat="cancelVuln" val="100" />
                        <sub order="0x40" stat="debuffVuln" val="100" />
                    </effect>
                </for>
            </skill>

     

     

    why a potion and not the buff? or if u dont want to change the original buff.. master blessing?

×
×
  • Create New...