Hi everyone,
I am going through some spells in my module I could never get to work. I have this one spell called: “Holy Vision”…see below.
It is suppose to primarily show the entire map area when cast along with some other features (i.e. grants ultravision and truesight to caster, removes blindness in addition).
Here is the original spell as I have it:
//::///////////////////////////////////////////////
//:: Holy Vision
//:: kl_sp_holyvision.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Reveals the entire area to the Caster and
all Players in the party.
*/
//:://////////////////////////////////////////////
//:: Created By: junhunglau
//:: Created On: Mar 07, 2007
//:://////////////////////////////////////////////
// Modified by junhunglau Apr 10, 2007 - Now briefly grants ultravision and truesight to caster, removes blindness
#include "kl_inc_spells"
void HolyVision(object oCaster);
void HolyVision(object oCaster)
{
object oPC = GetFirstFactionMember(oCaster, TRUE);
effect eVis2 = EffectVisualEffect(VFX_DUR_MAGICAL_SIGHT);
while (GetIsObjectValid(oPC))
{
if(oPC != oCaster)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis2, oPC, 5.0);
FloatingTextStringOnCreature("*Holy Vision*", oPC, TRUE);
ExploreAreaForPlayer(GetArea(oCaster), oPC, TRUE);
}
oPC = GetNextFactionMember(oCaster, TRUE);
}
object oMapPin = GetFirstObjectInArea();
while (GetIsObjectValid(oMapPin))
{
if(GetObjectType(oMapPin) == OBJECT_TYPE_WAYPOINT)
{
SetMapPinEnabled(oMapPin, TRUE);
}
oMapPin = GetNextObjectInArea();
}
}
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())
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
object oCaster = OBJECT_SELF;
effect eVis1 = EffectVisualEffect(VFX_FNF_LOS_HOLY_30);
effect eVis2 = EffectVisualEffect(VFX_DUR_MAGICAL_SIGHT);
effect eUltra = EffectUltravision();
effect eTrue = EffectTrueSeeing();
effect eLink = EffectLinkEffects(eUltra, eTrue);
eLink = EffectLinkEffects(eLink, eVis2);
eLink = SupernaturalEffect(eLink);
SignalEvent(oCaster, EventSpellCastAt(oCaster, GetSpellId(), FALSE));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis1, oCaster);
if(GetHasEffect(EFFECT_TYPE_BLINDNESS, oCaster))
{
RemoveSpecificEffect(EFFECT_TYPE_BLINDNESS, oCaster);
}
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oCaster, 6.0);
HolyVision(oCaster);
}
But I took out the include: #include “kl_inc_spells”
And right away it did not compile. I tried fixing all the errors going down after that which I did (i.e. remove right brackets, put in brackets, etc as prompted)…then got to the point below (see screen shot of last error I can’t fix). I tried doing what it said and it still did not compile. I almost made it to the end,…lol
Why did I take out the include? I figured it depended on that and figured since many spells that depend on that include do not work…maybe the spell could be adjusted to work without it…my logic…it looks like it should as a stand alone.
Here is the error:
The spell version below is where I get the above error that I have adjusted. Any feedback would be appreciated.
//::///////////////////////////////////////////////
//:: Holy Vision
//:: kl_sp_holyvision.nss
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Reveals the entire area to the Caster and
all Players in the party.
*/
//:://////////////////////////////////////////////
//:: Created By: junhunglau
//:: Created On: Mar 07, 2007
//:://////////////////////////////////////////////
// Modified by junhunglau Apr 10, 2007 - Now briefly grants ultravision and truesight to caster, removes blindness
void HolyVision(object oCaster);
void HolyVision(object oCaster)
{
object oPC = GetFirstFactionMember(oCaster, TRUE);
effect eVis2 = EffectVisualEffect(VFX_DUR_MAGICAL_SIGHT);
while (GetIsObjectValid(oPC))
{
if(oPC != oCaster)
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis2, oPC, 5.0);
FloatingTextStringOnCreature("*Holy Vision*", oPC, TRUE);
ExploreAreaForPlayer(GetArea(oCaster), oPC, TRUE);
}
oPC = GetNextFactionMember(oCaster, TRUE);
}
object oMapPin = GetFirstObjectInArea();
while (GetIsObjectValid(oMapPin))
{
if(GetObjectType(oMapPin) == OBJECT_TYPE_WAYPOINT)
{
SetMapPinEnabled(oMapPin, TRUE);
}
oMapPin = GetNextObjectInArea();
}
}
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)
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
object oCaster = OBJECT_SELF;
effect eVis1 = EffectVisualEffect(VFX_FNF_LOS_HOLY_30);
effect eVis2 = EffectVisualEffect(VFX_DUR_MAGICAL_SIGHT);
effect eUltra = EffectUltravision();
effect eTrue = EffectTrueSeeing();
effect eLink = EffectLinkEffects(eUltra, eTrue);
eLink = EffectLinkEffects(eLink, eVis2);
eLink = SupernaturalEffect(eLink);
SignalEvent(oCaster, EventSpellCastAt(oCaster, GetSpellId(), FALSE));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis1, oCaster);
if (GetHasEffect(EFFECT_TYPE_BLINDNESS, oCaster))
{
RemoveSpecificEffect(EFFECT_TYPE_BLINDNESS, oCaster);
}
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oCaster, 6.0);
HolyVision(oCaster);
}