How do I prevent a NON-PLAYER unit from casting a spell it has?

Status
Not open for further replies.
Level 4
Joined
Sep 22, 2011
Messages
70
Hey, i'm trying to make a boss-style fight in a semi-RPG map, and My boss has several abilities, They are:
Fireball: Hurls a ball of fire at a random enemy target every 5sec once the Fire Lord reaches 65% health, the Fireball deals 895 damage and stuns the target for 2sec. The Fire lord will stop casting this ability once his health drops below 30%.
Soul Burn: Burns the soul of a random enemy target for 254 damage every 5sec. and reduces their damage done by 15%, and silences them for the duration.
Spawn Fire Elementals: At 75 and 15% health the Fire lord will teleport back to the Firelands, becoming unattackable. When he does this he will spawn 8 Fire Elementals to attack the players. Once the last elemental dies, the Fire lord will return to the battle.
Volcano: Once the Fire Lord reaches 15% health, he will summon a volcano at the position of a random enemy player once every 6sec. The volcano will do 2579 damage every 3sec to all players within the AoE Range of the volcano. Each Volcano will last for 9sec.

Now, having all that info, I have the triggers for the spells and the spells themselves all done and all.
My problem: My fire lord boss casts spells when I don't want him to.. For example, if only one unit attacks him, he will spam Fireball on CD, if more then one unit attacks him then he will cast Spawn Fire Elementals everytime he can, which means once he returns to the platform, he casts it again, preventing the player's hero's from doing any damage to the fire lord.

What I need: To prevent the firelord from casting these spells until I want him to. The only thing I can think of would be to remove the spells from the fire lord, and add them individually when I want him to cast it, then remove it again when I don't want him casting it.. But i'm sure that would spur up some other problem of some kind. I basically just dont want him to cast any spells until the triggers order him to cast the spell, but I dont know how to do that
 
Level 4
Joined
Sep 22, 2011
Messages
70
ok so my triggers are set up this way:
  • Soul Burn Start
    • Events
      • Unit - Rayvan 0034 <gen>'s life becomes Less than ((Life of Rayvan 0034 <gen>) x 0.95)
    • Conditions
    • Actions
      • Trigger - Turn on Soul Burn Cast <gen>
      • Unit - Add Soul Burn (Rayvan) to Rayvan 0034 <gen>
      • Trigger - Turn off (This trigger)
  • Soul Burn Cast
    • Events
      • Time - Every 12.00 seconds of game time
    • Conditions
    • Actions
      • Unit - Order Rayvan 0034 <gen> to Neutral Fire Lord - Soul Burn (Random unit from (Units in Rayvans Platform <gen> owned by (Random player from (All enemies of Neutral Hostile))))
      • Game - Display to (All players) the text: Rayvan Burns the so...
  • Soul Burn Stop
    • Events
      • Unit - Rayvan 0034 <gen>'s life becomes Less than ((Life of Rayvan 0034 <gen>) x 0.50)
    • Conditions
    • Actions
      • Trigger - Turn off Soul Burn Cast <gen>
      • Unit - Remove Soul Burn (Rayvan) from Rayvan 0034 <gen>
      • Game - Display to (All players) the text: Rayvan's Power is w...
Now, the start and end triggers will add the ability and then remove it, having it set up this way will work correct?
 
Level 11
Joined
Jul 9, 2009
Messages
926
You can also do

A Units Starts the effect of an ability

Ability being cast = Fireball

If Casting Unit's HP is not equal to or less than 60 then order unit to attack target of ability being cast

cause there may be a change if then action is order unit to stop, he may spam the ability and he may not attack because he may stop every attack making him unable to attack.
 
Status
Not open for further replies.
Top