• 🏆 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 with unit , doodad , structure & item as target

Status
Not open for further replies.
Level 4
Joined
Dec 22, 2016
Messages
67
Hi. I wanted to create a spell based on channel , that can target unit , tree , structure and item , I know how to do it in object editor , the problem is the trigger. I want it to check if target is a tree or structure , take caster to target , if it is an item , bring it to caster and if it is a unit , bring it to caster and deal damage.
I can't find any condition to detect if target of ability being cast is a tree or structure.

I need it in GUI
 

Jampion

Code Reviewer
Level 15
Joined
Mar 25, 2016
Messages
1,327
The trigger would be like this:
  • Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Channel
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Target unit of ability being cast) Not equal to No unit
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Target unit of ability being cast) is A structure) Equal to True
            • Then - Actions
              • Game - Display to (All players) the text: structure
            • Else - Actions
              • Game - Display to (All players) the text: unit
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Target item of ability being cast) Not equal to No item
            • Then - Actions
              • Game - Display to (All players) the text: item
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Target destructible of ability being cast) Not equal to No destructible
                • Then - Actions
                  • Game - Display to (All players) the text: destructible
                • Else - Actions
You just check if target unit/destructible/item of ability exist.
If it is a unit you check if it is a structure.

I would be interested how you got Channel to be able target trees. I tried it, but i could not target them.
 
Level 8
Joined
Jan 28, 2016
Messages
486
I would be interested how you got Channel to be able target trees. I tried it, but i could not target them.

It's not possible. The only abilities that can target trees are those listed in the trigger action, Issued Order Targeting A Destructable. While I'm at it, I might as well list them here.
  • Attack
  • Right-Click
  • Harvest
  • Night Elf Ancients - Eat Tree
  • Night Elf Huntress - Sentinel
  • Night Elf Mountain Giant - War Club
Units can have their attacks allowed against trees but the attack won't appear in the UI. Not sure about right-click but I know Mountain Giants can right-click a tree to use War Club, as well as casting it manually (same with Harvest; not sure about Eat Tree though).

However I do recall someone here on The Hive creating an ability based on Sentinel which could target trees and units. Think he messed around with the targets to make it work so try taking a look into that.
 
Status
Not open for further replies.
Top