forked from Thrinaria/ServerResource
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGuildCombat1TO1.lua
130 lines (98 loc) · 3.48 KB
/
GuildCombat1TO1.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
-----------------------------------------------------------------------------------------
-- Begin Script -------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
-- 루아 스크립트는 "//" 대신 "--"를 사용하여 주석처리 한다.
-- 블럭 주석은 "/*, */"대신 "--[[, --]]"를 사용한다.
-----------------------------------------------------------------------------------------
-- 최소 참가 PENYA 설정
MinJoinPenya = 110000000
-- 최소 참가 길드 레벨 설정
MinGuildLevel = 20
-- 최소 참여 길드 개수
MinJoinGuild = 2
-- 최대 전쟁을 할수 있는 길드 개수
MaxJoinGuild = 8
-- 최소 참가 인원
MinJoinPlayer = 6
-- 최대 참가 인원
MaxJoinPlayer = 11
-- 최소 참가 레벨
MinJoinPlayerLevel = 30
-- 대전한 참가자들의 최대 생명수
PlayerLife = 1
-- 참가 취소 시 돌려주는 페냐 %
CancelReturnRate = 80
-- 입찰 실패 시 돌려주는 페냐 %
FailReturnRate = 98
-- 참가자 작성 시간(msec)
MemberLineUpTime = 3600000
-- 입장대기시간 (msec)
EntranceWaitTime = 600000
-- 대전 시작전 대기시간(msec)
WarWaitTime = 60000
-- 대전 시간(msec)
WarTime = 600000
-- 대전 종료 후 대기 시간(msec)
WarCloseWaitTime = 30000
-- 대전 승리시 얻는 칩 갯수 공식
WinChipNum = MinJoinPenya * 0.9 * 0.00001 / MaxJoinPlayer
OPENTIME = {} -- 초기화(수정 금지)
-- 자동 오픈 시간 설정( 요일 순서로, index는 1부터 시작, 시간은 2자리로[예 - 07:08] )
-- 요일 순서 - Sun, Mon, Tue, Wed, Thu, Fri, Sat : 대소문자 구분함, 가장 빠른 요일이 index 1에 배정.
OPENTIME[1] = "Sat 17:00"
------------------------------------------------------------------------------
-- Function ------------------------------------------------------------------
------------------------------------------------------------------------------
-- __DBSERVER
function CheckOpenTime()
local strNowTime = os.date("%a %H:%M")
for i in pairs(OPENTIME) do
if( OPENTIME[i] == strNowTime ) then
return 1
end
end
return 0
end
-- 남은 시간 __WORLDSERVER
function GetRemainNextTime()
if( table.getn(OPENTIME) == 0 ) then
return 0
end
local nNowDay = tonumber( os.date("%w") )
local nNowHour = tonumber( os.date("%H") )
local nNowMin = tonumber( os.date("%M") )
local nNowSec = tonumber( os.date("%S") )
for i in pairs(OPENTIME) do
local a, b, c = GetWeekDayStrToNum( OPENTIME[i] )
if( a > nNowDay ) then
return ((a-nNowDay)*24*3600)+((b-nNowHour)*3600)+((c-nNowMin)*60)-nNowSec
elseif( (a == nNowDay) and (b > nNowHour) ) then
return ((b-nNowHour)*3600)+((c-nNowMin)*60)-nNowSec
elseif( (a == nNowDay) and (b == nNowHour) and (c > nNowMin) ) then
return ((c-nNowMin)*60)-nNowSec
elseif( (a == nNowDay) and (b == nNowHour) and (c == nNowMin) ) then
return nNowSec
end
end
-- 다음이 없으면...
local a, b, c = GetWeekDayStrToNum( OPENTIME[1] )
return ((7-nNowDay+a)*24*3600)+((b-nNowHour)*3600)+((c-nNowMin)*60)-nNowSec
end
-- 요일을 수치화
function GetWeekDayStrToNum( strTime )
local a = 0
local nTemp1, nTemp2 = string.find(strTime, "%d%d:")
local b = tonumber( string.sub(strTime, nTemp1, nTemp2-1) )
nTemp1, nTemp2 = string.find(strTime, ":%d%d")
local c = tonumber( string.sub(strTime, nTemp1+1, nTemp2) )
local strDay = string.sub(strTime, string.find(strTime, "%a+"))
if( strDay == "Sun" ) then a=0
elseif( strDay == "Mon" ) then a=1
elseif( strDay == "Tue" ) then a=2
elseif( strDay == "Wed" ) then a=3
elseif( strDay == "Thu" ) then a=4
elseif( strDay == "Fri" ) then a=5
elseif( strDay == "Sat" ) then a=6
end
return a, b, c
end