|
Jass代码如下:
function IsSpellA1MX takes nothing returns boolean
local player PLY=GetOwningPlayer(GetTriggerUnit())
local integer LVL=GetUnitAbilityLevel(GetTriggerUnit(),'A1MX')
return ((GetSpellAbilityId()=='A1MX')and(GetPlayerState(PLY,PLAYER_STATE_RESOURCE_GOLD)>=LVL*100+400))
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_CAST)
call TriggerAddCondition(t,Condition(function IsSpellA1MX))
call TriggerAddAction(t,function SpellA1MX)
set t=null
endfunction
技能说明:
技能代码为A1MX,原型为AHtc(其他相关的SLK文件已经写好了),V0X为DotA作者编写好的注册触发器函数。
当施放该技能时,如果玩家英雄身上的金钱大于500/600/700/800,则自动增加金钱100/150/200/250.
不过有个问题,就是在DotA里,使用该技能后,技能会耗魔,会进入冷却时间,但就是没有效果,玩家英雄身上不增加金钱,头上也没有冒金币,不知为啥...
PS:另外问一下,函数TriggerRegisterAnyUnitEvent和TriggerRegisterAnyUnitEventBJ、函数UnitDamageTarget和UnitDamageTargetBJ有什么区别?
高人求助啊,有重谢!!!
函数V0X代码为:
function V0X takes trigger t,playerunitevent V1X returns nothing
local integer MLV=0
loop
call TriggerRegisterPlayerUnitEvent(t,Player(MLV),V1X,null)
set MLV=MLV+1
exitwhen MLV==16
endloop
endfunction |
|