- 13/11/11
- 270
- 160
Tạo một biến real=life của random 1 unit trong group đó. Sau đó pick từng unit trong group kia để check,nếu life của picked unit đó nhỏ hơn biến real thì set real = life của unit đó. Giá trị sau cùng trả về là biến real nhỏ nhất,sau đó tiếp tục pick từng unit trong group kia một lần nữa,nếu picked unit nào có giá trị life nhỏ hơn hoặc = biến real trên thì unit đó ít máu nhất trong group
Em làm thử trigger như thế này sai ở chỗ nào mà thỉnh thoảng nó chọn 2 thằng chứ ko phải chọn 1 (2 thằng máu ko bằng nhau).
[SPOIL]
Mã:
Untitled Trigger 001
Events
Player - Player 1 (Red) skips a cinematic sequence
Conditions
Actions
Set Group = (Units in Region 000 <gen>)
Set Life = (Life of (Random unit from Group))
Unit Group - Pick every unit in Group and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of (Picked unit)) Less than Life
Then - Actions
Set Unit = (Picked unit)
Set Life = (Life of Unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of (Picked unit)) Less than or equal to Life
Then - Actions
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
Special Effect - Destroy (Last created special effect)
Else - Actions
Else - Actions
skill khi cast thì pick từng unit trong phạm vi 200. Unit cứ 2s thì mất máu (max 3 lần). tức là khi dính skill rùi mà có blink ra đâu hay chạy bao xa cũng bị mất máu
ngoại trừ Orb Of Slow