Code:
-- ÃʱâÈ* ----------------------------------------------------------
--------------------------------------------------------------------
dofile( ".\\LuaFunc\\GuildHouseFunc.lua" )
--------------------------------------------------------------------
--[[
SetNoticeTime( 2, "15:00", 4, "15:00" ) -- °øÁö ½ÃÀÛ, Á¾·á
SetTenderTime( 4, "15:00", 0, "15:00" ) -- ÀÔÂû ½ÃÀÛ, Á¾·á
SetTenderInfo( "WI_GUILDHOUSE_MIDDLE" )
--{
SetMaxTender( 5 ) -- ȸÂ÷´ç ÃÖ´ë ¹°·®
SetMinTenderPenya( 100000000 ) -- ÀÔÂû ÃÖ¼Ò Æä³Ä
SetChargeRate( 1 ) -- ¹Ýȯ ¼ö¼ö·áÀ²( % )
SetNpc( strNpcId, nAreaIndex )
:
--}
SetGuildHouseInfo( strGHId, strNpcId, strGHType, nAreaIndex, strTitle )
--]]
--------------------------------------------------------------------
--------------------------------------------------------------------
-- 0 = Sunday, 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday
SetNoticeTime( 2, "15:00", 4, "15:00" )
SetTenderTime( 4, "15:00", 0, "14:00" )
SetTenderInfo( "WI_GUILDHOUSE_MIDDLE" )
--{
SetMaxTender( 5 )
SetMinTenderPenya( 100000000 )
SetChargeRate( 1 )
SetNoticeTick( MIN(60), MIN(60) )
SetNpc( "MI_MAFL_GUILDWAR04", GH_AREA_FLARIS )
SetNpc( "MI_MaSa_ROA", GH_AREA_SAINTMORNING )
SetNpc( "MI_MaEw_RODELLA", GH_AREA_ELIUN )
--}
SetGuildHouseInfo( "MI_MaFl_GUILDHOUSE_DOOR_01", "MI_MaFl_GUILDHOUSE_NOTICE_01", "WI_GUILDHOUSE_MIDDLE", GH_AREA_FLARIS, "TID_MMI_MAFL_GUILDHOUSE_DOOR_01" )
SetGuildHouseInfo( "MI_MaFl_GUILDHOUSE_DOOR_02", "MI_MaFl_GUILDHOUSE_NOTICE_02", "WI_GUILDHOUSE_MIDDLE", GH_AREA_FLARIS, "TID_MMI_MAFL_GUILDHOUSE_DOOR_02" )
SetGuildHouseInfo( "MI_MaFl_GUILDHOUSE_DOOR_03", "MI_MaFl_GUILDHOUSE_NOTICE_03", "WI_GUILDHOUSE_MIDDLE", GH_AREA_FLARIS, "TID_MMI_MAFL_GUILDHOUSE_DOOR_03" )
SetGuildHouseInfo( "MI_MaFl_GUILDHOUSE_DOOR_04", "MI_MaFl_GUILDHOUSE_NOTICE_04", "WI_GUILDHOUSE_MIDDLE", GH_AREA_FLARIS, "TID_MMI_MAFL_GUILDHOUSE_DOOR_04" )
SetGuildHouseInfo( "MI_MaFl_GUILDHOUSE_DOOR_05", "MI_MaFl_GUILDHOUSE_NOTICE_05", "WI_GUILDHOUSE_MIDDLE", GH_AREA_FLARIS, "TID_MMI_MAFL_GUILDHOUSE_DOOR_05" )
SetGuildHouseInfo( "MI_MaSa_GUILDHOUSE_DOOR_01", "MI_MaSa_GUILDHOUSE_NOTICE_01", "WI_GUILDHOUSE_MIDDLE", GH_AREA_SAINTMORNING, "TID_MMI_MASA_GUILDHOUSE_DOOR_01" )
SetGuildHouseInfo( "MI_MaSa_GUILDHOUSE_DOOR_02", "MI_MaSa_GUILDHOUSE_NOTICE_02", "WI_GUILDHOUSE_MIDDLE", GH_AREA_SAINTMORNING, "TID_MMI_MASA_GUILDHOUSE_DOOR_02" )
SetGuildHouseInfo( "MI_MaSa_GUILDHOUSE_DOOR_03", "MI_MaSa_GUILDHOUSE_NOTICE_03", "WI_GUILDHOUSE_MIDDLE", GH_AREA_SAINTMORNING, "TID_MMI_MASA_GUILDHOUSE_DOOR_03" )
SetGuildHouseInfo( "MI_MaSa_GUILDHOUSE_DOOR_04", "MI_MaSa_GUILDHOUSE_NOTICE_04", "WI_GUILDHOUSE_MIDDLE", GH_AREA_SAINTMORNING, "TID_MMI_MASA_GUILDHOUSE_DOOR_04" )
SetGuildHouseInfo( "MI_MaSa_GUILDHOUSE_DOOR_05", "MI_MaSa_GUILDHOUSE_NOTICE_05", "WI_GUILDHOUSE_MIDDLE", GH_AREA_SAINTMORNING, "TID_MMI_MASA_GUILDHOUSE_DOOR_05" )
SetGuildHouseInfo( "MI_MaSa_GUILDHOUSE_DOOR_06", "MI_MaSa_GUILDHOUSE_NOTICE_06", "WI_GUILDHOUSE_MIDDLE", GH_AREA_SAINTMORNING, "TID_MMI_MASA_GUILDHOUSE_DOOR_06" )
SetGuildHouseInfo( "MI_MaSa_GUILDHOUSE_DOOR_07", "MI_MaSa_GUILDHOUSE_NOTICE_07", "WI_GUILDHOUSE_MIDDLE", GH_AREA_SAINTMORNING, "TID_MMI_MASA_GUILDHOUSE_DOOR_07" )
SetGuildHouseInfo( "MI_MaSa_GUILDHOUSE_DOOR_08", "MI_MaSa_GUILDHOUSE_NOTICE_08", "WI_GUILDHOUSE_MIDDLE", GH_AREA_SAINTMORNING, "TID_MMI_MASA_GUILDHOUSE_DOOR_08" )
SetGuildHouseInfo( "MI_MaSa_GUILDHOUSE_DOOR_09", "MI_MaSa_GUILDHOUSE_NOTICE_09", "WI_GUILDHOUSE_MIDDLE", GH_AREA_SAINTMORNING, "TID_MMI_MASA_GUILDHOUSE_DOOR_09" )
SetGuildHouseInfo( "MI_MaEw_GUILDHOUSE_DOOR_01", "MI_MaEw_GUILDHOUSE_NOTICE_01", "WI_GUILDHOUSE_MIDDLE", GH_AREA_ELIUN, "TID_MMI_MAEW_GUILDHOUSE_DOOR_01" )
SetGuildHouseInfo( "MI_MaEw_GUILDHOUSE_DOOR_02", "MI_MaEw_GUILDHOUSE_NOTICE_02", "WI_GUILDHOUSE_MIDDLE", GH_AREA_ELIUN, "TID_MMI_MAEW_GUILDHOUSE_DOOR_02" )
SetGuildHouseInfo( "MI_MaEw_GUILDHOUSE_DOOR_03", "MI_MaEw_GUILDHOUSE_NOTICE_03", "WI_GUILDHOUSE_MIDDLE", GH_AREA_ELIUN, "TID_MMI_MAEW_GUILDHOUSE_DOOR_03" )
SetGuildHouseQuest( "QUEST_GUILDHOUSE_TRN1", "WI_GUILDHOUSE_MIDDLE", 1, "CI_MIDDLE_GUILDHOUSE_DOOR_01" )
SetGuildHouseQuest( "QUEST_GUILDHOUSE_TRN2", "WI_GUILDHOUSE_MIDDLE", 2, "CI_MIDDLE_GUILDHOUSE_DOOR_02" )
SetGuildHouseQuest( "QUEST_GUILDHOUSE_TRN3", "WI_GUILDHOUSE_MIDDLE", 3, "CI_MIDDLE_GUILDHOUSE_DOOR_03" )
Code:
function MIN( a ) return a * 1000 * 60 end
--------------------------------------------------------------------
GH_AREA_FLARIS = 1
GH_AREA_SAINTMORNING = 2
GH_AREA_ELIUN = 3
--------------------------------------------------------------------
tTender = {}
tNpc = {}
tGHInfo = {}
tGHQuest = {}
tNoticeTime = {}
tTenderTime = {}
function GetTimeToNumber( strTime )
local strTemp = ""
local j = 0
for i in string.gfind( strTime, "%d+" ) do
j = j + 1
if( (j~=1) and (tonumber(i)<10) ) then
i = "0"..tonumber(i)
end
strTemp = strTemp..i
end
return tonumber( strTemp )
end
function SetNoticeTime( nBeginDay, strBeginTime, nEndDay, strEndTime )
tNoticeTime.nBeginDay = nBeginDay
tNoticeTime.strBeginTime = strBeginTime
tNoticeTime.nEndDay = nEndDay
tNoticeTime.strEndTime = strEndTime
end
function SetTenderTime( nBeginDay, strBeginTime, nEndDay, strEndTime )
tTenderTime.nBeginDay = nBeginDay
tTenderTime.strBeginTime = strBeginTime
tTenderTime.nEndDay = nEndDay
tTenderTime.strEndTime = strEndTime
end
function IsNoticeTime()
local nCurrentDay = tonumber( os.date("%w") )
local nCurrentTime = tonumber( os.date("%H%M") )
local nBeginTime = GetTimeToNumber( tNoticeTime.strBeginTime )
local nEndTime = GetTimeToNumber( tNoticeTime.strEndTime )
if( nCurrentDay == tNoticeTime.nBeginDay ) then
if( nCurrentTime >= nBeginTime ) then
return true
end
end
if( nCurrentDay == tNoticeTime.nEndDay ) then
if( nCurrentTime <= nEndTime ) then
return true
end
end
if( tNoticeTime.nEndDay < tNoticeTime.nBeginDay ) then
if( (nCurrentDay > tNoticeTime.nBeginDay) and (nCurrentDay < tNoticeTime.nEndDay + 7) ) then
return true
end
end
if( tNoticeTime.nEndDay > tNoticeTime.nBeginDay ) then
if( (nCurrentDay > tNoticeTime.nBeginDay) and (nCurrentDay < tNoticeTime.nEndDay) ) then
return true
end
end
return false
end
function IsTenderTime()
local nCurrentDay = tonumber( os.date("%w") )
local nCurrentTime = tonumber( os.date("%H%M") )
local nBeginTime = GetTimeToNumber( tTenderTime.strBeginTime )
local nEndTime = GetTimeToNumber( tTenderTime.strEndTime )
if( nCurrentDay == tTenderTime.nBeginDay ) then
if( nCurrentTime >= nBeginTime ) then
return true
end
end
if( nCurrentDay == tTenderTime.nEndDay ) then
if( nCurrentTime <= nEndTime ) then
return true
end
end
if( tTenderTime.nEndDay < tTenderTime.nBeginDay ) then
if( (nCurrentDay > tTenderTime.nBeginDay) and (nCurrentDay < tTenderTime.nEndDay + 7) ) then
return true
end
end
if( tTenderTime.nEndDay > tTenderTime.nBeginDay ) then
if( (nCurrentDay > tTenderTime.nBeginDay) and (nCurrentDay < tTenderTime.nEndDay) ) then
return true
end
end
return false
end
function SetTenderInfo( strGHType )
local nIndex = table.getn( tTender ) + 1
tTender[nIndex] = {}
tTender[nIndex].strGHType = strGHType
tTender[nIndex].nMaxHouse = 1
tTender[nIndex].nMinPenya = 1
tTender[nIndex].nChargeRate = 1
tTender[nIndex].nPrevNoticeTick = 0
tTender[nIndex].nTenderNoticeTick = 0
tTender[nIndex].tNpc = {}
end
function SetMaxTender( nMaxHouse )
local nIndex = table.getn( tTender )
tTender[nIndex].nMaxHouse = nMaxHouse
end
function SetMinTenderPenya( nMinPenya )
local nIndex = table.getn( tTender )
tTender[nIndex].nMinPenya = nMinPenya
end
function SetChargeRate( nChargeRate )
local nIndex = table.getn( tTender )
tTender[nIndex].nChargeRate = nChargeRate
end
function SetNoticeTick( nPrevNoticeTick, nTenderNoticeTick )
local nIndex = table.getn( tTender )
tTender[nIndex].nPrevNoticeTick = nPrevNoticeTick
tTender[nIndex].nTenderNoticeTick = nTenderNoticeTick
end
function SetNpc( strNpcId, nAreaIndex )
local nIndex = table.getn( tTender )
local nNIndex = table.getn( tTender[nIndex].tNpc ) + 1
tTender[nIndex].tNpc[nNIndex] = {}
tTender[nIndex].tNpc[nNIndex].strNpcId = strNpcId
tTender[nIndex].tNpc[nNIndex].nAreaIndex = nAreaIndex
end
function SetGuildHouseInfo( strGHId, strNpcId, strGHType, nAreaIndex, strTitle )
local nIndex = table.getn( tGHInfo ) + 1
tGHInfo[nIndex] = {}
tGHInfo[nIndex].strGHId = strGHId
tGHInfo[nIndex].strNpcId = strNpcId
tGHInfo[nIndex].strGHType = strGHType
tGHInfo[nIndex].nAreaIndex = nAreaIndex
tGHInfo[nIndex].strTitle = strTitle
end
function SetGuildHouseQuest( strQuestId, strGHType, nLevel, strDoorId )
local nIndex = table.getn( tGHQuest ) + 1
tGHQuest[nIndex] = {}
tGHQuest[nIndex].strQuestId = strQuestId
tGHQuest[nIndex].strGHType = strGHType
tGHQuest[nIndex].nLevel = nLevel
tGHQuest[nIndex].strDoorId = strDoorId
end