Item OnHit:Cast Spells explanations

Moderator: Event DM

Post Reply
User avatar
JollyOrc
Elder Sage
Posts: 3984
Joined: Fri Jan 17, 2003 11:41 am
Timezone: Europe, CE(S)T
Location: Germany
Contact:

Item OnHit:Cast Spells explanations

Post by JollyOrc » Sat May 28, 2005 7:45 am

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 ?
User avatar
Jonezie
Team Member; Retired with Honors
Posts: 3905
Joined: Wed Jun 09, 2004 7:05 am
Location: Melbourne (GMT +10)

Post by Jonezie » Sat May 28, 2005 8:17 am

SHould be:

Code: Select all

object oTarget = GetSpellTargetObject();
User avatar
JollyOrc
Elder Sage
Posts: 3984
Joined: Fri Jan 17, 2003 11:41 am
Timezone: Europe, CE(S)T
Location: Germany
Contact:

Post by JollyOrc » Sat May 28, 2005 10:19 am

that works, thanks.
User avatar
Jonezie
Team Member; Retired with Honors
Posts: 3905
Joined: Wed Jun 09, 2004 7:05 am
Location: Melbourne (GMT +10)

Post by Jonezie » Sat May 28, 2005 10:23 am

:good:
Chemical-Burn
Scholar
Posts: 1099
Joined: Mon Jun 07, 2004 11:42 am
Timezone: PST -8
Location: McMinnville, OR GMT-8 (-7)

Post by Chemical-Burn » Sat May 28, 2005 10:28 pm

Is that a recipe for turkey stuffing?
User avatar
JollyOrc
Elder Sage
Posts: 3984
Joined: Fri Jan 17, 2003 11:41 am
Timezone: Europe, CE(S)T
Location: Germany
Contact:

Post by JollyOrc » Sat May 28, 2005 11:28 pm

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.
Post Reply