//:://///////////////////////////////////////////// //:: Generic On Pressed Respawn Button //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* // * June 1: moved RestoreEffects into plot include */ //::////////////////////////////////////////////// //:: Created By: Brent //:: Created On: November //::////////////////////////////////////////////// #include "nw_i0_plot" 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); } } } //void ApplyPenalty(object oDead) void main() { object oRespawner = GetLastRespawnButtonPresser(); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner); RemoveEffects(oRespawner); //* Return PC to temple string sDestTag = "wp_respawn"; string sArea = GetTag(GetArea(oRespawner)); if (sArea == "TempleofTyrAldaris") { sDestTag = "wp_respawn"; } if (GetIsObjectValid(GetObjectByTag(sDestTag))) { object oSpawnPoint = GetObjectByTag(sDestTag); AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint))); // * mak } else { // * do nothing, just 'res where you are. } object oPC = GetLastRespawnButtonPresser(); { int nXP = GetXP(oPC); int nPenalty = 50 * GetHitDice(oPC); int nHD = GetHitDice(oPC); // * You can not lose a level with this respawning int nMin = ((nHD * (nHD - 1)) / 2) * 1000; int nNewXP = nXP - nPenalty; if (nNewXP < nMin) nNewXP = nMin; SetXP(oPC, nNewXP); int nGoldToTake = FloatToInt(0.10 * GetGold(oPC)); // * a cap of 10 000gp taken from you if (nGoldToTake > 10000) { nGoldToTake = 10000; } AssignCommand(oPC, TakeGoldFromCreature(nGoldToTake, oPC, TRUE)); DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oPC, FALSE)); DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oPC, FALSE)); } } // * Applies an XP and GP penalty // * to the player respawning /////////////////////////////////////////////////////////////////////// // this function resets variabls and clears the arenas in the fighter // 'gauntlet' subplot in chapter one /////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////