Tentatively fixed scrying for NWN:EE. Added SCRY_AREA_BLOCKED & SCRY_FROM_AREA_BLOCKED area variables to control scrying. Updated all scrying spells, powers & abilities to use the above variables.
34 lines
1.1 KiB
Plaintext
34 lines
1.1 KiB
Plaintext
#include "x2_inc_spellhook"
|
|
#include "prc_inc_scry"
|
|
|
|
void main()
|
|
{
|
|
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
|
SetLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR", SPELL_SCHOOL_ILLUSION);
|
|
|
|
if (!X2PreSpellCastCode())
|
|
{
|
|
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
|
return;
|
|
}
|
|
|
|
// Check if current area blocks scrying
|
|
if(GetLocalInt(GetArea(OBJECT_SELF), "SCRY_FROM_AREA_BLOCKED"))
|
|
{
|
|
FloatingTextStringOnCreature("This area prevents scrying.", OBJECT_SELF, FALSE);
|
|
return;
|
|
}
|
|
|
|
int nDuration = GetLevelByTypeArcane();
|
|
|
|
SetLocalInt(OBJECT_SELF, "ScryCasterLevel", nDuration);
|
|
SetLocalInt(OBJECT_SELF, "ScrySpellId", MYST_EPHEMERAL_IMAGE); // This is deliberate, lets things happen based on Project Image
|
|
SetLocalInt(OBJECT_SELF, "ScrySpellDC", -1);
|
|
SetLocalFloat(OBJECT_SELF, "ScryDuration", RoundsToSeconds(nDuration));
|
|
|
|
ScryMain(OBJECT_SELF, OBJECT_SELF);
|
|
|
|
DeleteLocalInt(OBJECT_SELF, "X2_L_LAST_SPELLSCHOOL_VAR");
|
|
// Getting rid of the local integer storing the spellschool name
|
|
}
|