Aantioch_Infernum/_module/nss/_on_respawn.nss
EpicValor f14fe514bb Dialog changes + CR adjust
Adjusted the CR of that were tougher than the supposed level to face them.

Changed dialog in some connected convos to align more closely

Some stores were adjusted up for buying price and cap
2023-08-11 19:23:28 -05:00

91 lines
2.8 KiB
Plaintext

//::///////////////////////////////////////////////
//:: 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"
// * Applies an XP and GP penalty
// * to the player respawning
void ApplyPenalty(object oDead)
{
int nPenalty = 50 * GetHitDice(oDead);
int nXP = GetXP(oDead);
int nHD = GetHitDice(oDead);
// * 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(oDead, nNewXP);
int nGoldToTake = FloatToInt(0.05 * GetGold(oDead));
// * a cap of 100000gp taken from you
if (nGoldToTake > 100000)
{
nGoldToTake = 20000;
}
AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE));
DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE));
}
void main()
{
object oRespawner = GetLastRespawnButtonPresser();
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
RemoveEffects(oRespawner);
DeleteLocalInt(oRespawner,"PCDead");
//* Return PC to temple
string sDestTag = "NW_DEATH_TEMPLE";
string sArea = GetTag(GetArea(oRespawner));
int ispawn = GetCampaignInt("respawn_point",GetPCPlayerName(oRespawner),oRespawner);
if (GetIsObjectValid(GetObjectByTag(sDestTag)))
{
if (sArea != "TheStadium")
{
if(ispawn==1)
{
ApplyPenalty(oRespawner);
object oSpawnPoint = GetObjectByTag("deathtemple_nas");
AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint)));
}
if(GetHitDice(oRespawner)<=5)
{
object oSpawnPoint = GetObjectByTag(sDestTag);
AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint)));
SendMessageToPC(oRespawner,"You will suffer no XP or GP penalties until level 5");
}
else
{
ApplyPenalty(oRespawner);
object oSpawnPoint = GetObjectByTag(sDestTag);
AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint)));
}
}
else
//stadium respawn
if (sArea == "TheStadium")
{
object oRespawner = GetLastRespawnButtonPresser();
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
RemoveEffects(oRespawner);
}
}
}