|
技能描述:召唤一朵花。持续时间无限。上限为7/10/13/16个。
达到上限则替换生命最少的或最早召唤的,优先替换生命最少的。。。
一个变量udg_GC游戏缓存
function hua2J takes nothing returns nothing
local unit u
local unit array uu
local integer int
local integer i
local integer num
if GetUnitTypeId(GetSummonedUnit()) == 'oeye' then
set i = GetStoredInteger(udg_GC,"Uxiang"+I2S(GetConvertedPlayerId(GetOwningPlayer(GetSummoningUnit()))),"I")
set num = GetStoredInteger(udg_GC,"Uxiang"+I2S(GetConvertedPlayerId(GetOwningPlayer(GetSummoningUnit()))),"NUM")
set i = i + 1
call SetUnitUserData(GetSummonedUnit(),i)
call StoreInteger(udg_GC,"Uxiang"+I2S(GetConvertedPlayerId(GetOwningPlayer(GetSummoningUnit()))),"I",i)
call StoreInteger(udg_GC,"Uxiang"+I2S(GetConvertedPlayerId(GetOwningPlayer(GetSummoningUnit()))),"Flowers"+I2S(i),H2I(GetSummonedUnit()))
if i > num then
set int = 1
loop
exitwhen int > num
set uu[int] = I2U(GetStoredInteger(udg_GC,"Uxiang"+I2S(GetConvertedPlayerId(GetOwningPlayer(GetSummoningUnit()))),"Flowers"+I2S(int)))
set int = int + 1
endloop
set u = uu[1]
set int = 1
loop
exitwhen int > num
if GetUnitLifePercent(u) > GetUnitLifePercent(uu[int]) then
set u = uu[int]
endif
set int = int+1
endloop
call KillUnit(u)
set int = 1
loop
exitwhen int > num
set uu[int] = null
set int = int+1
endloop
set u = null
endif
endif
endfunction
function hua1J takes nothing returns nothing
local integer num
if GetLearnedSkill() == 'AHwe' then
set num = GetStoredInteger(udg_GC,"Uxiang"+I2S(GetConvertedPlayerId(GetOwningPlayer(GetLearningUnit()))),"NUM")
set num = ( num + 3 )
call StoreInteger(udg_GC,"Uxiang"+I2S(GetConvertedPlayerId(GetOwningPlayer(GetLearningUnit()))),"NUM",num)
endif
endfunction
function Trig_huahua_Conditions takes nothing returns nothing
local trigger hua1 = CreateTrigger()
local trigger hua2 = CreateTrigger()
if GetUnitTypeId(GetSoldUnit()) == 'Hamg' then
call StoreInteger(udg_GC,"Uxiang"+I2S(GetConvertedPlayerId(GetOwningPlayer(GetSoldUnit()))),"I",0)
call StoreInteger(udg_GC,"Uxiang"+I2S(GetConvertedPlayerId(GetOwningPlayer(GetSoldUnit()))),"NUM",4)
call TriggerRegisterUnitEvent(hua1,GetSoldUnit(),EVENT_UNIT_HERO_SKILL)
call TriggerRegisterUnitEvent(hua2,GetSoldUnit(),EVENT_UNIT_SUMMON)
call TriggerAddCondition(hua1,Condition(function hua1J))
call TriggerAddCondition(hua2,Condition(function hua2J))
endif
set hua1 = null
set hua2 = null
endfunction
//===========================================================================
function InitTrig_huahua takes nothing returns nothing
set gg_trg_huahua = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_huahua, EVENT_PLAYER_UNIT_SELL )
call TriggerAddCondition( gg_trg_huahua, Condition( function Trig_huahua_Conditions ) )
endfunction
//===========================================================================
function huasi takes nothing returns nothing
local integer n
local integer int
local integer i
local unit array uu
if GetUnitTypeId(GetDyingUnit()) == 'oeye' then
set i = GetStoredInteger(udg_GC,"Uxiang"+I2S(GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))),"I")
set int = GetUnitUserData(GetDyingUnit())
set n = int
loop
exitwhen n > i
set uu[n] = I2U(GetStoredInteger(udg_GC,"Uxiang"+I2S(GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))),"Flowers"+I2S(n+1)))
call SetUnitUserData(uu[n],n)
call StoreInteger(udg_GC,"Uxiang"+I2S(GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))),"Flowers"+I2S(n),H2I(uu[n]))
set n = n + 1
endloop
set i = i - 1
call StoreInteger(udg_GC,"Uxiang"+I2S(GetConvertedPlayerId(GetOwningPlayer(GetDyingUnit()))),"I",i)
endif
endfunction
//===========================================================================
function InitTrig_huasi takes nothing returns nothing
set gg_trg_huasi = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_huasi, EVENT_PLAYER_UNIT_DEATH )
call TriggerAddCondition( gg_trg_huasi, Condition( function huasi ) )
endfunction |
评分
-
查看全部评分
|