35 lines
1005 B
Plaintext
35 lines
1005 B
Plaintext
void main()
|
|
{
|
|
|
|
effect eVFX;
|
|
|
|
// Get the creature who triggered this event.
|
|
object oPC = GetEnteringObject();
|
|
|
|
// Only fire for (real) PCs.
|
|
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )
|
|
return;
|
|
|
|
// Abort if the PC does not have the item "towerofangarngit".
|
|
if ( GetItemPossessedBy(oPC, "towerofangarngit") == OBJECT_INVALID )
|
|
return;
|
|
|
|
// Apply a visual effect.
|
|
eVFX = EffectVisualEffect(VFX_COM_CHUNK_STONE_MEDIUM);
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oPC);
|
|
|
|
// Have text appear over the PC's head.
|
|
FloatingTextStringOnCreature("The tower is starting to crumble.", oPC);
|
|
|
|
if (!GetIsPC(oPC))return;
|
|
int DoOnce = GetLocalInt(OBJECT_SELF,GetTag(OBJECT_SELF));
|
|
if (DoOnce==TRUE)return;
|
|
SetLocalInt(OBJECT_SELF,GetTag(OBJECT_SELF),TRUE);
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_SCREEN_SHAKE),oPC);
|
|
PlaySound("as_na_rockfallg2");
|
|
AssignCommand(oPC,ClearAllActions());
|
|
AssignCommand(oPC,ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT,1.0,999.0));
|
|
|
|
}
|
|
|