HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

item usage

09-23-2003, 02:27 AM#1
Crimsongg137
is it posible when u attack person an item would use up like if attack him with 3 hits i lose 3 of the item. if that item runs out i can attack. is it posible?
09-23-2003, 02:28 AM#2
Crimsongg137
opps i left my example out say like a bow an arrow.. im tryin to do somehtin like that say a unit has bow it needs arrow if arrow = 0 then im thinkin abilty that will make the hero hvae no attack
09-23-2003, 02:37 AM#3
UltimateJim
a unit is atacked

if atacking unit has 1 (item) in slot # do nothing else disable atack 1 for atacking unit


i THINK this will work
09-23-2003, 02:38 AM#4
Dragon
E Unit X attacks
A I don't know, try to find a "Destroy item" trigger or something.

E Unit X attacks
C Unit X has no arrows
A Set the player to "ally with everyone" (and make it so friendlies cant be targeted)

E Unit X picks up arrows
A Set player to hostile with (enemies)

This won't work on creeps tho; you can't ally creeps.

So try to avoid placing creeps...

Much simpler and works with creeps:

E Unit X picks up arrows (Unit X has no attack but besides that is a duplicate of Unit B)
A switch Unit X for Unit B

E Unit has no arrows
A Switch Unit B for unit X (unit B has an attack)

Edit: ok jim has it, I was ****ed up. Didnt know there was a disable attack action...
09-23-2003, 02:42 AM#5
Crimsongg137
heres an eaiser way make arrows then buy arrows then make the bow require ment bows..
09-23-2003, 03:03 AM#6
Zachary_Shadow
Now THAT made no sence....
09-23-2003, 03:42 AM#7
Saethori
How about the 'War Club' ability?

As far as I understand, War Club disables 'Attack 1' and enables 'Attack 2'. If you have a unit have no Attack 1 data, and naturally has no attacks enabled, then this might work.

Try giving the 'Quiver of Arrows' item charges of the ability, and have each charge represent 10 arrows or so. When the unit runs out of arrows, he'll need to restock from his quiver. When his quiver runs out, he can't attack anymore.


I'm not certain if this will work though, just off the top of my head.
09-23-2003, 11:28 AM#8
Crimsongg137
i tried the war club its strange
09-23-2003, 01:52 PM#9
Vexorian
Give the item an edited shadow orb ability with arrow missile and a hit points ability (A potion of health ability) that gives him 0 hit points, you know a spell that does nothing.

Make the item actively used and then::

Events:
A unit is attacked
Conditions
(Attacking unit) has an item of type (Arrows)
Actions:
Wait 0.01 seconds
Hero MAke (Attacking Unit) to use item (Item carried by (Attacking unit of type (Arrows))


Don't forget to make the hero to have 0 allowed attacks
09-23-2003, 08:07 PM#10
Crimsongg137
also if i want it to be able so he can add on to that
like say he has 5 then he buys 30 then it will be 35
09-23-2003, 09:15 PM#11
Ligature
Ah yess.... HOW in god's name do you alter charges on an item? I think that's the sticking point here, right?
09-23-2003, 09:27 PM#12
Crimsongg137
i guess
09-23-2003, 09:44 PM#13
Ligature
OK... since you can't add charges to an item, and you can't divine how many charges are on one, here's my plan -

set the custom value of each unit that has this thing to the ammo it's got - which should be set up to match the number of real charges in its "quiver" or whatever you're calling this item.

Next, make the Quiver item hold as many real charges as it can - the maximum ammo you want the player's units to possibly have.

Then, every time a unit gets a Quiver, remove its old one and replace it with the new one - which will have the maximum ammo. Then add however much you decide should be in a quiver to the unit's custom value, and have the unit use the quiver over and over again until its Real charges match the custom value.