RoT2_PRC8/_module/nss/tab_respawn.nss
Jaysyn904 499aba4eb3 Initial upload
Initial upload
2023-09-25 18:13:22 -04:00

111 lines
4.5 KiB
Plaintext

#include "nw_i0_plot"
// * Applies an XP and GP penalty
// * to the player respawning
void ApplyPenalty(object oDead)
{
int nXP = GetXP(oDead);
int nPenalty = 50 * GetHitDice(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.50 * GetGold(oDead));
// * a cap of 10 000gp taken from you
if (nGoldToTake > 200000)
{
nGoldToTake = 200000;
}
AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE));
DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE));
}
#include "asg_i_dbplayer"
void main()
{
object oRespawner = GetLastRespawnButtonPresser();
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
RemoveEffects(oRespawner);
effect e1 = EffectVisualEffect(VFX_FNF_PWKILL);
effect e2 = EffectVisualEffect(VFX_FNF_DISPEL_DISJUNCTION);
effect e3 = EffectVisualEffect(VFX_FNF_WORD);
effect e4 = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_1);
effect e5 = EffectVisualEffect(VFX_FNF_SCREEN_SHAKE);
effect e6 = EffectVisualEffect(VFX_FNF_SUMMON_CELESTIAL);
string sDestTag = "trinity_respawn";
string sArea = GetTag(GetArea(oRespawner));
ApplyPenalty(oRespawner);
object oSpawnPoint = GetWaypointByTag(sDestTag);
AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint)));
PlayerDatabase("W",oRespawner);
SetCutsceneMode(oRespawner,TRUE);
AssignCommand(oRespawner,ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT,1.0,25.0));
DelayCommand(12.0,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,e1,GetLocation( oRespawner)));
DelayCommand(13.0,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,e2,GetLocation( oRespawner)));
DelayCommand(14.0,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,e3,GetLocation( oRespawner)));
DelayCommand(15.0,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,e4,GetLocation( oRespawner)));
DelayCommand(16.0,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,e5,GetLocation( oRespawner)));
DelayCommand(18.0,ApplyEffectAtLocation(DURATION_TYPE_INSTANT,e6,GetLocation( oRespawner)));
DelayCommand(25.0,SetCutsceneMode(oRespawner,FALSE));
object oCaster = GetObjectByTag("HEALER1");
object oCaster2 = GetObjectByTag("HEALER2");
object oCaster3 = GetObjectByTag("HEALER3");
DelayCommand(5.0,AssignCommand(oCaster, ActionSpeakString("Another one... I pray to the Gods above to have mercy on this one")));
DelayCommand(6.0,AssignCommand(oCaster, ClearAllActions()));
DelayCommand(6.5,AssignCommand(oCaster, ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0f, 8.0f)));
DelayCommand(15.0,AssignCommand(oCaster, ClearAllActions()));
object oTarget = GetObjectByTag("TEMPLE_ZERO1");
DelayCommand(16.0,AssignCommand(oCaster, ActionCastFakeSpellAtObject(SPELL_WORD_OF_FAITH, oTarget)));
DelayCommand(19.0,AssignCommand(oCaster, ActionPlayAnimation(ANIMATION_FIREFORGET_READ)));
DelayCommand(22.0,AssignCommand(oCaster, ActionCastFakeSpellAtObject(SPELL_RESURRECTION, oTarget)));
DelayCommand(6.0,AssignCommand(oCaster2, ActionSpeakString("Quickly! There's not much time")));
DelayCommand(6.5,AssignCommand(oCaster2, ClearAllActions()));
DelayCommand(7.5,AssignCommand(oCaster2, ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0f, 8.0f)));
DelayCommand(15.0,AssignCommand(oCaster2, ClearAllActions()));
oTarget = GetObjectByTag("TEMPLE_ZERO2");
DelayCommand(16.0,AssignCommand(oCaster2 , ActionCastFakeSpellAtObject(SPELL_WORD_OF_FAITH, oTarget)));
DelayCommand(18.0,AssignCommand(oCaster2 , ActionPlayAnimation(ANIMATION_FIREFORGET_READ)));
DelayCommand(23.0,AssignCommand(oCaster2 , ActionCastFakeSpellAtObject(SPELL_RESURRECTION, oTarget)));
DelayCommand(6.0,AssignCommand(oCaster3, ActionSpeakString("I pray to the Holy Ones.. Let this one live")));
DelayCommand(8.0,AssignCommand(oCaster3, ClearAllActions()));
oTarget = GetObjectByTag("TEMPLE_ZERO3");
DelayCommand(9.0,AssignCommand(oCaster3, ActionPlayAnimation(ANIMATION_LOOPING_WORSHIP, 1.0f, 12.0f)));
DelayCommand(22.0,AssignCommand(oCaster3, ClearAllActions()));
DelayCommand(23.0,AssignCommand(oCaster3 , ActionCastFakeSpellAtObject(SPELL_RESURRECTION, oTarget)));
}