langthangbairac
T.E.T.Я.I.S
- 19/5/12
- 594
- 767
Giới thiệu về skills : Khi dùng skills ( ở đây mình làm skills ở item ) thì mọi đòn kẻ địch tấn công ( bao gồm đánh thường và magic damage.
Đầu tiên là chuẩn bị 1 custom skills ( dạng notarget, nếu làm cho item thì nên chọn Berserk trong unit abilities ) thêm 1 cái buff tên là phan damage ( xem demo sẽ thấy )
Làm việc trigger :
1 . Làm 2 cái trigger add event :
và
xong phần add event, đến phần phản damage :
Từ phần Floating bạn có thể bỏ vì đấy là phần hiển thị số damage phản lại nên không cần thiết.
Đặc biệt chú ý đến condition
Nếu ko có cái này thì zZz.. khi bị take dame thì diss war luôn 
Nếu ai ko hiểu thì xem demo dưới
Lưu ý : Ở phần trigger do WE bị j ấy nên mình phải enabled trigger, các bạn down về tick vào ô enabled trong mấy cái trigger là đc
Đã sửa lại theo code chuẩn của anh Leo rồi :)
Demo
Đầu tiên là chuẩn bị 1 custom skills ( dạng notarget, nếu làm cho item thì nên chọn Berserk trong unit abilities ) thêm 1 cái buff tên là phan damage ( xem demo sẽ thấy )
Làm việc trigger :
1 . Làm 2 cái trigger add event :
Mã:
event add 1
Events
Time - Elapsed game time is 0.00 seconds
Conditions
Actions
Set Unit_group = (Unit in (Playable map area))
Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
Loop - Actions
Trigger - Add to Return <gen> the event (Unit - (Picked unit) Takes damage)
Mã:
event add 2
Events
Unit - A unit enters (Playable map area)
Conditions
Actions
Trigger - Add to Return <gen> the event (Unit - (Triggering unit) Takes damage)
xong phần add event, đến phần phản damage :
Mã:
Return
Events
Conditions
((Triggering unit) has buff Phan damage ) Equal to True
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Triggering unit) Not equal to (Damage source)
Then - Actions
Trigger - Turn off this trigger.
Unit - Cause (triggering unit) to damage (Damage source), dealing (Damage taken) damage of attack type Hero and damage type Normal
Floating Text - Create floating text that reads (+ + (String((Integer((Damage taken)))))) above (Triggering unit) with Z offset 0.00, using font size 8.50, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change the lifespan of (Last created floating text) to 6.00 seconds
Floating Text - Change the fading age of (Last created floating text) to 3.00 seconds
Trigger - Turn on this trigger.
Else - Actions
Đặc biệt chú ý đến condition
Mã:
((Triggering unit) has buff Phan damage ) Equal to True

Nếu ai ko hiểu thì xem demo dưới
Lưu ý : Ở phần trigger do WE bị j ấy nên mình phải enabled trigger, các bạn down về tick vào ô enabled trong mấy cái trigger là đc
Đã sửa lại theo code chuẩn của anh Leo rồi :)
Demo
Chỉnh sửa cuối:





