//:://////////////////////////////////////////////////////////////////////////// //:: //:: Script Name: clone_pc_hostile //:: //:: Use: This script is used to spawn in a copy of a player who kills an //:: object (generally a placeable) //:: //:: //:: Created By: Birdman076 //:: //:: Created On: July 27, 2009 //:: //:: Note: Magic-user clones are not really effective as they don't cast alot //:: this could be fixed with further scripting //:: //:://////////////////////////////////////////////////////////////////////////// #include "nw_i0_generic" void main() { ExecuteScript("plcble_respawn", OBJECT_SELF); object oItem; object oPC = GetLastKiller(); if (!GetIsPC(oPC)) return; int nInt; nInt = GetObjectType(oPC); if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_BLOOD_SPARK_SMALL), oPC); else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_BLOOD_SPARK_SMALL), GetLocation(oPC)); string sName = "npc"+GetName(oPC); //create and name the object. Set up debug strings object oOppForce = CopyObject(oPC, GetLocation(oPC),OBJECT_INVALID, sName); int nHP = GetMaxHitPoints(oOppForce); ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(nHP), oOppForce); string altName= GetName (oOppForce); string altTag= GetTag (oOppForce); //Buff the HP up a bit with a buff script SetLocalInt (oOppForce, "TEMPORARY_HIT_POINTS", 1200); ExecuteScript("monster_buffs", oOppForce); //INVENTORY MANAGEMENT FUNCTIONS //Remove this if you want loot to drop //if you want inventory or gold to drop then set to true //Remove gold //Remark the take statement out if you want gold to drop int nGold = GetGold(oOppForce); TakeGoldFromCreature(nGold, oOppForce, TRUE); //Set equipped items to FALSE for Dropping for (nInt=0; nInt