benop001
08-11-10, 08:30 PM
Include("\\Script\\global\\sourcejx49.lua");
Include("\\script\\cacsukien\\banghoi\\tong.lua")
Include("\\Data\\danhsachtrungsinh.lua")
Include("\\Data\\dangcaptrungsinh.lua")
IDKEYTRUNGSINH = 81
LEVELGOTWHENRESET = 1 --Level nhan duoc sau khi Chuyen Sinh
CASHTORESETPLAYER = 20000 --So tien dung de Chuyen Sinh.Gia Tri: Van
MAXCHUYENSINH = 1 --Tat/Mo Chuyen Sinh Vo Han.Mac Dinh: 1
RESETKEEPSTART = 1 --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>: Chuyen Sinh: "..solan.." lan.\tLan Tiep Theo Can:\nLevel: 200 Cap.\tDanh Vong: "..LISTFORTS[info][2].." Diem.\nPhuc Duyen: "..LISTFORTS[info][3].." Diem.\tChuyen Sinh Kiep: "..LISTFORTS[info][6].." Cai.",
"Ta Muon Chuyen Sinh./chuyensinhZ",
"Thoat./Exit"})
end;
function lapdanhsach_main()
if timkiemtennhanvat(GetName()) == 1 then
trungsinh_npc()
else
LISTRESET[getn(LISTRESET)+1] = {GetName(),0,0,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
return LISTRESET[i][2],LISTRESET[i][3],LISTRESET[i][4]
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] = LISTRESET[i][2]+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
lv = GetLevel()
if lv >= 200 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> Hoa Son Tuyet Lien Moi co the Chuyen Sinh",1)
end
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Can Dang Cap <color=red>200<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;
mún cs giữ điễm thì phải chĩnh ntn vậy mấy pro =:)=:)
Include("\\script\\cacsukien\\banghoi\\tong.lua")
Include("\\Data\\danhsachtrungsinh.lua")
Include("\\Data\\dangcaptrungsinh.lua")
IDKEYTRUNGSINH = 81
LEVELGOTWHENRESET = 1 --Level nhan duoc sau khi Chuyen Sinh
CASHTORESETPLAYER = 20000 --So tien dung de Chuyen Sinh.Gia Tri: Van
MAXCHUYENSINH = 1 --Tat/Mo Chuyen Sinh Vo Han.Mac Dinh: 1
RESETKEEPSTART = 1 --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>: Chuyen Sinh: "..solan.." lan.\tLan Tiep Theo Can:\nLevel: 200 Cap.\tDanh Vong: "..LISTFORTS[info][2].." Diem.\nPhuc Duyen: "..LISTFORTS[info][3].." Diem.\tChuyen Sinh Kiep: "..LISTFORTS[info][6].." Cai.",
"Ta Muon Chuyen Sinh./chuyensinhZ",
"Thoat./Exit"})
end;
function lapdanhsach_main()
if timkiemtennhanvat(GetName()) == 1 then
trungsinh_npc()
else
LISTRESET[getn(LISTRESET)+1] = {GetName(),0,0,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
return LISTRESET[i][2],LISTRESET[i][3],LISTRESET[i][4]
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] = LISTRESET[i][2]+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
lv = GetLevel()
if lv >= 200 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> Hoa Son Tuyet Lien Moi co the Chuyen Sinh",1)
end
else
MsgEx("<color="..colorS()..">Chuyen Sinh Lao Nhan<color>: Can Dang Cap <color=red>200<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;
mún cs giữ điễm thì phải chĩnh ntn vậy mấy pro =:)=:)