62 lines
2.0 KiB
Plaintext
62 lines
2.0 KiB
Plaintext
|
///::///////////////////////////////////////////////
|
||
|
//:: Premonition
|
||
|
//:: NW_S0_Premo
|
||
|
//:: Copyright (c) 2001 Bioware Corp.
|
||
|
//:://////////////////////////////////////////////
|
||
|
/*
|
||
|
Gives the gives the creature touched 30/+5
|
||
|
damage reduction. This lasts for 1 hour per
|
||
|
caster level or until 10 * Caster Level
|
||
|
is dealt to the person.
|
||
|
*/
|
||
|
//:://////////////////////////////////////////////
|
||
|
//:: Created By: Preston Watamaniuk
|
||
|
//:: Created On: March 16 , 2001
|
||
|
//:://////////////////////////////////////////////
|
||
|
//:: Last Updated By: Preston Watamaniuk, On: April 11, 2001
|
||
|
#include "x0_i0_spells"
|
||
|
#include "x2_inc_spellhook"
|
||
|
|
||
|
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())
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
// End of Spell Cast Hook
|
||
|
//Declare major variables
|
||
|
int nDuration = GetCasterLevel(OBJECT_SELF);
|
||
|
int nDamage=nDuration*10;
|
||
|
if (nDamage>150)
|
||
|
{
|
||
|
nDamage=150;
|
||
|
}
|
||
|
int nLimit = nDuration * 10;
|
||
|
int nMetaMagic = GetMetaMagicFeat();
|
||
|
effect eStone = EffectDamageReduction(30, DAMAGE_POWER_PLUS_FIVE, nDamage);
|
||
|
effect eVis = EffectVisualEffect(VFX_DUR_PROT_PREMONITION);
|
||
|
//Link the visual and the damage reduction effect
|
||
|
effect eLink = EffectLinkEffects(eStone, eVis);
|
||
|
//Enter Metamagic conditions
|
||
|
//Fire cast spell at event for the specified target
|
||
|
SignalEvent(OBJECT_SELF, EventSpellCastAt(OBJECT_SELF, SPELL_PREMONITION, FALSE));
|
||
|
if (nMetaMagic == METAMAGIC_EXTEND)
|
||
|
{
|
||
|
nDuration = nDuration *2; //Duration is +100%
|
||
|
}
|
||
|
|
||
|
RemoveEffectsFromSpell(OBJECT_SELF, SPELL_PREMONITION);
|
||
|
|
||
|
//Apply the linked effect
|
||
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, OBJECT_SELF, TurnsToSeconds(nDuration));
|
||
|
}
|