PDA

View Full Version : A ThaiHoa e hỏi cái !



cobega
13-09-10, 10:28 AM
E xài sever anh + patch fullby thaihoa91 ! sao map vượt ải ! mỗi khi vượt ải chết hay out giữa chừng ở map vượt ải là vào nhân vật máy lại báo là máy chủ gián đoạn, hoặc đang bảo trì ! Tạo nhân vật khác thì chơi bình thường !

A kiểm tra chỉ giáo giùm em :((

PhongLinh
13-09-10, 10:58 AM
Có lễ map thách thức thời gian này out là không vào được rồi. Cái này thì nên bảo mấy đứa viết server cho vào cái hàm khi out bất chợt thì nó kick về thành hoặc thôn nào đó là không sao.

cobega
13-09-10, 06:18 PM
bác nào vô giúp giùm em với :( Sao không thấy ai hít vậy ? :((

PhátPrồ
13-09-10, 06:30 PM
bạn ko out ở BLH nên thường gặp tình trạng này:|

thaihoa91
13-09-10, 06:40 PM
Mình chưa test Server ở khúc đó nên ko rõ ! Tốt nhất là quay về ba lăng huyện rùi thoát !

Nếu bạn chịu khó ngâm cách viết code để edit khi thoát ra là nhân vật dc đưa về ba lăng thì sẽ đỡ hơn rất nhìu !

cobega
13-09-10, 06:50 PM
hok phải tại ví trong map vượt ải không có con xa phu ! chết hay dí là không vào được hà !
SetLogoutRV(1) mình có thêm nó vào phần vượt ải

--Include("\\Script\\global\\headexp.lua");
--Include("\\script\\droprate\\drop10x.lua")
--Include("\\Script\\global\\level350.lua");
Include("\\Script\\cacsukien\\boold\\npc_baodanh.lua")

function OnDeath(Launcher)
PlayerIndex1 = NpcIdx2PIdx(Launcher);
OrgPlayer = PlayerIndex;
DeathName = GetName()
camp = GetCamp();
SetCurCamp(camp);
SetDeathScript("");
SetMissionV(41,0)
SetTask(150,0)
SetTask(151,0)
Msg2Player("Ban da chet, hy vong lan sau hay co gang hon...")
MoveNPC(53,197,202,6,4,500,0);
SetLogoutRV(1)
--StopTimer()
end;

với thằng xa phu mà sao nó không được :(

PhongLinh
13-09-10, 08:19 PM
Thêm SetLogoutRV vào ở script xa phu move tới map thách thức thời gian đó nữa.

cobega
13-09-10, 11:17 PM
Include("\\Script\\global\\sourcejx49.lua");

danhsach_player = {}
PLAYERINMAP = 0
MISSIONQTM = 3
BLOOD1 = 153
BLOOD2 = 154
BLOOD3 = 155
BLOOD4 = 156

NEEDTOVE1 = 1
NEEDTOVE2 = 2
NEEDTOVE3 = 3
NEEDTOVE4 = 4

SUCCESSRATELV1 = 80
SUCCESSRATELV2 = 70
SUCCESSRATELV3 = 60
SUCCESSRATELV4 = 50

function main()
VZ = GetGlbMissionV(MISSIONQTM)
if VZ == 0 then
SayEx({"<color="..colorS()..">Quan Vien Quang Truong<color> : Su kien duoc bat dau vao nhung luc <color="..colorS(2)..">7:00, 9:00, 11:00, 13:00, 15:00, 19:00, 21:00<color>.",
"Ep Ve 1./ep",
"Ep Ve 2./ep",
"Ep Ve 3./ep",
--"Ep Ve 4./ep",
"Thoat./Exit"})
elseif VZ == 1 then
SayEx({"<color="..colorS()..">Quan Vien Quang Truong<color>: Nguoi hay chon cap do de tham gia.",
"Cap 10-100./tang1",
"Cap 100-150./tang2",
"Cap 150-200./tang3",
--"Cap 200-350./tang4",
"Ep ve tham gia./epvethamgia",
"Thoat./Exit"})
elseif VZ == 2 then
Talk(2,"","<color="..colorS()..">Quan Vien Quang Truong<color>: Su kien <color="..colorS(1)..">Quang Truong Mau<color> quang truong mau da bat dau roi ban khong the tham gia.","<color="..colorS()..">Quan Vien Quang Truong<color> : Su kien ket thuc bao danh sau <color="..colorS(5)..">10 phut<color> ke tu khi thong bao...")
end
end;

function epvethamgia()
SayEx({"<color="..colorS()..">Quan Vien Quang Truong<color> : Su kien duoc bat dau voa nhung luc <color="..colorS(2)..">7:00, 9:00, 11:00, 13:00, 15:00, 19:00, 21:00<color>.",
"Ep Ve 1./ep",
"Ep Ve 2./ep",
"Ep Ve 3./ep",
--"Ep Ve 4./ep",
"Thoat./Exit"})
end;

function ep(nsel)
id = nsel+1
if id == 1 then
if GetItemCount(152) >= NEEDTOVE1 then
rate = random(1,100)
if rate <= SUCCESSRATELV1 then
AddEventItem(BLOOD1)
DelItem(152)
MsgEx("Che tao thanh cong Dong Ho Cat +1.")
else
DDelItem(152)
MsgEx("Hop thanh that bai, Chuc ban may man lan sau.")
end
else
MsgEx("Khong co "..NEEDTOVE1.." Dong Ho Cat.")
end
elseif id == 2 then
if GetItemCount(152) >= NEEDTOVE2 then
rate = random(1,100)
if rate <= SUCCESSRATELV2 then
AddEventItem(BLOOD2)
DelItem(152)
DelItem(152)
MsgEx("Che tao thanh cong Dong Ho Cat +2.")
else
DelItem(152)
DelItem(152)
MsgEx("Hop thanh that bai, Chuc ban may man lan sau.")
end
else
MsgEx("Khong co "..NEEDTOVE2.." Dong Ho Cat.")
end
elseif id == 3 then
if GetItemCount(152) >= NEEDTOVE3 then
rate = random(1,100)
if rate <= SUCCESSRATELV3 then
AddEventItem(BLOOD3)
DelItem(152)
DelItem(152)
DelItem(152)

MsgEx("Che tao thanh cong Dong Ho Cat +3.")
else
DelItem(152)
MsgEx("Hop thanh that bai, Chuc ban may man lan sau.")
end
else
MsgEx("Khong co "..NEEDTOVE3.." Dong Ho Cat.")
end
elseif id == 4 then
if GetItemCount(152) >= NEEDTOVE4 then
rate = random(1,100)
if rate <= SUCCESSRATELV4 then
AddEventItem(BLOOD4)
DelItem(152)
DelItem(152)
DelItem(152)
DelItem(152)
MsgEx("Che tao thanh cong Dong Ho Cat +4.")
else
DelItem(152)
MsgEx("Hop thanh that bai, Chuc ban may man lan sau.")
end
else
MsgEx("Khong co "..NEEDTOVE4.." Dong Ho Cat.")
end
end
end;


function tang1()
if GetLevel() >= 10 and GetLevel() < 100 then
if GetItemCount(BLOOD1) >= 1 then
if CheckPlayerInMaps(464) <= MAXPLAYERINMAP then
DelItem(BLOOD1)
joinIngames(464)
else
MsgEx("<color="..colorS()..">Quan Vien Quang Truong<color>: Hien Tai Quang Truong Mau da du nguoi roi nguoi khong the tham gia.",1)
end
else
MsgEx("<color="..colorS()..">Quan Vien Quang Truong<color>: Nguoi khong co ve vao Quang Truong Mau Tang 1.",1)
end
else
MsgEx("<color="..colorS()..">Quan Vien Quang Truong<color>: Cap do khong phu hop de tham gia Tang nay.",1)
end
end;

function tang2()
if GetLevel() >= 100 and GetLevel() < 150 then
if GetItemCount(BLOOD2) >= 1 then
if CheckPlayerInMaps(465) <= MAXPLAYERINMAP then
DelItem(BLOOD2)
joinIngames(465)
else
MsgEx("<color="..colorS()..">Quan Vien Quang Truong<color>: Hien Tai Quang Truong Mau da du nguoi roi nguoi khong the tham gia.",1)
end
else
MsgEx("<color="..colorS()..">Quan Vien Quang Truong<color>: Nguoi khong co ve vao Quang Truong Mau Tang 2.",1)
end
else
MsgEx("<color="..colorS()..">Quan Vien Quang Truong<color>: Cap do khong phu hop de tham gia Tang nay.",1)
end
end;

function tang3()
if GetLevel() >= 150 and GetLevel() < 200 then
if GetItemCount(BLOOD3) >= 1 then
if CheckPlayerInMaps(466) <= MAXPLAYERINMAP then
DelItem(BLOOD3)
joinIngames(466)
else
MsgEx("<color="..colorS()..">Quan Vien Quang Truong<color>: Hien Tai Quang Truong Mau da du nguoi roi nguoi khong the tham gia.",1)
end
else
MsgEx("<color="..colorS()..">Quan Vien Quang Truong<color>: Nguoi khong co ve vao Quang Truong Mau Tang 3.",1)
end
else
MsgEx("<color="..colorS()..">Quan Vien Quang Truong<color>: Cap do khong phu hop de tham gia Tang nay.",1)
end
end;

function tang4()
if GetItemCount(BLOOD4) >= 1 then
if CheckPlayerInMaps(467) <= MAXPLAYERINMAP then
DelItem(BLOOD4)
joinIngames(467)
else
MsgEx("<color="..colorS()..">Quan Vien Quang Truong<color>: Hien Tai Quang Truong Mau da du nguoi roi nguoi khong the tham gia.",1)
end
else
MsgEx("<color="..colorS()..">Quan Vien Quang Truong<color>: Nguoi khong co ve vao Quang Truong Mau Tang 4.",1)
end
end;



function CheckPlayerInMaps(MapID)
PLAYERINMAP = 0
for i=1,300 do
PlayerIndex = i
W,X,Y = GetWorldPos()
if W == MapID then
PLAYERINMAP = PLAYERINMAP + 1
return PLAYERINMAP
end
end
end;

function ChangeStylePlayer(MapID)
for i=1,300 do
PlayerIndex = i
W,X,Y = GetWorldPos()
if W == MapID then
SetFightState(1)
MsgEx("Bat Dau Chien Dau Can Than Khong Kheo Lai Mat Dau Day...")
end
end;
end;

function joinIngames(IDMAPS)
if TimKiem(danhsach_player,GetName()) == nil then
danhsach_player[getn(danhsach_player)+1] = {GetName(),GetLevel(),GetTask(TaskQuangTruong),Get Faction()}
LeaveTeam()
SetPunish(0)
SetLogoutRV(1)
SetCurCamp(1)
SetDeathScript("\\script\\cacsukien\\boold\\playerdie.lua");
MoveNPC(IDMAPS,196,201,2,4,0,0);
elseif TimKiem(danhsach_player,GetName()) == 1 then
LeaveTeam()
SetPunish(0)
SetLogoutRV(1)
SetCurCamp(1)
for i = 1,getn(danhsach_player) do
if GetName() == danhsach_player[i][1] then
danhsach_player[i] = {GetName(),GetLevel(),GetTask(TaskQuangTruong),Get Faction()}
end
end;
SetDeathScript("\\script\\cacsukien\\boold\\playerdie.lua");
MoveNPC(IDMAPS,196,201,2,4,0,0);
end
end;



function EndGame()
ClearMaps()
BangXepHang()
SetGlbMissionV(MISSIONQTM,0)
SetMissionV(MISSIONQTM,0)
Msg2SubWorld("Su kien Quang Truong Mau da ket thuc...")
ReWarExp()
VeLang1()
VeLang2()
VeLang3()
--VeLang4()
end;

function VeLang1()
W,X,Y = GetWorldPos()
for i=1,GetPlayerCount() do
PlayerIndex = i
if W == 464 then
SetTask(TaskQuangTruong,0)
MoveNPC(37,204,190,8,5,0,0);
end
end
end;

function VeLang2()
W,X,Y = GetWorldPos()
for i=1,GetPlayerCount() do
PlayerIndex = i
if W == 465 then
SetTask(TaskQuangTruong,0)
MoveNPC(80,221,189,1,6,0,0);
end
end
end;

function VeLang3()
W,X,Y = GetWorldPos()
for i=1,GetPlayerCount() do
PlayerIndex = i
if W == 466 then
SetTask(TaskQuangTruong,0)
MoveNPC(1,199,200,3,3,0,0);
end
end
end;

function VeLang4()
W,X,Y = GetWorldPos()
for i=1,GetPlayerCount() do
PlayerIndex = i
if W == 467 then
SetTask(TaskQuangTruong,0)
MoveNPC(11,391,316,2,5,0,0);
end
end
end;

function ChayGame()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
intime = 50 - phut
listend = {5,10,15,20,25,30,35,40}
SetGlbMissionV(MISSIONQTM,2)
ChuyenDoiPlayer(1)
if phut == 10 then
Msg2SubWorld("Su kien Quang Truong Mau da dien ra. Hay quay lai vao luc khac...")
AddMonter1(1)
AddMonter2(1)
AddMonter3(1)
else
for i = 1,getn(listend) do
if intime == listend[i] then
Msg2SubWorld("Su kien Quang Truong Mau con "..intime.." phut nua se ket thuc.")
idmis = listend[i]/5
AddMonter1(idmis)
AddMonter2(idmis)
AddMonter3(idmis)
--AddMonter4(idmis)
break
end
end
end
end;



function ChayReg()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
conlai = 10 - phut
Msg2SubWorld("Thoi gian bao danh vao Quang Truong Mau con "..conlai.." phut nua.")
SetGlbMissionV(MISSIONQTM,1)
end;


function KiemTraGio()
gio = tonumber(date("%H"))
phut = tonumber(date("%M"))
times = {7,9,11,13,15,17,19,21,23}
for i = 1, getn(times) do
if gio == times[i] then
if phut < 10 then
ChayReg()
break
elseif phut >= 10 then
ChayGame()
break
elseif phut == 50 then
EndGame()
end
end
end
return 0
end;


function TimKiem(tenbang,tukhoa)
if getn(tenbang) == 0 then
return nil
end
for i= 1,getn(tenbang) do
for k = 1,getn(tenbang[i]) do
if tenbang[i][k] == tukhoa then
return 1
end
end
end
end

function Level_NV(tennhanvat)
for i = 1,getn(danhsach_player) do
if danhsach_player[i][1] == tennhanvat then
return danhsach_player[i][2]
end
end
return "khong co du lieu"
end

function MonterKill(tennhanvat)
for i = 1,getn(danhsach_player) do
if danhsach_player[i][1] == tennhanvat then
return danhsach_player[i][3]
end
end
end

function BangXepHang(IDMAPS)
W,X,Y = GetWorldPos()
if getn(danhsach_player) < 2 then
Msg2Player("Do qua it nguoi choi nen khong can bang xep hang.")
return
end;
bangxephang = {}
for k = 1,15 do
danhsach3 = {}
danhsach2 = {}
danhsach = {}
diemlonnhat = 0
lvnhonhat = 0
for i = 1,getn(danhsach_player) do
if danhsach_player[i][3] > diemlonnhat and TimKiem(bangxephang,danhsach_player[i][1]) == nil then
danhsach = {danhsach_player[i][1]}
diemlonnhat = danhsach_player[i][3]
elseif danhsach_player[i][3] == diemlonnhat and TimKiem(bangxephang,danhsach_player[i][1]) == nil then
danhsach[getn(danhsach)+1] = danhsach_player[i][1]
end
end
danhsach2 = {danhsach[1]}
for i = 1,getn(danhsach) - 1 do
if Level_NV(danhsach[i]) < lvnhonhat and TimKiem(bangxephang,danhsach[i]) == nil then
danhsach2 = {danhsach[i+1][1]}
lvnhonhat = Level_NV(danhsach[i])
elseif Level_NV(danhsach[i]) == lvnhonhat and TimKiem(bangxephang,danhsach[i]) == nil then
danhsach2[getn(danhsach2)+1] = danhsach[i+1][1]
end
end
if danhsach2[1] ~= nil then
bangxephang[getn(bangxephang)+1] = danhsach2
end
end
if getn(bangxephang) == 0 then
return
end
for i = 1,getn(bangxephang) do
for k = 1, getn(bangxephang[i]) do
str = "<<"..bangxephang[i][k]..">>\nSo Monter giet duoc "..MonterKill(bangxephang[i][k]).."."
end
str = "Hang "..i.." :\n"..str
for i =1,GetPlayerCount() do
PlayerIndex = i
if W == IDMAPS then
Msg2Player(str)
end
end
str = ""
end
end;

function ReWarExp(MAPID)
for i=1,GetPlayerCount() do
PlayerIndex = i
W,X,Y = GetWorldPos()
if W == MAPID then
if GetTask(TaskQuangTruong) > 0 then
xp = GetTask(TaskQuangTruong) * 5000
AddOwnExp(xp)
Msg2Player("Phan Thuong Quang Truong :\nBan nhan duoc "..xp.." diem kinh nghiem.")
end
end
end
end;

function ClearMaps()
for i = 1,1480 do
DelNpc(quaiqt)
end
end;

function AddMonter1(ids)
toado= {
{196,199,1,8},
{195,200,5,0},
{195,200,0,3},
{194,200,1,6},
{193,201,3,1},
{192,201,7,4},
{193,201,3,6},
{194,202,0,0},
{194,202,7,4},
{195,202,3,7},
{195,203,8,0},
{196,202,8,6},
{197,202,4,3},
{197,202,9,0},
{198,201,6,7},
{199,201,3,5},
{198,201,8,1},
{198,200,3,6},
{197,200,4,3},
{196,200,7,0},
{196,200,0,3},
{195,200,3,7},
{194,201,8,1},
{193,201,9,2},
{194,201,7,6},
{195,202,5,1},
{196,202,0,3},
{196,202,8,0},
{197,201,4,5},
{198,201,0,4},
{197,201,3,0},
{196,200,5,6},
{196,201,0,1},
{195,201,1,5},
{195,202,5,1},
{196,202,0,3},
{192,201,2,6},
{192,202,6,1},
{193,202,3,3},
{194,202,0,8},
{194,203,6,0},
{195,203,4,4},
{196,203,1,6},
{194,203,8,0},
{200,201,1,7},
{199,201,6,3}
}
Monter = {1,154,162,20,164,640,641,542}
mapids = SubWorldID2Idx(464)
for i = 1,getn(toado) do
quaiqt = AddNpc(Monter[ids],60,mapids,(floor(toado[i][1] + (toado[i][3]/10))*8*32),(floor(toado[i][2] + (toado[i][4]/10))*16*32),1,"Quang Truong Mau",1)
SetNpcScript(quaiqt,"\\script\\cacsukien\\boold\\1\\quaiqt.lua")
end
end;

function AddMonter2(ids)
toado= {
{196,199,1,8},
{195,200,5,0},
{195,200,0,3},
{194,200,1,6},
{193,201,3,1},
{192,201,7,4},
{193,201,3,6},
{194,202,0,0},
{194,202,7,4},
{195,202,3,7},
{195,203,8,0},
{196,202,8,6},
{197,202,4,3},
{197,202,9,0},
{198,201,6,7},
{199,201,3,5},
{198,201,8,1},
{198,200,3,6},
{197,200,4,3},
{196,200,7,0},
{196,200,0,3},
{195,200,3,7},
{194,201,8,1},
{193,201,9,2},
{194,201,7,6},
{195,202,5,1},
{196,202,0,3},
{196,202,8,0},
{197,201,4,5},
{198,201,0,4},
{197,201,3,0},
{196,200,5,6},
{196,201,0,1},
{195,201,1,5},
{195,202,5,1},
{196,202,0,3},
{192,201,2,6},
{192,202,6,1},
{193,202,3,3},
{194,202,0,8},
{194,203,6,0},
{195,203,4,4},
{196,203,1,6},
{194,203,8,0},
{200,201,1,7},
{199,201,6,3}
}
Monter = {161,164,542,151,60,62,58,564}
mapids = SubWorldID2Idx(465)
for i = 1,getn(toado) do
quaiqt = AddNpc(Monter[ids],80,mapids,(floor(toado[i][1] + (toado[i][3]/10))*8*32),(floor(toado[i][2] + (toado[i][4]/10))*16*32),1,"Quang Truong Mau",1)
SetNpcScript(quaiqt,"\\script\\cacsukien\\boold\\2\\quaiqt.lua")
end
end;

function AddMonter3(ids)
toado= {
{196,199,1,8},
{195,200,5,0},
{195,200,0,3},
{194,200,1,6},
{193,201,3,1},
{192,201,7,4},
{193,201,3,6},
{194,202,0,0},
{194,202,7,4},
{195,202,3,7},
{195,203,8,0},
{196,202,8,6},
{197,202,4,3},
{197,202,9,0},
{198,201,6,7},
{199,201,3,5},
{198,201,8,1},
{198,200,3,6},
{197,200,4,3},
{196,200,7,0},
{196,200,0,3},
{195,200,3,7},
{194,201,8,1},
{193,201,9,2},
{194,201,7,6},
{195,202,5,1},
{196,202,0,3},
{196,202,8,0},
{197,201,4,5},
{198,201,0,4},
{197,201,3,0},
{196,200,5,6},
{196,201,0,1},
{195,201,1,5},
{195,202,5,1},
{196,202,0,3},
{192,201,2,6},
{192,202,6,1},
{193,202,3,3},
{194,202,0,8},
{194,203,6,0},
{195,203,4,4},
{196,203,1,6},
{194,203,8,0},
{200,201,1,7},
{199,201,6,3}
}
Monter = {565,566,568,559,411,561,594,608}
mapids = SubWorldID2Idx(466)
for i = 1,getn(toado) do
quaiqt = AddNpc(Monter[ids],95,mapids,(floor(toado[i][1] + (toado[i][3]/10))*8*32),(floor(toado[i][2] + (toado[i][4]/10))*16*32),1,"Quang Truong Mau",1)
SetNpcScript(quaiqt,"\\script\\cacsukien\\boold\\3\\quaiqt.lua")
end
end;

function AddMonter4(ids)
toado= {
{196,199,1,8},
{195,200,5,0},
{195,200,0,3},
{194,200,1,6},
{193,201,3,1},
{192,201,7,4},
{193,201,3,6},
{194,202,0,0},
{194,202,7,4},
{195,202,3,7},
{195,203,8,0},
{196,202,8,6},
{197,202,4,3},
{197,202,9,0},
{198,201,6,7},
{199,201,3,5},
{198,201,8,1},
{198,200,3,6},
{197,200,4,3},
{196,200,7,0},
{196,200,0,3},
{195,200,3,7},
{194,201,8,1},
{193,201,9,2},
{194,201,7,6},
{195,202,5,1},
{196,202,0,3},
{196,202,8,0},
{197,201,4,5},
{198,201,0,4},
{197,201,3,0},
{196,200,5,6},
{196,201,0,1},
{195,201,1,5},
{195,202,5,1},
{196,202,0,3},
{192,201,2,6},
{192,202,6,1},
{193,202,3,3},
{194,202,0,8},
{194,203,6,0},
{195,203,4,4},
{196,203,1,6},
{194,203,8,0},
{200,201,1,7},
{199,201,6,3}
}
Monter = {15,860,556,703,705,1151,708,710}
mapids = SubWorldID2Idx(467)
for i = 1,getn(toado) do
quaiqt = AddNpc(Monter[ids],150,mapids,(floor(toado[i][1] + (toado[i][3]/10))*8*32),(floor(toado[i][2] + (toado[i][4]/10))*16*32),1,"Quang Truong Mau",1)
SetNpcScript(quaiqt,"\\script\\cacsukien\\boold\\4\\quaiqt.lua")
end
end;


Các bác coi sao chết nó vẫn k out ra ! đăng nhập vẫn báo lỗi gáin đoạn sever !

PhongLinh
14-09-10, 09:42 AM
Test đơn giản = cách viết 1 script xa phu move tới map đó, có + hàm log out khi bị dis mạng hay nhỡ tay out.v.v. Thêm 1 script Ondeath của player khi bi quái đánh chết+hàm log out.

cobega
14-09-10, 11:37 PM
Chi tiết xíu được hok vậy ? mình newbie 8-|

thaihoa91
14-09-10, 11:51 PM
Ý ổng nói là bạn viết code ngắn để test thui ! Viết dài wá test lỗi mệt !

Viết code move wa 1 bản đồ thui rùi setlogout thử coi dc ko ! Nếu dc thì hãy thay vào code fức tạp !