banynavy
22-07-11, 08:17 AM
function Delay(times)
times = times or 1
local time_to = tonumber(date("%S")+times)
while tonumber(date("%S")) < time_to do end
end
tbCity =
{
{"Phîng Têng", 1, 0, 99},{"Thµnh §«", 11, 0, 20},{"BiÖn Kinh", 37, 0, 100},{"T¬ng D¬ng", 78, 0, 53},{"L©m An", 176, 0, 174},{"D¬ng Ch©u", 80, 0, 101},{"§¹i Lý", 162, 0, 153},{"Phîng Têng", 1, 0,121},
}
tbVillage =
{
{"§¹o H¬ng th«n", 101,"D¬ng Ch©u"},{"Long M«n trÊn", 121,"Phîng Têng"},{"VÜnh L¹c trÊn", 99,"Phîng Têng"},{"Th¹ch Cæ trÊn", 153,"§¹i Lý"},{"Giang T©n Th«n", 20,"Thµnh §«"},{"Ba L¨ng huyÖn", 53,"T¬ng D¬ng"},{"Long TuyÒn th«n", 174,"L©m An"},{"Chu Tiªn trÊn", 100,"BiÖn Kinh"},{"Nam Nh¹c trÊn",222,"Ba L¨ng huyÖn"},
{"Phîng Têng", 1, 0, 99},{"Thµnh §«", 11, 0, 20},{"BiÖn Kinh", 37, 0, 100},{"T¬ng D¬ng", 78, 0, 53},{"L©m An", 176, 0, 174},{"D¬ng Ch©u", 80, 0, 101},{"§¹i Lý", 162, 0, 153},{"Phîng Têng", 1, 0,121},
}
tbAllMap=
{
{"§¹o H¬ng th«n", 101,"D¬ng Ch©u"},
{"Long M«n trÊn", 121,"Phîng Têng"},
{"VÜnh L¹c trÊn", 99,"Phîng Têng"},
{"Th¹ch Cæ trÊn", 153,"§¹i Lý"},
{"Giang T©n Th«n", 20,"Thµnh §«"},
{"Ba L¨ng huyÖn", 53,"T¬ng D¬ng"},
{"Long TuyÒn th«n", 174,"L©m An"},
{"Chu Tiªn trÊn", 100,"BiÖn Kinh"},
{"Nam Nh¹c trÊn",222,"Ba L¨ng huyÖn"},
}
tbBattleMapID = {44, 326, 327, 328, 329, 330, 331, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 868, 869, 870,876,877,878,879,880,881,883,884,885, 898, 899, 900, 902, 903, 904}
tbMapBridge = {
{20, 11, 162, 53},
{53, 78, 20},
{99, 1},
{101, 80, 78},
{121, 1},
{153, 162},
{174, 176},
{100, 37},
}
function Check(sInput)
if sInput~="" or sInput ~=nil then print(sInput) return end
Msg2Player("Kh«ng cã d÷ liÖu")
end
MatchStr=function(szPartern,szStr)
if szPartern==nil or szStr==nil then return false end
if string.match(szPartern,szStr)~=nil then
return true
else
return false
end
end
LeftTrim = function(stText)
if stText == nil or stText == "" then
return ""
end
return string.gsub(stText, "^(%s*)(%w*)", "%2")
end
--------------------------------------------------
RightTrim = function(stText)
if stText == nil or stText == "" then
return ""
end
return string.gsub(stText, "(%w*)(%s*)$", "%1")
end
--------------------------------------------------
Trim = function(stText)
if stText == nil or stText == "" then
return ""
end
return LeftTrim(RightTrim(stText))
end
function ChatRoom ( szContent)
local szTemp = ""
szTemp = "Chat('".."CH_CHATROOM".."', '"..szContent.."')"
ExeScript(szTemp)
end
--------------------------------------------------
function ChatTeam ( szContent)
local szTemp = ""
szTemp = "Chat('".."CH_TEAM".."', '"..szContent.."')"
ExeScript(szTemp)
end
--------------------------------------------------
function ChatNear ( szContent)
local szTemp = ""
szTemp = "Chat('".."CH_NEARBY".."', '"..szContent.."')"
ExeScript(szTemp)
end
SaveFile = function( sPath,nValue)
file = io.open(sPath,"a+")
file:write(nValue)
file:close()
end
InCity = function(nMapID)
for i = 1, getn(tbCity) do
if nMapID == tbCity[i][2] then return 1 end
end
for i = 1, getn(tbVillage) do
if nMapID == tbVillage[i][2] then return 0 end
end
return 2
end
--------------------------------------------------
IsInCity = function(szMapName)
for i = 1, getn(tbCity) do
if szMapName == tbCity[i][1] then return 1 end
end
for i = 1, getn(tbVillage) do
if szMapName == tbVillage[i][1] then return 0 end
end
return 2
end
IsInVillage = function()
local szMapName=CityName()
for i = 1, getn(tbCity) do
if szMapName == tbCity[i][1] then return 0,mapName end
end
for i = 1, getn(tbVillage) do
if szMapName == tbVillage[i][1] then return 1,szMapName end
end
return 2
end
function AddEventIR(zname,xmin,xmax,xr,yr)
zname=name
xr=random(xmin,xmax)
if xr<yr then
AddEventItem(name)
end
end;
đang hàm duy chuyển cho nhân nhân vật,
times = times or 1
local time_to = tonumber(date("%S")+times)
while tonumber(date("%S")) < time_to do end
end
tbCity =
{
{"Phîng Têng", 1, 0, 99},{"Thµnh §«", 11, 0, 20},{"BiÖn Kinh", 37, 0, 100},{"T¬ng D¬ng", 78, 0, 53},{"L©m An", 176, 0, 174},{"D¬ng Ch©u", 80, 0, 101},{"§¹i Lý", 162, 0, 153},{"Phîng Têng", 1, 0,121},
}
tbVillage =
{
{"§¹o H¬ng th«n", 101,"D¬ng Ch©u"},{"Long M«n trÊn", 121,"Phîng Têng"},{"VÜnh L¹c trÊn", 99,"Phîng Têng"},{"Th¹ch Cæ trÊn", 153,"§¹i Lý"},{"Giang T©n Th«n", 20,"Thµnh §«"},{"Ba L¨ng huyÖn", 53,"T¬ng D¬ng"},{"Long TuyÒn th«n", 174,"L©m An"},{"Chu Tiªn trÊn", 100,"BiÖn Kinh"},{"Nam Nh¹c trÊn",222,"Ba L¨ng huyÖn"},
{"Phîng Têng", 1, 0, 99},{"Thµnh §«", 11, 0, 20},{"BiÖn Kinh", 37, 0, 100},{"T¬ng D¬ng", 78, 0, 53},{"L©m An", 176, 0, 174},{"D¬ng Ch©u", 80, 0, 101},{"§¹i Lý", 162, 0, 153},{"Phîng Têng", 1, 0,121},
}
tbAllMap=
{
{"§¹o H¬ng th«n", 101,"D¬ng Ch©u"},
{"Long M«n trÊn", 121,"Phîng Têng"},
{"VÜnh L¹c trÊn", 99,"Phîng Têng"},
{"Th¹ch Cæ trÊn", 153,"§¹i Lý"},
{"Giang T©n Th«n", 20,"Thµnh §«"},
{"Ba L¨ng huyÖn", 53,"T¬ng D¬ng"},
{"Long TuyÒn th«n", 174,"L©m An"},
{"Chu Tiªn trÊn", 100,"BiÖn Kinh"},
{"Nam Nh¹c trÊn",222,"Ba L¨ng huyÖn"},
}
tbBattleMapID = {44, 326, 327, 328, 329, 330, 331, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 868, 869, 870,876,877,878,879,880,881,883,884,885, 898, 899, 900, 902, 903, 904}
tbMapBridge = {
{20, 11, 162, 53},
{53, 78, 20},
{99, 1},
{101, 80, 78},
{121, 1},
{153, 162},
{174, 176},
{100, 37},
}
function Check(sInput)
if sInput~="" or sInput ~=nil then print(sInput) return end
Msg2Player("Kh«ng cã d÷ liÖu")
end
MatchStr=function(szPartern,szStr)
if szPartern==nil or szStr==nil then return false end
if string.match(szPartern,szStr)~=nil then
return true
else
return false
end
end
LeftTrim = function(stText)
if stText == nil or stText == "" then
return ""
end
return string.gsub(stText, "^(%s*)(%w*)", "%2")
end
--------------------------------------------------
RightTrim = function(stText)
if stText == nil or stText == "" then
return ""
end
return string.gsub(stText, "(%w*)(%s*)$", "%1")
end
--------------------------------------------------
Trim = function(stText)
if stText == nil or stText == "" then
return ""
end
return LeftTrim(RightTrim(stText))
end
function ChatRoom ( szContent)
local szTemp = ""
szTemp = "Chat('".."CH_CHATROOM".."', '"..szContent.."')"
ExeScript(szTemp)
end
--------------------------------------------------
function ChatTeam ( szContent)
local szTemp = ""
szTemp = "Chat('".."CH_TEAM".."', '"..szContent.."')"
ExeScript(szTemp)
end
--------------------------------------------------
function ChatNear ( szContent)
local szTemp = ""
szTemp = "Chat('".."CH_NEARBY".."', '"..szContent.."')"
ExeScript(szTemp)
end
SaveFile = function( sPath,nValue)
file = io.open(sPath,"a+")
file:write(nValue)
file:close()
end
InCity = function(nMapID)
for i = 1, getn(tbCity) do
if nMapID == tbCity[i][2] then return 1 end
end
for i = 1, getn(tbVillage) do
if nMapID == tbVillage[i][2] then return 0 end
end
return 2
end
--------------------------------------------------
IsInCity = function(szMapName)
for i = 1, getn(tbCity) do
if szMapName == tbCity[i][1] then return 1 end
end
for i = 1, getn(tbVillage) do
if szMapName == tbVillage[i][1] then return 0 end
end
return 2
end
IsInVillage = function()
local szMapName=CityName()
for i = 1, getn(tbCity) do
if szMapName == tbCity[i][1] then return 0,mapName end
end
for i = 1, getn(tbVillage) do
if szMapName == tbVillage[i][1] then return 1,szMapName end
end
return 2
end
function AddEventIR(zname,xmin,xmax,xr,yr)
zname=name
xr=random(xmin,xmax)
if xr<yr then
AddEventItem(name)
end
end;
đang hàm duy chuyển cho nhân nhân vật,