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.

237 lines
4.0 KiB

--------------------------------------------------------------------------------
-- Gold Hill Routine --
--------------------------------------------------------------------------------
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
-- <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 Var["KQLimitTime"] == nil
then
return
end
if Var["CurSec"] == nil
then
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>.
local nLimitSec = Var["KQLimitTime"] - Var["CurSec"]
cShowKQTimerWithLife_Obj( Handle, nLimitSec )
end
function CoreBreakRoutine( Handle, MapIndex )
cExecCheck "CoreBreakRoutine"
local Var = InstanceField[ MapIndex ]
if Var == nil
then
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
if Var["LayerStep"] == nil
then
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
if Var["LayerStep"]["LayerNumber"] == nil
then
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
if Var["LayerStep"]["LayerNumber"] > #LayerNameTable
then
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
local LayerName = LayerNameTable[ Var["LayerStep"]["LayerNumber"] ]
if Var[ LayerName ] == nil
then
cAIScriptSet( Handle )
cNPCVanish( Handle )
return ReturnAI["END"]
end
if cIsObjectDead( Handle ) == nil
then
return ReturnAI["CPP"]
end
local ItemDropInfo = ItemDrop[ LayerName ]
Var[ LayerName ]["DeadCoreCount"] = Var[ LayerName ]["DeadCoreCount"] + 1
for i = 1, #Var[ LayerName ]["KeyCore"]
do
if Var[ LayerName ]["DeadCoreCount"] >= Var[ LayerName ]["KeyCore"][i]
then
cDropItem( ItemDropInfo["Index"], Handle, -1, ItemDropInfo[i]["DropRate"] )
cNotice( MapIndex, MsgScriptFileDefault, ItemDropInfo["Notice"] )
Var[ LayerName ]["KeyCore"][i] = 100000
break
end
end
cAIScriptSet( Handle )
return ReturnAI["CPP"]
end
function DoorClick( Handle, PlayerHandle, PlayerCharNo, Arg )
cExecCheck "DoorClick"
local MapIndex = cGetCurMapIndex( Handle )
if MapIndex == nil
then
cAIScriptSet( Handle )
cNPCVanish( Handle )
return
end
local Var = InstanceField[ MapIndex ]
if Var == nil
then
cAIScriptSet( Handle )
cNPCVanish( Handle )
return
end
if Var["LayerStep"] == nil
then
return
end
if Var["LayerStep"]["LayerNumber"] == nil
then
return
end
if Var["LayerStep"]["LayerNumber"] > #LayerNameTable
then
return
end
local LayerName = LayerNameTable[ Var["LayerStep"]["LayerNumber"] ]
if Var[ LayerName ] == nil
then
return
end
local ItemDropInfo = ItemDrop[ LayerName ]
local ItemLot, bLocked = cGetItemLot( PlayerHandle, ItemDropInfo["Index"] )
if ItemLot == nil or bLocked == nil
then
return
end
if ItemLot < 1
then
return
end
local PlayerList = { cGetPlayerList( MapIndex ) }
for i = 1, #PlayerList
do
cInvenItemDestroy( PlayerList[ i ], ItemDropInfo["Index"], -1 )
end
cDoorAction( Handle, RegenInfo["Stuff"][ LayerName ]["Block"], "open" )
Var["LayerStep"]["LayerNumber"] = Var["LayerStep"]["LayerNumber"] + 1
Var[ LayerName ] = nil
cAIScriptSet( Handle )
end
function EndGateClick( Handle, PlayerHandle, PlayerCharNo, Arg )
cExecCheck "EndGateClick"
if Handle == nil
then
cAIScriptSet( Handle )
cNPCVanish( Handle )
return
end
local MapIndex = cGetCurMapIndex( Handle )
if MapIndex == nil
then
cAIScriptSet( Handle )
cNPCVanish( Handle )
return
end
local Var = InstanceField[ MapIndex ]
if Var == nil
then
cAIScriptSet( Handle )
cNPCVanish( Handle )
return
end
GoToSuccess( Var )
end