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

[Spell] A soul gem that only targets a particular hero

Status
Not open for further replies.
Level 3
Joined
Aug 8, 2020
Messages
25
Im working on a map where the player's goal is to capture a certain hero (out of many) and bring the soul bearing gem back to base.

How exactly can I do this regarding the target; if I set it to heroes the soul capture ability would be able to be used on any hero on the battlefield, what exactly do I need to do to make it so that it can target and be used on a particular hero and that hero only.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,536
I'm not sure how your map works exactly but maybe this will help.

Add the units that you want to be "capturable" to a Unit Group:
  • Setup Soul Steal Group
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Add Paladin 0002 <gen> to Soul_Group
      • Unit Group - Add Archmage 0003 <gen> to Soul_Group
      • Unit Group - Add Mountain King 0004 <gen> to Soul_Group
Then trigger the use of the Soul Steal ability.
If the Target is NOT in Soul_Group then the caster is ordered to Stop and an error message is displayed. Otherwise, the target is stolen.
  • Cast Soul Steal
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Soul Steal (Custom Ability)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is in Soul_Group.) Equal to False
        • Then - Actions
          • Unit - Order (Triggering unit) to Stop.
          • Set VariableSet Temp_PlayerGroup = (Player group((Triggering player)))
          • Game - Display to Temp_PlayerGroup for 5.00 seconds the text: You cannot target t...
          • Custom script: call DestroyForce (udg_Temp_PlayerGroup)
          • -------- --------
          • -------- Not sure if this next line is needed but it would prevent the target from being stolen again: --------
          • Unit Group - Remove (Target unit of ability being cast) from Soul_Group.
        • Else - Actions
          • Unit - Change ownership of (Target unit of ability being cast) to (Triggering player) and Change color
You can modify the above trigger to work how you'd like for your Soul Capture ability.
 

Attachments

  • Soul Steal Example.w3m
    18.2 KB · Views: 15
Last edited:
Level 20
Joined
Apr 12, 2018
Messages
494
You could work with classifications. Maybe use Ancient or something to differentiate the valid targets. Triggers are nice since you have complete control over everything.
Classifications work, but you would not need to use triggers at all in this case-- the UI will helpfully tell you the target is invalid. One of my favorite tricks is to use the Suicidal tag because that is very commonly used to exclude units from certain activities (like boarding transports) and if you don't need it for the other purposes you an easily distill it down to a handful of units using it (generally the Golbin Sapper). Although truthfully there's no such thing as Ancient Heroes by default, you might get that Hero affected by things that affect Ancients).
 
Level 3
Joined
Aug 8, 2020
Messages
25
Classifications work, but you would not need to use triggers at all in this case-- the UI will helpfully tell you the target is invalid. One of my favorite tricks is to use the Suicidal tag because that is very commonly used to exclude units from certain activities (like boarding transports) and if you don't need it for the other purposes you an easily distill it down to a handful of units using it (generally the Golbin Sapper). Although truthfully there's no such thing as Ancient Heroes by default, you might get that Hero affected by things that affect Ancients).

So you're saying just give it the suicide classification and make the soul gem ability target only suicidal hero?
Sounds good, but will there be any side effects to this?
 
Level 1
Joined
Mar 24, 2017
Messages
7
ok so the hero that is inteded to be caught by the spell should have 1) hero classification 2) suicide classification
 
Level 3
Joined
Aug 8, 2020
Messages
25
@Ghost23 That is correct, also make sure that the spell can only target units that are suicidal and hero, that way only the unit that you're intending to catch can be caught by the spell
 
Status
Not open for further replies.
Top