PoA_PRC8/_module/nss/_clone_7.nss
Jaysyn904 8d97886c3f Changed folder name.
Changed folder name.
2022-10-07 21:08:37 -04:00

64 lines
2.7 KiB
Plaintext

void main()
{
object PC = GetFirstPC();
while(GetIsPC(PC)==TRUE)
{
int SN = GetLocalInt(PC,"bootlist");
if(SN==9007){
object oPC = GetLastSpeaker();
AssignCommand(oPC,PlaySound("as_sw_x2gong2"));
object oTrigger=OBJECT_SELF;
object oNest = GetWaypointByTag("WP_NEST6");
object clone = GetLocalObject(oPC, "Clone");
// int bReady=!GetLocalInt(oTrigger, "Used");
location lSpawn=GetLocation(oNest);
// if (bReady && GetIsPC(oPC))
if (GetIsObjectValid(clone) == FALSE && GetIsPC(oPC))
{
object oClone = CopyObject(PC, lSpawn, OBJECT_INVALID, "Clone");
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_PWKILL), GetLocation(oNest));
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SOUND_BURST_SILENT), GetLocation(oNest));
SetBaseAttackBonus(6,oClone);
//This prevents a PC from accidentally triggering an army of clones
//by making the trigger inactive for 30 seconds after use.
// SetLocalInt(oTrigger, "Used", TRUE);
// DelayCommand(30.0, SetLocalInt(oTrigger, "Used", FALSE));
SetLocalObject(PC, "Clone", oClone);
//This sets the clone to Hostile
ChangeToStandardFaction(oClone, STANDARD_FACTION_HOSTILE);
//Have the clone leave a corpse that's not lootable.
//We don't want all the player's gear coming into play either.
AssignCommand(oClone, SetIsDestroyable(FALSE, FALSE));
int nGold = GetGold(oClone);
int nHP = GetMaxHitPoints(oClone);
//This makes sure the clone doesn't drop a ton of gold,
//otherwise he'd have as much as the PC he copied
TakeGoldFromCreature(nGold, oClone, TRUE);
//Don't want an injured clone from an injured player, so heal him too.
DelayCommand(3.0,ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(nHP), oClone));
DelayCommand(3.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectTemporaryHitpoints(9999), oClone));
DelayCommand(3.0,ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectConcealment(99,MISS_CHANCE_TYPE_VS_MELEE), oClone));
DelayCommand(3.0,AssignCommand(oClone,SpeakString("You will Die Fucker!!!",TALKVOLUME_TALK)));
DelayCommand(2.0,AssignCommand(oClone, ActionPlayAnimation(ANIMATION_FIREFORGET_BOW)));
DelayCommand(2.5,AssignCommand(oClone,ActionEquipMostDamagingMelee(oPC,FALSE)));
DelayCommand(2.6,AssignCommand(oClone,ActionEquipMostDamagingMelee(oPC,TRUE)));
// Attack player straight away
DelayCommand (3.0,AssignCommand(oClone, ActionAttack(oPC)));
//This is the all important combat hb script.
ExecuteScript("clone_hb", oClone);
}
}
PC = GetNextPC();
}
}