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

Triggered spell help

Status
Not open for further replies.
Level 6
Joined
Aug 29, 2004
Messages
159
hey guys, i'm making a footman wars map with custom heroes, one of which is an Archon (ie starcraft) who has the ability to transform back and forth into a Dark Archon. They have abilities which share a common theme (ie Psionic Storm to Maelstrom, Hallucination to Mind Control), which i want to transfer as he transforms. Ie if he has lv3 Hallucination as an Archon and transforms to a Dark Archon, he will have Lv3 Mind Control.
So far i have decided that the transformation needs to be based off 'Bear Form', with two alternate heroes, primarily so that the learning of skills makes sense. Does anyone know a way to to do the triggers such that it will find the level of his ability before he morphs, and then change the level of the secondary ability after the morphing is done?
BTW it is a 12 player map so it needs to work multiplayer, but not simultaneously for the same player.
Any ideas?
Bort
 
Level 6
Joined
Mar 18, 2005
Messages
153
here's an example:

Code:
bearform
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Unit-type of (Triggering unit)) Equal to Wild Druid
        (Ability being cast) Equal to Bear Form (hero)
    Actions
        Set abilitylevel[1] = (Level of Rejuvenation (hero) for (Triggering unit))
        Set abilitylevel[2] = (Level of Summon Wolves  for (Triggering unit))
        Set abilitylevel[3] = (Level of Brilliance Aura  for (Triggering unit))
        Wait until (((Unit-type of (Triggering unit)) Equal to Wild Druid (bearform 1)) or ((Unit-type of (Triggering unit)) Equal to Wild Druid (bearform 2))), checking every 0.10 seconds
        Unit - Remove Rejuvenation (hero) from (Triggering unit)
        Unit - Remove Summon Wolves  from (Triggering unit)
        Unit - Remove Brilliance Aura  from (Triggering unit)
        Player - Disable Rejuvenation (hero) for (Owner of (Triggering unit))
        Player - Disable Summon Wolves  for (Owner of (Triggering unit))
        Player - Disable Brilliance Aura  for (Owner of (Triggering unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                abilitylevel[1] Greater than 0
            Then - Actions
                Unit - Add Howl of Terror (hero) to (Triggering unit)
                Unit - Set Level of Howl of Terror (hero) for (Triggering unit) to abilitylevel[1]
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                abilitylevel[2] Greater than 0
            Then - Actions
                Unit - Add Summon Claw  to (Triggering unit)
                Unit - Set Level of Summon Claw  for (Triggering unit) to abilitylevel[2]
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                abilitylevel[3] Greater than 0
            Then - Actions
                Unit - Add Thorns Aura  to (Triggering unit)
                Unit - Set Level of Thorns Aura  for (Triggering unit) to abilitylevel[3]
            Else - Actions


undobearform
    Events
        Unit - A unit Begins casting an ability
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Unit-type of (Triggering unit)) Equal to Wild Druid (bearform 1)
                (Unit-type of (Triggering unit)) Equal to Wild Druid (bearform 2)
        (Ability being cast) Equal to Bear Form (hero)
    Actions
        Set abilitylevel[1] = (Level of Howl of Terror (hero) for (Triggering unit))
        Set abilitylevel[2] = (Level of Summon Claw  for (Triggering unit))
        Set abilitylevel[3] = (Level of Thorns Aura  for (Triggering unit))
        Wait until ((Unit-type of (Triggering unit)) Equal to Wild Druid), checking every 0.10 seconds
        Unit - Remove Howl of Terror (hero) from (Triggering unit)
        Unit - Remove Summon Claw  from (Triggering unit)
        Unit - Remove Thorns Aura  from (Triggering unit)
        Player - Enable Rejuvenation (hero) for (Owner of (Triggering unit))
        Player - Enable Summon Wolves  for (Owner of (Triggering unit))
        Player - Enable Brilliance Aura  for (Owner of (Triggering unit))
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                abilitylevel[1] Greater than 0
            Then - Actions
                Unit - Add Rejuvenation (hero) to (Triggering unit)
                Unit - Set Level of Rejuvenation (hero) for (Triggering unit) to abilitylevel[1]
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                abilitylevel[2] Greater than 0
            Then - Actions
                Unit - Add Summon Wolves  to (Triggering unit)
                Unit - Set Level of Summon Wolves  for (Triggering unit) to abilitylevel[2]
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                abilitylevel[3] Greater than 0
            Then - Actions
                Unit - Add Brilliance Aura  to (Triggering unit)
                Unit - Set Level of Brilliance Aura  for (Triggering unit) to abilitylevel[3]
            Else - Actions

this has been tested and it works. however beware: rare bugs my appear due to the nature of those weird triggers. e.g. a tome of retraining or a triggered add-another-ability-for-this-unit might mess it as well as fiddling with the level.
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Someone please close this... it was supposed to go into the spells section (and the guy already made this exact thread there as well).

Laosh'Ra... Use "Unit Starts The Event of an ability" as event next time. Overall, pretty nice triggers. But you didn't have the disable the abilities, since you removed them anyway. And first condition of the second trigger is wrong. ;) It makes the trigger not work just because both conditions can never be fulfilled at the same time. And since you removed the abilities, you can enable them anyway, because they won't work. ;) Unit doesn't have them anyway.

And Tome of Retraining causes no problems... Because when morphing unit cannot really use tome until morphing is finished. If not, a protective trigger can be easily made.

~Daelin
 
Status
Not open for further replies.
Top