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

Racial abilities

Status
Not open for further replies.
Level 3
Joined
Nov 28, 2010
Messages
42
Hello,

I need your help!

I want to make a new map.
I created a new Race, a Murloc Race.
Now i want to create a unit who buffs only buffs units of the Murloc race.

I dont know how to do that.

So help me please.

Sorry for my bad English.

Minoros
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
Is this a selfcast ability? If it's targeted ability, then you will need to check either when unit begins casting the ability or when it is issued such order. Personally, I would do it via order as that will work in similar fashion like for example Storm bolt (you cannot even cast it on friendly unit), while if you do it via "begins casting an ability" event, the unit will run close to the target first (to spell's range) and then the check will happen.

However it is a bit more complex when done via "order" and I'm not sure if you will understand it, so I will show you the more simple approach with "begins casting an ability".
  • Race check
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Animate Dead
          • (Ability being cast) Equal to Avatar (Neutral)
          • (Ability being cast) Equal to Attribute Bonus
          • (Ability being cast) Equal to Banish
    • Actions
      • Set unit_var = (Target unit of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of unit_var) Not equal to Footman
          • (Unit-type of unit_var) Not equal to Knight
          • (Unit-type of unit_var) Not equal to Rifleman
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop
          • -------- Here can be some error message --------
        • Else - Actions
In the first condition block, you put all abilities that you want to check (all abilities that are castable only on murlocks)
Then you save the targeted unit inside unit variable and instead of using "targeted unit" all the time, you use the variable (this is for efficiency sake).

The second block of conditions checks if the targeted unit is not one of the unit-types - in this case, the unit-types should be your murlock units.
If the targeted unit is not one of those, then the target is not murlock and thus the spell will be cancelled. Else the spell will be cast.
 
Level 3
Joined
Nov 28, 2010
Messages
42
Thank you for your reply!

But i didn't want it to be a targeted ability.

I wanted it to be a passive abillity.

For example: Increases the attack of all Murloc units in range.

Sorry that i didn't mentioned that
 
Level 25
Joined
Sep 26, 2009
Messages
2,381
well, imo the easiest way would be to actually use damage detection system. When unit takes damage, you would check if attacker is murlock. If yes, you check how many other murlocks are nearby and multiply damage dealt by some amount.

However if you want it to be done via something like aura - that you see the increased damage (the +X amount nearby damage value), then you wouldn't need damage detection system, but you would have to have ability based off the item ability "Item - Damage bonus" (or something like that) and periodic trigger, which picks each murlock unit and checks how many units are nearby that picked unit. Then calculate how much damage should the unit get.

The second method, although visible, is much more complicated and less efficient than using DDS.
 
Level 3
Joined
Nov 28, 2010
Messages
42
Thank you again,

I will try out everything tommorow.

If i need help i will report back here.

Minoros
 
Status
Not open for further replies.
Top