Initial upload
Initial upload
This commit is contained in:
88
_module/nss/tailors_on_spawn.nss
Normal file
88
_module/nss/tailors_on_spawn.nss
Normal file
@@ -0,0 +1,88 @@
|
||||
|
||||
//This is biowares standard script I've added VFXs to it
|
||||
//for spawning in NPCs...
|
||||
|
||||
const int EVENT_USER_DEFINED_PRESPAWN = 1510;
|
||||
const int EVENT_USER_DEFINED_POSTSPAWN = 1511;
|
||||
|
||||
|
||||
|
||||
|
||||
#include "x2_inc_switches"
|
||||
void main()
|
||||
{
|
||||
|
||||
ExecuteScript("do_vfx_spawn", OBJECT_SELF);
|
||||
|
||||
//Note used anymore! YAY!
|
||||
//DoVFXs();
|
||||
|
||||
string sTag;
|
||||
object oNPC;
|
||||
// User defined OnSpawn event requested?
|
||||
int nSpecEvent = GetLocalInt(OBJECT_SELF,"X2_USERDEFINED_ONSPAWN_EVENTS");
|
||||
|
||||
|
||||
// Pre Spawn Event requested
|
||||
if (nSpecEvent == 1 || nSpecEvent == 3 )
|
||||
{
|
||||
SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_PRESPAWN ));
|
||||
}
|
||||
|
||||
sTag=GetLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG");
|
||||
if (GetStringLength(sTag)>0)
|
||||
{ // look for master
|
||||
oNPC=GetNearestObjectByTag(sTag);
|
||||
if (GetIsObjectValid(oNPC)&&GetObjectType(oNPC)==OBJECT_TYPE_CREATURE)
|
||||
{ // master found
|
||||
AddHenchman(oNPC);
|
||||
} // master found
|
||||
else
|
||||
{ // look in module
|
||||
oNPC=GetObjectByTag(sTag);
|
||||
if (GetIsObjectValid(oNPC)&&GetObjectType(oNPC)==OBJECT_TYPE_CREATURE)
|
||||
{ // master found
|
||||
AddHenchman(oNPC);
|
||||
} // master found
|
||||
else
|
||||
{ // master does not exist - remove X3_HORSE_OWNER_TAG
|
||||
DeleteLocalString(OBJECT_SELF,"X3_HORSE_OWNER_TAG");
|
||||
} // master does not exist - remove X3_HORSE_OWNER_TAG
|
||||
} // look in module
|
||||
} // look for master
|
||||
|
||||
/* Fix for the new golems to reduce their number of attacks */
|
||||
|
||||
int nNumber = GetLocalInt(OBJECT_SELF,CREATURE_VAR_NUMBER_OF_ATTACKS);
|
||||
if (nNumber >0 )
|
||||
{
|
||||
SetBaseAttackBonus(nNumber);
|
||||
}
|
||||
|
||||
// Execute default OnSpawn script.
|
||||
ExecuteScript("nw_c2_default9", OBJECT_SELF);
|
||||
|
||||
|
||||
//Post Spawn event requeste
|
||||
if (nSpecEvent == 2 || nSpecEvent == 3)
|
||||
{
|
||||
SignalEvent(OBJECT_SELF,EventUserDefined(EVENT_USER_DEFINED_POSTSPAWN));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Save this...
|
||||
|
||||
|
||||
void DoVFXs()
|
||||
{
|
||||
object oMe = OBJECT_SELF;
|
||||
effect e;
|
||||
|
||||
e = EffectVisualEffect(VFX_IMP_GOOD_HELP);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, e, oMe, 0.0f);
|
||||
|
||||
e = EffectVisualEffect(VFX_IMP_HOLY_AID);
|
||||
DelayCommand(0.1, ApplyEffectToObject(DURATION_TYPE_INSTANT, e, oMe, 0.0f));
|
||||
|
||||
}
|
Reference in New Issue
Block a user