Jump to content
  • 0

Instance Open a door after kill 2 mobs.


Question

Posted

i have this code right now:

 

if npcId == SENTRY1 :
         if npc.getInstanceId() in self.worlds:
            world = self.worlds[npc.getInstanceId()]
            for partyMember in party.getPartyMembers().toArray():
               st1 = partyMember.getQuestState("Bloodshedparty")
               if not st1:
                  st1 = self.newQuestState(partyMember)
               st1.playSound("ItemSound.quest_middle")
               partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Beginners luck..."))
            st.giveItems(E_APIGA,1)

      elif npcId == SENTRY2 :
         if npc.getInstanceId() in self.worlds:
            world = self.worlds[npc.getInstanceId()]
            for partyMember in party.getPartyMembers().toArray():
               st1 = partyMember.getQuestState("Bloodshedparty")
               if not st1:
                  st1 = self.newQuestState(partyMember)
               st1.playSound("ItemSound.quest_middle")
               partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "I'll get you next time, Noob!!"))
            st.giveItems(E_APIGA,1)

            openDoor(DOOR1,npc.instanceId)
            openDoor(DOOR2,npc.instanceId)

 

This is the first room of 3 in the instance so the players are ported there and fight vs 2 mobs.

 

Right now the players can kill Sentry 2 first and the Door will open, i wanna the players need kill the 2 MOBS and later of this the door get opened. thx.

2 answers to this question

Recommended Posts

  • 0
Posted

if npcId == SENTRY1 :
         if npc.getInstanceId() in self.worlds:
            world = self.worlds[npc.getInstanceId()]
            for partyMember in party.getPartyMembers().toArray():
               st1 = partyMember.getQuestState("Bloodshedparty")
               if not st1:
                  st1 = self.newQuestState(partyMember)
               st1.playSound("ItemSound.quest_middle")
               partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Beginners luck..."))
            st.giveItems(E_APIGA,1)

      elif npcId == SENTRY2 :
         if npc.getInstanceId() in self.worlds:
            world = self.worlds[npc.getInstanceId()]
            for partyMember in party.getPartyMembers().toArray():
               st1 = partyMember.getQuestState("Bloodshedparty")
               if not st1:
                  st1 = self.newQuestState(partyMember)
               st1.playSound("ItemSound.quest_middle")
               partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "I'll get you next time, Noob!!"))
            st.giveItems(E_APIGA,1)

            openDoor(DOOR1,npc.instanceId)
            openDoor(DOOR2,npc.instanceId)

 

Man's written on your face if you want that only when he killed 2 mobs and the doors open so leave it alone.

more if he wants to kill a mob and a door opens so well put,

 

if npcId == SENTRY1 :
         if npc.getInstanceId() in self.worlds:
            world = self.worlds[npc.getInstanceId()]
            for partyMember in party.getPartyMembers().toArray():
               st1 = partyMember.getQuestState("Bloodshedparty")
               if not st1:
                  st1 = self.newQuestState(partyMember)
               st1.playSound("ItemSound.quest_middle")
               partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Beginners luck..."))
            st.giveItems(E_APIGA,1)

               openDoor(DOOR1,npc.instanceId)

      elif npcId == SENTRY2 :
         if npc.getInstanceId() in self.worlds:
            world = self.worlds[npc.getInstanceId()]
            for partyMember in party.getPartyMembers().toArray():
               st1 = partyMember.getQuestState("Bloodshedparty")
               if not st1:
                  st1 = self.newQuestState(partyMember)
               st1.playSound("ItemSound.quest_middle")
               partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "I'll get you next time, Noob!!"))
            st.giveItems(E_APIGA,1)

            
            openDoor(DOOR2,npc.instanceId)

  • 0
Posted

if npcId == SENTRY1 :
        if npc.getInstanceId() in self.worlds:
           world = self.worlds[npc.getInstanceId()]
           for partyMember in party.getPartyMembers().toArray():
              st1 = partyMember.getQuestState("Bloodshedparty")
              if not st1:
                 st1 = self.newQuestState(partyMember)
              st1.playSound("ItemSound.quest_middle")
              partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Beginners luck..."))
           st.giveItems(E_APIGA,1)

     elif npcId == SENTRY2 :
        if npc.getInstanceId() in self.worlds:
           world = self.worlds[npc.getInstanceId()]
           for partyMember in party.getPartyMembers().toArray():
              st1 = partyMember.getQuestState("Bloodshedparty")
              if not st1:
                 st1 = self.newQuestState(partyMember)
              st1.playSound("ItemSound.quest_middle")
              partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "I'll get you next time, Noob!!"))
           st.giveItems(E_APIGA,1)

           openDoor(DOOR1,npc.instanceId)
           openDoor(DOOR2,npc.instanceId)

 

Man's written on your face if you want that only when he killed 2 mobs and the doors open so leave it alone.

more if he wants to kill a mob and a door opens so well put,

 

if npcId == SENTRY1 :
        if npc.getInstanceId() in self.worlds:
           world = self.worlds[npc.getInstanceId()]
           for partyMember in party.getPartyMembers().toArray():
              st1 = partyMember.getQuestState("Bloodshedparty")
              if not st1:
                 st1 = self.newQuestState(partyMember)
              st1.playSound("ItemSound.quest_middle")
              partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Beginners luck..."))
           st.giveItems(E_APIGA,1)

              openDoor(DOOR1,npc.instanceId)

     elif npcId == SENTRY2 :
        if npc.getInstanceId() in self.worlds:
           world = self.worlds[npc.getInstanceId()]
           for partyMember in party.getPartyMembers().toArray():
              st1 = partyMember.getQuestState("Bloodshedparty")
              if not st1:
                 st1 = self.newQuestState(partyMember)
              st1.playSound("ItemSound.quest_middle")
              partyMember.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "I'll get you next time, Noob!!"))
           st.giveItems(E_APIGA,1)

           
           openDoor(DOOR2,npc.instanceId)

 

Man if leave it like i write in my post, the Player can kill first the Sentry 2 and the door will be opened in the second way is like kill SENTRY1  - OPEN DOOR1 / KILL SENTRY 2 OPEN DOOR 2

 

What i need is the doors ONLY OPEN WHEN THE 2 SENTRY'S are dead.

 

openDoor(DOOR1,npc.instanceId)

openDoor(DOOR2,npc.instanceId)

 

If i put this after the Sentry 2 code so he only need kill Sentry 2 and the DOORS will be opened.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...