//Created by Guile 12/31/07 //Goes OnPlayerRespawn of the module properties effect eEffect; location lTarget; int nInt; object oTarget; #include "nw_i0_plot" //Void function to tell the functions below how to appropriately remove xp. void RemoveXPFromParty(int nXP, object oPC, int bAllParty=TRUE) { if (!bAllParty) { nXP=(GetXP(oPC)-nXP)>=0 ? GetXP(oPC)-nXP : 0; SetXP(oPC, nXP); } else { object oMember=GetFirstFactionMember(oPC, TRUE); while (GetIsObjectValid(oMember)) { nXP=(GetXP(oMember)-nXP)>=0 ? GetXP(oMember)-nXP : 0; SetXP(oMember, nXP); oMember=GetNextFactionMember(oPC, TRUE); } } } //Main Script void main() { //This script may seem very complex, but it's not, each function is noted //so there is no confusion on what each thing does. //You can simply void a function by typing // before the line, all functions //<<= 40) { oTarget = oPC; nInt = GetObjectType(oTarget); if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_HOWL_WAR_CRY), oTarget); else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_HOWL_WAR_CRY), GetLocation(oTarget)); oTarget = GetWaypointByTag("home"); lTarget = GetLocation(oTarget); if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; DelayCommand(3.0, AssignCommand(oPC, ClearAllActions())); DelayCommand(3.3, AssignCommand(oPC, ActionJumpToLocation(lTarget))); AssignCommand(oPC, TakeGoldFromCreature(50000, oPC, TRUE)); object oItem; oItem = GetFirstItemInInventory(oPC); while (GetIsObjectValid(oItem)) { if (GetTag(oItem)=="death") DestroyObject(oItem); oItem = GetNextItemInInventory(oPC); } } else if (GetHitDice(oPC) >= 30) { oTarget = oPC; nInt = GetObjectType(oTarget); if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_HOWL_WAR_CRY), oTarget); else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_HOWL_WAR_CRY), GetLocation(oTarget)); RemoveXPFromParty(5000, oPC, FALSE); AssignCommand(oPC, TakeGoldFromCreature(50000, oPC, TRUE)); oTarget = GetWaypointByTag("home"); lTarget = GetLocation(oTarget); if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; DelayCommand(2.0, AssignCommand(oPC, ClearAllActions())); DelayCommand(2.2, AssignCommand(oPC, ActionJumpToLocation(lTarget))); object oItem; oItem = GetFirstItemInInventory(oPC); while (GetIsObjectValid(oItem)) { if (GetTag(oItem)=="death") DestroyObject(oItem); oItem = GetNextItemInInventory(oPC); } } else if (GetHitDice(oPC) >= 20) { oTarget = oPC; nInt = GetObjectType(oTarget); if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_HOWL_WAR_CRY), oTarget); else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_HOWL_WAR_CRY), GetLocation(oTarget)); RemoveXPFromParty(3000, oPC, FALSE); AssignCommand(oPC, TakeGoldFromCreature(30000, oPC, TRUE)); oTarget = GetWaypointByTag("home"); lTarget = GetLocation(oTarget); if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; DelayCommand(2.0, AssignCommand(oPC, ClearAllActions())); DelayCommand(2.2, AssignCommand(oPC, ActionJumpToLocation(lTarget))); object oItem; oItem = GetFirstItemInInventory(oPC); while (GetIsObjectValid(oItem)) { if (GetTag(oItem)=="death") DestroyObject(oItem); oItem = GetNextItemInInventory(oPC); } } else { oTarget = oPC; nInt = GetObjectType(oTarget); if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_HOWL_WAR_CRY), oTarget); else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_HOWL_WAR_CRY), GetLocation(oTarget)); RemoveXPFromParty(1000, oPC, FALSE); AssignCommand(oPC, TakeGoldFromCreature(5000, oPC, TRUE)); oTarget = GetWaypointByTag("home"); lTarget = GetLocation(oTarget); if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; DelayCommand(2.0, AssignCommand(oPC, ClearAllActions())); DelayCommand(2.2, AssignCommand(oPC, ActionJumpToLocation(lTarget))); object oItem; oItem = GetFirstItemInInventory(oPC); while (GetIsObjectValid(oItem)) { if (GetTag(oItem)=="death") DestroyObject(oItem); oItem = GetNextItemInInventory(oPC); } } }