kenlucifer
07-06-12, 08:59 AM
Tình hình là vừa down cái server tinhhuynhde nofont về test , bị lỗi npc chức năng , ko chuyển sinh đc :(
lỗi npc dã tẩu.....ai bít cách fix hay có script hoàn chỉnh send giùm....tks lắm
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
tks trước các pro
script chuyển sinh đây :(
Include("\\Script\\global\\sourcejx49.lua");
Include("\\script\\cacsukien\\banghoi\\tong.lua")
Include("\\Data\\danhsachtrungsinh.lua")
Include("\\Data\\dangcaptrungsinh.lua")
Include("\\script\\Á½ºþÇø\\°ÍÁêÏØ\\npc\\resetpl .lua");
IDKEYTRUNGSINH = 128
LEVELGOTWHENRESET = 1 --Level nhan duoc sau khi Chuyen Sinh
CASHTORESETPLAYER = 200 --So tien dung de Chuyen Sinh.Gia Tri: Van
MAXCHUYENSINH = 1 --Tat/Mo Chuyen Sinh Vo Han.Mac Dinh: 1
RESETKEEPSTART = 0 --Tat/mo Trung Sinh co giu diem.
FileDataTrungSinh = "Data/danhsachtrungsinh.lua"
function main()
lapdanhsach_main()
end;
function trungsinh_npc()
solan,diemdu,info = ThongTinNhanVat(GetName())
SayEx({"<color="..colorS()..">Chuyen Sinh Lao Nhan<color>:\nThong Tin:\nChuyen Sinh: "..GetTask(TaskTrungSinh).." lan.\nYeu Cau Ke Tiep:\nLevel: "..LISTFORTS[info][1].." Cap.\t\tDanh Vong: "..LISTFORTS[info][2].." Diem.\nPhuc Duyen:"..LISTFORTS[info][3].." diem.\t\tChuyen Sinh Kiep: "..LISTFORTS[info][6].." Cai.",
"Chuyen Sinh Nhan Vat./chuyensinhZ",
"Huong Dan Ve Chuyen Sinh./hdcs",
"Nhan Danh Hieu Chuyen Sinh./danhhieuchuyensinh",
"Cai Lao Hoan Dong./clhd",
"Thoat./Exit"})
end;
function clhd()
Msg2Player("Chuc Nang nay se cap nhat sau")
end
function phanthuongcs()
Msg2Player("Ra mat trong thoi gian som nhat")
end;
function danhhieuchuyensinh()
if GetTask(TaskTrungSinh) >= 1 and GetTask(TaskTrungSinh) < 10 then
if HaveMagic(457) <= 0 then
SetRank(25)
AddMagic(457,1)
Msg2Player("Ban nhan duoc Danh Hieu [Sieu Pham]")
else
Talk(1,"addrank","Nguoi da nhan <color=fire>Danh Hieu Sieu Pham<color> khong the nhan duoc nua")
end
elseif GetTask(TaskTrungSinh) >= 10 and GetTask(TaskTrungSinh) < 20 then
if HaveMagic(458) <= 0 then
DelMagic(457)
SetRank(26)
AddMagic(458,1)
Msg2Player("Ban nhan duoc Danh Hieu [Xuat Tran]")
else
Talk(1,"addrank","Nguoi da nhan <color=fire>Danh Hieu Xuat Tran<color> khong the nhan duoc nua")
end
elseif GetTask(TaskTrungSinh) >= 20 and GetTask(TaskTrungSinh) < 30 then
if HaveMagic(459) <= 0 then
DelMagic(458)
DelMagic(457)
SetRank(27)
AddMagic(459,1)
Msg2Player("Ban nhan duoc Danh Hieu [Lang Tuyet]")
else
Talk(1,"addrank","Nguoi da nhan <color=fire>Danh Hieu Lang Tuyet<color> khong the nhan duoc nua")
end
elseif GetTask(TaskTrungSinh) >= 30 and GetTask(TaskTrungSinh) < 40 then
if HaveMagic(460) <= 0 then
DelMagic(459)
DelMagic(458)
DelMagic(457)
SetRank(28)
AddMagic(460,1)
Msg2Player("Ban nhan duoc Danh Hieu [Kinh The]")
else
Talk(1,"addrank","Nguoi da nhan <color=fire>Danh Hieu Kinh The<color> khong the nhan duoc nua")
end
elseif GetTask(TaskTrungSinh) >= 40 then
if HaveMagic(461) <= 0 then
SetRank(29)
DelMagic(460)
DelMagic(458)
DelMagic(457)
DelMagic(459)
AddMagic(461,1)
Msg2Player("Ban nhan duoc Danh Hieu [Hon Thien]")
else
Talk(1,"addrank","Nguoi da nhan <color=fire>Danh Hieu Hon Thien<color> khong the nhan duoc nua")
end
else
Msg2Player("So lan trung sinh cua ban la : "..GetTask(TaskTrungSinh).." khong the nhan thuong")
end
end
function addrank()
if GetTask(TaskTrungSinh) >= 1 and GetTask(TaskTrungSinh) < 10 then
SetRank(25)
elseif GetTask(TaskTrungSinh) >= 10 and GetTask(TaskTrungSinh) < 20 then
SetRank(26)
elseif GetTask(TaskTrungSinh) >= 20 and GetTask(TaskTrungSinh) < 30 then
SetRank(27)
elseif GetTask(TaskTrungSinh) >= 30 and GetTask(TaskTrungSinh) < 40 then
SetRank(28)
elseif GetTask(TaskTrungSinh) >= 40 then
SetRank(29)
end
end
function hdcs()
Talk(4,"Exit","Chuyen Sinh giup gia tang cong luc, hoi sinh nguyen khi",
"Chuyen Sinh nhieu lan se co uu dai nhu gia tang diem <color=fire>Trang Phai<color> va luyen them duoc skill Mon Phai",
"Cap Bac:\n1 -> 10 : Sieu Pham\t\t10 -> 20 : Xuat Tran\n20 -> 30 : Lang Tuyet\t\t30 -> 40 : Hon Thien\n40 -> 50 : Hon Thien\t\t50 >> : Vo Song",
"Moi lan trung sinh se nhan duoc diem ky nang, tiem nang va dac biet la skill ho tro danh hieu kem theo")
end;
function lapdanhsach_main()
if timkiemtennhanvat(GetName()) == 1 then
trungsinh_npc()
else
LISTRESET[getn(LISTRESET)+1] = {GetName(),GetTask(TaskTrungSinh),0,GetTask(TaskTr ungSinh)+1,0}
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
trungsinh_npc()
end
end;
function updatetablecs()
if timkiemtennhanvat(GetName()) == nil then
LISTRESET[getn(LISTRESET)+1] = {GetName(),0,0,1,0}
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
end
end;
function timkiemtennhanvat(ten)
for i = 1,getn(LISTRESET) do
if LISTRESET[i][1] == ten then
return 1
end
end
end;
function ThongTinNhanVat(ten)
for i = 1,getn(LISTRESET) do
if LISTRESET[i][1] == ten then
a = GetTask(TaskTrungSinh) + 1
if a == LISTRESET[i][4] then
return LISTRESET[i][2],LISTRESET[i][3],LISTRESET[i][4]
else
LISTRESET[i][2] = GetTask(TaskTrungSinh)
LISTRESET[i][4] = GetTask(TaskTrungSinh)+1
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
return LISTRESET[i][2],LISTRESET[i][3],LISTRESET[i][4]
end
end
end
end;
function SOLANTRUNGSINH(ten)
for i = 1,getn(LISTRESET) do
if LISTRESET[i][1] == ten then
return LISTRESET[i][2]
end
end
end;
function PHANTHUONGCHUYENSINH(ten)
for i = 1,getn(LISTRESET) do
if LISTRESET[i][1] == ten then
return LISTRESET[i][5]
end
end
end;
function SUMALLREWAR()
for i=1,getn(LISTRESET) do
if LISTRESET[i][1] == GetName() then
LISTRESET[i][5] = LISTRESET[i][5]+1
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
end
end
end;
function conglantrungsinh()
for i=1,getn(LISTRESET) do
if LISTRESET[i][1] == GetName() then
LISTRESET[i][2] = GetTask(TaskTrungSinh)+1
LISTRESET[i][4] = LISTRESET[i][4]+1
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
end
end
end;
function LuuExpSauKhiTrungSinh(diemluu)
for i=1,getn(LISTRESET) do
if LISTRESET[i][1] == GetName() then
LISTRESET[i][3] = LISTRESET[i][3]+diemluu
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
end
end
end;
function chuyensinhZ()
solan,diemdu,info = ThongTinNhanVat(GetName())
--if info >= 47 then info = 47 end
if GetCash() >= Van(CASHTORESETPLAYER)*info then
if GetLevel() >= LISTFORTS[info][1] then
if AddDanhVong() >= LISTFORTS[info][2] then
if GetTask(TaskPhucDuyen) >= LISTFORTS[info][3] then
if GetItemCount(IDKEYTRUNGSINH) >= LISTFORTS[info][6] then
Pay(Van(CASHTORESETPLAYER)*info)
conglantrungsinh()
if RESETKEEPSTART == 1 then
MsgEx("Chuyen Sinh Giu Lai Toan Bo Diem Tu Cap Truoc.")
elseif RESETKEEPSTART == 0 then
RollPoint()
MsgEx("Chuyen Sinh Khong Giu Lai Toan Bo Diem Tu Cap Truoc.")
end
now = GetExp()
if now <= 0 then now = 0 end
LuuExpSauKhiTrungSinh(now)
for i =1,LISTFORTS[info][6] do
DelItem(IDKEYTRUNGSINH)
end;
AddOwnExp(-now)
a = LISTFORTS[info][2]*(-1)
b = LISTFORTS[info][3]
AddDanhVong(a)
SetTask(TaskPhucDuyen,GetTask(TaskPhucDuyen)-b)
z = LISTFORTS[info][4]
x = LISTFORTS[info][5]
AddAll(z,x)
--SetRank(LISTFORTS[info][7])
SetTask(TaskTayTuyKinh,0)
SetTask(TaskVoLamMatTich,0)
SetTask(TaskTrungSinh,GetTask(TaskTrungSinh)+1)
SetLevel(LEVELGOTWHENRESET)
solan,diemdu,info = ThongTinNhanVat(GetName())
MsgEx("Chuyen Sinh Nhan Vat Thanh Cong Lan Thu: "..solan)
MsgEx("Chuan bi thoat khoi Game...\n<Dang Cap Nhat Lai Thong Tin Nhan Vat>")
KickOutSelf()
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Can Co <color=red>"..LISTFORTS[info][6].."<color> Vien Chuyen Sinh Kiep Moi co the Chuyen Sinh",1)
end
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Can Phuc Duyen <color=red>"..LISTFORTS[info][3].."<color> Diem Moi co the Chuyen Sinh",1)
end
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Can Danh Vong <color=red>"..LISTFORTS[info][2].."<color> Diem Moi co the Chuyen Sinh",1)
end
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Can Dang Cap <color=red>"..LISTFORTS[info][1].."<color> Moi co the Chuyen Sinh",1)
end
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Can <color=red>"..CASHTORESETPLAYER.."<color> Van moi co the Chuyen Sinh",1)
end
end;
function RollPoint()
SucManh = {35,20,25,30,20}
ThanPhap = {25,35,25,20,15}
SinhLuc = {25,20,25,30,25}
NoiLuc = {15,25,25,20,40}
NguHanh = GetSeries() + 1
ResetBaseAttrib(0,SucManh[NguHanh]);
ResetBaseAttrib(1,ThanPhap[NguHanh]);
ResetBaseAttrib(2,SinhLuc[NguHanh]);
ResetBaseAttrib(3,NoiLuc[NguHanh]);
AddProp(-GetProp())
TaySkill()
AddMagicPoint(-GetMagicPoint())
end;
function testdiemdu()
diemdu = kiemtradiemdu(GetName())
strings = "Rut "..diemdu.." diem./rutexp"
SayEx({"<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Hien tai nguoi dang co "..diemdu.." diem Kinh Nghiem du chua su dung.","Rut 500k diem./rutexp","Rut 1 Trieu diem./rutexp",strings,"Thoat./Exit"})
end;
function rutexp(nsel)
diemdu = kiemtradiemdu(GetName())
id = nsel+1
if id == 1 then
if diemdu >= 500000 then
for i=1,10 do
AddOwnExp(50000)
end
UseDiemExpDu(GetName(),-500000)
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Nguoi khong co du diem de rut ra...",1)
end
elseif id == 2 then
if diemdu >= 1000000 then
for i=1,20 do
AddOwnExp(50000)
end
UseDiemExpDu(GetName(),-1000000)
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Nguoi khong co du diem de rut ra...",1)
end
elseif id == 3 then
if diemdu > 0 then
diemduz = floor(diemdu/500000)
diemdut = mod(diemdu,500000)
for j=1,diemduz do
AddOwnExp(500000)
end
AddOwnExp(diemdut)
UseDiemExpDu(GetName(),-diemdu)
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Nguoi khong co diem nao de rut ra ca...",1)
end
end
end;
function kiemtravonglap(sodiem)
if sodiem > 0 and sodiem < 500000 then
return 10,floor(sodiem/10),1
elseif sodiem >= 500000 then
return 10,50000,1
elseif sodiem >= 1000000 then
return 20,50000,1
elseif sodiem >= 10000000 then
return 10,1000000,1
elseif sodiem >= 100000000 then
return 100,1000000,1
elseif sodiem >= 1000000000 then
return 100,1000000,10
elseif sodiem >= 2000000000 then
return 100,2000000,10
elseif sodiem >= 3000000000 then
return 100,3000000,10
end
end;
function UseDiemExpDu(tennguoirut,sodiem)
if sodiem == nil then
return
end
for i = 1,getn(LISTRESET) do
if tennguoirut == LISTRESET[i][1] then
LISTRESET[i][3] = LISTRESET[i][3] + sodiem
MsgEx("Hien tai ban con "..LISTRESET[i][3].." diem EXP du.")
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
break
end
end
end
function kiemtradiemdu(ten)
for i = 1,getn(LISTRESET) do
if LISTRESET[i][1] == ten then
return LISTRESET[i][3]
end
end
end;
function ResetDataBaseCS(ten)
for i = 1,getn(LISTRESET) do
if ten == LISTRESET[i][1] then
LISTRESET[i][3] = 0
LISTRESET[i][2] = 0
LISTRESET[i][4] = 0
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
MsgEx("Bay gio ban co the chuyen sinh lai tu dau.")
end
end
end;
lỗi npc dã tẩu.....ai bít cách fix hay có script hoàn chỉnh send giùm....tks lắm
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>
tks trước các pro
script chuyển sinh đây :(
Include("\\Script\\global\\sourcejx49.lua");
Include("\\script\\cacsukien\\banghoi\\tong.lua")
Include("\\Data\\danhsachtrungsinh.lua")
Include("\\Data\\dangcaptrungsinh.lua")
Include("\\script\\Á½ºþÇø\\°ÍÁêÏØ\\npc\\resetpl .lua");
IDKEYTRUNGSINH = 128
LEVELGOTWHENRESET = 1 --Level nhan duoc sau khi Chuyen Sinh
CASHTORESETPLAYER = 200 --So tien dung de Chuyen Sinh.Gia Tri: Van
MAXCHUYENSINH = 1 --Tat/Mo Chuyen Sinh Vo Han.Mac Dinh: 1
RESETKEEPSTART = 0 --Tat/mo Trung Sinh co giu diem.
FileDataTrungSinh = "Data/danhsachtrungsinh.lua"
function main()
lapdanhsach_main()
end;
function trungsinh_npc()
solan,diemdu,info = ThongTinNhanVat(GetName())
SayEx({"<color="..colorS()..">Chuyen Sinh Lao Nhan<color>:\nThong Tin:\nChuyen Sinh: "..GetTask(TaskTrungSinh).." lan.\nYeu Cau Ke Tiep:\nLevel: "..LISTFORTS[info][1].." Cap.\t\tDanh Vong: "..LISTFORTS[info][2].." Diem.\nPhuc Duyen:"..LISTFORTS[info][3].." diem.\t\tChuyen Sinh Kiep: "..LISTFORTS[info][6].." Cai.",
"Chuyen Sinh Nhan Vat./chuyensinhZ",
"Huong Dan Ve Chuyen Sinh./hdcs",
"Nhan Danh Hieu Chuyen Sinh./danhhieuchuyensinh",
"Cai Lao Hoan Dong./clhd",
"Thoat./Exit"})
end;
function clhd()
Msg2Player("Chuc Nang nay se cap nhat sau")
end
function phanthuongcs()
Msg2Player("Ra mat trong thoi gian som nhat")
end;
function danhhieuchuyensinh()
if GetTask(TaskTrungSinh) >= 1 and GetTask(TaskTrungSinh) < 10 then
if HaveMagic(457) <= 0 then
SetRank(25)
AddMagic(457,1)
Msg2Player("Ban nhan duoc Danh Hieu [Sieu Pham]")
else
Talk(1,"addrank","Nguoi da nhan <color=fire>Danh Hieu Sieu Pham<color> khong the nhan duoc nua")
end
elseif GetTask(TaskTrungSinh) >= 10 and GetTask(TaskTrungSinh) < 20 then
if HaveMagic(458) <= 0 then
DelMagic(457)
SetRank(26)
AddMagic(458,1)
Msg2Player("Ban nhan duoc Danh Hieu [Xuat Tran]")
else
Talk(1,"addrank","Nguoi da nhan <color=fire>Danh Hieu Xuat Tran<color> khong the nhan duoc nua")
end
elseif GetTask(TaskTrungSinh) >= 20 and GetTask(TaskTrungSinh) < 30 then
if HaveMagic(459) <= 0 then
DelMagic(458)
DelMagic(457)
SetRank(27)
AddMagic(459,1)
Msg2Player("Ban nhan duoc Danh Hieu [Lang Tuyet]")
else
Talk(1,"addrank","Nguoi da nhan <color=fire>Danh Hieu Lang Tuyet<color> khong the nhan duoc nua")
end
elseif GetTask(TaskTrungSinh) >= 30 and GetTask(TaskTrungSinh) < 40 then
if HaveMagic(460) <= 0 then
DelMagic(459)
DelMagic(458)
DelMagic(457)
SetRank(28)
AddMagic(460,1)
Msg2Player("Ban nhan duoc Danh Hieu [Kinh The]")
else
Talk(1,"addrank","Nguoi da nhan <color=fire>Danh Hieu Kinh The<color> khong the nhan duoc nua")
end
elseif GetTask(TaskTrungSinh) >= 40 then
if HaveMagic(461) <= 0 then
SetRank(29)
DelMagic(460)
DelMagic(458)
DelMagic(457)
DelMagic(459)
AddMagic(461,1)
Msg2Player("Ban nhan duoc Danh Hieu [Hon Thien]")
else
Talk(1,"addrank","Nguoi da nhan <color=fire>Danh Hieu Hon Thien<color> khong the nhan duoc nua")
end
else
Msg2Player("So lan trung sinh cua ban la : "..GetTask(TaskTrungSinh).." khong the nhan thuong")
end
end
function addrank()
if GetTask(TaskTrungSinh) >= 1 and GetTask(TaskTrungSinh) < 10 then
SetRank(25)
elseif GetTask(TaskTrungSinh) >= 10 and GetTask(TaskTrungSinh) < 20 then
SetRank(26)
elseif GetTask(TaskTrungSinh) >= 20 and GetTask(TaskTrungSinh) < 30 then
SetRank(27)
elseif GetTask(TaskTrungSinh) >= 30 and GetTask(TaskTrungSinh) < 40 then
SetRank(28)
elseif GetTask(TaskTrungSinh) >= 40 then
SetRank(29)
end
end
function hdcs()
Talk(4,"Exit","Chuyen Sinh giup gia tang cong luc, hoi sinh nguyen khi",
"Chuyen Sinh nhieu lan se co uu dai nhu gia tang diem <color=fire>Trang Phai<color> va luyen them duoc skill Mon Phai",
"Cap Bac:\n1 -> 10 : Sieu Pham\t\t10 -> 20 : Xuat Tran\n20 -> 30 : Lang Tuyet\t\t30 -> 40 : Hon Thien\n40 -> 50 : Hon Thien\t\t50 >> : Vo Song",
"Moi lan trung sinh se nhan duoc diem ky nang, tiem nang va dac biet la skill ho tro danh hieu kem theo")
end;
function lapdanhsach_main()
if timkiemtennhanvat(GetName()) == 1 then
trungsinh_npc()
else
LISTRESET[getn(LISTRESET)+1] = {GetName(),GetTask(TaskTrungSinh),0,GetTask(TaskTr ungSinh)+1,0}
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
trungsinh_npc()
end
end;
function updatetablecs()
if timkiemtennhanvat(GetName()) == nil then
LISTRESET[getn(LISTRESET)+1] = {GetName(),0,0,1,0}
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
end
end;
function timkiemtennhanvat(ten)
for i = 1,getn(LISTRESET) do
if LISTRESET[i][1] == ten then
return 1
end
end
end;
function ThongTinNhanVat(ten)
for i = 1,getn(LISTRESET) do
if LISTRESET[i][1] == ten then
a = GetTask(TaskTrungSinh) + 1
if a == LISTRESET[i][4] then
return LISTRESET[i][2],LISTRESET[i][3],LISTRESET[i][4]
else
LISTRESET[i][2] = GetTask(TaskTrungSinh)
LISTRESET[i][4] = GetTask(TaskTrungSinh)+1
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
return LISTRESET[i][2],LISTRESET[i][3],LISTRESET[i][4]
end
end
end
end;
function SOLANTRUNGSINH(ten)
for i = 1,getn(LISTRESET) do
if LISTRESET[i][1] == ten then
return LISTRESET[i][2]
end
end
end;
function PHANTHUONGCHUYENSINH(ten)
for i = 1,getn(LISTRESET) do
if LISTRESET[i][1] == ten then
return LISTRESET[i][5]
end
end
end;
function SUMALLREWAR()
for i=1,getn(LISTRESET) do
if LISTRESET[i][1] == GetName() then
LISTRESET[i][5] = LISTRESET[i][5]+1
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
end
end
end;
function conglantrungsinh()
for i=1,getn(LISTRESET) do
if LISTRESET[i][1] == GetName() then
LISTRESET[i][2] = GetTask(TaskTrungSinh)+1
LISTRESET[i][4] = LISTRESET[i][4]+1
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
end
end
end;
function LuuExpSauKhiTrungSinh(diemluu)
for i=1,getn(LISTRESET) do
if LISTRESET[i][1] == GetName() then
LISTRESET[i][3] = LISTRESET[i][3]+diemluu
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
end
end
end;
function chuyensinhZ()
solan,diemdu,info = ThongTinNhanVat(GetName())
--if info >= 47 then info = 47 end
if GetCash() >= Van(CASHTORESETPLAYER)*info then
if GetLevel() >= LISTFORTS[info][1] then
if AddDanhVong() >= LISTFORTS[info][2] then
if GetTask(TaskPhucDuyen) >= LISTFORTS[info][3] then
if GetItemCount(IDKEYTRUNGSINH) >= LISTFORTS[info][6] then
Pay(Van(CASHTORESETPLAYER)*info)
conglantrungsinh()
if RESETKEEPSTART == 1 then
MsgEx("Chuyen Sinh Giu Lai Toan Bo Diem Tu Cap Truoc.")
elseif RESETKEEPSTART == 0 then
RollPoint()
MsgEx("Chuyen Sinh Khong Giu Lai Toan Bo Diem Tu Cap Truoc.")
end
now = GetExp()
if now <= 0 then now = 0 end
LuuExpSauKhiTrungSinh(now)
for i =1,LISTFORTS[info][6] do
DelItem(IDKEYTRUNGSINH)
end;
AddOwnExp(-now)
a = LISTFORTS[info][2]*(-1)
b = LISTFORTS[info][3]
AddDanhVong(a)
SetTask(TaskPhucDuyen,GetTask(TaskPhucDuyen)-b)
z = LISTFORTS[info][4]
x = LISTFORTS[info][5]
AddAll(z,x)
--SetRank(LISTFORTS[info][7])
SetTask(TaskTayTuyKinh,0)
SetTask(TaskVoLamMatTich,0)
SetTask(TaskTrungSinh,GetTask(TaskTrungSinh)+1)
SetLevel(LEVELGOTWHENRESET)
solan,diemdu,info = ThongTinNhanVat(GetName())
MsgEx("Chuyen Sinh Nhan Vat Thanh Cong Lan Thu: "..solan)
MsgEx("Chuan bi thoat khoi Game...\n<Dang Cap Nhat Lai Thong Tin Nhan Vat>")
KickOutSelf()
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Can Co <color=red>"..LISTFORTS[info][6].."<color> Vien Chuyen Sinh Kiep Moi co the Chuyen Sinh",1)
end
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Can Phuc Duyen <color=red>"..LISTFORTS[info][3].."<color> Diem Moi co the Chuyen Sinh",1)
end
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Can Danh Vong <color=red>"..LISTFORTS[info][2].."<color> Diem Moi co the Chuyen Sinh",1)
end
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Can Dang Cap <color=red>"..LISTFORTS[info][1].."<color> Moi co the Chuyen Sinh",1)
end
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Can <color=red>"..CASHTORESETPLAYER.."<color> Van moi co the Chuyen Sinh",1)
end
end;
function RollPoint()
SucManh = {35,20,25,30,20}
ThanPhap = {25,35,25,20,15}
SinhLuc = {25,20,25,30,25}
NoiLuc = {15,25,25,20,40}
NguHanh = GetSeries() + 1
ResetBaseAttrib(0,SucManh[NguHanh]);
ResetBaseAttrib(1,ThanPhap[NguHanh]);
ResetBaseAttrib(2,SinhLuc[NguHanh]);
ResetBaseAttrib(3,NoiLuc[NguHanh]);
AddProp(-GetProp())
TaySkill()
AddMagicPoint(-GetMagicPoint())
end;
function testdiemdu()
diemdu = kiemtradiemdu(GetName())
strings = "Rut "..diemdu.." diem./rutexp"
SayEx({"<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Hien tai nguoi dang co "..diemdu.." diem Kinh Nghiem du chua su dung.","Rut 500k diem./rutexp","Rut 1 Trieu diem./rutexp",strings,"Thoat./Exit"})
end;
function rutexp(nsel)
diemdu = kiemtradiemdu(GetName())
id = nsel+1
if id == 1 then
if diemdu >= 500000 then
for i=1,10 do
AddOwnExp(50000)
end
UseDiemExpDu(GetName(),-500000)
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Nguoi khong co du diem de rut ra...",1)
end
elseif id == 2 then
if diemdu >= 1000000 then
for i=1,20 do
AddOwnExp(50000)
end
UseDiemExpDu(GetName(),-1000000)
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Nguoi khong co du diem de rut ra...",1)
end
elseif id == 3 then
if diemdu > 0 then
diemduz = floor(diemdu/500000)
diemdut = mod(diemdu,500000)
for j=1,diemduz do
AddOwnExp(500000)
end
AddOwnExp(diemdut)
UseDiemExpDu(GetName(),-diemdu)
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Nguoi khong co diem nao de rut ra ca...",1)
end
end
end;
function kiemtravonglap(sodiem)
if sodiem > 0 and sodiem < 500000 then
return 10,floor(sodiem/10),1
elseif sodiem >= 500000 then
return 10,50000,1
elseif sodiem >= 1000000 then
return 20,50000,1
elseif sodiem >= 10000000 then
return 10,1000000,1
elseif sodiem >= 100000000 then
return 100,1000000,1
elseif sodiem >= 1000000000 then
return 100,1000000,10
elseif sodiem >= 2000000000 then
return 100,2000000,10
elseif sodiem >= 3000000000 then
return 100,3000000,10
end
end;
function UseDiemExpDu(tennguoirut,sodiem)
if sodiem == nil then
return
end
for i = 1,getn(LISTRESET) do
if tennguoirut == LISTRESET[i][1] then
LISTRESET[i][3] = LISTRESET[i][3] + sodiem
MsgEx("Hien tai ban con "..LISTRESET[i][3].." diem EXP du.")
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
break
end
end
end
function kiemtradiemdu(ten)
for i = 1,getn(LISTRESET) do
if LISTRESET[i][1] == ten then
return LISTRESET[i][3]
end
end
end;
function ResetDataBaseCS(ten)
for i = 1,getn(LISTRESET) do
if ten == LISTRESET[i][1] then
LISTRESET[i][3] = 0
LISTRESET[i][2] = 0
LISTRESET[i][4] = 0
lammoidanhsach = TaoBang(LISTRESET,"LISTRESET","")
SaveData(FileDataTrungSinh,lammoidanhsach)
MsgEx("Bay gio ban co the chuyen sinh lai tu dau.")
end
end
end;