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

-Requesting Trigger

Status
Not open for further replies.
Level 3
Joined
Oct 17, 2013
Messages
29
-Requesting Trigger(Close)

Requesting Trigger

Can i request a trigger

-Like you must have an arrow(item) in your inventory if your hero is an archer to attack and if you don't have an arrow(item) in your inventory you can't attack and for swords Durablity like when you attack your sword's durability decreases or something like that.
-if you do can you give description of how to use or if i can change the model used.
-Like if i can change the arrow to axe.
-Or if you found some Spells like it please post the link Thanks.
 
Last edited:
Hiho... in init triger you can choose unit type of bowUser and swordUser.

You also can modify the item types in init trigger. (bow and sword)

SWORD_HIT_LIMIT sets the max of attacks you can do with a sword.

bowUser units only can attack, if they have the itemBow in their inventory.

Atm all units can use the sword, but it can be changed that only swordUser can use this item type.

Just test it and say if there is something to change. :)
 

Attachments

  • Test.w3x
    28.1 KB · Views: 55
Level 3
Joined
Oct 17, 2013
Messages
29
Request!

SWORD_HIT_LIMIT sets the max of attacks you can do with a sword.:)
Can you change this to durability?
-Like when a Swordsman attack his/her sword's(weapon,item) durability goes down from 100% to 99%,98%,97%,96% and i can change the durability reduced so i can make the durability reduced varies from the type of the sword(weapon,item) he/she wields.

bowUser units only can attack, if they have the itemBow in their inventory.
Can you add an arrow so he/she can attack
-Like BowUser must have a Bow and arrow to attack and when she/he attacks the amount of arrows decreases by 1.
-Oh and if you can do this if you click the bow it can have multishots that it can shoot 2,3 or 4 arrows at the same time ofcourse 2 fired arrows equal to 2 arrows decreased from the inventory. same with the others.if 1 arrow left reset to 1 arrow fired(well this is not really needed so you can ignore it.)
-(make the arrow stackable if you can and Stacked arrow up to 100 or so)

Sorry to bother you!
 
Do you want that only specific unitType can use bow, or sword?

And do you use JNGP?

I will work on it tomorrow I think. (idk if I will do each point)

Edit:

- Only specific unit type can now use arrows/bow (else it doesnt make much sense)

- You need bow + arrows to enable attack

- Arrows are stackable

- Changed from hits to durability in %

- As you wanted you can now set max durability differently for each itemType

Have fun!
 

Attachments

  • Request.w3x
    31.1 KB · Views: 59
Last edited:
No problem. :)

Yo, you can edit it for your needs of course.

Edit:

There is a fail. Attack trigger only will run for player units, but not for passive. You will only have to change a number in a function:
JASS:
function InitTrig_Kolle takes nothing returns nothing
    local trigger pickUp = CreateTrigger()
    local trigger drop   = CreateTrigger()
    local trigger attack = CreateTrigger()
    local player p
    local integer i = 0
    
    loop
        set p = Player(i)
        
        call TriggerRegisterPlayerUnitEvent(pickUp, p, EVENT_PLAYER_UNIT_PICKUP_ITEM, null)
        call TriggerRegisterPlayerUnitEvent(drop, p, EVENT_PLAYER_UNIT_DROP_ITEM, null)
        call TriggerRegisterPlayerUnitEvent(attack, p, EVENT_PLAYER_UNIT_ATTACKED, null)
        
        set i = i + 1
        exitwhen i > 11
    endloop
    
    call TriggerAddCondition( pickUp, Filter(function ItemPickUp))
    call TriggerAddCondition( drop, Filter(function ItemDrop ))
    call TriggerAddCondition( attack, Filter(function Attack ))
endfunction
This exitwhen i > 11 should beexitwhen i > 15
 
Status
Not open for further replies.
Top