52 lines
1.4 KiB
Plaintext
52 lines
1.4 KiB
Plaintext
effect eEffect;
|
|
int nInt;
|
|
object oTarget;
|
|
|
|
//Created By Guile 4/8/07
|
|
//Put this script OnEnter of a tracks trigger
|
|
|
|
void main()
|
|
{
|
|
|
|
object oPC = GetEnteringObject();
|
|
|
|
if (!GetIsPC(oPC)) return;
|
|
|
|
//If the rogue successfully makes the search check the trap is auto disarmed
|
|
if (GetIsSkillSuccessful(oPC, SKILL_SEARCH, 94))
|
|
{
|
|
oTarget = OBJECT_SELF;
|
|
|
|
//Visual effects can't be applied to waypoints, so if it is a WP
|
|
//the VFX will be applied to the WP's location instead
|
|
|
|
nInt = GetObjectType(oTarget);
|
|
|
|
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_DISPEL_DISJUNCTION), oTarget);
|
|
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_DISPEL_DISJUNCTION), GetLocation(oTarget));
|
|
|
|
DestroyObject(oTarget, 3.0);
|
|
|
|
}
|
|
|
|
//otherwise the entering looter dies to a horrible ruin spell.
|
|
else
|
|
{
|
|
eEffect = EffectDamage(3000, DAMAGE_TYPE_POSITIVE, DAMAGE_POWER_ENERGY);
|
|
|
|
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);
|
|
|
|
oTarget = oPC;
|
|
|
|
//Visual effects can't be applied to waypoints, so if it is a WP
|
|
//the VFX will be applied to the WP's location instead
|
|
|
|
nInt = GetObjectType(oTarget);
|
|
|
|
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_GREATER_RUIN), oTarget);
|
|
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_GREATER_RUIN), GetLocation(oTarget));
|
|
|
|
}
|
|
|
|
}
|