PDA

View Full Version : Ép Bánh Kem cho Event Noen, mình mới viết !!!



The King
05-01-2012, 10:39 PM
Script Ép Bánh Kem cho Event Noen, mình mới viết !!! chỉ test trong gamesever.exe Không có Patch chạy đồng hóa ai test giùm đi !!!


Code

---- Author: Kenshiwo
---- Yahoo: kenshiwo
---- Tittle: Event Ep Banh cho Noen - Giang Sinh
---- Date: Dec 24,2010

--- Gioi han diem ---
GIOIHAN = GetTask(2000) --- Khai Bao gioi han 1 Ty Kinh Nghiem
--- Phan Thuong Banh
EXPKEM = 10*1000000 --- 10 Trieu
EXPTHUONG = 20*1000000 --- 20 Trieu
EXPNGON = 50*1000000 --- 50 Trieu
EXPHAOHANG = 100*1000000 --- 100 Trieu
--- Vat Pham
SUA = 117
BOTMI = 118
TRUNG = 119
DUONG = 200
---Kiem Tra Vat Pham
KTSUA = GetItemCount(117) --- SUA
KTBOTMI = GetItemCount(118) --- BOTMI
KTTRUNG = GetItemCount(119) --- TRUNG
KTDUONG = GetItemCount(120) --- DUONG
--- Banh
BKEM = 121
BTHUONG = 122
BNGON = 123
BHAOHANG = 124
--- Kiem tra banh
KTBKEM = GetItemCount(121)
KTBTHUONG = GetItemCount(122)
KTBNGON = GetItemCount(123)
KTBHAOHANG = GetItemCount(124)

---Script Chu
function main()
SayEx({"Le Quan: <color=green>Giang Sinh Vui Ve!<color>, tham gia su kien Giang Sinh!",4,
"Tim hieu ve su kien/timhieu",
"Ep Banh/epbanh",
"Su Dung Banh/sudungbanh",
"Thoat/no",
});
end;

--- Tim hieu
function timhieu()
SayEx({"Le Quan: Event giang sinh lan nay la Banh Kem.",
"Nguyen Lieu ep banh: <color=blue>Sua, Bot Mi, Trung, Duong<color> va <color=yellow>Tien Van.",
"Tat ca co 4 loai Banh: Kem, Thuong, Ngon, Hao Hang.",
"Dieu kien de ep banh theo <color=green>Dang Cap<color> cua moi loai.",
"<color=blue>Banh Kem - Sua, Thuong, Ngon, Hao Hang<color> = <color=yellow>100v, 200v, 300v, 500v.",
"Su dung banh se nhan duoc Kinh Nghiem theo dang cap cua banh.",
"Moi loai chi an duoc 10 cai.",
"<color=green>Chuc Dai Hiep!!! Giang Sinh Vui Ve!!!"
});
end;

--- Lua chon ep banh
function epbanh()
SayEx({
"Le quan: Xin lua chon loai Banh muon ep:",5,
"Banh Kem Sua/banhkem1",
"Banh Kem Sua - Thuong/banhkem2",
"Banh Kem Sua - Ngon/banhkem3",
"Banh Kem Sua - Haohan/banhkem4",
"Thoat/no"
});
end;

--- Lua chon Su Dung Banh
function sudungbanh()
SayEx({
"Le quan: Xin lua chon loai Banh muon su dung:",5,
"Banh Kem Sua/dungbanhkem1",
"Banh Kem Sua - Thuong/dungbanhkem2",
"Banh Kem Sua - Ngon/dungbanhkem3",
"Banh Kem Sua - Haohan/dungbanhkem4",
"Thoai/no"
});
end

--- Ep Banh
function banhkem1()
if
KTSUA >= 1 and
KTBOTMI >= 1 and
KTTRUNG >= 1 and
KTDUONG >= 1 and
(GetCash() >= 1000000) then
Pay(1000000)
DeleteItem(SUA)
DeleteItem(BOTMI)
DeleteItem(TRUNG)
DeleteItem(DUONG)
AddEventItem(BKEM)
Msg2Player("Chuc mung ban! Ban nhan duoc 1 [Banh kem]");
else
SayEx({"Ban khong du nguyen lieu hoac 50v de doi banh Kem"});
end
end;

function banhkem2()
if
KTSUA >= 1 and
KTBOTMI >= 1 and
KTTRUNG >= 1 and
KTDUONG >= 1 and
(GetCash() >= 2000000) then
Pay(2000000)
DeleteItem(SUA)
DeleteItem(BOTMI)
DeleteItem(TRUNG)
DeleteItem(DUONG)
AddEventItem(BTHUONG)
Msg2Player("Chuc mung ban! Ban nhan duoc 1 [Banh kem thuong]");
else
SayEx({"Ban khong du nguyen lieu hoac 100v de doi banh Kem"});
end
end;

function banhkem3()
if
KTSUA >= 1 and
KTBOTMI >= 1 and
KTTRUNG >= 1 and
KTDUONG >= 1 and
(GetCash() >= 3000000) then
Pay(3000000)
DeleteItem(SUA)
DeleteItem(BOTMI)
DeleteItem(TRUNG)
DeleteItem(DUONG)
AddEventItem(BNGON)
Msg2Player("Chuc mung ban! Ban nhan duoc 1 [Banh kem ngon]");
else
SayEx({"Ban khong du nguyen lieu hoac 150v de doi banh Kem"});
end
end;

function banhkem4()
if
KTSUA >= 1 and
KTBOTMI >= 1 and
KTTRUNG >= 1 and
KTDUONG >= 1 and
(GetCash() >= 5000000) then
Pay(5000000)
DeleteItem(SUA)
DeleteItem(BOTMI)
DeleteItem(TRUNG)
DeleteItem(DUONG)
AddEventItem(BHAOHANG)
Msg2Player("Chuc mung ban! Ban nhan duoc 1 [Banh kem hao hang]");
else
SayEx({"Ban khong du nguyen lieu hoac 200v de doi banh Kem"});
end
end;

--- Su Dung Banh
function dungbanhkem1()
if KTBKEM >= 1 and GIOIHAN <= 100 then
SetTask(2000,GIOIHAN+1)
DeleteItem(BKEM)
AddOwnExp(EXPKEM)
Msg2Player("Chuc mung ban! Ban nhan duoc 1 phan thuong "..EXPKEM.." Kinh nghiem");
else
SayEx({"Ban da nhan duong 1 Ty Kinh nghiem hoac khong co banh muon su dung trong nguoi"});
end
end;

function dungbanhkem2()
if KTBTHUONG >= 1 and GIOIHAN <= 100 then
SetTask(2000,GIOIHAN+2)
DeleteItem(BTHUONG)
AddOwnExp(EXPTHUONG)
Msg2Player("Chuc mung ban! Ban nhan duoc 1 phan thuong "..EXPTHUONG.." Kinh nghiem");
else
SayEx({"Ban da nhan duong 1 Ty Kinh nghiem hoac khong co banh muon su dung trong nguoi"});
end
end;

function dungbanhkem3()
if KTBNGON >= 1 and GIOIHAN <= 100 then
SetTask(2000,GIOIHAN+5)
DeleteItem(BNGON)
AddOwnExp(EXPNGON)
Msg2Player("Chuc mung ban! Ban nhan duoc 1 phan thuong "..EXPNGON.." Kinh nghiem");
else
SayEx({"Ban da nhan duong 1 Ty Kinh nghiem hoac khong co banh muon su dung trong nguoi"});
end
end;

function dungbanhkem4()
if KTBHAOHANG >= 1 and GIOIHAN <= 100 then
SetTask(2000,GIOIHAN+10)
DeleteItem(BHAOHANG)
AddOwnExp(EXPHAOHANG)
Msg2Player("Chuc mung ban! Ban nhan duoc 1 phan thuong "..EXPHAOHANG.." Kinh nghiem");
else
SayEx({"Ban da nhan duong 1 Ty Kinh nghiem hoac khong co banh muon su dung trong nguoi"});
end
end;

--- Thoat
function no()
end;


Script rớt đồ tách riêng: tạo file "tentuyy.LUA"

Code

---- Author: Kenshiwo
---- Yahoo: kenshiwo
---- Tittle: Event Ep Banh cho Noen - Giang Sinh
---- Date: Dec 24,2010

function dropeventitem()
tle = random(1,20) ----> Ty le vat pham rot ra .05%
sll = random(117,120) ---> Vat Pham rot ra tuy y co 4 loai Random --- SUA -- BOTMI -- TRUNG -- DUONG ---
if (tle <= 1) then
AddEventItem(sll)
end
end;

Tìm Script .LUA của Quái: Include "\\Script\\....\\tentuyy.LUA"
Khai báo hàm: dropeventitem() trong Function OnDeath() ở file .LUA của Quái


[Only registered and activated users can see links]