|
楼主 |
发表于 2020-7-4 16:06:30
|
显示全部楼层
另外有没有大佬会 DOTA里的黑皇杖 模拟。我做的 只能用BUFF 判断 ,有能用时间判断的么,重新新开启修改之前的时间。用局部 可以多人使用,但取不回时间, 用全局只会玩家引锁,玩家有两个同样的英雄然后BUG。想要完美点的有么
这是我做的用BUFF判断
function MhZsTJ01 takes nothing returns boolean
return ((GetSpellAbilityId() == 'A00B') and (IsUnitType(GetSpellAbilityUnit(), UNIT_TYPE_HERO) == true)and(GetUnitTypeId(GetSpellAbilityUnit()) == 'E000'))
endfunction
function MhZsJS03 takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer id=GetHandleId(t)
local unit u1=LoadUnitHandle(hc,id,1)
local real r=LoadReal(hc,id,2)+1
local real ri=LoadReal(hc,id,3)-0.02
call SaveReal(hc,id,2,r)
call SaveReal(hc,id,3,ri)
if ri > 2 then
call SetUnitScale(u1, ri, ri, ri)
else
if r >= 10 then
call SetUnitVertexColor(u1, 255, 255, 255, 255)
call UnitRemoveAbility(u1, 'A00E')
call ModifyHeroStat(bj_HEROSTAT_STR,u1, bj_MODIFYMETHOD_SUB, OperatorIntegerMultiply(600, GetUnitAbilityLevel(u1, 'A00B')))
call ModifyHeroStat(bj_HEROSTAT_AGI,u1, bj_MODIFYMETHOD_SUB, OperatorIntegerMultiply(600, GetUnitAbilityLevel(u1, 'A00B')))
call ModifyHeroStat(bj_HEROSTAT_INT,u1, bj_MODIFYMETHOD_SUB, OperatorIntegerMultiply(600, GetUnitAbilityLevel(u1, 'A00B')))
call PauseTimer(t)
call DestroyTimer(t)
call GroupRemoveUnit(gcoaTJ, u1)
call FlushChildHashtable(hc,id)
set u1=null
set t=null
endif
endif
set u1=null
set t=null
endfunction
//--------------------计时器持续多少秒到期,到期开启模型缩小计时器-----------------------------
function MhZsJS02 takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer id=GetHandleId(t)
local unit u1=LoadUnitHandle(hc,id,1)
if UnitHasBuffBJ(u1, 'B000') == false then
call PauseTimer(t)
call TimerStart(t,0.01,true,function MhZsJS03)
set t=null
set u1=null
endif
endfunction
function MhZsJS01 takes nothing returns nothing
local timer t=GetExpiredTimer()
local integer id=GetHandleId(t)
local unit u1=LoadUnitHandle(hc,id,1)
local real r=LoadReal(hc,id,2)+1
local real ri=LoadReal(hc,id,3)+0.02
call SaveReal(hc,id,2,r)
call SaveReal(hc,id,3,ri)
if ri < 4 then
call SetUnitScale(u1, ri, ri, ri)
call SetUnitVertexColor(u1, 20, 20, 20, 255)
else
if r >= 10 then
call PauseTimer(t)
set r=0 //清理设置--------------为下次计时----------------------
set ri=4//设置确保无误---------------------------------
call SaveReal(hc,id,2,r)
call SaveReal(hc,id,3,ri)
call TimerStart(t,1,true,function MhZsJS02)
set u1=null
set t=null
endif
endif
set u1=null
set t=null
endfunction
function MhZsDz01 takes nothing returns nothing
local timer t=CreateTimer()
local integer id=GetHandleId(t)
local unit u1=GetSpellAbilityUnit()
local unit u2=CreateUnit(GetOwningPlayer(u1), 'h003', GetUnitX(u1), GetUnitY(u1), GetUnitFacing(u1))
local real r=0//计时器到期使用判断
local real ri=2//模型大小
//--------------------------重新开启只添加BUFF------------------
if GetUnitAbilityLevel(u1, 'A00D') >= 1 then
call ShowUnit(u2, false)
call UnitAddAbility(u2, 'A00C')
call SetUnitAbilityLevel(u2, 'A00C', GetUnitAbilityLevel(u1, 'A00B'))
call IssueNeutralTargetOrder(GetOwningPlayer(u2), u2, "innerfire", u1)
call UnitApplyTimedLife(u2, 'BHwe', 1.50)
endif
if GetUnitAbilityLevel(u1, 'A00D') < 1 then
//-------------------------设置魔免---------------------------------------------
call UnitAddAbility(u1, 'A00E')
call SetPlayerAbilityAvailable(GetOwningPlayer(u1), 'A00E', false)
//--------------------添加BUFF--------------------------------------
call ShowUnit(u2, false)
call UnitAddAbility(u2, 'A00C')
call SetUnitAbilityLevel(u2, 'A00C', GetUnitAbilityLevel(u1, 'A00B'))
call IssueNeutralTargetOrder(GetOwningPlayer(u2), u2, "innerfire", u1)
call UnitApplyTimedLife(u2, 'BHwe', 1.50)
//-------------------增加属性--------------------
if IsUnitInGroup(u1, gcoaTJ) == false then
call GroupAddUnit(gcoaTJ, u1)
call ModifyHeroStat(bj_HEROSTAT_STR,u1, bj_MODIFYMETHOD_ADD, OperatorIntegerMultiply(600, GetUnitAbilityLevel(u1, 'A00B')))
call ModifyHeroStat(bj_HEROSTAT_AGI,u1, bj_MODIFYMETHOD_ADD, OperatorIntegerMultiply(600, GetUnitAbilityLevel(u1, 'A00B')))
call ModifyHeroStat(bj_HEROSTAT_INT,u1, bj_MODIFYMETHOD_ADD, OperatorIntegerMultiply(600, GetUnitAbilityLevel(u1, 'A00B')))
endif
//-----------------------中心计时器开启--------------------------------
call SaveUnitHandle(hc,id,1,u1)
call SaveReal(hc,id,2,r)
call SaveReal(hc,id,3,ri)
call TimerStart(t,0.01,true,function MhZsJS01)
endif
set u1=null
set u2=null
set t=null
endfunction
//-----------------------------------------魔化真身初始化-----------------------------------------------------------------
function InitTrig_MoHuaZhenShen takes nothing returns nothing
local trigger MhZscf = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(MhZscf , EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(MhZscf , Condition(function MhZsTJ01))
call TriggerAddAction(MhZscf , function MhZsDz01)
set MhZscf=null
endfunction |
|