Page 1 of 1

Item OnHit:Cast Spells explanations

PostPosted: Sat May 28, 2005 7:45 am
Author: 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 ?

PostPosted: Sat May 28, 2005 8:17 am
Author: Jonezie
SHould be:

Code: Select all
object oTarget = GetSpellTargetObject();

PostPosted: Sat May 28, 2005 10:19 am
Author: JollyOrc
that works, thanks.

PostPosted: Sat May 28, 2005 10:23 am
Author: Jonezie
:good:

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

PostPosted: Sat May 28, 2005 11:28 pm
Author: 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.