Warcraft III resources & community, 2003–2006 · archived

Need Help with an item trigger

6 posts
#1

Need Help with an item trigger

ok im making a map off of link to the past when he aquires the bow (item) he can click it and target a unit with it and shoot an arrow but heres the catch i want the lumber to be like how many arrows he has in his quiver so how do i make a trigger so that the abilty to use that item will cost 1 lumber and if he has 0 lumber he will be unable to cast it?
(please give me the whole trigger)
#2
Sound a bit more difficult, why not use "charged item" Bow instead? You could use item like "Arrow" lying around and click it act sort of like Tome of Experience but 0 exp, but with trigger adds up Bow's charges remaining?
#3
Thats not tha much of a task.
Here is the trigger:

Event:
- a unit uses an item
Condition:
//if you would create your items, so that all bows(and only bows) are in one 'itemgroup' (like charged, permanent, campaign, ...) then the trigger would be one for all of them
- Itemclass of (item beeing manipulated) = <your bow class>
//otherwise if would be
- OR
- - Itemtype (Item beeing Manipulated) = bow 1
- - Itemtype (Item beeing Manipulated) = bow 2
- - Itemtype (Item beeing Manipulated) = bow x
Action:
- if
- condition
- - Player - Lumber of (Owner of (manipulating Unit)) > 0
- then
- - Player - Add '-1' to (Owner of (Manipulating Unit)) current Lumber
- else
- - order unit (manipulating unit) stop


that one should work, even though i'd do it different.
(no, i'll not say how i'd do it -> i don't have the time to write that stuff done right now -> if you want to now -> PM me and i might tell you)
#4
Ok i got the part where it minuses 1 lumber from you when you use it but i cant get hmm to not be able to use it when he reaches 0 lumber
#5
just create another trigger that goes like this:

Event:
Unit begins casting an ability

Conditions:
(ability being cast) equal to Arrow
(owner of casting unit) current lumber equal to 0.

Actions:
Order (casting unit) to stop.


That's not so hard, is it? :?
#6
and it's already part of the trigger i wrote ^^

hf testing it. i'm damned shure it'll work.