Battledale_PRC8/_module/nss/gzcs_pkeg_ignite.nss
Jaysyn904 e5b3f6ad61 Finished PRC8 integration
Finished PRC8 integration.  Moved creature abilities to top hak.  Setup tooling.  Created release archive
2024-03-12 21:27:23 -04:00

73 lines
3.0 KiB
Plaintext

#include "prc_inc_racial"
void DoSmoke()
{
effect eSmoke = EffectVisualEffect(VFX_FNF_SMOKE_PUFF);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eSmoke,OBJECT_SELF);
}
// Makes intelligent monsters and humanoids run when a keg is ignited
void DoFlee()
{
location lLoc = GetLocation(OBJECT_SELF);
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE, OBJECT_TYPE_CREATURE);
//Cycle through the targets within the spell shape until an invalid object is captured.
while (GetIsObjectValid(oTarget))
{
if ((!GetIsPC(oTarget)) && GetLocalInt(oTarget,"GZ_CRE_PKEGFLEE")!=TRUE)
{
if (MyPRCGetRacialType(oTarget) == RACIAL_TYPE_HUMAN || MyPRCGetRacialType(oTarget) == RACIAL_TYPE_DWARF || MyPRCGetRacialType(oTarget) == RACIAL_TYPE_ELF || MyPRCGetRacialType(oTarget) == RACIAL_TYPE_FEY ||
MyPRCGetRacialType(oTarget) == RACIAL_TYPE_GNOME || MyPRCGetRacialType(oTarget) == RACIAL_TYPE_HALFELF || MyPRCGetRacialType(oTarget) == RACIAL_TYPE_HALFLING ||
MyPRCGetRacialType(oTarget) == RACIAL_TYPE_HALFORC || MyPRCGetRacialType(oTarget) == RACIAL_TYPE_OUTSIDER)
{
int nRand=d8();
switch(nRand)
{
case 1: AssignCommand(oTarget,ActionSpeakString("Run!!!"));
break;
case 2: AssignCommand(oTarget,ActionSpeakString("Take cover!"));
break;
case 3: AssignCommand(oTarget,ActionSpeakString("Flee, the fuse is lit!"));
break;
case 5: AssignCommand(oTarget,PlayVoiceChat(VOICE_CHAT_FLEE));
break;
case 6: AssignCommand(oTarget,PlayVoiceChat(VOICE_CHAT_FLEE));
break;
break;
}
}
AssignCommand(oTarget,ActionMoveAwayFromObject(OBJECT_SELF,TRUE,20.0f));
SetLocalInt(oTarget,"GZ_CRE_PKEGFLEE",TRUE);
SetCommandable(FALSE,oTarget);
DelayCommand(16.0f,DeleteLocalInt(oTarget,"GZ_CRE_PKEGFLEE"));
DelayCommand(16.0f,SetCommandable(FALSE,oTarget));
}
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE, OBJECT_TYPE_CREATURE );
}
}
void main()
{
if (GetLocalInt(OBJECT_SELF,"GZ_OBJECT_ACTIVE") == TRUE)
return;
SetLocalInt(OBJECT_SELF,"GZ_OBJECT_ACTIVE",TRUE);
if (GetPCSpeaker() != OBJECT_INVALID)
SetLocalObject(OBJECT_SELF,"GZ_OBJECT_ACTIVATOR",GetPCSpeaker());
DoSmoke();
float fDetDelay = IntToFloat(d6());
DelayCommand(2.5f,DoSmoke());
DelayCommand(5.0f,DoSmoke());
DelayCommand(3.0+fDetDelay,DoFlee());
DelayCommand(7.5f,DoSmoke());
DelayCommand(10.0f,DoSmoke());
effect eFire = EffectBeam(VFX_BEAM_FIRE,OBJECT_SELF, BODY_NODE_CHEST);
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eFire,OBJECT_SELF);
DelayCommand(8.0f+fDetDelay,ExecuteScript("gz_pkeg_detonate",OBJECT_SELF));
}