• 🏆 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!

Basic GUI Attack Spell For AI

Basic GUI Attack Spell For AI

Okay this is a basic system only using 4 triggers to create a unit that when attacks makes a unit cast a spell.

Step #1: Create a unit and change HP ect to your likeings BUT >>>>IMPROTANT<<<< Shift Enter Or Shift double click the attack damage field and put -1.00 there After that go to Damage number of sides and damage and set that to 1,1 and your unit has 0 damage.


Step #2: Make a spell based of Breath of fire if this is for a user or player create a Tool Tip if not Forget about TT for the moment becuase a user will not see the TT. After that make the AOE 40 and Final Area 40 to create a Shockwave effect with the depression behind it making it look more life like. If you want to remove the buff and the effect of the spell go to buffs and remove the buff and go to duration and set it to 0.01 for both Normal And Hero if you have it 0 the spell wont work and if you have it for mre than your cooldown the ability wont do anything untill the set time has run out eg

Duration - normal: 2
Duration - Hero 0.5
The normal unit cant be hurt for 2 seconds and the hero cant be hurt for 0.5 seconds by any spell based of Breath Of Fire
So the optimal Setting would be

Duration - Normal: 0.01
Duration - Hero: 0.01
Buffs: ** NONE **
This will create a spell like a normal attack. The cooldown on the spell doesnt matter becuase the spell is only triggered when the unit is attacked. Okay set the maxuimum damage 10 more than the damage you want done eg.
WRONG ONLY DEALS 10 DMG
Damage Dealt: 100
Maximuim Damage Dealt: 10
See the maxuimum damage set how much the spell can do over all the damage dealt is the minuim damage dealt but is overided by the Maximuin Damage being lower

Correct way of doing this:
Damage Dealt: 100
Maximuim Damage Dealt: 110
This 110 allows armor bonuses becuase spells do not do damage like chaos they are based of the Spell Damage.

okay for this you will just need to change the range to 40 and art to Spawned Effects and what ever blood effect you want and change the missile speed to 1560 wich is what i find great for melee attacks


Step #3: Create 2 varibles with arrays. 1st Variable is a Point called Point,Postion,Location ect ( to make it easier for beginers to see what i am doing) and another Variable of Unit Called unit,Triggering_unit, Trigger_unit ect. So you should have 2 varibles now A Point And A Unit Varible With Arrays.

Step #4: Give the newley created spell to The unit you want to cast the spell

Step #5: Okay create a trigger like this:-
  • Dummy Attack
  • Events
    • Unit - A unit is attacked
  • Conditions
    • (Unit type of (Attacking unit)) Equal to (** Enter Your Unit**)
  • Actions
    • Set Unit[1] = (Triggering Unit)
    • Set Point[1] = (Postition Of (Unit[1]))
    • Set Unit[2] = (Attacking Unit)
    • Unit - Order Unit[2] To Neutral Panderan Brewmaster - Breath Of Fire Point[1]
    • Custom Script: Call RemoveLocation( udg_Point[1] )
And you are now done and you can create AI or Player Line/Splash Spells


To do this go to the unit casting the spell and go to
Art - Cast Backswing and
Art - Cast Point
and set them both to 0 to create instant casting spells!



Part 2 Making a specific unit cast a spell when life is less or equal to 210

Okay i am going to use a footmans defend ability to cast defend when his life is less then or equal to 210 to do this you will need 2 varibles 1. A unit Varible lets call it Defending Caster and a second Veribles Unit group with an array to (why an array?: Becuase with an array of unit groups you dont need to have a billion small non array varibles!) Lets call it uhm INT_Group

Step 1: Okay make a trigger like this

[trigger=INT Trigger]
Events
Map Initialization
Conditions

Actions
Player - set the current research level of Defend to 1 for Player1 (Red)
Set Variable - INT_Group[1] = (unit in (playable map))
Unit Group - Pick every unit in INT_Group[1] and do (Actions)
Loop - Actions
Add to Defend <gen>( Created Later ) the event ( Unit - (picked Unit)'s life become less then or equal to 120)[/trigger]


Okay now we have created a Int trigger to pick the specific unit to cast now we have to make a trigger called defend to make that unit defend!

[trigger=Defend]
Events

Conditions
(Unit type of (triggering unit)) is equal to footman
Actions
Set Variable - Defending_Caster (triggering unit)
Unit - Order Defending_Caster to Defend
[/trigger]


Okay thats basicly the whole trigger you can basicly manipulate this trigger to do cast just about anything from warstomp to custom triggered spells it can be all created rom this 1 trigger

To make it cast a unit just add a unit verible and oder Defending_Caster to cast on that unit! so you can create Chain lightning to warstomp, finger of death these 2 triggers can be used for just about any spell
 
Last edited:
It is a little disorganized and lacking more information. You should generally give actual examples rather than saying stuff like <Insert name here> and things to leave the reader confused.

Then you added a different part that discussed a different topic, so it was a little unclear.

Please reformat your tutorial if you can. =) Update/notify me if you want to improve this tutorial, else it will go to the graveyard once a week of no changes has passed.

EDIT:

No updates have been made within a week. Please notify me if you are willing to update again/if I have made a mistake.
~Graveyarded.
 
Last edited:
Top