[Thảo luận]làm Spell bằng Jass - chia sẻ và học hỏi ^^!

sukaraki

Donkey Kong
Tham gia ngày
12/5/08
Bài viết
356
Reaction score
9
Mình thực sự không muốn rời GUI qua jass , vì đã quá quen với việc làm spell nói riêng và map nói chung bằng GUI. Nhưng vì dự án mới đây ,1 map build hero từ basic ra tới 32 hướng đi , thế nên có nhiều trường hợp các bạn build hero cùng hướng đi, giống skill nhau, mà GUI thì rất khó làm MUI - Multi Instancable gì gì đấy - tạm hiểu là spell mà nhiều con cùng cast được. Thế là đành phải bỏ GUI thôi :D . Bây giờ vì thời gian gấp rút , mà kiến thức thì nông cạn, nên mình lập topic này để anh em đang học Jass vào cùng nhau thảo luận và chia sẻ Code spell của mình.

Mở hàng : các bạn check leak dùm mình spell mới làm này - mò mãi vẫn ko hiểu bị leak chỗ nào T_T

Spell mega crushing wave hiệu ứng đại hồng thủy cực khủng , cực mượt , bao nhiêu con cast cũng đc :cool: , có điều sau khi cast vài chục phát là máy đơ luôn T_T

function Trig_mega_crushing_wave_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'sk07' ) ) then
return false
endif
return true
endfunction

function casmega takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit dum = GHUnit( t, "dummy")
local unit cas = GHUnit( t, "caster")
call SetUnitPositionLocFacingBJ( dum, GetRandomLocInRect(RectFromCenterSizeBJ(GetUnitLoc(cas), 250.00, 250.00)), GetUnitFacing(cas) )
call IssuePointOrderLocBJ( dum, "carrionswarm", PolarProjectionBJ(GetUnitLoc(dum), 256, GetUnitFacing(cas)) )
endfunction

function Trig_mega_crushing_wave_Actions takes nothing returns nothing
local unit dum
local timer t
local unit cas
local location loc
local location casloc = GetUnitLoc(GetSpellAbilityUnit())
set t = CreateTimer()
set cas = GetSpellAbilityUnit()
call SHHandle(t , "caster" , cas )
set loc = GetSpellTargetLoc()
call CreateNUnitsAtLoc( 1, 'hgyr', GetOwningPlayer(cas), GetUnitLoc(cas), DistanceBetweenPoints(GetUnitLoc(cas), loc) )
set dum = GetLastCreatedUnit()
call SHHandle(t , "dummy" , dum )
call UnitAddAbilityBJ( 'ACc3', dum )
call SetUnitVertexColorBJ( dum, 100, 100, 100, 100.00 )
call TimerStart(t , 0.03 , true , function casmega )
call TriggerSleepAction(1.3)
call FHL(t)
set cas = null
set t = null
set casloc = null
set loc = null
call RemoveUnit( dum )
set dum = null
call RemoveLocation( loc )
call RemoveLocation( casloc )
call DestroyTimer( t )
endfunction


//===========================================================================
function InitTrig_mega_crushing_wave takes nothing returns nothing
set gg_trg_mega_crushing_wave = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_mega_crushing_wave, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_mega_crushing_wave, Condition( function Trig_mega_crushing_wave_Conditions ) )
call TriggerAddAction( gg_trg_mega_crushing_wave, function Trig_mega_crushing_wave_Actions )
endfunction

test : 10 con phù thủy cùng cast 8 lần thì máy giựt. 10X8 = 80 lần cast.
 
Bỏ BJ ở đằng sau đi cho nó lành

FHL là cái gì?? hình như la FlushHandleLocal cua KaTTaNa
đoạn trên cùng chuyển thành


return GetSpellAbilityId() == 'sk07'

local unit d
set d = CreateUnitAtLoc....

Hiệu ứng khủng nên lag là phải?đúng hem? :D

cái đoạn function casmega takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit dum = GHUnit( t, "dummy")
local unit cas = GHUnit( t, "caster")
call SetUnitPositionLocFacingBJ( dum, GetRandomLocInRect(RectFromCenterSizeBJ(GetUnitLoc (cas), 250.00, 250.00)), GetUnitFacing(cas) )
call IssuePointOrderLocBJ( dum, "carrionswarm", PolarProjectionBJ(GetUnitLoc(dum), 256, GetUnitFacing(cas)) )
endfunction
chưa null var: t dum cas
cả DestroyTimerv.v..

Nên sư dụng GetTriggerUnit hơn là GetSpellAbilityUnit()

còn lại nghĩ sau vậy ....

Dạo này đang học xài vJASS, có gì nhờ Tom chỉ giáo nhìu

quên còn fai pausetimer nữa

Để viết lại thử xem

function Trig_mega_crushing_wave_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'sk07'

function casmega takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit d = GHUnit( t, "dummy")
local unit cas = GHUnit( t, "caster")
call SetUnitPositionLocFacingBJ( d, GetRandomLocInRect(RectFromCenterSizeBJ(GetUnitLoc (cas), 250.00, 250.00)), GetUnitFacing(cas) )
call IssuePointOrderLoc( d, "carrionswarm", PolarProjectionBJ(GetUnitLoc(d), 256, GetUnitFacing(cas)) )
call PauseTimer(t)
call DestroyTimer(t)
set t = null
set d = null
set cas = null
endfunction

function Trig_mega_crushing_wave_Actions takes nothing returns nothing
local timer t
local unit cas
local unit d
local location loc
local location casloc = GetUnitLoc(GetTriggerUnit())
set t = CreateTimer()
set cas = GetTriggerUnit()
call SHHandle(t , "caster" , cas )
set loc = GetSpellTargetLoc()
set d = CreateUnitAtLoc(GetOwningPlayer(cas), 'hgyr',GetUnitLoc(cas), DistanceBetweenPoints(GetUnitLoc(cas), loc) )
call SHHandle(t , "dummy" , d)
call UnitAddAbility(d, 'ACc3')
call SetUnitVertexColorBJ( d, 100, 100, 100, 100.00 )
call TimerStart(t , 0.03 , true , function casmega )
call TriggerSleepAction(1.3)
call FHL(t)
call RemoveUnit( d)
call RemoveLocation( loc )
call RemoveLocation( casloc )
call PauseTimer(t)
call DestroyTimer( t )
set cas = null
set t = null
set casloc = null
set loc = null
set d= null
endfunction


//================================================== =========================
function InitTrig_mega_crushing_wave takes nothing returns nothing
set gg_trg_mega_crushing_wave = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_mega_crushing_wave, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_mega_crushing_wave, Condition( function Trig_mega_crushing_wave_Conditions ) )
call TriggerAddAction( gg_trg_mega_crushing_wave, function Trig_mega_crushing_wave_Actions )
endfunction

==Rosario†Vampire==
 
-cảm ơn bạn, đúng là mình chưa remove leak chỗ function casmega.
-Còn vụ pause timer bạn nhầm rồi đó . timer cho chạy liên tục cast spell liên tục mà , sau 1.2 giây hủy timer rồi.
-Còn gettriggerunit với getspellabilityunit thì cái thứ 2 nó ít tổng quát hơn chứ ? gettriggerunit tổng quát quá sợ catch nhầm event thì sao.
-Sáng nay server bị gì đó, mình ko lên đây đc, tự sửa ở nhà, thì thành công rồi, tại lộn chỗ dưới, set = null trước remove sau, nên lúc sau nó đâu biết remove thằng nào .Đổi vị trí lại là xong.Tui test kiểu bệnh hoạn là : mới vô cho chạy loop từ 1 tới 50, tạo 50 con lính, add skill cho nó, sau đó đưa chúng nó vào group. Rồi mỗi lần chat "cas" , thì pick 50 con đó bắt cast phép. Lúc cast thì giựt tung màn hình, nhưng khi cast xong lập tức mướt rượt. Chả hiểu còn leak phía trên chỗ megacas, chưa remove, mà 50 con cast nhiều lần map vẫn ko sao ????


____________________________

Chủ đề này ít mem quan tâm nhỉ >"<
 
nhìn jass cũng hay nhưng mà ko hiểu mấy cái handle cho lắm ::(
chắc cần pro giảng thêm mấy cái handle :D
 
Còn đây là spell Hell Slam đẹp lòi mắt : blade master nhảy lên và dập xuống đất nổ lửa , có animation Jump đàng hoàng.

ko hiểu sao đập thì ngon, MUI cũng ngon, test 20 con cast cùng lúc ko sao, nhưng dính chỗ nó ko gây damage >"<
mấy bro sửa giúp với ! heo mi !

function Trig_hell_slam_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'AOsh' ) ) then
return false
endif
return true
endfunction

function Trig_hell_slam_jump takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit cas = GHUnit( t, "AOshcas")
local location loc = GHLoc( t , "AOshloc" )
local location casloc = GHLoc( t , "AOshcasloc" )
local real dis = GHReal( t , "AOshdis" )
if ( ( DistanceBetweenPoints(GetUnitLoc(cas), loc) > dis ) ) then
call SetUnitPositionLoc( cas, PolarProjectionBJ(GetUnitLoc(cas), dis, AngleBetweenPoints(casloc,loc)) )
endif
endfunction

function Trig_hell_slam_Func01 takes nothing returns boolean
return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction

function Trig_hell_slam_Func02 takes nothing returns boolean
local timer t = GetExpiredTimer()
local unit cas = GHUnit( t, "AOshcas")
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(cas)) == true )
endfunction

function Trig_hell_slam_Func2 takes nothing returns boolean
return GetBooleanAnd( Trig_hell_slam_Func01(), Trig_hell_slam_Func02() )
endfunction

function Trig_hell_slam_Func3 takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit cas = GHUnit( t, "AOshcas")
call UnitDamageTargetBJ( cas, GetEnumUnit(), 800.00, ATTACK_TYPE_HERO, DAMAGE_TYPE_FIRE )
endfunction



function Trig_hell_slam_Actions takes nothing returns nothing
local effect e1
local effect e2
local effect e3
local effect e4
local effect e5
local timer t = CreateTimer()
local unit cas = GetSpellAbilityUnit()
local location casloc = GetUnitLoc(cas)
local location loc = GetSpellTargetLoc()
local real dis = ( DistanceBetweenPoints(casloc, loc)/50 )
call SHHandle( t , "AOshcas" , cas )
call SHHandle( t , "AOshcasloc" , casloc )
call SHHandle( t , "AOshloc" , loc )
call SHReal( t , "AOshdis" , dis )
call IssueImmediateOrderBJ( cas, "stop" )
call UnitRemoveBuffsBJ( bj_REMOVEBUFFS_ALL, cas )
call PauseUnitBJ( true, cas )
call SetUnitVertexColorBJ( cas, 100, 0.00, 0.00, 20.00 )
call SetUnitAnimation( cas, "slam" )
call SetUnitPathing( cas, false )
call UnitAddAbilityBJ( 'Amrf', cas )
call UnitRemoveAbilityBJ( 'Amrf', cas )
call SetUnitFlyHeightBJ( cas, 300.00, 1200.00 )
call AddSpecialEffectTargetUnitBJ( "chest", cas, "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl" )
set e1 = GetLastCreatedEffectBJ()
call AddSpecialEffectTargetUnitBJ( "left hand", cas, "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl" )
set e2 = GetLastCreatedEffectBJ()
call AddSpecialEffectTargetUnitBJ( "right hand", cas, "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl" )
set e3 = GetLastCreatedEffectBJ()
call TimerStart(t , 0.01 , true , function Trig_hell_slam_jump )
call TriggerSleepAction( 0.25 )
call UnitAddAbilityBJ( 'Amrf', cas )
call UnitRemoveAbilityBJ( 'Amrf', cas )
call SetUnitFlyHeightBJ( cas, 0.00, 1200.00 )
call TriggerSleepAction( 0.25 )
call AddSpecialEffectLocBJ( GetUnitLoc(cas), "Objects\\Spawnmodels\\Human\\HCancelDeath\\HCancelDeath.mdl" )
set e4 = GetLastCreatedEffectBJ()
call AddSpecialEffectLocBJ( GetUnitLoc(cas), "Abilities\\Spells\\Human\\MarkOfChaos\\MarkOfChaosTarget.mdl" )
set e5 = GetLastCreatedEffectBJ()
call ForGroupBJ( GetUnitsInRectMatching(RectFromCenterSizeBJ(GetUnitLoc(cas), 350.00, 350.00), Condition(function Trig_hell_slam_Func2)), function Trig_hell_slam_Func3 )
call TerrainDeformationRippleBJ( 0.60, false, GetUnitLoc(cas), 200.00, 300.00, 30.00, 0.20, 512 )
call DestroyEffectBJ( e1 )
call DestroyEffectBJ( e2 )
call DestroyEffectBJ( e3 )
call SetUnitPathing( cas, true )
call UnitRemoveBuffsBJ( bj_REMOVEBUFFS_ALL, cas )
call PauseUnitBJ( false, cas )
call SetUnitVertexColorBJ( cas, 100, 100.00, 100.00, 0.00 )
call TriggerSleepAction( 0.30 )
call DestroyEffectBJ( e4 )
call DestroyEffectBJ( e5 )
call ResetUnitAnimation(cas)
call FHL(t)
set cas = null
call RemoveLocation( loc )
set loc = null
call RemoveLocation( casloc )
set casloc = null
call DestroyTimer( t )
set t = null
set dis = 0.0
endfunction

//===========================================================================
function InitTrig_hell_slam takes nothing returns nothing
set gg_trg_hell_slam = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_hell_slam, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_hell_slam, Condition( function Trig_hell_slam_Conditions ) )
call TriggerAddAction( gg_trg_hell_slam, function Trig_hell_slam_Actions )
endfunction
 
Ko gây dmg là đúng mà, điều kiện pick có đúng đâu, trong function Trig_hell_slam_Func02 thì làm gì có "GetExpiredTimer()", sở dĩ function Trig_hell_slam_jump có "GetExpiredTimer()" là vì func này là "callback" function của timer
call TimerStart(t , 0.01 , true , function Trig_hell_slam_jump ) //in đậm đó, thấy ko ?

Muốn "giải quyết" vụ này, tạo 1 global var, lưu "caster" vào rồi gọi func ForGroupBJ, ở func Trig_hell_slam_Func02 thì tất nhiên phải dùng var kia mà xét điều kiện rồi.
--------
dùng code tag thì cho code vào: [.code]<đặt code vào đây>[/.code] (nhớ bỏ dấu chấm "." )
 
thanks anh.
em đã cho trước khi pick unit
udg_hell_caster = cas
rồi trong hàm gọi thì
local unit cas = udg_hell_caster
test ok, nhưng em vẫn nghi ngờ tính MUI của nó ... nhỡ chúng nó cast cùng lúc mà thằng gây dam chỉ là 1 thằng nào đó thì ...
 
có ai biết mấy cái handle dùng để làm gì ko ???
rồi trong jass có nhiều cái mà trong jass code ko có
vd như

Mã:
local timer t = GetExpiredTimer()
local unit cas = GHUnit( t, "AOshcas")
local location loc = GHLoc( t , "AOshloc" )
local location casloc = GHLoc( t , "AOshcasloc" )
local real dis = GHReal( t , "AOshdis"
 
@RongdoVN :
khi bạn chuyển qua jass, nghĩa là bạn muốn làm spell mượt mà, gọn gàng , và quan trọng là MUI , vì thế mới có cái handlevar của Kattana , trước tiên bạn phải import cái system đó vào map, sau đó dùng thì dễ thôi : muốn lưu thì dùng SHHandle , SHReal , SHint .... muốn lấy ra thì dùng GHUnit ,GHReal ,GHint , GHLoc ...
cách dùng chi tiết :
http://forum.gamevn.com/showpost.php?p=9831894&postcount=9
 
vậy có nghĩa là handle = system giống ở GUI vậy à
vậy sukari cho xin đoạn jass knockback mà hok phãi là system giùm nha
hoặc spell jass knockback tương tự cũng đc :D
 
knockback hả ? xin ông Tom đi , ổng lúc nào làm example cũng làm spell đó, kiếm bài Tut nào của ổng cũng thấy :D
 
//TESH.scrollpos=13
//TESH.alwaysfold=0
function Trig_ShockWave_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A001' ) ) then
return false
endif
return true
endfunction


function ShockWave takes nothing returns nothing
local location Target
local unit Caster
set Caster = GetSpellAbilityUnit()
set Target = GetSpellTargetLoc()
call TriggerSleepAction ( 0.1 )
call SetUnitPositionLoc( Caster , Target )
set Caster = null
call RemoveLocation( Target )
endfunction



function Trig_ShockWave_Actions takes nothing returns nothing
local location Target
local unit Caster
call SetUnitAnimation( Caster, "slam" )
call SetUnitTimeScalePercent( Caster , 0.00 )
call SetUnitFlyHeightBJ( Caster , 800 , 800 )
call AddSpecialEffectTargetUnitBJ( "weapon" , Caster , "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl" )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call TriggerSleepAction ( 1.5 )
call SetUnitFlyHeightBJ( Caster, 0 , 0 )
call SetUnitTimeScalePercent ( Caster , 100.00 )
set Target = GetSpellTargetLoc()
set Caster = GetSpellAbilityUnit()
call AddSpecialEffectLocBJ( Target , "Abilities\\Spells\\Human\\FlameStrike\\FlameStrike1.mdl" )
set Caster = null
endfunction



//===========================================================================
function InitTrig_ShockWave takes nothing returns nothing
set gg_trg_ShockWave = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_ShockWave, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddAction( gg_trg_ShockWave, function Trig_ShockWave_Conditions )
endfunction
Cho em hỏi làm Jass như vậy thì có gì sai mà nó lại ko có làm theo các special effect trong function ::(::(
 
mọi người LÀM ƠN cho jass vào CODE tag với, biểu tượng này này:
code.gif

nếu dùng "trả lời nhanh", ko có biểu tượng đó thì: [code.] <jass> [/code.] <- bỏ dấu chấm đi

--------
@DarkKing2828, path của effect sao lại có dấu "cách" thế ? "Phoenix_Missi le.mdl", "FlameStrik e1.mdl"
 
nhưng spell em ko có special effect đã đành nhưng mà nó lại ko có fly height là 800 nữa chứ ::(::(
 
em đã "set" Caster và Target chưa ? mà đã "dùng" ?

Mã:
function Trig_ShockWave_Actions takes nothing returns nothing
    local location Target
    local unit Caster
    call SetUnitAnimation( Caster, "slam" ) //<- Caster là ai ?
    call SetUnitTimeScalePercent( Caster , 0.00 ) //<- Caster là ai ?
    call SetUnitFlyHeightBJ( Caster , 800 , 800 )  //<- Caster là ai ?
    call AddSpecialEffectTargetUnitBJ( "weapon" , Caster , "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missi le.mdl" )   //<- Caster là ai ?
    call DestroyEffectBJ( GetLastCreatedEffectBJ() )
    call TriggerSleepAction ( 1.5 )
    call SetUnitFlyHeightBJ( Caster, 0 , 0 )  //<- Caster là ai ?
    call SetUnitTimeScalePercent ( Caster , 100.00 )  //<- Caster là ai ?
    set Target = GetSpellTargetLoc() //<- set đây hả ?
    set Caster = GetSpellAbilityUnit() //<- set đây hả ?
    call AddSpecialEffectLocBJ( Target , "Abilities\\Spells\\Human\\FlameStrike\\FlameStrik e1.mdl" )
    set Caster = null
endfunction

hơn nữa, trc khi đổi fly height PHẢI add/remove ability "Crow Form" nếu MOvement Type chưa phải là Fly
Mã:
call UnitAddAbility( <unit>, 'Amrf')
call UnitRemoveAbility( <unit>, 'Amrf')
call SetUnitFlyHeight( <unit>, <height> , <rate>)
 
@DarkKing2828 kinh khủng thật, làm Jass phải có ít kiến thức cơ bản về lập trình.Này ngay cả gán trị trước rồi mới đc dùng cũng ko biết , thì nhào vô Jass như con thiêu thân nhỉ ? ban đầu bạn làm nhuần nhuyễn trigger đi , rồi convert sang custom text, rồi đọc hiểu rồi hẵng viết Jass.
 
>>>>Từ bài viết của sukaraki trong box vo lam truyen ki<<<<
#799 29-03-2009, 08:17
sukaraki
GameVN Member
4th Class Gamer Ngày tham gia: 12-05-2008
Đến từ: Demonworld
Bài viết: 280
Rep Power: 4


bạn ko xài jass vẫn anti-leak đc như thường, tại lười thôi , thêm 1 vài dòng custom script là xong mà : call RemoveLocation( udg_vịtrí ) , call DestroyGroup( udg_group ) ... v...v.. unit thì có cái remove unit trong GUI rồi, string, int , real thì ko cần destroy , special effect trong GUI cũng có lệnh destroy rồi.

Chưa hẳn là vậy đâu??? Vì sao ???
====>Các BJ func của blizzard hầu hết đều có leak >.<, anti leak cái này mới là khó đó

Ví dụ trong các func của blizzard có CreateGroup, đã DestroyGroup nhưng lịa ko set = null zzzz

PolledWait(wait game-time) cũng vậy, leak timer do ko set null
GroupAddGroup, GetUnitsTypeIdAll, cái matching gì đó mà hay xài cũng vậy.
Vì vậy ngươi ta mới nói làm jass map mới mượt, bởi xóa đi được khá nhiều leak. :D
 
:) Hi
Mình có làm 1 skill Jump cho thằng Blake hoạt động tốt nhưng có chổ mình thấy rất khó hiểu là nhiều hero cast cùng lúc skill đó thì bị lỗi :-o . Vậy phải làm sao ? :|
Xin mọi người chỉ dzùm :((
Skill nó thế này ;)) ( đừng cười nhá) . Skill có 2 phần là Jump và Move
Jump :
function Trig_Jump_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03J' ) ) then
return false
endif
return true
endfunction

function Trig_Jump_Func023001 takes nothing returns boolean
return ( GetUnitAbilityLevelSwapped('A03J', udg_JumpCast) == 1 )
endfunction

function Trig_Jump_Func024001 takes nothing returns boolean
return ( GetUnitAbilityLevelSwapped('A03J', udg_JumpCast) == 2 )
endfunction

function Trig_Jump_Func025001 takes nothing returns boolean
return ( GetUnitAbilityLevelSwapped('A03J', udg_JumpCast) == 3 )
endfunction

function Trig_Jump_Actions takes nothing returns nothing
set udg_JumpCast = GetSpellAbilityUnit()
set udg_JumpPoint = GetUnitLoc(udg_JumpCast)
set udg_JumpVictim = GetSpellTargetLoc()
call AddSpecialEffectTargetUnitBJ( "weapon,right", udg_JumpCast, "Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl" )
call PauseUnitBJ( true, udg_JumpCast )
call SetUnitInvulnerable( udg_JumpCast, true )
call SetUnitFacingToFaceLocTimed( udg_JumpCast, udg_JumpVictim, 0.00 )
call SetUnitAnimation( udg_JumpCast, "slam" )
call SetUnitTimeScalePercent( udg_JumpCast, 50.00 )
call UnitAddAbilityBJ( 'Amrf', udg_JumpCast )
call SetUnitFlyHeightBJ( udg_JumpCast, 500.00, 500.00 )
call EnableTrigger( gg_trg_Move )
call TriggerSleepAction( 0.70 )
call SetUnitFlyHeightBJ( udg_JumpCast, 0.00, 500.00 )
call TriggerSleepAction( 0.70 )
call DisableTrigger( gg_trg_Move )
call SetUnitTimeScalePercent( udg_JumpCast, 100.00 )
call UnitRemoveAbilityBJ( 'Amrf', udg_JumpCast )
call SetUnitInvulnerable( udg_JumpCast, false )
call PauseUnitBJ( false, udg_JumpCast )
if ( Trig_Jump_Func023001() ) then
call CreateNUnitsAtLoc( 1, 'e006', GetOwningPlayer(udg_JumpCast), udg_JumpVictim, bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_Jump_Func024001() ) then
call CreateNUnitsAtLoc( 1, 'e007', GetOwningPlayer(udg_JumpCast), udg_JumpVictim, bj_UNIT_FACING )
else
call DoNothing( )
endif
if ( Trig_Jump_Func025001() ) then
call CreateNUnitsAtLoc( 1, 'e008', GetOwningPlayer(udg_JumpCast), udg_JumpVictim, bj_UNIT_FACING )
else
call DoNothing( )
endif
call IssueImmediateOrderBJ( GetLastCreatedUnit(), "stomp" )
call RemoveUnit( GetLastCreatedUnit() )
call DestroyEffectBJ( GetLastCreatedEffectBJ() )
call AddSpecialEffectLocBJ( udg_JumpVictim, "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
call AddSpecialEffectLocBJ( udg_JumpVictim, "Abilities\\Spells\\Orc\\WarStomp\\WarStompCaster.mdl" )
endfunction

//===========================================================================
function InitTrig_Jump takes nothing returns nothing
set gg_trg_Jump = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Jump, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Jump, Condition( function Trig_Jump_Conditions ) )
call TriggerAddAction( gg_trg_Jump, function Trig_Jump_Actions )
endfunction
:D
Move :
function Trig_Move_Actions takes nothing returns nothing
set udg_JumpPoint = GetUnitLoc(udg_JumpCast)
set udg_MovePoint = PolarProjectionBJ(udg_JumpPoint, ( DistanceBetweenPoints(udg_JumpPoint, udg_JumpVictim) / 100.00 ), GetUnitFacing(udg_JumpCast))
call SetUnitPositionLoc( udg_JumpCast, udg_MovePoint )
endfunction

//===========================================================================
function InitTrig_Move takes nothing returns nothing
set gg_trg_Move = CreateTrigger( )
call DisableTrigger( gg_trg_Move )
call TriggerRegisterTimerEventPeriodic( gg_trg_Move, 0.01 )
call TriggerAddAction( gg_trg_Move, function Trig_Move_Actions )
endfunction
;;)
Chỉ thế thôi mà khi chơi lúc nhiều hero cùng cast skill là bị lỗi . Mình cũng đã xem nhiều Topic liên quan đến vấn đề này nhưng cũng đành "bó chíu" :-o . Mọi người giúp dzùm ( thật tình rất cần sự giúp đở):( thanks .
 
cái spell đấy thà làm = GUI còn hơn vì vốn dĩ nó từ GUI convert ra jass mà =))
còn việc chơi nhiều hero cast bị lỗi là do spell này ko MUI đi học làm spell MUI đi :)
 
Back
Top