|
看了N多国外JASS演示才搞的,达人帮忙看看有错没有。
///////////////////////////////////////////////////////
function Trig_Skill_F1_Jass_Conditions takes nothing returns boolean
return ( GetSpellAbilityId() == 'A011' )
endfunction
function Trig_Skill_F1_Jass_Actions takes nothing returns nothing
local unit Unit1 = GetTriggerUnit()
local unit Unit2 = GetSpellTargetUnit()
local location P1
local location P2
local real Real = ( 50.00 + I2R(( GetUnitAbilityLevel(Unit1, 'A011') * 50 )) )
loop
set P1 = GetUnitLoc(Unit1)
set P2 = GetUnitLoc(Unit2)
exitwhen ( IsUnitDeadBJ(Unit2) == true ) or ( DistanceBetweenPoints(P1, P2) > 600.00 )
call AddSpecialEffectLocBJ( P2, "Abilities\\Weapons\\HydraliskImpact\\HydraliskImpact.mdl" )
call DestroyEffect( GetLastCreatedEffectBJ() )
call UnitDamageTarget( Unit1, Unit2, Real, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_UNIVERSAL, WEAPON_TYPE_WHOKNOWS )
call SetUnitState( Unit1, UNIT_STATE_LIFE, ( GetUnitState(Unit1, UNIT_STATE_LIFE) + ( Real * 0.30 ) ) )
call CreateTextTagLocBJ( ( I2S(R2I(Real)) + "!" ), P2, 0, 10, 50.00, 40.00, 25.00, 15.00 )
call SetTextTagPermanent( GetLastCreatedTextTag(), false )
call SetTextTagLifespan( GetLastCreatedTextTag(), 3.00 )
call SetTextTagFadepoint( GetLastCreatedTextTag(), 2.50 )
call SetTextTagVelocityBJ( GetLastCreatedTextTag(), 64, 90 )
call RemoveLocation( P1 )
call RemoveLocation( P2 )
call TriggerSleepAction( 3.00 )
endloop
call RemoveLocation( P1 )
call RemoveLocation( P2 )
set Unit1 = null
set Unit2 = null
set P1 = null
set P2 = null
set Real = 0
endfunction
//===========================================================================
function InitTrig_Skill_F1_Jass takes nothing returns nothing
set gg_trg_Skill_F1_Jass = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Skill_F1_Jass, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Skill_F1_Jass, Condition( function Trig_Skill_F1_Jass_Conditions ) )
call TriggerAddAction( gg_trg_Skill_F1_Jass, function Trig_Skill_F1_Jass_Actions )
endfunction |
|