Making an NPC look like the PC
#1
Posté 10 octobre 2011 - 08:19
Remember in HoTU the room in Undermountain that had two rows of mirrors and there were different effects if you broke them? One of them created an exact duplicate of the PC who then attacked. Does anyone know how the scripting for that effect? I'd like to try and implement into my own module.
Thanks!
#2
Posté 10 octobre 2011 - 08:50
#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 .
#3
Posté 14 octobre 2011 - 01:26
What I do, is when the boss gets to 50% hp, he summons Duplicates of the Attackers Party,
Applies the shadow armor visual to them, to make them look like shadows.
In order to make them as smart as any other npc, you need to give them the script sets that the other npc's have.
I noted that when they are summoned, they just stand there, even if they show up as hostile.
So, what I did, was impliment a 'for statement' (loop), to loop through all the Bosses event scripts, and take note of them, and use nwnx funcs to set the copies event scripts to be the same.
This results in the copies, having the correct AI Scripts.
I think when you use CopyObject on a PC, it copies it, and puts 'default' into all the event scripts.
#4
Posté 14 octobre 2011 - 02:30





Retour en haut







