伤害函数在这里
//伤害函数1.0
function ShanaSistemOfDamage takes unit u,unit target,real value,integer ty,real zzf returns nothing
local real dam
local attacktype atty
local damagetype daty
local string Ps=""
local texttag tag1
local texttag tag2
local integer R
local integer G
local integer B
local real Si=0.00
if ty==0 or ty==3 then
set dam=value
set udg_ABDamHit[GetConvertedPlayerId(GetOwningPlayer(u))]=value
set R=255
set G=10
set B=10
set atty=ATTACK_TYPE_HERO
if ty==0 then
set daty=DAMAGE_TYPE_NORMAL
else
set daty=DAMAGE_TYPE_ENHANCED
endif
else
if ty!=5 then
if (((udg_MagicDamPer[GetConvertedPlayerId(GetOwningPlayer(u))]>0)and(GetRandomInt(1,100)<=udg_MagicDamPer[GetConvertedPlayerId(GetOwningPlayer(u))]))) then
set dam=I2R(udg_MagicDamEX[GetConvertedPlayerId(GetOwningPlayer(u))])*zzf+value*udg_MagicDamMul[GetConvertedPlayerId(GetOwningPlayer(u))]
set Ps="!"
set Si=8.00
else
set dam=I2R(udg_MagicDamEX[GetConvertedPlayerId(GetOwningPlayer(u))])*zzf+value
endif
if ty==1 or ty==2 then
set dam=dam*(1-udg_MagicResistPer[GetConvertedPlayerId(GetOwningPlayer(u))])
set atty=ATTACK_TYPE_NORMAL
if ty==1 then
set daty=DAMAGE_TYPE_MAGIC
set R=10
set G=10
set B=255
else
set daty=DAMAGE_TYPE_NORMAL
set R=255
set G=10
set B=255
endif
else
set atty=ATTACK_TYPE_HERO
set daty=DAMAGE_TYPE_MAGIC
set R=10
set G=10
set B=255
endif
//法术吸血
call MakeUnitLife(u,true,dam*udg_AbsorbValueAT[GetConvertedPlayerId(GetOwningPlayer(u))],null)
call YDWETimerDestroyEffect(2.00,AddSpecialEffectTarget("Abilities\\Spells\\Undead\\VampiricAura\\VampiricAuraTarget.mdl",GetEventDamageSource(),"origin"))
else
set atty=ATTACK_TYPE_HERO
set daty=DAMAGE_TYPE_UNIVERSAL
set R=254
set G=186
set B=14
endif
endif
call UnitDamageTarget(u,target,dam,false,false,atty,daty,WEAPON_TYPE_WHOKNOWS)
//漂浮文字
if GetOwningPlayer(u) == GetLocalPlayer() then
set tag1=CreateTextTag()
call SetTextTagTextBJ(tag1,I2S(R2I(dam))+Ps,(12.00+Si))
call SetTextTagColor(tag1,R,G,B,235)
call SetTextTagPos(tag1,GetUnitX(target),GetUnitY(target),80.00)
call SetTextTagVelocityBJ(tag1,70.00,YDWER2Deg(GetRandomReal(40.00, 140.00)))
call SetTextTagPermanent(tag1,false)
call SetTextTagLifespan(tag1,4.00)
call SetTextTagFadepoint(tag1,2.00)
elseif GetOwningPlayer(target) == GetLocalPlayer() then
set tag2=CreateTextTag()
call SetTextTagTextBJ(tag2,I2S(R2I(dam)),12.00)
call SetTextTagPos(tag2,GetUnitX(target),GetUnitY(target),80.00)
call SetTextTagColor(tag2,100,100,100,235)
call SetTextTagVelocityBJ(tag2,70.00,YDWER2Deg(GetRandomReal(40.00, 140.00)))
call SetTextTagPermanent(tag2,false)
call SetTextTagLifespan(tag2,4.00)
call SetTextTagFadepoint(tag2,2.00)
endif
set tag1=null
set tag2=null
endfunction
//0为物理,1为魔法,2为混合,3为物理穿透,4为魔法穿透,5为完全
我今天还要修正一下关于漂浮文字的函数段~
2012年10月02日 05点10分
7