Shargast_PRC8/_module/Chapter 2/nss/death_ta_casting.nss
Jaysyn904 66a0a3e043 Initial commit
Initial commit.
2024-08-03 14:13:18 -04:00

63 lines
1.9 KiB
Plaintext

//::///////////////////////////////////////////////
//:: Healer perform recovery
//:: death_ta_casting
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created By: Dauvis
//:: Created On: 6/28/03
//::
//:: This function will perform the recovery on the
//:: player. If the player does not have enough gold,
//:: it will return FALSE to indicate to the conversation
//:: that fact. Otherwise, it will perform the recovery
//:: and return TRUE
//:://////////////////////////////////////////////
#include "death_include"
int StartingConditional()
{
object oPlayer = GetPCSpeaker();
int iType;
// get the gold and exp
int iGold = GetCampaignInt(dhDeathGetDatabaseName(oPlayer), "iExpBuyBackCost", oPlayer);
int iExp = GetCampaignInt(dhDeathGetDatabaseName(oPlayer), "iRecoverableExp", oPlayer);
// test to see if player has enough gold
int iPlayerGold = GetGold(oPlayer);
if (iPlayerGold < iGold) {
return FALSE;
}
// Glitz & Glamor
AssignCommand(OBJECT_SELF, ActionCastFakeSpellAtObject(SPELL_RESTORATION, oPlayer));
effect effPlayer = EffectVisualEffect(VFX_IMP_HEALING_G);
DelayCommand(3.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, effPlayer, oPlayer, 0.0));
// remove "rez sick" if still on player
effPlayer = GetFirstEffect(oPlayer);
while (GetIsEffectValid(effPlayer)) {
iType = GetEffectType(effPlayer);
if (iType == EFFECT_TYPE_NEGATIVELEVEL) {
RemoveEffect(oPlayer, effPlayer);
}
effPlayer = GetNextEffect(oPlayer);
}
// return exp and take gold
GiveXPToCreature(oPlayer, iExp);
TakeGoldFromCreature(iGold, oPlayer, TRUE);
// clear the persistant data
SetCampaignInt(dhDeathGetDatabaseName(oPlayer), "iExpBuyBackCost", 0, oPlayer);
SetCampaignInt(dhDeathGetDatabaseName(oPlayer), "iRecoverableExp", 0, oPlayer);
// done
return TRUE;
}