Hỏi cách tạo Trigger của skill Omnislash (spell dota)

askquest

Mr & Ms Pac-Man
Tham gia ngày
23/5/08
Bài viết
224
Reaction score
0
Có lẽ là bài cũ nhưng mình tìm ko thấy nên mình porst lại
ai bít xin chỉ cách tạo trigger của skill Omnilash nhé, ngoài trigger ra nó cần dùng vriables ko ?
đây là cái Trigger mình tìm đc trên mạng.
nguồn : http://www.hiveworkshop.com/forums/resource.php?t=103044&prev=status=g&search=dota&d=list&r=20

Trigger nó như vậy nhưng sao mình coppy rồi paste vào 1 map khác nó ko cho và báo lỗi

function Trig_Omnislash_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A005'
endfunction

function Unit_Group takes nothing returns boolean
return GetBooleanAnd( IsUnitAliveBJ(GetFilterUnit()) == true, IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction

function Trig_Omnislash_Actions takes nothing returns nothing
local unit Caster = GetTriggerUnit()
local integer i = 0
local group UnitGroup
local unit TargetRandom
local unit Target = GetSpellTargetUnit()
local effect Phoenix
local location R
local real Damage = 100
local integer Amount = 1 + ( GetUnitAbilityLevelSwapped('A005', Caster) * 2 )
call TriggerSleepAction( 0.20 )
call SelectUnitRemove( Caster )
call SetUnitVertexColor( Caster, 150, 150, 150, 150 )
call SetUnitInvulnerable( Caster, true )
set Phoenix = AddSpecialEffectTarget("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl",Caster,"weapon" )
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl", Caster, "chest" ))
call SetUnitPositionLocFacingBJ( Caster, PolarProjectionBJ(GetUnitLoc(Target), 50.00, GetRandomDirectionDeg()), AngleBetweenPoints(GetUnitLoc(Caster), GetUnitLoc(Target)) )
call UnitDamageTarget( Caster, Target, Damage, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_AXE_MEDIUM_CHOP )
call SetUnitAnimation( Caster, "attack" )
call TriggerSleepAction( 0.25 )
call SelectUnitRemove( Caster )
loop
set i = i + 1
exitwhen i > Amount
set UnitGroup = GetUnitsInRangeOfLocMatching(600.00, GetUnitLoc(Caster), Condition(function Unit_Group))
if ( IsUnitGroupEmptyBJ(UnitGroup) == false ) then
set TargetRandom = GroupPickRandomUnit(UnitGroup)
set R = GetUnitLoc(TargetRandom)
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl", Caster, "chest" ))
call SetUnitPositionLocFacingBJ( Caster, PolarProjectionBJ(R, 50.00, GetRandomDirectionDeg()), AngleBetweenPoints(GetUnitLoc(Caster), GetUnitLoc(TargetRandom)) )
call UnitDamageTarget( Caster, TargetRandom, Damage, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_AXE_MEDIUM_CHOP )
call SetUnitAnimation( Caster, "attack" )
call RemoveLocation ( R )
call TriggerSleepAction( 0.25 )
call SelectUnitRemove( Caster )
else
endif
call DestroyGroup(UnitGroup)
endloop
call SelectUnitForPlayerSingle( Caster, GetTriggerPlayer() )
call SetUnitInvulnerable( Caster, false )
call SetUnitVertexColor( Caster, 255, 255, 255, 255 )
call DestroyEffect( Phoenix )
set Phoenix = null
set Caster = null
set UnitGroup = null
set TargetRandom = null
set Target = null
set Amount = 0
set R = null
set Damage = 0
endfunction

//===========================================================================
function InitTrig_Omnislash takes nothing returns nothing
set gg_trg_Omnislash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Omnislash, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Omnislash, Condition( function Trig_Omnislash_Conditions ) )
call TriggerAddAction( gg_trg_Omnislash, function Trig_Omnislash_Actions )
endfunction

Ai bít chỉ lại dùm cho mình nhé cám ơn nhìu !!!
 
Bác tạo mấy cái biến như ở mấy cái đoạn Set:
Spell OmniSlash hình như phải tạo ra có Raw ID là A005,hoặc bác tạo 1 skill mới based trên 1 chiêu target nào đó,xem raw code của nó <Ctrl+D> rồi thay thông số vào A005.

Tạm thời là thế test thử xem,việc copy spell có thể nói hơi bị khó khăn,bác xem trong mấy cái trigger của nó có phần //notice hoặc //tutorial ko đọc thử cách copy spell của nó xem,hoặc xem readme.txt kèm theo nếu có.

Xin lỗi nếu ko giúp được gì ^^
 
ùa thanks bạn nhìu ^^ có cho mình hướng và cách để làm là quý roài :D
 
àh mà trigger có cần sự hổ trợ của Variables ko ?
 
Back
Top