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

Changing Unit Attack

Status
Not open for further replies.
Level 1
Joined
May 22, 2004
Messages
2
Hello guys :)

Is it possible to change a Units Attack after getting an item?

For example:

Hero gets Sniper Rifle item - Range goes up, damage goes up buts speed down
Hero gets Mashine Gun item - Range goes to "normal", damage goes down, but speed goes up
etc.

f its possible, how?
 
Level 1
Joined
May 22, 2004
Messages
2
Thx for the replies :) I tried with Upgrades and well, first it seemed to work.

It is possible for me, that when a Unit has an item and uses it, that attack rate, damage und range gets how i want it to. The problem, when hero drops or uses another weapon the upgrade should go to level 0, but it doens't and we says it isn't possible. Is there any possibility to get the upgrade from level 1 back to 0?
This is the code I am using:
  • Assault Rifle get
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to ItemUsageAssault
    • Actions
      • Player - Set the current research level of Flamethrower to 0 for (Owner of (Triggering unit))
      • Player - Set the current research level of Minigun to 0 for (Owner of (Triggering unit))
      • Player - Set the current research level of Shotgun to 0 for (Owner of (Triggering unit))
      • Player - Set the current research level of Sniper to 0 for (Owner of (Triggering unit))
      • Player - Set the current research level of Submachinegun to 0 for (Owner of (Triggering unit))
      • Player - Set the current research level of AssaultRifle to 1 for (Owner of (Triggering unit))
      • Unit - Remove Flamethrower from (Triggering unit)
      • Unit - Remove Minigun from (Triggering unit)
      • Unit - Remove Shotgun from (Triggering unit)
      • Unit - Remove Sniper from (Triggering unit)
      • Unit - Remove Submachinegun from (Triggering unit)
      • Unit - Add Assault Rifle to (Triggering unit)
Upgrades all have 1 level.

Just to explain: The Add/Remove ability is just for the weapon model to attach or remove from the unit model. I think the rest should be easy to understand :) (I hope ^^)
 
Level 3
Joined
Jun 25, 2008
Messages
65
Hmm...
The Trigger you have does not work ?
Maybe it is possible to make a DeUpgrade for each Upgrade you use.
Somewhere you can say "Allow negative Integers"
Then you could make an Upgrade that puts Range and everything else down.
But im not sure if the "Negative Integers" work on Upgrades...

But its worth a try i think ;)
 
Level 3
Joined
Jun 3, 2008
Messages
52
Perhaps you could try using buffs like "Roar" (Druid of Claw) or "Terrifying Howl" (Pit Lord) which increase or decrease damage (if I remember correctly). As for range changing, you could try using Abilities like Searing Arrow, which can increase the range of the attack (sort of).
 
Level 9
Joined
Oct 17, 2007
Messages
547
Try using Orbs? Make your weapons base on orbs and add more passive skills to it to mod different stats e.i. damage, attack speed, movement speed, sight range etc...
 
Level 1
Joined
Jul 6, 2008
Messages
2
well, the damage bonus is too easy. just use the "item damage bonus [x]. where x is the value of extra damage u want.

also the speed thing is an easy fix. but it's a 4 parter:
1. start the hero with a slower attack speed than any of the new weapon's attack speed.
2. give the hero a item attack speed bonus ability.
3. when he picks up a slower firing item use the trigger:
evnt: a unit aqcuires an item
cond: item type = x
act: remove ability (item attack speed bonus [x] from triggering unit.
4. when he drops the item make a similiar trigger but giving him the item speed bonus ability back.

the range increase/decrease is trickier. i tried the upgrade thing on my map too about 2 months ago and it didn't seem to work for me. once i researched a range upgrade i couldn't un-research it. so that was a problem. i gave up on the idea. but if you really want to you could try trigger dissabling first attack, and enabling a 2nd attack of the unit which picks up the item. but in this case u could only have a max of 2 different weapon ranges for any one guy. if it works, i'm not going to test it for u, good luck though.
 
Status
Not open for further replies.
Top