Initial Upload
Initial Upload
This commit is contained in:
53
_module/nss/escort_death.nss
Normal file
53
_module/nss/escort_death.nss
Normal file
@@ -0,0 +1,53 @@
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: NW_C2_DEFAULT7
|
||||
/*
|
||||
Default OnDeath event handler for NPCs.
|
||||
|
||||
Adjusts killer's alignment if appropriate and
|
||||
alerts allies to our death.
|
||||
*/
|
||||
//:://////////////////////////////////////////////////
|
||||
//:: Copyright (c) 2002 Floodgate Entertainment
|
||||
//:: Created By: Naomi Novik
|
||||
//:: Created On: 12/22/2002
|
||||
//:://////////////////////////////////////////////////
|
||||
|
||||
#include "x0_i0_spawncond"
|
||||
|
||||
void main()
|
||||
{ ///////////////////////////
|
||||
object oPC = GetObjectByTag("zzzzz");
|
||||
object oNPC = (OBJECT_SELF);
|
||||
SetLocalObject (oNPC, "Follow", oPC );
|
||||
AssignCommand(oNPC,ClearAllActions());
|
||||
|
||||
SetLocalInt(OBJECT_SELF, "busy", 0);
|
||||
|
||||
/////////////////////////////////
|
||||
int nClass = GetLevelByClass(CLASS_TYPE_COMMONER);
|
||||
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
|
||||
|
||||
// If we're a good/neutral commoner,
|
||||
// adjust the killer's alignment evil
|
||||
if(nClass > 0 && (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL))
|
||||
{
|
||||
object oKiller = GetLastKiller();
|
||||
AdjustAlignment(oKiller, ALIGNMENT_EVIL, 5);
|
||||
}
|
||||
|
||||
// Call to allies to let them know we're dead
|
||||
SpeakString("NW_I_AM_DEAD", TALKVOLUME_SILENT_TALK);
|
||||
|
||||
//Shout Attack my target, only works with the On Spawn In setup
|
||||
SpeakString("NW_ATTACK_MY_TARGET", TALKVOLUME_SILENT_TALK);
|
||||
|
||||
// NOTE: the OnDeath user-defined event does not
|
||||
// trigger reliably and should probably be removed
|
||||
if(GetSpawnInCondition(NW_FLAG_DEATH_EVENT))
|
||||
{
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(1007));
|
||||
|
||||
}
|
||||
|
||||
ExecuteScript("prc_npc_death", OBJECT_SELF);
|
||||
}
|
Reference in New Issue
Block a user