Topic post, bàn luận, đóng góp ý kiến, thắc mắc, giải đáp, bình phẩm về Custom Spell.

  • Thread starter Thread starter raivor
  • Ngày gửi Ngày gửi
Em có 1 spell Post lên cho mọi người xem rồi cho em ý kiến với nha , lần đầu mọi người thông cảm. Spell khá là gà T_T
Spell 1: Wind Runing.
- Khi sử dụng Spell này thì tạo ra 12 cơn lốc ở Caster và bay ra nhiều phía quanh người cast. Không mất Damage mà chỉ làm cho Hero Invisible và + Speed cho Hero đó.
Spell 2: Wind Rate
- Là spell PAS. Khi learned spell thì các unit và hero đó sẽ tăng move speed và attack speed. Đồng thời đưa cấp độ gió của Spell Wind Runing lên cấp 2. Tức là có gây Dame. Khi nâng cấp level của spell này thì cấp độ gió sẽ tiếp tục tăng.
Đây là trigger của Spell 1:
PHP:
CycloneCasting
    Events
        Unit - A unit Starts the effect of an ability ( Khi unit sử dụng spell )
    Conditions
        (Ability being cast) Equal to Wind Runing ( Spell đó phải là Wind Runing )
    Actions
        Set Cyclone_Real = 0.00 ( Đặt biến góc của cơn lốc đi ra là 0 độ )
        Set Cyclone_Caster[1] = (Casting unit) ( Đặt biến người sử dụng là Cyclone_Caster[1] )
        Set Cyclone_Temp_Point[1] = (Position of Cyclone_Caster[1]) ( Dặt vị trí người sử dụng là Cyclone_Temp_Point[1] )
        For each (Integer A) from 1 to 12, do (Actions) ( A Chạy từ 1 -> 12 )
            Loop - Actions
                Unit - Create 1 Peasant for (Triggering player) at Cyclone_Temp_Point[1] facing Default building facing degrees ( Tạo 1 Dummy ở vị trí người sự dụng Spell)
                Unit - Add Cyclone Wave  to (Last created unit) ( Cho unit vừa mới tạo ra spell Cyclone Wave )
                Unit - Set level of Cyclone Wave  for (Last created unit) to ((Integer((Real((Level of Wind Rate  for Cyclone_Caster[1]))))) + 1) ( Set level của Cyclon Wave cho unit vừa tạo = level của Wind Rate +1 )
                Unit - Add a 2.00 second Generic expiration timer to (Last created unit) ( Sau 2 giây thì unit vưa tạo từ giả cỏi đời )
                Unit - Order (Last created unit) to Orc Tauren Chieftain - Shockwave (Cyclone_Temp_Point[1] offset by 200.00 towards Cyclone_Real degrees) ( Cho unit vừa tạo sử dụng Cyclon Wave )
                Set Cyclone_Real = (Cyclone_Real + 30.00) ( Tăng góc lên 30 độ )
        Custom script:   call RemoveLocation(udg_Cyclone_Temp_Point[1])
Ảnh đây anh: spells_4246_screenshot.jpg
Map: http://www.mediafire.com/?3pc9c3cyc6k2s20
 
Chỉnh sửa cuối:
trigger nên cho vào thẻ code nhé bạn. Ngoài ra bạn còn thiếu một vài cái ảnh + map demo. Bổ sung sớm giúp mình nhé.
Cám ơn bạn đã đóng góp spell >:D<!
 
Spell còn leak, ko MUI post được ko vậy :|
 
Có quyền post mọi spell trong topic này, tuy nhiên post thì phải có ảnh + map demo và phải giải thích cách làm spell đó.
 
Skill: Không tên (Màu mè y MTH :|)
Miêu tả: Mountain King phóng chiếc búa của mình tới đối phương, đồng thời lẩn tránh vì sau đó sẽ diễn ra những vụ nổ kinh hoàng ở địa điểm của kẻ thù.
Hình ảnh
[spoil]
20111204043248q3DG____WC3ScrnShot_120411_192902_01.jpg

20111204043252j2eI____WC3ScrnShot_120411_192904_02.jpg

20111204043255mR8z____WC3ScrnShot_120411_192906_03.jpg

20111204043258xiqH____WC3ScrnShot_120411_192909_04.jpg

20111204043302vXLv____WC3ScrnShot_120411_192916_05.jpg

20111204043308fnL5____WC3ScrnShot_120411_192917_06.jpg
[/spoil]
Giải thích:
[spoil]
Mã:
Skill
    Events
        Unit - A unit Starts the effect of an ability [COLOR="#FF0000"]// Một unit bắt đầu một hiệu ứng của một ability[/COLOR]
    Conditions
        (Ability being cast) Equal to Plus [COLOR="#FF0000"]// Ability đang cast là Plus[/COLOR]
    Actions
        Set Caster = (Casting unit) [COLOR="#FF0000"]// Đặt biến[/COLOR] 
        Set Target = (Target unit of ability being cast) [COLOR="#FF0000"]// Đặt biến[/COLOR]
        Set Point = (Position of Target) [COLOR="#FF0000"]// Đặt biến[/COLOR]
        Unit - Pause Target [COLOR="#FF0000"]// 'Ngừng' target, tức làm cho target đứng yên.[/COLOR]
        Camera - Shake the camera for (Owner of Caster) with magnitude 10.00 [COLOR="#FF0000"]// Khiến camera chuyển động dữ dội :D[/COLOR]
        Unit - Hide Caster [COLOR="#FF0000"]// Ẩn caster đi[/COLOR]
        For each (Integer A) from 1 to 5, do (Actions) [COLOR="#FF0000"]// Vòng lặp từ 1 > 5 rồi thực hiện[/COLOR]
            Loop - Actions
                Special Effect - Create a special effect at Point using FireStomp.mdx [COLOR="#FF0000"]// Tạo effect Vòng lửa ( hình đầu tiên) ở Point[/COLOR]
                Special Effect - Destroy (Last created special effect) [COLOR="#FF0000"]// Hủy cho đỡ lag :|[/COLOR]
                Wait 0.30 seconds [COLOR="#FF0000"]// Chờ 0.3 giây rồi create tiếp. Đủ 5 lần nó sẽ ngừng.[/COLOR]
        For each (Integer A) from 1 to 5, do (Actions) // Vòng lặp từ 1 > 5 rồi thực hiện
            Loop - Actions
                Special Effect - Create a special effect at Point using IceStomp.mdx [COLOR="#FF0000"]// Tạo effect Vòng băng ( hình thứ hai) ở Point[/COLOR]
                Special Effect - Destroy (Last created special effect)[COLOR="#FF0000"] // Hủy[/COLOR]
                Wait 0.30 seconds [COLOR="#FF0000"]// Chờ 0.3 giây rồi create tiếp. Đủ 5 lần nó sẽ ngừng.[/COLOR]
        For each (Integer B) from 1 to 10, do (Actions) [COLOR="#FF0000"]// Vòng lặp từ 1 > 10 rồi thực hiện[/COLOR]
            Loop - Actions
                Unit - Create 1 Hammer for (Owner of Caster) at (Point offset by 350.00 towards ((Real((Integer B))) x 36.00) degrees) facing Default building facing degrees /[COLOR="#FF0000"]/ Hammer ở đây là unit với model mà cây búa của mountain king và tạo 10 con cách targett 350 phạm vi và xếp thành hình tròn.[/COLOR]
                Set Dummy[(Integer B)] = (Last created unit) [COLOR="#FF0000"]// Đặt biến cho 10 con dummy vừa tạo ở trên[/COLOR]
                Unit - Add a 10.00 second Generic expiration timer to Dummy[(Integer B)] [COLOR="#FF0000"]// Cho nó sống 10 giây rồi giết[/COLOR]
                Unit - Make Dummy[(Integer B)] face Target over 0.00 seconds [COLOR="#FF0000"]// Quay mặt tụi dummy vào target[/COLOR]
        For each (Integer A) from 1 to 5, do (Actions)[COLOR="#FF0000"] // Vòng lặp từ 1 > 5 rồi thực hiện[/COLOR]
            Loop - Actions
                Unit - Create 1 Mountain King for (Owner of Caster) at (Point offset by 500.00 towards ((Real((Integer A))) x 72.00) degrees) facing Default building facing degrees [COLOR="#FF0000"]// Tạo 1 dummy với model là Mountain King cách target 500 phạm vi cũng xếp theo hình tròn nhưng thưa hơn.[/COLOR]
                Set Dummy[(Integer A)] = (Last created unit) [COLOR="#FF0000"]// Lại đặt biến thôi[/COLOR]
                Unit - Order Dummy[(Integer A)] to Attack Target[COLOR="#FF0000"] // Ra lệnh cho 5 con dummy vừa tạo tấn công target[/COLOR]
                Animation - Change Dummy[(Integer A)]'s vertex coloring to (100.00%, 100.00%, 100.00%) with 60.00% transparency [COLOR="#FF0000"]// Khiến cho 5 con dummy vừa tạo mờ hơn[/COLOR]
                Unit - Add a 10.00 second Generic expiration timer to Dummy[(Integer A)] [COLOR="#FF0000"]// Cho sống 10 giây rồi lại giết...[/COLOR]
        Trigger - Turn on Effect <gen>[COLOR="#FF0000"] // Bật trigger effect lên[/COLOR]
Mã:
Effect
    Events
        Time - Every 0.25 seconds of game time [COLOR="#FF0000"]// Mỗi 0.25 giây là thực hiện action[/COLOR]
    Conditions
    Actions
        For each (Integer A) from 1 to 5, do (Actions) [COLOR="#FF0000"]// Vòng lặp từ 1 > 5 rồi thực hiện[/COLOR]
            Loop - Actions
                Special Effect - Create a special effect at (Position of Dummy[(Integer A)]) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl [COLOR="#FF0000"]// Tạo effect thunder clap ngay vị trí của dummy a ( tức là 5 con mountain king)[/COLOR]
                Special Effect - Destroy (Last created special effect)[COLOR="#FF0000"] // Hủy effect[/COLOR]
        For each (Integer A) from 1 to 1, do (Actions) [COLOR="#FF0000"]// Thực hiên 1 lần ( không biết bỏ vào loop làm gì :|)[/COLOR]
            Loop - Actions
                Special Effect - Create a special effect at (Point offset by (Random real number between 200.00 and 400.00) towards (Random angle) degrees) using DarkNova.mdx [COLOR="#FF0000"]// Tạo effect nova tím ngẫu nhiên ở vị trí target cách từ 200 - 400.[/COLOR]
                Special Effect - Destroy (Last created special effect) [COLOR="#FF0000"]// Hủy[/COLOR]
                Wait 0.20 seconds[COLOR="#FF0000"] // Chờ 0.2 giây rồi lại thực hiện[/COLOR]
        For each (Integer A) from 1 to 1, do (Actions) [COLOR="#FF0000"]// Giống trên rồi :|[/COLOR]
            Loop - Actions
                Special Effect - Create a special effect at (Point offset by (Random real number between 200.00 and 400.00) towards (Random angle) degrees) using FrostNova.mdx [COLOR="#FF0000"]// Tạo effect frostnova ngẫu nhiên ở vị trí target cách từ 200 - 400.[/COLOR]
                Special Effect - Destroy (Last created special effect) [COLOR="#FF0000"]// Hủy[/COLOR]
                Wait 0.20 seconds[COLOR="#FF0000"] // Chờ 0.2 giây rồi lại thực hiện[/COLOR]
        If (All Conditions are True) then do (Then Actions) else do (Else Actions) [COLOR="#FF0000"]// Nếu tất cả điều kiện đúng, nó sẽ thực hiện then action, ngược lại là else aciton[/COLOR]
            If - Conditions
                (Dummy[(Integer A)] is dead) Equal to True [COLOR="#FF0000"]// Khi 5 con mountain king chết là đúng[/COLOR]
            Then - Actions
                Unit - Unhide Caster
                Camera - Stop swaying/shaking the camera for (Owner of Caster) [COLOR="#FF0000"]// Dừng rung camera[/COLOR]
                Special Effect - Create a special effect at (Position of Target) using LaserCannonRed.mdx [COLOR="#FF0000"]// Tạo effect laser ở vị trí target[/COLOR]
                Special Effect - Destroy (Last created special effect) [COLOR="#FF0000"]// Hủy[/COLOR]
                Trigger - Turn off (This trigger) [COLOR="#FF0000"]// Tắt trigger này[/COLOR]
                Unit - Unpause Target [COLOR="#FF0000"]// Khiến cho target hoạt động lại bình thường ( nhưng nó đã chết rồi còn đâu :D)[/COLOR]
                Unit - Cause Caster to damage Target, dealing 500.00 damage of attack type Spells and damage type Normal [COLOR="#FF0000"]// Khiến caster gây sát thương cho target và gây 500 dmg.[/COLOR]
                Custom script:   call RemoveLocation(udg_Point) [COLOR="#FF0000"]// Nãy giờ remove được một cái leak[/COLOR] :|
            Else - Actions
[/spoil]
Demo: Click
 
Chỉnh sửa cuối:
cho em hỏi topic còn hoạt động không ạ, nếu còn thì khoảng 1 tuần nữa( thi xong đã) em post 1 skill lên được không ạ, em mới tập làm MUI có lỗi gì nhờ các bác sửa giùm. nhân tiện topic có nhận những skill đơn giản và hơi imba 1 tí không ạ ( mấy skill này em làm hồi hè,lúc đó mới tập tành làm spell, chủ yếu là hiệu ứng phụ thêm khi cast skill thường, ) mai em post lên luôn.
 
Có quyền post mọi spell trong topic này, tuy nhiên post thì phải có ảnh + map demo và phải giải thích cách làm spell đó.

Còn hỏi gì nữa ?
 
mấy skill này em làm hồi mới tập tành( dù bây giờ vẫn đang tập) nên rất sơ sài và đơn giản, mấy anh đừng cười
Mã:
entangle
    Events
        Unit - A unit Starts the effect of an ability// khi skill được cast
    Conditions
        (Ability being cast) Equal to Entangling Roots// skill được cast là Entangling Roots
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)// nếu mọi thứ đều đúng thì…
            If – Conditions// điều kiện
                (Level of Entangling Roots for (Triggering unit)) Greater than or equal to 1// lv của skill trói cây của thằng cast phải lớn hơn( đề phòng nó dùng item)
            Then - Actions
                Set vitrithangcast = (Position of (Triggering unit))// đặt chỗ cast bằng vị trí thằng cast
                Set hoiduocchon = (Units within (150.00 x (Real((Level of Entangling Roots for (Triggering unit))))) of (Target point of ability being cast))// hội được chọn là bọn đứng cách  150x skilllv của chiêu trói xung quanh thằng bị cast, vì trong đó nó đòi số kiểu real nên phải đổi lv skill sang real cho giống
                Unit Group - Pick every unit in hoiduocchon and do (Actions) //chọn cả cái hội và xử lý từng thằng
                    Loop - Actions
                        Unit - Create 1 castentangle for (Owner of (Triggering unit)) at vitrithangcast facing 0.00 degrees //tạo 1 con có tên là castentangle( tạo 1 con unit tên đó, add skill trói cho nó, sửa cái manacost cua skill lại thành 0) tại vị trí thằng cast  quay mặt theo hướng…( chả quan trọng cái vụ quay mặt)
                        Unit - Set level of dummyEntangling Roots  for (Last created unit) to (Level of Entangling Roots for (Triggering unit))// gán cái lv skill trói của con castentangle( mấy cái skill do unit cast đó mình đặt chữ dummy đằng trước cho dễ phân biệt)
                        Unit - Order (Last created unit) to Night Elf Keeper Of The Grove - Entangling Roots (Picked unit)// unit sử dụng skill trói lên thằng trong hội
                        Unit - Add a 10.00 second Generic expiration timer to (Last created unit)
                Custom script:   call DestroyGroup (udg_hoiduocchon)// đặt thời gian sống của lũ unit là 10s nếu k0 sẽ ngập map mất
                Custom script:   call RemoveLocation (udg_vitrithangcast)// xóa cái biến vị trí thằng cast cho khỏi tốn bộ nhớ, tính ra thì phải xóa cả cái biến chúa hội được chọn nữa nhưng k0 biết xóa làm sao, mong các bác chỉ giáo
            Else – Actions// nếu lvskill entage của thằng cast k0 thỏa điều kiện( tức là nó xài item) thì k0 làm gì cả

Skill sau cho em nói vắn tắt, khỏi giải thích những chỗ “ai cũng biết là chỗ nào đấy”


hoithorong
    Events
        Unit - A unit Starts the effect of an ability// như trên
    Conditions
        (Ability being cast) Equal to Breath of Dragon // như trên
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Level of Breath of Dragon  for (Triggering unit)) Greater than or equal to 1// như trên
            Then - Actions
                Set vitrithangcast = (Position of (Triggering unit))// như trên
                For each (Integer A) from 1 to 20, do (Actions)// phần mới k0 như trên đây
                    Loop - Actions
                        Unit - Create 1 casthoithorong for (Owner of (Triggering unit)) at vitrithangcast facing ((Real((Integer A))) x 18.00) degrees// đây!!! Tạo 1 unit tại vị trí thằng cast( vẫn như trên) và quay mặt về hướng ((Real((Integer A))) x 18.00) degrees. (Real((Integer A) chỉ là để cho nó hợp với yêu cầu số nhập vào thôi, vấn đề là tại sao lại là Ax18 ? . vấn đề là số a chạy từ 1 đến 20  tức là 1,2,3,..,20 mà 1 vòng tròn là 360’ suy ra 20 thằng mỗi thằng quay 18 là 360 là 1 vòng. ( mà tại sao là 1 vòng thì vô map demo sẽ hỉu,skill cũa con DK ấy)
                        Unit - Set level of dummyBreath of Dragon  for (Last created unit) to (Level of Breath of Dragon  for (Triggering unit))// như trên
                        Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Breath Of Fire ((Position of (Last created unit)) offset by 1.00 towards (Facing of (Last created unit)) degrees)// lại quan trọng đây: câu trên có nghĩa là cast skill phun lủa giống skill của con  Pandaren Brewmaster vào chỗ cách chỗ đang đứng 1 về phía trước mặt( cái số 1 ấy là để cho chắc là con unit k0 chạy lên phía trước rùi mới cast thui sửa lên 100 hay 200 cũng chả sao)
                        Unit - Add a 5.00 second Generic expiration timer to (Last created unit)// như trên
                Custom script:   call RemoveLocation (udg_vitrithangcast)// như trên
            Else – Actions



Bingo :đây là skill em thấy ức chế nhất trong dota imba  1 hit chết ngay, cách của em skill bằng triger k0 phải là cho con Pa skill cri 10000000000% như imba( trông nổi số rất xấu)( skill của em imba hơn nhìu)
    Events
        Unit - A unit Is attacked// khi someone or something bị tấn công
    Conditions
        (Level of Vengeance for (Attacking unit)) Greater than or equal to 1// như trên
        (Random integer number between 1 and 100) Less than or equal to (5 + ((Hero level of (Attacking unit)) / 5))// tạo 1 số random giũa 1 và100, nếu số đó thấp hơn  (5 + ((Hero level of (Attacking unit)) / 5))  tức là lv của thằng đánh càng cao thì càng đễ “đi”( nhưng tối đa là 10 thui vì map mình maxlv là 25)
    Actions
        Set vitrithangbicast = (Position of (Triggering unit))//như trên
        Unit - Kill (Attacked unit)// SÁT( tức là cho thằng bị đánh chết k0 lý do)
        Floating Text - Create floating text that reads BINGO!!!! above (Attacked unit) with Z offset 0.00, using font size 20.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency// hiện 1 dòng chữ trên đầu bạn ghi là BINGO!!!!( sủa thành OMG >o<!!!! cho hay) với  cỡ chữ là 20 và màu( mấy cái số kia theo tỉ lệ ĐÒ,LỤC,LAM cứ thế mà pha màu ra) và độ trong suốt là 0%
        Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees// chữ sẽ bắt đầu xuất hiện cách đầu bạn 64range và bay lên theo góc 90’
        Floating Text - Change (Last created floating text): Disable permanence// xóa bỏ chế độ vĩnh cửu
        Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds// thay vào đó là cuộc sống ngắn kéo dài 3s
        Unit - Create 1 Avatar of Vengeance for (Owner of (Attacking unit)) at vitrithangbicast facing (Facing of (Triggering unit)) degrees// tạo 1 con ấy tại vị trí thằng chết( đã nói là imba) con này thì thay bằng con gì cũng được chả quan trọng
        Unit - Add a 10.00 second Generic expiration timer to (Last created unit)// cho cái con mới tạo ra sống đươc 10s( k0 thì nó nhung nhúc mất)
        Custom script:   call RemoveLocation (udg_vitrithangbicast)// xóa cáióa  đươc gọi là leak( nghe mấy anh kia nói mấy cái như triggering uint, attatked unit khỏi xóa cũng được)  




Phanthan :skill này y chang skill của phantom lance trong dota mỗi tội k0 kiểm tra được dã tạo ra mấy con mà giới hạn nên phân thân kinh hồn lắm
    Events
        Unit - A unit Is attacked// như trên
    Conditions
        (Level of Mirror Image for (Attacking unit)) Greater than or equal to 1
        (Random integer number between 1 and 100) Less than or equal to (5 + ((Hero level of (Attacking unit)) / 5))
    Actions
        
                Set vitrithangcast = (Position of (Triggering unit))// như trên
                Unit - Create 1 castrainofchaos for (Owner of (Attacking unit)) at vitrithangcast facing Default building facing degrees// tạo 1 thằng unit tại vị trí thằng cast
                Hero - Create Wand of Illusion  and give it to (Last created unit)// tạo 1  Wand of Illusion   và đưa nó cho tên mới tạo
                Unit - Add a 5.00 second Generic expiration timer to (Last created unit )// như trên
              Hero - Order (Last created unit) to use (Last created item) on (Attacking unit)// bảo con dummy xài cái wand lên đầu mình( đấy, thế mình là có phân thân, hoặc thằng phân thân của mình có phân thân,…..)

                Custom script:   call RemoveLocation (udg_vitrithangcast)// xóa bộ nhớ 
            



Rainofchaos// skill này y chang skill trong dota imba k0 khác tí nào( trừ khoản úp cái trượng)
    Events
        Unit - A unit Starts the effect of an ability// như trên
    Conditions
        (Ability being cast) Equal to Inferno// như trên
    Actions
        Set vitrithangcast = (Position of (Triggering unit))// như trên
        Set vitrithangbicast = (Target point of ability being cast)// như trên
        Set khuvucbicast = (Region centered at vitrithangbicast with size (800.00, 800.00)) // chỉ định cái vùng mà các trainfromer á nhầm inferno nhà ta sắp đổ bộ là 1 khu vực có chiều ngang 800(m) rộng 800(m) với cái chỗ ta cast là trung tâm.
        For each (Integer A) from 1 to (Integer(((Real((Level of (Triggering unit)))) / 5.00))), do (Actions)// chạy từ 1 đến (Integer(((Real((Level of (Triggering unit)))) / 5.00))) tức là lv càng cao thì các trainfromer được tạo ra càng nhiều
            Loop - Actions
                Unit - Create 1 castrainofchaos for (Owner of (Triggering unit)) at vitrithangcast facing 0.00 degrees// tạo 1 thằng cast skill thôi
                Unit - Set level of dummy Inferno  for (Last created unit) to (Integer(((Real((Level of (Triggering unit)))) / 8.00))) // cái này mình làm để lv thằng cast  càn cao thì các bác trainfromer rơi xuống càng chết nhìu thằng (to dam hơn)
                Unit - Order (Last created unit) to Undead Dreadlord - Inferno (Random point in khuvucbicast)//  các bác trainfromer nhà mình thích chỗ nào trong khu vực thì rớt xuống chỗ đó
               Unit - Add a 4.00 second Generic expiration timer to (Last created unit)// đặt chế độ tự hủy cho các cỗ máy tạo trainfromer( là mấy con unit ấy mà)
        Custom script:   call RemoveLocation (udg_vitrithangcast)
        Custom script:   call RemoveLocation (udg_vitrithangbicast)
        Custom script:   call RemoveRect(udg_khuvucbicast)
có gì mấy anh góp ý cho

---------- Post added at 13:49 ---------- Previous post was at 13:46 ----------

chết!!! k0 biết gửi file di kèm làm sao huhuhu (chắc bị anh raivor phạt mất) mấy anh chỉ em cách gửi file di kem cái. xin cám ơn
 
^
Chưa rõ phần gửi kèm nhưng chắc chưa có được đâu, cậu up lên mf đi :">
 
1 núi chữ @@! cái nào bạn giải thích TV thì tô màu lên + chia từng code cho ng` xem dễ biết @@!
 
Mấy Bạn Có Thể giúp mình làm trigger skill này được không :)
Mình muốn tạo kiểu skill như War Stomp Nhưng Mà lại khác hơn 1 tí là khi bắn ra thì không phải là hình đất bị lở ra ở dưới chân hero mà mình muốn khi bắn ra thì cái búa (Của ông mountain king ý mà :D) bắn ra ở xung quanh hero và khi cái búa đi về theo tùy hướng (Chẳng hạn như phía trên thì đi 1 đoạn 3 cm nó sẽ bỗng nổ ra :D) (Skill gồm 8 hướng :) )
Bạn nào làm giúp hộ mình với :)
 
Ai zúp mình skill này :(, chọn 1 target thì target không thể ATK trong khoảng time, hết time thì target ATK lại như bình thường :( thanks nhìu
 
@*darkman*:

lấy Ability base từ Drunken Haze set dòng Attacks Prevented thành Melee and Ranger
 
Em mới làm MUI, sau lúc test thì skill không thành công khi nhiều caster cùng cast 1 lúc. Mong mấy anh chỉ giúp em bị sai chỗ nào để sửa nha.
Code:
PHP:
Moving Blade Cast
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Death Flame 
    Actions
        Unit Group - Remove all units from MB_Group
        Set MB_MUI = (MB_MUI + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                MB_MUI Greater than or equal to 500
            Then - Actions
                Set MB_MUI = 0
            Else - Actions
        Set MB_Caster[MB_MUI] = (Casting unit)
        Special Effect - Create a special effect at ((Position of MB_Caster[MB_MUI]) offset by 0.00 towards 0.00 degrees) using Abilities\Spells\Orc\Reincarnation\ReincarnationTarget.mdl
        Special Effect - Destroy (Last created special effect)
        Unit - Create 1 Blade Dummy for (Owner of MB_Caster[MB_MUI]) at ((Position of MB_Caster[MB_MUI]) offset by 50.00 towards 90.00 degrees) facing Default building facing degrees
        Set MB_Dummy_Blade[MB_MUI] = (Last created unit)
        Unit - Add a 3.00 second Generic expiration timer to MB_Dummy_Blade[MB_MUI]
        Unit - Turn collision for MB_Dummy_Blade[MB_MUI] Off
        Set MB_Real[MB_MUI] = 0.00
        Set MB_Distance[MB_MUI] = 0.00
        Set MB_Int[MB_MUI] = 0
        Unit - Create 1 Dummy for (Owner of MB_Caster[MB_MUI]) at (Position of MB_Caster[MB_MUI]) facing Default building facing degrees
        Unit Group - Add (Last created unit) to MB_Group
        Unit - Set the custom value of (Last created unit) to MB_MUI
        Trigger - Turn on Moving Blade Loop <gen>


Còn đây là phần Loop

PHP:
Moving Blade Loop
    Events
        Time - Every 0.03 seconds of game time
    Conditions
    Actions
        Unit Group - Pick every unit in MB_Group and do (Actions)
            Loop - Actions
                Set MB_Int[(Custom value of (Picked unit))] = (MB_Int[(Custom value of (Picked unit))] + 1)
                Set MB_Distance[(Custom value of (Picked unit))] = (MB_Distance[(Custom value of (Picked unit))] + 1.00)
                Set MB_Real[(Custom value of (Picked unit))] = (MB_Real[(Custom value of (Picked unit))] + 10.00)
                Unit - Move MB_Dummy_Blade[(Custom value of (Picked unit))] instantly to ((Position of MB_Dummy_Blade[(Custom value of (Picked unit))]) offset by MB_Distance[(Custom value of (Picked unit))] towards MB_Real[(Custom value of (Picked unit))] degrees)
                Unit - Create 1 Casting Dummy for (Owner of MB_Caster[(Custom value of (Picked unit))]) at (Position of MB_Dummy_Blade[(Custom value of (Picked unit))]) facing Default building facing degrees
                Set MB_Dummy_Damage[(Custom value of (Picked unit))] = (Last created unit)
                Unit - Add a 1.25 second Generic expiration timer to MB_Dummy_Damage[(Custom value of (Picked unit))]
                Unit - Add MB Damage Dealing  to MB_Dummy_Damage[(Custom value of (Picked unit))]
                Unit - Set level of MB Damage Dealing  for MB_Dummy_Damage[(Custom value of (Picked unit))] to MB_Level[(Custom value of (Picked unit))]
                Unit - Order MB_Dummy_Damage[(Custom value of (Picked unit))] to Orc Tauren Chieftain - War Stomp
                Special Effect - Create a special effect at (Position of MB_Dummy_Blade[(Custom value of (Picked unit))]) using Abilities\Weapons\PhoenixMissile\Phoenix_Missile.mdl
                Special Effect - Destroy (Last created special effect)
                Special Effect - Create a special effect at (Position of MB_Dummy_Blade[(Custom value of (Picked unit))]) using Abilities\Spells\Undead\DeathandDecay\DeathandDecayTarget.mdl
                Special Effect - Destroy (Last created special effect)
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        MB_Int[(Custom value of (Picked unit))] Equal to 100
                    Then - Actions
                        Unit Group - Remove (Picked unit) from MB_Group
                        Unit - Remove (Picked unit) from the game
                    Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Number of units in MB_Group) Equal to 0
            Then - Actions
                Trigger - Turn off (This trigger)
            Else - Actions


Các biến : Caster, Dummy_Blade, Dummy_Damage là Unit Array[1..500]
Các biến còn lại toàn là Real, Int và 1 biến Group.
-----------------------------------------------------
Mong mấy anh giúp đở. Thanks.
Em tìm thấy chỗ sai rồi. Em đã lở remove all unit in unit Group ở đầu. :D
 
Chỉnh sửa cuối:
vừa làm xog spell đây ;))
em dựa trên RepeatData của mình để viết, các anh xem rùi nhận xét nhé:
Requires Repeat Data:
[spoil]
Mã:
library RepeatData initializer RepeatInit
/* 
----------------------------------------------------------------------------------------------------------------------------------------------------------- 
*/
/*
        ===  === ===   ===     =     ==== 
        = =   =      =   =  =       =   =     =
        ==    ===  ==    ===  ====     =
        =  =  =      =       =      =     =     =
        =   = ===  =       === =     =     =
                    *VERSION 0.1*
                ===      =    ====    =
                =   =   =  =     =     =   =
                =    = ====    =    ====
                =   =  =    =    =    =     =
                ===   =    =    =    =     =
    Write by Dorae.Mun
    => Easy to use
    => Store data by Struct
    => MUI for spell

  * HOW TO USE?
      + Method:
         - method isStart takes nothing returns nothing
         - method isLoop takes nothing returns nothing
         - method isEnd takes nothing returns nothing
      + Example
         "
         library example initializer init requires RepeatData
         private struct repeat extends RepeatData
              // some variables
              method isLoop takes nothing returns nothing
	     // some action when loop
	endmethod
	method isStart takes nothing returns nothing
	     // some action when start
	endmethod
	method isEnd takes nothing returns nothing
  	     // some action when end
	endmethod
         endstruct

         function init takes nothing returns nothing
              local repeat t=repeat.create(0.05,0)    // (real timeloop, real maxtimeloop) if real maxtimeloop equal to 0, struct will repeat until you use call this.stop() command in method
         endfunction
         endlibrary
         "
*/

/* 
----------------------------------------------------------------------------------------------------------------------------------------------------------- 
*/
private interface RepeatFace
    method isLoop takes nothing returns nothing defaults nothing
    method isStart takes nothing returns nothing defaults nothing
    method isEnd takes nothing returns nothing defaults nothing
endinterface

globals
    private integer cn
    private timer rTime
endglobals
/* Version 0.1  */


struct RepeatData extends RepeatFace
    public real rL
    public real nrL
    public real mrL
    public boolean rSt
    public real rnL
    
    private static thistype array rData
    static method create takes real Loop, real maxLoop returns thistype
        local thistype this=thistype.allocate()
            set this.rL=Loop
            set this.mrL=maxLoop
            set this.rSt=true
            set this.nrL=0
            set this.rnL=0
            set cn=cn+1
            set .rData[cn]=this
            if cn==1 then
                call TimerStart(rTime,0.03,true,function RepeatData.mtLoop)
            endif
        return this
    endmethod
    
    
    method stop takes nothing returns nothing
        set this.mrL=0.03
    endmethod
    
    static method mtLoop takes nothing returns nothing
        local thistype this
        local integer i=1
        loop
            exitwhen i>cn
            set this=.rData[i]
            if this.rL==0 then
                call this.stop()
            endif
            if this.rSt==true then
                set this.rSt=false
                call this.isStart()
            endif
            if this.mrL==0 then
                set this.nrL=this.nrL+0.03
                set this.rnL=this.rnL+0.03
                if this.rnL>=this.rL then
                    call this.isLoop()
                    set this.rnL=0
                endif
            else
                if this.nrL>=this.mrL then
                    call this.isEnd()
                    call this.destroy()
                    set .rData[i]=.rData[cn]
                    set i=i-1
                    set cn=cn-1
                else
                    set this.nrL=this.nrL+0.03
                    set this.rnL=this.rnL+0.03
                    if this.rnL>=this.rL then
                        call this.isLoop()
                        set this.rnL=0
                    endif
                endif
            endif
            set i=i+1
        endloop
        if cn<=0 then
            set cn=0
            call PauseTimer(rTime)
        endif
    endmethod
endstruct

private function RepeatInit takes nothing returns nothing
    set cn=0
    set rTime=CreateTimer()
endfunction
endlibrary
[/spoil]

Spell Library:
[spoil]
Mã:
library Psychic initializer init requires RepeatData, AutoIndex
/*
    spell Write by Dorae.Mun
        Requires RepeatData
                                AutoIndex
*/
globals
    private constant real DAMAGE=100 //Ability Damage
    private constant real TIME=.03      //Time loop
    private constant real RANGE=700 //Area of effect
    private constant string FX="Models\\PsychicTarget.mdl" 
    private constant string SFX="Models\\GrandUndeadAura.mdl"
    private constant string SFX2="Models\\NewGroundEX.mdx"
    private constant attacktype ATT=ATTACK_TYPE_HERO
    private constant damagetype DMT=DAMAGE_TYPE_MAGIC
endglobals

function trig_con takes nothing returns boolean
    return ( GetSpellAbilityId() == 'A000' )
endfunction

private struct Psychic extends RepeatData
    unit caster
    boolean isfly
    real fly
    integer face
    group eG
    group eG2
    group eG3
    real xx
    real yy
    unit dum
    effect deff
    private static effect array def
    method isLoop takes nothing returns nothing
        local unit e
        local real x
        local real y
        local real dx
        local real dy
        call GroupAddGroup(this.eG,this.eG3)
        //set this.eG3=this.eG
        loop
            set e=FirstOfGroup(this.eG3)
            exitwhen e==null
            set x=GetUnitX(e)
            set y=GetUnitY(e)
            set dx=x+GetRandomReal(0,10)*Cos((GetUnitFacing(e))*bj_DEGTORAD)
            set dy=y+GetRandomReal(0,10)*Sin((GetUnitFacing(e))*bj_DEGTORAD)
            call UnitAddAbility(e,'Amrf')
            call SetUnitPosition(e,dx,dy)
            call SetUnitFlyHeight(e,this.fly,0)
            call SetUnitAnimationByIndex(e,(-1*this.face))
            call UnitRemoveAbility(e,'Amrf')
            call GroupRemoveUnit(this.eG3,e)
        endloop
        if this.isfly==true then
            if this.fly>=600 then
                set this.isfly=false
            endif
            set this.fly=this.fly+6
            set this.face=this.face+2
        else
            if this.fly<=0 then
                call this.stop()
            endif
            set this.fly=this.fly-100
        endif
        call GroupClear(this.eG3)
        set e=null
    endmethod
    
    method isStart takes nothing returns nothing
        local unit e
        call PauseUnit(this.caster,true)
        set this.dum=CreateUnit(Player(15),'h000',this.xx,this.yy,0)
        set this.deff=AddSpecialEffectTarget(SFX,this.dum,"origin")
        call GroupEnumUnitsInRange(this.eG2,this.xx,this.yy,RANGE,null)
        loop
            set e=FirstOfGroup(this.eG2)
            exitwhen e==null
            if IsUnitEnemy(e,GetOwningPlayer(this.caster)) and GetWidgetLife(e)>0.405 and IsUnitType(e,UNIT_TYPE_STRUCTURE)==false then
                call GroupAddUnit(this.eG,e)
                call PauseUnit(e,true)
                call SetUnitTimeScalePercent(e,0)
                set def[GetUnitId(e)]=AddSpecialEffectTarget(FX,e,"chest")
            endif
            call GroupRemoveUnit(this.eG2,e)
        endloop
        call GroupClear(this.eG2)
        set e=null
    endmethod
    method isEnd takes nothing returns nothing
        local unit e
        call PauseUnit(this.caster,false)
        loop
            set e=FirstOfGroup(this.eG)
            exitwhen e==null
            call DestroyEffect(this.def[GetUnitId(e)])
            call UnitDamageTarget(this.caster,e,DAMAGE,false,false,ATT,DMT,null)
            call SetUnitAnimationByIndex(e,0)
            call PauseUnit(e,false)
            call SetUnitTimeScalePercent(e,100)
            call DestroyEffect(AddSpecialEffect(SFX2,GetUnitX(e),GetUnitY(e)))
            call GroupRemoveUnit(this.eG,e)
        endloop
        call RemoveUnit(this.dum)
        call DestroyEffect(this.deff)
        call GroupClear(this.eG)
        call GroupClear(this.eG2)
        call GroupClear(this.eG3)
        call DestroyGroup(this.eG)
        call DestroyGroup(this.eG2)
        call DestroyGroup(this.eG3)
        set this.dum=null
        set this.caster=null
        set e=null
    endmethod
endstruct

function trig_act takes nothing returns nothing
    local unit cast=GetTriggerUnit()
    local real x=GetUnitX(cast)
    local real y=GetUnitY(cast)
    local Psychic this=Psychic.create(TIME,0) // struct will loop until use 'call this.stop'
    set this.caster=cast // save variable cast with name this.caster
    set this.isfly=true
    set this.fly=0
    set this.face=0
    set this.eG=CreateGroup()
    set this.eG2=CreateGroup()
    set this.eG3=CreateGroup()
    set this.xx=x
    set this.yy=y
    
    
    set cast=null
endfunction

//===========================================================================
function init takes nothing returns nothing
    local trigger trig = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ(trig, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( trig, Condition( function trig_con ) )
    call TriggerAddAction( trig, function trig_act )
    set trig=null
endfunction

endlibrary
[/spoil]

Test.jpg
 

Attachments

Mấy cái isStart, isLoop, isEnd nên đổi thành onStart, onLoop, onEnd nghe mới hợp lý chứ nhỉ :-?
Ngại review code, đặt tên biến quá tối nghĩa, ít comment... cũng 1 phần vì lười =))
Nên học tập cái KeyTimer của Jesus4lyf \m/

---------- Post added at 13:53 ---------- Previous post was at 13:49 ----------

Mấy cái isStart, isLoop, isEnd nên đổi thành onStart, onLoop, onEnd nghe mới hợp lý chứ nhỉ :-?
Ngại review code, đặt tên biến quá tối nghĩa, ít comment... cũng 1 phần vì lười =))
Nên học tập cái KeyTimer của Jesus4lyf \m/
 
^ isStart gì đó em đặt thì sợ bị đụng độ nên đặt cho nó bất hợp lý để khỏi đụng chạm ;;)
còn cái comment và giải thích thì một phần tại em, làm xong cái map trước, làm xong hết rùi mới save, lần đầu save nó sẽ hk check lỗi nên save lại lần hai, tự dưng nó dis ra mất tiu rùi mất cả cái map. :P xog làm lại cái này, lười comment lần 2 :">
 
Back
Top