Files
PRC8/nwn/nwnprc/trunk/spells/sp_megmht.nss
Jaysyn904 875f00c88f 2026/01/30 Update
Updated version number.
Fixed Touch of Golden Ice.
Removed Leadership related feats from Thrallherds feat list.
Necrocarnum Circlet should only fire the Detect Undead cone VFX once.
Desert Wind maneuvers should to the right amount of damage.
Blade Guide now takes less damage during combat.
FEAT_HOSPITALER_SPELLCASTING_PALADIN was missing from HospitalerMarkerFeats()
Frenzied Berzerker should now work with Vow of Poverty and Forsaker.
prc_wallbreathc now uses PRCEffectDamage().
Changed Mantle of Egregious Might back to Dodge AC.
Tweaked Mirror Image.
2026-01-30 18:11:38 -05:00

76 lines
3.1 KiB
Plaintext

/*
sp_megmht
Mangle of Egregious Might - +4 bonus to stats, attacks,
saves, AC for 10 min / level.
By: ???
Created: ???
Modified: Jul 2, 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);
// Boost stats, AC, attacks, stats, and saves by 4, and add the buff visual effect.
// Shouldn't stack with itself. ~ Lock.
if (!GetHasSpellEffect(SPELL_MANTLE_OF_EGREG_MIGHT, oTarget))
{
effect eList = EffectAbilityIncrease(ABILITY_STRENGTH, 4);
eList = EffectLinkEffects(eList, EffectAbilityIncrease(ABILITY_DEXTERITY, 4));
eList = EffectLinkEffects(eList, EffectAbilityIncrease(ABILITY_CONSTITUTION, 4));
eList = EffectLinkEffects(eList, EffectAbilityIncrease(ABILITY_INTELLIGENCE, 4));
eList = EffectLinkEffects(eList, EffectAbilityIncrease(ABILITY_WISDOM, 4));
eList = EffectLinkEffects(eList, EffectAbilityIncrease(ABILITY_CHARISMA, 4));
eList = EffectLinkEffects(eList, EffectACIncrease(4, AC_DODGE_BONUS));
eList = EffectLinkEffects(eList, EffectAttackIncrease(4));
eList = EffectLinkEffects(eList, EffectSavingThrowIncrease(SAVING_THROW_ALL, 4));
eList = EffectLinkEffects(eList, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE));
//SetLocalInt(oTarget, "EgragiousM", 2); Does not seem to be used anywhere else - Ornedan
// Get duration, 10 min / level unless extended.
float fDuration = PRCGetMetaMagicDuration(TenMinutesToSeconds(nCasterLevel));
// Build the list of fancy visual effects to apply when the spell goes off.
effect eVisList = EffectLinkEffects(EffectVisualEffect(VFX_IMP_AC_BONUS), EffectVisualEffect(VFX_IMP_IMPROVE_ABILITY_SCORE));
// Apply effects and VFX to target
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eList, oTarget, fDuration,TRUE,-1,nCasterLevel);
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVisList, 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();
}