BlueSin
New Member
- Reaction score
- 37
The Recipe System is for items that require you to have certain
items before you can buy, or 'upgrade', to another, better item.
It handles many different scenarios, all demonstrated in a 'Demo Recipes' trigger. (See Below)
Please Credit if used.
Example Recipes:
EDIT:
> call Recipe(u, 'I000','I004','I005',0,100,200,true)
Does it explain, somewhere in that map, what that line might do?
If not, why not?
If yes, would I get it? Without knowing JASS?
This seems to be taking three weird numbers that I guess are IDs, what are the others?
Can I edit this thing somehow to work with 4 items + recipe = something?
items before you can buy, or 'upgrade', to another, better item.
It handles many different scenarios, all demonstrated in a 'Demo Recipes' trigger. (See Below)
Please Credit if used.
Example Recipes:
Code:
//Recipe Input: (The Buying Unit, The New Item ID, Required Item #1 ID, Required Item #2 ID,
// Required Item #3 ID, Gold Cost, Lumber Cost, Bought or Not)
function Trig_Test_Actions takes nothing returns nothing
local unit u=GetTriggerUnit()
local integer id=GetItemTypeId(GetManipulatedItem())
//Upgraded Through Store
//Axe
if(id == 'I000' )then
call Recipe(u, 'I000','I004','I005',0,100,200,true)
endif
//Sword
if(id == 'I002' )then
call Recipe(u, 'I002','I004','I004','I004',125,0,true)
endif
//Staff
if(id == 'I001' )then
call Recipe(u, 'I001','I005','I005',0,150,50,true)
endif
//Super Axe
if(id == 'I003' )then
call Recipe(u, 'I003','I005','I005',0,400,400,true)
endif
//Simply Combined (No Store Involved)
//Ghetto Orb
if(id == 'I006')then
call Recipe(u, 'I007','I006','I006','I006',0,0,false)
endif
//Good Orb (But also Great Orb + Good Orb=Ghetto Orb)
if(id == 'I007')then
call Recipe(u, 'I008','I007','I007',0,0,0,false)
call Recipe(u, 'I006','I008','I008','I007',0,0,false)
endif
//Ghetto Orb
if(id == 'I008')then
call Recipe(u, 'I006','I008','I008','I007',0,0,false)
endif
set u=null
endfunction
//===========================================================================
function InitTrig_Demo_Recipes takes nothing returns nothing
set gg_trg_Demo_Recipes = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Demo_Recipes, EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddAction( gg_trg_Demo_Recipes, function Trig_Test_Actions )
endfunction
EDIT:
> call Recipe(u, 'I000','I004','I005',0,100,200,true)
Does it explain, somewhere in that map, what that line might do?
If not, why not?
If yes, would I get it? Without knowing JASS?
This seems to be taking three weird numbers that I guess are IDs, what are the others?
Can I edit this thing somehow to work with 4 items + recipe = something?