• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[JASS] AI triggering problems

Status
Not open for further replies.
Level 3
Joined
Jan 13, 2010
Messages
27
Hi all, i'm kinda new to Jass triggering so if anyone could help me with this one please i'd appreciate it.

Well the problem: when i make a hero spell based on item or unit spell, AI heroes don't use the spell. Thats normal so i have to trigger them to use it.

i got problem with heroes using spells based on the item, for example [scroll of healing].

example of trigger i'm using for hero to use normal spell, and it works:
76091120.png


Some of the heroes have more spells based on item spells.

So my question and problem is: how can i make hero use specific spell he's got which is based on item spell. Can someone please show me what should i replace in my trigger, and show me how can i define and make sure AI hero will use exactly the spell i want him to use.

I'd like universal trigger that makes AI heroes use certain spells based on their or their enemies HP status. So can anyone show me the trigger where i'd be able to switch heroes and spells?

Thanks alot for your time.
 
Level 11
Joined
Sep 30, 2009
Messages
697
JASS:
function Trig_OrderIds_Actions takes nothing returns nothing
    call BJDebugMsg(I2S(GetUnitCurrentOrder(GetTriggerUnit())))
endfunction

//===========================================================================
function InitTrig_OrderIds takes nothing returns nothing
    set gg_trg_OrderIds = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_OrderIds, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddAction( gg_trg_OrderIds, function Trig_OrderIds_Actions )
endfunction

Should do it
 
Status
Not open for further replies.
Top