|
楼主 |
发表于 2008-10-28 11:20:40
|
显示全部楼层
[codes=jass]function Trig_thf_Conditions takes nothing returns boolean
if (not(IsUnitType(GetTriggerUnit(),UNIT_TYPE_HERO) == true)) then
return false
endif
return true
endfunction
function Trig_jjh_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit us = GetKillingUnit()
local integer i = 0
loop
exitwhen i > 11
if (not(IsUnitAlly(us,GetOwningPlayer(u)) == true)) then
call DisplayTextToPlayer(Player(i),0,0,udg_zifuchuan[GetPlayerId(GetTriggerPlayer())]+GetPlayerName(GetTriggerPlayer())+"|r已经阵亡!杀死他的是"+udg_zifuchuan[GetPlayerId(GetOwningPlayer(us))]+GetPlayerName(GetOwningPlayer(us))+"|r。")
else
call DisplayTextToPlayer(Player(i),0,0,udg_zifuchuan[GetPlayerId(GetTriggerPlayer())]+GetPlayerName(GetTriggerPlayer())+"|r已经阵亡!杀死他的是"+udg_zifuchuan[GetPlayerId(GetOwningPlayer(us))]+GetPlayerName(GetOwningPlayer(us))+"|r,这个畜生自己人也杀,扣掉他200黄金作为惩罚。")
endif
set i = i+1
endloop
if (not(IsUnitAlly(us,GetOwningPlayer(u)) == true)) then
call SetPlayerState(GetOwningPlayer(us),PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(GetOwningPlayer(us),PLAYER_STATE_RESOURCE_GOLD)-200))
endif
set u = null
set us = null
endfunction
function InitTrig_Revive takes nothing returns nothing
set gg_trg_Revive = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Revive,EVENT_PLAYER_UNIT_DEATH)
call TriggerAddCondition(gg_trg_Revive,Condition(function Trig_thf_Conditions))
call TriggerAddAction(gg_trg_Revive,function Trig_jjh_Actions)
endfunction[/codes] |
|