|
当移植肉钩子时,会出现20个错误。
[jass]function Trig_Butcher_Hook_GetTimerIndex takes timer t returns integer
local integer i = 0
loop
exitwhen i>=200
if t!=null then
if udg_Butcher_Hook_Timer==t then
return i
endif
else
if udg_Butcher_Hook_Timer==null then
set udg_Butcher_Hook_Timer = CreateTimer()
return i
endif
endif
set i = i + 1
endloop
set udg_Butcher_Hook_Timer[0] = null
return 0
endfunction
function Trig_Butcher_Hook_Group_Conditions takes nothing returns boolean
return (IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false)and(GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>0.00)
endfunction
function Trig_Butcher_Hook_Loop takes nothing returns nothing
local integer timerIndex = Trig_Butcher_Hook_GetTimerIndex(GetExpiredTimer()) * 40
local integer hookLength = R2I(udg_Butcher_Hook_Real[timerIndex+3])
local integer index = 1
local real a = 0.00
local real x = 0.00
local real y = 0.00
local group g = null
if udg_Butcher_Hook_Real[timerIndex+2]==0.00 then
set hookLength = hookLength + 1
set udg_Butcher_Hook_Unit[timerIndex+hookLength+1] = udg_Butcher_Hook_Unit[timerIndex]
if(hookLength>1)then
set a = GetAngleSP(GetUnitX(udg_Butcher_Hook_Unit[timerIndex]),GetUnitY(udg_Butcher_Hook_Unit[timerIndex]),GetUnitX(udg_Butcher_Hook_Unit[timerIndex+hookLength-1]),GetUnitY(udg_Butcher_Hook_Unit[timerIndex+hookLength-1]))
set udg_Butcher_Hook_Unit[timerIndex+hookLength] = CreateUnit(Player(0),'e00L',GetUnitX(udg_Butcher_Hook_Unit[timerIndex]),GetUnitY(udg_Butcher_Hook_Unit[timerIndex]),a)
else
set a = udg_Butcher_Hook_Real[timerIndex]
set udg_Butcher_Hook_Unit[timerIndex+hookLength] = CreateUnit(Player(0),'e00L',GetUnitX(udg_Butcher_Hook_Unit[timerIndex]),GetUnitY(udg_Butcher_Hook_Unit[timerIndex]),a)
call SetUnitVertexColor(udg_Butcher_Hook_Unit[timerIndex+hookLength],255,55,55,255)
endif
loop
exitwhen index>hookLength
if(index==1)then
set a = udg_Butcher_Hook_Real[timerIndex]
set x = GetDisplacementXSP(GetUnitX(udg_Butcher_Hook_Unit[timerIndex+index]),30.0,a)
set y = GetDisplacementYSP(GetUnitY(udg_Butcher_Hook_Unit[timerIndex+index]),30.0,a)
else
set a = GetAngleSP(GetUnitX(udg_Butcher_Hook_Unit[timerIndex+index]),GetUnitY(udg_Butcher_Hook_Unit[timerIndex+index]),GetUnitX(udg_Butcher_Hook_Unit[timerIndex+index-1]),GetUnitY(udg_Butcher_Hook_Unit[timerIndex+index-1]))
set x = GetDisplacementXSP(GetUnitX(udg_Butcher_Hook_Unit[timerIndex+index-1]),25.0,a+180.0)
set y = GetDisplacementYSP(GetUnitY(udg_Butcher_Hook_Unit[timerIndex+index-1]),25.0,a+180.0)
endif
call SetUnitX(udg_Butcher_Hook_Unit[timerIndex+index],x)
call SetUnitY(udg_Butcher_Hook_Unit[timerIndex+index],y)
call SetUnitFacing(udg_Butcher_Hook_Unit[timerIndex+index],a)
set index = index + 1
endloop
set index = hookLength
loop
exitwhen index <= 0
set a = GetAngleSP(GetUnitX(udg_Butcher_Hook_Unit[timerIndex+index+1]),GetUnitY(udg_Butcher_Hook_Unit[timerIndex+index+1]),GetUnitX(udg_Butcher_Hook_Unit[timerIndex+index]),GetUnitY(udg_Butcher_Hook_Unit[timerIndex+index]))
set x = GetDisplacementXSP(GetUnitX(udg_Butcher_Hook_Unit[timerIndex+index+1]),25.0,a)
set y = GetDisplacementYSP(GetUnitY(udg_Butcher_Hook_Unit[timerIndex+index+1]),25.0,a)
call SetUnitX(udg_Butcher_Hook_Unit[timerIndex+index],x)
call SetUnitY(udg_Butcher_Hook_Unit[timerIndex+index],y)
call SetUnitFacing(udg_Butcher_Hook_Unit[timerIndex+index],a)
if(index==1 and udg_Butcher_Hook_Real[timerIndex+4]==0.00)then
set g = CreateGroup()
call GroupEnumUnitsInRange(g,GetUnitX(udg_Butcher_Hook_Unit[timerIndex+1]),GetUnitY(udg_Butcher_Hook_Unit[timerIndex+1]),88.00,Condition(function Trig_Butcher_Hook_Group_Conditions))
call GroupRemoveUnit(g,udg_Butcher_Hook_Unit[timerIndex])
set udg_Butcher_Hook_Unit[timerIndex+38] = FirstOfGroup(g)
call DestroyGroup(g)
if IsUnitType(udg_Butcher_Hook_Unit[timerIndex+38],UNIT_TYPE_MAGIC_IMMUNE) and IsUnitAlly(udg_Butcher_Hook_Unit[timerIndex],GetOwningPlayer(udg_Butcher_Hook_Unit[timerIndex+38]))==false then
if GetRandomInt(0,1)==0 then
set udg_Butcher_Hook_Real[timerIndex+4] = GetRandomReal(-90.0,-70.0)
else
set udg_Butcher_Hook_Real[timerIndex+4] = GetRandomReal(70.0,90.0)
endif
call DestroyEffect( AddSpecialEffectTarget("Abilities\\Spells\\Items\\SpellShieldAmulet\\SpellShieldCaster.mdl",udg_Butcher_Hook_Unit[timerIndex+38], "origin") )
set udg_Butcher_Hook_Real[timerIndex] = GetUnitFacing(udg_Butcher_Hook_Unit[timerIndex+1])+udg_Butcher_Hook_Real[timerIndex+4]
set udg_Butcher_Hook_Unit[timerIndex+38] = null
elseif IsUnitAlly(udg_Butcher_Hook_Unit[timerIndex],GetOwningPlayer(udg_Butcher_Hook_Unit[timerIndex+38]))==false then
call DestroyEffect( AddSpecialEffectTarget("Objects\\Spawnmodels\\Naga\\NagaBlood\\NagaBloodWindserpent.mdl",udg_Butcher_Hook_Unit[timerIndex+38], "chest") )
call DestroyEffect( AddSpecialEffectTarget("Objects\\Spawnmodels\\NightElf\\NightElfBlood\\NightElfBloodDruidoftheClaw.mdl",udg_Butcher_Hook_Unit[timerIndex+38], "chest") )
call DestroyEffect( AddSpecialEffectTarget("Abilities\\Spells\\Other\\Stampede\\StampedeMissileDeath.mdl",udg_Butcher_Hook_Unit[timerIndex+38], "chest") )
call UnitDamageTarget(udg_Butcher_Hook_Unit[timerIndex],udg_Butcher_Hook_Unit[timerIndex+38],udg_Butcher_Hook_Real[timerIndex+1]*100.0, true, false, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_METAL_MEDIUM_SLICE )
endif
set g = null
endif
set index = index - 1
endloop
if hookLength>=R2I(udg_Butcher_Hook_Real[timerIndex+1])*5+17 or udg_Butcher_Hook_Unit[timerIndex+38]!=null then
set udg_Butcher_Hook_Real[timerIndex+2] = 1.0
endif
else
call RemoveUnit(udg_Butcher_Hook_Unit[timerIndex+hookLength])
set hookLength = hookLength - 1
set udg_Butcher_Hook_Unit[timerIndex+hookLength+1] = udg_Butcher_Hook_Unit[timerIndex]
set index = hookLength
loop
exitwhen index<1
if(index>0)then
set a = GetAngleSP(GetUnitX(udg_Butcher_Hook_Unit[timerIndex+index+1]),GetUnitY(udg_Butcher_Hook_Unit[timerIndex+index+1]),GetUnitX(udg_Butcher_Hook_Unit[timerIndex+index]),GetUnitY(udg_Butcher_Hook_Unit[timerIndex+index]))
set x = GetDisplacementXSP(GetUnitX(udg_Butcher_Hook_Unit[timerIndex+index+1]),25.0,a)
set y = GetDisplacementYSP(GetUnitY(udg_Butcher_Hook_Unit[timerIndex+index+1]),25.0,a)
call SetUnitX(udg_Butcher_Hook_Unit[timerIndex+index],x)
call SetUnitY(udg_Butcher_Hook_Unit[timerIndex+index],y)
call SetUnitFacing(udg_Butcher_Hook_Unit[timerIndex+index],a)
if index==1 and udg_Butcher_Hook_Unit[timerIndex+38]!=null and udg_Butcher_Hook_Unit[timerIndex+38]!=udg_Butcher_Hook_Unit[timerIndex] then
call SetUnitX(udg_Butcher_Hook_Unit[timerIndex+38],GetUnitX(udg_Butcher_Hook_Unit[timerIndex+1]))
call SetUnitY(udg_Butcher_Hook_Unit[timerIndex+38],GetUnitY(udg_Butcher_Hook_Unit[timerIndex+1]))
endif
endif
set index = index - 1
endloop
endif
if(hookLength<1)then
set udg_Butcher_Hook_Unit[timerIndex+38] = null
call PauseTimer(udg_Butcher_Hook_Timer[timerIndex/40])
set udg_Butcher_Hook_Timer[timerIndex/40] = null
else
set udg_Butcher_Hook_Real[timerIndex+3] = hookLength
endif
endfunction
function Trig_Butcher_Hook_Actions takes nothing returns nothing
local integer timerIndex = Trig_Butcher_Hook_GetTimerIndex(null)
local real a = GetAngleSP(GetUnitX(GetTriggerUnit()),GetUnitY(GetTriggerUnit()),GetSpellTargetX(),GetSpellTargetY()) | call TimerStart(udg_Butcher_Hook_Timer[timerIndex],0.027,true,function Trig_Butcher_Hook_Loop)
set timerIndex = timerIndex * 40
set udg_Butcher_Hook_Real[timerIndex+0] = a
set udg_Butcher_Hook_Real[timerIndex+1] = GetUnitAbilityLevel(GetTriggerUnit(),GetSpellAbilityId())
set udg_Butcher_Hook_Real[timerIndex+2] = 0.00
set udg_Butcher_Hook_Real[timerIndex+3] = 0.00
set udg_Butcher_Hook_Real[timerIndex+4] = 0.00
set udg_Butcher_Hook_Unit[timerIndex+0] = GetTriggerUnit()
endfunction
function Trig_Butcher_Hook_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A016'
endfunction
//===========================================================================
function InitTrig_Hook takes nothing returns nothing
set gg_trg_Hook = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Hook, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Hook, Condition( function Trig_Butcher_Hook_Conditions ) )
call TriggerAddAction( gg_trg_Hook, function Trig_Butcher_Hook_Actions )
endfunction][/jass]
蓝字的都错,鱼妹的问下错在哪?
|
|