W3XMASTER打开W3X地图,解压WAR3MAP.J文件,用记事本或者JassShopPro
globals里添加
unit gg_my=null
trigger smy=CreateTrigger()
在endglobals后添加下面的3个函数
function xx1 takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(),'A05J')>0
endfunction
//A05J是技能名,WE里可以CTRL+D找,最好根据一个被动技能(用WE把效果都失效)来新建
function xx2 takes nothing returns nothing
set gg_my=GetTriggerUnit()
call DestroyEffect(AddSpecialEffectLoc("Abilities//Spells//Human//MarkOfChaos//MarkOfChaosTarget.mdl",GetUnitLoc(GetAttacker())))
call DestroyEffect(AddSpecialEffectTarget("Abilities//Spells//NightElf//Starfall//StarfallTarget.mdl",GetAttacker(),"origin"))
call UnitDamageTargetBJ(gg_my,GetAttacker(),8*GetHeroStatBJ(bj_HEROSTAT_INT,gg_my,false),ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
call AdjustPlayerStateBJ( 100,GetOwningPlayer(gg_my), PLAYER_STATE_RESOURCE_GOLD)
endfunction
//8倍智力伤害(伤害为普通,类型为英雄,可以改成混乱,换成DAMAGE_TYPE_MAGIC后无伤害..费解(魔法伤害)
function xxx takes nothing returns nothing
call TriggerRegisterAnyUnitEventBJ(smy,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(smy,Condition(function xx1))
call TriggerAddAction(smy,function xx2)
endfunction
最后在MAIN里
call xxx()就可以了
有问题留言