Jump to content
  • 0

[HELP]EVENT Bloodshedparty GIVE ITEMS ALL PLAYERS IN PT


Question

Posted

HELLO, I wanted to know how to put reward for all players who are in a party, as below so that's the reward for the player who has the last hit on Monster.

 

# ================================================================

# EDITED AND RECONFIGURED BY LOL

# ================================================================

#Instance Event by Bloodshed Party

from br.xtreme.gameserver.instancemanager        import InstanceManager

from br.xtreme.gameserver.model                  import L2ItemInstance

from br.xtreme.gameserver.model.actor            import L2Summon

from br.xtreme.gameserver.model.entity          import Instance

from br.xtreme.gameserver.model.itemcontainer    import PcInventory

from br.xtreme.gameserver.model.quest            import State

from br.xtreme.gameserver.model.quest            import QuestState

from br.xtreme.gameserver.model.quest.jython    import QuestJython as JQuest

from br.xtreme.gameserver.network.serverpackets  import CreatureSay

from br.xtreme.gameserver.network.clientpackets  import Say2;

from br.xtreme.gameserver.network.serverpackets  import SystemMessage;

from br.xtreme.gameserver.network.serverpackets  import InventoryUpdate

from br.xtreme.gameserver.network.serverpackets  import MagicSkillUse

from br.xtreme.gameserver.network.serverpackets  import SystemMessage

from br.xtreme.gameserver.network.serverpackets  import ExShowScreenMessage

from br.xtreme.gameserver.network.serverpackets  import Earthquake

from br.xtreme.gameserver.network                import SystemMessageId

from br.xtreme.gameserver.util                  import Util

from br.xtreme.util                              import Rnd

from br.xtreme.gameserver                        import Announcements

qn = "Bloodshedparty"

 

print "-----------------------------------"

print "Bloodshedparty - EVENTO "

print "-----------------------------------"

 

#Items

E_APIGA = 9143

ADENA = 9143

STONE = 9143

STONE82 = 10486

STONE84 = 14169

SCROLL = 9143

SCROLLB = 6577

GOLDDRAGON = 3481

 

#NPCs

ROSE = 2009001

CHEST = 2010010

 

#FIRST CHAMBER MOBS

GUARD = 2010001

KEYKEEPER = 2010013

PROTECTOR = 2010005

 

BELETH = 2010007

BAYLOR = 2010008

TIAT = 2010009

 

#Doors

DOOR = 20240001

class PyObject:

pass

 

def openDoor(doorId,instanceId):

for door in InstanceManager.getInstance().getInstance(instanceId).getDoors():

if door.getDoorId() == doorId:

door.openMe()

 

def closeDoor(doorId,instanceId):

for door in InstanceManager.getInstance().getInstance(instanceId).getDoors():

if door.getDoorId() == doorId:

door.closeMe()

 

def checkConditions(player, new):

party = player.getParty()

if not party:

player.sendPacket(ExShowScreenMessage("Voce nao esta em party e nao pode entrar.", 8000))

return False

if party and party.getMemberCount() < 6:

player.sendPacket(ExShowScreenMessage("Voce precisa de no minimo 6 pessoas na party para poder entrar.", 8000))

return False

for partyMember in party.getPartyMembers().toArray():

if partyMember.getLevel() < 78:

player.sendPacket(SystemMessage.sendString(partyMember.getName()+"s o Level minimo para entrar e 83."))

return False

if not Util.checkIfInRange(1000, player, partyMember, True) and new:

player.sendPacket(SystemMessage.sendString(partyMember.getName()+" Voce esta muito longe do seu lider. Chegue mais perto."))

return False

return True

 

def teleportplayer(self,player,teleto):

player.setInstanceId(teleto.instanceId)

player.teleToLocation(teleto.x, teleto.y, teleto.z)

pet = player.getPet()

if pet != None :

pet.setInstanceId(teleto.instanceId)

pet.teleToLocation(teleto.x, teleto.y, teleto.z)

return

 

def enterInstance(self,player,template,teleto):

instanceId = 0

party = player.getParty()

if party :

for partyMember in party.getPartyMembers().toArray():

st = partyMember.getQuestState(qn)

if not st : st = self.newQuestState(partyMember)

if partyMember.getInstanceId()!=0:

instanceId = partyMember.getInstanceId()

else :

if player.getInstanceId()!=0:

instanceId = player.getInstanceId()

if instanceId != 0:

if not checkConditions(player,False):

return 0

foundworld = False

for worldid in self.world_ids:

if worldid == instanceId:

foundworld = True

if not foundworld:

player.sendPacket(SystemMessage.sendString("Você entrou uma outra zona, portanto, você não pode entrar nesta"))

return 0

teleto.instanceId = instanceId

teleportplayer(self,player,teleto)

return instanceId

else:

if not checkConditions(player,True):

return 0

instanceId = InstanceManager.getInstance().createDynamicInstance(template)

if not instanceId in self.world_ids:

world = PyObject()

world.rewarded=[]

world.instanceId = instanceId

self.worlds[instanceId]=world

self.world_ids.append(instanceId)

print "Instance: Started " + template + " Instance: " +str(instanceId) + " created by " + str(player.getName())

teleto.instanceId = instanceId

for partyMember in party.getPartyMembers().toArray():

teleportplayer(self,partyMember,teleto)

return instanceId

return instanceId

 

def exitInstance(player,tele):

party = player.getParty()

if party :

for partyMember in party.getPartyMembers().toArray():

partyMember.setInstanceId(0)

partyMember.teleToLocation(tele.x, tele.y, tele.z)

pet = partyMember.getPet()

if pet != None :

pet.setInstanceId(0)

pet.teleToLocation(tele.x, tele.y, tele.z)

else :

player.setInstanceId(0)

player.teleToLocation(tele.x, tele.y, tele.z)

pet = player.getPet()

if pet != None :

pet.setInstanceId(0)

pet.teleToLocation(tele.x, tele.y, tele.z)

InstanceManager.getInstance().destroyInstance(player.getInstanceId())

 

class Bloodshedparty(JQuest):

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

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

self.worlds = {}

self.world_ids = []

 

def onTalk (self,npc,player):

st = player.getQuestState(qn)

npcId = npc.getNpcId()

if npcId == ROSE :

tele = PyObject()

tele.x = 16345

tele.y = 209051

tele.z = -9357

enterInstance(self, player, "Bloodshedparty.xml", tele)

st.playSound("ItemSound.quest_middle")

elif npcId == CHEST :

npc.decayMe()

tele = PyObject()

tele.x = 82200

tele.y = 148347

tele.z = -3467

party = player.getParty()

if party :

for partyMember in party.getPartyMembers().toArray():

exitInstance(partyMember,tele)

else:

exitInstance(player,tele)

st.giveItems(STONE,1)

if Rnd.get(100) < 1 :

st.giveItems(SCROLL,1)

st.playSound("ItemSound.quest_finish")

player.sendPacket(ExShowScreenMessage("Este mundo foi destruído: Concluído", 8000))

player.sendPacket(ExShowScreenMessage("Baylor: Você tolos, Nós nos encontraremos em breve em seu mundo ..... Aha ha ha", 15000))

return

 

def onKill(self,npc,player,isPet):

st = player.getQuestState(qn)

npcId = npc.getNpcId()

if npcId == GUARD :

if npc.getInstanceId() in self.worlds:

world = self.worlds[npc.getInstanceId()]

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Mestre, perdoa-me! eu Falhei"))

#newNpc = self.addSpawn(int npcId,x,y,z,heading,randomOffset,despawnDelay,isSummonSpawn,instanceId)

newNpc = self.addSpawn(PROTECTOR,16658,211498,-9357,0,False,0,False,npc.instanceId)

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Seus tolos,Seu fim esta aqui"))

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Ooo...e um bom dia para morrer"))

openDoor(DOOR,npc.instanceId)

elif npcId == PROTECTOR :

if npc.getInstanceId() in self.worlds:

world = self.worlds[npc.getInstanceId()]

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Mestre, perdoa-me!!"))

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Eu falhei, me de outra chance para te proteger."))

player.sendPacket(ExShowScreenMessage("Tolos, aqui está o seu fim!!", 8000))

#newNpc = self.addSpawn(int npcId,x,y,z,heading,randomOffset,despawnDelay,isSummonSpawn,instanceId)

newNpc = self.addSpawn(BELETH,16344,213091,-9356,0,False,0,False,npc.instanceId)

player.sendPacket(Earthquake(16344,213091,-9356,20,5))

elif npcId == BELETH :

if npc.getInstanceId() in self.worlds:

world = self.worlds[npc.getInstanceId()]

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "OMG Meu Mundo....."))

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Baylor ME Ajuda!!"))

st.giveItems(STONE,1)

player.sendPacket(ExShowScreenMessage("Baylor:Meu Irmão , eu vou vingar você!", 12000))

#newNpc = self.addSpawn(int npcId,x,y,z,heading,randomOffset,despawnDelay,isSummonSpawn,instanceId)

newNpc = self.addSpawn(BAYLOR,16344,213091,-9356,0,False,0,False,npc.instanceId)

player.sendPacket(Earthquake(16344,213091,-9356,20,5))

elif npcId == BAYLOR :

if npc.getInstanceId() in self.worlds:

world = self.worlds[npc.getInstanceId()]

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Minha morte nao e nada, O fim de Vocês esta proximo"))

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Seus TOLOS ....Aha ha ha ha"))

st.giveItems(E_APIGA,1)

player.sendPacket(ExShowScreenMessage("..............MATE TODOS!..............", 8000))

#newNpc = self.addSpawn(int npcId,x,y,z,heading,randomOffset,despawnDelay,isSummonSpawn,instanceId)

newNpc = self.addSpawn(TIAT,16344,213091,-9356,0,False,0,False,npc.instanceId)

player.sendPacket(Earthquake(16344,213091,-9356,80,5))

elif npcId == TIAT :

if npc.getInstanceId() in self.worlds:

world = self.worlds[npc.getInstanceId()]

player.sendPacket(CreatureSay(npc.getObjectId(), 0, npc.getName(), "Ugh.... DERROTADOOO.. COMOO!?"))

player.sendPacket(ExShowScreenMessage("Parabens! Voce Derrotou Demonic Lord.", 12000))

st.playSound("ItemSound.quest_finish")

st.giveItems(E_APIGA,1)

#newNpc = self.addSpawn(int npcId,x,y,z,heading,randomOffset,despawnDelay,isSummonSpawn,instanceId)

newNpc = self.addSpawn(CHEST,16225,213040,-9357,0,False,0,False,npc.instanceId)

return

 

QUEST = Bloodshedparty(-1, qn, "Bloodshedparty")

QUEST.addStartNpc(ROSE)

QUEST.addTalkId(ROSE)

QUEST.addTalkId(CHEST)

 

QUEST.addKillId(GUARD)

QUEST.addKillId(PROTECTOR)

QUEST.addKillId(BELETH)

QUEST.addKillId(BAYLOR)

QUEST.addKillId(TIAT)

7 answers to this question

Recommended Posts

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Greetings, MaxCheaters community! We are the development team behind projects like AdenLand, Classic GvE, TinyEssence, PvPEssence, and several others. Over the years of managing high-traffic servers, we’ve built our own ecosystem of tools for datapack and client editing, simply because standard software often failed to meet our production needs or was too slow. Today, we are opening access to these professional solutions for our colleagues in the dev scene. You can explore our suite of editors and utilities here: 👉 https://la2.tools/ Why choose our tools? Battle-Tested: This software is used daily to maintain and update our own live projects. Efficiency: Designed to automate routine tasks that usually take hours or even days. Stability: Built to handle complex client/server structures where generic tools often crash. We are ready to provide consultations on integrating these tools into your development workflow to make your process faster and more secure.  
    • There is such a topics based on java html services!
    • L2Elixir – Patch 9 Is Live! Since November 28, when L2Elixir officially opened, we’ve been here consistently and with dedication. We sincerely thank everyone who continues to support this major effort to bring back the true legacy of L2Elixir, even after 18+ years. It truly makes us happy to see many old players reunite, just like in the old days, and enjoy the game the way it was meant to be played: without RMT, without bug abusers, and without “paid” clans/CPs that disappear after a month. We continue with vision, stability, and respect for the community. Wishing everyone to Have fun! Changelogs: 🏆 Olympiad Olympiad every Monday & Friday (last day: Friday). Fixed an issue with wrong Class ID caused by the Class Change service. ⚔️ Territory Wars Territory Wars will now be held every Tuesday to increase PvP activity. 🛡️ Antibot General updates and additional security improvements implemented. 🔧 Items Augmentation & Attribute are now allowed on PvP weapons. Implemented Premium Coupon (15 Days) (currently not available). 🎉 Events An Auto Event will begin early morning (05:00) for NA players. 💻 Client Added EXP zones to the Map → Hunting Zones section. Renamed them to “XP Bonus” so they appear at the top of the list.   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
    • I haven't work in Essence but I have transformed mobius projects into fully stable projects, reach out to me in Discord @cerus0130
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..