Help With Trigger (lol)

SwedishChef

New Member
Reaction score
32
Okey I have this trigger which I really don't understand. It worked perfect befre but now it have some strange bug. I want the trigger to check so that the player don't have two of one item. Strange thing with this trigger is that it is being run even if the hero only have 1 item. The only possible explaination I can think of is that if you have no item in two of the slots then the editor say that is is the same item-type. So how do I fix this? And why has it suddenly stopped working, new version?

Trigger:
  • Double Skills
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • And - All (Conditions) are true
            • Conditions
              • (Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to (Item-type of (Item being manipulated))
              • (Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to (Item-type of (Item being manipulated))
          • And - All (Conditions) are true
            • Conditions
              • (Item-type of (Item carried by (Triggering unit) in slot 1)) Equal to (Item-type of (Item being manipulated))
              • (Item-type of (Item carried by (Triggering unit) in slot 3)) Equal to (Item-type of (Item being manipulated))
          • And - All (Conditions) are true
            • Conditions
              • (Item-type of (Item carried by (Triggering unit) in slot 2)) Equal to (Item-type of (Item being manipulated))
              • (Item-type of (Item carried by (Triggering unit) in slot 3)) Equal to (Item-type of (Item being manipulated))
      • And - All (Conditions) are true
        • Conditions
          • Has_Moved[(Player number of (Owner of (Triggering unit)))] Equal to False
    • Actions
      • Game - Display to (All players) the text: a
      • Player - Add 1 to (Owner of (Triggering unit)) Current gold
      • Item - Remove (Item being manipulated)
      • EGUI Misc - Simulate an error message for (Owner of (Triggering unit)) with the message You can not have two of the same ability
      • If (Randoming Equal to True) then do (Hero - Create (Random level -1 Permanent item-type) and give it to (Triggering unit)) else do (Do nothing)


Okey I found an newer verison I had made for the trigger on another map. It worked and looked like this:

Trigger:
  • Double Skills New
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Has_Moved[(Player number of (Owner of (Triggering unit)))] Equal to False
    • Actions
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item being manipulated)) Equal to (Item-type of (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot (Integer A)))
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Item carried by Hero[(Player number of (Owner of (Triggering unit)))] in slot (Integer A)) Not equal to (Item being manipulated)
                • Then - Actions
                  • Player - Add 1 to (Owner of (Triggering unit)) Current gold
                  • Item - Remove (Item being manipulated)
                  • EGUI Misc - Simulate an error message for (Owner of (Triggering unit)) with the message You can not have two of the same ability
                  • If (Randoming Equal to True) then do (Hero - Create (Random level -1 Permanent item-type) and give it to (Triggering unit)) else do (Do nothing)
                • Else - Actions
            • Else - Actions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top