• 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.

Change Range Via An Item

Status
Not open for further replies.
Level 4
Joined
Jun 4, 2009
Messages
52
So far, I have :

Secret Ranged Weapon
Events
Unit - A unit Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to Secret |CFFFF0303Ranged|r Weapon
Actions

What I want to be done is have the hero take the item, have the unit change their range from melee to 500, and after they attack a barrel of explosives, the item is removed and the range of the hero is changed back. Also while this happens, after the barrel of explosives is attacked, all barrels in X region explode, killing the 2 footmen in the area.
I am quite 'noobish' when it comes to mapmaking, but, I really want to learn. (Starting off with GUI of course, and maybe working my way to JASS. :D).

+Rep to those who help me.
Thanks for your time.

Fixed, added rep, although, I don't know why you removed your post.
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,243
Create a duplicate of your hero in object manager, just set his attack range to a different value.

Make a trigger that detects when the item is picked up. Then replace the unit with the duplicate. You have to save the unit's ability levels, and then restore them for the new unit. You don't have to save items or hero level, those are automatically transferred.

Have another trigger detect when the item is not in inventory, and do the replacing again.

I'll try to look up if there's a JASS function to change unit's range, that would be much easier way.


The barrell thing:

  • Trigger
    • Events - Destructible dies // set this to be the barrell
    • Conditions
    • Actions
      • Set TempLoc1 = (Position of (Triggering unit))
      • Set TempGroup = (Units within 512.00 of TempLoc1)
      • Unit Group - Pick every unit in TempGroup and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Custom script: call DestroyGroup(udg_TempGroup)
      • Custom script: call RemoveLocation(udg_TempLoc1)
 
Status
Not open for further replies.
Top