Tom_Kazansky
<b><font color="RoyalBlue"><font face="Lucida Cons
- 28/12/06
- 3,454
- 462
- Thread starter
- #1,001
cho em hỏi
1.làm sao để "bắt" event khi demon hunter chuyển từ dạng demon sang dạng thường......?
2.làm sao để k0 cho 1 hero k0 thể sử dụng item.. ( tức là k0 thể mua, bán, drop, chuyển cho hero khác....)???
1. tiếc là không có event nào như vậy, bạn phải dùng periodic event để check
Mã:
Metamorph Cast
Events
Unit - A unit [COLOR="#0000CD"][B]Finishes casting an ability[/B][/COLOR]
Conditions
(Ability being cast) Equal to Metamorphosis
Actions
Unit Group - Add (Triggering unit) to MetamorphUnits
chú ý event
trigger này chạy khi cast xong Metamorphosis, tức là đã hóa từ normal -> alternate
thêm unit này vào MetamorphUnits
Mã:
Metamorph Check
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
Unit Group - Pick every unit in MetamorphUnits and do (Actions)
Loop - Actions
Set TempUnit = (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit has buff Metamorphosis) Equal to False
Then - Actions
Unit Group - Remove TempUnit from MetamorphUnits
Game - Display to (All players) for 30.00 seconds the text: ((Name of TempUnit) + has morphed back to normal form!)
Else - Actions
ở đây mỗi 0.1s kiểm tra unit trong MetamorphUnits, nếu không còn buff Metamorphosis, tức là đã hết thời gian hóa, giờ unit sẽ chuyển từ alternate -> normal, ở đây sẽ bỏ unit đã hết hóa ra khỏi group MetamorphUnits và hiện một text
lý do dùng group để MUI, nhiều unit có Metamorphosis vẫn check được
2. bạn thêm một level cho ability Inventory (Hero) và ở level 2, không cho phép nhặt, ném, dùng item
khi cần disable thì:
Mã:
Unit - Set level of Inventory (Hero) for <hero> to 2
Unit - Add Dispel Magic to <hero>
Unit - Remove Dispel Magic from <hero>
( add/remove "Dispel Magic" (hay ability khác) để "refresh UI" )
khi enable thì đặt level là 1 thôi.


. Mình đã thử nhiều, ko phải do đương hẹp, và khi move thử thì nó luôn luôn stop như hình dưới
