[PHP]--AUTHOR: BANYNAVY
--DATE: 18/12/2012
Include("\\script\\lib\\mem.lua");
Include("\\Script\\lib\\string.lua");
Include("\\Script\\lib\\player.lua");
Include("\\script\\lib\\task.lua")
ngay = tonumber(date("%d"))
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
giay = tonumber(date("%S"))
TYPE_HACK=GetTask(500)
WPE_TIME=tonumber(date("%S"))
VAN=10000
TRAM=100
NGAN=1000
TRIEU=1000000
TY=1000000000
-----------------------------------------------------------------------------------------------------------------
TYPEHACK=function(value)
SetTask(500,value)
end
SetNpcState=function(nIdNpc,idSkill)
SetNpcSkillState(nIdNpc,idSkill,20,0)
end
CheckRoom=function(x,y)
if (CheckBox(x,y) < 1) then
Msg2Player("Hµnh trang kh«ng ®ñ chæ <color=yellow>("..x.."x"..y..")<color>")
return 0
end
end
function MsgToPlayerInMaps(IdMaps,TAB_MSG)
for i=1,500 do
PlayerIndex = i
local nW,nX,nY = GetWorldPos()
if (nW == IdMaps) then
Msg2Player(TAB_MSG)
end
end
end
function ActionInMaps(IdMaps,Action)
local idbt = PlayerIndex
for i=1,500 do
PlayerIndex = i
local nW,nX,nY = GetWorldPos()
if (nW == IdMaps) then
Action()
end
end
PlayerIndex = idbt
end
function ActionAllMaps(Action)
local idbt = PlayerIndex
for i=1,500 do
PlayerIndex = i
local nW,nX,nY = GetWorldPos()
Action()
end
PlayerIndex = idbt
end
function AntiLick(value)
SetTaskTemp(value+100,GetTaskTemp(value+100)+1)
if GetTaskTemp(value+100)>=2 then
Talk(1,"","Kh«ng nªn thao t¸c qu¸ nhanh")
return
end
end
function ThemHoangKim(id,hsd,khoa)
local index=AddGoldItem(id,SeriGold(id),1,1,1)
if khoa~=nil then
SetCanLockAll(index,khoa)--0 la khoa 1 la ko khoa
end
if hsd~=nil then
SetTimeUse(index,hsd)
end
end
function AddQuestKeyLock(id,hsd)
local index=AddEventItem(id)
SetCanLockAll(index,0)
if hsd~=nil then
SetTimeUse(index,hsd)
end
end
function TRAIN_GetLevel()
if GetTask(UYTHAC_IDSKILL)==0 then
return
end
return GetMagicLevel(GetTask(UYTHAC_IDSKILL))
end
function TRAIN_GetExp()
if GetTask(UYTHAC_VITRISKILL)==0 then
return
end
return GetTask(GetTask(UYTHAC_VITRISKILL))
end
function TRAIN_PhanTram()
local value=TRAIN_GetExp()*100/TRAIN_LoadExp(TRAIN_GetLevel())*2
return round(value,2)
end
function UpdateExpTrain()
if GetTask(UYTHAC_IDSKILL)==0 then
return
end
if TRAIN_GetLevel()>=20 then
return
end
for i=TRAIN_GetLevel(),19 do
if TRAIN_PhanTram()>=100 then
InsertLevelSkill(GetTask(UYTHAC_IDSKILL))
end
end
end
function AddExpSkill(value)
if TRAIN_GetLevel()>=20 then
return
end
if GetTask(UYTHAC_VITRISKILL)==0 then
return
end
SetTask(GetTask(UYTHAC_VITRISKILL),GetTask(GetTask (UYTHAC_VITRISKILL))+value)
end
function TRAIN_LoadExp(lv)
Load = LoadData("Settings/TrainSkillExp.txt")
local value
value = Load[lv+2][2]
return value;
end
function NameGold(id)
MSG_load = LoadData("Settings/item/GoldItemSeri.txt")
local TenQK
TenQK = MSG_load[id+1][1]
return TenQK;
end;
function LevelGold(id)
MSG_load = LoadData("Settings/item/GoldItemSeri.txt")
local TenQK
TenQK = MSG_load[id+1][3]
return TenQK;
end;
function SeriGold(id)
MSG_load = LoadData("Settings/item/GoldItemSeri.txt")
local TenQK
TenQK = MSG_load[id+1][2]
return TenQK;
end;
DEBUG=function(str)
Msg2Player("DEBUG:"..str.."")
end
function GetSkillName(id)
MSG_load = LoadData("Settings/SkillName.txt")
local TenQK
TenQK = MSG_load[id+2][2]
return TenQK;
end
function AntiKTC(account)
nP=0
for i=1,500 do
gmidx=PlayerIndex
PlayerIndex=i
if (GetUUID() ~= 0) then
if GetAccount()==account then
nP=nP+1
end
end
PlayerIndex=gmidx
end
return tonumber(nP)
end
function CheckHackMoney(nMoney)
local sotien = GetCash()
if GetCash() < nMoney then
Msg2Player("B¹n kh«ng cã "..nMoney.." lîng ")
return
end
Pay(nMoney)
if GetCash() ~= (sotien - nMoney) then
Msg2Player("B¹n kh«ng cã "..nMoney.." lîng ")
return
end
end
function CheckHackQuestKeyItem(id,nIdx)
local n = GetItemCount(id)
if GetItemCount(id) < 1 then
Msg2Player("B¹n kh«ng cã "..CheckNameQuestKey(id).."")
return
end
DelItemIdx(nIdx)
if GetItemCount(id) ~= (n-1) then
Msg2Player("B¹n kh«ng cã "..CheckNameQuestKey(id).."")
return
end
end
function MoveBox()
if GetFightState()==1 then
local nW=GetTask(TRAP_W)
local nX=GetTask(TRAP_X)
local nY=GetTask(TRAP_Y)
NewWorld(nW,nX,nY)
SetFightState(0)
end
end
function GetMoneyBox()
return GetMoney()-GetCash()
end
function DelayTime(times)
local ngay = tonumber(date("%d"))
local gio = tonumber(date("%H"))
local phut = tonumber(date("%M"))
local giay = tonumber(date("%S"))
local delay = ngay * 24 * 60 * 60 + gio * 60 * 60 + phut * 60 + giay
local time1 = delay - times
local time2 = GetTaskTemp(31) - time1
local time3 = times - delay
if (GetTaskTemp(30) == 0) then
SetTaskTemp(30,delay)
return 0
end
if (delay<times and delay>=0)then
time3 = times - delay
Msg2Player("Vui lßng chê <color=yellow>"..time3.."<color> gi©y")
return 0
end
time1 = delay - times
if (time1 < GetTaskTemp(30)) then
time2 = GetTaskTemp(30) - time1
Msg2Player("Vui lßng chê <color=yellow>"..time2.."<color> gi©y")
return 0
end
SetTaskTemp(30,0)
end
function NoteMsg(str)
Say(str,1,"KÕt thóc ®èi tho¹i/no")
end
function tinhngay()
ngay = tonumber(date("%d"))
thang = tonumber(date("%m"))
tinhngay1 = 0
for k=1,getn(mang) do
if thang > mang[k][1] then
tinhngay1 = tinhngay1 + mang[k][2]
end
end
tinhngay1 = tinhngay1 + ngay
return tinhngay1
end
mang = {
{1,31},{2,28},{3,31},{4,30},{5,31},{6,30},{7,31},{ 8,31},{9,30},{10,31},{11,30},{12,31},
}
function WriteLogProA(data,str)
local IPData2 = openfile(""..data.."", "a+");
write(IPData2,tostring(str));
closefile(IPData2);
end
function WriteLogPro(data,str,type)
local IPData2 = openfile(""..data.."",type);
write(IPData2,tostring(str));
closefile(IPData2);
end
function GetIPs()
local arr =split(GetIP()," ")
return(arr[1])
end
function ReadIPs(ip)
local arr =split(ip," ")
return(arr[1])
end
function GetAccount()
return GetPlayerAccount()
end
function AddNPCEx(nId,nLevel, nMap,nX,nY,nOffsetX,nOffsetY,nScript,nCurCamp,nSer ies,nName,nDescName)
if (nOffsetX==nil) then nOffsetX = 0 end
if (nOffsetY==nil) then nOffsetY = 0 end
mapindex = SubWorldID2Idx(nMap)
npcid = nId
npclvl = nLevel
posx = floor((nX+nOffsetX/10)*8*32)
posy = floor((nY+nOffsetY/10)*16*32)
nNpcId = AddNpc(npcid,npclvl,mapindex,posx,posy,1, "", 1);
if(nScript~=nil) then
SetNpcScript(nNpcId, nScript);
end
if(nCurCamp~=nil) then
SetNpcCurCamp(nNpcId, nCurCamp);
end
if(nName~=nil)then
SetNpcName(nNpcId,nName);
end
if(nSeries~=nil)then
SetNpcSeries(nNpcId,nSeries);
end;
if(nDescName~=nil)then
SetNpcDesc(nNpcId,nDescName);
end;
return
end;
--Hµm add qu¸i talk toa do d¹ng xxxx,yyyy kh«ng cã ®é lÖch
function AddNPCEz(nId,nLevel,nMap,nX,nY,nScript,nCurCamp,nS er,nName,nDescName,nIsboss,nState)
mapindex = SubWorldID2Idx(nMap)
npcid = nId
npclvl = nLevel
posx = nX
posy = nY
nNpcId = AddNpc(npcid,npclvl,mapindex,posx,posy,1,"", 1);
if(nScript~=nil) then
SetNpcScript(nNpcId, nScript);
end
if(nCurCamp~=nil) then
SetNpcCurCamp(nNpcId, nCurCamp);
end
if(nName~=nil)then
SetNpcName(nNpcId,nName);
end
if(nSer~=nil)then
SetNpcSeries(nNpcId,nSer);
end;
if(nDescName~=nil)then
--SetNpcDesc(nNpcId,nDescName);
end;
if(nIsboss~=nil)then
SetNpcScript(nNpcId,nIsboss)
end
if(nState~=nil)then
SetNpcState(nNpcId,nState)
end
return
end;
function no()
end
function NoteMsg(str)
Say(str,1,"KÕt thóc ®èi tho¹i/no")
end
function ResetExp()
exp=GetExp()
if (exp < 0) then
exp = exp*-1
AddOwnExpPro(exp)
Msg2Player("B¹n ®· ®îc gi¶i trõ kinh nghiÖm ©m")
return 0
end
end;
--------------------------------------Variable Define-----------
function CheckNameQuestKey(id)
MSG_load = LoadData("Settings/item/questkey.txt")
local TenQK
TenQK = MSG_load[id+2][1]--Ten QuestKey
return TenQK;
end;
function CountPlayerInMaps(IdMaps)
nP=0
for i=1,500 do
gmidx=PlayerIndex
PlayerIndex=i
W,X,Y=GetWorldPos()
if W==IdMaps then
nP=nP+1
end
PlayerIndex=gmidx
end
return tonumber(nP)
end
function MoveTeam(idteam,idmap,posx,posy)
if SubWorldID2Idx(idmap) == -1 then
Msg2Player("B¶n ®å kh«ng ®îc më trong qu¸ tr×nh khëi ®éng")
return
end
for i=1,500 do
PlayerIndex = i
if GetTeam() == idteam then
NewWorld(idmap,posx*8,posy*16)
end
end
end
function TeamInfo(idteam)
for i=1,500 do
PlayerIndex = i
if GetTeam() == idteam then
teamsize = GetTeamSize()
if IsCaptain() == 1 then
totruong = GetName()
end
end
end
str = "Tæ ®éi [M· Sè] : "..idteam..", [Sè ngêi] : "..teamsize..", [§éi trëng] : "..totruong
return str
end
function ChoPhepTanCong(idteam,num)
if num == nil then return end
for i=1,500 do
PlayerIndex = i
if GetTeam() == idteam then
SetFightState(num)
end
end
end
function SetDeathScriptTeam(idteam,scriptdir)
for i=1,500 do
PlayerIndex = i
if GetTeam() == idteam then
SetDeathScript(scriptdir)
end
end
end
function SetTaskTempTeam(idteam,taskid,num)
for i=1,500 do
PlayerIndex = i
if GetTeam() == idteam then
SetTaskTemp(taskid,num)
end
end
end
function GetTaskTempTeam(idteam,taskid)
local task = 0
for i=1,500 do
PlayerIndex = i
if GetTeam() == idteam then
if task == 0 then task = GetTaskTemp(taskid) end
if task == GetTaskTemp(taskid) then
task = GetTaskTemp(taskid)
else
return 0
end
end
end
return task
end
function SetTaskTeam(idteam,taskid,num)
for i=1,500 do
PlayerIndex = i
if GetTeam() == idteam then
SetTask(taskid,num)
end
end
end
function GetTaskTeam(idteam,taskid)
local task = 0
for i=1,500 do
PlayerIndex = i
if GetTeam() == idteam then
if task == 0 then task = GetTask(taskid) end
if task == GetTask(taskid) then
task = GetTask(taskid)
else
return 0
end
end
end
return task
end
function XemTaskTamThoi(idteam,taskid)
local task = 0
for i=1,500 do
PlayerIndex = i
if GetTeam() == idteam then
if task == 0 then task = GetTaskTemp(taskid) end
if task == GetTaskTemp(taskid) then
task = GetTaskTemp(taskid)
else
return 0
end
end
end
return task
end
function SuaTaskTamThoi(idteam,taskid,num)
for i=1,500 do
PlayerIndex = i
if GetTeam() == idteam then
SetTaskTemp(taskid,num)
end
end
end
function XemPK(idteam)
local pksum = 0
for i=1,500 do
PlayerIndex = i
if GetTeam() == idteam then
pksum = pksum+GetPK()
end
end
return pksum
end
function SuaPK(idteam,num)
for i=1,500 do
PlayerIndex = i
if GetTeam() == idteam then
SetPK(num)
end
end
end
function SetTimerTeam(idteam,timerid,thoigian)
for i=1,500 do
PlayerIndex = i
if GetTeam() == idteam then
SetTimer(timerid,thoigian)
end
end
end
function StopTimerTeam(idteam)
for i=1,500 do
PlayerIndex = i
if GetTeam() == idteam then
StopTimer()
end
end
end
Powered by vBulletin® Version 4.2.0 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.