Moderator
M
Moderator
23:21, 2nd Jan 2013
Magtheridon96: Approved.
Nice system. It's quite efficient and useful.
Magtheridon96: Approved.
Nice system. It's quite efficient and useful.
RCR Config

Events


Map initialization

Conditions

Actions


-------- -------------------------------------------------------------------------------- --------


-------- SYSTEM VARIABLES --------


-------- -------------------------------------------------------------------------------- --------


-------- Set the disassemble ability --------


Set RCR_DisassembleAbility = Disassemble


-------- Set the combine SFX --------


Set RCR_CombineSFX = Abilities\Spells\Items\AIam\AIamTarget.mdl


-------- Set the disassemble SFX --------


Set RCR_DisassembleSFX = Abilities\Spells\Items\AIfb\AIfbSpecialArt.mdl


-------- (for either SFX, set to nothing if you don't want an SFX) --------


-------- -------------------------------------------------------------------------------- --------


-------- SETTINGS --------


-------- -------------------------------------------------------------------------------- --------


-------- Show text when items combined/disassembled --------


Set RCR_ShowText = True


-------- Enabled/disable disassembly when an item is dropped on itself - delete the next line to disable --------


Trigger - Turn on RCR Disassemble RC <gen>


-------- -------------------------------------------------------------------------------- --------


-------- RECIPES --------


-------- -------------------------------------------------------------------------------- --------


-------- Set a recipe --------


Set RCR_SaveRecipeItemA = Claws of Attack +15


Set RCR_SaveRecipeItemB = Crown of Kings +5


Set RCR_SaveRecipeResult = Blood Key


Trigger - Run RCR SaveRecipe <gen> (ignoring conditions)


-------- -------------------------------------------------------------------------------- --------


-------- And another --------


Set RCR_SaveRecipeItemA = Kelen's Dagger of Escape


Set RCR_SaveRecipeItemB = Mask of Death


Set RCR_SaveRecipeResult = Sun Key


Trigger - Run RCR SaveRecipe <gen> (ignoring conditions)


-------- -------------------------------------------------------------------------------- --------


-------- And another --------


Set RCR_SaveRecipeItemA = Potion of Greater Healing


Set RCR_SaveRecipeItemB = Potion of Greater Mana


Set RCR_SaveRecipeResult = Replenishment Potion


-------- Set whether or not charges will be added together for this recipe --------


Set RCR_SaveAddCharges = True


Trigger - Run RCR SaveRecipe <gen> (ignoring conditions)


-------- -------------------------------------------------------------------------------- --------
RCR SaveRecipe

Events

Conditions

Actions


Custom script: set udg_RCR_SaveA = udg_RCR_SaveRecipeItemA


Custom script: set udg_RCR_SaveB = udg_RCR_SaveRecipeItemB


Custom script: set udg_RCR_SaveR = udg_RCR_SaveRecipeResult


-------- For combining --------


Hashtable - Save RCR_SaveR as RCR_SaveA of RCR_SaveB in RCR_CombineTable


Hashtable - Save RCR_SaveR as RCR_SaveB of RCR_SaveA in RCR_CombineTable


-------- For charges --------


Hashtable - Save RCR_SaveAddCharges as RCR_SaveR of RCR_SaveA in RCR_CombineTable


Hashtable - Save RCR_SaveAddCharges as RCR_SaveR of RCR_SaveB in RCR_CombineTable


-------- For disassembly --------


Hashtable - Save RCR_SaveA as (RCR_SaveR x -1) of (RCR_SaveR x -1) in RCR_CombineTable


Hashtable - Save RCR_SaveB as (RCR_SaveA x -1) of (RCR_SaveR x -1) in RCR_CombineTable
RCR Combine

Events


Unit - A unit Is issued an order targeting an object

Conditions


(Target item of issued order) Not equal to No item

Actions


Set tempUnit = (Triggering unit)


-------- null previous variables --------


Set RCR_SaveR = 0


Set RCR_SaveAddCharges = False


Set RCR_CombineItemA = No item


Set RCR_CombineItemB = No item


Custom script: set udg_LoopA = GetIssuedOrderId()-852001


Set RCR_CombineItemB = (Item carried by tempUnit in slot LoopA)


Set RCR_CombineItemA = (Target item of issued order)


-------- Now check recipes --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




RCR_CombineItemA Not equal to No item




RCR_CombineItemB Not equal to No item




RCR_CombineItemA Not equal to RCR_CombineItemB



Then - Actions




-------- Retrieve recipe result --------




Set RCR_SaveRecipeItemA = (Item-type of RCR_CombineItemA)




Set RCR_SaveRecipeItemB = (Item-type of RCR_CombineItemB)




Custom script: set udg_RCR_SaveA = udg_RCR_SaveRecipeItemA




Custom script: set udg_RCR_SaveB = udg_RCR_SaveRecipeItemB




Set RCR_SaveR = (Load RCR_SaveA of RCR_SaveB from RCR_CombineTable)




Custom script: set udg_tempItemType = udg_RCR_SaveR




Set RCR_SaveAddCharges = (Load RCR_SaveR of RCR_SaveA from RCR_CombineTable)




-------- Verify result --------




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






RCR_SaveR Not equal to 0





Then - Actions






Hero - Drop RCR_CombineItemA from tempUnit






Hero - Drop RCR_CombineItemB from tempUnit






Hero - Create tempItemType and give it to tempUnit






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








RCR_SaveAddCharges Equal to True







Then - Actions








Item - Set charges remaining in (Last created item) to ((Charges remaining in RCR_CombineItemA) + (Charges remaining in RCR_CombineItemB))







Else - Actions






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








RCR_CombineSFX Not equal to <Empty String>







Then - Actions








Special Effect - Create a special effect attached to the origin of tempUnit using RCR_CombineSFX








Special Effect - Destroy (Last created special effect)







Else - Actions






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








RCR_ShowText Equal to True







Then - Actions








Set tempForce = (Player group((Owner of tempUnit)))








Quest - Display to tempForce the New Item Received message: (|cff7777aaITEMS COMBINED|r - + (((Name of RCR_CombineItemA) + combined with ) + ((Name of RCR_CombineItemB) + ( to create + (Name of (Last created item))))))








Custom script: call DestroyForce(udg_tempForce)







Else - Actions






Item - Remove RCR_CombineItemA






Item - Remove RCR_CombineItemB





Else - Actions



Else - Actions
RCR Disassemble Ability

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to RCR_DisassembleAbility

Actions


Set tempUnit = (Triggering unit)


Set tempItem = (Target item of ability being cast)


-------- null previous variables --------


Set RCR_SaveR = 0


Set RCR_SaveA = 0


Set RCR_SaveB = 0


Set RCR_SaveAddCharges = False


-------- Retrieve recipe result --------


Set RCR_SaveRecipeResult = (Item-type of tempItem)


Custom script: set udg_RCR_SaveR = udg_RCR_SaveRecipeResult


Set RCR_SaveA = (Load (RCR_SaveR x -1) of (RCR_SaveR x -1) from RCR_CombineTable)


Set RCR_SaveB = (Load (RCR_SaveA x -1) of (RCR_SaveR x -1) from RCR_CombineTable)


Custom script: set udg_tempItemType = udg_RCR_SaveA


Custom script: set udg_tempItemType2 = udg_RCR_SaveB


Set RCR_SaveAddCharges = (Load RCR_SaveR of RCR_SaveA from RCR_CombineTable)


-------- Verify result --------


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




RCR_SaveA Not equal to 0




RCR_SaveB Not equal to 0



Then - Actions




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






RCR_SaveAddCharges Equal to True






(Charges remaining in tempItem) Less than or equal to 1





Then - Actions






Set tempForce = (Player group((Owner of tempUnit)))






Quest - Display to tempForce the Simple Hint message: |cffff0000Error|r -...






Custom script: call DestroyForce(udg_tempForce)





Else - Actions






Set tempLoc = (Position of tempItem)






Item - Create tempItemType at tempLoc






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








RCR_SaveAddCharges Equal to True







Then - Actions








Set tempInt = ((Charges remaining in tempItem) mod 2)








Item - Set charges remaining in (Last created item) to (((Charges remaining in tempItem) / 2) + tempInt)







Else - Actions






Set tempItem2 = (Last created item)






Item - Create tempItemType2 at tempLoc






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








RCR_SaveAddCharges Equal to True







Then - Actions








Item - Set charges remaining in (Last created item) to ((Charges remaining in tempItem) / 2)







Else - Actions






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








RCR_ShowText Equal to True







Then - Actions








Set tempForce = (Player group((Owner of tempUnit)))








Quest - Display to tempForce the New Item Received message: (|cff7777aaITEMS DISASSEMBLED|r - + (((Name of tempItem) + was disassembled into ) + ((Name of tempItem2) + ( and + (Name of (Last created item))))))








Custom script: call DestroyForce(udg_tempForce)







Else - Actions






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








(tempItem is owned) Equal to True







Then - Actions








Item - Remove tempItem








Hero - Give tempItem2 to tempUnit








Hero - Give (Last created item) to tempUnit








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










RCR_DisassembleSFX Not equal to <Empty String>









Then - Actions










Special Effect - Create a special effect attached to the origin of tempUnit using RCR_DisassembleSFX










Special Effect - Destroy (Last created special effect)









Else - Actions







Else - Actions








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










RCR_DisassembleSFX Not equal to <Empty String>









Then - Actions










Special Effect - Create a special effect at tempLoc using RCR_DisassembleSFX










Special Effect - Destroy (Last created special effect)









Else - Actions








Item - Remove tempItem






Custom script: call RemoveLocation(udg_tempLoc)



Else - Actions
RCR Disassemble RC

Events


Unit - A unit Is issued an order targeting an object

Conditions


(Target item of issued order) Not equal to No item

Actions


Set tempUnit = (Triggering unit)


-------- null previous variables --------


Set RCR_SaveA = 0


Set RCR_SaveB = 0


Set RCR_SaveR = 0


Set RCR_SaveAddCharges = False


Set RCR_CombineItemA = No item


Set RCR_CombineItemB = No item


Custom script: set udg_LoopA = GetIssuedOrderId()-852001


Set RCR_CombineItemB = (Item carried by tempUnit in slot LoopA)


Set RCR_CombineItemA = (Target item of issued order)


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




And - All (Conditions) are true





Conditions






RCR_CombineItemA Not equal to No item






RCR_CombineItemB Not equal to No item






RCR_CombineItemA Equal to RCR_CombineItemB



Then - Actions




-------- Retrieve recipe result --------




Set RCR_SaveRecipeResult = (Item-type of RCR_CombineItemA)




Custom script: set udg_RCR_SaveR = udg_RCR_SaveRecipeResult




Set RCR_SaveA = (Load (RCR_SaveR x -1) of (RCR_SaveR x -1) from RCR_CombineTable)




Set RCR_SaveB = (Load (RCR_SaveA x -1) of (RCR_SaveR x -1) from RCR_CombineTable)




Custom script: set udg_tempItemType = udg_RCR_SaveA




Custom script: set udg_tempItemType2 = udg_RCR_SaveB




Set RCR_SaveAddCharges = (Load RCR_SaveR of RCR_SaveA from RCR_CombineTable)




-------- Verify result --------




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






RCR_SaveA Not equal to 0






RCR_SaveB Not equal to 0





Then - Actions






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








RCR_SaveAddCharges Equal to True








(Charges remaining in RCR_CombineItemA) Less than or equal to 1







Then - Actions








Set tempForce = (Player group((Owner of tempUnit)))








Quest - Display to tempForce the Simple Hint message: |cffff0000Error|r -...








Custom script: call DestroyForce(udg_tempForce)







Else - Actions








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










RCR_DisassembleSFX Not equal to <Empty String>









Then - Actions










Special Effect - Create a special effect attached to the origin of tempUnit using RCR_DisassembleSFX










Special Effect - Destroy (Last created special effect)









Else - Actions








Hero - Drop RCR_CombineItemA from tempUnit








Hero - Create tempItemType and give it to tempUnit








Set tempItem = (Last created item)








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










RCR_SaveAddCharges Equal to True









Then - Actions










Set tempInt = ((Charges remaining in RCR_CombineItemA) mod 2)










Item - Set charges remaining in (Last created item) to (((Charges remaining in RCR_CombineItemA) / 2) + tempInt)









Else - Actions








Hero - Create tempItemType2 and give it to tempUnit








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










RCR_SaveAddCharges Equal to True









Then - Actions










Item - Set charges remaining in (Last created item) to ((Charges remaining in RCR_CombineItemA) / 2)









Else - Actions








If (All Conditions are True) then do (Then Actions) else do (Else Actions)









If - Conditions










RCR_ShowText Equal to True









Then - Actions










Set tempForce = (Player group((Owner of tempUnit)))










Quest - Display to tempForce the New Item Received message: (|cff7777aaITEMS DISASSEMBLED|r - + (((Name of RCR_CombineItemA) + was disassembled into ) + ((Name of tempItem) + ( and + (Name of (Last created item))))))










Custom script: call DestroyForce(udg_tempForce)









Else - Actions








Item - Remove RCR_CombineItemA





Else - Actions



Else - Actions