|
发表于 2009-12-1 11:37:30
|
显示全部楼层
[codes=jass]function CancelSpellA1MX takes nothing returns nothing
local player PLY=GetOwningPlayer(GetTriggerUnit())
local integer LVL=GetUnitAbilityLevel(GetTriggerUnit(),'A1MX')
if GetPlayerState(PLY,PLAYER_STATE_RESOURCE_GOLD)<LVL*100+400 then
call mr(GetTriggerUnit())
call LL(PLY,"金钱不足,无法使用!")
endif
endfunction
function IsSpellA1MX takes nothing returns boolean
return GetSpellAbilityId()=='A1MX'
endfunction
function SpellA1MX takes nothing returns nothing
local player PLY=GetOwningPlayer(GetTriggerUnit())
local integer LVL=GetUnitAbilityLevel(GetTriggerUnit(),'A1MX')
call SetPlayerState(PLY,PLAYER_STATE_RESOURCE_GOLD,(GetPlayerState(PLY,PLAYER_STATE_RESOURCE_GOLD)+LVL*50+50))
call DestroyEffect(AddSpecialEffectTarget("Abilities\\\\Spells\\\\Other\\\\Transmute\\\\PileofGold.mdl",GetTriggerUnit(),"origin"))
endfunction
function TriggerSpellA1MX takes nothing returns nothing
local trigger t=CreateTrigger()
call V0X(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(t,Condition(function IsSpellA1MX))
call TriggerAddAction(t,function SpellA1MX)
set t=CreateTrigger()
call V0X(t,EVENT_PLAYER_UNIT_SPELL_CAST)
call TriggerAddCondition(t,Condition(function IsSpellA1MX))
call TriggerAddAction(t,function CancelSpellA1MX)
set t=null
endfunction[/codes]
这是其中一个技能很多都是有特定场合的东西,比如函数名变量名之类,由于加密的关系不断在变
另外有一部分技能不适用这样的方法,比如狂战士,即使这样捕捉照样给你放出来……………… |
|