Aller au contenu

Photo

Beholder antimagic on Cast Spell: Unique Item use


  • Veuillez vous connecter pour répondre
3 réponses à ce sujet

#1
Seter

Seter
  • Members
  • 5 messages
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.

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
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());

}

#3
Seter

Seter
  • Members
  • 5 messages
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.

#4
ffbj

ffbj
  • Members
  • 593 messages
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 .