1.
Mã:
Untitled Trigger 001
Events
Map initialization
Conditions
Actions
Set UnitTypeArray[TempInt] = Footman
Set ItemTypeArray[TempInt] = Claws of Attack +15
Set Item[TempInt] = Orb of Frost
Set TempInt = (TempInt + 1)
Set UnitTypeArray[TempInt] = Blood Mage
Set ItemTypeArray[TempInt] = Claws of Attack +15
Set Item[TempInt] = Orb of Slow
Set TempInt = (TempInt + 1)
Set UnitTypeArray[TempInt] = Kael
Set ItemTypeArray[TempInt] = Claws of Attack +15
Set Item[TempInt] = Orb of Darkness
Set TempInt = (TempInt + 1)
Mã:
Untitled Trigger 005
Events
Unit - A unit Sells an item (from shop)
Conditions
Actions
For each (Integer A) from 1 to TempInt, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Item-type of (Sold Item)) Equal to ItemTypeArray[(Integer A)]
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Buying unit)) Equal to UnitTypeArray[(Integer A)]
Then - Actions
Hero - Create Item[(Integer A)] and give it to (Buying unit)
Else - Actions
Else - Actions
2.
3.Đầu tiên bạn phải add item cần bán cho các shop bằng lệnh,ví dụ ở đây là Tome of Experience
Mã:
Neutral Building - Add Tome of Experience to all marketplaces with 1 in stock and a max stock of 1
Sau đó khi một unit mua item đó thành công thì bạn dùng lệnh
Mã:
Neutral Building - Remove Tome of Experience from all marketplaces
Theo kinh nghiệm của mình thì dù đặt stock và max stock là bao nhiêu thì mua một lần là nó tự biến mất khỏi shop rồi