truongdzuy
Mr & Ms Pac-Man
- 25/1/09
- 274
- 40
Cho hỏi về cách làm skill Timber Chain của Goblin Shelder trong DotA
Hỏi thêm về đống trigger này :
General Init
[spoil]
Events
Map initialization
Conditions
Actions
Hashtable - Create a hashtable
Set SpellData = (Last created hashtable)
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Player - Disable Darkscreen Ability Hidden for (Picked player)
[/spoil]
Set Attack Flag For Hero
[spoil]
Events
Unit - A unit Is attacked
Conditions
((Attacked unit) is A Hero) Equal to True
Actions
-------- set these so we will know the damage is from attack or not --------
Custom script: set udg_TempHandle = GetAttackedUnitBJ()
Hashtable - Save True as (Key AttackFlag) of (Key TempHandle) in SpellData
Hashtable - Save Handle Of(Triggering unit) as (Key AttackTarget) of (Key TempHandle) in SpellData
Custom script: set udg_TempInt = udg_TempOrder
Hashtable - Save TempInt as (Key AttackOrder) of (Key TempHandle) in SpellData
[/spoil]
Abort Attack Flag
[spoil]
Events
Unit - A unit Is issued an order with no target
Unit - A unit Is issued an order targeting a point
Unit - A unit Is issued an order targeting an object
Conditions
((Triggering unit) is A Hero) Equal to True
Actions
Set TempUnit = (Triggering unit)
Custom script: set udg_TempHandle = udg_TempUnit
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load (Key AttackFlag) of (Key TempHandle) from SpellData) Equal to True
Then - Actions
-------- if this unit has Attack Flag set, check if its attack is interrupted or not --------
Set TempInt = (Load (Key AttackOrder) of (Key TempHandle) from SpellData)
Custom script: set udg_AttackOrder = udg_TempInt
Set TempUnit2 = (Load (Key AttackTarget) of (Key TempHandle) in SpellData)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
Or - Any (Conditions) are true
Conditions
(Target unit of issued order) Equal to No unit
And - All (Conditions) are true
Conditions
(Target unit of issued order) Not equal to No unit
TempUnit2 Not equal to (Target unit of issued order)
(Current order of TempUnit) Not equal to AttackOrder
Then - Actions
-------- if interrupted, remove the flag --------
Hashtable - Save False as (Key AttackFlag) of (Key TempHandle) in SpellData
Hashtable - Save Handle OfNo unit as (Key AttackTarget) of (Key TempHandle) in SpellData
Hashtable - Save 0 as (Key AttackOrder) of (Key TempHandle) in SpellData
Else - Actions
Else - Actions
[/spoil]
Darkscreen Learn
[spoil]
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Darkscreen
Actions
Set TempUnit = (Triggering unit)
Set TempInt = (Learned skill level)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit is in Darkscreen_InCD_G) Equal to False
Then - Actions
-------- Jinada is not in cooldown --------
Unit - Add Darkscreen Ability Hidden to TempUnit
Unit - Set level of Darkscreen Evade for TempUnit to TempInt
Else - Actions
[/spoil]
Darkscreen Hit
[spoil]
Events
Game - GDD_Event becomes Equal to 0.00
Conditions
(Level of Empower for GDD_DamagedUnit) Greater than 0
Actions
Custom script: set udg_TempHandle = udg_GDD_DamagedUnit
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load (Key AttackFlag) of (Key TempHandle) from SpellData) Equal to True
Then - Actions
Unit - Remove Darkscreen Ability Hidden from GDD_DamagedUnit
Set TempInt = (Level of Darkscreen for GDD_DamagedUnit)
-------- divide by 0.1 because we use 0.1s timer for cooldown time check --------
Set Darkscreen_InCD_Time[Darkscreen_InCD_Count] = (Integer(((11.50 - (1.50 x (Real(TempInt)))) / 0.10)))
Set Darkscreen_InCD_U[Darkscreen_InCD_Count] = GDD_DamagedUnit
Set Darkscreen_InCD_Count = (Darkscreen_InCD_Count + 1)
-------- this group is used to detect if tidebringer is in cooldown or not --------
-------- actually, we can loop through the array "Jinada_InCD_U" to check but it would be slower --------
Unit Group - Add GDD_DamagedUnit to Darkscreen_InCD_G
Else - Actions
[/spoil]
Darkscreen CD
[spoil]
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
For each (Integer Darkscreen_Looper) from 0 to (Darkscreen_InCD_Count - 1), do (Actions)
Loop - Actions
Set Darkscreen_InCD_Time[Darkscreen_Looper] = (Darkscreen_InCD_Time[Darkscreen_Looper] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Darkscreen_InCD_Time[Darkscreen_Looper] Equal to 0
Then - Actions
Set TempUnit = Darkscreen_InCD_U[Darkscreen_Looper]
Set TempInt = (Level of Darkscreen for TempUnit)
-------- cooldown done, add critical strike --------
Unit - Add Darkscreen Ability Hidden to TempUnit
Unit - Set level of Darkscreen Evade for TempUnit to TempInt
-------- Jinada is not in cooldown anymore, remove unit from the group --------
Unit Group - Remove TempUnit from Darkscreen_InCD_G
Set Darkscreen_InCD_Count = (Darkscreen_InCD_Count - 1)
Set Darkscreen_InCD_Time[Darkscreen_Looper] = Darkscreen_InCD_Time[Darkscreen_InCD_Count]
Set Darkscreen_InCD_U[Darkscreen_Looper] = Darkscreen_InCD_U[Darkscreen_InCD_Count]
Set Darkscreen_Looper = (Darkscreen_Looper - 1)
Else - Actions
[/spoil]
Đây là 6 trigger của skill Darkscreen ( Evade 1 hit đánh - cd : 10/8.5/7/5.5s )
Vậy sao khi học xg, Hero[1] ( hero được học skill này ) bị đánh thì Hero[2] ( hero đánh vào Hero[1] ) thì nó kô cd và còn add thêm skill này vào Hero[2]
Làm dựa từ [Spell Pack] On Attack Hit Spell của a Tom.
P/s: vì trigger dài nên e bỏ thẳng vào Spoil cho dễ nhìn, nhìn =
Hỏi thêm về đống trigger này :
General Init
[spoil]
Events
Map initialization
Conditions
Actions
Hashtable - Create a hashtable
Set SpellData = (Last created hashtable)
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
Player - Disable Darkscreen Ability Hidden for (Picked player)
[/spoil]
Set Attack Flag For Hero
[spoil]
Events
Unit - A unit Is attacked
Conditions
((Attacked unit) is A Hero) Equal to True
Actions
-------- set these so we will know the damage is from attack or not --------
Custom script: set udg_TempHandle = GetAttackedUnitBJ()
Hashtable - Save True as (Key AttackFlag) of (Key TempHandle) in SpellData
Hashtable - Save Handle Of(Triggering unit) as (Key AttackTarget) of (Key TempHandle) in SpellData
Custom script: set udg_TempInt = udg_TempOrder
Hashtable - Save TempInt as (Key AttackOrder) of (Key TempHandle) in SpellData
[/spoil]
Abort Attack Flag
[spoil]
Events
Unit - A unit Is issued an order with no target
Unit - A unit Is issued an order targeting a point
Unit - A unit Is issued an order targeting an object
Conditions
((Triggering unit) is A Hero) Equal to True
Actions
Set TempUnit = (Triggering unit)
Custom script: set udg_TempHandle = udg_TempUnit
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load (Key AttackFlag) of (Key TempHandle) from SpellData) Equal to True
Then - Actions
-------- if this unit has Attack Flag set, check if its attack is interrupted or not --------
Set TempInt = (Load (Key AttackOrder) of (Key TempHandle) from SpellData)
Custom script: set udg_AttackOrder = udg_TempInt
Set TempUnit2 = (Load (Key AttackTarget) of (Key TempHandle) in SpellData)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Or - Any (Conditions) are true
Conditions
Or - Any (Conditions) are true
Conditions
(Target unit of issued order) Equal to No unit
And - All (Conditions) are true
Conditions
(Target unit of issued order) Not equal to No unit
TempUnit2 Not equal to (Target unit of issued order)
(Current order of TempUnit) Not equal to AttackOrder
Then - Actions
-------- if interrupted, remove the flag --------
Hashtable - Save False as (Key AttackFlag) of (Key TempHandle) in SpellData
Hashtable - Save Handle OfNo unit as (Key AttackTarget) of (Key TempHandle) in SpellData
Hashtable - Save 0 as (Key AttackOrder) of (Key TempHandle) in SpellData
Else - Actions
Else - Actions
[/spoil]
Darkscreen Learn
[spoil]
Events
Unit - A unit Learns a skill
Conditions
(Learned Hero Skill) Equal to Darkscreen
Actions
Set TempUnit = (Triggering unit)
Set TempInt = (Learned skill level)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(TempUnit is in Darkscreen_InCD_G) Equal to False
Then - Actions
-------- Jinada is not in cooldown --------
Unit - Add Darkscreen Ability Hidden to TempUnit
Unit - Set level of Darkscreen Evade for TempUnit to TempInt
Else - Actions
[/spoil]
Darkscreen Hit
[spoil]
Events
Game - GDD_Event becomes Equal to 0.00
Conditions
(Level of Empower for GDD_DamagedUnit) Greater than 0
Actions
Custom script: set udg_TempHandle = udg_GDD_DamagedUnit
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Load (Key AttackFlag) of (Key TempHandle) from SpellData) Equal to True
Then - Actions
Unit - Remove Darkscreen Ability Hidden from GDD_DamagedUnit
Set TempInt = (Level of Darkscreen for GDD_DamagedUnit)
-------- divide by 0.1 because we use 0.1s timer for cooldown time check --------
Set Darkscreen_InCD_Time[Darkscreen_InCD_Count] = (Integer(((11.50 - (1.50 x (Real(TempInt)))) / 0.10)))
Set Darkscreen_InCD_U[Darkscreen_InCD_Count] = GDD_DamagedUnit
Set Darkscreen_InCD_Count = (Darkscreen_InCD_Count + 1)
-------- this group is used to detect if tidebringer is in cooldown or not --------
-------- actually, we can loop through the array "Jinada_InCD_U" to check but it would be slower --------
Unit Group - Add GDD_DamagedUnit to Darkscreen_InCD_G
Else - Actions
[/spoil]
Darkscreen CD
[spoil]
Events
Time - Every 0.10 seconds of game time
Conditions
Actions
For each (Integer Darkscreen_Looper) from 0 to (Darkscreen_InCD_Count - 1), do (Actions)
Loop - Actions
Set Darkscreen_InCD_Time[Darkscreen_Looper] = (Darkscreen_InCD_Time[Darkscreen_Looper] - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Darkscreen_InCD_Time[Darkscreen_Looper] Equal to 0
Then - Actions
Set TempUnit = Darkscreen_InCD_U[Darkscreen_Looper]
Set TempInt = (Level of Darkscreen for TempUnit)
-------- cooldown done, add critical strike --------
Unit - Add Darkscreen Ability Hidden to TempUnit
Unit - Set level of Darkscreen Evade for TempUnit to TempInt
-------- Jinada is not in cooldown anymore, remove unit from the group --------
Unit Group - Remove TempUnit from Darkscreen_InCD_G
Set Darkscreen_InCD_Count = (Darkscreen_InCD_Count - 1)
Set Darkscreen_InCD_Time[Darkscreen_Looper] = Darkscreen_InCD_Time[Darkscreen_InCD_Count]
Set Darkscreen_InCD_U[Darkscreen_Looper] = Darkscreen_InCD_U[Darkscreen_InCD_Count]
Set Darkscreen_Looper = (Darkscreen_Looper - 1)
Else - Actions
[/spoil]
Đây là 6 trigger của skill Darkscreen ( Evade 1 hit đánh - cd : 10/8.5/7/5.5s )
Vậy sao khi học xg, Hero[1] ( hero được học skill này ) bị đánh thì Hero[2] ( hero đánh vào Hero[1] ) thì nó kô cd và còn add thêm skill này vào Hero[2]
Làm dựa từ [Spell Pack] On Attack Hit Spell của a Tom.
P/s: vì trigger dài nên e bỏ thẳng vào Spoil cho dễ nhìn, nhìn =
Mã:
thì hơi mệt (theo e ngĩ ).
Chỉnh sửa cuối:
Đọc kĩ cho hiểu đi đã chứ
được không nhỉ ????
)