• 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] Item Refining

Status
Not open for further replies.

sentrywiz

S

sentrywiz

Ello fellow wc3 mappers. I am facing a major problem, as when I was creating the triggers I thought they would work however they don't sadly.

The idea of this trigger is when an item Refiner is used, to pick a random item from inventory that is not already refined, and with a chance on luck - to refine it. Otherwise if another chance, to return full gold cost. And bottom line if both chances fail, to display a FAIL message.

Before I copy paste it, let me just explain few variables:
* - Hero_Ref = Hero Manipulating Item
* - Item_Norm[1-11] = Bunch of item types (items) already predefined
* - Item_NormRef[1-11] = Bunch of item types (items) already predefined [these are the Refined version of the Normal items]


The part of the trigger that isn't working is the second For cycle, it is supposed to see for example that if an:
item_norm[5] is carried, remove it and create an item_normref[5]. But it doesn't. All works but the creation trigger.

Here is the code for this chaotic misdeed:



  • Normal Refining
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to |c00DA0025Refiner|r
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item carried by (Hero manipulating item) in slot (Integer A)) Not equal to No item
            • Then - Actions
              • For each (Integer B) from 1 to 11, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Item carried by Hero_Ref in slot (Integer A)) Equal to (Item carried by Hero_Ref of type Item_Norm[(Integer B)])
                      • (Item carried by Hero_Ref in slot (Integer A)) Not equal to (Item carried by Hero_Ref of type |c00DA0025Refiner|r)
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Random integer number between 1 and 100) Less than or equal to 50
                        • Then - Actions
                          • Game - Display to (All players) for 7.00 seconds the text: (A lucky bastard refined |c00DA0025 + ((Name of (Item carried by (Hero manipulating item) in slot (Integer A))) + |r !!!))
                          • Item - Remove (Item carried by (Hero manipulating item) in slot (Integer A))
                          • Hero - Create Item_NormRef[(Integer B)] and give it to Hero_Ref
                          • Skip remaining actions
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Random integer number between 1 and 100) Less than or equal to 8
                            • Then - Actions
                              • Game - Display to (Player group((Owner of Hero_Ref))) for 7.00 seconds the text: Fail! But you got y...
                              • Player - Add 600 to (Owner of Hero_Ref) Current gold
                              • Skip remaining actions
                            • Else - Actions
                              • Game - Display to (All players) for 7.00 seconds the text: Lol somebody wasted...
                              • Skip remaining actions
                    • Else - Actions
            • Else - Actions
+REP FOR THE SOLVER! AND YOUR NAME WILL BE POSTED IN THE HALL OF FAME ON THE MAIN PAGE OF PRO WAR. If that means something to you :D
 
Last edited by a moderator:
Level 20
Joined
Jul 6, 2009
Messages
1,885
  • (Item carried by Hero_Ref in slot (Integer A)) Equal to (Item carried by Hero_Ref of type Item_Norm[(Integer B)])
This should be Item-Type comparisons,not Item comparison
like this
  • (Item-type of (Item carried by Hero_Ref in slot (Integer A))) Equal to Item_Norm[(Integer B)]
If you have 2 boots of speed,they are not the same items,their type is same.

Also there's no need for this condition
  • (Item carried by Hero_Ref in slot (Integer A)) Not equal to (Item carried by Hero_Ref of type |c00DA0025Refiner|r)
Since if the item in slot Integer A is equal to any of predefined items,it surely isn't Refiner and if it isn't equal then the condition is false anyway.
 
Last edited:

sentrywiz

S

sentrywiz

  • (Item carried by Hero_Ref in slot (Integer A)) Equal to (Item carried by Hero_Ref of type Item_Norm[(Integer B)])
  • (Item carried by Hero_Ref in slot (Integer A)) Not equal to (Item carried by Hero_Ref of type |c00DA0025Refiner|r)
These should be Item-Type comparisons,not Item comparisons.

They are both. One check if item carried by here in slot[#] is a non-refined item[#], the other if the item isn't refiner item. I don't think that is the problem since the code works, but the item doesn't get created.
 

sentrywiz

S

sentrywiz

  • (Item carried by Hero_Ref in slot (Integer A)) Equal to (Item carried by Hero_Ref of type Item_Norm[(Integer B)])
This should be Item-Type comparisons,not Item comparison
like this
  • (Item-type of (Item carried by Hero_Ref in slot (Integer A))) Equal to Item_Norm[(Integer B)]
If you have 2 boots of speed,they are not the same items,their type is same.

Also there's no need for this condition
  • (Item carried by Hero_Ref in slot (Integer A)) Not equal to (Item carried by Hero_Ref of type |c00DA0025Refiner|r)
Since if the item in slot Integer A is equal to any of predefined items,it surely isn't Refiner and if it isn't equal then the condition is false anyway.

Alright will edit it and give a try.
You might be right about the condition. Will remove it

But I don't get what you mean by
If you have 2 boots of speed,they are not the same items,their type is same.

RE-EDIT: Did you what you said again and removed some varible confusion in the variables. This time IT DID WORK! Well its wall of fame for ya :D
 
Last edited by a moderator:
Status
Not open for further replies.
Top