Author Topic: Anti-Magic zone  (Read 351 times)

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Anti-Magic zone
« on: January 19, 2012, 08:50:28 am »


               I wanted something along the line of this download: http://nwvault.ign.c...s.Detail&id=282

but it appears that this is a module only for NWN2. I'm assuming so because I cannot open it.

Is there anything out there for NWN1 that will do this; establish a no magic area by way of the area's OnEnter script?
               
               

               
            

Legacy_WebShaman

  • Hero Member
  • *****
  • Posts: 1390
  • Karma: +0/-0
Anti-Magic zone
« Reply #1 on: January 19, 2012, 01:13:11 pm »


               This is relatively easy to do - just have the anti-magic effect applied to all who enter, and make sure that it stays active.
               
               

               
            

Legacy_Pstemarie

  • Hero Member
  • *****
  • Posts: 4368
  • Karma: +0/-0
Anti-Magic zone
« Reply #2 on: January 19, 2012, 01:47:30 pm »


               Alternatively you could use a spellhook that checks the area tag (or a variable set on the area) and if it matches, then the spell is canceled before its ever cast. Doing it this way would also mean that the spell is used up for that day.

I use this in a few areas in my module - Karek Norn - to simulate null magic areas. Using the spellhook allows me to effectively hide such areas from casters until they attempt to cast a spell and find that nothing happens.

Example Code from my module's spellhook


#include "x2_inc_switches"
#include "nw_i0_plot"

void main()
{
    if (GetLocalInt(GetArea(oCaster), "NULL_MAGIC_ZONE") == 1) //Magic Nullification Area
    {
        SetModuleOverrideSpellScriptFinished();
        SendMessageToPC(oCaster, "Your spell disipates before the magical energies conjured forth can manifest any effect.");
    }
}

You could even use thespellhook to generate some alternate effect, damage the caster and any allies, etc. With spellhooking you can acomplish a lot of global spell changes without changing a bunch of scripts. For example, in addition to area specific effects upon spells, I also use the spellhook for my spell components and divine focus systems. Basically I can prevent a divine caster from casting any spells without a holy symbol in their inventory or prevent arcane casters from casting spells without the appropriate material components or foci.
               
               

               


                     Modifié par Pstemarie, 19 janvier 2012 - 01:59 .
                     
                  


            

Legacy_Badwater

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Anti-Magic zone
« Reply #3 on: January 19, 2012, 07:48:07 pm »


               Interesting....thanks for that and I'll play around with this script.