|
发表于 2020-12-17 16:45:59
|
显示全部楼层
function HuaFenfei1TJ takes nothing returns boolean
return ((GetSpellAbilityId() == 'A00K') and (IsUnitType(GetSpellAbilityUnit(), UNIT_TYPE_HERO) == true))
endfunction
function HuaFenfei2DZ takes nothing returns nothing
local unit u=GetTriggerUnit()
local unit u2
if UnitHasBuffBJ(u, 'B003') == false then
call DisableTrigger(GetTriggeringTrigger())
call DestroyTrigger(GetTriggeringTrigger())
call GroupRemoveUnit(grtjpd, u)
endif
if GetEventDamage() > 0.00 then
if (((GetUnitAbilityLevel(u, 'A00L') < 1) and (UnitHasBuffBJ(u, 'B003') == true)) and (GetRandomPercentageBJ() <= 50.00)) then
call SetUnitLifeBJ(u, OperatorRealAdd(GetUnitState(u, UNIT_STATE_LIFE), GetEventDamage()))
endif
if (((GetUnitAbilityLevel(u, 'A00L') > 0) and (UnitHasBuffBJ(u, 'B003') == true)) and (GetRandomPercentageBJ() <= 65.00)) then
call SetUnitLifeBJ(u, OperatorRealAdd(GetUnitState(u, UNIT_STATE_LIFE), GetEventDamage()))
endif
endif
//----------------单位类型------------------------------------------
set u=null
set u2=null
endfunction
//----------------------免伤触发上列------------------------------------------------------------------
function HuaBafG02 takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer id=GetHandleId(t)
local unit u=LoadUnitHandle(hc,id,1)
local unit u2=LoadUnitHandle(hc,id,4)
local unit u3=GetEnumUnit()
local real rx=GetUnitX(u2)
local real ry=GetUnitY(u2)
if(((IsUnitType(u3, UNIT_TYPE_STRUCTURE) == false) and ((IsUnitType(u3, UNIT_TYPE_MAGIC_IMMUNE) == false) and ((IsUnitType(u3, UNIT_TYPE_DEAD) == false) and ((IsUnitEnemy(u3, GetOwningPlayer(u)) == true) and (u3 != u))))))then
call UnitDamageTarget(u, u3, OperatorRealAdd(OperatorRealMultiply(I2R(GetHeroAgi(u, true)), 2.00), OperatorRealMultiply(300.00, I2R(GetUnitAbilityLevel(u, 'A00K')))), true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MIND, WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Critters\\Albatross\\CritterBloodAlbatross.mdl", u3, "chest"))
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\Bolt\\BoltImpact.mdl", rx, ry))
call RemoveUnit(u2)//-------------------碰撞删除残影---------------
endif
set u=null
set u2=null
set u3=null
set t=null
endfunction
function HuaBafG01 takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer id=GetHandleId(t)
local group g2=CreateGroup()
local unit u2=GetEnumUnit()
local real rx=GetUnitX(u2)
local real ry=GetUnitY(u2)
call GroupEnumUnitsInRange(g2,rx,ry,375.00, null)
call SaveUnitHandle(hc,id,4,u2)
call ForGroup(g2, function HuaBafG02)
call GroupClear(g2)
call DestroyGroup(g2)
set u2=null
set g2=null
set t=null
endfunction
function HuaBafG03 takes nothing returns nothing
local unit u2=GetEnumUnit()
call DestroyEffect(AddSpecialEffect("Abilities\\Weapons\\Bolt\\BoltImpact.mdl", GetUnitX(u2), GetUnitY(u2)))
call RemoveUnit(u2)
set u2=null
//---------------------------清除残影----------------------------------------
endfunction
function HuaFenfei1JSQDZ takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer id=GetHandleId(t)
local unit u=LoadUnitHandle(hc,id,1)
local group g=LoadGroupHandle(hc,id,2)
local real r=LoadReal(hc,id,3)+1
call SaveReal(hc,id,3,r)
call ForGroup(g, function HuaBafG01)
//----------------------------------到期删除-------------------------------------------------------------清理内存-------------------
if r >= 12 then
call PauseTimer(t)
call DestroyTimer(t)
call ForGroup(g, function HuaBafG03)
call GroupClear(g)
call DestroyGroup(g)
call FlushChildHashtable(hc,id)
set u=null
set t=null
set g=null
endif
endfunction
function HuaFenfei1DZ takes nothing returns nothing
local timer t=CreateTimer()
local integer id=GetHandleId(t)
local unit u=GetTriggerUnit()
local real rx=GetUnitX(u)
local real ry=GetUnitY(u)
local group g=CreateGroup()
local real r=0
local unit u2
local real nx
local real ny
local trigger HuaFenfei2
//-------------技能生效------------------------------
call PolledWait(0.10)
call SetUnitTimeScale(u, 0.20)
call SetUnitVertexColor(u, 105, 105,105, 75)
//--------------免伤设置---------------------------------
if IsUnitInGroup(u, grtjpd) == false then
call GroupAddUnit(grtjpd, u)
set HuaFenfei2=CreateTrigger()
call TriggerAddAction(HuaFenfei2, function HuaFenfei2DZ)
call TriggerRegisterUnitEvent(HuaFenfei2, u, EVENT_UNIT_DAMAGED)
set HuaFenfei2=null
endif
//---------------------瞬间伤害----------------------------------------
call GroupEnumUnitsInRange(g,rx,ry,600.00, null)
call DestroyEffect(AddSpecialEffect("yinghua.mdx", rx, ry))
loop
set u2=FirstOfGroup(g)
if(((IsUnitType(u2, UNIT_TYPE_STRUCTURE) == false) and ((IsUnitType(u2, UNIT_TYPE_MAGIC_IMMUNE) == false) and ((IsUnitType(u2, UNIT_TYPE_DEAD) == false) and ((IsUnitEnemy(u2, GetOwningPlayer(u)) == true) and (u2 != u))))))then
call UnitDamageTarget(u, u2, OperatorRealAdd(OperatorRealMultiply(I2R(GetHeroAgi(u, true)), 2.00), OperatorRealMultiply(300.00, I2R(GetUnitAbilityLevel(u, 'A00K')))), true, true, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_MIND, WEAPON_TYPE_WHOKNOWS)
call DestroyEffect(AddSpecialEffectTarget("Objects\\Spawnmodels\\Human\\HumanBlood\\BloodElfSpellThiefBlood.mdl", u2, "chest"))
endif
call GroupRemoveUnit(g, u2)
set u2=null
exitwhen CountUnitsInGroup(g)==0
endloop
set u2=null
//---------------2次动作----------------
loop
set r=r+90
set nx = rx + 375*Cos(Deg2Rad(r))
set ny = ry + 375*Sin(Deg2Rad(r))
if GetUnitTypeId(u) == 'E002' then
set u2=CreateUnit(GetOwningPlayer(u), 'h007', nx, ny, r)
if GetUnitAbilityLevel(u, 'A011') >= 1 then
call SetUnitScale(u2, 1.60, 1.60, 1.60)
endif
else
if GetUnitTypeId(u) == 'E006' then
set u2=CreateUnit(GetOwningPlayer(u), 'h00K', nx, ny, r)
if GetUnitAbilityLevel(u, 'A011') >= 1 then
call SetUnitScale(u2, 1.60, 1.60, 1.60)
endif
else
if GetUnitTypeId(u) == 'E007' then
set u2=CreateUnit(GetOwningPlayer(u), 'h00L', nx, ny, r)
if GetUnitAbilityLevel(u, 'A011') >= 1 then
call SetUnitScale(u2, 1.60, 1.60, 1.60)
endif
else
if GetUnitTypeId(u) == 'E00D' then
set u2=CreateUnit(GetOwningPlayer(u), 'h00R', nx, ny, r)
call SetUnitAnimation(u, "attack")
if GetUnitAbilityLevel(u, 'A011') >= 1 then
call SetUnitScale(u2, 2.50, 2.50, 2.50)
endif
else
set u2=CreateUnit(GetOwningPlayer(u), 'h00D', nx, ny, r)
if GetUnitAbilityLevel(u, 'A011') >= 1 then
call SetUnitScale(u2, 2.50, 2.50, 2.50)
endif
endif
endif
endif
endif
call SetUnitAnimation(u2, "spell slam")
call SetUnitTimeScale(u2, 0.55)
call SetUnitVertexColor(u2, 255, 255, 255, 145)
call SetUnitX(u, nx)
call SetUnitY(u, ny)
call GroupAddUnit(g, u2)
set u2=null
call PolledWait(0.10)
exitwhen r>=360
endloop
call SetUnitTimeScale(u, 1.00)
call SetUnitVertexColor(u, 255, 255, 255, 255)
call SetUnitX(u, rx)
call SetUnitY(u, ry)
set u2=null
set r=0
//--------绑定计时器计算分身伤害-----------------------------------------
call SaveUnitHandle(hc,id,1,u)
call SaveGroupHandle(hc,id,2,g)
call SaveReal(hc,id,3,r)
call TimerStart(t,0.50,true,function HuaFenfei1JSQDZ)
set u=null
set u2=null
set t=null
set g=null
set HuaFenfei2=null
endfunction
//------------------------------------------------------幻化纷飞-----------------------------------------------------
function InitTrig_HuaFenfei1 takes nothing returns nothing
local trigger HuaFenfei1= CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(HuaFenfei1, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(HuaFenfei1, Condition(function HuaFenfei1TJ))
call TriggerAddAction(HuaFenfei1, function HuaFenfei1DZ)
set HuaFenfei1=null
endfunction
说白了 JASS不是很厉害- - |
|