[Tutorial] Tạo các hiệu ứng skill

Evil_Hunter

Mario & Luigi
Như các bạn đã biết, một skill cơ bản bao gồm 2 phần, là hiệu ứng và damage (sát thương). Nên dù một skill mà thiếu hiệu ứng hoặc damage đều ko thể chấp nhận đc. Trong một vài trường hợp khác thì người Việt mình đều thích đẹp chứ ko quan trọng nó deal dmg ra sao, nhỉ? :D

View attachment Test.rar

1. Tạo hiệu ứng thành vòng tròn
[spoil]
Đơn giản nhưng biết cách phối hợp sẽ tạo nên skill rất đẹp :-
untitled.jpg
Ảnh minh họa​

Đếm kĩ sẽ thấy 10 effect Thunder clap xung quanh Mountain King.
Sau đây là code

Mã:
Untitled Trigger 001
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Thunder Clap
    Actions
        For each (Integer A) from 1 to 10, do (Actions)
            Loop - Actions
                Special Effect - Create a special effect at ((Position of (Casting unit)) offset by 500.00 towards ((Real((Integer A))) x 36.00) degrees) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl
Giải thích các dòng lệnh như sau:
- Events: Một unit bắt đầu một hiệu ứng của kĩ năng
- Conditions (điều kiện): Kĩ năng unit dùng là Thunder Clap
- Actions: Như đã nói ở trên, thấy 10 effect Thunder Clap tượng trưng cho dòng thứ nhất trong action. Tức làm một action từ 1 đến 10, nôm na là làm 10 lần. Dòng dưới là tạo effect. Position of (Casting unit): Tức vị trí của unit đã dùng skill Thunder Clap.offset by 500.00 towards tức cách xa vị trí đó 500 range (xem hình coi phải ko :-), và ((Real((Integer A))) x 36.00) degrees. Chữ degrees là gì? Độ. Liên quan đến hình tròn đấy ;)). Tại sao lại phải Integer A x 36? Vì một vòng tròn có 360 độ, mà muốn effect thành một hình tròn => phải lấy 360/10, 10 tức số effect. Nhỉ :)). Và Integer A tức 10.[/spoil]



2. Tạo hiệu ứng thành một đương thẳng
[spoil]

untitled-1.jpg
Ảnh minh họa​


Sau đây là code
Mã:
Untitled Trigger 001 Copy
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to abc 
    Actions
        For each (Integer A) from 1 to 20, do (Actions)
            Loop - Actions
                Special Effect - Create a special effect at ((Position of (Casting unit)) offset by ((Real((Integer A))) x 150.00) towards (Facing of (Casting unit)) degrees) using Abilities\Spells\Undead\FrostNova\FrostNovaTarget.mdl

Giải thích các dòng lệnh như sau:
- Events: Một unit bắt đầu một hiệu ứng của kĩ năng
- Conditions (điều kiện): Kĩ năng unit dùng là Abc(Abc ở đây base từ skill Carion Spawn Của Dreadlord, thay một vài chỗ)
- Actions: Cũng giống như phần 1, for each loop from 1 to 20 tức lập 20 lần, dòng 2 tạo effect ở nơi unit dùng skill, offset by ((Real((Integer A))) x 150.00) towards // Integer A x 150, tượng trưng cho 20 x 150 tức cứ 150 range trong war sẽ tạo một hiệu ứng FrostNova. Đơn giản mà đẹp nhỉ :D [/spoil]



3. Hình dấu cộng
[spoil]

untitled-2.jpg
Ảnh minh họa​


Sau đây là code
Mã:
Untitled Trigger 001 Copy Copy
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to War Stomped
    Actions
        For each (Integer B) from 1 to 5, do (Actions)
            Loop - Actions
                For each (Integer A) from 1 to 4, do (Actions)
                    Loop - Actions
                        Special Effect - Create a special effect at ((Position of (Casting unit)) offset by ((Real((Integer B))) x 150.00) towards (90.00 x (Real((Integer A)))) degrees) using Abilities\Spells\Orc\WarStomp\WarStompCaster.mdl
                        Special Effect - Destroy (Last created special effect)

Giải thích các dòng lệnh như sau:
- Events: Một unit bắt đầu một hiệu ứng của kĩ năng
- Conditions (điều kiện): Kĩ năng unit dùng là War Stomped(Base từ skill War Stomp Của Tauren, thay một vài chỗ)
- Actions: Bắt đầu từ dòng cuối trước. Tạo effect cách vị trí của unit dùng skill là ((Real((Integer B))) x 150.00), tức cứ mỗi 150 phạm vi sẽ tạo một effect, mà integer B từ 1-5 => sẽ có 5 effect từ chỗ unit dùng skill cho tới hết, Còn (90.00 x (Real((Integer A)))) degrees) tức giống cách tạo vòng tròn, nhưng chỉ có 4 điểm (360/4=90 ý) => Ta sẽ đc 4 effect xung quanh unit dùng skill theo hình dấu cộng, nhưng chỉ một lớp, do đó Integer B ở ngoài sẽ làm cho lớp này đc tạo 5 lần với phạm vi càng ngày xa ra. Hiểu chứ :D [/spoil]


4. Hình vuông
[spoil]

Square.jpg
Ảnh minh họa​


Sau đây là code
Mã:
Untitled Trigger 001 Copy Copy Copy
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Starfall
    Actions
        For each (Integer B) from 1 to 7, do (Actions)
            Loop - Actions
                Special Effect - Create a special effect at (((Position of (Casting unit)) offset by 500.00 towards (90.00 + 45.00) degrees) offset by ((Real((Integer B))) x 100.00) towards 360.00 degrees) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
                Special Effect - Destroy (Last created special effect)
                Special Effect - Create a special effect at (((Position of (Casting unit)) offset by 500.00 towards (180.00 + 45.00) degrees) offset by ((Real((Integer B))) x 100.00) towards 90.00 degrees) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
                Special Effect - Destroy (Last created special effect)
                Special Effect - Create a special effect at (((Position of (Casting unit)) offset by 500.00 towards (270.00 + 45.00) degrees) offset by ((Real((Integer B))) x 100.00) towards 180.00 degrees) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
                Special Effect - Destroy (Last created special effect)
                Special Effect - Create a special effect at (((Position of (Casting unit)) offset by 500.00 towards (360.00 + 45.00) degrees) offset by ((Real((Integer B))) x 100.00) towards 270.00 degrees) using Abilities\Spells\NightElf\Starfall\StarfallTarget.mdl
                Special Effect - Destroy (Last created special effect)

Giải thích các dòng lệnh như sau:
- Events: Một unit bắt đầu một hiệu ứng của kĩ năng
- Conditions (điều kiện): Kĩ năng unit dùng là Starfall(Base từ skill Starfall Của Priestess of the Moon, thay một vài chỗ)
- Actions:Cứ làm theo tự hiểu :- vì dù tạo theo cách này nó cũng ko thay đỏi góc => cứ làm y chang là đc :)) [/spoil]


5. Hình tam giác
[spoil]

untitled-3.jpg
Ảnh minh họa​


Sau đây là code
Mã:
Untitled Trigger 001 Copy Copy Copy Copy
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Flaming 
    Actions
        For each (Integer B) from 1 to 7, do (Actions)
            Loop - Actions
                Special Effect - Create a special effect at (((Position of (Casting unit)) offset by 500.00 towards 120.00 degrees) offset by ((Real((Integer B))) x 120.00) towards 270.00 degrees) using Units\Demon\Infernal\InfernalBirth.mdl
                Special Effect - Destroy (Last created special effect)
                Special Effect - Create a special effect at (((Position of (Casting unit)) offset by 500.00 towards 240.00 degrees) offset by ((Real((Integer B))) x 120.00) towards 28.00 degrees) using Units\Demon\Infernal\InfernalBirth.mdl
                Special Effect - Destroy (Last created special effect)
                Special Effect - Create a special effect at (((Position of (Casting unit)) offset by 500.00 towards 360.00 degrees) offset by ((Real((Integer B))) x 120.00) towards 150.00 degrees) using Units\Demon\Infernal\InfernalBirth.mdl
                Special Effect - Destroy (Last created special effect)

Giải thích các dòng lệnh như sau:
- Events: Một unit bắt đầu một hiệu ứng của kĩ năng
- Conditions (điều kiện): Kĩ năng unit dùng là Flaming(Base từ skill Thunder, thay một vài chỗ)
- Actions:Cứ làm theo tự hiểu :- vì dù tạo theo cách này nó cũng ko thay đỏi góc => cứ làm y chang là đc :)), y hình vuông :)) [/spoil]
 
Chỉnh sửa cuối:
bài này đáng rep vì đây là bài đầu tiên do bạn lập với hướng dẫn khá tốt! :D
 
-Hay wá đúng cái đang cần nghiên cứu :D
-Ở đây là các hình đơn giản. Nếu là hình zíc zắc thì sao ta ? hay hình ngôi sao ? :5cool_ops: e ko dám đòi hỏi đâu
 
ziczac làm tương tự xem :-?
Trên toàn là hàng thủ công, ngồi canh đo ==
còn tạo star thì dùng system cho lợi, chứ tạo cách này thì,...
 
Bổ sung cho chủ thớt:

__I. Hình Ziczac:
Ziczac-1.png

Hình trên mô tả vị trí các point để làm hình Ziczac

  • Tròn đen: unit hoặc point gốc
  • Tròn đỏ: EffectPoint_1
  • Tròn xanh: EffectPoint_2
  • Đường xanh và đỏ: các vị trí của TempPoint, các vị trí này sẽ tạo nên hình Ziczac


Và đây là code:
Mã:
Ziczac Effect
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Thunder Clap
    Actions
        Set TempLoc = (Position of (Triggering unit))
        For each (Integer A) from 1 to 3, do (Actions)
            Loop - Actions
                [COLOR=#ff0000]Set EffectPoint_1 = (TempLoc offset by (530.00 x (Real(((Integer A) - 1)))) towards (Facing of (Triggering unit)) degrees) [/COLOR]// xem phần **[COLOR=#ff0000]
                For each (Integer B) from 1 to 5, do (Actions)
                    Loop - Actions
                        Set TempPoint = (EffectPoint_1 offset by (75.00 x (Real(((Integer B) - 1)))) towards ((Facing of (Triggering unit)) + 45.00) degrees)
                        Special Effect - Create a special effect at TempPoint using Abilities\Weapons\VengeanceMissile\VengeanceMissile.mdl
                        Special Effect - Destroy (Last created special effect)
                        Custom script:   call RemoveLocation( udg_TempPoint )[/COLOR]
                [COLOR=#0000ff]Set EffectPoint_2 = (EffectPoint_1 offset by (75.00 x 5.00) towards ((Facing of (Triggering unit)) + 45.00) degrees)
                For each (Integer B) from 1 to 5, do (Actions)
                    Loop - Actions
                        Set TempPoint = (EffectPoint_2 offset by (75.00 x (Real(((Integer B) - 1)))) towards ((Facing of (Triggering unit)) - 45.00) degrees)
                        Special Effect - Create a special effect at TempPoint using Abilities\Weapons\FarseerMissile\FarseerMissile.mdl
                        Special Effect - Destroy (Last created special effect)
                        Custom script:   call RemoveLocation( udg_TempPoint )[/COLOR]
                Custom script:   call RemoveLocation( udg_EffectPoint_1 )
                Custom script:   call RemoveLocation( udg_EffectPoint_2 )
        Custom script:   call RemoveLocation( udg_TempLoc )

* : đoạn code màu đỏ tạo nên đường màu đỏ trên hình, đoạn code màu xanh tạo nên đường màu xanh trên hình
** : khoảng cách giữa 2 point đỏ được tính bằng (khoảng cách từ point đỏ đến point xanh /cos 45 độ). Ở ví dụ của tôi là 375/cos 45 = 530.

Kết quả ta được (tôi dùng 2 effect khác nhau để mọi người hiểu rõ công dụng của đoạn code màu đỏ và xanh):
Ziczac.jpg



__II. Hình ngôi sao:

Cái này thì đơn giản thôi, set vị trí 5 đỉnh của ngôi sao rồi cho hàm loop tạo effect từ đỉnh này đến đỉnh kia.
Mã:
Star Effect
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Avatar
    Actions
        Set TempLoc = (Position of (Triggering unit))
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                Set StarPoint[(Integer A)] = (TempLoc offset by 300.00 towards (144.00 x (Real((Integer A)))) degrees) [COLOR=#0000ff]// xem phần *[/COLOR]
        For each (Integer A) from 1 to 5, do (Actions)
            Loop - Actions
                For each (Integer B) from 1 to 6, do (Actions)
                    Loop - Actions
                        Set TempPoint = (StarPoint[(Integer A)] offset by (100.00 x (Real((Integer B)))) towards (Angle from StarPoint[(Integer A)] to StarPoint[((Integer A) + 1)]) degrees)
                        Special Effect - Create a special effect at TempPoint using Abilities\Spells\Human\MassTeleport\MassTeleportCaster.mdl
                        Special Effect - Destroy (Last created special effect)
                        Custom script:   call RemoveLocation( udg_TempPoint )
        For each (Integer A) from 1 to 6, do (Actions)
            Loop - Actions
                Custom script:   call RemoveLocation( udg_StarPoint[ bj_forLoopAIndex ] )
        Custom script:   call RemoveLocation( udg_TempLoc )
* : set vị trí của 5 đỉnh, góc giữa 2 đỉnh là 144 độ, như vậy thứ tự các đỉnh sẽ đan xen nhau. Nói là 5, nhưng tôi lại cho loop 6 lần, như vậy StarPoint[1] sẽ bằng StarPoint[6], để khi loop tạo effect:

  • Loop lần 1: tạo effect từ StarPoint[1] đến StarPoint[2]
  • Loop lần 2: tạo effect từ StarPoint[2] đến StarPoint[3]
    ...
  • Loop lần 5: tạo effect từ StarPoint[5] đến StarPoint[6], tức StarPoint[1]
    Vậy chỉ cần loop 5 lần là ta được 1 ngôi sao 5 cánh, như thế này:
StarShape.jpg


Map Demo: Link!
 
Chỉnh sửa cuối:
Bổ sung demo đã remove leak...

@Leo: Tưởng star ... dài lắm chứ nhỉ. Ai ngờ ... :D
 
Cám ơn Evil_Hunter
Ít mấy ai chỉ mấy cái cơ bản và có giải thích
Còn Code của LeoNguyen112 mình nhìn rối mắt quá, có mấy cái không hiểu.

Đây là cái của mình làm theo cách hiểu của mình.
Mình ngu nhất phần trigger có gì sai sót mọi người cho mình ý kiến nha.

Ziczac:
1ebb8046e86b23110bdc7378c1d9f1af_52129212.untitled.jpg

Star:
e45f482dd1f662e4d82d2663af51a737_52129213.untitled2.jpg


Đây là map: http://www.mediafire.com/?vzrjkzj03a099ja
 
đây là thuật toán vẽ hình tròn xoắn ốc 5 hướng trong! mình hok biết tên nó là gì :-ss
bạn nào giúp mình làm 1 cái map demo bằng hàm số dưới với vì hok hiểu cách loop cho lắm :((

a=5
b=7
c=2.2
theta=360*t*10
x=(a-b)*cos(theta)+c*cos((a/b-1)*theta)
y=(a-b)*sin(theta)-c*sin((a/b-1)*theta)
 
effect mình nói thât ra nó trông như thế :-?
8aa49c4d2b5b0156383dfa129a952352_52139371.untitled.png


công thức đã có rồi mà hok biết cách loop của nó :-?
 
đây là thuật toán vẽ hình tròn xoắn ốc 5 hướng trong! mình hok biết tên nó là gì :-ss
bạn nào giúp mình làm 1 cái map demo bằng hàm số dưới với vì hok hiểu cách loop cho lắm :((

a=5
b=7
c=2.2
theta=360*t*10
x=(a-b)*cos(theta)+c*cos((a/b-1)*theta)
y=(a-b)*sin(theta)-c*sin((a/b-1)*theta)

mình ko hiểu t là gì cả, mấy cái còn lại mình hiểu
 
ah hiểu rồi

Công thức đúng nhưng khi đưa vào loop thì cái hình nó nhỏ và khi phóng to ra thì thưa lắm.
vòng loop chạy t (t là số nguyên)
Nên mình đã nhân t cho 5 để mật độ nó dày lên.
Do vậy mình phải lấy 36/5=7.2 (Công thức ở trên là Đồ thị tạo độ Oxy 360*t*10, còn mình làm trong WE, thì lấy mỗi đơn vị là 100 ran nên phải chia 100 còn lại 36)

Đây là hình:
fdc7856034df8cec45ad828dad478e34_52145895.untitled1.jpg


Map tại đây
 
^ Eo ôi, giỏi kinh thế :|
Bạn còn có thể làm đc hinh gì nữa cứ post lên đây đi, mĩnh xem thử :D
 
Evil_Hunter ơi, mình ngu cái trigger lắm, có lúc thầy cô nói mình đc cái là tư duy, mình chỉ cần hiểu bản chất của ngôn ngữ trong trigger mình làm kiểu gì cũng đc hết.
Thực ra minh mới học từ bạn từ hôm qua thôi. Nếu bạn làm thêm topic nào hướng dẫn cái bản chất gây sát thương, slow, stun, ...
Kiến thực sự về trigger chỉ có nhiêu đó thôi ... (Mong bạn và những người khác giúp đỡ)

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

Còn cái xoắn ốc trong các bạn sửa loop 1 to 500 thành 1to 350 (vì 1 chu kỳ của xoắn ốc đối với Code của mình là 350 là nó lặp lại)
Đây là bản sửa chữa : Map
 
Đây là Code:

Ziczac:
PHP:
Ziczac
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Ziczac 
    Actions
        Set Point = ((Position of (Casting unit)) offset by 250.00 towards ((Facing of (Casting unit)) + 60.00) degrees)
        For each (Integer Integer_A) from 1 to 5, do (Actions)
            Loop - Actions
                Special Effect - Create a special effect at ((Position of (Casting unit)) offset by ((Real(Integer_A)) x 50.00) towards (60.00 + (Facing of (Casting unit))) degrees) using Abilities\Spells\Undead\OrbOfDeath\OrbOfDeathMissile.mdl
                Special Effect - Destroy (Last created special effect)
        For each (Integer Integer_A) from 1 to 3, do (Actions)
            Loop - Actions
                For each (Integer Integer_B) from 1 to 10, do (Actions)
                    Loop - Actions
                        Special Effect - Create a special effect at (Point offset by ((Real(Integer_B)) x 50.00) towards ((Facing of (Casting unit)) + 300.00) degrees) using Abilities\Spells\Undead\OrbOfDeath\OrbOfDeathMissile.mdl
                        Special Effect - Destroy (Last created special effect)
                Set Point = (Point offset by 500.00 towards ((Facing of (Casting unit)) + 300.00) degrees)
                For each (Integer Integer_B) from 1 to 10, do (Actions)
                    Loop - Actions
                        Special Effect - Create a special effect at (Point offset by ((Real(Integer_B)) x 50.00) towards ((Facing of (Casting unit)) + 60.00) degrees) using Abilities\Spells\Undead\OrbOfDeath\OrbOfDeathMissile.mdl
                        Special Effect - Destroy (Last created special effect)
                Set Point = (Point offset by 500.00 towards ((Facing of (Casting unit)) + 60.00) degrees)

Ngôi sao
PHP:
Star
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Thunder Clap
    Actions
        Set Point = ((Position of (Casting unit)) offset by 315.37 towards (Facing of (Casting unit)) degrees)
        For each (Integer Integer_A) from 1 to 5, do (Actions)
            Loop - Actions
                For each (Integer Integer_B) from 1 to 12, do (Actions)
                    Loop - Actions
                        Special Effect - Create a special effect at (Point offset by ((Real(Integer_B)) x 50.00) towards (((Facing of (Casting unit)) + 18.00) + ((Real(Integer_A)) x 144.00)) degrees) using Abilities\Spells\Undead\OrbOfDeath\OrbOfDeathMissile.mdl
                        Special Effect - Destroy (Last created special effect)
                Set Point = (Point offset by 600.00 towards (((Facing of (Casting unit)) + 18.00) + ((Real(Integer_A)) x 144.00)) degrees)

Xoắn ốc 5 hướng
PHP:
Xoan oc
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to War Stomp
    Actions
        For each (Integer Integer_A) from 1 to 5, do (Actions)
            Loop - Actions
                For each (Integer Integer_B) from 1 to 50, do (Actions)
                    Loop - Actions
                        Special Effect - Create a special effect at ((Position of (Casting unit)) offset by ((Real(Integer_B)) x 25.00) towards ((Facing of (Casting unit)) + (((Real(Integer_B)) x 9.00) + ((Real(Integer_A)) x 72.00))) degrees) using Abilities\Spells\Undead\OrbOfDeath\OrbOfDeathMissile.mdl
                        Special Effect - Destroy (Last created special effect)

Xoắn ốc 5 hướng trong
PHP:
Xoan oc trong
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Starfall
    Actions
        Set Real_A = 5.00
        Set Real_B = 7.00
        Set Real_C = 2.20
        For each (Integer Integer_T) from 1 to 350, do (Actions)
            Loop - Actions
                Set Real_Theta = (7.20 x (Real(Integer_T)))
                Set Real_X = (((Real_A - Real_B) x (Cos(Real_Theta))) + (Real_C x (Cos((((Real_A / Real_B) - 1.00) x Real_Theta)))))
                Set Real_Y = (((Real_A - Real_B) x (Sin(Real_Theta))) - (Real_C x (Sin((((Real_A / Real_B) - 1.00) x Real_Theta)))))
                Special Effect - Create a special effect at ((Position of (Casting unit)) offset by ((Real_X x 150.00), (Real_Y x 150.00))) using Abilities\Weapons\SpiritOfVengeanceMissile\SpiritOfVengeanceMissile.mdl
                Special Effect - Destroy (Last created special effect)

Đây là map
 
cảm ơn bạn bgcy_ro002 nhiều, nhờ bạn mình mới biết rằng quên mất tăng distance cho vị trí XY nên test gặp lỗi :-"

và đây là Xoắn ốc 5 hướng ngoài
03f32c65ebf665ce353eb85bda081b34_52157587.gggg.png


công thức:
PHP:
scope test initializer int
    globals
        string ex = "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl"
        real x = 0
        real y = 0
        real theta = 0
    endglobals
    
    function cf takes nothing returns boolean
        return GetSpellAbilityId() == 'AEsf'
    endfunction
    
    private function f takes nothing returns nothing
        local unit u = GetTriggerUnit()
        local real a = 5.00
        local real b = 3.00
        local real c = 5.00
        local integer t = 0
        for t = 1 to 360
        set theta = (7.20 * I2R(t))
        set x = (a + b) * Cos(theta) - c * Cos((a / b + 1) * theta)
        set y = (a + b) * Sin(theta) - c * Sin((a / b + 1) * theta)
        call DestroyEffect(AddSpecialEffect(ex, GetUnitX(u) + (x * 50), GetUnitY(u) + (y * 50)))
        endfor
    endfunction

//===========================================================================
    private function int takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
        call TriggerAddCondition(t, Condition( function cf ) )
        call TriggerAddAction(t, function f )
    endfunction
endscope
download :
http://www.mediafire.com/?2n9qd4n4hmshbr8

P/S: mình còn đến 96 thuật toán hiệu ứng có nhịp sẽ share tiếp cho mọi người vậy :">
 
Chỉnh sửa cuối:
Hay! a,b,c là cơ số của thuật toán đó, mình có thể thay đổi để cho hình theo ý muốn của mình
 
và đây là cong mặt trăng
d071c4633b90068253e3133801594bad_52164803.p5.png


công thức:
PHP:
scope test initializer int
    globals
        string ex = "Abilities\\Weapons\\SpiritOfVengeanceMissile\\SpiritOfVengeanceMissile.mdl"
        real x = 0
        real y = 0
    endglobals
    
    function cf takes nothing returns boolean
        return GetSpellAbilityId() == 'AEsf'
    endfunction
    
    private function f takes nothing returns nothing
        local unit u = GetTriggerUnit()
        local integer t = 0
        for t = 1 to 180
        set x = Cos(t * 360) + Cos(2 * t * 360)
        set y = Sin(t * 360) * 2 + Sin(t * 360) * 2
        call DestroyEffect(AddSpecialEffect(ex, GetUnitX(u) + (x * 100), GetUnitY(u) + (y * 100)))
        endfor
    endfunction

//===========================================================================
    private function int takes nothing returns nothing
        local trigger t = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
        call TriggerAddCondition(t, Condition( function cf ) )
        call TriggerAddAction(t, function f )
    endfunction
endscope
download :
http://www.mediafire.com/?fcl35b43v5h1h3h
 
Đây là Moon:
1f5d1ac8a97c76f57fd6f12532b2ba92_52176753.untitled5.jpg


[COLOR=""]Đây là Code:[/COLOR]
[SPOIL]
Mã:
Moon
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Moon 
    Actions
        For each (Integer Integer_A) from 1 to 30, do (Actions)
            Loop - Actions
                Special Effect - Create a special effect at ((Position of (Casting unit)) offset by 300.00 towards ((Facing of (Casting unit)) + (((Real(Integer_A)) x 10.00) - 150.00)) degrees) using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
                Special Effect - Destroy (Last created special effect)
        For each (Integer Integer_A) from 1 to 27, do (Actions)
            Loop - Actions
                Special Effect - Create a special effect at (((Position of (Casting unit)) offset by 100.00 towards ((Facing of (Casting unit)) + 180.00) degrees) offset by 200.00 towards ((Facing of (Casting unit)) + (((Real(Integer_A)) x 10.00) - 135.00)) degrees) using Abilities\Weapons\FaerieDragonMissile\FaerieDragonMissile.mdl
                Special Effect - Destroy (Last created special effect)
[/SPOIL]

Còn đây là map
 
Back
Top