Chắc mọi người biết until con kiến trong dota rồi chứ ? Sau đây mình sin giới thiệu qua về skills này : Khi cast skill, hero sẽ trở về trạng thái 5s trước đó ( MP, HP trở về và EXP, gold vẫn bình thường ) Mình dốt văn nên ko thể miêu tả được cho các bạn nên chỉ nói sơ sơ thôi, ai ko hiểu down về copy sang map mình cũng được. Khi cast skill, nó sẽ hồi phục MP, HP 5s trước ( nhờ trigger thứ 3 ) Mã: Time Lapse cast Events Unit - A unit Starts the effect of an ability Conditions (Ability being cast) Equal to Time Lapse Actions Set CasterPos = (Position of (Triggering unit)) Special Effect - Create a special effect at CasterPos using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl Special Effect - Destroy (Last created special effect) Custom script: call RemoveLocation (udg_CasterPos) If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions HPInteger Less than or equal to 6 Then - Actions Unit - Set life of (Triggering unit) to HP[1] Unit - Set mana of (Triggering unit) to MP[1] Unit - Move (Triggering unit) instantly to POS[1] Custom script: call RemoveLocation (udg_POS[1]) Else - Actions Unit - Set life of (Triggering unit) to HP[(HPInteger - 5)] Unit - Set mana of (Triggering unit) to MP[(MPInteger - 5)] Unit - Move (Triggering unit) instantly to POS[(POSInteger - 5)] Custom script: call RemoveLocation (udg_POS[udg_POSInteger - 5]) Set CasterPos = (Position of (Triggering unit)) Special Effect - Create a special effect at CasterPos using Abilities\Spells\NightElf\Blink\BlinkTarget.mdl Special Effect - Destroy (Last created special effect) Custom script: call RemoveLocation (udg_CasterPos) Unit - Order (Triggering unit) to Stop Khi học skill thì sẽ bắt dầu mở trigger 3 đẻ đặt thời gian bảo lưu Mã: Time Lapse cast Events Unit - A unit Learns a skill Conditions (Level of Time Lapse for (Triggering unit)) Greater than 0 Actions Set Caste = (Triggering unit) Trigger - Turn off (This trigger) Trigger - Turn on Time Lapse creat restore2 <gen> Đặt số máu, vị trí trước đó 5s, sau 5s sẽ đặt lại vị trí ( kể từ khi mỏ trigger này ) Mã: Time Lapse creat restore2 Events Time - Every 1.00 seconds of game time Conditions (Caste is alive) Equal to True Actions Set HPInteger = (HPInteger + 1) Set HP[HPInteger] = (Life of Caste) Set MPInteger = (MPInteger + 1) Set MP[MPInteger] = (Mana of Caste) Set POSInteger = (POSInteger + 1) Set POS[POSInteger] = (Position of Caste) If (All Conditions are True) then do (Then Actions) else do (Else Actions) If - Conditions HPInteger Greater than 6 Then - Actions Custom script: call RemoveLocation (udg_POS[udg_POSInteger - 6]) Else - Actions Lưu 5 giây kể từ khi bị chết Mã: Time Lapse save dies Events Unit - A unit Dies Conditions (Dying unit) Equal to Caste Actions Wait until ((Caste is alive) Equal to True), checking every 0.10 seconds For each (Integer A) from 1 to 5, do (Actions) Loop - Actions Set HP[(HPInteger - (Integer A))] = (Life of Caste) Set MP[(MPInteger - (Integer A))] = (Mana of Caste) Set POS[(POSInteger - (Integer A))] = (Position of Caste) Chắc khó hiểu :( nhưng đảm bảo ko có leak Cũng tại vì WE bị lỗi nên đã Enabled trigger nên các bạn phải tick vào enabled trigger rồi test
Ulti chứ không phải Unti MUI = Multi Unit Instanciable (nhiều unit cùng cast 1 triggered spell mà không gây ra lỗi).
hè. cũng hay đấy chứ thử rồi sẽ biết ngay :) ko nhất thiết đâu mà cũng mới biết mấy cái rìa thôi chẳng dám đông sâu :(
thực ra nó là đoạn code jass tôi kiếm trên epic và viết bằng gui đấy. Mã: function Trig_Time_Lapse_Creat_restore_Conditions takes nothing returns boolean if ( not ( GetSpellAbilityId() == 'A000' ) ) then return false endif return true endfunction function Trig_Time_Lapse_Creat_restore_Func005C takes nothing returns boolean if ( not ( udg_HPInteger <= 6 ) ) then return false endif return true endfunction function Trig_Time_Lapse_Creat_restore_Actions takes nothing returns nothing set udg_CasterPos = GetUnitLoc(GetTriggerUnit()) call AddSpecialEffectLocBJ( udg_CasterPos, "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl" ) call DestroyEffectBJ( GetLastCreatedEffectBJ() ) call RemoveLocation (udg_CasterPos) if ( Trig_Time_Lapse_Creat_restore_Func005C() ) then call SetUnitLifeBJ( GetTriggerUnit(), udg_HP[1] ) call SetUnitManaBJ( GetTriggerUnit(), udg_MP[1] ) call SetUnitPositionLoc( GetTriggerUnit(), udg_POS[1] ) call RemoveLocation (udg_POS[1]) else call SetUnitLifeBJ( GetTriggerUnit(), udg_HP[( udg_HPInteger - 5 )] ) call SetUnitManaBJ( GetTriggerUnit(), udg_MP[( udg_MPInteger - 5 )] ) call SetUnitPositionLoc( GetTriggerUnit(), udg_POS[( udg_POSInteger - 5 )] ) call RemoveLocation (udg_POS[udg_POSInteger - 5]) endif set udg_CasterPos = GetUnitLoc(GetTriggerUnit()) call AddSpecialEffectLocBJ( udg_CasterPos, "Abilities\\Spells\\NightElf\\Blink\\BlinkTarget.mdl" ) call DestroyEffectBJ( GetLastCreatedEffectBJ() ) call RemoveLocation (udg_CasterPos) call IssueImmediateOrderBJ( GetTriggerUnit(), "stop" ) endfunction //=========================================================================== function InitTrig_Time_Lapse_Creat_restore takes nothing returns nothing set gg_trg_Time_Lapse_Creat_restore = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Time_Lapse_Creat_restore, EVENT_PLAYER_UNIT_SPELL_EFFECT ) call TriggerAddCondition( gg_trg_Time_Lapse_Creat_restore, Condition( function Trig_Time_Lapse_Creat_restore_Conditions ) ) call TriggerAddAction( gg_trg_Time_Lapse_Creat_restore, function Trig_Time_Lapse_Creat_restore_Actions ) endfunction Mã: function Trig_Time_Lapse_cast_Conditions takes nothing returns boolean if ( not ( GetUnitAbilityLevelSwapped('A000', GetTriggerUnit()) > 0 ) ) then return false endif return true endfunction function Trig_Time_Lapse_cast_Actions takes nothing returns nothing set udg_Caste = GetTriggerUnit() call DisableTrigger( GetTriggeringTrigger() ) call EnableTrigger( gg_trg_Time_Lapse_creat_restore2 ) endfunction //=========================================================================== function InitTrig_Time_Lapse_cast takes nothing returns nothing set gg_trg_Time_Lapse_cast = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Time_Lapse_cast, EVENT_PLAYER_HERO_SKILL ) call TriggerAddCondition( gg_trg_Time_Lapse_cast, Condition( function Trig_Time_Lapse_cast_Conditions ) ) call TriggerAddAction( gg_trg_Time_Lapse_cast, function Trig_Time_Lapse_cast_Actions ) endfunction Mã: function Trig_Time_Lapse_creat_restore2_Conditions takes nothing returns boolean if ( not ( IsUnitAliveBJ(udg_Caste) == true ) ) then return false endif return true endfunction function Trig_Time_Lapse_creat_restore2_Func007C takes nothing returns boolean if ( not ( udg_HPInteger > 6 ) ) then return false endif return true endfunction function Trig_Time_Lapse_creat_restore2_Actions takes nothing returns nothing set udg_HPInteger = ( udg_HPInteger + 1 ) set udg_HP[udg_HPInteger] = GetUnitStateSwap(UNIT_STATE_LIFE, udg_Caste) set udg_MPInteger = ( udg_MPInteger + 1 ) set udg_MP[udg_MPInteger] = GetUnitStateSwap(UNIT_STATE_MANA, udg_Caste) set udg_POSInteger = ( udg_POSInteger + 1 ) set udg_POS[udg_POSInteger] = GetUnitLoc(udg_Caste) if ( Trig_Time_Lapse_creat_restore2_Func007C() ) then call RemoveLocation (udg_POS[udg_POSInteger - 6]) else endif endfunction //=========================================================================== function InitTrig_Time_Lapse_creat_restore2 takes nothing returns nothing set gg_trg_Time_Lapse_creat_restore2 = CreateTrigger( ) call TriggerRegisterTimerEventPeriodic( gg_trg_Time_Lapse_creat_restore2, 1.00 ) call TriggerAddCondition( gg_trg_Time_Lapse_creat_restore2, Condition( function Trig_Time_Lapse_creat_restore2_Conditions ) ) call TriggerAddAction( gg_trg_Time_Lapse_creat_restore2, function Trig_Time_Lapse_creat_restore2_Actions ) endfunction Mã: function Trig_Time_Lapse_save_dies_Conditions takes nothing returns boolean if ( not ( GetDyingUnit() == udg_Caste ) ) then return false endif return true endfunction function Trig_Time_Lapse_save_dies_Func001001 takes nothing returns boolean return ( IsUnitAliveBJ(udg_Caste) == true ) endfunction function Trig_Time_Lapse_save_dies_Actions takes nothing returns nothing loop exitwhen ( Trig_Time_Lapse_save_dies_Func001001() ) call TriggerSleepAction(RMaxBJ(bj_WAIT_FOR_COND_MIN_INTERVAL, 0.10)) endloop set bj_forLoopAIndex = 1 set bj_forLoopAIndexEnd = 5 loop exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd set udg_HP[( udg_HPInteger - GetForLoopIndexA() )] = GetUnitStateSwap(UNIT_STATE_LIFE, udg_Caste) set udg_MP[( udg_MPInteger - GetForLoopIndexA() )] = GetUnitStateSwap(UNIT_STATE_MANA, udg_Caste) set udg_POS[( udg_POSInteger - GetForLoopIndexA() )] = GetUnitLoc(udg_Caste) set bj_forLoopAIndex = bj_forLoopAIndex + 1 endloop endfunction //=========================================================================== function InitTrig_Time_Lapse_save_dies takes nothing returns nothing set gg_trg_Time_Lapse_save_dies = CreateTrigger( ) call TriggerRegisterAnyUnitEventBJ( gg_trg_Time_Lapse_save_dies, EVENT_PLAYER_UNIT_DEATH ) call TriggerAddCondition( gg_trg_Time_Lapse_save_dies, Condition( function Trig_Time_Lapse_save_dies_Conditions ) ) call TriggerAddAction( gg_trg_Time_Lapse_save_dies, function Trig_Time_Lapse_save_dies_Actions ) endfunction zzz nhìn hoa cả mắt. ko biết có sai chỗ nào ko
nhưng đám (code jass) kia nó hoàn toàn là từ GUI to jass( Converter Custom Text) cũng là jass nhưng không được tối ưu. nói chung: Jass không tối ưu hóa = Vô ích. GUI (Converter Custom Text) chẳng khác gì là GUI mặc dù ghi = jass nếu bấm nút (Converter Custom Text) thì lấy đâu ra mà sai P/S: có thể ai đó khá rảnh rỗi up một map demo. spell Time Lapse by cr4xzZz được chuyển hết GUI = jass lên epicwar chăng
1. Pick Player group 1 rồi add pick player vào group 2 2. Giật là giật thế nào? Code? 3. Hướng dẫn tạo effect cho 1 vài player nhất định 4. Sao không post vào topic hỏi đáp?
GUI: Tức là những trigger bình thường có ba dòng event, conditions, actions mà bạn có thể đưa các lệnh thực thi có sẵn bằng cách chuột phải-> add event, condition,action trong trigger đó. MUI: MUI Là một thuật ngữ để chỉ về việc trigger đó có thể thực hiện cùng một lúc (hay chênh lệch ở một phạm vi thời gian) hoặc nhiều bản thân khác sử dụng mà không bị lỗi. Lấy ví dụ đơn giản về một chiêu thức, thường thì bạn làm chiêu sử dụng lên một đối thủ, muốn gây ra dam sau 5s mà sử dụng hàm Wait 5.00s trong trigger , rồi sau đó sử dụng hàm deal dam và gán mục tiêu là một giá trị định sẵn (ex:set TargetUnit = GetSpellTargetUnit()) trước đó thì sẽ bị lỗi khi một đơn vị khác sử dụng chiêu thức đó trong phạm vi 5 giây. JASS: Là trigger và cũng có event, conditions, actions nhưng được hiển thị dưới hình thức text, nó phải nhờ người viết phân định ra đâu là event, đâu là conditions, đâu là actions qua các bộ hàm gọi là function. Tiện lợi của JASS hơn GUI ở chỗ là dễ dàng giúp người viết thực hiện MUI spell nếu biết cách sử dụng hợp lý. JASS được anh Tom-sama khuyên các bạn rành thạo nên học và viết các spell bằng JASS. Bạn đọc thêm về JASS ở đây nhé:http://forums.gamevn.com/showthread.php?485055-Tutorial-GUI-to-JASS p.s: Trả lời thui Tom-sama chém nhẹ em thui nhé
GUI là viết tắt của graphical user interface, hiểu nôm na là lập trình bằng giao diện. Jass là ngôn ngữ lập trình của World Editor.