TriggerExplodeObject(int)

Blow up the nearest object with a matching tag with the specified spell.

void TriggerExplodeObject(
    int nSpell = SPELL_FIREBALL
);

Parameters

nSpell

The SPELL_* used to destroy the target. (Default: SPELL_FIREBALL)


Description

Blow up the nearest object with a matching tag with the specified spell.

This should be called by the trigger object! It ASSUMES that GetEnteringObject will work for OBJECT_SELF here.

This destroys the trigger after it is successfully invoked by the PC.



Remarks

This function does nothing if the entering object is not a PC based on the results of a call to GetIsPC.

The tag of the object to be destroyed is determined by: GetNearestObjectByTag(GetTag(OBJECT_SELF)). Meaning it looks for the nearest object to OBJECT_SELF that has the same tag as OBJECT_SELF.

GetNearestObjectByTag returns an object to be destroyed, note that no validation is done that it found a valid object. This object, valid or not, is then sent off to ExplodeObject for exploding by nSpell.

After a 5 second delay. OBJECT_SELF is destroyed as well. But quietly without any fanfair. This destruction makes the trigger one time use instead of repeatable use.


Requirements

#include "x0_i0_corpses"


Version

???

See Also

functions:  GetEnteringObject
constants:  SPELL_*
categories:  Movement Functions
events:  OnEnter Event


author: Mistress