#include "nw_i0_generic"
// lf_copypc
// This makes a duplicate of a PC that uses the Mirror of Opposition
// Put in OnUsed of Placable Mirror
void main()
{
object oPC = GetLastUsedBy();
object oSpot=GetWaypointByTag("WP_Copy");
location lSpot=GetLocation(oSpot);
string copytag="copy1";
if (GetLocalInt(oPC,"OPPOSITION") == 1)
{
FloatingTextStringOnCreature("The Mirror appears foggy...",oPC);
return;
}
else
{
if (GetIsPC(oPC)==TRUE)
{
SetLocalInt(oPC,"OPPOSITION",1);
FloatingTextStringOnCreature("You gaze into the Mirror and see Yourself...",oPC);
ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect (VFX_FNF_SUMMON_UNDEAD), lSpot);
object oCopy = CopyObject(oPC, lSpot,OBJECT_INVALID,copytag);
AssignCommand(oCopy , SetIsDestroyable(FALSE));
object oOrb = GetObjectByTag( "MirrorofOpposition");
SetLocalObject(oOrb, "TAG", oCopy);
AdjustReputation(oPC, oCopy, -100);
SetIsTemporaryEnemy(oPC, oCopy);
DelayCommand(2.0,AssignCommand(oCopy,ActionAttack(oPC)));
AssignCommand(oCopy, DetermineCombatRound(oPC));
}
}
}
OnHeartbeat:
// lf_copypchb
// Meant to run with lf_copypc. This
kicks off the default NWN
// script for a cloned PC so he casts spells, uses
items, etc..
// goes OnHeartbeat of Mirror of Opposition
void main()
{
object
oTHING = GetLocalObject( OBJECT_SELF, "TAG");
if (oTHING != OBJECT_INVALID)
{
if
(GetIsDead( oTHING) == TRUE) DeleteLocalObject( OBJECT_SELF, "TAG");
else
{
ExecuteScript( "nw_c2_default3", oTHING);
}
}
}
FP!
Modifié par Fester Pot, 10 octobre 2011 - 08:52 .