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

Item triggering

Status
Not open for further replies.
Level 7
Joined
Feb 23, 2020
Messages
253
Hello, is there a way to make an item passive that reads i.e: For each item gain 5 bonus strength, a mythic item like in League of Legends? If so how?
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Yeah, here's how:
  • Setup Mythic Item
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet MythicItem = Kelen's Dagger of Escape
      • Set VariableSet StrBonus = 5
  • Acquire Mythic Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to MythicItem
    • Actions
      • Set VariableSet InvSize = 6
      • For each (Integer InvSlot) from 1 to InvSize, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has (Item carried by (Triggering unit) in slot InvSlot)) Equal to True
            • Then - Actions
              • Hero - Modify Strength of (Triggering unit): Add StrBonus.
            • Else - Actions
  • Acquire Normal Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Not equal to MythicItem
      • ((Triggering unit) has an item of type MythicItem) Equal to True
    • Actions
      • Hero - Modify Strength of (Triggering unit): Add StrBonus.
  • Lose Mythic Item
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to MythicItem
    • Actions
      • Set VariableSet InvSize = 6
      • For each (Integer InvSlot) from 1 to InvSize, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has (Item carried by (Triggering unit) in slot InvSlot)) Equal to True
            • Then - Actions
              • Hero - Modify Strength of (Triggering unit): Subtract StrBonus.
            • Else - Actions
  • Lose Normal Item
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Not equal to MythicItem
      • ((Triggering unit) has an item of type MythicItem) Equal to True
    • Actions
      • Hero - Modify Strength of (Triggering unit): Subtract StrBonus.
I attached two maps. The first one uses the above triggers and the second one (Mythic Item 2) has the addition of only allowing 1 of these Mythic Items to be equipped at a time. If you have different types of Mythic Items you'd have to account for that a bit differently.
 

Attachments

  • Mythic Item.w3m
    18.3 KB · Views: 18
  • Mythic Item 2.w3m
    19 KB · Views: 14
Last edited:
Level 7
Joined
Feb 23, 2020
Messages
253
Yeah, here's how:
  • Setup Mythic Item
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set VariableSet MythicItem = Kelen's Dagger of Escape
      • Set VariableSet StrBonus = 5
  • Acquire Mythic Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to MythicItem
    • Actions
      • Set VariableSet InvSize = 6
      • For each (Integer InvSlot) from 1 to InvSize, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has (Item carried by (Triggering unit) in slot InvSlot)) Equal to True
            • Then - Actions
              • Hero - Modify Strength of (Triggering unit): Add StrBonus.
            • Else - Actions
  • Acquire Normal Item
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Not equal to MythicItem
      • ((Triggering unit) has an item of type MythicItem) Equal to True
    • Actions
      • Hero - Modify Strength of (Triggering unit): Add StrBonus.
  • Lose Mythic Item
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to MythicItem
    • Actions
      • Set VariableSet InvSize = 6
      • For each (Integer InvSlot) from 1 to InvSize, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Triggering unit) has (Item carried by (Triggering unit) in slot InvSlot)) Equal to True
            • Then - Actions
              • Hero - Modify Strength of (Triggering unit): Subtract StrBonus.
            • Else - Actions
  • Lose Normal Item
    • Events
      • Unit - A unit Loses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Not equal to MythicItem
      • ((Triggering unit) has an item of type MythicItem) Equal to True
    • Actions
      • Hero - Modify Strength of (Triggering unit): Subtract StrBonus.
I attached two maps. The first one uses the above triggers and the second one (Mythic Item 2) has the addition of only allowing 1 of these Mythic Items to be equipped at a time. If you had different types of Mythic Items you'd have to account for that a bit differently.


Thank you very much, appreciate it!
 
Status
Not open for further replies.
Top