• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Trigger] Combine 2 Identical Items into a New One when using a skill

Level 2
Joined
Mar 17, 2021
Messages
8
Hello everyone, I think it's a simple request, but I can't for the life of me figure it out. Here's what I got:

A Building with an custome inventory (2 slots) and a skill.
Lets say I drop 2 Claws of Attack +3 into the building's inventory, then, using the skilll would replace those two items with a third one, lets say a Claws of Attack +6.
Can someone help me with this? It would be much a apreciated
 

Uncle

Warcraft Moderator
Level 66
Joined
Aug 10, 2018
Messages
6,726
This is the lazy way of doing it:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to YourAbility
  • Actions
    • Set VariableSet Item_Unit = (Triggering unit)
    • -------- --------
    • Set VariableSet Item_In_Slot[1] = (Item carried by Item_Unit in slot 1)
    • Set VariableSet Item_In_Slot[2] = (Item carried by Item_Unit in slot 2)
    • -------- --------
    • Set VariableSet Item_Type_In_Slot[1] = (Item-type of Item_In_Slot[1])
    • Set VariableSet Item_Type_In_Slot[2] = (Item-type of Item_In_Slot[2])
    • -------- --------
    • -------- Create Mask of Death: --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Item_Type_In_Slot[1] Equal to Claws of Attack +15
        • Item_Type_In_Slot[2] Equal to Claws of Attack +15
      • Then - Actions
        • Item - Remove Item_In_Slot[1]
        • Item - Remove Item_In_Slot[2]
        • Hero - Create Mask of Death and give it to Item_Unit
        • Skip remaining actions
      • Else - Actions
    • -------- --------
    • -------- Create Helm of Valor: --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Item_Type_In_Slot[1] Equal to Belt of Giant Strength +6
        • Item_Type_In_Slot[2] Equal to Boots of Quel'Thalas +6
      • Then - Actions
        • Item - Remove Item_In_Slot[1]
        • Item - Remove Item_In_Slot[2]
        • Hero - Create Helm of Valor and give it to Item_Unit
        • Skip remaining actions
      • Else - Actions
    • -------- --------
    • -------- Create... --------
Variables:
Item_Unit = Unit
Item_In_Slot = Item (array)
Item_Type_In_Slot = Item-Type (array)
 

Attachments

  • Item Combiner 1.w3m
    17.2 KB · Views: 1
Level 2
Joined
Mar 17, 2021
Messages
8
This is the lazy way of doing it:
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to YourAbility
  • Actions
    • Set VariableSet Item_Unit = (Triggering unit)
    • -------- --------
    • Set VariableSet Item_In_Slot[1] = (Item carried by Item_Unit in slot 1)
    • Set VariableSet Item_In_Slot[2] = (Item carried by Item_Unit in slot 2)
    • -------- --------
    • Set VariableSet Item_Type_In_Slot[1] = (Item-type of Item_In_Slot[1])
    • Set VariableSet Item_Type_In_Slot[2] = (Item-type of Item_In_Slot[2])
    • -------- --------
    • -------- Create Mask of Death: --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Item_Type_In_Slot[1] Equal to Claws of Attack +15
        • Item_Type_In_Slot[2] Equal to Claws of Attack +15
      • Then - Actions
        • Item - Remove Item_In_Slot[1]
        • Item - Remove Item_In_Slot[2]
        • Hero - Create Mask of Death and give it to Item_Unit
        • Skip remaining actions
      • Else - Actions
    • -------- --------
    • -------- Create Helm of Valor: --------
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Item_Type_In_Slot[1] Equal to Belt of Giant Strength +6
        • Item_Type_In_Slot[2] Equal to Boots of Quel'Thalas +6
      • Then - Actions
        • Item - Remove Item_In_Slot[1]
        • Item - Remove Item_In_Slot[2]
        • Hero - Create Helm of Valor and give it to Item_Unit
        • Skip remaining actions
      • Else - Actions
    • -------- --------
    • -------- Create... --------
Variables:
Item_Unit = Unit
Item_In_Slot = Item (array)
Item_Type_In_Slot = Item-Type (array)
Thanks a lot, Uncle!
 
Top