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

Help: Making a 'spelltheft' ability.

Status
Not open for further replies.
Level 23
Joined
Jul 18, 2004
Messages
1,862
Hey there, I'm in a bit of a pickle.

I'm trying to make a Spell Theft ability. Basically, it's where a hero in my map targets an enemy hero with this ability, and the spelltheft ability gets replaced by a target-specific 'stolen; ability until the first time the 'stolen' ability is cast. When the hero casts this 'stolen' ability, it is removed and replaced by Spelltheft again. Here's what I got sofar:

Code:
SpellTheft Activate
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Spell Theft (Thauma)
    Actions
        Unit - Remove Spell Theft (Thauma) from (Triggering unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Target unit of ability being cast)) Equal to Mountain King
            Then - Actions
                Unit - Add Taunt (Spelltheft) to (Casting unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Target unit of ability being cast)) Equal to General
            Then - Actions
                Unit - Add Summon Assassin (Spelltheft) to (Casting unit)
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Unit-type of (Target unit of ability being cast)) Equal to Archer
            Then - Actions
                Unit - Add Tracking Arrow (Spelltheft) to (Casting unit)
            Else - Actions
etc
etc
etc

With this as a resetter:

Code:
Spelltheft Reset
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        And - All (Conditions) are true
            Conditions
                ((Unit-type of (Casting unit)) Equal to Thaumaturgist (Empowered)) or ((Unit-type of (Casting unit)) Equal to Thaumaturgist)
                (Ability being cast) Not equal to Banish (Thauma)
                (Ability being cast) Not equal to Power Overwhelming (Thauma)
                (Ability being cast) Not equal to Invigorate (Thauma)
                (Ability being cast) Not equal to Spell Theft (Thauma)
                (Ability being cast) Not equal to Mana Shield (Thauma)
                (Ability being cast) Not equal to Monsoon (Thauma)
    Actions
        Wait 1.00 seconds
        Unit - Remove (Ability being cast) from (Casting unit)
        Wait 0.10 seconds
        Unit - Add Spell Theft (Thauma) to (Casting unit)


This doesnt work. The Spelltheft ability is removed, yes, but not replaced with a new ability. I simply cant understand how a trigger THIS simple cannot work. Please help!
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • SpellTheft Activate
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Spell Theft (Thauma)
    • Actions
      • Unit - Remove Spell Theft (Thauma) from (Triggering unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Target unit of ability being cast)) Equal to Mountain King
          • Then - Actions
            • Unit - Add Taunt (Spelltheft) to (Casting unit)
          • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Unit-type of (Target unit of ability being cast)) Equal to General
              • Then - Actions
                • Unit - Add Summon Assassin (Spelltheft) to (Casting unit)
              • Else - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Unit-type of (Target unit of ability being cast)) Equal to Archer
                  • Then - Actions
                    • Unit - Add Tracking Arrow (Spelltheft) to (Casting unit)
                  • Else - Actions


  • Spelltheft Reset
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Unit-type of (Casting unit)) Equal to Thaumaturgist (Empowered)) or ((Unit-type of (Casting unit)) Equal to Thaumaturgist)
      • (Ability being cast) Not equal to Banish (Thauma)
      • (Ability being cast) Not equal to Power Overwhelming (Thauma)
      • (Ability being cast) Not equal to Invigorate (Thauma)
      • (Ability being cast) Not equal to Spell Theft (Thauma)
      • (Ability being cast) Not equal to Mana Shield (Thauma)
      • (Ability being cast) Not equal to Monsoon (Thauma)
    • Actions
      • Wait 1.00 seconds
      • Unit - Remove (Ability being cast) from (Casting unit)
      • Wait 0.10 seconds
      • Unit - Add Spell Theft (Thauma) to (Casting unit)
Replace all casting units with triggering unit.
 
Level 23
Joined
Nov 29, 2006
Messages
2,482
Triggering Unit always respond to the unit which is triggering the trigger, go and figure:p
Casting unit is basically a wrapper of triggering unit, except that it is overwritten or lost after waits. Triggering Unit is a somewhat 'local' response and will work properly even with waits.
 
Level 23
Joined
Jul 18, 2004
Messages
1,862
Triggering Unit always respond to the unit which is triggering the trigger, go and figure:p
Casting unit is basically a wrapper of triggering unit, except that it is overwritten or lost after waits. Triggering Unit is a somewhat 'local' response and will work properly even with waits.

And yet still even with the trigger rewritten to use 'Triggering Unit', the trigger does not work. So..

.. what could be the problem?
 
Status
Not open for further replies.
Top