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

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 64
Joined
Aug 10, 2018
Messages
6,548
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: 16
  • Mythic Item 2.w3m
    19 KB · Views: 12
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