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.
 
 
SigFiesta/LuaScript/ID/AdlFH/AdlFH_Guarder.lua

129 lines
1.9 KiB

require( "common" )
-- 마렌느
function AdlFH_Marlene( Handle, MapIndex )
cExecCheck "AdlFH_Marlene"
return Guarder( Handle, MapIndex )
end
-- 경비병
function AdlFH_GuardAlber( Handle, MapIndex )
cExecCheck "AdlFH_GuardAlber"
return Guarder( Handle, MapIndex )
end
-- 경비병
function AdlFH_GuardEstelle( Handle, MapIndex )
cExecCheck "AdlFH_GuardEstelle"
return Guarder( Handle, MapIndex )
end
GuardMemBlock = {}
function Guarder( Handle, MapIndex )
cExecCheck "Guarder"
local Var = GuardMemBlock[Handle]
if cIsObjectDead( Handle ) then -- 죽었음
-- 죽은 경비병이 마렌느 일 경우 대사하고 죽음
if InstanceField[MapIndex] ~= nil then
local Field = InstanceField[MapIndex]
if Field ~= nil then
if Handle == Field.Marlene then
cMobDialog( MapIndex,
DialogInfo.Marlene_Death[1].Portrait,
DialogInfo.Marlene_Death[1].FileName,
DialogInfo.Marlene_Death[1].Index )
end
end
end
cAIScriptSet( Handle ) -- 스크립트 없앰
GuardMemBlock[Handle] = nil -- 메모리해제
return ReturnAI.END
end
if Var == nil then
GuardMemBlock[Handle] = {}
Var = GuardMemBlock[Handle]
Var.Handle = Handle
Var.MapIndex = MapIndex
Var.StepFunc = GuarderStop
end
return Var.StepFunc( Var )
end
function CheckOnSurvivalOfLoussier( Var )
cExecCheck "CheckOnSurvivalOfLoussier"
if Var == nil then
return
end
-- 필드 전역변수. 루시에 핸들
if InstanceField[Var.MapIndex] == nil then
return
end
local loussier = InstanceField[Var.MapIndex].LoussierHandle
-- 마렌느와 경비병은 대기하다가 루시에가 죽으면 없앰
if loussier == nil then
cAIScriptSet( Handle ) -- 스크립트 없앰
cNPCVanish( Var.Handle )
Var = nil
end
end
function GuarderStop( Var )
cExecCheck "GuarderStop"
CheckOnSurvivalOfLoussier( Var )
return ReturnAI.END
end
function GuarderActivity( Var )
cExecCheck "GuarderActivity"
CheckOnSurvivalOfLoussier( Var )
return ReturnAI.CPP
end