Jump to content
  • Announcements

    • Xmat

      Pravidlo pro postování v TTT

      Do sekce Tipy, triky, tutoriály nepatří žádné dotazy.   Postujte sem vaše návody, tipy a různé další věci jež uznáte za vhodné sdělit zdejšímu osazenstvu, ale veškeré dotazy směřujte do sekce Všeobecná diskuse.
    • Replik

      Seznam návodů a důležitých témat v této sekci

      Pro lepší přehlednost jsem vytvořil tento seznam, který vás, méně zkušené, lépe provede touto sekcí. Věřím, že zde najdete, co hledáte. Vypsané jsou návody, které jsou oficiálně uznané jako návody. Běžné diskuze, které neposkytují postupy a rady zvěřejněny nejsou.   Instalace vlastního MaNGOS Serveru Díky těmto návodům budete (měli by jste být) schopni vytvořit a následně spustit váš vlastní server. Nastavení je pro verze s i bez datadisku.   Instalace MaNGOS Serveru (bez datadisku TBC) - Autor Benny Instalace MaNGOS Serveru (s datadiskem TBC) - Autor Malfik Instalace MaNGOS Serveru v prostředí Linux - Autor charlie Instalace MaNGOS Serveru v prostředí Linux - Autor kupkoid   Chyby a jejich řešení při přihlašování k serveru - Autor Cybe   Zálohování uživatelských dat   Dávkový soubor (BAT soubor) pro vytvoření SQL záloh - Autor Replik   Kompilování - tvoření vlastních release (revizí)   Tvorba kompilací pro Win32 (MangoScript) - Autor bLuma   Ostatní - těžko zařaditelné, ale neznamená to, že nejsou dobré   VIP Systém - Autor charlie Tvorba Webových stránek pro MaNGOS - Autor zahuba Tvorba teleportačních NPC (MangoScript) - Autor Replik Registrační web (původně předělaná SPORA) Funkční pro Antrix i MaNGOS - Autor Replik Nastavení a spuštění Minimanager pro MaNGOS - Autor BlackMartin Nastavení MaNGOS Website - Autor Artorius   Samozřejmě jsou zde i jiné návody, ale tyto jsou nejvíce používané, proto věřím, že vám budou nápomocné. Tuto sekci budeme upravovat podle potřeby. Pokud by jste něco nenašli nebo si nevěděli rady, hledejte na fóru a teprve potom založte vlastní topik. Pokud nějaký autor vytvoří kvalitní návod a chtěl by ho zveřejnit i v tomto seznamu, doporučuji, aby mi napsal zprávu skrze PM.   Díky a přeji hezký den na WoWResource   Replik
    • Aristo

      Příspěvky tam, kde nemají co dělat

      Dodržujte zákaz přispívání do topiků s repaky pokud si to zakladatelé nepřejí!! Opakované psaní příspěvků bude trestáno warnem.
    • Aristo

      Používání spoilerů

      Poslední dobou má většina uživatelů fora zvláštní nutkání postovat extrémně dlouhé texty nebo kódy, které zabírají v nejedenom případu i 80% obsahu celé stránky a hodně tak zvedají nepřehlednost v topiku. Chtěl bych všechny uživatele požádat, aby při postování citací, jakýchkoliv kódů, errorů, atp... delších než 30 řádků používali funkci spoileru.   Funkci vyvoláte příkazem [spoiler] text [/spoiler]   Ukázka:  
Sign in to follow this  
charlie

[Patch] Uceni warlock minonu skillu

Recommended Posts

* Jakou chybu patch opravuje? Jakou vlastnost patch přidává?

 

Od jakehosi patche (3.0.2 ?) byly zrusene grimorie.. (knizky z kterych se peti uci skilly) a toto uceni bylo nahrazeno automatickym ucenim dle levelu.. todle vsak na mangosu nefunguje.. teda alespon bez tohoto patche.

 

* Pro jakou revizi byl patch vytvořen?

7272

 

* Kdo napsal tento patch? Název uživatele na fóru nebo emailovou adresu.

Charlie

 

git pull git://github.com/charlie2025/mangos.git warlock

Share this post


Link to post
Share on other sites

Charlie pěkně, jen si podotknu že jsou to minioni a ne minoni, akorát Tě nechápu, řekneš že odcházíš, čtvrt rok utu nejsi, pak přijdeš řekneš že nechceš mod práva, a seš tu ted zase jeden z nejaktivnějších :)

Share this post


Link to post
Share on other sites
diff --git a/sql/warlock_pet_spells.sql b/sql/warlock_pet_spells.sql
new file mode 100644
index 0000000..208f609
--- /dev/null
+++ b/sql/warlock_pet_spells.sql
@@ -0,0 +1,121 @@
+-- Warlock Pet Spells FIX
+DROP TABLE IF EXISTS `pet_level_spell`;
+CREATE TABLE `pet_level_spell` (
+  `pet_family` int(11) unsigned NOT NULL default '0' COMMENT 'Pet Family',
+  `level` int(11) unsigned NOT NULL default '0' COMMENT 'Required Spell Level',
+  `spellid` int(11) unsigned NOT NULL default '0' COMMENT 'Spell Identifier',
+  PRIMARY KEY  (`pet_family`,`spellid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Player System';
+
+
+DELETE FROM `pet_level_spell`;
+-- Imp
+INSERT INTO `pet_level_spell` VALUES ('23','1','3110');    -- Firebolt Rank 1
+INSERT INTO `pet_level_spell` VALUES ('23','4','6307');    -- Blood Pact Rank 1
+INSERT INTO `pet_level_spell` VALUES ('23','8','7799');    -- Firebolt Rank 2
+INSERT INTO `pet_level_spell` VALUES ('23','12','4511');   -- Phase Shift
+INSERT INTO `pet_level_spell` VALUES ('23','14','7804');   -- Blood Pact Rank 2
+INSERT INTO `pet_level_spell` VALUES ('23','14','2947');   -- Fire Shield Rank 1
+INSERT INTO `pet_level_spell` VALUES ('23','18','7800');   -- Firebolt Rank 3
+INSERT INTO `pet_level_spell` VALUES ('23','24','8316');   -- Fire Shield Rank 2
+INSERT INTO `pet_level_spell` VALUES ('23','26','7805');   -- Blood Pact Rank 3
+INSERT INTO `pet_level_spell` VALUES ('23','28','7801');   -- Firebolt Rank 4
+INSERT INTO `pet_level_spell` VALUES ('23','34','8317');   -- Fire Shield Rank 5
+INSERT INTO `pet_level_spell` VALUES ('23','38','11766');  -- Blood Pact Rank 4
+INSERT INTO `pet_level_spell` VALUES ('23','38','7802');   -- Firebolt Rank 5
+INSERT INTO `pet_level_spell` VALUES ('23','44','11770');  
+INSERT INTO `pet_level_spell` VALUES ('23','48','11762');
+INSERT INTO `pet_level_spell` VALUES ('23','50','11767');
+INSERT INTO `pet_level_spell` VALUES ('23','54','11771');
+INSERT INTO `pet_level_spell` VALUES ('23','58','11763');
+INSERT INTO `pet_level_spell` VALUES ('23','62','27268');
+INSERT INTO `pet_level_spell` VALUES ('23','64','27269');
+INSERT INTO `pet_level_spell` VALUES ('23','68','27267');
+INSERT INTO `pet_level_spell` VALUES ('23','74','47982');
+INSERT INTO `pet_level_spell` VALUES ('23','76','47983');
+INSERT INTO `pet_level_spell` VALUES ('23','78','47964');
+-- Voidwalker
+INSERT INTO `pet_level_spell` VALUES ('16','10','3716');
+INSERT INTO `pet_level_spell` VALUES ('16','16','7812');
+INSERT INTO `pet_level_spell` VALUES ('16','18','17767');
+INSERT INTO `pet_level_spell` VALUES ('16','20','7809');
+INSERT INTO `pet_level_spell` VALUES ('16','24','19438');
+INSERT INTO `pet_level_spell` VALUES ('16','24','17735');
+INSERT INTO `pet_level_spell` VALUES ('16','26','17850');
+INSERT INTO `pet_level_spell` VALUES ('16','30','7810');
+INSERT INTO `pet_level_spell` VALUES ('16','32','19440');
+INSERT INTO `pet_level_spell` VALUES ('16','34','17851');
+INSERT INTO `pet_level_spell` VALUES ('16','36','17750');
+INSERT INTO `pet_level_spell` VALUES ('16','40','19441');
+INSERT INTO `pet_level_spell` VALUES ('16','40','7811');
+INSERT INTO `pet_level_spell` VALUES ('16','42','17852');
+INSERT INTO `pet_level_spell` VALUES ('16','48','19442');
+INSERT INTO `pet_level_spell` VALUES ('16','48','17751');
+INSERT INTO `pet_level_spell` VALUES ('16','50','17853');
+INSERT INTO `pet_level_spell` VALUES ('16','50','11774');
+INSERT INTO `pet_level_spell` VALUES ('16','56','19443');
+INSERT INTO `pet_level_spell` VALUES ('16','58','17854');
+INSERT INTO `pet_level_spell` VALUES ('16','60','17752');
+INSERT INTO `pet_level_spell` VALUES ('16','60','11775');
+INSERT INTO `pet_level_spell` VALUES ('16','63','27271');
+INSERT INTO `pet_level_spell` VALUES ('16','64','27273');
+INSERT INTO `pet_level_spell` VALUES ('16','66','27272');
+INSERT INTO `pet_level_spell` VALUES ('16','69','33701');
+INSERT INTO `pet_level_spell` VALUES ('16','70','27270');
+INSERT INTO `pet_level_spell` VALUES ('16','72','47985');
+INSERT INTO `pet_level_spell` VALUES ('16','73','47987');
+INSERT INTO `pet_level_spell` VALUES ('16','75','47989');
+INSERT INTO `pet_level_spell` VALUES ('16','78','47988');
+INSERT INTO `pet_level_spell` VALUES ('16','79','47986');
+INSERT INTO `pet_level_spell` VALUES ('16','80','47990');
+INSERT INTO `pet_level_spell` VALUES ('16','80','47984');
+-- Succubus
+INSERT INTO `pet_level_spell` VALUES ('17','20','7814');
+INSERT INTO `pet_level_spell` VALUES ('17','22','6360');
+INSERT INTO `pet_level_spell` VALUES ('17','26','6358');
+INSERT INTO `pet_level_spell` VALUES ('17','28','7815');
+INSERT INTO `pet_level_spell` VALUES ('17','32','7870');
+INSERT INTO `pet_level_spell` VALUES ('17','34','7813');
+INSERT INTO `pet_level_spell` VALUES ('17','36','7816');
+INSERT INTO `pet_level_spell` VALUES ('17','44','11778');
+INSERT INTO `pet_level_spell` VALUES ('17','46','11784');
+INSERT INTO `pet_level_spell` VALUES ('17','52','11779');
+INSERT INTO `pet_level_spell` VALUES ('17','58','11785');
+INSERT INTO `pet_level_spell` VALUES ('17','60','11780');
+INSERT INTO `pet_level_spell` VALUES ('17','68','27274');
+INSERT INTO `pet_level_spell` VALUES ('17','70','27275');
+INSERT INTO `pet_level_spell` VALUES ('17','74','47991');
+INSERT INTO `pet_level_spell` VALUES ('17','80','47992');
+-- Felhunter
+INSERT INTO `pet_level_spell` VALUES ('15','30','19505');
+INSERT INTO `pet_level_spell` VALUES ('15','32','54424');
+INSERT INTO `pet_level_spell` VALUES ('15','36','19244');
+INSERT INTO `pet_level_spell` VALUES ('15','38','19731');
+INSERT INTO `pet_level_spell` VALUES ('15','42','57564');
+INSERT INTO `pet_level_spell` VALUES ('15','42','54049');
+INSERT INTO `pet_level_spell` VALUES ('15','46','19734');
+INSERT INTO `pet_level_spell` VALUES ('15','50','54050');
+INSERT INTO `pet_level_spell` VALUES ('15','52','57565');
+INSERT INTO `pet_level_spell` VALUES ('15','52','19647');
+INSERT INTO `pet_level_spell` VALUES ('15','54','19736');
+INSERT INTO `pet_level_spell` VALUES ('15','58','54051');
+INSERT INTO `pet_level_spell` VALUES ('15','62','27276');
+INSERT INTO `pet_level_spell` VALUES ('15','62','57566');
+INSERT INTO `pet_level_spell` VALUES ('15','66','54052');
+INSERT INTO `pet_level_spell` VALUES ('15','70','27277');
+INSERT INTO `pet_level_spell` VALUES ('15','72','57567');
+INSERT INTO `pet_level_spell` VALUES ('15','74','54053');
+INSERT INTO `pet_level_spell` VALUES ('15','77','48011');
+-- Felguard
+INSERT INTO `pet_level_spell` VALUES ('29','50','33698');
+INSERT INTO `pet_level_spell` VALUES ('29','50','30213');
+INSERT INTO `pet_level_spell` VALUES ('29','52','30151');
+INSERT INTO `pet_level_spell` VALUES ('29','60','33699');
+INSERT INTO `pet_level_spell` VALUES ('29','60','30219');
+INSERT INTO `pet_level_spell` VALUES ('29','61','30194');
+INSERT INTO `pet_level_spell` VALUES ('29','68','30223');
+INSERT INTO `pet_level_spell` VALUES ('29','69','33700');
+INSERT INTO `pet_level_spell` VALUES ('29','69','30198');
+INSERT INTO `pet_level_spell` VALUES ('29','76','47994');
+INSERT INTO `pet_level_spell` VALUES ('29','78','47993');
+INSERT INTO `pet_level_spell` VALUES ('29','79','47996');
\ No newline at end of file
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp
index 7cf205f..63bed82 100644
--- a/src/game/Pet.cpp
+++ b/src/game/Pet.cpp
@@ -833,6 +833,9 @@ bool Pet::InitStatsForLevel(uint32 petlevel)
                         uint32 fire  = owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_FIRE);
                         uint32 shadow = owner->GetUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + SPELL_SCHOOL_SHADOW);
                         uint32 val  = (fire > shadow) ? fire : shadow;
+                        
+                        // learn spells per level
+                        learnWarlockLevelupSpells();

                         SetBonusDamage(int32 (val * 0.15f));
                         //bonusAP += val * 0.57;
@@ -1372,6 +1375,23 @@ void Pet::learnLevelupSpells()
     }
}

+void Pet::learnWarlockLevelupSpells()
+{
+    PetLevelupSpellSet const *levelupSpells = spellmgr.GetWarlockPetLevelupSpellList(GetCreatureInfo()->family);
+    if(!levelupSpells)
+        return;
+
+    uint32 level = getLevel();
+
+    for(PetLevelupSpellSet::const_iterator itr = levelupSpells->begin(); itr != levelupSpells->end(); ++itr)
+    {
+        if(itr->first <= level)
+            learnSpell(itr->second);
+        else
+            unlearnSpell(itr->second);
+    }
+}
+
bool Pet::unlearnSpell(uint32 spell_id)
{
     if(removeSpell(spell_id))
diff --git a/src/game/Pet.h b/src/game/Pet.h
index 47e0a65..f838335 100644
--- a/src/game/Pet.h
+++ b/src/game/Pet.h
@@ -191,6 +191,7 @@ class Pet : public Creature
         bool addSpell(uint32 spell_id,uint16 active = ACT_DECIDE, PetSpellState state = PETSPELL_NEW, PetSpellType type = PETSPELL_NORMAL);
         bool learnSpell(uint32 spell_id);
         void learnLevelupSpells();
+        void learnWarlockLevelupSpells();
         bool unlearnSpell(uint32 spell_id);
         bool removeSpell(uint32 spell_id);
         bool _removeSpell(uint32 spell_id);
diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp
index 89e8860..eecf6ee 100644
--- a/src/game/SpellMgr.cpp
+++ b/src/game/SpellMgr.cpp
@@ -2273,6 +2273,46 @@ void SpellMgr::LoadPetLevelupSpellMap()
     sLog.outString( ">> Loaded %u pet levelup spells", count );
}

+
+void SpellMgr::LoadWarlockPetLevelupSpellMap()
+{
+    uint32 count = 0;
+    QueryResult *result = WorldDatabase.PQuery("SELECT pet_family, level, spellid FROM pet_level_spell");    
+
+    if(!result)
+    {
+        sLog.outError( " Loaded 0 Warlock Pet Spells, Table pet_level_spell not exist/no data/wrong structure.");
+    }
+    else
+    {
+         uint32 cr_family = 0;
+         uint32 need_level = 0;
+         uint32 spellid = 0;
+    
+    do
+    {
+        Field *fields = result->Fetch();
+        
+        cr_family = fields[0].GetUInt32();
+        need_level = fields[1].GetUInt32();
+        spellid = fields[2].GetUInt32();
+        
+        mWarlockPetLevelupSpellMap[cr_family][need_level] = spellid;
+        count++;
+    }
+    while( result->NextRow() );
+    
+    delete result;
+   
+    
+    sLog.outString( ">> Loaded %u warlock pet levelup spells ", count);
+    sLog.outString();
+    
+    }
+      
+}
+
+
/// Some checks for spells, to prevent adding deprecated/broken spells for trainers, spell book, etc
bool SpellMgr::IsSpellValid(SpellEntry const* spellInfo, Player* pl, bool msg)
{
diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h
index 25e54a3..68c032b 100644
--- a/src/game/SpellMgr.h
+++ b/src/game/SpellMgr.h
@@ -745,6 +745,7 @@ typedef std::multimap<uint32, SkillLineAbilityEntry const*> SkillLineAbilityMap;

typedef std::map<uint32, uint32> PetLevelupSpellSet;
typedef std::map<uint32, PetLevelupSpellSet> PetLevelupSpellMap;
+typedef std::map<uint32, PetLevelupSpellSet> WarlockPetLevelupSpellMap;

inline bool IsPrimaryProfessionSkill(uint32 skill)
{
@@ -1025,9 +1026,16 @@ class SpellMgr
         {
             return SpellAreaForAreaMapBounds(mSpellAreaForAreaMap.lower_bound(area_id),mSpellAreaForAreaMap.upper_bound(area_id));
         }
+        PetLevelupSpellSet const* GetWarlockPetLevelupSpellList(uint32 petFamily) const
+        {
+            WarlockPetLevelupSpellMap::const_iterator itr = mWarlockPetLevelupSpellMap.find(petFamily);
+            if(itr != mWarlockPetLevelupSpellMap.end())
+                return &itr->second;
+            else
+                return NULL;
+        }

-    // Modifiers
-    public:
+    public:
         static SpellMgr& Instance();

         // Loading data at server startup
@@ -1045,6 +1053,7 @@ class SpellMgr
         void LoadSpellPetAuras();
         void LoadPetLevelupSpellMap();
         void LoadSpellAreas();
+        void LoadWarlockPetLevelupSpellMap();

     private:
         SpellScriptTarget  mSpellScriptTarget;
@@ -1059,13 +1068,14 @@ class SpellMgr
         SpellBonusMap      mSpellBonusMap;
         SkillLineAbilityMap mSkillLineAbilityMap;
         SpellPetAuraMap     mSpellPetAuraMap;
-        PetLevelupSpellMap  mPetLevelupSpellMap;
         SpellAreaMap         mSpellAreaMap;
         SpellAreaForQuestMap mSpellAreaForQuestMap;
         SpellAreaForQuestMap mSpellAreaForActiveQuestMap;
         SpellAreaForQuestMap mSpellAreaForQuestEndMap;
         SpellAreaForAuraMap  mSpellAreaForAuraMap;
         SpellAreaForAreaMap  mSpellAreaForAreaMap;
+        PetLevelupSpellMap mPetLevelupSpellMap;
+        WarlockPetLevelupSpellMap mWarlockPetLevelupSpellMap;
};

#define spellmgr SpellMgr::Instance()
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 0c7d222..532efba 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -1234,6 +1234,9 @@ void World::SetInitialWorldSettings()
     sLog.outString( "Loading pet levelup spells..." );
     spellmgr.LoadPetLevelupSpellMap();

+    sLog.outString( "Loading Warlock pet levelup spells..." );
+    spellmgr.LoadWarlockPetLevelupSpellMap();
+
     sLog.outString( "Loading Player Create Info & Level Stats..." );
     sLog.outString();
     objmgr.LoadPlayerInfo();

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×