|
[jass]
function WeaponProficientActions takes nothing returns nothing
local unit u = GetKillingUnitBJ()
local player p = GetOwningPlayer(u)
set udg_Rifle[0] = GetUnitAbilityLevelSwapped('Aven',u)
if GetUnitTypeId(u)=='Hpal' then
call DisplayTextToPlayer(GetOwningPlayer(u),0.0,0.0, I2S(udg_WeaponProficient[1])+ "/30")
set udg_WeaponProficient[1] = udg_WeaponProficient[1]+1
if udg_WeaponProficient[1]>=30 then
set udg_WeaponProficient[1]=0
call SetPlayerTechResearched(p,'Rovs',GetPlayerTechCount(p,'Rovs',true)+1)
call IncUnitAbilityLevel(u,'Aven')
call DisplayTextToPlayer(GetOwningPlayer(u),0.0,0.0, "|cffcd950cALICE|r : 你的武器精通已达到" + I2S(udg_Rifle[0]) + "级")
endif
endif
endfunction
function WeaponProInit takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterPlayerUnitEventSimple(t,Player(13),EVENT_PLAYER_UNIT_DEATH)
call TriggerRegisterPlayerUnitEventSimple(t,Player(14),EVENT_PLAYER_UNIT_DEATH)
call TriggerAddAction(t,function WeaponProficientActions)
endfunction
//===========================================================================
function InitTrig_Weapon_Proficient takes nothing returns nothing
endfunction
[/jass]
编译无错误,但是在地图运行时不起作用,个人觉得是在取得凶手单位的地方出了问题,但是不知道何解. |
|