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!
You are using an out of date browser. It may not display this or other websites correctly. You should upgrade or use an alternative browser.
Triggers
Recipe Item Combination + Autobuy.w3x
Variables
Variables
Initialization
bladebaneArmor
Enter map-specific custom script code below. This text will be included in the map script after variables are declared and before any trigger code except Custom Script Item. Custom Script Item will merge into map script after globals variables declaration with the list order in trigger view.
Name
Type
is_array
initial_value
itemCompleted
itemcode
No
itemComponent
itemcode
Yes
itemCounter
integer
Yes
itemNumComponents
integer
No
itempriceTotal
integer
No
TempInteger
integer
No
bladebaneArmor
Events
Unit - A unit Acquires an item
Conditions
Actions
-------- configure: --------
-------- components: --------
Set Variable Set itemComponent[1] = "rde4"
Set Variable Set itemComponent[2] = "lhst"
Set Variable Set itemComponent[3] = "I000"
-------- number of components (including recipe): --------
Set Variable Set itemNumComponents = "2"
Set Variable Set itemNumComponents = "3"
-------- completed item: --------
Set Variable Set itemCompleted = "blba"
-------- completed item total price: --------
Set Variable Set itempriceTotal = "1500"
-------- ------------------------ --------
-------- dont touch rest --------
-------- ------------------------ --------
For each (Integer A) from 1 to 6 , do (Actions)
Loop - Actions
Set Variable Set itemCounter[(Integer A)] = "0"
For each (Integer A) from 1 to 6 , do (Actions)
Loop - Actions
For each (Integer B) from 1 to itemNumComponents , do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Item carried by (Hero manipulating item) in slot (Integer A))) Equal to itemComponent[(Integer B)]
itemCounter[(Integer B)] Equal to 0
Then - Actions
Set Variable Set itemCounter[(Integer B)] = "1"
Custom script: exitwhen true
Else - Actions
-------- autobuy --------
-------- trigger autobuy only when acquiring components for this item --------
Set Variable Set TempInteger = "0"
For each (Integer A) from 1 to itemNumComponents , 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 itemComponent[(Integer A)]
(Item-class of (Item being manipulated)) Equal to Campaign
Then - Actions
Set Variable Set TempInteger = "1"
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
TempInteger Equal to 1
Then - Actions
-------- count gold of components u have to calculate gold missing (using item level as substitude for item price) --------
Set Variable Set TempInteger = "0"
For each (Integer A) from 1 to itemNumComponents , do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
itemCounter[(Integer A)] Equal to 1
Then - Actions
Set Variable Set TempInteger = (TempInteger + (Item level of (Item carried by (Hero manipulating item) of type itemComponent[(Integer A)])))
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Hero manipulating item)) Current gold) Greater than or equal to (itempriceTotal - TempInteger)
Then - Actions
Player - Set (Owner of (Hero manipulating item)) . Current gold to (((Owner of (Hero manipulating item)) Current gold) - (itempriceTotal - TempInteger))
For each (Integer A) from 1 to itemNumComponents , do (Actions)
Loop - Actions
Item - Remove (Item carried by (Hero manipulating item) of type itemComponent[(Integer A)])
Hero - Create itemCompleted and give it to (Hero manipulating item)
Special Effect - Create a special effect at (Position of (Hero manipulating item)) using Abilities\Spells\Items\AIem\AIemTarget.mdl
Special Effect - Destroy (Last created special effect)
Else - Actions
Player - Add (Item level of (Item being manipulated)) to (Owner of (Hero manipulating item)) . Current gold
Floating Text - Create floating text that reads |cffffff00insufficient total gold, recipe refunded|r above (Hero manipulating item) with Z offset 0 , using font size 7.00 , color ( 100 %, 100.00 %, 100.00 %), and 0 % transparency
Floating Text - Set the velocity of (Last created floating text) to 20.00 towards 90 degrees
Floating Text - Change (Last created floating text) : Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 8.00 seconds
Floating Text - Change the fading age of (Last created floating text) to 5.00 seconds
Special Effect - Create a special effect at (Position of (Hero manipulating item)) using UI\Feedback\GoldCredit\GoldCredit.mdl
Special Effect - Destroy (Last created special effect)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.