Hôm nay xin đóng góp thêm 1 spell custom lục từ đống spell cũ ^^!
[spoil]
Tên Spell: Black Hole ( GUI - MUI )
Mô tả: Spell dạng channel, khi cast spell sẽ hút các unit địch trong khoảng cách vào hố đen, trước khi hố đen đóng lại sẽ có 1 luồng sáng lóe lên, tất cả unit gần hố đen sẽ bị hút vào một không gian khác, các unit khác không ở gần tâm hố đen sẽ may mắn thoát chết, cánh cổng thời gian đóng lại và tất cả sẽ chẳng còn gì sót lại ngoài vài...vũng máu bê bết đỏ... :)
Black Hole xuất hiện, mở ra cánh cổng đến không gian khác...
...và lúc cánh cổng bắt đầu khép lại..
...một ánh sáng hiện lên, Black Hole đã khép lại và mang theo tất cả những nạn nhân xấu số của nó.
Và đây là các trigger
Black Hole
Mã:
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Black Hole
Actions
Set MUI = (MUI + 1)
Set Caster[MUI] = (Casting unit)
Set Boolean[MUI] = True
Set TargetPoint[MUI] = (Target point of ability being cast)
Unit - Create 1 Dummy Black hole for (Owner of Caster[MUI]) at TargetPoint[MUI] facing Default building facing degrees
Set Dummy1[MUI] = (Last created unit)
Unit - Create 1 Dummy Black hole (2) for (Owner of Caster[MUI]) at TargetPoint[MUI] facing Default building facing degrees
Set Dummy2[MUI] = (Last created unit)
Set Integer[MUI] = (((Level of Black Hole for Caster[MUI]) x 125) + 71)
Countdown Timer - Start Timer as a Repeating timer that will expire in 0.04 seconds
Black Hole Run
Mã:
Events
Time - Timer expires
Conditions
Actions
For each (Integer A) from 1 to MUI, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Integer[(Integer A)] Greater than 71
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Boolean[(Integer A)] Equal to False
Then - Actions
Set Integer[(Integer A)] = 72
Else - Actions
Set Group[(Integer A)] = (Units within 1000.00 of TargetPoint[(Integer A)] matching ((((Matching unit) belongs to an enemy of (Owner of Caster[(Integer A)])) Equal to True) and (((Matching unit) is alive) Equal to True)))
Unit Group - Pick every unit in Group[(Integer A)] and do (Actions)
Loop - Actions
Set Point[(Integer A)] = (Position of (Picked unit))
Set PointMove[(Integer A)] = (Point[(Integer A)] offset by 8.00 towards (Angle from Point[(Integer A)] to TargetPoint[(Integer A)]) degrees)
Unit - Turn collision for (Picked unit) Off
Unit - Pause (Picked unit)
Unit - Move (Picked unit) instantly to PointMove[(Integer A)]
Unit - Unpause (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(((Picked unit) is in Groupcheck[(Integer A)]) Equal to False) and (((Picked unit) is alive) Equal to True)
Then - Actions
Unit Group - Add (Picked unit) to Groupcheck[(Integer A)]
Else - Actions
Custom script: call RemoveLocation(udg_Point[bj_forLoopAIndex])
Custom script: call RemoveLocation(udg_PointMove[bj_forLoopAIndex])
Custom script: call DestroyGroup(udg_Group[bj_forLoopAIndex])
Set Integer[(Integer A)] = (Integer[(Integer A)] - 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Integer[(Integer A)] Greater than 70
Then - Actions
Set Group[(Integer A)] = (Units within 1000.00 of TargetPoint[(Integer A)] matching ((((Matching unit) belongs to an enemy of (Owner of Caster[(Integer A)])) Equal to True) and (((Matching unit) is alive) Equal to True)))
Unit Group - Pick every unit in Group[(Integer A)] and do (Actions)
Loop - Actions
Set Point[(Integer A)] = (Position of (Picked unit))
Set PointMove[(Integer A)] = (Point[(Integer A)] offset by 8.00 towards (Angle from Point[(Integer A)] to TargetPoint[(Integer A)]) degrees)
Unit - Turn collision for (Picked unit) Off
Unit - Pause (Picked unit)
Unit - Move (Picked unit) instantly to PointMove[(Integer A)]
Unit - Unpause (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(((Picked unit) is in Groupcheck[(Integer A)]) Equal to False) and (((Picked unit) is alive) Equal to True)
Then - Actions
Unit Group - Add (Picked unit) to Groupcheck[(Integer A)]
Else - Actions
Custom script: call RemoveLocation(udg_Point[bj_forLoopAIndex])
Custom script: call RemoveLocation(udg_PointMove[bj_forLoopAIndex])
Custom script: call DestroyGroup(udg_Group[bj_forLoopAIndex])
Unit - Create 1 Dummy Effect for Neutral Passive at TargetPoint[(Integer A)] facing Default building facing degrees
Set Integer[(Integer A)] = (Integer[(Integer A)] - 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Integer[(Integer A)] Greater than 1
Then - Actions
Set Group[(Integer A)] = (Units within 1000.00 of TargetPoint[(Integer A)] matching ((((Matching unit) belongs to an enemy of (Owner of Caster[(Integer A)])) Equal to True) and (((Matching unit) is alive) Equal to True)))
Unit Group - Pick every unit in Group[(Integer A)] and do (Actions)
Loop - Actions
Set Point[(Integer A)] = (Position of (Picked unit))
Set PointMove[(Integer A)] = (Point[(Integer A)] offset by 8.00 towards (Angle from Point[(Integer A)] to TargetPoint[(Integer A)]) degrees)
Unit - Turn collision for (Picked unit) Off
Unit - Pause (Picked unit)
Unit - Move (Picked unit) instantly to PointMove[(Integer A)]
Unit - Unpause (Picked unit)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(((Picked unit) is in Groupcheck[(Integer A)]) Equal to False) and (((Picked unit) is alive) Equal to True)
Then - Actions
Unit Group - Add (Picked unit) to Groupcheck[(Integer A)]
Else - Actions
Custom script: call RemoveLocation(udg_Point[bj_forLoopAIndex])
Custom script: call RemoveLocation(udg_PointMove[bj_forLoopAIndex])
Custom script: call DestroyGroup(udg_Group[bj_forLoopAIndex])
Set Integer[(Integer A)] = (Integer[(Integer A)] - 1)
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Integer[(Integer A)] Greater than 0
Then - Actions
Set Group[(Integer A)] = (Units within 300.00 of TargetPoint[(Integer A)] matching ((((Matching unit) belongs to an enemy of (Owner of Caster[(Integer A)])) Equal to True) and (((Matching unit) is alive) Equal to True)))
Unit Group - Pick every unit in Group[(Integer A)] and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Picked unit) is A Hero) Equal to True
Then - Actions
Else - Actions
Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 100.00% transparency
Unit - Cause Caster[(Integer A)] to damage (Picked unit), dealing ((Real((Level of Black Hole for Caster[(Integer A)]))) x 5000.00) damage of attack type Spells and damage type Normal
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(((Picked unit) is in Groupcheck[(Integer A)]) Equal to True) and (((Picked unit) is dead) Equal to False)
Then - Actions
Animation - Change (Picked unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 0.00% transparency
Else - Actions
Unit Group - Pick every unit in Groupcheck[(Integer A)] and do (Actions)
Loop - Actions
Unit - Turn collision for (Picked unit) On
Custom script: call DestroyGroup(udg_Group[bj_forLoopAIndex])
Custom script: call DestroyGroup(udg_Groupcheck[bj_forLoopAIndex])
Unit - Kill Dummy1[(Integer A)]
Unit - Kill Dummy2[(Integer A)]
Unit - Create 1 Wisp for Neutral Passive at TargetPoint[(Integer A)] facing Default building facing degrees
Special Effect - Create a special effect at TargetPoint[(Integer A)] using Abilities\Spells\Human\ReviveHuman\ReviveHuman.mdl
Special Effect - Destroy (Last created special effect)
Set Integer[(Integer A)] = (Integer[(Integer A)] - 1)
Custom script: call RemoveLocation(udg_TargetPoint[bj_forLoopAIndex])
Else - Actions
Black Hole Check - Kiểm tra xem hero đã mất chanel hay không
Mã:
Events
Unit - A unit Stops casting an ability
Conditions
(Ability being cast) Equal to Black Hole
Actions
For each (Integer A) from 1 to MUI, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
And - All (Conditions) are true
Conditions
Integer[(Integer A)] Greater than 71
(Casting unit) Equal to Caster[(Integer A)]
Then - Actions
Set Boolean[(Integer A)] = False
Else - Actions
[/spoil]
Spell này đã lâu lắm rồi nên mình chẳng còn nhớ gì để giảng giải lại, mong các bạn thông cảm @@!