|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
-- Promote Job2_Forest Progress Func --
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
-- InitDungeon : <EFBFBD>ʱ<EFBFBD>ȭ<EFBFBD>Լ<EFBFBD>( <EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD>귿, <EFBFBD>ֻ<EFBFBD><EFBFBD><EFBFBD>, npc <EFBFBD><EFBFBD><EFBFBD><EFBFBD> )
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function InitDungeon( Var )
|
|
|
|
|
cExecCheck "InitDungeon"
|
|
|
|
|
|
|
|
|
|
--DebugLog( "==========================InitDungeon_Start==========================" )
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog("InitDungeon::Var == nil")
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD><EFBFBD><EFBFBD> ù <EFBFBD>α<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>ٸ<EFBFBD><EFBFBD><EFBFBD>.
|
|
|
|
|
if Var["PlayerHandle"] == INVALID_HANDEL
|
|
|
|
|
then
|
|
|
|
|
if Var["InitialSec"] + WAIT_PLAYER_MAP_LOGIN_SEC_MAX <= cCurrentSecond()
|
|
|
|
|
then
|
|
|
|
|
ErrorLog("<EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD> <EFBFBD>ʿ<EFBFBD> <EFBFBD>α<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>")
|
|
|
|
|
Var["StepFunc"] = QuestFailed
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local InitDungeonInfo = Var["InitDungeon"]
|
|
|
|
|
if InitDungeonInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["InitDungeon"] = {}
|
|
|
|
|
InitDungeonInfo = Var["InitDungeon"]
|
|
|
|
|
|
|
|
|
|
-- NPC Regen
|
|
|
|
|
local ElderinHandle = RegenInfo["NPC"]["Elderin"]
|
|
|
|
|
local RoumenHandle = RegenInfo["NPC"]["Roumen"]
|
|
|
|
|
|
|
|
|
|
if ElderinHandle ~= nil and RoumenHandle ~= nil
|
|
|
|
|
then
|
|
|
|
|
Var["Elderin"] = cMobRegen_XY( Var["MapIndex"], ElderinHandle["MobIndex"], ElderinHandle["X"], ElderinHandle["Y"], ElderinHandle["Dir"] )
|
|
|
|
|
Var["Roumen"] = cMobRegen_XY( Var["MapIndex"], RoumenHandle["MobIndex"], RoumenHandle["X"], RoumenHandle["Y"], RoumenHandle["Dir"] )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if Var["Elderin"] == nil or Var["Roumen"] == nil
|
|
|
|
|
then
|
|
|
|
|
GoToFail( Var, "InitDungeon:: NPC Regen Fail" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
Var["StepFunc"] = FindHero
|
|
|
|
|
Var["InitDungeon"] = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
-- FindHero : 5<EFBFBD>оȿ<EFBFBD> npc(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD>) ã<EFBFBD>Ƴ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function FindHero( Var )
|
|
|
|
|
cExecCheck "FindHero"
|
|
|
|
|
|
|
|
|
|
--DebugLog("==========================FindHero_Start==========================")
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "FindHero : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local FindHeroInfo = Var["FindHero"]
|
|
|
|
|
if FindHeroInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["FindHero"] = {}
|
|
|
|
|
FindHeroInfo = Var["FindHero"]
|
|
|
|
|
|
|
|
|
|
cNotice( Var["MapIndex"], NoticeInfo["ScriptFileName"], NoticeInfo["MissionObj"]["Index"] )
|
|
|
|
|
|
|
|
|
|
-- Ÿ<EFBFBD≯<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if Var["FindHeroLimitTime"] == 0
|
|
|
|
|
then
|
|
|
|
|
Var["FindHeroLimitTime"] = Var["CurSec"] + DelayTime["FindHeroLimitTime"]
|
|
|
|
|
cTimer( Var["MapIndex"], DelayTime["FindHeroLimitTime"] )
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if Var["FindHeroLimitTime"] ~= 0
|
|
|
|
|
then
|
|
|
|
|
|
|
|
|
|
if Var["FindHeroLimitTime"] < Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
Var["StepFunc"] = QuestFailed
|
|
|
|
|
Var["FindHero"] = nil
|
|
|
|
|
return
|
|
|
|
|
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> return / <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BossBattle<EFBFBD>Լ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if cGetAreaObject( Var["MapIndex"], AreaInfo["FindNPC"], Var["PlayerHandle"] ) == nil
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
--Ÿ<EFBFBD≯<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Var["FindHeroLimitTime"] = nil
|
|
|
|
|
cTimer( Var["MapIndex"], 0 )
|
|
|
|
|
|
|
|
|
|
Var["StepFunc"] = FirstMeeting
|
|
|
|
|
Var["FindHero"] = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
-- FirstMeeting : ù<EFBFBD><EFBFBD>° <EFBFBD><EFBFBD>ȭ
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function FirstMeeting( Var )
|
|
|
|
|
cExecCheck "FirstMeeting"
|
|
|
|
|
|
|
|
|
|
--DebugLog("==========================FirstMeeting_Start==========================")
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "FirstMeeting : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if IsFail( Var ) == true
|
|
|
|
|
then
|
|
|
|
|
Var["StepFunc"] = QuestFailed
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local FirstMeetingInfo = Var["FirstMeeting"]
|
|
|
|
|
if FirstMeetingInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["FirstMeeting"] = {}
|
|
|
|
|
FirstMeetingInfo = Var["FirstMeeting"]
|
|
|
|
|
|
|
|
|
|
FirstMeetingInfo["NextStepWaitTime"] = Var["CurSec"] + ( DelayTime["GapDialog"] * #ChatInfo["FirstMeeting"] ) + DelayTime["WaitSeconds"]
|
|
|
|
|
FirstMeetingInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"]
|
|
|
|
|
FirstMeetingInfo["DialogStep"] = 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD>
|
|
|
|
|
if FirstMeetingInfo["DialogTime"] ~= nil
|
|
|
|
|
then
|
|
|
|
|
if FirstMeetingInfo["DialogTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
local CurMsg = ChatInfo["FirstMeeting"]
|
|
|
|
|
local DialogStep = FirstMeetingInfo["DialogStep"]
|
|
|
|
|
local MaxDialogStep = #ChatInfo["FirstMeeting"]
|
|
|
|
|
|
|
|
|
|
if DialogStep <= MaxDialogStep
|
|
|
|
|
then
|
|
|
|
|
cMobDialog( Var["MapIndex"], CurMsg[DialogStep]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurMsg[DialogStep]["MsgIndex"] )
|
|
|
|
|
FirstMeetingInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"]
|
|
|
|
|
FirstMeetingInfo["DialogStep"] = DialogStep + 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if FirstMeetingInfo["DialogStep"] > MaxDialogStep
|
|
|
|
|
then
|
|
|
|
|
FirstMeetingInfo["DialogTime"] = nil
|
|
|
|
|
FirstMeetingInfo["DialogStep"] = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if FirstMeetingInfo["NextStepWaitTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
-- Ÿ<EFBFBD≯<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
if Var["LimitTime"] == 0
|
|
|
|
|
then
|
|
|
|
|
Var["LimitTime"] = Var["CurSec"] + DelayTime["LimitTime"]
|
|
|
|
|
cTimer( Var["MapIndex"], DelayTime["LimitTime"] )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
Var["StepFunc"] = BattleFirst
|
|
|
|
|
Var["FirstMeeting"] = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
-- BattleFirst : ù<EFBFBD><EFBFBD>° <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function BattleFirst( Var )
|
|
|
|
|
cExecCheck "BattleFirst"
|
|
|
|
|
|
|
|
|
|
--DebugLog("==========================BattleFirst_Start==========================")
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "BattleFirst : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if IsFail( Var ) == true
|
|
|
|
|
then
|
|
|
|
|
Var["StepFunc"] = QuestFailed
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local BattleFirstInfo = Var["BattleFirst"]
|
|
|
|
|
if BattleFirstInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["BattleFirst"] = {}
|
|
|
|
|
BattleFirstInfo = Var["BattleFirst"]
|
|
|
|
|
|
|
|
|
|
BattleFirstInfo["NextStepWaitTime"] = Var["CurSec"] + DelayTime["WaitDialogSecond"]
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
local CurRegenMob = RegenInfo["MobInfo"]["BattleFirst"]
|
|
|
|
|
for i = 1, #CurRegenMob
|
|
|
|
|
do
|
|
|
|
|
if cGroupRegenInstance( Var["MapIndex"], CurRegenMob[i] ) == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog("BattleFirst : <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> _ "..CurRegenMob[i])
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܰ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ
|
|
|
|
|
if BattleFirstInfo["NextStepWaitTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
Var["StepFunc"] = DialogSecond
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
-- DialogSecond : <EFBFBD>ι<EFBFBD>° <EFBFBD><EFBFBD>ȭ
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function DialogSecond( Var )
|
|
|
|
|
cExecCheck "DialogSecond"
|
|
|
|
|
|
|
|
|
|
--DebugLog("==========================DialogSecond_Start==========================")
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "DialogSecond : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if IsFail( Var ) == true
|
|
|
|
|
then
|
|
|
|
|
Var["StepFunc"] = QuestFailed
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local DialogSecondInfo = Var["DialogSecond"]
|
|
|
|
|
if DialogSecondInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["DialogSecond"] = {}
|
|
|
|
|
DialogSecondInfo = Var["DialogSecond"]
|
|
|
|
|
|
|
|
|
|
DialogSecondInfo["NextStepWaitTime"] = Var["CurSec"] + ( DelayTime["GapDialog"] * #ChatInfo["DialogSecond"] ) + DelayTime["WaitSeconds"]
|
|
|
|
|
DialogSecondInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"]
|
|
|
|
|
DialogSecondInfo["DialogStep"] = 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD>
|
|
|
|
|
if DialogSecondInfo["DialogTime"] ~= nil
|
|
|
|
|
then
|
|
|
|
|
if DialogSecondInfo["DialogTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
local CurMsg = ChatInfo["DialogSecond"]
|
|
|
|
|
local DialogStep = DialogSecondInfo["DialogStep"]
|
|
|
|
|
local MaxDialogStep = #ChatInfo["DialogSecond"]
|
|
|
|
|
|
|
|
|
|
if DialogStep <= MaxDialogStep
|
|
|
|
|
then
|
|
|
|
|
cMobDialog( Var["MapIndex"], CurMsg[DialogStep]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurMsg[DialogStep]["MsgIndex"] )
|
|
|
|
|
DialogSecondInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"]
|
|
|
|
|
DialogSecondInfo["DialogStep"] = DialogStep + 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if DialogSecondInfo["DialogStep"] > MaxDialogStep
|
|
|
|
|
then
|
|
|
|
|
DialogSecondInfo["DialogTime"] = nil
|
|
|
|
|
DialogSecondInfo["DialogStep"] = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if DialogSecondInfo["NextStepWaitTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
Var["StepFunc"] = BattleSecond
|
|
|
|
|
Var["DialogSecond"] = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
-- BattleSecond : <EFBFBD>ι<EFBFBD>° <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function BattleSecond( Var )
|
|
|
|
|
cExecCheck "BattleSecond"
|
|
|
|
|
|
|
|
|
|
--DebugLog("==========================BattleSecond_Start==========================")
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "BattleSecond : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if IsFail( Var ) == true
|
|
|
|
|
then
|
|
|
|
|
Var["StepFunc"] = QuestFailed
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local BattleSecondInfo = Var["BattleSecond"]
|
|
|
|
|
if BattleSecondInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["BattleSecond"] = {}
|
|
|
|
|
BattleSecondInfo = Var["BattleSecond"]
|
|
|
|
|
|
|
|
|
|
BattleSecondInfo["NextStepWaitTime"] = Var["CurSec"] + DelayTime["WaitDialogThird"]
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
local CurRegenMob = RegenInfo["MobInfo"]["BattleSecond"]
|
|
|
|
|
for i = 1, #CurRegenMob
|
|
|
|
|
do
|
|
|
|
|
if cGroupRegenInstance( Var["MapIndex"], CurRegenMob[i] ) == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog("BattleSecond : <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> _ "..CurRegenMob[i])
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܰ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ
|
|
|
|
|
if BattleSecondInfo["NextStepWaitTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
Var["StepFunc"] = DialogThird
|
|
|
|
|
Var["BattleSecond"] = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
-- DialogThird : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>° <EFBFBD><EFBFBD>ȭ
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function DialogThird( Var )
|
|
|
|
|
cExecCheck "DialogThird"
|
|
|
|
|
|
|
|
|
|
--DebugLog("==========================DialogThird_Start==========================")
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "DialogThird : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if IsFail( Var ) == true
|
|
|
|
|
then
|
|
|
|
|
Var["StepFunc"] = QuestFailed
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local DialogThirdInfo = Var["DialogThird"]
|
|
|
|
|
if DialogThirdInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["DialogThird"] = {}
|
|
|
|
|
DialogThirdInfo = Var["DialogThird"]
|
|
|
|
|
|
|
|
|
|
DialogThirdInfo["NextStepWaitTime"] = Var["CurSec"] + ( DelayTime["GapDialog"] * #ChatInfo["DialogThird"] ) + DelayTime["WaitSeconds"]
|
|
|
|
|
DialogThirdInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"]
|
|
|
|
|
DialogThirdInfo["DialogStep"] = 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD>
|
|
|
|
|
if DialogThirdInfo["DialogTime"] ~= nil
|
|
|
|
|
then
|
|
|
|
|
if DialogThirdInfo["DialogTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
local CurMsg = ChatInfo["DialogThird"]
|
|
|
|
|
local DialogStep = DialogThirdInfo["DialogStep"]
|
|
|
|
|
local MaxDialogStep = #ChatInfo["DialogThird"]
|
|
|
|
|
|
|
|
|
|
if DialogStep <= MaxDialogStep
|
|
|
|
|
then
|
|
|
|
|
cMobDialog( Var["MapIndex"], CurMsg[DialogStep]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurMsg[DialogStep]["MsgIndex"] )
|
|
|
|
|
DialogThirdInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"]
|
|
|
|
|
DialogThirdInfo["DialogStep"] = DialogStep + 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if DialogThirdInfo["DialogStep"] > MaxDialogStep
|
|
|
|
|
then
|
|
|
|
|
DialogThirdInfo["DialogTime"] = nil
|
|
|
|
|
DialogThirdInfo["DialogStep"] = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if DialogThirdInfo["NextStepWaitTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
Var["StepFunc"] = BattleThird
|
|
|
|
|
Var["DialogThird"] = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
-- BattleThird : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>° <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function BattleThird( Var )
|
|
|
|
|
cExecCheck "BattleThird"
|
|
|
|
|
|
|
|
|
|
--DebugLog("==========================BattleThird_Start==========================")
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "BattleThird : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if IsFail( Var ) == true
|
|
|
|
|
then
|
|
|
|
|
Var["StepFunc"] = QuestFailed
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local BattleThirdInfo = Var["BattleThird"]
|
|
|
|
|
if BattleThirdInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["BattleThird"] = {}
|
|
|
|
|
BattleThirdInfo = Var["BattleThird"]
|
|
|
|
|
|
|
|
|
|
BattleThirdInfo["NextStepWaitTime"] = Var["CurSec"] + DelayTime["WaitDialogFourth"]
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
local CurRegenMob = RegenInfo["MobInfo"]["BattleThird"]
|
|
|
|
|
for i = 1, #CurRegenMob
|
|
|
|
|
do
|
|
|
|
|
if cGroupRegenInstance( Var["MapIndex"], CurRegenMob[i] ) == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog("BattleThird : <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> _ "..CurRegenMob[i])
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܰ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ
|
|
|
|
|
if BattleThirdInfo["NextStepWaitTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
Var["StepFunc"] = DialogFourth
|
|
|
|
|
Var["BattleThird"] = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
-- DialogFourth : <EFBFBD><EFBFBD>° <EFBFBD><EFBFBD>ȭ
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function DialogFourth( Var )
|
|
|
|
|
cExecCheck "DialogFourth"
|
|
|
|
|
|
|
|
|
|
--DebugLog("==========================DialogFourth_Start==========================")
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "DialogFourth : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if IsFail( Var ) == true
|
|
|
|
|
then
|
|
|
|
|
Var["StepFunc"] = QuestFailed
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local DialogFourthInfo = Var["DialogFourth"]
|
|
|
|
|
if DialogFourthInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["DialogFourth"] = {}
|
|
|
|
|
DialogFourthInfo = Var["DialogFourth"]
|
|
|
|
|
|
|
|
|
|
DialogFourthInfo["NextStepWaitTime"] = Var["CurSec"] + ( DelayTime["GapDialog"] * #ChatInfo["DialogFourth"] ) + DelayTime["WaitSeconds"]
|
|
|
|
|
DialogFourthInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"]
|
|
|
|
|
DialogFourthInfo["DialogStep"] = 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD>
|
|
|
|
|
if DialogFourthInfo["DialogTime"] ~= nil
|
|
|
|
|
then
|
|
|
|
|
if DialogFourthInfo["DialogTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
local CurMsg = ChatInfo["DialogFourth"]
|
|
|
|
|
local DialogStep = DialogFourthInfo["DialogStep"]
|
|
|
|
|
local MaxDialogStep = #ChatInfo["DialogFourth"]
|
|
|
|
|
|
|
|
|
|
if DialogStep <= MaxDialogStep
|
|
|
|
|
then
|
|
|
|
|
cMobDialog( Var["MapIndex"], CurMsg[DialogStep]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurMsg[DialogStep]["MsgIndex"] )
|
|
|
|
|
DialogFourthInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"]
|
|
|
|
|
DialogFourthInfo["DialogStep"] = DialogStep + 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if DialogFourthInfo["DialogStep"] > MaxDialogStep
|
|
|
|
|
then
|
|
|
|
|
DialogFourthInfo["DialogTime"] = nil
|
|
|
|
|
DialogFourthInfo["DialogStep"] = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if DialogFourthInfo["NextStepWaitTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
Var["StepFunc"] = BattleFourth
|
|
|
|
|
Var["DialogFourth"] = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
-- BattleFourth : <EFBFBD><EFBFBD>° <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function BattleFourth( Var )
|
|
|
|
|
cExecCheck "BattleFourth"
|
|
|
|
|
|
|
|
|
|
--DebugLog("==========================BattleFourth_Start==========================")
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "BattleFourth : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if IsFail( Var ) == true
|
|
|
|
|
then
|
|
|
|
|
Var["StepFunc"] = QuestFailed
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local BattleFourthInfo = Var["BattleFourth"]
|
|
|
|
|
if BattleFourthInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["BattleFourth"] = {}
|
|
|
|
|
BattleFourthInfo = Var["BattleFourth"]
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
local CurRegenMob = RegenInfo["MobInfo"]["BattleFourth"]
|
|
|
|
|
for i = 1, #CurRegenMob
|
|
|
|
|
do
|
|
|
|
|
if cGroupRegenInstance( Var["MapIndex"], CurRegenMob[i] ) == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog("BattleFourth : <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> _ "..CurRegenMob[i])
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ
|
|
|
|
|
if Var["LimitTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
Var["StepFunc"] = QuestSuccess
|
|
|
|
|
Var["BattleFourth"] = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
-- QuestSuccess : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> + <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function QuestSuccess( Var )
|
|
|
|
|
cExecCheck "QuestSuccess"
|
|
|
|
|
|
|
|
|
|
--DebugLog("==========================QuestSuccess_Start==========================")
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "QuestSuccess : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local QuestSuccessInfo = Var["QuestSuccess"]
|
|
|
|
|
if QuestSuccessInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["QuestSuccess"] = {}
|
|
|
|
|
QuestSuccessInfo = Var["QuestSuccess"]
|
|
|
|
|
|
|
|
|
|
QuestSuccessInfo["NextStepWaitTime"] = Var["CurSec"] + ( DelayTime["GapDialog"] * #ChatInfo["QuestSuccess"] ) + DelayTime["WaitSeconds"]
|
|
|
|
|
QuestSuccessInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"]
|
|
|
|
|
QuestSuccessInfo["DialogStep"] = 1
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD>ʿ<EFBFBD> <EFBFBD>ִ<EFBFBD> job2_ElfKnight, Job2_LIzardK<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
VanishMob( Var )
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
cRewardItem_CharInven( Var["PlayerHandle"], RewardItem["Index"], 1 )
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ
|
|
|
|
|
cEffectMsg( Var["PlayerHandle"], EFFECT_MSG_TYPE["EMT_SUCCESS"] )
|
|
|
|
|
|
|
|
|
|
--Ÿ<EFBFBD≯<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Var["LimitTime"] = "NoLimit"
|
|
|
|
|
cTimer( Var["MapIndex"], 0 )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD>
|
|
|
|
|
if QuestSuccessInfo["DialogTime"] ~= nil
|
|
|
|
|
then
|
|
|
|
|
if QuestSuccessInfo["DialogTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
local CurMsg = ChatInfo["QuestSuccess"]
|
|
|
|
|
local DialogStep = QuestSuccessInfo["DialogStep"]
|
|
|
|
|
local MaxDialogStep = #ChatInfo["QuestSuccess"]
|
|
|
|
|
|
|
|
|
|
if DialogStep <= MaxDialogStep
|
|
|
|
|
then
|
|
|
|
|
cMobDialog( Var["MapIndex"], CurMsg[DialogStep]["SpeakerIndex"], ChatInfo["ScriptFileName"], CurMsg[DialogStep]["MsgIndex"] )
|
|
|
|
|
QuestSuccessInfo["DialogTime"] = Var["CurSec"] + DelayTime["GapDialog"]
|
|
|
|
|
QuestSuccessInfo["DialogStep"] = DialogStep + 1
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if QuestSuccessInfo["DialogStep"] > MaxDialogStep
|
|
|
|
|
then
|
|
|
|
|
QuestSuccessInfo["DialogTime"] = nil
|
|
|
|
|
QuestSuccessInfo["DialogStep"] = nil
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if QuestSuccessInfo["NextStepWaitTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
Var["StepFunc"] = ReturnToHome
|
|
|
|
|
Var["QuestSuccess"] = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
-- QuestFailed : <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD>н<EFBFBD>
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function QuestFailed( Var )
|
|
|
|
|
cExecCheck "QuestFailed"
|
|
|
|
|
|
|
|
|
|
--DebugLog("==========================QuestFailed_Start==========================")
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "QuestFailed : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local QuestFailedInfo = Var["QuestFailed"]
|
|
|
|
|
if QuestFailedInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["QuestFailed"] = {}
|
|
|
|
|
QuestFailedInfo = Var["QuestFailed"]
|
|
|
|
|
|
|
|
|
|
QuestFailedInfo["NextStepWaitTime"] = Var["CurSec"] + DelayTime["WaitSeconds"]
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD>ʿ<EFBFBD> <EFBFBD>ִ<EFBFBD> job2_ElfKnight, Job2_LIzardK<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
VanishMob( Var )
|
|
|
|
|
|
|
|
|
|
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ
|
|
|
|
|
cEffectMsg( Var["PlayerHandle"], EFFECT_MSG_TYPE["EMT_FAIL"] )
|
|
|
|
|
|
|
|
|
|
--Ÿ<EFBFBD≯<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
Var["LimitTime"] = "NoLimit"
|
|
|
|
|
cTimer( Var["MapIndex"], 0 )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if QuestFailedInfo["NextStepWaitTime"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
else
|
|
|
|
|
Var["StepFunc"] = ReturnToHome
|
|
|
|
|
Var["QuestFailed"] = nil
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
-- ReturnToHome : <EFBFBD><EFBFBD>ȯ
|
|
|
|
|
------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
function ReturnToHome( Var )
|
|
|
|
|
cExecCheck "ReturnToHome"
|
|
|
|
|
|
|
|
|
|
--DebugLog("==========================ReturnToHome_Start==========================")
|
|
|
|
|
|
|
|
|
|
if Var == nil
|
|
|
|
|
then
|
|
|
|
|
ErrorLog( "ReturnToHome : Var nil" )
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
local ReturnToHomeInfo = Var["ReturnToHome"]
|
|
|
|
|
if ReturnToHomeInfo == nil
|
|
|
|
|
then
|
|
|
|
|
Var["ReturnToHome"] = {}
|
|
|
|
|
ReturnToHomeInfo = Var["ReturnToHome"]
|
|
|
|
|
|
|
|
|
|
ReturnToHomeInfo["ReturnStepSec"] = Var["CurSec"]
|
|
|
|
|
ReturnToHomeInfo["ReturnStepNo"] = 1
|
|
|
|
|
ReturnToHomeInfo["WaitSecReturnToHome"] = Var["CurSec"] + DelayTime["WaitReturnToHome"]
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
if ReturnToHomeInfo["WaitSecReturnToHome"] > Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Return : return notice substep
|
|
|
|
|
if ReturnToHomeInfo["ReturnStepNo"] <= #NoticeInfo["IDReturn"]
|
|
|
|
|
then
|
|
|
|
|
if ReturnToHomeInfo["ReturnStepSec"] < Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
-- Notice of Escape
|
|
|
|
|
if NoticeInfo["IDReturn"][ ReturnToHomeInfo["ReturnStepNo"] ]["Index"] ~= nil
|
|
|
|
|
then
|
|
|
|
|
cNotice( Var["MapIndex"], NoticeInfo["ScriptFileName"], NoticeInfo["IDReturn"][ ReturnToHomeInfo["ReturnStepNo"] ]["Index"] )
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Go To Next Notice
|
|
|
|
|
ReturnToHomeInfo["ReturnStepNo"] = Var["ReturnToHome"]["ReturnStepNo"] + 1
|
|
|
|
|
ReturnToHomeInfo["ReturnStepSec"] = Var["CurSec"] + DelayTime["GapReturnNotice"]
|
|
|
|
|
end
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- Return : linkto substep
|
|
|
|
|
if ReturnToHomeInfo["ReturnStepNo"] > #NoticeInfo["IDReturn"]
|
|
|
|
|
then
|
|
|
|
|
if ReturnToHomeInfo["ReturnStepSec"] <= Var["CurSec"]
|
|
|
|
|
then
|
|
|
|
|
cLinkToAll( Var["MapIndex"], LinkInfo["ReturnMap"]["MapIndex"], LinkInfo["ReturnMap"]["X"], LinkInfo["ReturnMap"]["Y"] )
|
|
|
|
|
|
|
|
|
|
cVanishAll( Var["MapIndex"] )
|
|
|
|
|
cMobSuicide( Var["MapIndex"] )
|
|
|
|
|
|
|
|
|
|
Var["StepFunc"] = DummyFunc
|
|
|
|
|
Var["ReturnToHome"] = nil
|
|
|
|
|
|
|
|
|
|
-- 2014.12.23 <EFBFBD>߰<EFBFBD><EFBFBD>۾<EFBFBD>
|
|
|
|
|
cDropFilm( Var["MapIndex"], MainLuaScriptPath )
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
end
|