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/KQ/KDSpring/KDSpring.lua

489 lines
14 KiB

require( "common" )
require( "KQ/KDSpring/KDSpring_Data" )
require( "KQ/KDSpring/KDSpring_StepFunc" )
------------------------------------------------------------------------------------------
-- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ --
------------------------------------------------------------------------------------------
function KF_INIT( Field, KSMemory, nCurSec )
cExecCheck "KF_INIT"
if Field == nil
then -- <EFBFBD>ʵ<EFBFBD> <EFBFBD≯<EFBFBD> Ȯ<EFBFBD><EFBFBD>
return
end
if KSMemory == nil
then -- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
return
end
if nCurSec == nil
then -- <EFBFBD>ð<EFBFBD> Ȯ<EFBFBD><EFBFBD>
return
end
-- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD>ʵ<EFBFBD> <EFBFBD><EFBFBD>ũ<EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
cSetFieldScript( Field, KQ_SCRIPT_NAME )
cFieldScriptFunc( Field, "MapLogin", "KF_MAP_LOGIN" ) -- ij<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>ȭ
KSMemory["FIELD_NAME"] = Field
KSMemory["WORK_TICK"] = 0
KSMemory["STEP_NO"] = 1
KSMemory["STEP_NEXT_TIME"] = nCurSec + KQ_STEP[1]["KS_NEXT_TIME"]
KSMemory["MSG_NO"] = 1
KSMemory["MSG_NEXT_TIME"] = 1
KSMemory["GAME_TYPE"] = KQ_GAME_TYEP["KGT_NORMAL"]
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ
KSMemory["FLAG_INFO"] = {}
KSMemory["FLAG_INFO"]["FHND"] = KQ_INVALID_HANDLE
KSMemory["FLAG_INFO"]["FINDEX"] = ""
KSMemory["FLAG_INFO"]["FPHND"] = KQ_INVALID_HANDLE
KSMemory["FLAG_INFO"]["FPICK_TIME"] = 0
KSMemory["FLAG_INFO"]["FREGEN_TIME"] = 0
KSMemory["FLAG_INFO"]["FREGEN_X"] = KQ_FLAG_POINT["KFP_X"]
KSMemory["FLAG_INFO"]["FREGEN_Y"] = KQ_FLAG_POINT["KFP_Y"]
-- <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD>ʱ<EFBFBD>ȭ
KSMemory["PLAYER_LIST"] = {}
-- KSMemory["PLAYER_LIST"][n] = {}
-- KSMemory["PLAYER_LIST"][n]["PHND"] = KQ_INVALID_HANDLE
-- KSMemory["PLAYER_LIST"][n]["PREG_NO"] = KQ_INVALID_HANDLE
-- KSMemory["PLAYER_LIST"][n]["PNAME"] = ""
-- KSMemory["PLAYER_LIST"][n]["PTEAM_NO"] = 0
-- KSMemory["PLAYER_LIST"][n]["PIS_MAP"] = false
-- KSMemory["PLAYER_LIST"][n]["PPICK_TIME"] = 0
-- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ
KSMemory["TEAM_LIST"] =
{
{ -- RED TEAM
TSCORE = 0,
TPOINT_HND = KQ_INVALID_HANDLE,
TMEMBER_LIST = {},
},
{ -- BLUE TEAM
TSCORE = 0,
TPOINT_HND = KQ_INVALID_HANDLE,
TMEMBER_LIST = {},
},
}
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
KSMemory["MOB_LIST"] = {}
-- KSMemory["MOB_LIST"][n] = {}
-- KSMemory["MOB_LIST"][n]["MHND"] = KQ_INVALID_HANDLE
-- KSMemory["MOB_LIST"][n]["MREGEN_TIME"] = 0
-- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȯ
KSMemory["DOOR_LIST"] = {}
for i = 1, #KQ_DOOR
do
KSMemory["DOOR_LIST"][i] = cDoorBuild( KSMemory["FIELD_NAME"], KQ_DOOR[i]["KD_INDEX"], KQ_DOOR[i]["KD_X"], KQ_DOOR[i]["KD_Y"], KQ_DOOR[i]["KD_DIR"], KQ_DOOR[i]["KD_SCALE"] )
cDoorAction( KSMemory["DOOR_LIST"][i], KQ_DOOR[i]["KD_BLOCK"], "open" )
end
end
------------------------------------------------------------------------------------------
-- <EFBFBD><EFBFBD> <EFBFBD>α<EFBFBD><EFBFBD><EFBFBD> --
------------------------------------------------------------------------------------------
function KF_MAP_LOGIN( Field, Handle )
cExecCheck "KF_MAP_LOGIN"
local KSMemory = InstanceField[Field] -- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
local nCurSec = cCurSec(); -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD>(<EFBFBD><EFBFBD>)
if KSMemory == nil
then -- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
return
end
if Handle == nil
then -- <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD> <EFBFBD>ڵ<EFBFBD> Ȯ<EFBFBD><EFBFBD>
return
end
if nCurSec == nil
then -- <EFBFBD>ð<EFBFBD> Ȯ<EFBFBD><EFBFBD>
nCurSec = 0
end
local nAdminLevel = cGetAdminLevel( Handle ) -- <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
local nCharNo = cGetCharNo( Handle ) -- ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȣ
local TeamInfo = KSMemory["TEAM_LIST"] -- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD> : <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if nAdminLevel > 0
then -- <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
if cAbstateRestTime( Handle, "StaGMHideMode" ) ~= nil
then -- Hide <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
return
end
end
if nCharNo == nil
then -- ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȣ Ȯ<EFBFBD><EFBFBD>
return
end
if TeamInfo == nil
then -- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
return
end
local bLinkto = false -- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ġ<EFBFBD><EFBFBD> <EFBFBD>̵<EFBFBD>
local bNewPlayer = true -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD>
local nPlayerNum = #KSMemory["PLAYER_LIST"] -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD> <EFBFBD><EFBFBD>
local nPlayerIndex = nPlayerNum + 1 -- <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD> <EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>߰<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ε<EFBFBD><EFBFBD><EFBFBD>
local nTeamNo = KQ_TEAM_NO["KTN_DEFAULT"] -- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȣ
for i = 1, nPlayerNum
do -- <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ž<EFBFBD><EFBFBD>
if KSMemory["PLAYER_LIST"][i]["PREG_NO"] == nCharNo
then -- <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD> <EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD>
bNewPlayer = false
nPlayerIndex = i
nTeamNo = KSMemory["PLAYER_LIST"][i]["PTEAM_NO"]
if KSMemory["PLAYER_LIST"][i]["PHND"] ~= Handle
then -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ٲ<EFBFBD> <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD>
cAssertLog( "Handle Change" )
KSMemory["PLAYER_LIST"][i]["PHND"] = Handle
for j = 1, #TeamInfo[nTeamNo]
do -- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ž<EFBFBD><EFBFBD>
if TeamInfo[nTeamNo]["TMEMBER_LIST"][j] == KSMemory["PLAYER_LIST"][i]["PHND"]
then -- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
TeamInfo[nTeamNo]["TMEMBER_LIST"][j] = Handle
end
end
end
KSMemory["PLAYER_LIST"][i]["PPICK_TIME"] = nCurSec + KQ_PLAYER_PICK_DELAY -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȹ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD>
if KSMemory["PLAYER_LIST"][i]["PIS_MAP"] == false
then -- ŷ<EFBFBD><EFBFBD> <EFBFBD>ۿ<EFBFBD> <EFBFBD>־<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
bLinkto = true
KSMemory["PLAYER_LIST"][i]["PIS_MAP"] = true
end
break
end
end
if bNewPlayer == true and -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD>
nPlayerNum >= KQ_MAX_PLAYER -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>
then -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD> <EFBFBD>ִ<EFBFBD> <EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
cLinkTo( Handle, KQ_RETURN_MAP["KRM_INDEX"], KQ_RETURN_MAP["KRM_X"],KQ_RETURN_MAP["KRM_Y"] )
return
end
if bNewPlayer == true
then -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD>
KSMemory["PLAYER_LIST"][nPlayerIndex] = {}
KSMemory["PLAYER_LIST"][nPlayerIndex]["PHND"] = Handle -- <EFBFBD>ڵ<EFBFBD>
KSMemory["PLAYER_LIST"][nPlayerIndex]["PREG_NO"] = nCharNo -- ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȣ
KSMemory["PLAYER_LIST"][nPlayerIndex]["PNAME"] = cGetPlayerName( Handle ) -- ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD≯<EFBFBD>
KSMemory["PLAYER_LIST"][nPlayerIndex]["PTEAM_NO"] = KQ_TEAM_NO["KTN_DEFAULT"] -- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȣ
KSMemory["PLAYER_LIST"][nPlayerIndex]["PIS_MAP"] = true -- <EFBFBD>ʿ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD><EFBFBD><EFBFBD>
KSMemory["PLAYER_LIST"][nPlayerIndex]["PPICK_TIME"] = nCurSec + KQ_PLAYER_PICK_DELAY -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȹ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD>
-- <EFBFBD><EFBFBD>Ƽ <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
cPartyLeave( Handle )
end
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
cScoreInfo( Handle, #KQ_TEAM, TeamInfo[KQ_TEAM_NO["KTN_RED"]]["TSCORE"], TeamInfo[KQ_TEAM_NO["KTN_BLUE"]]["TSCORE"] )
-- <EFBFBD><EFBFBD> <EFBFBD>α<EFBFBD><EFBFBD>ν<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD> <EFBFBD>ɱ<EFBFBD>
cSetAbstate( Handle, KQ_MAPLOGIN_ABSTATE["KMA_INDEX"], KQ_MAPLOGIN_ABSTATE["KMA_STR"], KQ_MAPLOGIN_ABSTATE["KMA_KEEPTIME"] )
if nTeamNo == KQ_TEAM_NO["KTN_DEFAULT"]
then -- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȣ Ȯ<EFBFBD><EFBFBD>
local RedMemberNum = #TeamInfo[KQ_TEAM_NO["KTN_RED"]]["TMEMBER_LIST"]
local BlueMemberNum = #TeamInfo[KQ_TEAM_NO["KTN_BLUE"]]["TMEMBER_LIST"]
if RedMemberNum > 0 or BlueMemberNum > 0
then -- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
if cPermileRate( 500 ) == 1
then -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȣ <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
nTeamNo = KQ_TEAM_NO["KTN_RED"]
if RedMemberNum > BlueMemberNum
then -- <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>
nTeamNo = KQ_TEAM_NO["KTN_BLUE"]
end
else
nTeamNo = KQ_TEAM_NO["KTN_BLUE"]
if BlueMemberNum > RedMemberNum
then -- <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>
nTeamNo = KQ_TEAM_NO["KTN_RED"]
end
end
local nIndex = (#TeamInfo[nTeamNo]["TMEMBER_LIST"] + 1)
-- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>߰<EFBFBD>
TeamInfo[nTeamNo]["TMEMBER_LIST"][nIndex] = Handle
KSMemory["PLAYER_LIST"][nPlayerIndex]["PTEAM_NO"] = nTeamNo
-- <EFBFBD><EFBFBD>Ƽ <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
cPartyJoin( TeamInfo[nTeamNo]["TMEMBER_LIST"][1], Handle )
-- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>̵<EFBFBD>
cLinkTo( Handle, KSMemory["FIELD_NAME"], KQ_TEAM[nTeamNo]["KT_POINT_X"], KQ_TEAM[nTeamNo]["KT_POINT_Y"] )
end
return
end
if bLinkto == true and -- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ġ<EFBFBD><EFBFBD> <EFBFBD>̵<EFBFBD>
KQ_STEP[KSMemory["STEP_NO"]]["KS_LINKTO_TEAM"] == true -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> : <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ġ<EFBFBD><EFBFBD> <EFBFBD>̵<EFBFBD>
then -- <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ġ<EFBFBD><EFBFBD> <EFBFBD>̵<EFBFBD>
cLinkTo( Handle, KSMemory["FIELD_NAME"], KQ_TEAM[nTeamNo]["KT_POINT_X"], KQ_TEAM[nTeamNo]["KT_POINT_Y"] )
return
end
for j = 1, #KQ_TEAM[nTeamNo]["KT_UNIFORM"]
do -- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
cViewSlotEquip( Handle, KQ_TEAM[nTeamNo]["KT_UNIFORM"][j] )
end
if KQ_STEP[KSMemory["STEP_NO"]]["KS_TIMER"] == true
then -- Ÿ<EFBFBD≯<EFBFBD> ǥ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
local nTime = (KSMemory["STEP_NEXT_TIME"] - nCurSec)
cTimer_Obj( Handle, nTime )
end
end
------------------------------------------------------------------------------------------
-- <EFBFBD>޼<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> --
------------------------------------------------------------------------------------------
function KF_MESSAGE( KSMemory, nCurSec )
cExecCheck "KF_MESSAGE"
if KSMemory == nil
then -- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
return false
end
if nCurSec == nil
then -- <EFBFBD>ð<EFBFBD> Ȯ<EFBFBD><EFBFBD>
return false
end
if KQ_STEP[KSMemory["STEP_NO"]]["KS_MSG"] == nil
then -- <EFBFBD>ش<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>޽<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
return true
end
if KSMemory["MSG_NEXT_TIME"] > nCurSec
then -- <EFBFBD>޽<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD> Ȯ<EFBFBD><EFBFBD>
return true
end
local MsgData = KQ_MSG[KQ_STEP[KSMemory["STEP_NO"]]["KS_MSG"]] -- <EFBFBD>޽<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
local MsgStep = KSMemory["MSG_NO"] -- <EFBFBD>޽<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ܰ<EFBFBD>
if MsgData == nil
then -- <EFBFBD>޽<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
return false
end
if MsgStep == nil
then -- <EFBFBD>޽<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ܰ<EFBFBD> Ȯ<EFBFBD><EFBFBD>
return false
end
if #MsgData < MsgStep
then --<EFBFBD>޽<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ܰ<EFBFBD> <EFBFBD>ִ<EFBFBD>ġ Ȯ<EFBFBD><EFBFBD>
return true
end
if MsgData[MsgStep]["KM_TYPE"] == KQ_MSG_TYPE["KMT_SHN"]
then -- ScriptMessage
cScriptMessage( KSMemory["FIELD_NAME"], MsgData[MsgStep]["KM_INDEX"], MsgData[MsgStep]["KM_VAL"] )
elseif MsgData[MsgStep]["KM_TYPE"] == KQ_MSG_TYPE["KMT_TXT"]
then -- Notice
cNotice( KSMemory["FIELD_NAME"], MsgData[MsgStep]["KM_FILE_NAME"], MsgData[MsgStep]["KM_INDEX"] )
end
-- <EFBFBD>޽<EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ܰ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
MsgStep = MsgStep + 1
if #MsgData < MsgStep
then -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>޽<EFBFBD><EFBFBD><EFBFBD> ó<EFBFBD><EFBFBD>
KSMemory["MSG_NO"] = 1
KSMemory["MSG_NEXT_TIME"] = KSMemory["STEP_NEXT_TIME"]
else -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ܰ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
KSMemory["MSG_NO"] = MsgStep
KSMemory["MSG_NEXT_TIME"] = nCurSec + MsgData[MsgStep]["KM_TIME"]
end
end
------------------------------------------------------------------------------------------
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD>ƾ --
------------------------------------------------------------------------------------------
function KF_FLGAG_OBJECT( Handle, Field )
cExecCheck "KF_FLGAG_OBJECT"
local KSMemory = InstanceField[Field] -- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
local nCurSec = cCurSec() -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD>(<EFBFBD><EFBFBD>)
if KSMemory == nil
then -- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
return ReturnAI.END
end
if KSMemory["FLAG_INFO"] == nil
then -- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD> : <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
return ReturnAI.END
end
if KSMemory["FLAG_INFO"]["FPHND"] ~= KQ_INVALID_HANDLE
then -- ŷ<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>
cNPCVanish( Handle )
return ReturnAI.END
end
if KSMemory["PLAYER_LIST"] == nil
then -- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD> : <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
return ReturnAI.END
end
if nCurSec == nil
then -- <EFBFBD>ð<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
return ReturnAI.END
end
if nCurSec < KSMemory["FLAG_INFO"]["FPICK_TIME"]
then -- <EFBFBD>ð<EFBFBD> Ȯ<EFBFBD><EFBFBD>
return ReturnAI.END
end
local nCheckDist = KQ_FLAG["KF_CHECK_DIST"] -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> üũ <EFBFBD>Ÿ<EFBFBD>(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD>Ÿ<EFBFBD>)
if KSMemory["FLAG_INFO"]["FINDEX"] == KQ_FLAG_POINT["KFP_INDEX"]
then -- <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>Ʈ )
nCheckDist = KQ_FLAG_POINT["KFP_CHECK_DIST"]
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>
local PlayerList = { cNearObjectList( Handle, nCheckDist, ObjectType["Player"] ) }
for i = 1, #PlayerList
do
for j = 1, #KSMemory["PLAYER_LIST"]
do
if KSMemory["PLAYER_LIST"][j]["PHND"] == PlayerList[i] and -- <EFBFBD>ڵ<EFBFBD>
KSMemory["PLAYER_LIST"][j]["PTEAM_NO"] ~= KQ_TEAM_NO["KTN_DEFAULT"] and -- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȣ
KSMemory["PLAYER_LIST"][j]["PPICK_TIME"] <= nCurSec -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȹ<EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD>
then -- <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>
KSMemory["FLAG_INFO"]["FHND"] = KQ_INVALID_HANDLE -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ڵ<EFBFBD>
KSMemory["FLAG_INFO"]["FPHND"] = PlayerList[i] -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȹ<EFBFBD><EFBFBD> <EFBFBD>÷<EFBFBD><EFBFBD>̾<EFBFBD> <EFBFBD>ڵ<EFBFBD>
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̻<EFBFBD> <EFBFBD>ɱ<EFBFBD>
for k = 1, #KQ_FLAG_ABSTATE
do
cSetAbstate( KSMemory["FLAG_INFO"]["FPHND"], KQ_FLAG_ABSTATE[k]["KFA_INDEX"], KQ_FLAG_ABSTATE[k]["KFA_STR"], KQ_FLAG_ABSTATE[k]["KFA_KEEPTIME"] )
end
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȹ<EFBFBD><EFBFBD> <EFBFBD>˸<EFBFBD>
cScriptMessage( KSMemory["FIELD_NAME"], KQ_FLAG_SCRIPT_MSG["KFSM_HAVE"], KSMemory["PLAYER_LIST"][j]["PNAME"] )
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
local nTeamNo = KSMemory["PLAYER_LIST"][j]["PTEAM_NO"]
if nTeamNo ~= nil
then -- <EFBFBD><EFBFBD> <EFBFBD><EFBFBD>ȣ Ȯ<EFBFBD><EFBFBD>
if KSMemory["TEAM_LIST"][nTeamNo]["TPOINT_HND"] == KQ_INVALID_HANDLE
then -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD>ڵ<EFBFBD> Ȯ<EFBFBD><EFBFBD>
KSMemory["TEAM_LIST"][nTeamNo]["TPOINT_HND"] = cMobRegen_XY( Field, KQ_TEAM[nTeamNo]["KT_POINT_INDEX"], KQ_TEAM[nTeamNo]["KT_POINT_X"], KQ_TEAM[nTeamNo]["KT_POINT_Y"], 0 )
end
for k = 1, #KSMemory["TEAM_LIST"][nTeamNo]["TMEMBER_LIST"]
do
cPlaySound( KSMemory["TEAM_LIST"][nTeamNo]["TMEMBER_LIST"][k], KQ_SOUND["KS_GETFLAG"] );
end
end
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
cNPCVanish( Handle )
return ReturnAI.END
end
end
end
return ReturnAI.END
end
------------------------------------------------------------------------------------------
-- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>Լ<EFBFBD> --
------------------------------------------------------------------------------------------
function Main( Field )
cExecCheck "Main"
local nCurSec = cCurSec() -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ð<EFBFBD>(<EFBFBD><EFBFBD>)
local KSMemory = InstanceField[Field] -- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if KSMemory == nil
then -- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ȯ<EFBFBD><EFBFBD>
-- ŷ<EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>ʱ<EFBFBD>ȭ
InstanceField[Field] = {}
KSMemory = InstanceField[Field]
KF_INIT( Field, KSMemory, nCurSec )
end
if KSMemory["STEP_NO"] == nil
then -- ó<EFBFBD><EFBFBD> <EFBFBD>ܰ<EFBFBD> Ȯ<EFBFBD><EFBFBD>
return
end
if KQ_STEP[KSMemory["STEP_NO"]]["KS_FUNC"]( KSMemory, nCurSec ) == false
then -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD>Լ<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
cLinkToAll( KSMemory["FIELD_NAME"], KQ_RETURN_MAP["KRM_INDEX"], KQ_RETURN_MAP["KRM_X"], KQ_RETURN_MAP["KRM_Y"] )
cEndOfKingdomQuest( KSMemory["FIELD_NAME"] )
end
end