Files
Leviathan/GameServer/AziaMafiaScriptsBackup/Other/guild_system.lua
T
2026-06-01 12:46:52 +02:00

338 lines
14 KiB
Lua

function donation_menu_example()
dlg_menu("Guild Donation Register","clan_donation_register()")
dlg_menu("Guild Donation","guild_donation_point_menu(0)")
dlg_menu("Guild Level"," guild_level()")
dlg_menu("Guild Buff","clan_buff()")
dlg_menu("Guild Shop","guild_shop_menu()")
end
function guild_donation_point_menu(length)
dlg_title("Guild")
dlg_text("Min amount to donate(Bagislanicak en düsük tutar) : 100")
if length < 10 then
for i = 1,table.getn(menu_number) do
dlg_menu(menu_number[i] ,"guild_donation_point_menu2("..(length+1)..","..menu_number[i]..")")
end
end
dlg_menu("@90010001",'') -- Cikiş // string id =
dlg_show()
end
function guild_donation_point_menu2(length,donate_number)
dlg_title("Guild")
dlg_text("Amount to Donate(Bagislanicak tutar ) : "..donate_number.."")
if length < 10 then
for i = 1,table.getn(menu_number) do
dlg_menu(menu_number[i] ,"guild_donation_point_menu2("..(length+1)..","..donate_number..""..menu_number[i]..")")
end
end
dlg_menu("Donate ","clan_donation_system("..donate_number..")")
dlg_menu("@90010001",'') -- Cikiş // string id =
dlg_show()
end
menu_number = {"1","2","3","4","5","6","7","8","9","0"}
function clan_donation_system(price)
local donation_guild_id,guild_control_id,guild_donation_point,guild_shop_point,charackter_name,guild_shop_point_1,rupee
donation_guild_id = get_value("guild_id")
charackter_name = get_value("name")
guild_donation_point = get_global_variable("donation_guild_"..donation_guild_id.."")
guild_shop_point = get_global_variable("guild_"..donation_guild_id.."_"..charackter_name.."_shop_point")
guild_shop_point_1 = price / 100
rupee = get_value("gold")
if guild_shop_point == "" then
set_global_variable("guild_"..donation_guild_id.."_"..charackter_name.."_shop_point",1)
elseif guild_donation_point >= 1 then
if donation_guild_id >= 1 and guild_donation_point >= 1 and price >= 100 and rupee >= price then
set_global_variable("donation_guild_"..donation_guild_id.."",guild_donation_point + price)
set_value("gold",rupee - price)
private_notice("Your clan has donated "..price.." points")
set_global_variable("guild_"..donation_guild_id.."_"..charackter_name.."_shop_point",guild_shop_point + guild_shop_point_1)
private_notice("<#ff0a0a>You win "..guild_shop_point_1.." guild shop point")
else
private_notice("you have not registered clan or you do not have enough arena point")
private_notice("klan kayit yaptirmadiniz veya yeterli arena point yoktur")
end
end
end
function guild_level()
local donation_guild_id,guild_donation_point,charackter_name,guild_shop_point
charackter_name = get_value("name")
donation_guild_id = get_value("guild_id")
guild_donation_point = get_global_variable("donation_guild_"..donation_guild_id.."")
guild_shop_point = get_global_variable("guild_"..donation_guild_id.."_"..charackter_name.."_shop_point")
if donation_guild_id >= 1 and guild_donation_point >= 1 then
if donation_guild_id >= 1 and guild_donation_point >= 1 and guild_donation_point <= 10000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/10000 Guil Level : 0 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 10000 and guild_donation_point <= 30000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/30000 Guild Level : 1 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("90010001") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 30000 and guild_donation_point <= 60000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/60000 Guild Level : 2 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 60000 and guild_donation_point <= 100000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/100000 Guild Level : 3 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 100000 and guild_donation_point <= 150000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/150000 Guild level : 4 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 150000 and guild_donation_point <= 210000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/210000 Guild Level : 5 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 210000 and guild_donation_point <= 280000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/280000 Guild Level : 6 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 280000 and guild_donation_point <= 360000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/360000 Guild Level : 7 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 360000 and guild_donation_point <= 450000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/450000 Guild Level : 8 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 450000 and guild_donation_point <= 550000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/550000 Guild Level : 9 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 550000 and guild_donation_point <= 660000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/660000 Guild Level : 10 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 660000 and guild_donation_point <= 780000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/780000 Guild Level : 11 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 780000 and guild_donation_point <= 910000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/910000 Guild Level : 12 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 910000 and guild_donation_point <= 1050000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/1050000 Guild Level : 13 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 1050000 and guild_donation_point <= 1200000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/1200000 Guild Level : 14 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
if donation_guild_id >= 1 and guild_donation_point >= 1200000 then
dlg_title("Guild Point")
dlg_text("Guild point "..guild_donation_point.."/1360000 Guild Level :15 Guild Shop Point : "..guild_shop_point.."")
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
end
end
function clan_donation_register()
local donation_guild_id,guild_perm
donation_guild_id = get_value("guild_id")
guild_perm = get_value("guild_perm")
if donation_guild_id >= 1 and guild_perm == 7 and get_global_variable("donation_guild_"..donation_guild_id.."") == "" then
set_global_variable("donation_guild_"..donation_guild_id.."",1)
private_notice("You registered the clan")
else
private_notice("You are already registered")
end
end
function clan_buff()
local donation_guild_id,guild_donation_point
donation_guild_id = get_value("guild_id")
guild_donation_point = get_global_variable("donation_guild_"..donation_guild_id.."")
if guild_donation_point >= 10000 and guild_donation_point <= 30000 then
add_state(6523,50,8640000)
end
if guild_donation_point >= 30000 and guild_donation_point <= 60000 then
add_state(6523,100,8640000)
end
if guild_donation_point >= 60000 and guild_donation_point <= 100000 then
add_state(6523,150,8640000)
end
if guild_donation_point >= 100000 and guild_donation_point <= 150000 then
add_state(6523,200,8640000)
end
if guild_donation_point >= 150000 and guild_donation_point <= 210000 then
add_state(6523,250,8640000)
end
if guild_donation_point >= 210000 and guild_donation_point <= 280000 then
add_state(6523,300,8640000)
end
if guild_donation_point >= 280000 and guild_donation_point <= 360000 then
add_state(6523,350,8640000)
end
if guild_donation_point >= 360000 and guild_donation_point <= 450000 then
add_state(6523,400,8640000)
end
if guild_donation_point >= 450000 and guild_donation_point <= 550000 then
add_state(6523,450,8640000)
end
if guild_donation_point >= 550000 and guild_donation_point <= 660000 then
add_state(6523,550,8640000)
end
if guild_donation_point >= 660000 and guild_donation_point <= 780000 then
add_state(6523,600,8640000)
add_state(145012,1,8640000)
add_state(145522,1,8640000)
end
if guild_donation_point >= 780000 and guild_donation_point <= 910000 then
add_state(6523,650,8640000)
add_state(145012,2,8640000)
add_state(145522,2,8640000)
end
if guild_donation_point >= 910000 and guild_donation_point <= 1050000 then
add_state(6523,700,8640000)
add_state(145012,3,8640000)
add_state(145522,3,8640000)
end
if guild_donation_point >= 1050000 and guild_donation_point <= 1200000 then
add_state(6523,750,8640000)
add_state(145012,4,8640000)
add_state(145522,4,8640000)
end
if guild_donation_point >= 1200000 then
add_state(6523,800,8640000)
add_state(145012,5,8640000)
add_state(145522,5,8640000)
end
end
function guild_shop_menu()
local guild_id,charackter_name,guild_shop_point
guild_id = get_value("guild_id")
charackter_name = get_value("name")
guild_shop_point = get_global_variable("guild_"..guild_id.."_"..charackter_name.."_shop_point")
dlg_title("Guild Shop")
dlg_text("Guild Shop")
if guild_id >= 1 and guild_shop_point >= 1 then
dlg_menu("Guild Decoration Set Black -4K GP","guild_shop_system(1,1,4000)")
dlg_menu("Guild Decoration Set Red -4K GP","guild_shop_system(2,1,4000)")
dlg_menu("Guild Decoration Set Gold -4K GP","guild_shop_system(3,1,4000)")
dlg_menu("Guild Cloak -3K GP","guild_shop_system(4,1,3000)")
--dlg_menu("Guild Earring -3K GP","guild_shop_system(5,1,3000)")
--dlg_menu("Guild Necklace -4K GP","guild_shop_system(6,1,4000)")
dlg_menu("Guild Ring %15 -4500 GP","guild_shop_system(7,1,4500)")
dlg_menu("Guild Ring +75 -3K GP","guild_shop_system(8,1,3000)")
end
dlg_menu("@90010001","") -- cikis // exit
dlg_show()
end
function guild_shop_system(id,count,shop_point)
guild_id = get_value("guild_id")
charackter_name = get_value("name")
guild_shop_point = get_global_variable("guild_"..guild_id.."_"..charackter_name.."_shop_point")
if id == 1 and guild_shop_point >= shop_point then
insert_item(377887410,count)
insert_item(377887411,count)
insert_item(377887413,count)
insert_item(377887414,count)
insert_item(377887412,count)
private_notice("Guild ")
set_global_variable("guild_"..guild_id.."_"..charackter_name.."_shop_point",guild_shop_point - shop_point)
elseif id == 2 and guild_shop_point >= shop_point then
insert_item(387887410,count)
insert_item(387887411,count)
insert_item(387887413,count)
insert_item(387887414,count)
insert_item(387887412,count)
set_global_variable("guild_"..guild_id.."_"..charackter_name.."_shop_point",guild_shop_point - shop_point)
private_notice("Guild ")
elseif id == 3 and guild_shop_point >= shop_point then
insert_item(397887410,count)
insert_item(397887411,count)
insert_item(397887413,count)
insert_item(397887414,count)
insert_item(397887412,count)
set_global_variable("guild_"..guild_id.."_"..charackter_name.."_shop_point",guild_shop_point - shop_point)
private_notice("Guild ")
elseif id == 4 and guild_shop_point >= shop_point then
insert_item(498857445,count)
set_global_variable("guild_"..guild_id.."_"..charackter_name.."_shop_point",guild_shop_point - shop_point)
private_notice("Guild ")
elseif id == 5 and guild_shop_point >= shop_point then
insert_item(498857444,count)
set_global_variable("guild_"..guild_id.."_"..charackter_name.."_shop_point",guild_shop_point - shop_point)
private_notice("Guild ")
elseif id == 6 and guild_shop_point >= shop_point then
insert_item(498857443,count)
set_global_variable("guild_"..guild_id.."_"..charackter_name.."_shop_point",guild_shop_point - shop_point)
private_notice("Guild ")
elseif id == 7 and guild_shop_point >= shop_point then
insert_item(498857442,count)
set_global_variable("guild_"..guild_id.."_"..charackter_name.."_shop_point",guild_shop_point - shop_point)
private_notice("Guild ")
elseif id == 8 and guild_shop_point >= shop_point then
insert_item(498857441,count)
set_global_variable("guild_"..guild_id.."_"..charackter_name.."_shop_point",guild_shop_point - shop_point)
private_notice("Guild ")
end
end