Author Sticky: Post Working Scripts Here
Allroy Posted: Thursday, 25 July 07:38AM
Persistant world Boss spawner.

What it does:
In my module I have a Trigger spawn the bosses. If a party has killed the boss I don't want him to respawn if they cross that trigger. However, if there is a new party comes into the world later I want the trigger to spawn the boss. In order to do this the boss needs to set a flag on the PC who killed them along with his party.

In order to use this script you must uncomment the death event in the generic "onspawn" file of the npc. Then put this in the NPC's on user defined script area.

NWScript:
// Boss Spawner for Party by Chris Wilson AKA Allroy

void main()

{

    int nUser = GetUserDefinedEventNumber();

    switch (nUser)

    {

    case 1007: // on death

    object oPC = GetFirstFactionMember(GetLastKiller(),TRUE); // declair oPC to be the first member of the killers party

// cycle through party and set flag

    while (GetIsObjectValid(oPC) == TRUE)

       {

    SetLocalInt(oPC,  "KILLEDBOSS", 1);

    oPC = GetNextFactionMember(oPC,TRUE);

       }

   // ExecuteScript("LOOTDROPS",OBJECT_SELF); Optional random loot table drops file.

    break;

    }

    return;

}



Any questions/comments send me a message

Hope some of you use it.

_________________
I don't hold a grudge. I have no surviving enemies... at all.

- Galen