You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

888 lines
20 KiB

--------------------------------------------------------------------------------
-- <EFBFBD><EFBFBD> DummyRoutineFunc
--------------------------------------------------------------------------------
function DummyRoutineFunc( )
cExecCheck "DummyRoutineFunc"
end
--------------------------------------------------------------------------------
-- <EFBFBD><EFBFBD> PlayerMapLogin
--------------------------------------------------------------------------------
function PlayerMapLogin( MapIndex, Handle )
cExecCheck "PlayerMapLogin"
if MapIndex == nil
then
DebugLog( "PlayerMapLogin::MapIndex == nil")
return
end
if Handle == nil
then
DebugLog( "PlayerMapLogin::Handle == nil")
return
end
local Var = InstanceField[ MapIndex ]
if Var == nil
then
DebugLog( "PlayerMapLogin::Var == nil")
return
end
-- ù <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD>α<EFBFBD><EFBFBD><EFBFBD> üũ
Var["bPlayerMapLogin"] = true
end
--------------------------------------------------------------------------------
-- <EFBFBD><EFBFBD> Routine_BossLive
--------------------------------------------------------------------------------
function Routine_BossLive( Handle, MapIndex )
cExecCheck "Routine_BossLive"
if Handle == nil
then
ErrorLog( "Routine_BossLive::Handle == nil" )
return ReturnAI["END"]
end
if MapIndex == nil
then
ErrorLog( "Routine_BossLive::MapIndex == nil" )
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
local Var = InstanceField[ MapIndex ]
if Var == nil
then
ErrorLog( "Routine_BossLive::Var == nil" )
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
-- 0.2<EFBFBD>ʸ<EFBFBD><EFBFBD><EFBFBD> üũ<EFBFBD>ϴ<EFBFBD> <EFBFBD><EFBFBD>ƾ
if Var["RoutineTime"][ Handle ] <= cCurrentSecond()
then
Var["RoutineTime"][ Handle ] = cCurrentSecond() + 0.2
else
return ReturnAI["CPP"]
end
return ReturnAI["CPP"]
end
--------------------------------------------------------------------------------
-- <EFBFBD><EFBFBD> Routine_BossDead
--------------------------------------------------------------------------------
function Routine_BossDead( MapIndex, AttackerHandle, Handle )
cExecCheck "Routine_BossDead"
DebugLog("Routine_BossDead::<EFBFBD><EFBFBD>ƾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
-- <EFBFBD>Լ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
if Handle == nil
then
ErrorLog( "Routine_Guard::Handle == nil" )
return ReturnAI["END"]
end
if MapIndex == nil
then
ErrorLog( "Routine_Guard::MapIndex == nil" )
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
DebugLog("Routine_BossDead::MapIndex :"..MapIndex )
-- <EFBFBD>ʵ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
local Var = InstanceField[ MapIndex ]
if Var == nil
then
ErrorLog( "Routine_Guard::Var == nil"..MapIndex )
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
local CurDoor = Var["Boss"][Handle]["Door"]
if CurDoor["IsOpen"] == false
then
CurDoor["IsOpen"] = true
cAIScriptSet( Handle )
end
return ReturnAI["END"]
end
--------------------------------------------------------------------------------
-- <EFBFBD><EFBFBD> Routine_Leviathan
--------------------------------------------------------------------------------
function Routine_Leviathan( Handle, MapIndex )
cExecCheck "Routine_Leviathan"
-- <EFBFBD>Լ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
if Handle == nil
then
ErrorLog( "Routine_Leviathan::Handle == nil" )
return ReturnAI["END"]
end
if MapIndex == nil
then
ErrorLog( "Routine_Leviathan::MapIndex == nil" )
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
-- <EFBFBD>ʵ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
local Var = InstanceField[ MapIndex ]
if Var == nil
then
ErrorLog( "Routine_Leviathan::Var == nil"..MapIndex )
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
if Var["Routine_Leviathan"] == nil
then
Var["Routine_Leviathan"] = {}
ErrorLog("Routine_Leviathan::<EFBFBD><EFBFBD><EFBFBD>̺<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
end
local CurSkillInfo = LeviathanSkillInfo["Routine_Leviathan"]
local CurHP, MaxHP = cObjectHP( Handle )
local CurHPRate = ( CurHP / MaxHP ) * 100
if CurHPRate < CurSkillInfo["HPRateToRegenEgg"]
then
if Var["Routine_Leviathan"][Handle] == nil
then
Var["Routine_Leviathan"][Handle] = {}
Var["Routine_Leviathan"][Handle]["GuardianEgg"] = {}
Var["Routine_Leviathan"][Handle]["GuardEgg"] = {}
Var["Routine_Leviathan"][Handle]["BuffEgg"] = {}
-- GuardianEgg <EFBFBD><EFBFBD><EFBFBD>̺<EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ
Var["Routine_Leviathan"][Handle]["GuardianEgg"]["RegenTick"] = Var["CurSec"] + CurSkillInfo["GuardianEgg"]["RegenTick"]
Var["Routine_Leviathan"][Handle]["GuardianEgg"]["RegenMob"] = CurSkillInfo["GuardianEgg"]["RegenMob"]
Var["Routine_Leviathan"][Handle]["GuardianEgg"]["RegenMaxCount"] = 0
-- GuardEgg <EFBFBD><EFBFBD><EFBFBD>̺<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ
Var["Routine_Leviathan"][Handle]["GuardEgg"]["RegenTick"] = Var["CurSec"] + CurSkillInfo["GuardEgg"]["RegenTick"]
Var["Routine_Leviathan"][Handle]["GuardEgg"]["RegenMob"] = CurSkillInfo["GuardEgg"]["RegenMob"]
Var["Routine_Leviathan"][Handle]["GuardEgg"]["RegenMaxCount"] = 0
-- BuffEgg <EFBFBD><EFBFBD><EFBFBD>̺<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ
Var["Routine_Leviathan"][Handle]["BuffEgg"]["RegenTick"] = Var["CurSec"] + CurSkillInfo["BuffEgg"]["RegenTick"]
Var["Routine_Leviathan"][Handle]["BuffEgg"]["RegenMob"] = CurSkillInfo["BuffEgg"]["RegenMob"]
Var["Routine_Leviathan"][Handle]["BuffEgg"]["RegenMaxCount"] = 0
ErrorLog("Routine_Leviathan::<EFBFBD><EFBFBD><EFBFBD>̺<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ")
end
end
-- HP<EFBFBD><EFBFBD> CurSkillInfo["HPRateToRegenEgg"]% <EFBFBD><EFBFBD><EFBFBD>Ϸ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ź<EFBFBD><EFBFBD> return
if Var["Routine_Leviathan"][Handle] == nil
then
return ReturnAI["CPP"]
end
-- <EFBFBD>׾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
if cIsObjectDead( Handle ) ~= nil
then
if Handle == Var["LeviathanStep"]["BossMain"]["Handle"]
then
DebugLog("Routine_Leviathan::Leviathan BossMain Dead")
elseif Handle == Var["LeviathanStep"]["BossHead"]["Handle"]
then
DebugLog("Routine_Leviathan::Leviathan BossHead Dead")
end
ErrorLog("Routine_Leviathan::cIsObjectDead")
cAIScriptSet( Handle )
if Var["Routine_Leviathan"] ~= nil
then
ErrorLog("local Var[Routine_Leviathan] ~= nil")
if Var["Routine_Leviathan"][Handle] ~= nil
then
Var["Routine_Leviathan"][Handle] = nil
ErrorLog("local Var[Routine_Leviathan][Handle] ~= nil")
end
end
return ReturnAI["END"]
end
-- 0.2<EFBFBD>ʸ<EFBFBD><EFBFBD><EFBFBD> üũ<EFBFBD>ϴ<EFBFBD> <EFBFBD><EFBFBD>ƾ
if Var["RoutineTime"][ Handle ] <= cCurrentSecond()
then
Var["RoutineTime"][ Handle ] = cCurrentSecond() + 5
else
return ReturnAI["CPP"]
end
--------------------------------------------------------------------
-- GuardianEgg <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD>
--------------------------------------------------------------------
if Var["Routine_Leviathan"][Handle]["GuardianEgg"] ~= nil
then
local MyVar = Var["Routine_Leviathan"][Handle]["GuardianEgg"]
local MyCurSkillInfo = CurSkillInfo["GuardianEgg"]
-- RegenMaxCount Ȯ<EFBFBD><EFBFBD>
if MyVar["RegenMaxCount"] > MyCurSkillInfo["RegenMaxCount"]
then
DebugLog("Routine_Leviathan::Over RegenMaxCount..GuardianEgg")
Var["Routine_Leviathan"][Handle]["GuardianEgg"] = nil
return ReturnAI["CPP"]
end
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
if MyVar["RegenTick"] < Var["CurSec"]
then
ErrorLog("Routine_Leviathan::Regen GuardianEgg")
MyVar["RegenTick"] = Var["CurSec"] + MyCurSkillInfo["RegenTick"]
local SummonIndex = MyVar["RegenMob"]["Index"]
local SummonNum = MyVar["RegenMob"]["Num"]
local SummonDir = cRandomInt( 1, 90 ) * 4
local SummonRegenX, SummonRegenY = cGetAroundCoord( Handle, SummonDir, 450 )
for i = 1, SummonNum
do
local CurSummonHandle = cMobRegen_Circle( Var["MapIndex"], SummonIndex, SummonRegenX, SummonRegenY, 70 )
if CurSummonHandle == nil then
ErrorLog("Routine_Leviathan::cAIScriptFunc GuardianEgg cMobRegen_Circle Fail")
end
if cSetAIScript ( MainLuaScriptPath, CurSummonHandle ) ~= nil
then
if cAIScriptFunc( CurSummonHandle, "Entrance", "Routine_GuardianEgg" ) == nil
then
ErrorLog("Routine_Leviathan::cAIScriptFunc Fail")
return ReturnAI["END"]
end
end
end
DebugLog("Routine_Leviathan::GuardianEgg Regen Count.."..MyVar["RegenMaxCount"])
MyVar["RegenMaxCount"] = MyVar["RegenMaxCount"] + 1
end
end
--------------------------------------------------------------------
-- GuardEgg <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD>
--------------------------------------------------------------------
if Var["Routine_Leviathan"][Handle]["GuardEgg"] ~= nil
then
local MyVar = Var["Routine_Leviathan"][Handle]["GuardEgg"]
local MyCurSkillInfo = CurSkillInfo["GuardEgg"]
-- RegenMaxCount Ȯ<EFBFBD><EFBFBD>
if MyVar["RegenMaxCount"] > MyCurSkillInfo["RegenMaxCount"]
then
DebugLog("Routine_Leviathan::Over RegenMaxCount..GuardEgg")
Var["Routine_Leviathan"][Handle]["GuardEgg"] = nil
return ReturnAI["CPP"]
end
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
if MyVar["RegenTick"] < Var["CurSec"]
then
ErrorLog("Routine_Leviathan::Regen GuardEgg")
MyVar["RegenTick"] = Var["CurSec"] + MyCurSkillInfo["RegenTick"]
local SummonIndex = MyVar["RegenMob"]["Index"]
local SummonNum = MyVar["RegenMob"]["Num"]
local SummonDir = cRandomInt( 1, 90 ) * 4
local SummonRegenX, SummonRegenY = cGetAroundCoord( Handle, SummonDir, 450 )
for i = 1, SummonNum
do
local CurSummonHandle = cMobRegen_Circle( Var["MapIndex"], SummonIndex, SummonRegenX, SummonRegenY, 70 )
if CurSummonHandle == nil then
ErrorLog("Routine_Leviathan::cAIScriptFunc GuardEgg cMobRegen_Circle Fail")
end
if cSetAIScript ( MainLuaScriptPath, CurSummonHandle ) ~= nil
then
if cAIScriptFunc( CurSummonHandle, "Entrance", "Routine_GuardEgg" ) == nil
then
ErrorLog("Routine_Leviathan::cAIScriptFunc Fail")
return ReturnAI["END"]
end
end
end
DebugLog("Routine_Leviathan::GuardEgg Regen Count.."..MyVar["RegenMaxCount"])
MyVar["RegenMaxCount"] = MyVar["RegenMaxCount"] + 1
end
end
--------------------------------------------------------------------
-- BuffEgg <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ó<EFBFBD><EFBFBD>
--------------------------------------------------------------------
if Var["Routine_Leviathan"][Handle]["BuffEgg"] ~= nil
then
local MyVar = Var["Routine_Leviathan"][Handle]["BuffEgg"]
local MyCurSkillInfo = CurSkillInfo["BuffEgg"]
-- RegenMaxCount Ȯ<EFBFBD><EFBFBD>
if MyVar["RegenMaxCount"] > MyCurSkillInfo["RegenMaxCount"]
then
DebugLog("Routine_Leviathan::Over RegenMaxCount..BuffEgg")
Var["Routine_Leviathan"][Handle]["BuffEgg"] = nil
return ReturnAI["CPP"]
end
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
if MyVar["RegenTick"] < Var["CurSec"]
then
ErrorLog("Routine_Leviathan::Regen BuffEgg")
MyVar["RegenTick"] = Var["CurSec"] + MyCurSkillInfo["RegenTick"]
local SummonIndex = MyVar["RegenMob"]["Index"]
local SummonNum = MyVar["RegenMob"]["Num"]
local SummonDir = cRandomInt( 1, 90 ) * 4
local SummonRegenX, SummonRegenY = cGetAroundCoord( Handle, SummonDir, 450 )
for i = 1, SummonNum
do
local CurSummonHandle = cMobRegen_Circle( Var["MapIndex"], SummonIndex, SummonRegenX, SummonRegenY, 70 )
if CurSummonHandle == nil then
ErrorLog("Routine_Leviathan::cAIScriptFunc BuffEgg cMobRegen_Circle Fail")
end
if cSetAIScript ( MainLuaScriptPath, CurSummonHandle ) ~= nil
then
if cAIScriptFunc( CurSummonHandle, "Entrance", "Routine_BuffEgg" ) == nil
then
ErrorLog("Routine_Leviathan::cAIScriptFunc Fail")
return ReturnAI["END"]
end
end
end
DebugLog("Routine_Leviathan::BuffEgg Regen Count.."..MyVar["RegenMaxCount"])
MyVar["RegenMaxCount"] = MyVar["RegenMaxCount"] + 1
end
end
return ReturnAI["CPP"]
end
--------------------------------------------------------------------------------
-- <EFBFBD><EFBFBD> Routine_GuardianEgg -- ū <EFBFBD><EFBFBD>
--------------------------------------------------------------------------------
function Routine_GuardianEgg( Handle, MapIndex )
cExecCheck "Routine_GuardianEgg"
-- <EFBFBD>Լ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
if Handle == nil
then
ErrorLog( "Routine_GuardianEgg::Handle == nil" )
return ReturnAI["END"]
end
if MapIndex == nil
then
ErrorLog( "Routine_GuardianEgg::MapIndex == nil" )
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
-- <EFBFBD>ʵ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
local Var = InstanceField[ MapIndex ]
if Var == nil
then
ErrorLog( "Routine_GuardianEgg::Var == nil"..MapIndex )
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
-- <EFBFBD><EFBFBD>ų<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
local CurSkillInfo = LeviathanSkillInfo["Routine_GuardianEgg"]
if Var["Routine_GuardianEgg"] == nil
then
Var["Routine_GuardianEgg"] = {}
ErrorLog("Routine_GuardianEgg:: Table Create")
end
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ
if Var["Routine_GuardianEgg"][Handle] == nil
then
Var["Routine_GuardianEgg"][Handle] = {}
Var["Routine_GuardianEgg"][Handle]["EggBrakeTime"] = Var["CurSec"] + CurSkillInfo["EggBrakeTime"]
Var["Routine_GuardianEgg"][Handle]["IsReadySummon"] = false
ErrorLog("Routine_GuardianEgg:: Table Create [Handle] == nil")
end
local MyVar = Var["Routine_GuardianEgg"][Handle]
-- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȯ<EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ
if MyVar ~= nil
then
-- <EFBFBD><EFBFBD>ȭ ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ
if MyVar["IsReadySummon"] == false
then
if MyVar["EggBrakeTime"] <= Var["CurSec"]
then
ErrorLog("Routine_GuardianEgg::MyVar[EggBrakeTime] <= Var[CurSec]")
MyVar["IsReadySummon"] = true
else
if cIsObjectDead( Handle ) == 1
then
ErrorLog("Routine_GuardianEgg::cIsObjectDead( Handle ) ")
MyVar["IsReadySummon"] = true
else
return ReturnAI["CPP"]
end
end
end
-- <EFBFBD><EFBFBD>ȭ ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>غ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŭ <EFBFBD><EFBFBD>ȯ<EFBFBD>ϰ<EFBFBD>, <EFBFBD><EFBFBD>ũ<EFBFBD><EFBFBD>Ʈ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
if MyVar["IsReadySummon"] == true
then
ErrorLog("Routine_GuardianEgg::IsReadySummon == true")
local SummonIndex = CurSkillInfo["Summon"]["Index"]
local SummonNum = CurSkillInfo["Summon"]["Num"]
for i = 1, SummonNum
do
local CurSummonHandle = cMobRegen_Obj( CurSkillInfo["Summon"]["Index"], Handle )
ErrorLog("Routine_GuardianEgg::Summon : "..CurSkillInfo["Summon"]["Index"])
--[[
if cSetAIScript ( MainLuaScriptPath, CurSummonHandle ) ~= nil
then
if cAIScriptFunc( CurSummonHandle, "Entrance", "Routine_Guardian" ) == nil
then
ErrorLog("Routine_GuardianEgg::cAIScriptFunc Fail")
return ReturnAI["END"]
end
end
--]]
end
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD>.
cMobSuicide( MapIndex, Handle )
cAIScriptSet( Handle )
if Var["Routine_GuardianEgg"] ~= nil
then
ErrorLog("local Var[Routine_GuardianEgg] ~= nil")
if Var["Routine_GuardianEgg"][Handle] ~= nil
then
Var["Routine_GuardianEgg"][Handle] = nil
ErrorLog("local Var[Routine_GuardianEgg][Handle] ~= nil")
end
end
return ReturnAI["END"]
end
end
return ReturnAI["END"]
end
--------------------------------------------------------------------------------
-- <EFBFBD><EFBFBD> Routine_GuardEgg -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
--------------------------------------------------------------------------------
function Routine_GuardEgg( Handle, MapIndex )
cExecCheck "Routine_GuardEgg"
-- <EFBFBD>Լ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
if Handle == nil
then
ErrorLog( "Routine_GuardEgg::Handle == nil" )
return ReturnAI["END"]
end
if MapIndex == nil
then
ErrorLog( "Routine_GuardEgg::MapIndex == nil" )
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
-- <EFBFBD>ʵ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
local Var = InstanceField[ MapIndex ]
if Var == nil
then
ErrorLog( "Routine_GuardEgg::Var == nil"..MapIndex )
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
-- <EFBFBD><EFBFBD>ų<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
local CurSkillInfo = LeviathanSkillInfo["Routine_GuardEgg"]
if Var["Routine_GuardEgg"] == nil
then
Var["Routine_GuardEgg"] = {}
ErrorLog("Routine_GuardEgg:: Table Create")
end
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ
if Var["Routine_GuardEgg"][Handle] == nil
then
Var["Routine_GuardEgg"][Handle] = {}
Var["Routine_GuardEgg"][Handle]["EggBrakeTime"] = Var["CurSec"] + CurSkillInfo["EggBrakeTime"]
Var["Routine_GuardEgg"][Handle]["IsReadySummon"] = false
ErrorLog("Routine_GuardEgg:: Table Create [Handle] == nil")
end
local MyVar = Var["Routine_GuardEgg"][Handle]
-- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȯ<EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ
if MyVar ~= nil
then
-- <EFBFBD><EFBFBD>ȭ ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ
if MyVar["IsReadySummon"] == false
then
if MyVar["EggBrakeTime"] <= Var["CurSec"]
then
ErrorLog("Routine_GuardEgg::MyVar[EggBrakeTime] <= Var[CurSec]")
MyVar["IsReadySummon"] = true
else
if cIsObjectDead( Handle ) == 1
then
ErrorLog("Routine_GuardEgg::cIsObjectDead( Handle ) ")
MyVar["IsReadySummon"] = true
else
return ReturnAI["CPP"]
end
end
end
-- <EFBFBD><EFBFBD>ȭ ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>غ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŭ <EFBFBD><EFBFBD>ȯ<EFBFBD>ϰ<EFBFBD>, <EFBFBD><EFBFBD>ũ<EFBFBD><EFBFBD>Ʈ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
if MyVar["IsReadySummon"] == true
then
ErrorLog("Routine_GuardEgg::IsReadySummon == true")
local SummonIndex = CurSkillInfo["Summon"]["Index"]
local SummonNum = CurSkillInfo["Summon"]["Num"]
for i = 1, SummonNum
do
local CurSummonHandle = cMobRegen_Obj( CurSkillInfo["Summon"]["Index"], Handle )
ErrorLog("Routine_GuardEgg::Summon : "..CurSkillInfo["Summon"]["Index"])
--[[
if cSetAIScript ( MainLuaScriptPath, CurSummonHandle ) ~= nil
then
if cAIScriptFunc( CurSummonHandle, "Entrance", "Routine_Guard" ) == nil
then
ErrorLog("Routine_GuardEgg::cAIScriptFunc Fail")
return ReturnAI["END"]
end
end
--]]
end
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD>.
cMobSuicide( MapIndex, Handle )
cAIScriptSet( Handle )
if Var["Routine_GuardEgg"] ~= nil
then
ErrorLog("local Var[Routine_GuardEgg] ~= nil")
if Var["Routine_GuardEgg"][Handle] ~= nil
then
Var["Routine_GuardEgg"][Handle] = nil
ErrorLog("local Var[Routine_GuardEgg][Handle] ~= nil")
end
end
return ReturnAI["END"]
end
end
return ReturnAI["END"]
end
--------------------------------------------------------------------------------
-- <EFBFBD><EFBFBD> Routine_BuffEgg -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
--------------------------------------------------------------------------------
function Routine_BuffEgg( Handle, MapIndex )
cExecCheck "Routine_BuffEgg"
-- <EFBFBD>Լ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
if Handle == nil
then
ErrorLog( "Routine_BuffEgg::Handle == nil" )
return ReturnAI["END"]
end
if MapIndex == nil
then
ErrorLog( "Routine_BuffEgg::MapIndex == nil" )
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
-- <EFBFBD>ʵ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
local Var = InstanceField[ MapIndex ]
if Var == nil
then
ErrorLog( "Routine_BuffEgg::local Var = InstanceField[ MapIndex ]" )
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
-- <EFBFBD><EFBFBD>ų<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
local CurSkillInfo = LeviathanSkillInfo["Routine_BuffEgg"]
if Var["Routine_BuffEgg"] == nil
then
Var["Routine_BuffEgg"] = {}
ErrorLog("Routine_BuffEgg:: Table Create")
end
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ
if Var["Routine_BuffEgg"][Handle] == nil
then
Var["Routine_BuffEgg"][Handle] = {}
Var["Routine_BuffEgg"][Handle]["IsReadyBuff"] = false
ErrorLog("Routine_BuffEgg:: Table Create [Handle] == nil")
end
local MyVar = Var["Routine_BuffEgg"][Handle]
-- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȯ<EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ
if MyVar ~= nil
then
-- <EFBFBD><EFBFBD>ȭ ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ
if MyVar["IsReadyBuff"] == false
then
if cIsObjectDead( Handle ) == 1
then
ErrorLog("Routine_BuffEgg::cIsObjectDead( Handle )")
MyVar["IsReadyBuff"] = true
else
return ReturnAI["CPP"]
end
end
-- <EFBFBD><EFBFBD>ȭ ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>غ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ŭ <EFBFBD><EFBFBD>ȯ<EFBFBD>ϰ<EFBFBD>, <EFBFBD><EFBFBD>ũ<EFBFBD><EFBFBD>Ʈ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
if MyVar["IsReadyBuff"] == true
then
ErrorLog("Routine_BuffEgg::WhoKillBuffEgg : cMobSuicide( MapIndex, Handle )")
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD>.
--cMobSuicide( MapIndex, Handle )
cAIScriptSet( Handle )
if Var["Routine_BuffEgg"] ~= nil
then
ErrorLog("local Var[Routine_BuffEgg] ~= nil")
if Var["Routine_BuffEgg"][Handle] ~= nil
then
Var["Routine_BuffEgg"][Handle] = nil
ErrorLog("local Var[Routine_BuffEgg][Handle] ~= nil")
end
end
ErrorLog("Routine_BuffEgg::IsReadySummon == true")
local TargetHandle = cGetWhoKillMe( Handle )
if TargetHandle == nil then
ErrorLog("Routine_BuffEgg::if TargetHandle == nil")
end
ErrorLog("Routine_BuffEgg::WhoKillBuffEgg : TargetHandle ~= nil")
local BuffIndex = CurSkillInfo["Buff"]["Index"]
ErrorLog("local BuffIndex")
local BuffStrength = CurSkillInfo["Buff"]["Strength"]
ErrorLog("local BuffStrength")
local BuffKeepTime = CurSkillInfo["Buff"]["KeepTime"]
ErrorLog("local BuffKeepTime")
if cSetAbstate( TargetHandle, BuffIndex, BuffStrength, BuffKeepTime ) == nil
then
ErrorLog("Routine_BuffEgg::cSetAbstate Fail")
end
ErrorLog("Routine_BuffEgg::cSetAbstate Succ")
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ<EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD>.
--cMobSuicide( MapIndex, Handle )
--cAIScriptSet( Handle )
return ReturnAI["END"]
end
end
return ReturnAI["END"]
end