Faerie Tale
Youtube Master Race
Đây là trigger chọn hero cho Computer
![]()
1)Mình gặp rắc rối ở chỗ là khi mà random cho 3 computer trở lên thì hay bị random trùng hero.
Ví dụ : Computer 7 random được thì Tidus, Computer 8 được Cloud, thì Computer 9 vẫn được Cloud.
Bạn nào giúp mình fix cái này với, chỉnh làm sao mà khi random các Computer ko trùng hero
2)Mình muốn là khi mà Player chọn được 1 kon hero thì các kon hero random cho Computer sẽ ko có hero mà Player vừa chọn và ngược lại.
Chế độ chọn Hero mình đang dùng là Hero Tavern.
Mong sự giúp đỡ của các bạn![]()
1 + 2) Tạo thêm 1 biến Integer tên là MaxHero (biến này sẽ là tổng số heroes của bạn, lúc đầu sẽ là 6), rồi để toàn bộ chỗ Set Hero[1] = Blilzball Star......Set Hero[6] = Tailed Boy vào một trigger khác (trigger này có Event là Map Initialization) ; tạo một biến Unit-Type tên là TempUType, một biến Unit tên là TempUnit và một biến Integer tên là TempInt. Sau đó khi random hero thì:
Mã:
Actions
Set TempInt = (Random integer number between 1 and MaxHero)
Set TempUType = Hero[TempInt]
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
MaxHero Equal to 0
TempUType Equal to No unit-type
Then - Actions
Game - Display to (All players) the text: There is no hero to...
Skip remaining actions
Else - Actions
For each (Integer A) from TempInt to (MaxHero - 1), do (Actions)
Loop - Actions
Set Hero[(Integer A)] = Hero[((Integer A) + 1)]
Set MaxHero = (MaxHero - 1)
Unit - Create 1 TempUType for (Triggering player) at (Center of (Playable map area)) facing Default building facing degrees
Set TempUnit = (Last created unit)
Game - Display to (All players) the text: ((Name of (Triggering player)) + ( has randomed + (Name of TempUnit)))
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Player - Limit training of TempUType to 0 for (Picked player)
Demo: http://www.mediafire.com/?cq1icj5ai6vib5z