From dcc7b999827553b5a36d64fbe5c5fba4c3b27b69 Mon Sep 17 00:00:00 2001 From: QAston Date: Sun, 19 Apr 2009 20:45:55 +0200 Subject: [PATCH] *Update petLevelupSpellLearn code *Remove triggered aura of shadow embrace when main aura expires. --HG-- branch : trunk rename : sql/updates/2773_world_spell_linked_spell.sql => sql/updates/2814_world_spell_linked_spell.sql --- sql/updates/2773_world_spell_linked_spell.sql | 6 ------ sql/updates/2814_world_spell_linked_spell.sql | 6 ++++++ src/game/DBCStores.cpp | 6 ++++-- src/game/Pet.cpp | 2 -- src/game/Player.cpp | 2 -- src/game/SpellMgr.cpp | 7 +++---- 6 files changed, 13 insertions(+), 16 deletions(-) delete mode 100644 sql/updates/2773_world_spell_linked_spell.sql create mode 100644 sql/updates/2814_world_spell_linked_spell.sql diff --git a/sql/updates/2773_world_spell_linked_spell.sql b/sql/updates/2773_world_spell_linked_spell.sql deleted file mode 100644 index 90f5f8de19..0000000000 --- a/sql/updates/2773_world_spell_linked_spell.sql +++ /dev/null @@ -1,6 +0,0 @@ -DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (32386, 32388, 32389, 32390, 32391); -INSERT INTO `spell_linked_spell` VALUES (32386, 60448, 1, 'Shadow Embrace Rank1'); -INSERT INTO `spell_linked_spell` VALUES (32388, 60465, 1, 'Shadow Embrace Rank2'); -INSERT INTO `spell_linked_spell` VALUES (32389, 60466, 1, 'Shadow Embrace Rank3'); -INSERT INTO `spell_linked_spell` VALUES (32390, 60467, 1, 'Shadow Embrace Rank4'); -INSERT INTO `spell_linked_spell` VALUES (32391, 60468, 1, 'Shadow Embrace Rank5'); diff --git a/sql/updates/2814_world_spell_linked_spell.sql b/sql/updates/2814_world_spell_linked_spell.sql new file mode 100644 index 0000000000..4986c2a7e3 --- /dev/null +++ b/sql/updates/2814_world_spell_linked_spell.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (32386, 32388, 32389, 32390, 32391); +INSERT INTO `spell_linked_spell` VALUES (32386, 60448, 2, 'Shadow Embrace Rank1'); +INSERT INTO `spell_linked_spell` VALUES (32388, 60465, 2, 'Shadow Embrace Rank2'); +INSERT INTO `spell_linked_spell` VALUES (32389, 60466, 2, 'Shadow Embrace Rank3'); +INSERT INTO `spell_linked_spell` VALUES (32390, 60467, 2, 'Shadow Embrace Rank4'); +INSERT INTO `spell_linked_spell` VALUES (32391, 60468, 2, 'Shadow Embrace Rank5'); diff --git a/src/game/DBCStores.cpp b/src/game/DBCStores.cpp index e1fe1eba5e..c643dc4613 100644 --- a/src/game/DBCStores.cpp +++ b/src/game/DBCStores.cpp @@ -334,10 +334,12 @@ void LoadDBCStores(const std::string& dataPath) if(skillLine->skillId != cFamily->skillLine[0] && skillLine->skillId != cFamily->skillLine[1]) continue; + if(spellInfo->spellLevel) + continue; // Passive spell has to have spellfamilyflags if name present (need to not apply 20782) - if (spellInfo->Attributes & SPELL_ATTR_UNK18 && spellInfo->SpellFamilyName && !spellInfo->SpellFamilyFlags) - continue; + //if (spellInfo->Attributes & SPELL_ATTR_UNK18 && spellInfo->SpellFamilyName && !spellInfo->SpellFamilyFlags) + // continue; sPetFamilySpellsStore[i].insert(spellInfo->Id); } diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index df4ed5f46d..9c8835b8de 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -1089,8 +1089,6 @@ void Pet::_SaveSpells() void Pet::_LoadAuras(uint32 timediff) { sLog.outDebug("Loading auras for pet %u",GetGUIDLow()); - for (int i = 0; i < TOTAL_AURAS; i++) - m_modAuras[i].clear(); QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,stackcount,amount0, amount1, amount2 ,maxduration,remaintime,remaincharges FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber()); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 5ce396bfa6..71936933a8 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -14633,8 +14633,6 @@ void Player::_LoadActions(QueryResult *result) void Player::_LoadAuras(QueryResult *result, uint32 timediff) { sLog.outDebug("Loading auras for player %u",GetGUIDLow()); - for (int i = 0; i < TOTAL_AURAS; i++) - m_modAuras[i].clear(); //QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,stackcount,amount0,amount1,amount2,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'",GetGUIDLow()); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 57da411627..df5fa14541 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2533,11 +2533,10 @@ void SpellMgr::LoadPetLevelupSpellMap() if (creatureFamily->skillLine[j]!=skillLine->skillId) continue; SpellEntry const *spell = sSpellStore.LookupEntry(skillLine->spellId); - // not exist or passive (passives are handled elsewhere) - if(!spell || IsPassiveSpell(spell->Id)) + // not exist or triggered or talent + if(!spell || !spell->spellLevel || GetTalentSpellPos(spell->Id)) continue; - // Make sure that triggered spells aren't learned - if (!spell->SpellFamilyName && !spell->StartRecoveryCategory) + if (!spell->SpellFamilyFlags && spell->SpellIconID!=2310 && (!spell->RecoveryTime || !spell->StartRecoveryCategory)) continue; mPetLevelupSpellMap.insert(PetLevelupSpellMap::value_type(creatureFamily->ID, std::make_pair(spell->spellLevel , spell->Id ))); count++;