Further file organization

Further file organization
This commit is contained in:
Jaysyn904
2023-08-23 22:11:00 -04:00
parent 3062876237
commit d87fe14826
22364 changed files with 0 additions and 3253 deletions

View File

@@ -0,0 +1,31 @@
/** @file
prc_od_conc
Runs in the PC's virtual OnDamaged slot, added as an event script by spells
that require concentration to maintain.
Makes a concentration check if the PC is damaged and sets the local int
"CONC_BROKEN" if the check fails
@author fluffyamoeba
@date Created 2007.08.05
*/
#include "inc_eventhook"
void main()
{
object oPC = OBJECT_SELF;
// concentration check uses a DC of 10 + damage dealt + spell level
int nDamage = GetLocalInt(oPC, "PRC_LastDamageTaken");
int nSpellLevel = GetLocalInt(oPC, "CONC_SPELL_LEVEL");
int nDC = 10 + nDamage + nSpellLevel;
if(!GetIsSkillSuccessful(oPC, SKILL_CONCENTRATION, nDC))
{
RemoveEventScript(oPC, EVENT_VIRTUAL_ONDAMAGED, "prc_od_conc");
SetLocalInt(oPC, "CONC_BROKEN", TRUE);
}
else
DeleteLocalInt(oPC, "CONC_BROKEN");
}