54 lines
1.5 KiB
Plaintext
54 lines
1.5 KiB
Plaintext
|
|
#include "nw_i0_generic"
|
|
#include "x0_i0_partywide"
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
object oTarget;
|
|
object oSpawn;
|
|
location lTarget;
|
|
int nInt;
|
|
|
|
object oPC = GetPCSpeaker();
|
|
|
|
if (!GetIsPC(oPC)) return;
|
|
int DoOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
|
|
if (DoOnce==TRUE) return;
|
|
SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);
|
|
|
|
// Give 10 experience (to party) to the PC.
|
|
GiveXPToAll(oPC, 10);
|
|
|
|
oTarget = GetObjectByTag("Helena");
|
|
|
|
//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_IMP_POLYMORPH), oTarget);
|
|
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH), GetLocation(oTarget));
|
|
|
|
DestroyObject(oTarget, 1.5);
|
|
|
|
oTarget = oPC;
|
|
lTarget = GetLocation(oTarget);
|
|
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "avatarofbainr2", lTarget);
|
|
oTarget = oSpawn;
|
|
SetIsTemporaryEnemy(oPC, oTarget);
|
|
AssignCommand(oTarget, ActionAttack(oPC));
|
|
AssignCommand(oTarget, DetermineCombatRound(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) DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH), oTarget));
|
|
else DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH), GetLocation(oTarget)));
|
|
|
|
}
|
|
|