| 04-04-2004, 07:00 PM | #1 |
Ok, I've got a stupid question and I feel stupid asking it but... How do we attach triggers to spell? Ok what I've done is: Event: A unit'x' begins casting an ability condition: cast spell equal to dummy spell1 action: .... Event: A unit'x' begins casting an ability condition: cast spell equal to dummy spell2 action: .... Event: A unit'x' begins casting an ability condition: cast spell equal to dummy spell3 action: .... Event: A unit'x' begins casting an ability condition: cast spell equal to dummy spell4 action: .... Ok so these are my four triggers and the same unit, depending on the spell he cast, will make different action. The problem is that the condition isnt working and that the four action runs...:S Hope you can help me! Thank |
| 04-04-2004, 07:31 PM | #2 |
Here is a trigger base spell for my map. Code:
Charging Slash
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Charging Slash
Actions
Set HeroArray[11] = (Casting unit)
Sound - Play InvisibilityTarget <gen> at 100.00% volume, attached to HeroArray[11]
Unit - Turn collision for HeroArray[11] Off
Special Effect - Create a special effect attached to the origin of HeroArray[11] using Abilities\Spells\NightElf\TargetArtLumber\TargetArtLumber.mdl
Set SFX_Array[33] = (Last created special effect)
Unit - Create 1 DashDummyUnit for Neutral Passive at (Position of HeroArray[11]) facing Default building facing degrees
Set DummyUnitArray[38] = (Last created unit)
Unit - Make DummyUnitArray[38] Invulnerable
Wait 0.30 seconds
Unit - Move HeroArray[11] instantly to (Target point of ability being cast)
Wait 0.10 seconds
Animation - Play HeroArray[11]'s Attack animation
Floating Text - Create floating text that reads (String(i[8])) at (Position of HeroArray[11]) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 0.00%), and 0.00% transparency
Wait 0.10 seconds
Unit - Move HeroArray[11] instantly to (Position of DummyUnitArray[38])
Unit - Turn collision for HeroArray[11] On
Unit - Remove DummyUnitArray[38] from the game
Wait 0.20 seconds
Special Effect - Destroy SFX_Array[33]
Wait 0.50 seconds
Floating Text - Destroy (Last created floating text)Feel free to use but give me credit. The spell to use would be Storm Bolt. Also the variable i[8] is an interger I set it to the damage amount of the storm bolt when the hero learns a level. Here is the Second Part: Code:
Charging Slash Skill
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Charging Slash
Actions
Wait 0.40 seconds
If ((Level of Charging Slash for (Triggering unit)) Equal to 1) then do (Set i[8] = 75) else do (Do nothing)
If ((Level of Charging Slash for (Triggering unit)) Equal to 2) then do (Set i[8] = 150) else do (Do nothing)
If ((Level of Charging Slash for (Triggering unit)) Equal to 3) then do (Set i[8] = 225) else do (Do nothing)
If ((Level of Charging Slash for (Triggering unit)) Equal to 4) then do (Set i[8] = 300) else do (Do nothing)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Charging Slash for (Triggering unit)) Equal to 5
Then - Actions
Set i[8] = 375
Trigger - Turn off (This trigger)
Else - Actions
Do nothing |
| 04-04-2004, 07:52 PM | #3 |
Thanks but this isn't really what I wanted. The actions works but they all works when he cast an ability. I want the event for only one spell... gonna try something. |
| 04-04-2004, 08:19 PM | #4 | |
Quote:
Yeah guess I misunderstood your question and still don't understand what you want to do exactly. From what I read it sounds like you couldn't get the condition to of the specific ability. Do you want a specific unit cast a spell or a generic unit? Or do you want to cast multiple spells off of one spell? If so you might just want to add the action run trigger. |
| 04-04-2004, 08:25 PM | #5 |
Could it be that you used the same base ability for all these spells ? |
| 04-04-2004, 08:49 PM | #6 | |
Quote:
|
| 04-04-2004, 09:51 PM | #7 |
On a side note, you should use a unit starts the effect of an ability instead of a unit begins casting an ability, cause that event fires before the hero spends mana / cooldown |
