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.
80 lines
2.6 KiB
Plaintext
80 lines
2.6 KiB
Plaintext
/*
|
|
nw_s0_truesee
|
|
|
|
The creature can seen all invisible, sanctuared,
|
|
or hidden opponents.
|
|
|
|
By: Preston Watamaniuk
|
|
Created: ???
|
|
Modified: Jun 28, 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)
|
|
{
|
|
effect eVis = EffectVisualEffect(VFX_DUR_MAGICAL_SIGHT);
|
|
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
|
effect eSight = EffectTrueSeeing();
|
|
if(GetPRCSwitch(PRC_PNP_TRUESEEING))
|
|
{
|
|
eSight = EffectSeeInvisible();
|
|
int nSpot = GetPRCSwitch(PRC_PNP_TRUESEEING_SPOT_BONUS);
|
|
if(nSpot == 0)
|
|
nSpot = 15;
|
|
effect eSpot = EffectSkillIncrease(SKILL_SPOT, nSpot);
|
|
effect eUltra = EffectUltravision();
|
|
eSight = EffectLinkEffects(eSight, eSpot);
|
|
eSight = EffectLinkEffects(eSight, eUltra);
|
|
}
|
|
effect eLink = EffectLinkEffects(eVis, eSight);
|
|
eLink = EffectLinkEffects(eLink, eDur);
|
|
//Fire cast spell at event for the specified target
|
|
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_TRUE_SEEING, FALSE));
|
|
int CasterLvl = nCasterLevel;
|
|
int nDuration = CasterLvl;
|
|
int nMetaMagic = PRCGetMetaMagicFeat();
|
|
//Enter Metamagic conditions
|
|
if ((nMetaMagic & METAMAGIC_EXTEND))
|
|
{
|
|
nDuration = nDuration *2; //Duration is +100%
|
|
}
|
|
//Apply the VFX impact and effects
|
|
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration),TRUE,-1,CasterLvl);
|
|
|
|
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();
|
|
} |