dota吧 关注:4,646,524贴子:155,326,378

回复:诈尸钓鱼帖:龟速直播翻新光环指南

只看楼主收藏回复


function L23 takes nothing returns boolean
local trigger t2=GetTriggeringTrigger()
local integer BBO=GetHandleId(t2)
local trigger t1=(LoadTriggerHandle(HY,(BBO),(274)))
local integer YF2=GetHandleId(t1)
local unit JTI=(LoadUnitHandle(HY,(BBO),(2)))
local unit JRI
local real d
local real a
local boolean L33=(LoadBoolean(HY,(BBO),(273)))
if(GetTriggerEventId()==EVENT_UNIT_DEATH and GetTriggerUnit()==JTI)or(GetTriggerEventId()!=EVENT_UNIT_DAMAGED and GetTriggerEventId()!=EVENT_UNIT_DEATH)then
call FlushChildHashtable(HY,(YF2))
call FlushChildHashtable(HY,(BBO))
call WTI(t1)
call WTI(t2)
elseif GetTriggerEventId()==EVENT_UNIT_DEATH then
if IsUnitIllusion(GetDyingUnit())==false then
call N1I(GetDyingUnit(),JTI,1747990361,"LO3",600)
endif
elseif L33==false then
set JRI=GetTriggerUnit()
set d=L9I(JTI,JRI)
if d<775 and GetEventDamage()>4 then
if LI3(JTI)then
set a=20+5*CUI
else
set a=15+5*CUI
endif
if d>200 then
set a=a-15*((d-150)/(775-150))
endif
call SaveBoolean(HY,(BBO),(273),(true))
call JSI(GetEventDamageSource(),GetTriggerUnit(),3,GetEventDamage()*a/100)
call SaveBoolean(HY,(BBO),(273),(false))
endif
endif
set t2=null
set t1=null
set JTI=null
set JRI=null
return false
endfunction
在其它函数的辅助下,若是尸王死亡触发事件则摧毁触发器t1、t2,若是非幻象敌人死亡则,根据距离由尸王对目标造成英雄攻击魔法伤害
function N1I takes unit JTI,unit JRI,integer NOI,string N2I,real MRI returns trigger
local trigger t=CreateTrigger()
local integer XII=GetHandleId(t)
local real L5I=GetUnitX(JTI)
local real L6I=GetUnitY(JTI)
local real N3I=GetUnitFacing(JTI)
call TriggerRegisterTimerEvent(t,0.03,true)
call TriggerAddCondition(t,Condition(function MSI))
call SaveReal(HY,(XII),(44),((MRI)*1.0))
call SaveInteger(HY,(XII),(30),(WVI(JRI)))
call SaveStr(HY,(XII),(46),(N2I))
call SaveInteger(HY,(XII),(43),(WVI(JTI)))
call SaveUnitHandle(HY,(XII),(45),(CreateUnit(GetOwningPlayer(JTI),NOI,L5I,L6I,N3I)))
set CK=t
set t=null
return CK
endfunction
function WVI takes unit u returns integer
set YY=YY+1
if YY>16000 then
set XY[YY-16000]=u
elseif YY>8000 then
set WY[YY-8000]=u
else
set VY[YY]=u
endif
return YY
endfunction
function MSI takes nothing returns boolean
local trigger t=GetTriggeringTrigger()
local integer XII=GetHandleId(t)
local integer K0I=(LoadInteger(HY,(XII),(30)))
local unit JRI=WHI(K0I)
local integer MTI=(LoadInteger(HY,(XII),(43)))
local unit JTI=WHI(MTI)
local real MRI=(LoadReal(HY,(XII),(44)))
local unit MPI=(LoadUnitHandle(HY,(XII),(45)))
local real x=GetUnitX(MPI)
local real y=GetUnitY(MPI)
local real L7I=GetUnitX(JRI)
local real L8I=GetUnitY(JRI)
local real MQI=MRI*0.03
local real MUI=LQI(x,y,L7I,L8I)
local real N0I=x+MQI*Cos(MUI*bj_DEGTORAD)
local real NII=y+MQI*Sin(MUI*bj_DEGTORAD)
call SetUnitX(MPI,N0I)
call SetUnitY(MPI,NII)
call SetUnitFacing(MPI,MUI)
if MNI(JRI)then
call KillUnit(MPI)
call WGI(K0I)
call FlushChildHashtable(HY,(XII))
call WTI(t)
elseif MBI(L7I,L8I,N0I,NII)<=MQI then
call KillUnit(MPI)
set IK=JTI
set OK=JRI
call ExecuteFunc((LoadStr(HY,(XII),(46))))
call WGI(K0I)
call FlushChildHashtable(HY,(XII))
call WTI(t)
endif
set t=null
set JRI=null
set JTI=null
set MPI=null
return false
endfunction
function WHI takes integer i returns unit
if i>16000 then
return XY[i-16000]
elseif i>8000 then
return WY[i-8000]
else
return VY[i]
endif
endfunction
function WGI takes integer i returns nothing
if i>16000 then
set XY[i-16000]=null
elseif i>8000 then
set WY[i-8000]=null
else
set VY[i]=null
endif
endfunction
function MNI takes unit u returns boolean
return GetUnitTypeId(u)<1 or IsUnitType(u,UNIT_TYPE_DEAD)==true
endfunction
以上是对目标死亡的函数


IP属地:山东47楼2012-07-16 11:24
回复

    unction L9I takes unit JTI,unit JRI returns real
    local real L5I=GetUnitX(JTI)
    local real L6I=GetUnitY(JTI)
    local real L7I=GetUnitX(JRI)
    local real L8I=GetUnitY(JRI)
    if JTI==null or JRI==null then
    return I2R(9999999999)
    else
    return SquareRoot((L5I-L7I)*(L5I-L7I)+(L6I-L8I)*(L6I-L8I))
    endif
    return 1.0
    endfunction
    这个函数判断尸王和目标是否死亡,或者两人的距离
    function LI3 takes unit XDI returns boolean
    if QVI(XDI,F50[YV0])!=null then
    return true
    endif
    return false
    endfunction
    function QVI takes unit XDI,integer LNI returns item
    local integer VXI
    local item LSI
    set VXI=0
    loop
    exitwhen VXI>5
    set LSI=UnitItemInSlot(XDI,VXI)
    if(LSI!=null)and(GetItemTypeId(LSI)==LNI)then
    set LSI=null
    return UnitItemInSlot(XDI,VXI)
    endif
    set VXI=VXI+1
    endloop
    set LSI=null
    return null
    endfunction
    以上两个函数判断是否有A杖
    function WTI takes trigger t returns nothing
    call DisableTrigger(t)
    set IJ=IJ+1
    set QY[IJ]=t
    set UY[IJ]=(TimerGetElapsed(M))+60
    if IJ>8000 then
    call WSI()
    endif
    endfunction
    摧毁触发器t
    function WSI takes nothing returns nothing
    local integer i=0
    if U2==false and SC0==false then
    loop
    call DisplayTimedTextToPlayer(Player(i),0,0,120,"|c00ff0303An internal checksum has failed|r")
    call DisplayTimedTextToPlayer(Player(i),0,0,120,"|c00ff0303This might not be a serious glitch, but it is important for me to get it|r")
    call DisplayTimedTextToPlayer(Player(i),0,0,120,"|c00ff0303Please send me the replay for this game to IceFrog@gmail.com|r")
    set i=i+1
    exitwhen i==12
    endloop
    endif
    endfunction
    以上应该是错误的自检程序,出现问题时会给玩家发消息致信IF报告数据
    function L13 takes nothing returns boolean
    local trigger t=GetTriggeringTrigger()
    local integer XII=GetHandleId(t)
    local unit JTI=(LoadUnitHandle(HY,(XII),(2)))
    local integer YRI=GetUnitAbilityLevel(JTI,1093743946)
    call SetUnitAbilityLevel(JTI,1093743947,YRI)
    call FlushChildHashtable(HY,(XII))
    call WTI(t)
    set t=null
    set JTI=null
    return false
    endfunction
    简而言之是使用技能后及时注册3个触发器。t3为发动技能效果0.01秒后设置瘟疫技能等级等于血肉傀儡技能等级,t1为进入尸王750范围区域


    IP属地:山东48楼2012-07-16 11:24
    回复
      2025-08-02 15:36:27
      广告
      不感兴趣
      开通SVIP免广告
      47楼就是没怎么弄懂的部分了,目测和根据距离改变移动速度有关系,似乎是用XY坐标做的。另外我至今没找见哪里是给尸王回血的


      IP属地:山东49楼2012-07-16 11:27
      回复
        标记一下


        IP属地:浙江来自手机贴吧50楼2012-07-16 11:30
        回复
          慢慢终于磕出来瘟疫了


          IP属地:山东51楼2012-07-21 17:18
          回复

            瘟疫
            A15K /1093743947
            code:AOae 耐久光环
            buffID:B0AI
            数值-0.09
            血肉傀儡
            A15J /1093743946
            function ZT1 takes nothing returns nothing
            local trigger t=CreateTrigger()
            call M8I(t,EVENT_PLAYER_UNIT_SPELL_EFFECT)
            call TriggerAddCondition(t,Condition(function L63))
            call KWI(1093743947)
            set t=null
            endfunction
            function KWI takes integer KXI returns nothing
            local unit u=CreateUnit(Player(15),1211117657,0,0,270)
            call UnitAddAbility(u,KXI)
            call UnitRemoveAbility(u,KXI)
            call RemoveUnit(u)
            set u=null
            endfunction
            又是注册任意单位发动技能效果事件,同时让傀儡单位预加载技能
            function L63 takes nothing returns boolean
            if GetSpellAbilityId()==1093743946 and GetUnitTypeId(GetTriggerUnit())==1211117650 then
            call L53()
            endif
            return false
            endfunction
            function L53 takes nothing returns nothing
            local unit JTI=GetTriggerUnit()
            local trigger t1=CreateTrigger()
            local integer YF2=GetHandleId(t1)
            local trigger t2=CreateTrigger()
            local integer BBO=GetHandleId(t2)
            local trigger t3=CreateTrigger()
            local integer K63=GetHandleId(t3)
            local integer YRI=GetUnitAbilityLevel(JTI,1093743946)
            set CUI=YRI
            call TriggerRegisterUnitInRange(t1,JTI,750,Condition(function VPI))
            call TriggerAddCondition(t1,Condition(function L43))
            call SaveTriggerHandle(HY,(YF2),(275),(t2))
            call SaveUnitHandle(HY,(YF2),(2),(JTI))
            call TriggerRegisterTimerEvent(t2,30,false)
            call TriggerRegisterUnitEvent(t2,JTI,EVENT_UNIT_DEATH)
            call TriggerAddCondition(t2,Condition(function L23))
            call SaveTriggerHandle(HY,(BBO),(274),(t1))
            call SaveUnitHandle(HY,(BBO),(2),(JTI))
            call SaveBoolean(HY,(BBO),(273),(false))
            call TriggerRegisterTimerEvent(t3,0.01,false)
            call TriggerAddCondition(t3,Condition(function L13))
            call SaveUnitHandle(HY,(K63),(2),(JTI))
            set JTI=null
            set t1=null
            set t2=null
            set t3=null
            endfunction
            注册3个触发器,触发器的大部分内容在下文的函数里,除了给t1注册单位进入尸王750范围内事件,t2注册30秒时间事件、单位死亡事件(尸王死亡),t3注册游戏时间过去0.01秒事件
            function VPI takes nothing returns boolean
            return true
            endfunction
            function L43 takes nothing returns boolean
            local trigger t1=GetTriggeringTrigger()
            local integer YF2=GetHandleId(t1)
            local trigger t2=(LoadTriggerHandle(HY,(YF2),(275)))
            local integer BBO=GetHandleId(t2)
            local unit JRI=GetTriggerUnit()
            local unit JTI=(LoadUnitHandle(HY,(YF2),(2)))
            if IsUnitEnemy(JTI,GetOwningPlayer(JRI))==true and IsUnitType(JRI,UNIT_TYPE_STRUCTURE)==false and GetUnitAbilityLevel(JRI,1093678162)==0 then
            if(LoadBoolean(HY,(BBO),(GetHandleId(JRI))))==false then
            call TriggerRegisterUnitEvent(t2,JRI,EVENT_UNIT_DAMAGED)
            call TriggerRegisterUnitEvent(t2,JRI,EVENT_UNIT_DEATH)
            call SaveBoolean(HY,(BBO),(GetHandleId(JRI)),(true))
            endif
            endif
            set t1=null
            set t2=null
            set JRI=null
            set JTI=null
            return false
            endfunction
            t1的实际功能,进入尸王750范围内的单位进过判断是敌人、不是建筑、没有标记技能A04R(免疫触发的那个技能)以后注册被伤害事件、死亡事件到t2


            IP属地:山东52楼2012-07-21 17:18
            回复

              function L23 takes nothing returns boolean
              local trigger t2=GetTriggeringTrigger()
              local integer BBO=GetHandleId(t2)
              local trigger t1=(LoadTriggerHandle(HY,(BBO),(274)))
              local integer YF2=GetHandleId(t1)
              local unit JTI=(LoadUnitHandle(HY,(BBO),(2)))
              local unit JRI
              local real d
              local real a
              local boolean L33=(LoadBoolean(HY,(BBO),(273))) 这个布尔值为false
              if(GetTriggerEventId()==EVENT_UNIT_DEATH and GetTriggerUnit()==JTI)or(GetTriggerEventId()!=EVENT_UNIT_DAMAGED and GetTriggerEventId()!=EVENT_UNIT_DEATH)then
              call FlushChildHashtable(HY,(YF2))
              call FlushChildHashtable(HY,(BBO))
              call WTI(t1)
              call WTI(t2) 尸王死亡摧毁t1、t2
              elseif GetTriggerEventId()==EVENT_UNIT_DEATH then
              if IsUnitIllusion(GetDyingUnit())==false then
              call N1I(GetDyingUnit(),JTI,1747990361,"LO3",600)
              endif
              elseif L33==false then
              set JRI=GetTriggerUnit()
              set d=L9I(JTI,JRI)
              if d<775 and GetEventDamage()>4 then 如果尸王和目标距离小于775且伤害值大于4
              if LI3(JTI)then
              set a=20+5*CUI
              else
              set a=15+5*CUI
              endif
              if d>200 then
              set a=a-15*((d-150)/(775-150))
              endif
              call SaveBoolean(HY,(BBO),(273),(true))
              call JSI(GetEventDamageSource(),GetTriggerUnit(),3,GetEventDamage()*a/100)
              call SaveBoolean(HY,(BBO),(273),(false))
              endif
              endif
              set t2=null
              set t1=null
              set JTI=null
              set JRI=null
              return false
              endfunction
              t2实际功能,在其它函数的辅助下,若是尸王死亡触发事件则摧毁触发器t1、t2,若是非幻象敌人死亡则运行函数N1I(鄙人愚钝,虽然废了老鼻子劲终于读出来了,但觉得这函数完全无蛋用~),都不是则根据距离由尸王对目标造成英雄攻击魔法伤害
              function N1I takes unit JTI,unit JRI,integer NOI,string N2I,real MRI returns trigger
              local trigger t=CreateTrigger() 创建触发器t
              local integer XII=GetHandleId(t)
              local real L5I=GetUnitX(JTI)
              local real L6I=GetUnitY(JTI)
              local real N3I=GetUnitFacing(JTI) 获得死亡单位X、Y坐标和面向角度
              call TriggerRegisterTimerEvent(t,0.03,true) 给t注册0.03秒事件
              call TriggerAddCondition(t,Condition(function MSI)) 添加条件函数MSI
              call SaveReal(HY,(XII),(44),((MRI)*1.0)) 存储实数600
              call SaveInteger(HY,(XII),(30),(WVI(JRI))) 存储整数,
              call SaveStr(HY,(XII),(46),(N2I))
              call SaveInteger(HY,(XII),(43),(WVI(JTI)))
              call SaveUnitHandle(HY,(XII),(45),(CreateUnit(GetOwningPlayer(JTI),NOI,L5I,L6I,N3I)))
              给死亡单位的所有者创建傀儡单位在死亡单位的X、Y坐标并面向死亡单位的面向角度
              set CK=t
              set t=null
              return CK
              endfunction
              function WVI takes unit u returns integer
              set YY=YY+1
              if YY>16000 then
              set XY[YY-16000]=u
              elseif YY>8000 then
              set WY[YY-8000]=u
              else
              set VY[YY]=u
              endif
              return YY
              endfunction
              function MSI takes nothing returns boolean
              local trigger t=GetTriggeringTrigger()
              local integer XII=GetHandleId(t)
              local integer K0I=(LoadInteger(HY,(XII),(30)))
              local unit JRI=WHI(K0I)
              local integer MTI=(LoadInteger(HY,(XII),(43)))
              local unit JTI=WHI(MTI)
              local real MRI=(LoadReal(HY,(XII),(44)))
              local unit MPI=(LoadUnitHandle(HY,(XII),(45)))
              local real x=GetUnitX(MPI)
              local real y=GetUnitY(MPI)
              local real L7I=GetUnitX(JRI)
              local real L8I=GetUnitY(JRI)
              local real MQI=MRI*0.03 600*0.03,就是18了
              local real MUI=LQI(x,y,L7I,L8I)
              local real N0I=x+MQI*Cos(MUI*bj_DEGTORAD)
              local real NII=y+MQI*Sin(MUI*bj_DEGTORAD)
              call SetUnitX(MPI,N0I)
              call SetUnitY(MPI,NII)
              call SetUnitFacing(MPI,MUI) 设置傀儡单位X、Y坐标为由傀儡单位向尸王移动18距离,面向尸王
              if MNI(JRI)then 如果尸王死亡
              call KillUnit(MPI)
              call WGI(K0I)
              call FlushChildHashtable(HY,(XII))
              call WTI(t) 排泄变量和哈希表,摧毁触发器t
              elseif MBI(L7I,L8I,N0I,NII)<=MQI then 如果傀儡单位单位和尸王距离小于等于18
              call KillUnit(MPI)
              set IK=JTI
              set OK=JRI
              call ExecuteFunc((LoadStr(HY,(XII),(46))))
              call WGI(K0I)
              call FlushChildHashtable(HY,(XII))
              call WTI(t)
              endif
              set t=null
              set JRI=null
              set JTI=null
              set MPI=null
              return falseendfunction


              IP属地:山东53楼2012-07-21 17:23
              回复

                function LQI takes real x1,real y1,real x2,real y2 returns real
                return bj_RADTODEG*Atan2(y2-y1,x2-x1)
                endfunction 获取(x1,y1)到(x2,y2)的角度
                function WHI takes integer i returns unit
                if i>16000 then
                return XY[i-16000]
                elseif i>8000 then
                return WY[i-8000]
                else
                return VY[i]
                endif
                endfunction
                这个函数配合上面的WVI函数在两个函数间通过传递一个整数变量完成单位变量的传递
                function WGI takes integer i returns nothing
                if i>16000 then
                set XY[i-16000]=null
                elseif i>8000 then
                set WY[i-8000]=null
                else
                set VY[i]=null
                endif
                endfunction
                排泄WHI、WVI函数使用的变量
                function MNI takes unit u returns boolean
                return GetUnitTypeId(u)<1 or IsUnitType(u,UNIT_TYPE_DEAD)==true
                endfunction
                一个返回布尔值的函数,如果单位不存在(被触发删除或尸体消失)或单位死亡则返回true,否则false
                function MBI takes real x1,real y1,real x2,real y2 returns real
                return SquareRoot(((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)))
                获取点(x1,y1),(x2,y2)的距离
                function L9I takes unit JTI,unit JRI returns real
                local real L5I=GetUnitX(JTI)
                local real L6I=GetUnitY(JTI)
                local real L7I=GetUnitX(JRI)
                local real L8I=GetUnitY(JRI)
                if JTI==null or JRI==null then
                return I2R(9999999999)
                else
                return SquareRoot((L5I-L7I)*(L5I-L7I)+(L6I-L8I)*(L6I-L8I))
                endif
                return 1.0
                endfunction
                这个函数判断尸王或目标是死亡则I2R(9999999999),或者两人的距离
                function LI3 takes unit XDI returns boolean
                if QVI(XDI,F50[YV0])!=null then
                return true
                endif
                return false
                endfunction
                function QVI takes unit XDI,integer LNI returns item
                local integer VXI
                local item LSI
                set VXI=0
                loop
                exitwhen VXI>5
                set LSI=UnitItemInSlot(XDI,VXI)
                if(LSI!=null)and(GetItemTypeId(LSI)==LNI)then
                set LSI=null
                return UnitItemInSlot(XDI,VXI)
                endif
                set VXI=VXI+1
                endloop
                set LSI=null
                return null
                endfunction以上两个函数判断是否有A杖


                IP属地:山东54楼2012-07-21 17:24
                回复
                  2025-08-02 15:30:27
                  广告
                  不感兴趣
                  开通SVIP免广告

                  function WTI takes trigger t returns nothing
                  call DisableTrigger(t)
                  set IJ=IJ+1
                  set QY[IJ]=t
                  set UY[IJ]=(TimerGetElapsed(M))+60
                  if IJ>8000 then
                  call WSI()
                  endif
                  endfunction
                  摧毁触发器t
                  function WSI takes nothing returns nothing
                  local integer i=0
                  if U2==false and SC0==false then
                  loop
                  call DisplayTimedTextToPlayer(Player(i),0,0,120,"|c00ff0303An internal checksum has failed|r")
                  call DisplayTimedTextToPlayer(Player(i),0,0,120,"|c00ff0303This might not be a serious glitch, but it is important for me to get it|r")
                  call DisplayTimedTextToPlayer(Player(i),0,0,120,"|c00ff0303Please send me the replay for this game to IceFrog@gmail.com|r")
                  set i=i+1
                  exitwhen i==12
                  endloop
                  endif
                  endfunction
                  以上应该是错误的自检程序,出现问题时会给玩家发消息致信IF报告数据
                  function L13 takes nothing returns boolean
                  local trigger t=GetTriggeringTrigger()
                  local integer XII=GetHandleId(t)
                  local unit JTI=(LoadUnitHandle(HY,(XII),(2)))
                  local integer YRI=GetUnitAbilityLevel(JTI,1093743946)
                  call SetUnitAbilityLevel(JTI,1093743947,YRI)
                  call FlushChildHashtable(HY,(XII))
                  call WTI(t)
                  set t=null
                  set JTI=null
                  return false
                  endfunction
                  设置尸王瘟疫等级等于血肉傀儡等级
                  简而言之是使用技能后及时注册3个触发器。t3为发动技能效果0.01秒后设置瘟疫技能等级等于血肉傀儡技能等级,t1为进入尸王750范围区域


                  IP属地:山东55楼2012-07-21 17:24
                  回复


                    56楼2012-07-21 17:29
                    回复
                      楼上发现个问题,function N1I里给t注册的0.03秒事件是周期性的,所以每0.03秒就会触发一次。这样说来似乎是用来使傀儡单位h07Y1向尸王聚集的函数。至于h07Y是什么,貌似是个死亡缠绕模型的马甲,提供视觉效果的。理论上说在这马甲挂了以后尸王会回血的,但我没找见函数
                      


                      IP属地:山东57楼2012-07-21 18:14
                      回复
                        终于找见了……
                        elseif MBI(L7I,L8I,N0I,NII)<=MQI then 如果傀儡单位单位和尸王距离小于等于18
                        call KillUnit(MPI) 杀死傀儡
                        set IK=JTI
                        set OK=JRI
                        call ExecuteFunc((LoadStr(HY,(XII),(46)))) 执行函数LO3
                        function LO3 takes nothing returns nothing
                        if IsUnitType(IK,UNIT_TYPE_HERO)==true then
                        if LI3(OK)then
                        call SetUnitState(OK,UNIT_STATE_LIFE,GetUnitState(OK,UNIT_STATE_LIFE)+GetUnitState(OK,UNIT_STATE_MAX_LIFE)*0.10)
                        else
                        call SetUnitState(OK,UNIT_STATE_LIFE,GetUnitState(OK,UNIT_STATE_LIFE)+GetUnitState(OK,UNIT_STATE_MAX_LIFE)*0.06)
                        endif
                        else
                        if LI3(OK)then
                        call SetUnitState(OK,UNIT_STATE_LIFE,GetUnitState(OK,UNIT_STATE_LIFE)+GetUnitState(OK,UNIT_STATE_MAX_LIFE)*0.03)
                        else
                        call SetUnitState(OK,UNIT_STATE_LIFE,GetUnitState(OK,UNIT_STATE_LIFE)+GetUnitState(OK,UNIT_STATE_MAX_LIFE)*0.02)
                        endif
                        endif
                        endfunction
                        设置生命值给尸王回血


                        IP属地:山东58楼2012-07-21 18:21
                        回复
                          野性驱使
                          A03E/1093677893
                          AOae 耐久光环
                          player,self 玩家单位,自己 (即狼人玩家控制的所有单位)
                          function U93 takes nothing returns boolean
                          if GetLearnedSkill()==1093677893 and IsUnitIllusion(GetTriggerUnit())==false then
                          call U83()
                          endif
                          return false
                          endfunction
                          非幻象学习野性驱使
                          function U83 takes nothing returns nothing
                          local unit X9I=GetTriggerUnit()
                          local integer YRI=GetUnitAbilityLevel(X9I,1093677893)
                          local unit P4I
                          local trigger t
                          local integer XII
                          if YRI==1 then 如果学习的是一级技能
                          set P4I=CreateUnit(GetOwningPlayer(X9I),1697657174,0,0,0) 给狼人的玩家创建一个傀儡
                          call MLI(P4I,1093687882) 给傀儡添加命令光环并设置永久性
                          call SaveUnitHandle(HY,(GetHandleId(X9I)),(219),(P4I))
                          set t=CreateTrigger()
                          set XII=GetHandleId(t)
                          call TriggerAddCondition(t,Condition(function U73))
                          call TriggerRegisterTimerEvent(t,0.2,true)
                          call SaveUnitHandle(HY,(XII),(2),(X9I))
                          call SaveUnitHandle(HY,(XII),(19),(P4I))
                          else
                          set P4I=(LoadUnitHandle(HY,(GetHandleId(X9I)),(219)))
                          endif
                          if YRI==2 then
                          call UnitRemoveAbility(P4I,1093687882)
                          call MLI(P4I,1093687881)
                          elseif YRI==3 then
                          call UnitRemoveAbility(P4I,1093687882)
                          call UnitRemoveAbility(P4I,1093687881)
                          call MLI(P4I,1093687880)
                          elseif YRI==4 then
                          call UnitRemoveAbility(P4I,1093687882)
                          call UnitRemoveAbility(P4I,1093687881)
                          call UnitRemoveAbility(P4I,1093687880)
                          call MLI(P4I,1093687879)
                          endif
                          set X9I=null
                          set P4I=null
                          endfunction
                          学习1级技能则创建傀儡,每0.2秒将其设置到狼人的坐标,1级以上根据等级添加、移除傀儡对应的命令光环
                          function U73 takes nothing returns boolean
                          local trigger t=GetTriggeringTrigger()
                          local integer XII=GetHandleId(t)
                          local unit P4I=(LoadUnitHandle(HY,(XII),(19)))
                          local unit JTI=(LoadUnitHandle(HY,(XII),(2)))
                          if P4I!=null and GetUnitTypeId(P4I)==1697657174 then
                          if MNI(JTI)==false then
                          call SetUnitX(P4I,GetUnitX(JTI))
                          call SetUnitY(P4I,GetUnitY(JTI))
                          endif
                          endif
                          set t=null
                          set P4I=null
                          set JTI=null
                          return false
                          endfunction
                          设置傀儡单位到狼人的坐标
                          function MNI takes unit u returns boolean
                          return GetUnitTypeId(u)<1 or IsUnitType(u,UNIT_TYPE_DEAD)==true
                          endfunction
                          function MLI takes unit X9I,integer MMI returns nothing
                          call UnitAddAbility(X9I,MMI)
                          call UnitMakeAbilityPermanent(X9I,true,MMI)
                          endfunction
                          以上是两个脸熟函数,前者判断是不是死了,后者加技能并设置永久性
                          另外,根据函数推测并根据测试证实,狼人死后在他的死亡地仍有傀儡的命令光环


                          IP属地:山东59楼2012-07-21 18:50
                          回复
                            技术帖啊,就是看不懂


                            来自手机贴吧60楼2012-07-22 08:56
                            收起回复
                              2025-08-02 15:24:27
                              广告
                              不感兴趣
                              开通SVIP免广告
                              好久不见…


                              IP属地:天津来自掌上百度61楼2012-07-22 09:04
                              收起回复