Jaysyn904 86feb9ca6f Initial commit
Initial commit.
2024-06-05 21:21:06 -04:00

82 lines
2.1 KiB
Plaintext

//::///////////////////////////////////////////////
//:: [Raise Dead]
//:: [NW_S0_RaisDead.nss]
//:: Copyright (c) 2000 Bioware Corp.
//:://////////////////////////////////////////////
//:: Brings a character back to life with 1 HP.
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: Jan 31, 2001
//:://////////////////////////////////////////////
//:: Last Updated By: Preston Watamaniuk, On: April 11, 2001
//:: VFX Pass By: Preston W, On: June 22, 2001
#include "x2_inc_spellhook"
#include "mn_i_pcskin"
void main()
{
/*
Spellcast Hook Code
Added 2003-06-20 by Georg
If you want to make changes to all spells,
check x2_inc_spellhook.nss to find out more
*/
if (!X2PreSpellCastCode())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
//Declare major variables
object oTarget = GetSpellTargetObject();
effect eRaise = EffectResurrection();
effect eVis = EffectVisualEffect(VFX_IMP_RAISE_DEAD);
//Fire cast spell at event for the specified target
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_RAISE_DEAD, FALSE));
if(GetIsDead(oTarget))
{
{
int nXP = GetXP(oTarget);
int nPenalty = 30 * GetHitDice(oTarget);
if (nPenalty > 750)
{
nPenalty = 750;
}
int nHD = GetHitDice(oTarget);
int nNewXP = nXP + nPenalty;
SetXP(oTarget, nNewXP);
int nGoldToGive = FloatToInt(0.05 * GetGold(oTarget));
// * a cap of 10 000gp taken from you
if (nGoldToGive > 45000)
{
nGoldToGive = 45000;
}
AssignCommand(oTarget, TakeGoldFromCreature(-nGoldToGive, oTarget, TRUE));
DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oTarget, FALSE));
DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oTarget, FALSE));
setupSpecialEffects(oTarget);
}
//Apply raise dead effect and VFX impact
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eRaise, oTarget);
}
}