Page 1 of 1

Item OnHit:Cast Spells explanations

Posted: Sat May 28, 2005 7:45 am
by JollyOrc
Hi,

Code: Select all

// the arrows this script is attached to will kill Monster X instantly.
// otherwise they are more or less useless.

#include "x2_inc_switches"

void main()
{
    int nEvent = GetUserDefinedItemEventNumber();

    if (nEvent ==  X2_ITEM_EVENT_ONHITCAST)
    {
        object oTarget = GetItemActivatedTarget();
        if (GetTag(oTarget)=="TagOfMonsterX")
            ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectDeath(0,TRUE),oTarget);
    }
}
assuming I got the tag based scripting part right, why isn't this working ?

Posted: Sat May 28, 2005 8:17 am
by Jonezie
SHould be:

Code: Select all

object oTarget = GetSpellTargetObject();

Posted: Sat May 28, 2005 10:19 am
by JollyOrc
that works, thanks.

Posted: Sat May 28, 2005 10:23 am
by Jonezie
:good:

Posted: Sat May 28, 2005 10:28 pm
by Chemical-Burn
Is that a recipe for turkey stuffing?

Posted: Sat May 28, 2005 11:28 pm
by JollyOrc
no it's the essence of a new type of critters and weapons against them on Catara.

Where you've got to do some research before you can actually hurt some big nasty things.