26 lines
1.0 KiB
Plaintext
26 lines
1.0 KiB
Plaintext
//Script: cal_explode
|
|
//Author: Albert Shih (Calidarien)
|
|
//Version: v0.9, 2002-06-24
|
|
//Usage: Caller explodes after a delay and damages nearby objects for 2d6 fire
|
|
// damage (Reflex save DC 15 for half)
|
|
//Notes:
|
|
// v0.9: Added a Reflex save and defined the explosion as a separate function
|
|
// for delaying purposes
|
|
//
|
|
#include "prc_inc_spells"
|
|
|
|
void ExplodeAtLocation(location lTarget, int nDamage, int nSaveDC = 15, float fRadius = 3.) {
|
|
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_FIRESTORM), lTarget);
|
|
object oObject = GetFirstObjectInShape(SHAPE_SPHERE, fRadius, lTarget);
|
|
do {
|
|
int nDamageAfterSave = PRCGetReflexAdjustedDamage(nDamage/2, oObject, nSaveDC)+nDamage/2;
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(nDamageAfterSave, DAMAGE_TYPE_FIRE), oObject);
|
|
} while ((oObject = GetNextObjectInShape(SHAPE_SPHERE, fRadius, lTarget)) != OBJECT_INVALID);
|
|
}
|
|
|
|
void main()
|
|
{
|
|
location lSource = GetLocation(OBJECT_SELF);
|
|
DelayCommand(1., ExplodeAtLocation(lSource, d6(2)));
|
|
}
|