Updated Release Archive. Fixed Mage-killer prereqs. Removed old LETO & ConvoCC related files. Added organized spell scroll store. Fixed Gloura spellbook. Various TLK fixes. Reorganized Repo. Removed invalid user folders. Added DocGen back in.
60 lines
2.0 KiB
Plaintext
60 lines
2.0 KiB
Plaintext
/*
|
|
sp_convict
|
|
|
|
Conviction - Give the target a +2 to +5 bonus to saving throws.
|
|
|
|
By: ???
|
|
Created: ???
|
|
Modified: Jul 1, 2006
|
|
*/
|
|
|
|
#include "prc_sp_func"
|
|
|
|
//Implements the spell impact, put code here
|
|
// if called in many places, return TRUE if
|
|
// stored charges should be decreased
|
|
// eg. touch attack hits
|
|
//
|
|
// Variables passed may be changed if necessary
|
|
int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent)
|
|
{
|
|
PRCSignalSpellEvent(oTarget, FALSE);
|
|
float fDuration = PRCGetMetaMagicDuration(MinutesToSeconds(nCasterLevel));
|
|
int nBonus = 2 + (nCasterLevel / 6);
|
|
if (nBonus > 5) nBonus = 5;
|
|
effect eBuff = EffectSavingThrowIncrease(SAVING_THROW_ALL, nBonus, SAVING_THROW_TYPE_ALL);
|
|
eBuff = EffectLinkEffects(eBuff, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE));
|
|
eBuff = EffectLinkEffects(eBuff, EffectVisualEffect(VFX_DUR_PROTECTION_GOOD_MINOR));
|
|
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBuff, oTarget, fDuration,TRUE,-1,nCasterLevel);
|
|
SPApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_RESTORATION_LESSER), oTarget);
|
|
|
|
return TRUE; //return TRUE if spell charges should be decremented
|
|
}
|
|
|
|
void main()
|
|
{
|
|
object oCaster = OBJECT_SELF;
|
|
int nCasterLevel = PRCGetCasterLevel(oCaster);
|
|
PRCSetSchool(GetSpellSchool(PRCGetSpellId()));
|
|
if (!X2PreSpellCastCode()) return;
|
|
object oTarget = PRCGetSpellTargetObject();
|
|
int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
|
|
if(!nEvent) //normal cast
|
|
{
|
|
if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
|
|
{ //holding the charge, casting spell on self
|
|
SetLocalSpellVariables(oCaster, 1); //change 1 to number of charges
|
|
return;
|
|
}
|
|
DoSpell(oCaster, oTarget, nCasterLevel, nEvent);
|
|
}
|
|
else
|
|
{
|
|
if(nEvent & PRC_SPELL_EVENT_ATTACK)
|
|
{
|
|
if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent))
|
|
DecrementSpellCharges(oCaster);
|
|
}
|
|
}
|
|
PRCSetSchool();
|
|
} |