Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Cho hỏi cách làm spell như thế này: tạo effect và gây damage khi projectile chạm vào target (projectile ở đây là custom).Thanks


^
^
Nếu project là 1 con dummy và target biết di chuyển thì điều này thực sự khó .Liên tục phải set Point cho target trong lúc move dummy đến ( đấy là chưa nói đến target chạy ngang chạy dọc thì cũng ko có cơ sở nào để set Angle mà move ).
Trừ khi project có tốc độ tương đối lớn.
Hiện giờ mình cũng chỉ biết làm kiểu Elune's Arrow hơặc Storm Bolt trong Dota.
Elune's Arrow thì cũng không khác mấy cái spell wave là mấy , chỉ có điều khi slice mà check thấy group này có số lượng unit lớn hơn 0 thì kill project đi , deal dam ramdom 1 unit trong group ( sở dĩ làm thế này để đề phòng có 2 em bị ăn trưởng dù khi set group range rất nhỏ nhưng vẫn có thể xảy ra :) ) , kết thúc trigger.
Storm Bolt thì đơn giản hơn vì ko phải check gì hết , khi project đến gần Target Point thì set group và deal dam.
Cách của bạn Dhg mình ko rõ lắm nhưng chắc phải tính vận tốc của project của spell storm bolt để wait và deal dam .Mình dốt lí nên mình nghĩ cách này ko khả thi. :)
. Set point liên tục thì quẳng vào cái trigger every time ?
.SR Trigger 1
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to |cffFFCCCCSong R×u M·nh Thó|r
Actions
For each (Integer A) from 1 to 2, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SR_Dummy[(Integer A)] Equal to No unit
Then - Actions
Do nothing
Else - Actions
Unit - Kill SR_Dummy[(Integer A)]
Custom script: call RemoveLocation(udg_SR_Location[bj_forLoopAIndex])
Trigger - Turn off SR Trigger 2 <gen>
Set SR_Caster = (Casting unit)
Set SR_Location[1] = (Position of SR_Caster)
Set SR_Location[2] = (Target point of ability being cast)
Set SR_Angle[1] = ((Angle from SR_Location[1] to SR_Location[2]) - 27.00)
Set SR_Angle[2] = ((Angle from SR_Location[1] to SR_Location[2]) + 27.00)
Set SR_Distance = (Distance between SR_Location[1] and SR_Location[2])
For each (Integer A) from 1 to 2, do (Actions)
Loop - Actions
Set SR_Integer[(Integer A)] = 0
Unit - Create 1 SR Dummy for (Owner of SR_Caster) at SR_Location[(Integer A)] facing SR_Angle[(Integer A)] degrees
Set SR_Dummy[(Integer A)] = (Last created unit)
Unit - Turn collision for SR_Dummy[(Integer A)] Off
Trigger - Turn on SR Trigger 2 <gen>
Custom script: call RemoveLocation(udg_SR_Location[1])
SR Trigger 2
Events
Time - Every 0.02 seconds of game time
Conditions
Actions
Set SR_Location[1] = (Position of SR_Caster)
For each (Integer A) from 1 to 2, do (Actions)
Loop - Actions
Unit - Move SR_Dummy[(Integer A)] instantly to (SR_Location[1] offset by (SR_Distance x (Sin((1.00 x (Real(SR_Integer[(Integer A)])))))) towards SR_Angle[(Integer A)] degrees)
Set SR_Integer[(Integer A)] = (SR_Integer[(Integer A)] + 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Integer A) Equal to 1
Then - Actions
Set SR_Angle[(Integer A)] = (SR_Angle[(Integer A)] + 0.30)
Else - Actions
Set SR_Angle[(Integer A)] = (SR_Angle[(Integer A)] - 0.30)
Set SR_Damage[(Integer A)] = (Units within 150.00 of (Position of SR_Dummy[(Integer A)]) matching ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is in SR_Damage[(Integer A)]) Equal to True) and ((((Matching unit) belongs to an enemy of (Owner of SR_Caster)) Equ
Unit Group - Pick every unit in SR_Damage[(Integer A)] and do (Actions)
Loop - Actions
Unit - Cause SR_Caster to damage (Picked unit), dealing 50.00 damage of attack type Siege and damage type Universal
Unit Group - Add (Picked unit) to SR_Damage[(Integer A)]
Special Effect - Create a special effect attached to the origin of (Picked unit) using Abilities\Spells\Other\Stampede\MissileDeath.mdl
Special Effect - Destroy (Last created special effect)
Custom script: call DestroyGroup(udg_SR_Damage[bj_forLoopAIndex])
Destructible - Pick every destructible within 150.00 of (Position of SR_Dummy[(Integer A)]) and do (Actions)
Loop - Actions
Destructible - Kill (Picked destructible)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SR_Integer[(Integer A)] Equal to 180
Then - Actions
Trigger - Turn off SR Trigger 2 <gen>
For each (Integer A) from 1 to 2, do (Actions)
Loop - Actions
Custom script: call RemoveLocation(udg_SR_Location[bj_forLoopAIndex])
Custom script: call DestroyGroup(udg_SR_Damage[bj_forLoopAIndex])
Unit Group - Remove all units from SR_Damage[(Integer A)]
Set SR_Dummy[(Integer A)] = No unit
Unit - Remove SR_Dummy[(Integer A)] from the game
Set SR_Caster = No unit
Else - Actions
Custom script: call RemoveLocation(udg_SR_Location[1])

em import mấy cái model nhà, khi bỏ nó len map thì hero lại di xuyen qua được ai giup em voi
@ lonewolf xem thử có sai gì ko sao làm y chang mà chỉ có 1 rìu bay ra, lúc bay về thì ko remove khỏi game mà vẫn còn yên nguyên lại có cảm giác nó chưa remove leak mặc dù leak đã check xong hết
Trigger 2
..blah blah blah.................................
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SR_Integer[(Integer A)] Equal to 180
Then - Actions
Trigger - Turn off SR Trigger 2 <gen>
For each (Integer A) from 1 to 2, do (Actions)
Loop - Actions
Custom script: call RemoveLocation(udg_SR_Location[bj_forLoopAIndex])
Custom script: call DestroyGroup(udg_SR_Damage[bj_forLoopAIndex])
Unit Group - Remove all units from SR_Damage[(Integer A)]
[B][COLOR="Blue"] Unit - Remove SR_Dummy[(Integer A)] from the game
Set SR_Dummy[(Integer A)] = No unit// đổi vị trí 2 cái này[/COLOR][/B]
Set SR_Caster = No unit
Else - Actions
Custom script: call RemoveLocation(udg_SR_Location[1])
C1: Vào mục Pathing-Pathing Map và chọn Path phù hợp.em import mấy cái model nhà, khi bỏ nó len map thì hero lại di xuyen qua được ai giup em voi
Ai hướng dẫn giúp mình cách làm damage over time = jass. Thanks
function DOT takes unit c, unit u, real dmg, integer tick, real delay, string e,damagetype type1, attacktype type2 returns nothing
local integer i = 1
local integer k = tick
loop
exitwhen i > k
call UnitDamageTargetBJ( c, u, dmg, type2, type1 )
call AddSpecialEffectTargetUnitBJ( "chest", c, e )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call PolledWait(delay)
set i = i + 1
endloop
endfunction
Copy đoạn code này vào 1 trigger trắng, chú ý : trigger này phải nằm bên trên trigger skillMã:function DOT takes unit c, unit u, real dmg, integer tick, real delay, string e,damagetype type1, attacktype type2 returns nothing local integer i = 1 local integer k = tick loop exitwhen i > k call UnitDamageTargetBJ( c, u, dmg, type2, type1 ) call AddSpecialEffectTargetUnitBJ( "chest", c, e ) call DestroyEffectBJ( GetLastCreatedEffectBJ() ) call PolledWait(delay) set i = i + 1 endloop endfunction
Xài như sau
Call DOT(c,u,dmg,tick,delay,e,type1,type2)
C : caster
U : đối tượng
Dmg : sát thương (vd : 3.5)
Delay : khoảng cách giữa 2 lần tạo dmg tính theo giây
e : tên của hình ảnh mỗi lần gây dmg (vd : "Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdl" . ko có thì đặt "")
type1 : là dmg type
type : là attack type
Call DOT(udg_caster,udg_target,50,5,2,"Abilities\\Spells\\Other\\TalkToMe\\TalkToMe.mdl",ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
caster gây 50dmg lên target mỗi 2 giây và gây dmg 5 lần.
+++++++++++++++++++++
Đây là dạng đơn giản nhất. 1 newbie mù về jass cũng có thể dễ dàng mod được. Và các dạng khác khó mod hơn lên mình ko post
cho mình hỏi 2 thứ:
làm sao để tạo spell giống spirit bear trog DotA, làm thế nào mà khi chét con gấu vẫn không rơi đồ
trong map Plains of Snow của Warcraft, model của chú gấu do Beastmaster summon bị đổi thành màu trắng, có cách nào cho nó thàn mà nâu lại đc ko?
Xin lỗi vì đã chỉ nhầm, thật ra thì phần đó không cần loop@ lonewolf: Chịu pó tay rồi, tôi làm cả buổi chiều cũg ko ra, lúc thì rìu bay ra nhưng dealing theo Every, lúc thì dealing 2 lần nhất định thì rìu bay thành vòng tròn, sài đc 4 lần spell là reset máy vì lag, ông rảnh thì làm 1 cái demo dùm tui, spell Wild Axes giống dota càng nhìu càng tốt, nhớ remove hết tất cả leak dùm tui. Thanks trước
Trigger 2
..blah blah blah.................................
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
SR_Integer[(Integer A)] Equal to 180
Then - Actions
Trigger - Turn off SR Trigger 2 <gen>
Custom script: call RemoveLocation(udg_SR_Location[bj_forLoopAIndex])
Custom script: call DestroyGroup(udg_SR_Damage[bj_forLoopAIndex])
Unit Group - Remove all units from SR_Damage[(Integer A)]
[B][COLOR="Blue"] Unit - Remove SR_Dummy[(Integer A)] from the game
Set SR_Dummy[(Integer A)] = No unit[/COLOR][/B]
Else - Actions
Custom script: call RemoveLocation(udg_SR_Location[1])
Thử xem cái spell này tícho mình hỏi 2 thứ:
làm sao để tạo spell giống spirit bear trog DotA, làm thế nào mà khi chét con gấu vẫn không rơi đồ
trong map Plains of Snow của Warcraft, model của chú gấu do Beastmaster summon bị đổi thành màu trắng, có cách nào cho nó thàn mà nâu lại đc ko?
. Khi chết thêm effect vào cho nó đẹp là được.Hình như không MUI bởi vì nó MUI nếu xài local var. Mà đã xài jass thì cũng nên bỏ xài global var trong nhiều trường hợp.Trường hợp trên hình như không MUI bạn ạ!
Mình nghĩ ngoại newbie thì nên dùng Intuitive Buff System thì tiện hơn!:)
---------- Post added at 08:01 ---------- Previous post was at 07:59 ----------
Câu thứ nhất mình không trả lời được! Mình không chơi con đó!
Câu thứ hai xóa Textures trong phần Import của nó đi! Tìm cụ thể thì cứ việc tìm kiểu tên của nó ấy!

Cần hướng dẫn làm DoT = trigger![]()
Không thể giúp hơn.