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

363 lines
9.3 KiB
Lua

function buff()
for a = 1 , 3 do
for b = 1 , table.getn(buff_id_state[a]) do
enchant_max = 0
quantity_max10 = 0
enchant_max , quantity_max10 = get_enchant_max_skillcard(buff_id_card[a][b])
if quantity_max10 > 20 then quantity_max10 = 20 end
bonus = (buff_id_enhstate[a][b] * (quantity_max10-1) )
-- Just +10
--bonus = 0
if bonus < 0 then bonus = 0 end
if buff_id_lvstate[a][b] > 1 then
maxskill = 2 + buff_id_lvstate[a][b]
else
maxskill = buff_id_lvstate[a][b]
end
buff_final_lv = math.floor(buff_id_basestate[a][b] + (buff_id_addstate[a][b] * maxskill ) + (buff_id_enhstate[a][b] * enchant_max) + bonus)
--buff_final_lv = math.floor(buff_id_basestate[a][b] + (buff_id_addstate[a][b] * buff_id_lvstate[a][b]) + (buff_id_enhstate[a][b] * enchant_max) + bonus)
--Buff player
if buff_id_state[a][b] ~= 163436 and buff_id_state[a][b] ~= 164408 then
if get_state_level(buff_id_state[a][b]) == 0 or get_state_time(buff_id_state[a][b]) < 8640000 - 6000 then
add_state( buff_id_state[a][b], buff_final_lv, duration_buff)
end
end
--Buff pet
buff_summoned_pets( buff_id_state[a][b], buff_final_lv, duration_buff)
--cprint("Log state = " .. buff_id_state[a][b] .. " / lv = " .. buff_final_lv )
end
--TEMPO BUFF FRAG
--[[
-- Frag alteree Altar frag
add_state(9931, 1, 720000)
add_state(9932, 1, 720000)
add_state(9933, 1, 720000)
add_state(9934, 1, 720000)
add_state(9935, 1, 720000)
add_state(9936, 1, 720000)
add_state(9937, 1, 720000)
add_state(9938, 1, 720000)
add_state(9939, 1, 720000)
add_state(9940, 1, 720000)
add_state(9941, 1, 720000)
add_state(9942, 1, 720000)
add_state(9943, 1, 720000)
-- pierre purifiee -- Purified frag
add_state(9904, 1, 720000)
add_state(9905, 1, 720000)
add_state(9906, 1, 720000)
add_state(9907, 1, 720000)
add_state(9908, 1, 720000)
add_state(9909, 1, 720000)
-- Cristal du Colisee -- Arena frag
add_state(9949, 1, 720000)
add_state(9950, 1, 720000)
add_state(9951, 1, 720000)
add_state(9952, 1, 720000)
add_state(9953, 1, 720000)
add_state(9954, 1, 720000)
--]]
end
--buff village
--[[
add_state( 1007, 7, 900000 )
add_state( 1008, 7, 900000 )
add_state( 1009, 7, 900000 )
add_state( 1010, 7, 900000 )
add_state( 1011, 7, 900000 )
add_state( 1012, 7, 900000 )
add_state( 1013, 7, 900000 )
]]--
add_state( 9968, 7, 8640000 ) --9968 Fragment de Lune Offensif
buff_summoned_pets( 9968, 7, 8640000 ) --9969 Fragment de Lune Défensif
add_state( 9969, 7, 8640000 ) --9968 Fragment de Lune Offensif
buff_summoned_pets( 9969, 7, 8640000 ) --9969 Fragment de Lune Défensif
add_state(1066, 7, 8640000 ) -- buff village
add_state(1510, 150, 8640000 ) -- buff vitesse
buff_summoned_pets(1066, 7, 8640000 ) -- buff village
buff_summoned_pets(1510, 150, 8640000 ) -- buff vitesse
if get_state_level(9947) >= 1 then
buff_summoned_pets(9947,get_state_level(9947),get_state_time(9947) )
end
if get_state_level(9946) >= 1 then
buff_summoned_pets(9946,get_state_level(9946),get_state_time(9946) )
end
if get_state_level(9965) >= 1 then
buff_summoned_pets(9965,get_state_level(9965),get_state_time(9965) )
end
if get_state_level(9966) >= 1 then
buff_summoned_pets(9966,get_state_level(9966),get_state_time(9966) )
end
--Event Buff
-- 44000001 Soucoula bleu (Bienfait : Chant de Bataille)
add_state(44000001, 1, 360000 )
buff_summoned_pets(44000001, 1, 360000 )
--44000002 Soucoula vert (Bienfait : Trefle a Quatre Feuilles)
add_state(44000002, 1, 360000 )
buff_summoned_pets(44000002, 1, 360000 )
--44000003 Soucoula violet (Bienfait : Benediction)
add_state(44000003, 1, 360000 )
buff_summoned_pets(44000003, 1, 360000 )
--44000008 Soucoula rouge 5(Energie Doree)
add_state(44000008, 1, 360000 )
buff_summoned_pets(44000008, 1, 360000 )
end
function fullbuffville()
cast_world_state(314101,1,720000,0)
cast_world_state(145522,2,720000,0)
cast_world_state(41103050,1,720000,0)
cast_world_state(4523,1,360000,0)
cast_world_state(4525,1,360000,0)
cast_world_state(5128,2,720000,0)
announce("FullBuff ville")
end
function buff_player_and_pet(state, lvl , times )
add_state( state, lvl , times )
buff_summoned_pets( state, lvl , times )
end
function get_enchant_max_skillcard(id) -- /run insert_item(502001, 40, 4, 1, 2) ert(502001)
handle_list = get_item_handle_list(id)
local enchant_max = 0
local quantity_max10 = 0
if handle_list ~= 0 then
for i = 1 , table.getn(handle_list) do
handle = handle_list[i]
name = get_item_name(handle)
echant = get_item_enhance(handle)
quantity = get_item_count(handle)
--message( sconv("name +echant quantity","name", name , "echant" , echant , "quantity" , quantity ))
if enchant_max < echant then enchant_max = echant end
if echant == 10 then quantity_max10 = quantity end
end
end
return enchant_max , quantity_max10
end
function buff_summoned_pets(buff_id,blevel,duration)
local creature_handle,handle,summon_state
for i = 0,5 do
handle = get_creature_handle(i)
summon_state = get_creature_value( handle, "summon_state" )
creature_handle = get_creature_value(handle, "handle")
if summon_state == 1 then -- get_state_time(buff_id_state[a][b]) < 8640000 - 6000
if (get_state_level(buff_id , creature_handle) == 0 or get_state_time(buff_id , creature_handle) < 8640000 - 6000 ) then
add_state(buff_id,blevel,duration,creature_handle)
end
end
end
end
function Check_Tchat(name , text )
if name ~= "" or name ~= nil then
notice(tostring(name))
end
if text ~= "" or text ~= nil then
notice(tostring(text))
end
end
function dbuff()
buff = {163440,163406,163404,163407,163405,2505,2507,163433,314016,163436,164408,2506,2508,163429,314017,314049,13424,13423,13425,314018,163448,314099,163449}
for b = 1 , table.getn(buff) do
remove_state(buff[b], get_state_level(buff[b]))
end
remove_state(9931, 1)
remove_state(9932, 1)
remove_state(9933, 1)
remove_state(9934, 1)
remove_state(9935, 1)
remove_state(9936, 1)
remove_state(9937, 1)
remove_state(9938, 1)
remove_state(9939, 1)
remove_state(9940, 1)
remove_state(9941, 1)
remove_state(9942, 1)
remove_state(9943, 1)
-- pierre purifiee -- Purified frag
remove_state(9904, 1)
remove_state(9905, 1)
remove_state(9906, 1)
remove_state(9907, 1)
remove_state(9908, 1)
remove_state(9909, 1)
-- Cristal du Colisee -- Arena frag
remove_state(9949, 1)
remove_state(9950, 1)
remove_state(9951, 1)
remove_state(9952, 1)
remove_state(9953, 1)
remove_state(9954, 1)
-- Potion de Colisee -- Arena Pop
remove_state(4207, 5)
remove_state(4208, 5)
remove_state(4209, 5)
end
duration_buff = 8640000
buff_id_card = {}
buff_id_state = {}
buff_id_basestate = {}
buff_id_addstate = {}
buff_id_enhstate = {}
buff_id_lvstate = {}
buff_id_card[1]={523406,523404,523407,523405,503454,523433,550102,521524,521525}
--Deva Buff
buff_id_state[1] = {163406,163404,163407,163405,2505,163433,314016,163436,164408}
buff_id_basestate[1] = {0,0,0,0,3,30,0,0,20}
buff_id_addstate[1] = {3,3,3,3,0.5,3,10,2,2}
buff_id_enhstate[1] = {2.5,2.5,2.5,2.5,0.5,5,5,1,1}
buff_id_lvstate[1] = {16,16,16,16,20,20,7,6,5}
--Id name state state_level_base state_level_per_skl state_level_per_enhance
--63406 Bénédiction de Sagesse 163406 0 3 2,5 lv=16
--63404 Bénédiction de Vitalité 163404 0 3 2,5 lv=16
--63407 Bénédiction de Force 163407 0 3 2,5 lv=16
--63405 Bénédiction d'Intelligence 163405 0 3 2,5 lv=16
--3454 Arme Etincelante 2505 0 8 9 lv=20
--3454 Arme Etincelante2 2507 3 0.5 0.5 lv=20
--63433 Armure Scintillante 163433 30 3 5 lv=20
--50102 Adresse Divine 314016 0 10 5 lv=7
--Pet buff
--21524 Maîtrise de Résistance 163436 0 2 1 lv=6
--21525 Maîtrise de Bénédiction 164408 20 2 1 lv=5
--SQL
-- = 63406 OR = 63404 OR = 63407 OR = 63405 OR = 3454 OR = 63433 OR = 50102 OR = 21524 OR = 21525
--Asura Buff
buff_id_card[2] = {503412,503412,523429,550201,531423}
buff_id_state[2] = {2506,2508,163429,314017,314049}
buff_id_basestate[2] = {1,1,0,0,110+(3*10)}
buff_id_addstate[2] = {2,2,1,10,0}
buff_id_enhstate[2] = {2,2,0.5,20,7.5}
buff_id_lvstate[2] = {20,20,10,7,1}
--3412 Force des Ténèbres 2506 1 2 2 lv=20
--3412 Force des Ténèbres2 2508 1 2 2 lv=20
--63429 Arme de Vent 163429 0 1 0,5 lv=10
--50201 Vivacité Sinistre 314017 0 10 20 lv=7
--31423+31424 Pénétration Mentale(TP) 314049 110+(3*10) 0 7,5 lv=1
--SQL
-- = 3412 OR = 3412 OR = 63429 OR = 50201 OR = 31423 OR = 31424
--Gaia
buff_id_card[3] = {503424,503423,503425,550301,541320,541521,541419,541211}
buff_id_state[3] = {13424,13423,13425,314018,163448,314099,163449,163440}
buff_id_basestate[3] = {5,1,5,0,0,75+(7*3),0,96}
buff_id_addstate[3] = {17,1,17,10,30+(3*3),0,30+(3*3),0}
buff_id_enhstate[3] = {13,2,13,5,2,5,2,3}
buff_id_lvstate[3] = {16,16,16,7,1,1,1,1}
--3424 Energie de la Pierre 13424 5 17 13 lv=16
--3423 Vitesse du Vent 13423 20 1 2 lv=16
--3425 Force du Feu Sacré 13425 5 17 13 lv=16
--50301 Instinct Naturel 314018 0 10 5 lv=7
--41320 Force des Eléments(TP) 163448 0 30+(3*3) 2 lv=1
--41521+41522 Chance Naturelle(TP) 314099 75+(7*3) 0 5 lv=1
--41419+41420 Bienfait du Kahuna(TP) 163449 0 30+(3*3) 2 lv=1
--541211 Carte - Bénédiction de l'Archer<Master Archer(version:7.3)>
--41211 Bénédiction de l'Archer 163440 96 0 3 lv=1
--SQL 1800,00
-- = 3424 OR = 3423 OR = 3425 OR = 50301 OR = 41320 OR = 41521 or 41419 or 541211 or 41211
function test1()
cprint("hello " .. gv("name") .. " Bienvenu sur New world")
end