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

388 lines
9.6 KiB
Lua
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
function on_use_item_by_funzone( ID, p_handle, target, t_handle, target_id, target_creature )
if ID == 2011369 then -- Parcho Respé
reset_my_class(0)
end
if ID == 2902184 then -- Box Event Noel
add_currency("afk", 1 )
end
if ID >= 800001036 and ID <= 800001039 then
delete_item( get_item_handle( ID ), 1 )
local buff = { 44000001 , 44000002 , 44000003 , 44000008 }
index = ID - 800001035
add_state(buff[index], 1, 360000 ) -- buff vitesse
buff_summoned_pets(buff[index], 1, 360000 ) -- buff village
end
if ID == 800001044 then
delete_item( get_item_handle( ID ), 1 )
--800001032 100% parcho Re-ID Event
add_item( 800001032 , 1 )
rdm_one_item(15 , 960021 , 1 ) -- BA 20%
rdm_one_item(50 , -213 , 1 ) -- Carte Pet Vide Unique et + 50%
--1%
rdm_one_item(1 , 800000002 , 1 ) --Box de Gemme Héroïque
rdm_one_item(1 , 800001040 , 1 ) -- emblem coeur copote
rdm_one_item(1 , 800001041 , 1 ) -- emblem NoRageQuit
rdm_one_item(1 , 800001042 , 1 ) -- pet ramasseur
rdm_one_item(1 , 800001043 , 1 ) -- Casque Lego Coeur
end
--Boite en Bois FZ
if ID == 800000000 then
funzone_Box(1)
add_currency("sp", 1 )
local box_name = get_item_name_id( ID )
local use_item = sconv("@251", "#@item_name@#","@" .. tostring(box_name) )
cprint( use_item )
delete_item( get_item_handle( ID ), 1 )
end
if ID == 800000001 then
funzone_Box(2)
add_currency("sp", 1 )
local box_name = get_item_name_id( ID )
local use_item = sconv("@251", "#@item_name@#","@" .. tostring(box_name) )
cprint( use_item )
delete_item( get_item_handle( ID ), 1 )
end
if ID == 800000002 then
funzone_Box(3)
add_currency("sp", 1 )
local box_name = get_item_name_id( ID )
local use_item = sconv("@251", "#@item_name@#","@" .. tostring(box_name) )
cprint( use_item )
delete_item( get_item_handle( ID ), 1 )
end
if ID == 800000003 then
funzone_Box(4)
add_currency("sp", 1 )
local box_name = get_item_name_id( ID )
local use_item = sconv("@251", "#@item_name@#","@" .. tostring(box_name) )
cprint( use_item )
delete_item( get_item_handle( ID ), 1 )
end
if ID == 800000004 then
funzone_Box(5)
add_currency("sp", 1 )
local box_name = get_item_name_id( ID )
local use_item = sconv("@251", "#@item_name@#","@" .. tostring(box_name) )
cprint( use_item )
delete_item( get_item_handle( ID ), 1 )
end
if ID == 800000005 then
funzone_Box(6)
add_currency("sp", 1 )
local box_name = get_item_name_id( ID )
local use_item = sconv("@251", "#@item_name@#","@" .. tostring(box_name) )
cprint( use_item )
delete_item( get_item_handle( ID ), 1 )
end
if ID == 701001 then -- 701001 Morceau de Cube de Force / 1100103 Acier Inoxydable<combination metariel>
if find_item(ID) >= 7 and find_item(1100103) >= 14 then
if rdm(100) <= 65 then
add_item(700112,1) --700112 [VII] Cube de Force
else
cprint('@9716')
end
delete_item( get_item_handle( ID ), 7 )
delete_item( get_item_handle( 1100103 ), 14 )
end
end
if ID == 701002 then -- 701002 Morceau de Cube de Force Amélioré
if find_item(ID) >= 7 and find_item(1100103) >= 28 then
if rdm(100) <= 65 then
add_item(700607,1) -- 700607 [VII] Cube de Force Amélioré<ep7>
else
cprint('@9716')
end
delete_item( get_item_handle( ID ), 7 )
delete_item( get_item_handle( 1100103 ), 28 )
end
end
if ID == 701003 then -- 701003 Morceau de Cube de Force Béni
if find_item(ID) >= 7 and find_item(1100103) >= 56 then
if rdm(100) <= 65 then
add_item(700657,1) -- 700657 [VII] Cube de Force Béni<ep7>
else
cprint('@9716')
end
delete_item( get_item_handle( ID ), 7 )
delete_item( get_item_handle( 1100103 ), 56 )
end
end
if ID == 702001 then -- 702001 Morceau de Cube de Défense
if find_item(ID) >= 7 and find_item(1100103) >= 7 then
if rdm(100) <= 65 then
add_item(700212,1) --700212 [VII] Cube de Défense
else
cprint('@9716')
end
delete_item( get_item_handle( ID ), 7 )
delete_item( get_item_handle( 1100103 ), 7 )
end
end
if ID == 702002 then -- 702002 Morceau de Cube de Défense Amélioré
if find_item(ID) >= 7 and find_item(1100103) >= 14 then
if rdm(100) <= 65 then
add_item(700707,1) --700707 [VII] Cube de Défense Amélioré<ep7>
else
cprint('@9716')
end
delete_item( get_item_handle( ID ), 7 )
delete_item( get_item_handle( 1100103 ), 14 )
end
end
if ID == 702003 then --702003 Morceau de Cube de Défense Béni
if find_item(ID) >= 7 and find_item(1100103) >= 28 then
if rdm(100) <= 65 then
add_item(700757,1) --700757 [VII] Cube de Défense Béni<ep7>
else
cprint('@9716')
end
delete_item( get_item_handle( ID ), 7 )
delete_item( get_item_handle( 1100103 ), 28 )
end
end
end
function funzone_Box(index)
if index == 1 then -- Box FunZone Consommable
--[[ 100% (1-2)
900000 Economiseur d'Energie
920001 Parchemin de Résurrection de Créature
]]--
array = {900000,920001}
if rdm(100) <= 100 then
for i = 1 , rdm(2) do
add_item( array[math.random(1,table.getn(array)) ] , 1 )
end
end
--[[ 10%
910006 Plume de Retour
910007 Plume d'Invocation
910008 Plume d'Union
910022 Plume de Désir ]]--
array = {910006,910007,910008,910022}
if rdm(100) <= 10 then
add_item( array[math.random(1,table.getn(array)) ] , 1 )
end
--[[ 15%
601100231 Bénédiction des Dieux
2902165 Fiole de Bonheur
900017 Potion Miraculeuse Extreme <1-300>
910005 Fiole d'Eau Bénite
2902162 Toast d'Avoine
array = {601100231,900017,910005}
if rdm(100) <= 10 then
add_item( array[math.random(1,table.getn(array)) ] , 1 )
end]]--
rdm_one_item(10 , 601100231 , 1 )
rdm_one_item(10 , 2902165 , 1 )
rdm_one_item(10 , 900017 , 1 )
rdm_one_item(10 , 910005 , 1 )
rdm_one_item(10 , 2902162 , 1 )
--[[ 80% (1-3)
>= 930000 and <= 930005 Pierre de Force Purifiée
>= 950084 and <= 950089 Pierre de Force Purifiée (Supérieure)
>= 910064 and <= 910076 Fragment Altéré de Vitalité 910102
>= 910094 and <= 910107 Fragment Altéré de Vitalité (Supérieur) ]]--
array = {910064,910065,910066,910067,910068,910069,910070,910071,910072,910073,910074,910075,910076,910094,910095,910096,910097,910098,910099,910100,910101,910103,910104,910105,910106,910107,930000,930001,930002,930003,930004,930005,950084,950085,950086,950087,950088,950089}
if rdm(100) <= 80 then
for i = 1 , rdm(3) do
add_item( array[math.random(1,table.getn(array)) ] , 1 )
end
end
--[[ 10%
960021 Bouclier d'Apprivoisement
920004 Change-Nom de Créature
920006 Potion de Re-spécialisation de Créature
920013 Potion de Re-spécialisation de Créature (Appropriation de l'Ame)
920014 Potion de Sélection de Compétence de Créature
array = {960021,920004,920006,920013,920014}
if rdm(100) <= 5 then
add_item( array[math.random(1,table.getn(array)) ] , 1 )
end]]--
rdm_one_item(9 , 960021 , 1 )
rdm_one_item(8 , 920004 , 1 )
rdm_one_item(7 , 920006 , 1 )
rdm_one_item(6 , 920013 , 1 )
rdm_one_item(5 , 920014 , 1 )
--[[ 3%
2011369 Parchemin de Renaissance<_tradable_storrable>
930040 Change-Nom de Personnage
601100284 Cœur d'Homoncule]]--
array = {2011369,930040,601100284}
if rdm(100) <= 1 then
add_item( array[math.random(1,table.getn(array)) ] , 1 )
end
--[[ (fz)
Fun Potion +50% Exp
Fun Potion +100% Exp
Fun Potion +150% Exp
Fun Potion +200% Exp
Fun Potion +300% Exp (Event Only)
Bouclier d'Apprivoisement Fz (100% chance Tame)
2902266 Toast Jaune
2902267 Toast Violet
2902268 Toast Rouge ]]--
end
if index == 2 then -- Box FunZone enchant
--[[ 100%
700112 [VII] Cube de Force
700212 [VII] Cube de Défense
700401 Cube de Compétence
]]--
array = {700112,700212,700401}
if rdm(100) <= 100 then
add_item( array[math.random(1,table.getn(array)) ] , rdm(2) )
end
--[[ 20%
950071 [VII] Élément Ancien ~ Force
950072 [VII] Élément Ancien ~ Défense
950019 Élément Ancien ~ Compétence ]]--
rdm_one_item(30 , 950071 , rdm(3) )
rdm_one_item(30 , 950072 , rdm(3) )
rdm_one_item(30 , 950019 , rdm(3) )
--[[ 40%
705002 Parchemin d'Eveil : Armes
705004 Parchemin d'Eveil : Accessoires
705011 Parchemin d'Eveil Ultime : Armures
950083 Carte de Protection ]]--
rdm_one_item(40 , 705002 , rdm(2) )
rdm_one_item(40 , 705004 , rdm(2) )
rdm_one_item(40 , 705011 , rdm(2) )
rdm_one_item(40 , 950083 , rdm(2) )
--[[ 30%
491003 Kit Complet d'Amélioration de Ceinture
491006 Kit de Riley
710004 Mélangeur d'Âme Spécial ]]--
array = {491003,491006}
if rdm(100) <= 30 then
add_item( array[math.random(1,table.getn(array)) ] , 1 )
end
rdm_one_item(30 , 710004 , 1 )
--[[ (Fz)
Cube Ancien Fz (100% chance)
Cube Bénie Ancien Fz (100% chance)
Amalgame Fz (pas de 2éme stuff)
Carte Protection Fz (100% chance)
Mélangeur ame Fz (100% chance) ]]--
end
if index == 3 then -- Box FunZone Gemme
--[[ 100% 1-2
>= 810301 AND <= 810314 Gemme T1 ]]--
array = {810301,810302,810303,810304,810305,810306,810307,810308,810309,810310,810311,810312,810313,810314}
if rdm(100) <= 100 then
for i = 1 , rdm(2) do
add_item( array[math.random(1,table.getn(array)) ] , 1 )
end
end
end
if index == 4 then -- Box FunZone Eclat
--[[ 100% 1-2
(10-20)
801321 Eclat de Brutalité Ultime : Arme à une main
801323 Eclat de Brutalité Ultime : Arme à deux mains
801322 Eclat de Pouvoir Ultime : Arme à une main
801324 Eclat de Pouvoir Ultime : Arme à deux mains ]]--
array = {801321,801323,801322,801324}
if rdm(100) <= 100 then
add_item( array[math.random(1,table.getn(array)) ] , math.random( 10 , 20 ) )
end
--[[ 10%
801320 Effet visuel d'arme : Pierre Galactique (Expert)
801325 Effet visuel d'arme : Pierre de Rage (Expert)]]--
array = {801320,801325}
if rdm(100) <= 10 then
add_item( array[math.random(1,table.getn(array)) ] , 1 )
end
end
--End function
end
function rdm(x)
return math.random(1,x)
end
function rdm_one_item(chance , id , quantity )
if rdm(100) <= chance then
handle = add_item( id , quantity )
end
if id == 800001043 then
id_noel_2022( id , handle )
end
end