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

Item that gives ranged attack {to hero}

Status
Not open for further replies.
Level 4
Joined
Oct 11, 2008
Messages
90
There are more threads like this one on the hive, but none of them is solved, and none of them has a good answer.
I have a melee hero that picks up an item. When it has the item, it has 500 ranged attack. After it drops the item, is becomes melee again. I have thought of 3 possible solution until now:
1. Use an upgrade like Long Rifles. When the hero picks up the item, set level of upgrade for the right player to 1. Problem: It's ok when the hero picks up the item, but when he drops it, i can't unlearn the research, so the hero will always have ranged attack.
2. Use the orb effect that enables attack 2. I set the attack 2 of the hero to ranged and i give the item an orb ability like "item fire bonus damage". Problem: The hero uses attack 2 (ranged) only on flying units. But if i add the "Ground" to combat - targeting units, the hero will use attack 1 again.
3. Use the chaos ability to replace the melee hero with a ranged one. Problem: Practically impossible becouse the hero has almost 20 different proper names.

So if anyone can come up with a good idea... or if anyone managed to make an item that gives ranged attack without replacing the unit plz help. +rep.
 
Level 9
Joined
Dec 17, 2008
Messages
499
Sorry, only way I can think of is making a 2nd unit with a ranged attack and replacing it :/
 
Level 10
Joined
Jan 28, 2009
Messages
442
Demon hunter ultimate, metamorphosis. If I'm not wrong, it changes the unit without changing its proper name. Just be sure the second unit has the same list of proper names. Doesn't that work? I'm really sure, actually. But I'll test it later.
Oh but I forgot it makes use of different animations. Don't know if that'll be a real problem.
 
Level 4
Joined
Oct 11, 2008
Messages
90
Demon hunter ultimate, metamorphosis. If I'm not wrong, it changes the unit without changing its proper name. Just be sure the second unit has the same list of proper names. Doesn't that work? I'm really sure, actually. But I'll test it later.
Oh but I forgot it makes use of different animations. Don't know if that'll be a real problem.

That will do it, but it's about an item, not a spell. And demon hunter's ulti has a limited duration and then will expire.
 
Level 10
Joined
Jan 28, 2009
Messages
442
Oh yeah, duration. I was thinking making it a usable item with metamorphosis, and maybe create a trigger that orders the hero to activate it after picking it up, but the duration is a problem, yes. Then the trigger could start a timer when it's picked up and activated, and when that timer expires, the item is activated again. I know, this is a stupid sollution. And what about the cooldown timer and all? You can't really do it without having the player notice it's an ability.
 
Level 11
Joined
Jul 28, 2007
Messages
920
Oh yeah, duration. I was thinking making it a usable item with metamorphosis, and maybe create a trigger that orders the hero to activate it after picking it up, but the duration is a problem, yes. Then the trigger could start a timer when it's picked up and activated, and when that timer expires, the item is activated again. I know, this is a stupid sollution. And what about the cooldown timer and all? You can't really do it without having the player notice it's an ability.

You can set time to 0 .
 
Level 4
Joined
Oct 11, 2008
Messages
90
Ok, let's say that i give a metamorphosis ability to to unit. First, the player can activate it whenever he wants to gain the ranged attack. Even if i order the unit to activate it only when it picks up the item, then what happens when the unit drops the item? I can't cancel the metamorphosis.
 
Level 10
Joined
Jan 28, 2009
Messages
442
Ok, let's say that i give a metamorphosis ability to to unit. First, the player can activate it whenever he wants to gain the ranged attack. Even if i order the unit to activate it only when it picks up the item, then what happens when the unit drops the item? I can't cancel the metamorphosis.

You make the Metamorphosis ability an Item ability, and give it to the item (not the unit). When picked up, the unit picking it up is ordered to use the item. When it drops the item, it no longer has the item ability, and thus the effect ends automatically, at once.
 
Level 4
Joined
Oct 11, 2008
Messages
90
Works with the Robo Goblin Ability. But it only works this way: i make a robo roblin ability that changes the unit to a ranged one, but i make it a hero ability and add it to the hero. When the hero picks up the item, order it to activate, when it drops it, order it to deactivate. This works fine until now. Problem: The robo ability is visible and the player can click it any time to aquire the ranged attack. If it only wasn't visible to the player it would be perfect. I know there is a thing with the Channel ability that can make spell icons not to appear, but i never used that. Anyone knows how?
 
Level 9
Joined
Dec 17, 2008
Messages
499
There is a field saying something like "Show ability button" or something like it. Look for it and change it to No.
 
Level 4
Joined
Oct 11, 2008
Messages
90
There is a field saying something like "Show ability button" or something like it. Look for it and change it to No.

There isn't such a thing like "Show ability button" for a normal spell. Only for Channel ability. But that's what i'm saying, i don't know how to make a Channel spell based on a Robo Goblin Spell.
 
Level 10
Joined
Jan 28, 2009
Messages
442
I don't understand why it must be a hero ability. Make a dummy item. Let the trigger ask if the unit acquiring the dummy item has the unit type of the hero you want to be able to become ranged. If the hero is the correct type, replace the dummy item with an item with "RoboGoblin" ability, and force the hero to use it. When it's dropped, replace it again, now with the dummy item.
The unit will go back to its original form right after it loses the item. I've done something similar before.
 
Level 4
Joined
Oct 11, 2008
Messages
90
I have thought of a trigger that replaces the unit with a ranged one when the melee unit picks the item.

  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • (Item level of (Item being manipulated)) Equal to 4
    • (Unit-type of (Hero manipulating item)) Equal to Warrior
  • Actions
    • Wait 1.00 seconds
    • Unit - Replace (Hero manipulating item) with a Warrior (Ranged) using The old unit's relative life and mana
Problem: The trigger repeats itself forever. Why? Becouse replacing the unit means removing the unit, creating another unit instead and transferring all the items from the previous unit to the new unit. Hero's proper name remains the same, that is good. How can i change this so i won't repeat forever?
 
Level 4
Joined
Oct 11, 2008
Messages
90
Ok, i've done so far with the unit aquires an item, and it works. Here is the trigger:

  • Events
    • Unit - A unit Acquires an item
  • Conditions
    • (Item level of (Item being manipulated)) Equal to 4
    • (Unit-type of (Hero manipulating item)) Equal to Warrior
  • Actions
    • For each (Integer A) from 1 to 6, do (Actions)
      • Loop - Actions
        • Set Item[(Integer A)] = (Item carried by (Hero manipulating item) in slot (Integer A))
        • Hero - Drop Item[(Integer A)] from (Hero manipulating item)
    • Unit - Replace (Hero manipulating item) with a Warrior (Ranged) using The old unit's relative life and mana
    • For each (Integer A) from 1 to 6, do (Actions)
      • Loop - Actions
        • Hero - Give Item[(Integer A)] to (Last replaced unit)
    • Selection - Select (Last replaced unit) for (Owner of (Last replaced unit))
But now the problem is when the hero drops the item, it has to become melee again. And the reverse trigger for dropping the item is running forever now.

EDIT: OK Reaper, ill try it with the Chaos ability too.

EDIT2: OMG, that was so easy. Chaos ability solved it all. Thx Reaper. +rep to you and all guys who helped me here.
 
Last edited:
Status
Not open for further replies.
Top