Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[Problem]Pet System


Rekomendowane odpowiedzi

Opublikowano

Wgrywam pety z tego tematu

http://www.mpcforum.pl/topic/781824-dl-pets-system-final/

wszystko all dodaje no i syser wali taki błąd

SYSERR: Jan 7 15:52:23 :: RunState: LUA_ERROR: locale/poland/quest/questlib.lua:2555: attempt to index global `pet' (a nil value)
SYSERR: Jan 7 15:52:23 :: WriteRunningStateToSyserr: LUA_ERROR: quest horse_summon.start click

folder io/pet wgrałem do locale/poland/quest/object a nawet do locale/poland/quest oto urywek questlib

QuestFolder = get_locale_base_path().."/quest/"

-- Classe
PetSystem = {['Folder'] = QuestFolder.."io/pet/", ['ItemExp'] = 4000000, ['UpdateFrequency'] = 30, ['Flag'] = "active_pet", ['ExpFlag'] = "exp_blocked"}
-- Pet 1
PetSystem[1] = 
           {['Name'] = "Phoenix de Feu", ['Level'] = 22, ['Item'] = 53001, ['MaxLevel'] = 99, ['WindowSize'] = 395,
            ['Skill']= {
                       {['type']=apply.MAX_HP,['name']="Sang Vital",['max_points']=20,['min_level']=1,['desc']="+100HP",['mult']=100,['tag']=" HP"},
                       {['type']=apply.INT,['name']="Lumičre Divine",['max_points']=10,['min_level']=1,['desc']="+1 INT",['mult']=1,['tag']=" MP"},
                       {['type']=apply.STR,['name']="Force Celeste",['max_points']=10,['min_level']=1,['desc']="+1 STR",['mult']=1,['tag']=" Force"},
                       {['type']=apply.DEX,['name']="Ruse",['max_points']=10,['min_level']=1,['desc']="+1 DEX",['mult']=1,['tag']=" Esquive"},                        
                       {['type']=apply.PENETRATE_PCT,['name']="Precision Fatal",['max_points']=15,['min_level']=60,['desc']="+1% percing hits",['mult']=1,['tag']="% Percing"},
                       {['type']=apply.CRITICAL_PCT,['name']="Precision Mortel",['max_points']=15,['min_level']=80,['desc']="+1% coup critiques",['mult']=1,['tag']="% Critique"},
                       {['type']=apply.ATTBONUS_MONSTER,['name']="Frénésie",['max_points']=10,['min_level']=100,['desc']="+1% anti monstre",['mult']=1,['tag']="% Anti monstre"},
                       {['type']=apply.MOV_SPEED,['name']="Rapidité'",['max_points']=10,['min_level']=100,['desc']="+1% vit. de dplt",['mult']=1,['tag']="% Vit. de dplt"}
                       },
            ['ExpTable'] = {300,600,900,1200,1500,1800,2100,2400,2700,3000,        -- Liv 1-10
                            3300,3600,3900,4200,4500,4800,5100,5400,5700,6000,        -- Liv 11-20
                            6300,6600,6900,7200,7500,7800,8100,8400,8700,9000,        -- Liv 21-30
                            9300,9600,9900,10200,10500,10800,11100,11400,11700,12000,        -- Liv 31-40
                            12300,12600,12900,13200,13500,13800,14100,14400,14700,15000,        -- Liv 41-50
                            15300,15600,15900,16200,16500,16800,17100,17400,17700,18000,        -- Liv 51-60
                            18300,18600,18900,19200,19500,19800,20100,20400,20700,21000,        -- Liv 61-70
                            21300,21600,21900,22200,22500,22800,23100,23400,23700,24000,        -- Liv 71-80
                            24300,24600,24900,25200,25500,25800,26100,26400,26700,27000,        -- Liv 81-90
                            27300,27600,27900,28200,28500,28800,29100,29400,29700,30000,        -- Liv 91-100
                            30300,30600,30900,31200,31500,31800,32100,32400,32700,0            -- Liv 101-110
                           }
           }
-- Pet 2
PetSystem[2] = 
           {['Name'] = "Phoenix de Glace", ['Level'] = 23, ['Item'] = 53002, ['MaxLevel'] = 99, ['WindowSize'] = 395,
            ['Skill']= {
                       {['type']=apply.MAX_HP,['name']="Sang Vital",['max_points']=30,['min_level']=1,['desc']="+100HP",['mult']=100,['tag']=" HP"},
                       {['type']=apply.INT,['name']="Lumičre Divine",['max_points']=15,['min_level']=1,['desc']="+1 INT",['mult']=1,['tag']=" MP"},
                       {['type']=apply.STR,['name']="Force Celeste",['max_points']=15,['min_level']=1,['desc']="+1 STR",['mult']=1,['tag']=" Force"},
                       {['type']=apply.DEX,['name']="Ruse",['max_points']=15,['min_level']=1,['desc']="+1 DEX",['mult']=1,['tag']=" Esquive"},
                       {['type']=apply.PENETRATE_PCT,['name']="Precision Fatal",['max_points']=15,['min_level']=30,['desc']="+1% percing hits",['mult']=1,['tag']="% Percing"},
                       {['type']=apply.CRITICAL_PCT,['name']="Precision Mortel",['max_points']=15,['min_level']=60,['desc']="+1% coup critiques",['mult']=1,['tag']="% Critique"},
                       {['type']=apply.ATTBONUS_MONSTER,['name']="Frénésie",['max_points']=10,['min_level']=90,['desc']="+1% anti monstre",['mult']=1,['tag']="% Anti monstre"}
                       },
            ['ExpTable'] = {300,600,900,1200,1500,1800,2100,2400,2700,3000,        -- Liv 1-10
                            3300,3600,3900,4200,4500,4800,5100,5400,5700,6000,        -- Liv 11-20
                            6300,6600,6900,7200,7500,7800,8100,8400,8700,9000,        -- Liv 21-30
                            9300,9600,9900,10200,10500,10800,11100,11400,11700,12000,        -- Liv 31-40
                            12300,12600,12900,13200,13500,13800,14100,14400,14700,15000,        -- Liv 41-50
                            15300,15600,15900,16200,16500,16800,17100,17400,17700,18000,        -- Liv 51-60
                            18300,18600,18900,19200,19500,19800,20100,20400,20700,21000,        -- Liv 61-70
                            21300,21600,21900,22200,22500,22800,23100,23400,23700,24000,        -- Liv 71-80
                            24300,24600,24900,25200,25500,25800,26100,26400,26700,27000,        -- Liv 81-90
                            27300,27600,27900,28200,28500,28800,29100,29400,29700,30000,        -- Liv 91-100
                            30300,30600,30900,31200,31500,31800,32100,32400,32700,0            -- Liv 101-110
                           }
           }    
-- Pet 3
PetSystem[3] = 
           {['Name'] = "Bébé Renne", ['Level'] = 24, ['Item'] = 53003, ['MaxLevel'] = 99, ['WindowSize'] = 395,
            ['Skill']= {
                       {['type']=apply.MAX_HP,['name']="Sang Vital",['max_points']=20,['min_level']=1,['desc']="+100HP",['mult']=100,['tag']=" HP"},
                       {['type']=apply.INT,['name']="Lumičre Divine",['max_points']=10,['min_level']=1,['desc']="+1 INT",['mult']=1,['tag']=" MP"},
                       {['type']=apply.STR,['name']="Force Celeste",['max_points']=10,['min_level']=1,['desc']="+1 STR",['mult']=1,['tag']=" Force"},
                       {['type']=apply.DEX,['name']="Ruse",['max_points']=10,['min_level']=1,['desc']="+1 DEX",['mult']=1,['tag']=" Esquive"},
                       {['type']=apply.STEAL_HP,['name']="Absorption",['max_points']=10,['min_level']=30,['min_level']=30,['desc']="+1% ass. HP",['mult']=1,['tag']="% Absorption HP"},
                       {['type']=apply.PENETRATE_PCT,['name']="Precision Fatal",['max_points']=10,['min_level']=30,['desc']="+1% percing hits",['mult']=1,['tag']="% Percing"},
                       {['type']=apply.CRITICAL_PCT,['name']="Precision Mortel",['max_points']=10,['min_level']=60,['desc']="+1% coup critiques",['mult']=1,['tag']="% Critique"},
                       {['type']=apply.ATTBONUS_MONSTER,['name']="Frénésie",['max_points']=10,['min_level']=60,['desc']="+1% anti monstre",['mult']=1,['tag']="% Anti monstre"}
                       },
            ['ExpTable'] = {300,600,900,1200,1500,1800,2100,2400,2700,3000,        -- Liv 1-10
                            3300,3600,3900,4200,4500,4800,5100,5400,5700,6000,        -- Liv 11-20
                            6300,6600,6900,7200,7500,7800,8100,8400,8700,9000,        -- Liv 21-30
                            9300,9600,9900,10200,10500,10800,11100,11400,11700,12000,        -- Liv 31-40
                            12300,12600,12900,13200,13500,13800,14100,14400,14700,15000,        -- Liv 41-50
                            15300,15600,15900,16200,16500,16800,17100,17400,17700,18000,        -- Liv 51-60
                            18300,18600,18900,19200,19500,19800,20100,20400,20700,21000,        -- Liv 61-70
                            21300,21600,21900,22200,22500,22800,23100,23400,23700,24000,        -- Liv 71-80
                            24300,24600,24900,25200,25500,25800,26100,26400,26700,27000,        -- Liv 81-90
                            27300,27600,27900,28200,28500,28800,29100,29400,29700,30000,        -- Liv 91-100
                            30300,30600,30900,31200,31500,31800,32100,32400,32700,0            -- Liv 101-110
                           }
           }
-- Pet 4
PetSystem[4] = 
           {['Name'] = "Bébé Azrael", ['Level'] = 25, ['Item'] = 53004, ['MaxLevel'] = 99, ['WindowSize'] = 395,
            ['Skill']= {
                       {['type']=apply.MAX_HP,['name']="Sang Vital",['max_points']=30,['desc']="+100HP",['mult']=100,['tag']=" HP"},
                       {['type']=apply.RESBONUS_WARRIOR,['name']="Res. Guerrier",['max_points']=10,['desc']="+1% res. guerrier",['mult']=1,['tag']="% Res. Guerrier"},
                       {['type']=apply.RESBONUS_ASSASSIN,['name']="Res. Ninja",['max_points']=10,['desc']="+1% res. ninja",['mult']=1,['tag']="% Res. Ninja"},
                       {['type']=apply.RESBONUS_SURA,['name']="Res. Sura",['max_points']=10,['desc']="+1% res. sura",['mult']=1,['tag']="% Res. Sura"},
                       {['type']=apply.RESBONUS_SHAMAN,['name']="Res. Shaman",['max_points']=10,['desc']="+1% res. shaman",['mult']=1,['tag']="% Res. Shaman"},
                       {['type']=apply.CAST_SPEED,['name']="Frénésie Magic",['max_points']=15,['desc']="+1% vit. magique",['mult']=1,['tag']="% Vit. Magique"},
                       {['type']=apply.ATTBONUS_HUMAN,['name']="Frénésie Mortale",['max_points']=10,['desc']="+1% DH",['mult']=1,['tag']="% DH"}        
                       },
            ['ExpTable'] = {300,600,900,1200,1500,1800,2100,2400,2700,3000,        -- Liv 1-10
                            3300,3600,3900,4200,4500,4800,5100,5400,5700,6000,        -- Liv 11-20
                            6300,6600,6900,7200,7500,7800,8100,8400,8700,9000,        -- Liv 21-30
                            9300,9600,9900,10200,10500,10800,11100,11400,11700,12000,        -- Liv 31-40
                            12300,12600,12900,13200,13500,13800,14100,14400,14700,15000,        -- Liv 41-50
                            15300,15600,15900,16200,16500,16800,17100,17400,17700,18000,        -- Liv 51-60
                            18300,18600,18900,19200,19500,19800,20100,20400,20700,21000,        -- Liv 61-70
                            21300,21600,21900,22200,22500,22800,23100,23400,23700,24000,        -- Liv 71-80
                            24300,24600,24900,25200,25500,25800,26100,26400,26700,27000,        -- Liv 81-90
                            27300,27600,27900,28200,28500,28800,29100,29400,29700,30000,        -- Liv 91-100
                            30300,30600,30900,31200,31500,31800,32100,32400,32700,0            -- Liv 101-110
                           }
           }
-- Pet 5
PetSystem[5] = 
           {['Name'] = "Bébé Sanglier", ['Level'] = 26, ['Item'] = 53005, ['MaxLevel'] = 99, ['WindowSize'] = 395,
            ['Skill']= {
                       {['type']=apply.MAX_HP,['name']="Sang Vital",['max_points']=30,['min_level']=1,['desc']="+100HP",['mult']=100,['tag']=" HP"},
                       {['type']=apply.RESBONUS_WARRIOR,['name']="Res. Guerrier",['max_points']=15,['min_level']=20,['desc']="+1% res. guerrier",['mult']=1,['tag']="% res. Guerrier"},
                       {['type']=apply.ATTBONUS_WARRIOR,['name']="Att. Guerrier",['max_points']=15,['min_level']=20,['desc']="+1 att. contre guerrier",['mult']=1,['tag']="% att. contre Guerrier"},
                       {['type']=apply.CAST_SPEED,['name']="Frénésie Magic",['max_points']=20,['min_level']=40,['desc']="+1% vit. magique",['mult']=1,['tag']="% Vit. magique"},
                       {['type']=apply.ATTBONUS_HUMAN,['name']="Frénésie Mortale",['max_points']=10,['min_level']=60,['desc']="+1% DH",['mult']=1,['tag']="% DH"}
                       },
            ['ExpTable'] = {300,600,900,1200,1500,1800,2100,2400,2700,3000,        -- Liv 1-10
                            3300,3600,3900,4200,4500,4800,5100,5400,5700,6000,        -- Liv 11-20
                            6300,6600,6900,7200,7500,7800,8100,8400,8700,9000,        -- Liv 21-30
                            9300,9600,9900,10200,10500,10800,11100,11400,11700,12000,        -- Liv 31-40
                            12300,12600,12900,13200,13500,13800,14100,14400,14700,15000,        -- Liv 41-50
                            15300,15600,15900,16200,16500,16800,17100,17400,17700,18000,        -- Liv 51-60
                            18300,18600,18900,19200,19500,19800,20100,20400,20700,21000,        -- Liv 61-70
                            21300,21600,21900,22200,22500,22800,23100,23400,23700,24000,        -- Liv 71-80
                            24300,24600,24900,25200,25500,25800,26100,26400,26700,27000,        -- Liv 81-90
                            27300,27600,27900,28200,28500,28800,29100,29400,29700,30000,        -- Liv 91-100
                            30300,30600,30900,31200,31500,31800,32100,32400,32700,0            -- Liv 101-110
                           }
           }
-- Pet 6
PetSystem[6] = 
           {['Name'] = "Bébé Chien", ['Level'] = 27, ['Item'] = 53006, ['MaxLevel'] = 99, ['WindowSize'] = 395,
            ['Skill']= {
                       {['type']=apply.MAX_HP,['name']="Sang Vital",['max_points']=30,['min_level']=1,['desc']="+100HP",['mult']=100,['tag']=" HP"},
                       {['type']=apply.RESBONUS_ASSASSIN,['name']="Res. Ninja",['max_points']=15,['min_level']=20,['desc']="+1% res. ninja",['mult']=1,['tag']="% Res. Ninja"},
                       {['type']=apply.ATTBONUS_ASSASSIN,['name']="Att. Ninja",['max_points']=15,['min_level']=20,['desc']="+1 att. contre ninja",['mult']=1,['tag']="% att. contre Ninja"},
                       {['type']=apply.CAST_SPEED,['name']="Frénésie Magic",['max_points']=20,['min_level']=40,['desc']="+1% vit. magique",['mult']=1,['tag']="% Vit. Magique"},
                       {['type']=apply.ATTBONUS_HUMAN,['name']="Frénésie Mortale",['max_points']=10,['min_level']=60,['desc']="+1% DH",['mult']=1,['tag']="% DH"}
                       },
            ['ExpTable'] = {300,600,900,1200,1500,1800,2100,2400,2700,3000,        -- Liv 1-10
                            3300,3600,3900,4200,4500,4800,5100,5400,5700,6000,        -- Liv 11-20
                            6300,6600,6900,7200,7500,7800,8100,8400,8700,9000,        -- Liv 21-30
                            9300,9600,9900,10200,10500,10800,11100,11400,11700,12000,        -- Liv 31-40
                            12300,12600,12900,13200,13500,13800,14100,14400,14700,15000,        -- Liv 41-50
                            15300,15600,15900,16200,16500,16800,17100,17400,17700,18000,        -- Liv 51-60
                            18300,18600,18900,19200,19500,19800,20100,20400,20700,21000,        -- Liv 61-70
                            21300,21600,21900,22200,22500,22800,23100,23400,23700,24000,        -- Liv 71-80
                            24300,24600,24900,25200,25500,25800,26100,26400,26700,27000,        -- Liv 81-90
                            27300,27600,27900,28200,28500,28800,29100,29400,29700,30000,        -- Liv 91-100
                            30300,30600,30900,31200,31500,31800,32100,32400,32700,0            -- Liv 101-110
                           }
           }
-- Pet 7
PetSystem[7] = 
           {['Name'] = "Bébé Tigre", ['Level'] = 28, ['Item'] = 53007, ['MaxLevel'] = 99, ['WindowSize'] = 395,
            ['Skill']= {
                       {['type']=apply.MAX_HP,['name']="Sang Vital",['max_points']=30,['min_level']=1,['desc']="+100HP",['mult']=100,['tag']=" HP"},
                       {['type']=apply.RESBONUS_SURA,['name']="Res. Sura",['max_points']=15,['min_level']=20,['desc']="+1% res. sura",['mult']=1,['tag']="% Res. Sura"},
                       {['type']=apply.ATTBONUS_SURA,['name']="Att. Sura",['max_points']=15,['min_level']=20,['desc']="+1 att. contre sura",['mult']=1,['tag']="% att. contre Sura"},
                       {['type']=apply.CAST_SPEED,['name']="Frénésie Magic",['max_points']=20,['min_level']=40,['desc']="+1% vit. magique",['mult']=1,['tag']="% Vit. Magique"},
                       {['type']=apply.ATTBONUS_HUMAN,['name']="Frénésie Mortale",['max_points']=10,['min_level']=60,['desc']="+1% DH",['mult']=1,['tag']="% DH"}
                       },
            ['ExpTable'] = {300,600,900,1200,1500,1800,2100,2400,2700,3000,        -- Liv 1-10
                            3300,3600,3900,4200,4500,4800,5100,5400,5700,6000,        -- Liv 11-20
                            6300,6600,6900,7200,7500,7800,8100,8400,8700,9000,        -- Liv 21-30
                            9300,9600,9900,10200,10500,10800,11100,11400,11700,12000,        -- Liv 31-40
                            12300,12600,12900,13200,13500,13800,14100,14400,14700,15000,        -- Liv 41-50
                            15300,15600,15900,16200,16500,16800,17100,17400,17700,18000,        -- Liv 51-60
                            18300,18600,18900,19200,19500,19800,20100,20400,20700,21000,        -- Liv 61-70
                            21300,21600,21900,22200,22500,22800,23100,23400,23700,24000,        -- Liv 71-80
                            24300,24600,24900,25200,25500,25800,26100,26400,26700,27000,        -- Liv 81-90
                            27300,27600,27900,28200,28500,28800,29100,29400,29700,30000,        -- Liv 91-100
                            30300,30600,30900,31200,31500,31800,32100,32400,32700,0            -- Liv 101-110
                           }
           }
-- Pet 8
PetSystem[8] = 
           {['Name'] = "Bébé Lion", ['Level'] = 29, ['Item'] = 53008, ['MaxLevel'] = 99, ['WindowSize'] = 395,
            ['Skill']= {
                       {['type']=apply.MAX_HP,['name']="Sang Vital",['max_points']=30,['min_level']=1,['desc']="+100HP",['mult']=100,['tag']=" HP"},
                       {['type']=apply.RESBONUS_SHAMAN,['name']="Res. Shaman",['max_points']=15,['min_level']=20,['desc']="+1% res. shaman",['mult']=1,['tag']="% res. Shaman"},
                       {['type']=apply.ATTBONUS_SHAMAN,['name']="Att. Shaman",['max_points']=15,['min_level']=20,['desc']="+1 att. contre shaman",['mult']=1,['tag']="% att. contre Shaman"},
                       {['type']=apply.CAST_SPEED,['name']="Frénésie Magic",['max_points']=20,['min_level']=40,['desc']="+1% vit. magique",['mult']=1,['tag']="% Vit. Magique"},
                       {['type']=apply.ATTBONUS_HUMAN,['name']="Frénésie Mortale",['max_points']=10,['min_level']=60,['desc']="+1% DH",['mult']=1,['tag']="% DH"}
                       },
            ['ExpTable'] = {300,600,900,1200,1500,1800,2100,2400,2700,3000,        -- Liv 1-10
                            3300,3600,3900,4200,4500,4800,5100,5400,5700,6000,        -- Liv 11-20
                            6300,6600,6900,7200,7500,7800,8100,8400,8700,9000,        -- Liv 21-30
                            9300,9600,9900,10200,10500,10800,11100,11400,11700,12000,        -- Liv 31-40
                            12300,12600,12900,13200,13500,13800,14100,14400,14700,15000,        -- Liv 41-50
                            15300,15600,15900,16200,16500,16800,17100,17400,17700,18000,        -- Liv 51-60
                            18300,18600,18900,19200,19500,19800,20100,20400,20700,21000,        -- Liv 61-70
                            21300,21600,21900,22200,22500,22800,23100,23400,23700,24000,        -- Liv 71-80
                            24300,24600,24900,25200,25500,25800,26100,26400,26700,27000,        -- Liv 81-90
                            27300,27600,27900,28200,28500,28800,29100,29400,29700,30000,        -- Liv 91-100
                            30300,30600,30900,31200,31500,31800,32100,32400,32700,0            -- Liv 101-110
                           }
           }        


--**
--** Menu Pet
--**
function PetSystem.ShowMenu(PetIndex)
   if horse.is_mine() then
       local pet_menu
       if pc.getqf("exp_blocked") == 0 then
           pet_menu = {"Informations","Gestion Habilité'","Bloquer Expérience","Statut Habilité'","Le renvoyer","Rien (Fermer fenętre)"}
       else
           pet_menu = {"Informations","Gestion Habilité'","Débloquer Expérience","Statut Habilité'","Le renvoyer","Rien (Fermer fenętre)"}
       end
       say_title("Familier: "..PetSystem[PetIndex].Name) 
       local skill_points, liv, ex = PetSystem.ReadStatus(PetIndex)
       say_light_yellow("Level: "..liv.." / "..PetSystem[PetIndex].MaxLevel.." - Point Habilité: "..skill_points.."")
       if not PetSystem.IsExpBlocked() then
           say_light_yellow("Expérience: "..ex.." / "..PetSystem[PetIndex].ExpTable[liv].." (Débloquer)")
       else
           say_light_yellow("Expérience: "..ex.." / "..PetSystem[PetIndex].ExpTable[liv].." (Bloquer)")
       end
       say("Sélectionnez une opération:")
       say_size(350, 330)
       local s = select_table(pet_menu)
----------********** Informations ***********----------        
       if s == 1 then
           say_title("Informations")
           say("Le Familier et un petit animal qui accompagne le")
           say("personnage durant son aventure. Son")
           say("comportement et semblable ŕ celle du cheval,")
           say("sauf qu'il ne peut pas ętre montés.")
           say("Une fois appelé, il a une autre fonction que")
           say("d'accompagné le personnage. Il dispose d'un systéme")
           say("de compétences que vous trouverez dans")
           say("le menu 'Gestion Habilité'. Comme vous l'animal")
           say("évolue, il prends de l'expériences avec vous et")
           say("monte des niveaux pour gagner des points de compétence.[ENTER]")
           wait()
           say_title("Informations")
           say("Chaque compétence donnera un bonus, qui")
           say("augmentera ŕ chaque point assigner.")
           say("Le nombre maximum de points attribués varie")
           say("d'une compétence ŕ l'autre. Vous pouvez attribuer")
           say("et supprimer des points comme vous le souhaiterez.[ENTER]")
----------********** Gestion Habilité ***********----------            
       elseif s == 2 then
           say_title("Gestion Habilité du Familier: "..PetSystem[PetIndex].Name.."")
           say_orange("Point Habilité disponibilité: "..skill_points.."")
           say("[ENTER]Sélectionnez une opération:[ENTER]")
           local a = select("Augmenter Habilité'","Diminuer Habilité'","Annuler")
           if a == 3 then 
               return
           ----------********** Augmenter Habilité' ***********----------
           elseif a == 1 then    
               say_title("Augmenter Habilité'")
               if skill_points == 0 then
                   say("Vous n'avez pas de point(s) pour augmenter une compétence.[ENTER]")
                   return
               end
               local skill_value = {}
               local menu_abi = {}
               skill_value = PetSystem.LoadSkill(PetIndex)
               for i = 1, table.getn(PetSystem[PetIndex].Skill) do
                   if liv >= PetSystem[PetIndex].Skill[i].min_level then
                       table.insert(menu_abi, PetSystem[PetIndex].Skill[i].name..": "..skill_value[i].." point")
                   end
               end                
               table.insert(menu_abi, "Annuler")
               if table.getn(menu_abi) == 1 then
                   say("Il n'est pas possible d'augmenter.[ENTER]")
                   return
               end
               say("Séléctionner une compétence ŕ augmenter:")
               say_size(350, PetSystem[PetIndex].WindowSize)            
               local s = select_table(menu_abi)
               if s == table.getn(menu_abi) then
                   return            
               end
               say_title(PetSystem[PetIndex].Skill[s].name)
               say_orange("Points actuels: "..skill_value[s].." [ENTER]")
               if skill_value[s] == PetSystem[PetIndex].Skill[s].max_points then
                   say("La compétence a atteint le niveau maximum.[ENTER]")
                   return
               end
               say_light_blue("A chaque point: "..PetSystem[PetIndex].Skill[s].desc.."")
               say_light_blue("Nombre maximum de points: "..PetSystem[PetIndex].Skill[s].max_points.."[ENTER]")
               local a = select("Augmenter", "Annuler")
               if a == 2 then
                   return
               end
               say_title(PetSystem[PetIndex].Skill[s].name)
               say("De combien de point voulez-vous augmenter la compétence?[ENTER]")
               local points = tonumber(input())
               say_title(PetSystem[PetIndex].Skill[s].name)
               if points == nil or points < 1 then
                   say("Vous avez entré une valeur incorrecte.[ENTER]")
                   return
               elseif points > skill_points then
                   say("Vous n'avez pas assez de points habilité.[ENTER]")
                   return
               elseif (skill_value[s]+points) > PetSystem[PetIndex].Skill[s].max_points then
                   say("Si vous augmentez la compétence de "..points.." point(s),")
                   say("vous dépasserez la valeurs maximum. Ecrivez")
                   say("une valeur plus petite.[ENTER]")
                   return
               end
               skill_value[s] = skill_value[s]+points
               PetSystem.ChangeSkillPoints(PetIndex, -points)
               PetSystem.SaveSkill(PetIndex, skill_value)
               PetSystem.AddBonus(PetIndex)
               say("La compétence a été augmentée.[ENTER]")
           ----------********** Diminuer Habilité' ***********----------
           elseif a == 2 then
               say_title("Diminuer Habilité'")
               local skill_value = {}
               local menu_abi = {}
               skill_value = PetSystem.LoadSkill(PetIndex)
               for i = 1, table.getn(PetSystem[PetIndex].Skill) do
                   if liv >= PetSystem[PetIndex].Skill[i].min_level then
                       table.insert(menu_abi, PetSystem[PetIndex].Skill[i].name..": "..skill_value[i].." points")
                   end
               end
               table.insert(menu_abi, "Annuler")
               if table.getn(menu_abi) == 1 then
                   say("Il n'est pas possible de diminuer.[ENTER]")
                   return
               end                
               say("Selectionner la compétence ŕ diminuer:")
               say_size(350, PetSystem[PetIndex].WindowSize)                
               local s = select_table(menu_abi)
               if s == table.getn(menu_abi) then
                   return            
               end        
               say_title(PetSystem[PetIndex].Skill[s].name)
               say_orange("Point Habilité actuels: "..skill_value[s].."")
               if skill_value[s] == 0 then
                   say("Vous ne pouvez pas diminuer la compétence.[ENTER]")
                   return
               end
               say("Que faites vous?[ENTER]")
               local b = select("Soustraire 1 point","Supprimer tous les points","Annuler")
               if b == 3 then
                   return
               elseif b == 1 then
                   say_title(PetSystem[PetIndex].Skill[s].name)
                   say("Ętes-vous sur de vouloir retirer un point")
                   say("de compétence?[ENTER]")
                   local c = select("Oui","Non")
                   if c == 2 then
                       return
                   end
                   PetSystem.ChangeSkillPoints(PetIndex, 1)
                   skill_value[s] = skill_value[s]-1
                   PetSystem.SaveSkill(PetIndex, skill_value)
                   PetSystem.AddBonus(PetIndex)
                   say_title(PetSystem[PetIndex].Skill[s].name)
                   say("La compétence a été réduit d'un point.[ENTER]")                    
               elseif b == 2 then
                   say_title(PetSystem[PetIndex].Skill[s].name)
                   say("Ętes-vous sűr de vouloir effacer cette compétence?[ENTER]")
                   local c = select("Oui","Non")
                   if c == 2 then
                       return
                   end
                   PetSystem.ChangeSkillPoints(PetIndex, skill_value[s])
                   skill_value[s] = 0
                   PetSystem.SaveSkill(PetIndex, skill_value)
                   PetSystem.AddBonus(PetIndex)
                   say_title(PetSystem[PetIndex].Skill[s].name)
                   say("La compétence a été remis ŕ zéro.[ENTER]")                    
               end
           end    
----------********** Bloquer/Débloquer Expérience ***********----------
       elseif s == 3 then
           if not PetSystem.IsExpBlocked() then
               say_title("Bloquer Expérience")
               say("Bloquer l'expérience signifie qu'il vous sera ")
               say("impossible de monté ces levels et ces compétences.[ENTER]")
               local a = select("Bloquer","Annuler")
               if a == 2 then
                   return
               end
               say_title("Bloquer Expérience")
               say("L'Expérience de votre familier est bloquer.[ENTER]")
               PetSystem.BlockExp()
           else
               say_title("Sblocca Expérience")
               say("Voulez-vous bloquez l'expérience de votre animal?[ENTER]")
               local a = select("Oui","Non")
               if a == 2 then
                   return
               end
               say_title("Débloquer Expérience")
               say("L'Expérience de votre animal a été débloquer.[ENTER]")
               PetSystem.UnblockExp()
               pc.setqf("current_exp", pc.get_exp())
           end
----------********** Statut Habilité' Pet ***********----------
       elseif s == 4 then
           local skill_value = {}
           skill_value = PetSystem.LoadSkill(PetIndex)        
           say_title("Statut Habilité' - Pet "..PetSystem[PetIndex].Name.."")
           say_light_blue("Santé: "..horse.get_health_pct().."%")
           say("")
           for i = 1, table.getn(PetSystem[PetIndex].Skill) do
               if liv >= PetSystem[PetIndex].Skill[i].min_level then
                   local total = skill_value[i]*PetSystem[PetIndex].Skill[i].mult
                   say_light_yellow(PetSystem[PetIndex].Skill[i].name..": level "..skill_value[i]..". Bonus: "..total..PetSystem[PetIndex].Skill[i].tag)
               end
           end
           say("")    
----------********** Le renvoyer Pet ***********----------            
       elseif s == 5 then
           PetSystem.PetBack()                
       elseif s == 6 then
           return
       end
   end
end

--**
--** Le renvoyer le pet
--**
function PetSystem.PetBack()
   cleartimer("give_exp")
   pet.unsummon()    
   PetSystem.RemoveBonus()
   PetSystem.SetInactive()    
   chat("Vous renvoyez votre familier.")
end

--**
--** Carica le abilita' del pet specificato
--**
function PetSystem.LoadSkill(PetIndex)
   local FileName = PetSystem.Folder..pc.get_name().."_"..PetSystem[PetIndex].Name.."_skills"
   local PetSkill = {}
   if io.open(FileName, "r") == nil then
       io.output(FileName)
       for i = 1,table.getn(PetSystem[PetIndex].Skill) do
           io.write("0\n")
           table.insert(PetSkill, 0)
       end
       io.flush()
       io.close()
       return PetSkill
   end
   for line in io.lines(FileName) do
       table.insert(PetSkill, tonumber(line))
   end
   return PetSkill
end

--**
--** Salva le abilita' del pet specificato
--**
function PetSystem.SaveSkill(PetIndex, SkillList)
   local FileName = PetSystem.Folder..pc.get_name().."_"..PetSystem[PetIndex].Name.."_skills"
   io.output(FileName)
   for i,v in ipairs(SkillList) do
       io.write(tostring(v).."\n")
   end
   io.flush()
   io.close()
end

--**
--** Legge lo stato del pet specificato 
--**
function PetSystem.ReadStatus(petIndex)
   local FileName = PetSystem.Folder..pc.get_name().."_"..PetSystem[petIndex].Name.."_stats"
   local skill, liv, ex
   if io.open(FileName, "r") != nil then
       io.input(FileName)
       skill = tonumber(io.read())
       liv = tonumber(io.read())
       ex = tonumber(io.read())
       io.input():close()
   else
       io.output(FileName)
       io.write("0\n1\n0\n")
       io.flush()
       io.close()    
       skill = 0
       liv = 1
       ex = 0
   end
   return skill, liv, ex
end

--**
--** Legge il livello del pet specificato 
--**
function PetSystem.GetLevel(petIndex)
   local FileName = PetSystem.Folder..pc.get_name().."_"..PetSystem[petIndex].Name.."_stats"
   local liv
   if io.open(FileName, "r") != nil then
       io.input(FileName)
       io.read()
       liv = tonumber(io.read())
       io.input():close()
   else
       liv = 1
   end
   return liv
end

--**
--** Modifica i punti abilitŕ del pet specificato
--**
function PetSystem.ChangeSkillPoints(PetIndex, amount)
   local FileName = PetSystem.Folder..pc.get_name().."_"..PetSystem[PetIndex].Name.."_stats"
   local skill, liv, ex
   if io.open(FileName, "r") != nil then
       io.input(FileName)
       skill = tonumber(io.read())
       liv = tonumber(io.read())
       ex = tonumber(io.read())
       skill = skill+amount
       io.input():close()
   else
       skill = amount
   end
   io.output(FileName)
   io.write(tostring(skill).."\n")
   io.write(tostring(liv).."\n")
   io.write(tostring(ex).."\n")
   io.flush()
   io.close()
end

--**
--** Dŕ Expérience al pet specificato
--**
function PetSystem.GiveExp(petIndex, amount)
   local FileName = PetSystem.Folder..pc.get_name().."_"..PetSystem[petIndex].Name.."_stats"
   local skill, liv, ex
   if io.open(FileName, "r") != nil then
       io.input(FileName)
       skill = tonumber(io.read())
       liv = tonumber(io.read())
       ex = tonumber(io.read())
       ex = ex+amount
       io.input():close()
   else
       skill = 0
       liv = 1
       ex = amount
   end
   if liv == PetSystem[petIndex].MaxLevel then
       return false
   end
   if ex > PetSystem[petIndex].ExpTable[liv] then
       ex = ex-PetSystem[petIndex].ExpTable[liv]
       skill = skill+1
       liv = liv+1
       if liv == PetSystem[petIndex].MaxLevel then
           ex = 0
           chat("L'animal a atteint le niveau maximum!")
       else
           chat("L'animal a atteint le niveau "..liv.."!")
       end
       chat("L'animal a gagné 1 point de compétences")
       if PetSystem.NewSkillLearnt(petIndex, liv) then
           send_letter("Une nouvelle compétence a été débloquer!")
       end
   end
   io.output(FileName)
   io.write(tostring(skill).."\n")
   io.write(tostring(liv).."\n")
   io.write(tostring(ex).."\n")
   io.flush()
   io.close()    
   return true
end

--**
--** Aggiunge i bonus del Pet specificato in base ai Point Habilité assegnati
--**
function PetSystem.AddBonus(PetIndex)
   PetSystem.RemoveBonus()
   local SkillList = {}
   SkillList = PetSystem.LoadSkill(PetIndex)
   for i = 1,table.getn(SkillList) do
       affect.add_hair(PetSystem[PetIndex].Skill[i].type, SkillList[i]*PetSystem[PetIndex].Skill[i].mult, 60*60*24*365)
   end
end

--**
--** Rimuove i bonus del Pet
--**
function PetSystem.RemoveBonus()
   affect.remove(520)
end

--**
--** Imposta nome e livello al cavallo
--**
function PetSystem.SetHorseData(level, name)
   horse.set_name(name)
   horse.set_level(level)
end

--**
--** Controlla se il livello del cavallo e' associato a un pet
--**
function PetSystem.IsPetLevel(level)
   for i = 1,PetSystem.GetPetNumber() do
       if level == PetSystem[i].Level then
           return true
       end
   end
   return false
end

--**
--** Controlla se il pet ha imparato una nuova abilitŕ
--**
function PetSystem.NewSkillLearnt(PetIndex, PetLevel)
   for i = 1,table.getn(PetSystem[PetIndex].Skill) do
       if PetLevel == PetSystem[PetIndex].Skill[i].min_level then
           return true
       end
   end
   return false
end

--**
--** Ritorna il numero totale di pet definiti
--**
function PetSystem.GetPetNumber()
   return table.getn(PetSystem)
end

--** Imposta il pet attivo
function PetSystem.SetActivePet(petIndex)
   pc.setqf(PetSystem.Flag, petIndex)
end

--** Ritorna se il pet system č attivo
function PetSystem.IsActive()
   return (pc.getqf(PetSystem.Flag) > 0)
end

--** Disattiva il pet system
function PetSystem.SetInactive()
   pc.setqf(PetSystem.Flag, 0)
end

--** Ritorna il numero del pet attivo
function PetSystem.GetActivePet()
   return pc.getqf(PetSystem.Flag)
end

--** Blocca l'Expérience al pet
function PetSystem.BlockExp()
   pc.setqf(PetSystem.ExpFlag, 1)
end

--** Sblocca l'Expérience al pet
function PetSystem.UnblockExp()
   pc.setqf(PetSystem.ExpFlag, 0)
end

--** Ritorna se l'Expérience del pet č bloccata
function PetSystem.IsExpBlocked()
   return (pc.getqf(PetSystem.ExpFlag) == 1)
end

--**
--** Stampa a colori
--**

function say_light_yellow(str)
   say(color256(255,255,128)..str..color256(196, 196, 196))
end

function say_yellow(str)
   say(color256(255,255,53)..str..color256(196, 196, 196))
end

function say_orange(str)
   say(color256(255,191,24)..str..color256(196, 196, 196))
end

function say_light_blue(str)
   say(color256(130, 192, 255)..str..color256(196, 196, 196))
end

function say_bonus(str)
   say(color256(167, 255, 212)..str..color256(196, 196, 196))

 

linijka 2555 to

    pet.unsummon()    

Pomoze ktos ? poleca + i 5 do profilu jezeli to zacznie dzialac.

Opublikowano

./make było robione po wgraniu horse.summon.quest ???

 

Na pewno wszystko dobrze się dograło ?

Wgrywałem juz z 10 razy odnowa.Make tez robilem puzniej i nic.Wgrało sie all dobrze.No ale to i tak nic niedalo.

 

Opublikowano

Questlib , questfunctions ? zrobiony folder /io/pet ?

dodalem do quest lib, dodałem funkcje do quest functions zrobilem folder /io/pet wgralem horse_summon . no all zrobilem no i dupa.

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...