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

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

Status
Not open for further replies.
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 73
Joined
Aug 10, 2018
Messages
7,866
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: 11
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!
 
Status
Not open for further replies.
Top