AzuhaSky
T.E.T.Я.I.S
YAN[asian];18617567 nói:Đọc kĩ hộ mình chút >_<! Để phải post đến post thứ 3 vì mỗi cái tí ti này =_=!
Thì trong trigger editor, khi một điều kiện nào đó xảy ra, bạn cho hành động là Unit - Add Locust to (Mục tiêu nào?)
---------- Post added at 17:43 ---------- Previous post was at 17:31 ----------
Quote lần 1, Sky or someone giúp với @@
Hôm trước viết trả lời rồi, nhưng lỡ tay bấm nút Backspace, tức quá nên không viết lại!
Giờ hướng dẫn nè:
Khi mà map vừa mới lên đó, bạn tạo sẵn một biến unit-type array rồi làm như sau:
Mã:
Events: Time - Elapse 0.00 seconds of game time
Condition
Actions:
set unittype[1] = Warlock
set unittype[2] = Magical
set unittype[3] = Shaolin
set unittype[4] = EmeiSword
// cho hàm này, mình có 4 hero nào đó cần cho random chả hạng!
Mã:
Events: Player 1 chat message "-ar" as a matched string
Conditions:
Actions:
local integer i=1
loop
exitwhen (i==10)// có 10 em chơi
if Player control of (Player(i)) equal to User and slot user jj đó của (player(i)) equal to Is playing then
loop
set tempType = unittype[Random number from 1 to 4]
exitwhen (tempType not equal to no unit-type)
endloop
set tempUnit = Unit - Create tempType for Player(i) at Chỗ nào đó facing chỗ đó đó
sau cho gọi hàm kêu tên tempUnit cho em nào đó!Và nhớ chỉ số i có thể thay bằng Integer A gì đó, nhưng sử dụng i cho chắc ăn, bởi nó sẽ chạy ổn định khi mỗi lần ngắt quãng ở mỗi lượt lặp lại, tránh lag!
endif
set i=i+1
endloop
---------- Post added at 17:56 ---------- Previous post was at 17:43 ----------
Tiếp nữa nè:
Trong hàm loop lúc nãy, sau khi tạo rồi thì nhớ cho một lượt loop nữa, từ 1 cho đến 4 và làm như sau:
Mã:
local integer k=1
loop
exitwhen (k==4)
if tempUnit equal to unittype[k] then set unittype[k]=no unit-type
set k=k+1
endloop
Về -rp, thì cũng như lệnh -ar vậy, thay vì set tempUnit = tạo unit, bạn hãy dùng hàm Unit - Replace (First of (Unit owner by (Triggering player) matching ((Matching unit) is a hero equal to true))) with tempType with relative life and mana

IsUnitInRange(OO111II,OO111OI,200.))and(V6(OO111II,852127,1093677139)))or(e6(OO111II,852231,1093677132,OO111OI))
Deprotected map người ta ra rồi hỏi á?
Thanks nhìu