• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Cast a ability

Status
Not open for further replies.
Level 4
Joined
Aug 28, 2015
Messages
75
Hello, I need help ... I wonder how it can be done for a unit to be created with an effect (not the spell) as anti-magic shield or divine shield, which granted a passive as magic resistance, increased damage or defense, that permanent... Thanks :goblin_good_job:
 
Level 5
Joined
Jan 17, 2014
Messages
131
Hello, I need help ... I wonder how it can be done for a unit to be created with an effect (not the spell) as anti-magic shield or divine shield, which granted a passive as magic resistance, increased damage or defense, that permanent... Thanks :goblin_good_job:

Example triggers + an attached test map:

This will add the effect of "Divine Shield" to all Footmen + it will increase their armor by 1.

  • Effect Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set Effect_Hashtable = (Last created hashtable)
  • Effect Start Units
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Effect_Group = (Units in (Playable map area))
      • Unit Group - Pick every unit in Effect_Group and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Picked unit)) Equal to Footman
            • Then - Actions
              • Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Human\DivineShield\DivineShieldTarget.mdl
              • Hashtable - Save Handle Of(Last created special effect) as 1 of (Key (Picked unit)) in Effect_Hashtable
              • Unit - Add Item Armor Bonus (+1) to (Picked unit)
            • Else - Actions
              • Unit Group - Remove (Picked unit) from Effect_Group
  • Effect New Units
    • Events
      • Unit - A unit enters (Playable map area)
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Unit Group - Add (Triggering unit) to Effect_Group
      • Special Effect - Create a special effect attached to the origin of (Triggering unit) using Abilities\Spells\Human\DivineShield\DivineShieldTarget.mdl
      • Hashtable - Save Handle Of(Last created special effect) as 1 of (Key (Triggering unit)) in Effect_Hashtable
      • Unit - Add Item Armor Bonus (+1) to (Triggering unit)
  • Effect Remove
    • Events
      • Unit - A unit Dies
      • Unit - A unit leaves (Playable map area)
    • Conditions
      • ((Triggering unit) is in Effect_Group) Equal to True
    • Actions
      • Special Effect - Destroy (Load 1 of (Key (Triggering unit)) in Effect_Hashtable)
      • Hashtable - Clear all child hashtables of child (Key (Triggering unit)) in Effect_Hashtable
      • Unit - Remove Item Armor Bonus (+1) from (Triggering unit)
      • Unit Group - Remove (Triggering unit) from Effect_Group
Or, you can always edit the passive ability to give the effect of your choice and add the ability to the desired unit with the object editor like in the 2nd attached map.
 

Attachments

  • Test Map for AleGamer37.w3x
    13.9 KB · Views: 57
  • Test Map for AleGamer37 (2).w3x
    12.7 KB · Views: 88
Last edited:
Level 4
Joined
Aug 28, 2015
Messages
75
Emm ... always it has to be an ability of an object? Because I want more than anything, that is a passive skill with a particular effect, for example, create a unit called "Gnoll Wizard" and, being a magician, I wanted to add the effect of Divine Shield, but that gives resistance to the magic 60%, and the effect is visible without being a skill, serious, that the effect of magic resistance appears as "this unit has increased its magic resistance," but that does not appear between the skills ...
 
Level 5
Joined
Jan 17, 2014
Messages
131
Emm ... always it has to be an ability of an object? Because I want more than anything, that is a passive skill with a particular effect, for example, create a unit called "Gnoll Wizard" and, being a magician, I wanted to add the effect of Divine Shield, but that gives resistance to the magic 60%, and the effect is visible without being a skill, serious, that the effect of magic resistance appears as "this unit has increased its magic resistance," but that does not appear between the skills ...

You mean that you want the unit to have a buff but not the spell?

P.S. I'm having trouble understanding you. I'm sorry, but your English isn't very good.
 
Level 5
Joined
Jan 17, 2014
Messages
131
This is an example, it adds the buff "Magic Shield" with the effect of "Divine Shield" to all Footmen and also they will take 60% less spell damage. I hope that it is what you want.
 

Attachments

  • Test Map for AleGamer37 (3).w3x
    14.6 KB · Views: 76
Level 5
Joined
Jan 17, 2014
Messages
131
Ops, I disregarded the fact if the unit is revived/reanimated. This updated attached map covers that part too.
 

Attachments

  • Test Map for AleGamer37 (3).w3x
    15.4 KB · Views: 57
Last edited:
Status
Not open for further replies.
Top