Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
60 lines
1.8 KiB
Plaintext
60 lines
1.8 KiB
Plaintext
|
|
|
|
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 ((GetAbilityScore(oTarget, ABILITY_INTELLIGENCE)>3) && (!GetIsPC(oTarget)))
|
|
{
|
|
|
|
AssignCommand(oTarget,ActionMoveAwayFromObject(OBJECT_SELF,TRUE,20.0f));
|
|
|
|
|
|
}
|
|
oTarget = GetNextObjectInShape(SHAPE_SPHERE, RADIUS_SIZE_HUGE, lLoc, TRUE, OBJECT_TYPE_CREATURE );
|
|
}
|
|
}
|
|
|
|
int StartingConditional()
|
|
{
|
|
if (GetLocalInt(OBJECT_SELF,"GZ_OBJECT_ACTIVE") == TRUE)
|
|
return 1;
|
|
|
|
object oPC=GetPCSpeaker();
|
|
object oLeft=GetItemInSlot(INVENTORY_SLOT_LEFTHAND,oPC);
|
|
object oRight=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND,oPC);
|
|
|
|
if ((GetBaseItemType(oLeft)!=BASE_ITEM_TORCH)&&(GetBaseItemType(oRight)!=BASE_ITEM_TORCH))
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
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(1.0,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));
|
|
|
|
return 1;
|
|
|
|
}
|