|
发表于 2007-12-24 16:07:49
|
显示全部楼层
- function Trig_B_Conditions takes nothing returns boolean
- if ( not ( GetItemTypeId(GetManipulatedItem()) == '[color=#ff0000]物品代码[/color] ) ) then
- return false
- endif
- return true
- endfunction
- function Trig_B_Actions takes nothing returns nothing
- call RemoveItem( GetManipulatedItem() )
- call SetPlayerTechResearchedSwap( '[color=#ff0000]科技代码[/color]', ( GetPlayerTechCountSimple('[color=#ff0000]科技代码[/color]', GetOwningPlayer(GetTriggerUnit())) + 1 ), GetOwningPlayer(GetTriggerUnit()) )
- call DisplayTimedTextToForce( GetPlayersAll(), 5.00, "TRIGSTR_002" )
- endfunction
- //===========================================================================
- function InitTrig_B takes nothing returns nothing
- set gg_trg_B = CreateTrigger( )
- call TriggerRegisterAnyUnitEventBJ( gg_trg_B, EVENT_PLAYER_UNIT_PICKUP_ITEM )
- call TriggerAddCondition( gg_trg_B, Condition( function Trig_B_Conditions ) )
- call TriggerAddAction( gg_trg_B, function Trig_B_Actions )
- endfunction
复制代码 |
|