Author Topic: Beholder antimagic on Cast Spell: Unique Item use  (Read 307 times)

Legacy_Seter

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Beholder antimagic on Cast Spell: Unique Item use
« on: September 16, 2012, 10:42:23 pm »


               Hello there,

I am trying to make it possible so that an item upon Unique item use will be able to cast Beholder antimagic ray at the target.
I have tried reworking the x2_s1_beantimagic script and using ExecuteScript command but its not working. Could anyone offer a working code please?

Thanks in advance.
               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Beholder antimagic on Cast Spell: Unique Item use
« Reply #1 on: September 17, 2012, 01:21:28 am »


               I think the problem you are running into is that the Activate item script is running on the module.  try this.

void main()
{
 ExecuteScript("x2_s1_beantimag",GetItemActivator());

}
               
               

               
            

Legacy_Seter

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Beholder antimagic on Cast Spell: Unique Item use
« Reply #2 on: September 17, 2012, 09:34:12 am »


               I tried that but sadly it does not seem to work.
I have been pounding my head trying to come up with a workable workaround.
               
               

               
            

Legacy_ffbj

  • Hero Member
  • *****
  • Posts: 1097
  • Karma: +0/-0
Beholder antimagic on Cast Spell: Unique Item use
« Reply #3 on: September 18, 2012, 02:24:13 am »


               Try making the item cast spell activate item long range.
This is the script I used to test it. I left the references in to the item, the target, an oPC, though they are not used.

#include "x2_inc_switches"
void main()
{
int nEvent =GetUserDefinedItemEventNumber();
if (!nEvent == X2_ITEM_EVENT_ACTIVATE)
return;
object oItem = GetItemActivated();
object oPC = GetItemActivator();
object oTarget = GetItemActivatedTarget();

ExecuteScript("x2_s1_beantimag",GetItemActivator());

}

Btw i assume it works as it made some undead sparkle, which I guess means they are immune to the spell effects.
               
               

               


                     Modifié par ffbj, 18 septembre 2012 - 01:34 .