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

[Trigger] Improving a Merging Item System

Level 6
Joined
Aug 24, 2022
Messages
85
Hi for everyone! I'd like some help to improve this merging item system. I'll note things below:

  • U Initiate Staff
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Initiate Staff (Tier 1)
    • Actions
      • For each (Integer A) from 1 to 6, do (If ((Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to Initiate Staff (Tier 1)) then do (Set VariableSet ItemAmount = (ItemAmount + 1)) else do (Do nothing))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ItemAmount Equal to 2
        • Then - Actions
          • Hero - Drop (Item carried by (Hero manipulating item) of type Initiate Staff (Tier 1)) from (Hero manipulating item).
          • Item - Remove (Last dropped item)
          • Hero - Drop (Item carried by (Hero manipulating item) of type Initiate Staff (Tier 1)) from (Hero manipulating item).
          • Item - Remove (Last dropped item)
          • Special Effect - Create a special effect attached to the origin of (Hero manipulating item) using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Hero - Create |cff00ff00Uncommon Initiate Staff|r (Tier 1) and give it to (Hero manipulating item)
        • Else - Actions
          • Set VariableSet ItemAmount = 0
I don't remember who wrote this trigger, but I took it here inside the Hive. I'll update the post if I find the author.

Well, this is the trigger I'd like to improve. How it works? Basically, when you pick up two same items, they merge into a better version of it (Two lvl 1 items = One lvl 2 item). The problems noted with it, as my project was tested, are:

1. If your inventory is full, you can't buy another item, and auto merge them. You need to drop something.

2. If your inventory is empty, and you buy the same item multiple times, they only merge one time. When you buy two lvl 1 items, they merge into a lvl 2. So, if you buy another two lvl 1 items, they merge into a lvl 2, but those lvl 2 don't merge together. So, you can have multiple lvl 2 items unmerged.

3. If you have items merged inside the inventory like the 2nd situation descripted above, you need to drop all of them in order to start merging again. If you have three lvl 2 items, and drop one in order to merge it into a lvl 3, they'll not merge, even having two of the same item in your inventory. This only occurs with the item type manipulated. Other items keep merging normally.

4. Sometimes, items just don't merge. You need to drop and pick, forcing the trigger to work. Maybe the problem is that multiple heroes are trying to use the same trigger together... I don't know. This often occurs at late game.



These are the problems currently noted with this trigger. It works very well, but it's unfriendly with new players, and as you keep playing the game, it gets boring to drop and pick items everytime you need to improve your equipment. Below, the page for the project, where you can download the map and see by yourself how things work in-game:

Thank you if you read until here.
 
Top