不好意思 我不是很清楚 但是我从basic13那摘抄了一部分 你可能看的懂
DOTA的技能均是比价复杂的,如果想使用DOTA的原版可以参考:
未加密图下载:
http://bbs.uuu9.com/viewthread.php?tid=563934
技能触发器:
1.// OpenDota 6.41 deprotected by NETRAT and DioD
// inspired by everyone who posted on forum threads and feedback page
// based on OpenDota 6.32b, deprotected by DimonT, NETRAT and TheBloodiest
// http://dimon.xgm.ru/opendota/
// Visit our modmaking community at http://xgm.ru/
// Objects used:
// 'A0LL' = Avalanche (Stone Giant : Tiny)
// 'e00E' = Spellcaster
// 'A0KG' = Avalanche (effect)
// DEBUG Trigger Number : 279
function Trig_Avalanche_Conditions takes nothing returns boolean
if(not(GetSpellAbilityId()=='A0LL'))then
return false
endif
return true
endfunction
function Trig_Avalanche_Actions takes nothing returns nothing
local location liD=GetUnitLoc(GetTriggerUnit())
call CreateNUnitsAtLoc(1,'e00E',GetOwningPlayer(GetTriggerUnit()),liD,bj_UNIT_FACING)
call RemoveLocation(liD)
call SetUnitInvulnerable(bj_lastCreatedUnit,true)
call ShowUnitHide(bj_lastCreatedUnit)
call UnitApplyTimedLifeBJ(10.,'BTLF',bj_lastCreatedUnit)
call UnitAddAbility(bj_lastCreatedUnit,'A0KG')
call SetUnitAbilityLevelSwapped('A0KG',bj_lastCreatedUnit,GetUnitAbilityLevel(GetTriggerUnit(),'A0LL'))
set liD=GetSpellTargetLoc()
call IssuePointOrderByIdLoc(bj_lastCreatedUnit,OrderId("clusterrockets"),liD)
call RemoveLocation(liD)
endfunction
function StartTrigger_Avalanche takes nothing returns nothing
set gg_trg_Avalanche=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Avalanche,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Avalanche,Condition(function Trig_Avalanche_Conditions))
call TriggerAddAction(gg_trg_Avalanche,function Trig_Avalanche_Actions)
endfunction
function InitTrig_Avalanche takes nothing returns nothing
endfunction
2.// OpenDota 6.41 deprotected by NETRAT and DioD
// inspired by everyone who posted on forum threads and feedback page
// based on OpenDota 6.32b, deprotected by DimonT, NETRAT and TheBloodiest
// http://dimon.xgm.ru/opendota/
// Visit our modmaking community at http://xgm.ru/
// Objects used:
// 'A0O0' = Beast Rage (Beastmaster : Rexxar)
// 'A0NZ' = Beast Rage
// DEBUG Trigger Number : 12
function SafeAddSpell takes unit pEU,integer pfV,integer pfw returns nothing
if GetUnitAbilityLevel(pEU,pfV)==0 then
call UnitAddAbility(pEU,pfV)
endif
call SetUnitAbilityLevel(pEU,pfV,pfw)
endfunction
function BeastRageMain takes nothing returns nothing
local unit lKg=GetAttacker()
local unit lFB=GetTriggerUnit()
local string lf5=H2Tx(lKg)
local unit lMd=GetUnit(lf5,"BeastRage|PreviousTarget")
local integer lMa=ReturnMax(GetInteger(lf5,"BeastRage|Counter"),0)
local integer lmZ=GetUnitAbilityLevel(lKg,'A0O0')
if lMd!=lFB then
set lMa=lMa/2
else
set lMa=ReturnMin(lMa+1,21)
endif
call SafeAddSpell(lKg,'A0NZ',lMa*lmZ)
call SetInteger(lf5,"BeastRage|Counter",lMa)
call SetHandle(lf5,"BeastRage|PreviousTarget",lFB)
call SetBoolean(lf5,"BeastRage|Wait",true)
call PolledWait(.4)
call SetBoolean(lf5,"BeastRage|Wait",false)
endfunction
function BeastRageCheck takes nothing returns boolean
return GetUnitAbilityLevel(GetAttacker(),'A0O0')>0 and GetBoolean(H2Tx(GetAttacker()),"BeastRage|Wait")==false and IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)==false
endfunction
function BeastRageInit takes nothing returns nothing
local trigger ltt=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(ltt,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(ltt,Condition(function BeastRageCheck))
call TriggerAddAction(ltt,function BeastRageMain)
call SpellPreload('A0NZ')
endfunction
function InitTrig_Beast_Rage takes nothing returns nothing
endfunction
3.// OpenDota 6.41 deprotected by NETRAT and DioD
// inspired by everyone who posted on forum threads and feedback page
// based on OpenDota 6.32b, deprotected by DimonT, NETRAT and TheBloodiest
// http://dimon.xgm.ru/opendota/
// Visit our modmaking community at http://xgm.ru/
// Objects used:
// 'A0DZ' = Backstab (Stealth Assassin : Rikimaru)
// DEBUG Trigger Number : 266
function BackStab_Roll takes nothing returns boolean
if((RAbsBJ((GetUnitFacing(GetTriggerUnit())-GetUnitFacing(GetAttacker())))<=105.))then
return true
endif
return false
endfunction
function Trig_Backstab_Conditions takes nothing returns boolean
if(IsUnitAlly(GetTriggerUnit(),GetOwningPlayer(GetAttacker())))then
return false
endif
if(not(GetUnitAbilityLevelSwapped('A0DZ',GetAttacker())>0))then
return false
endif
if(not(IsUnitType(GetTriggerUnit(),UNIT_TYPE_STRUCTURE)==false))then
return false
endif
if(not BackStab_Roll())then
return false
endif
return true
endfunction
function Trig_Backstab_Actions takes nothing returns nothing
local effect lkW=AddSpecialEffectTargetUnitBJ("chest",GetTriggerUnit(),"Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl")
call UnitDamageTargetBJ(GetAttacker(),GetTriggerUnit(),((.25*I2R(GetUnitAbilityLevelSwapped('A0DZ',GetAttacker())))*I2R(GetHeroStatBJ(1,GetAttacker(),true))),ATTACK_TYPE_HERO,DAMAGE_TYPE_NORMAL)
call DestroyEffect(lkW)
endfunction
function StartTrigger_Backstab takes nothing returns nothing
set gg_trg_Backstab=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Backstab,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(gg_trg_Backstab,Condition(function Trig_Backstab_Conditions))
call TriggerAddAction(gg_trg_Backstab,function Trig_Backstab_Actions)
endfunction
function InitTrig_Backstab takes nothing returns nothing
endfunction
4.// OpenDota 6.41 deprotected by NETRAT and DioD
// inspired by everyone who posted on forum threads and feedback page
// based on OpenDota 6.32b, deprotected by DimonT, NETRAT and TheBloodiest
// http://dimon.xgm.ru/opendota/
// Visit our modmaking community at http://xgm.ru/
// Objects used:
// 'A0L8' = Elune's Arrow (Priestess of the Moon : Mirana Nightshade)
// 'A04R' = Marker (Nether Ward 4,Lightning Bolter,Nether Ward 3,Nether Ward 2,Vengeance Death caster,...)
// 'e00E' = Spellcaster
// 'A0L7' = Basic Stun
// 'h005' = Elune's Arrow
// DEBUG Trigger Number : 55
function EluneArrowCheck takes nothing returns boolean
return GetSpellAbilityId()=='A0L8'
endfunction
function EluneArrowFilter takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(udg_u_DTAX_temp))and GetUnitAbilityLevel(GetFilterUnit(),'A04R')==0 and GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>1 and IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false
endfunction
function EluneArrowStunCalc takes real pX1,real pY1,real pX2,real pY2 returns integer
local real lDistance=SquareRoot((pX2-pX1)*(pX2-pX1)+(pY2-pY1)*(pY2-pY1))
return ReturnMin(R2I(lDistance/150),10)
endfunction
function EluneArrowTimer takes nothing returns nothing
local timer lMove=GetExpiredTimer()
local string lTable=H2Tx(lMove)
local unit lCaster=GetUnit(lTable,"Hero")
local unit lBolt=GetUnit(lTable,"Projectile")
local real lXL=GetReal(lTable,"TargetX")
local real lYL=GetReal(lTable,"TargetY")
local real lAngle=GetReal(lTable,"Angle")
local real lXX=GetUnitX(lBolt)
local real lYY=GetUnitY(lBolt)
local real lXN=SafeX(GetUnitX(lBolt)+30*Cos(lAngle))
local real lYN=SafeY(GetUnitY(lBolt)+30*Sin(lAngle))
local boolexpr lCheck=Condition(function EluneArrowFilter)
local group lEnumGroup=CreateGroup()
local unit lTemp
local unit lFirst
local real lXF
local real lYF
call SetUnitX(lBolt,lXN)
call SetUnitY(lBolt,lYN)
set udg_u_DTAX_temp=lCaster
call GroupEnumUnitsInRange(lEnumGroup,lXN,lYN,150,lCheck)
set lFirst=FirstOfGroup(lEnumGroup)
call DestroyGroup(lEnumGroup)
call DestroyBoolExpr(lCheck)
if lFirst!=null then
set lXF=GetReal(lTable,"OriginalX")
set lYF=GetReal(lTable,"OriginalY")
set lTemp=CreateUnit(GetOwningPlayer(lCaster),'e00E',lXX,lYY,0)
call UnitAddAbility(lTemp,'A0L7')
call SetUnitAbilityLevel(lTemp,'A0L7',EluneArrowStunCalc(lXF,lYF,lXX,lYY))
call IssueTargetOrderById(lTemp,OrderId("thunderbolt"),lFirst)
call UnitDamageTarget(lCaster,lFirst,90*GetUnitAbilityLevel(lCaster,'A0L8'),true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,WEAPON_TYPE_WHOKNOWS)
call KillUnit(lBolt)
call KillTimer(lMove)
elseif(lXN-lXL)*(lXN-lXL)+(lYN-lYL)*(lYN-lYL)<1600 then
call KillUnit(lBolt)
call KillTimer(lMove)
endif
endfunction
function EluneArrowAction takes nothing returns nothing
local unit lCaster=GetTriggerUnit()
local real lXX=SafeX(GetUnitX(lCaster))
local real lYY=SafeY(GetUnitY(lCaster))
local location lCastLoc=GetSpellTargetLoc()
local real lXL=GetLocationX(lCastLoc)
local real lYL=GetLocationY(lCastLoc)
local real lAngle=Atan2(lYL-lYY,lXL-lXX)
local timer lMove=CreateTimer()
local string lTable=H2Tx(lMove)
local unit lBolt=CreateUnit(GetOwningPlayer(lCaster),'h005',lXX,lYY,lAngle*bj_RADTODEG)
call RemoveLocation(lCastLoc)
call SetUnitFacing(lBolt,lAngle*bj_RADTODEG)
call SetUnitPathing(lBolt,false)
set lXL=SafeX(lXX+3000*Cos(lAngle))
set lYL=SafeY(lYY+3000*Sin(lAngle))
call SetReal(lTable,"OriginalX",lXX)
call SetReal(lTable,"OriginalY",lYY)
call SetReal(lTable,"TargetX",lXL)
call SetReal(lTable,"TargetY",lYL)
call SetReal(lTable,"Angle",lAngle)
call SetHandle(lTable,"Hero",lCaster)
call SetHandle(lTable,"Projectile",lBolt)
call TimerStart(lMove,.035,true,function EluneArrowTimer)
endfunction
function HJ takes nothing returns nothing
local trigger ltt=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(ltt,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(ltt,Condition(function EluneArrowCheck))
call TriggerAddAction(ltt,function EluneArrowAction)
call SpellPreload('A0L7')
endfunction
function InitTrig_Elune_Arrow takes nothing returns nothing
endfunction
5.// OpenDota 6.41 deprotected by NETRAT and DioD
// inspired by everyone who posted on forum threads and feedback page
// based on OpenDota 6.32b, deprotected by DimonT, NETRAT and TheBloodiest
// http://dimon.xgm.ru/opendota/
// Visit our modmaking community at http://xgm.ru/
// Objects used:
// 'A0DW' = Untouchable (Enchantress : Aiushtha)
// 'e00E' = Spellcaster
// 'A0B0' = Untouchable effect
// DEBUG Trigger Number : 44
function Untouchable_Spell takes nothing returns boolean
return GetUnitAbilityLevel(GetTriggerUnit(),'A0DW')>0
endfunction
function Untouchable_Main takes nothing returns nothing
local unit lJV=CreateUnit(GetOwningPlayer(GetTriggerUnit()),'e00E',GetUnitX(GetAttacker()),GetUnitY(GetAttacker()),0)
call UnitAddAbility(lJV,'A0B0')
call SetUnitAbilityLevel(lJV,'A0B0',GetUnitAbilityLevel(GetTriggerUnit(),'A0DW'))
call IssueTargetOrderById(lJV,OrderId("acidbomb"),GetAttacker())
endfunction
function Untouchable_Init takes nothing returns nothing
local trigger ltt=CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(ltt,EVENT_PLAYER_UNIT_ATTACKED)
call TriggerAddCondition(ltt,Condition(function Untouchable_Spell))
call TriggerAddAction(ltt,function Untouchable_Main)
endfunction
function InitTrig_Untouchable takes nothing returns nothing
endfunction