Aller au contenu

Photo

Need Help With Custom Module Death Script


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
MokahTGS

MokahTGS
  • Members
  • 946 messages
I'm having issue with a custom death script for my Jabberwocky module.  The script is working perfectly for a player with only one member in their party.  The script is not working for a player if they have a party, which is the goal for the module.  I'd like to support an adventure party of 5 for the module, but when one member of the party dies the death script fires and the module hangs/crashes.

Basically I need to adjust things so that the custom script doesn't fire until the entire party is wiped out.  Can someone help me with this?  The below script was originally written for me by QK.  Here's the script in question.

Modifié par MokahTGS, 02 octobre 2010 - 10:50 .


#2
rjshae

rjshae
  • Members
  • 4 491 messages
Not sure if this will help any, but I'd move the first call to GetFirstEffect(oPlayer) until after the two ApplyEffectToObject calls. You might also check for Petrify.

#3
Shallina

Shallina
  • Members
  • 1 011 messages
you need to use a loop with GetNextFactioMember and check if they are all dead inside your on death script.



And fire your death event only if they are all dead. (GetIsDead function)



The on death script fire when a member of the party dies.

int allDead=1;

object oMember =GetFirstFactionMember();

While (GetisObjectValid(oMember)){

if (!GetIsDead(oMember,TRUE)) { //check for true or false for what you need

allDead = 0;

}

oMember = GetNextfactionMember();

}

if (allDead == 1) {

// here your death event



}



Something like that, but you can do something better if you take the other approach