diff --git a/sql/mangos.sql b/sql/mangos.sql index 6ea0523d6..f566859cb 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, - `required_8098_02_mangos_playercreateinfo_action` bit(1) default NULL + `required_8115_01_mangos_playercreateinfo_action` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -17609,7 +17609,9 @@ INSERT INTO `spell_proc_event` VALUES (61356, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (61846, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0), (61847, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0), -(63108, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); +(63108, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(63156, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(63158, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); /*!40000 ALTER TABLE `spell_proc_event` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/updates/8112_01_mangos_spell_proc_event.sql b/sql/updates/8112_01_mangos_spell_proc_event.sql new file mode 100644 index 000000000..b882e66ee --- /dev/null +++ b/sql/updates/8112_01_mangos_spell_proc_event.sql @@ -0,0 +1,6 @@ +ALTER TABLE db_version CHANGE COLUMN required_8098_02_mangos_playercreateinfo_action required_8112_01_mangos_spell_proc_event bit; + +DELETE FROM spell_proc_event WHERE entry IN (63156, 63158); +INSERT INTO spell_proc_event VALUES +(63156, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(63158, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); \ No newline at end of file diff --git a/sql/updates/8115_01_mangos_playercreateinfo_action.sql b/sql/updates/8115_01_mangos_playercreateinfo_action.sql new file mode 100644 index 000000000..d0a5b338e --- /dev/null +++ b/sql/updates/8115_01_mangos_playercreateinfo_action.sql @@ -0,0 +1,358 @@ +ALTER TABLE db_version CHANGE COLUMN required_8112_01_mangos_spell_proc_event required_8115_01_mangos_playercreateinfo_action bit; + +TRUNCATE TABLE `playercreateinfo_action`; +INSERT INTO `playercreateinfo_action` VALUES +(1,1,1,78,0), +(1,1,0,6603,0), +(1,1,11,117,128), +(1,2,2,635,0), +(1,2,0,6603,0), +(1,2,1,21084,0), +(1,2,10,159,128), +(1,2,11,2070,128), +(1,4,1,1752,0), +(1,4,2,2098,0), +(1,4,3,2764,0), +(1,4,0,6603,0), +(1,4,11,2070,128), +(1,5,1,585,0), +(1,5,2,2050,0), +(1,5,0,6603,0), +(1,5,10,159,128), +(1,5,11,2070,128), +(1,6,0,6603,0), +(1,6,1,49576,0), +(1,6,2,45477,0), +(1,6,3,45462,0), +(1,6,4,45902,0), +(1,6,5,47541,0), +(1,6,11,59752,0), +(1,8,1,133,0), +(1,8,2,168,0), +(1,8,0,6603,0), +(1,8,10,159,128), +(1,8,11,2070,128), +(1,9,1,686,0), +(1,9,2,687,0), +(1,9,0,6603,0), +(1,9,10,159,128), +(1,9,11,4604,128), +(2,1,1,78,0), +(2,1,0,6603,0), +(2,1,11,117,128), +(2,3,2,75,0), +(2,3,1,2973,0), +(2,3,0,6603,0), +(2,3,11,117,128), +(2,3,10,159,128), +(2,4,10,0,128), +(2,4,1,1752,0), +(2,4,2,2098,0), +(2,4,0,6603,0), +(2,4,11,117,128), +(2,6,0,6603,0), +(2,6,1,49576,0), +(2,6,2,45477,0), +(2,6,3,45462,0), +(2,6,4,45902,0), +(2,6,5,47541,0), +(2,6,10,20572,0), +(2,7,2,331,0), +(2,7,1,403,0), +(2,7,0,6603,0), +(2,7,11,117,128), +(2,7,10,159,128), +(2,9,1,686,0), +(2,9,2,687,0), +(2,9,0,6603,0), +(2,9,11,117,128), +(2,9,10,159,128), +(3,1,1,78,0), +(3,1,0,6603,0), +(3,1,11,117,128), +(3,2,2,635,0), +(3,2,0,6603,0), +(3,2,1,21084,0), +(3,2,10,159,128), +(3,2,11,4540,128), +(3,3,2,75,0), +(3,3,1,2973,0), +(3,3,0,6603,0), +(3,3,11,117,128), +(3,3,10,159,128), +(3,4,1,1752,0), +(3,4,2,2098,0), +(3,4,3,2764,0), +(3,4,0,6603,0), +(3,4,11,4540,128), +(3,5,1,585,0), +(3,5,2,2050,0), +(3,5,0,6603,0), +(3,5,10,159,128), +(3,5,11,4540,128), +(3,6,0,6603,0), +(3,6,1,49576,0), +(3,6,2,45477,0), +(3,6,3,45462,0), +(3,6,4,45902,0), +(3,6,5,47541,0), +(3,6,10,2481,0), +(4,1,1,78,0), +(4,1,0,6603,0), +(4,1,11,117,128), +(4,3,2,75,0), +(4,3,1,2973,0), +(4,3,0,6603,0), +(4,3,11,117,128), +(4,3,10,159,128), +(4,4,1,1752,0), +(4,4,2,2098,0), +(4,4,3,2764,0), +(4,4,0,6603,0), +(4,4,11,4540,128), +(4,5,1,585,0), +(4,5,2,2050,0), +(4,5,0,6603,0), +(4,5,10,159,128), +(4,5,11,2070,128), +(4,6,0,6603,0), +(4,6,1,49576,0), +(4,6,2,45477,0), +(4,6,3,45462,0), +(4,6,4,45902,0), +(4,6,5,47541,0), +(4,6,10,58984,0), +(4,6,83,58984,0), +(4,11,1,5176,0), +(4,11,2,5185,0), +(4,11,0,6603,0), +(4,11,10,159,128), +(4,11,11,4536,128), +(5,1,11,4604,128), +(5,1,0,6603,0), +(5,1,1,78,0), +(5,4,11,4604,128), +(5,4,3,2764,0), +(5,4,2,2098,0), +(5,4,1,1752,0), +(5,4,0,6603,0), +(5,5,10,159,128), +(5,5,2,2050,0), +(5,5,1,585,0), +(5,5,11,4604,128), +(5,5,0,6603,0), +(5,6,0,6603,0), +(5,6,1,49576,0), +(5,6,2,45477,0), +(5,6,3,45462,0), +(5,6,4,45902,0), +(5,6,5,47541,0), +(5,6,10,20577,0), +(5,8,11,4604,128), +(5,8,10,159,128), +(5,8,2,168,0), +(5,8,1,133,0), +(5,8,0,6603,0), +(5,9,1,686,0), +(5,9,10,159,128), +(5,9,2,687,0), +(5,9,11,4604,128), +(5,9,0,6603,0), +(6,1,1,78,0), +(6,1,2,20549,0), +(6,1,11,4540,128), +(6,1,0,6603,0), +(6,3,1,2973,0), +(6,3,10,159,128), +(6,3,2,75,0), +(6,3,3,20549,0), +(6,3,11,117,128), +(6,3,0,6603,0), +(6,6,0,6603,0), +(6,6,1,49576,0), +(6,6,2,45477,0), +(6,6,3,45462,0), +(6,6,4,45902,0), +(6,6,5,47541,0), +(6,6,10,20549,0), +(6,6,75,20549,0), +(6,7,1,403,0), +(6,7,10,159,128), +(6,7,2,331,0), +(6,7,3,20549,0), +(6,7,11,4604,128), +(6,7,0,6603,0), +(6,11,1,5176,0), +(6,11,10,159,128), +(6,11,2,5185,0), +(6,11,3,20549,0), +(6,11,11,4536,128), +(6,11,0,6603,0), +(7,1,11,117,128), +(7,1,1,78,0), +(7,1,0,6603,0), +(7,4,11,117,128), +(7,4,3,2764,0), +(7,4,1,1752,0), +(7,4,2,2098,0), +(7,4,0,6603,0), +(7,6,0,6603,0), +(7,6,1,49576,0), +(7,6,2,45477,0), +(7,6,3,45462,0), +(7,6,4,45902,0), +(7,6,5,47541,0), +(7,6,10,20589,0), +(7,6,72,6603,0), +(7,6,83,117,128), +(7,6,84,6603,0), +(7,6,96,6603,0), +(7,6,108,6603,0), +(7,8,11,4536,128), +(7,8,1,133,0), +(7,8,2,168,0), +(7,8,10,159,128), +(7,8,0,6603,0), +(7,9,11,4604,128), +(7,9,1,686,0), +(7,9,2,687,0), +(7,9,10,159,128), +(7,9,0,6603,0), +(8,1,11,117,128), +(8,1,1,78,0), +(8,1,3,2764,0), +(8,1,0,6603,0), +(8,3,10,159,128), +(8,3,11,4604,128), +(8,3,1,2973,0), +(8,3,2,75,0), +(8,3,0,6603,0), +(8,4,1,1752,0), +(8,4,3,2764,0), +(8,4,2,2098,0), +(8,4,11,117,128), +(8,4,0,6603,0), +(8,5,1,585,0), +(8,5,10,159,128), +(8,5,2,2050,0), +(8,5,11,4540,128), +(8,5,0,6603,0), +(8,6,0,6603,0), +(8,6,1,49576,0), +(8,6,2,45477,0), +(8,6,3,45462,0), +(8,6,4,45902,0), +(8,6,5,47541,0), +(8,6,10,50621,0), +(8,7,1,403,0), +(8,7,10,159,128), +(8,7,2,331,0), +(8,7,11,117,128), +(8,7,0,6603,0), +(8,8,1,133,0), +(8,8,10,159,128), +(8,8,2,168,0), +(8,8,11,117,128), +(8,8,0,6603,0), +(10,2,0,6603,0), +(10,2,1,21084,0), +(10,2,2,635,0), +(10,2,3,28734,0), +(10,2,4,28730,0), +(10,2,10,159,128), +(10,2,11,20857,128), +(10,3,0,6603,0), +(10,3,1,2973,0), +(10,3,2,75,0), +(10,3,3,28734,0), +(10,3,4,28730,0), +(10,3,10,159,128), +(10,3,11,20857,128), +(10,4,0,6603,0), +(10,4,1,1752,0), +(10,4,2,2098,0), +(10,4,3,2764,0), +(10,4,4,28734,0), +(10,4,5,25046,0), +(10,4,11,20857,128), +(10,5,0,6603,0), +(10,5,1,585,0), +(10,5,2,2050,0), +(10,5,3,28734,0), +(10,5,4,28730,0), +(10,5,10,159,128), +(10,5,11,20857,128), +(10,6,0,6603,0), +(10,6,1,49576,0), +(10,6,2,45477,0), +(10,6,3,45462,0), +(10,6,4,45902,0), +(10,6,5,47541,0), +(10,6,6,50613,0), +(10,8,0,6603,0), +(10,8,1,133,0), +(10,8,2,168,0), +(10,8,3,28734,0), +(10,8,4,28730,0), +(10,8,10,159,128), +(10,8,11,20857,128), +(10,9,11,20857,128), +(10,9,10,159,128), +(10,9,4,28730,0), +(10,9,3,28734,0), +(10,9,2,687,0), +(10,9,1,686,0), +(10,9,0,6603,0), +(11,1,0,6603,0), +(11,1,72,6603,0), +(11,1,73,78,0), +(11,1,74,28880,0), +(11,1,83,4540,128), +(11,1,84,6603,0), +(11,1,96,6603,0), +(11,1,108,6603,0), +(11,2,0,6603,0), +(11,2,1,21084,0), +(11,2,2,635,0), +(11,2,3,59542,0), +(11,2,10,159,128), +(11,2,11,4540,128), +(11,2,83,4540,128), +(11,3,0,6603,0), +(11,3,1,2973,0), +(11,3,2,75,0), +(11,3,3,59543,0), +(11,3,10,159,128), +(11,3,11,4540,128), +(11,3,72,6603,0), +(11,3,73,2973,0), +(11,3,74,75,0), +(11,3,82,159,128), +(11,3,83,4540,128), +(11,5,0,6603,0), +(11,5,1,585,0), +(11,5,2,2050,0), +(11,5,3,59544,0), +(11,5,10,159,128), +(11,5,11,4540,128), +(11,5,83,4540,128), +(11,6,0,6603,0), +(11,6,1,49576,0), +(11,6,2,45477,0), +(11,6,3,45462,0), +(11,6,4,45902,0), +(11,6,5,47541,0), +(11,6,6,59545,0), +(11,7,0,6603,0), +(11,7,1,403,0), +(11,7,2,331,0), +(11,7,3,59547,0), +(11,7,10,159,128), +(11,7,11,4540,128), +(11,8,0,6603,0), +(11,8,1,133,0), +(11,8,2,168,0), +(11,8,3,59548,0), +(11,8,10,159,128), +(11,8,11,4540,128), +(11,8,83,4540,128); diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 5969c8cb1..ef83aa02b 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -240,6 +240,8 @@ pkgdata_DATA = \ 8098_03_characters_character_pet.sql \ 8098_04_characters_pet_spell.sql \ 8104_01_characters.sql \ + 8112_01_mangos_spell_proc_event.sql \ + 8115_01_mangos_playercreateinfo_action.sql \ README ## Additional files to include when running 'make dist' @@ -460,4 +462,6 @@ EXTRA_DIST = \ 8098_03_characters_character_pet.sql \ 8098_04_characters_pet_spell.sql \ 8104_01_characters.sql \ + 8112_01_mangos_spell_proc_event.sql \ + 8115_01_mangos_playercreateinfo_action.sql \ README diff --git a/src/game/Group.cpp b/src/game/Group.cpp index c67d874e0..75299c935 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -1526,7 +1526,7 @@ void Group::ResetInstances(uint8 method, Player* SendMsgTo) bool isEmpty = true; // if the map is loaded, reset it Map *map = MapManager::Instance().FindMap(p->GetMapId(), p->GetInstanceId()); - if(map && map->IsDungeon()) + if(map && map->IsDungeon() && !(method == INSTANCE_RESET_GROUP_DISBAND && !p->CanReset())) isEmpty = ((InstanceMap*)map)->Reset(method); if(SendMsgTo) diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index df3bbdcec..7ff4ecf3c 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -1074,6 +1074,9 @@ bool ChatHandler::HandleUnLearnCommand(const char* args) else SendSysMessage(LANG_FORGET_SPELL); + if(GetTalentSpellCost(spell_id)) + target->SendTalentsInfoData(false); + return true; } @@ -2016,6 +2019,10 @@ bool ChatHandler::HandleLearnCommand(const char* args) else targetPlayer->learnSpell(spell,false); + uint32 first_spell = spellmgr.GetFirstSpellInChain(spell); + if(GetTalentSpellCost(first_spell)) + targetPlayer->SendTalentsInfoData(false); + return true; } diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 347d5ee5c..2f9cbfdba 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -798,16 +798,19 @@ bool Pet::CreateBaseAtCreature(Creature* creature) return true; } -bool Pet::InitStatsForLevel(uint32 petlevel) +bool Pet::InitStatsForLevel(uint32 petlevel, Unit* owner) { CreatureInfo const *cinfo = GetCreatureInfo(); assert(cinfo); - Unit* owner = GetOwner(); if(!owner) { - sLog.outError("attempt to summon pet (Entry %u) without owner! Attempt terminated.", cinfo->Entry); - return false; + owner = GetOwner(); + if(!owner) + { + sLog.outError("attempt to summon pet (Entry %u) without owner! Attempt terminated.", cinfo->Entry); + return false; + } } uint32 creature_ID = (getPetType() == HUNTER_PET) ? 1 : cinfo->Entry; diff --git a/src/game/Pet.h b/src/game/Pet.h index f41b77710..bbe878d1d 100644 --- a/src/game/Pet.h +++ b/src/game/Pet.h @@ -161,7 +161,7 @@ class Pet : public Creature void GivePetXP(uint32 xp); void GivePetLevel(uint32 level); void SynchronizeLevelWithOwner(); - bool InitStatsForLevel(uint32 level); + bool InitStatsForLevel(uint32 level, Unit* owner = NULL); bool HaveInDiet(ItemPrototype const* item) const; uint32 GetCurrentFoodBenefitLevel(uint32 itemlevel); void SetDuration(int32 dur) { m_duration = dur; } diff --git a/src/game/Player.cpp b/src/game/Player.cpp index ba575de79..72c5db56d 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -2909,7 +2909,7 @@ bool Player::addSpell(uint32 spell_id, bool active, bool learning, bool dependen if(!rankSpellId || rankSpellId==spell_id) continue; - removeSpell(rankSpellId); + removeSpell(rankSpellId,false,false); } } } @@ -3158,7 +3158,7 @@ void Player::learnSpell(uint32 spell_id, bool dependent) GetSession()->SendPacket(&data); } -void Player::removeSpell(uint32 spell_id, bool disabled, bool update_action_bar_for_low_rank) +void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank) { PlayerSpellMap::iterator itr = m_spells.find(spell_id); if (itr == m_spells.end()) @@ -3171,7 +3171,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool update_action_bar_ SpellChainMapNext const& nextMap = spellmgr.GetSpellChainNext(); for(SpellChainMapNext::const_iterator itr2 = nextMap.lower_bound(spell_id); itr2 != nextMap.upper_bound(spell_id); ++itr2) if(HasSpell(itr2->second) && !GetTalentSpellPos(itr2->second)) - removeSpell(itr2->second,disabled); + removeSpell(itr2->second,disabled,false); // re-search, it can be corrupted in prev loop itr = m_spells.find(spell_id); @@ -3300,13 +3300,16 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool update_action_bar_ { SpellEntry const *spellInfo = sSpellStore.LookupEntry(spell_id); - // if talent then lesser rank also talent and need learn + // if talent then lesser rank also talent and need learn if(talentCosts) - learnSpell (prev_id,false); - // if ranked non-stackable spell: need activate lesser rank and update dendence state + { + if(learn_low_rank) + learnSpell (prev_id,false); + } + // if ranked non-stackable spell: need activate lesser rank and update dendence state else if(cur_active && !SpellMgr::canStackSpellRanks(spellInfo) && spellmgr.GetSpellRank(spellInfo->Id) != 0) { - // need manually update dependence state (learn spell ignore like attempts) + // need manually update dependence state (learn spell ignore like attempts) PlayerSpellMap::iterator prev_itr = m_spells.find(prev_id); if (prev_itr != m_spells.end()) { @@ -3318,19 +3321,16 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool update_action_bar_ } // now re-learn if need re-activate - if(cur_active && !prev_itr->second->active) + if(cur_active && !prev_itr->second->active && learn_low_rank) { if(addSpell(prev_id,true,false,prev_itr->second->dependent,prev_itr->second->disabled)) { - if(update_action_bar_for_low_rank) - { - // downgrade spell ranks in spellbook and action bar - WorldPacket data(SMSG_SUPERCEDED_SPELL, 4 + 4); - data << uint32(spell_id); - data << uint32(prev_id); - GetSession()->SendPacket( &data ); - prev_activate = true; - } + // downgrade spell ranks in spellbook and action bar + WorldPacket data(SMSG_SUPERCEDED_SPELL, 4 + 4); + data << uint32(spell_id); + data << uint32(prev_id); + GetSession()->SendPacket( &data ); + prev_activate = true; } } } @@ -3537,7 +3537,13 @@ bool Player::resetTalents(bool no_cost) uint32 itrFirstId = spellmgr.GetFirstSpellInChain(itr->first); // unlearn if first rank is talent or learned by talent - if (itrFirstId == talentInfo->RankID[j] || spellmgr.IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId)) + if (itrFirstId == talentInfo->RankID[j]) + { + removeSpell(itr->first,!IsPassiveSpell(itr->first),false); + itr = GetSpellMap().begin(); + continue; + } + else if (spellmgr.IsSpellLearnToSpell(talentInfo->RankID[j],itrFirstId)) { removeSpell(itr->first,!IsPassiveSpell(itr->first)); itr = GetSpellMap().begin(); @@ -18224,7 +18230,7 @@ void Player::resetSpells() PlayerSpellMap smap = GetSpellMap(); for(PlayerSpellMap::const_iterator iter = smap.begin();iter != smap.end(); ++iter) - removeSpell(iter->first); // only iter->first can be accessed, object by iter->second can be deleted already + removeSpell(iter->first,false,false); // only iter->first can be accessed, object by iter->second can be deleted already learnDefaultSpells(); learnQuestRewardedSpells(); @@ -19395,6 +19401,7 @@ void Player::EnterVehicle(Vehicle *vehicle) SetFarSightGUID(vehicle->GetGUID()); // set view SetClientControl(vehicle, 1); // redirect controls to vehicle + SetMover(vehicle); WorldPacket data(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0); GetSession()->SendPacket(&data); @@ -19446,6 +19453,7 @@ void Player::ExitVehicle(Vehicle *vehicle) SetFarSightGUID(0); SetClientControl(vehicle, 0); + SetMover(NULL); WorldPacket data(MSG_MOVE_TELEPORT_ACK, 30); data.append(GetPackGUID()); diff --git a/src/game/Player.h b/src/game/Player.h index 03e55510a..bbe948c25 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1453,7 +1453,7 @@ class MANGOS_DLL_SPEC Player : public Unit void SendInitialSpells(); bool addSpell(uint32 spell_id, bool active, bool learning, bool dependent, bool disabled); void learnSpell(uint32 spell_id, bool dependent); - void removeSpell(uint32 spell_id, bool disabled = false, bool update_action_bar_for_low_rank = false); + void removeSpell(uint32 spell_id, bool disabled = false, bool learn_low_rank = true); void resetSpells(); void learnDefaultSpells(); void learnQuestRewardedSpells(); @@ -2033,6 +2033,7 @@ class MANGOS_DLL_SPEC Player : public Unit bool IsAllowUseFlyMountsHere() const; void SetClientControl(Unit* target, uint8 allowMove); + void SetMover(Unit* target) { m_mover = target ? target : this; } void EnterVehicle(Vehicle *vehicle); void ExitVehicle(Vehicle *vehicle); diff --git a/src/game/SkillDiscovery.cpp b/src/game/SkillDiscovery.cpp index 9a763476e..8e0725157 100644 --- a/src/game/SkillDiscovery.cpp +++ b/src/game/SkillDiscovery.cpp @@ -35,7 +35,7 @@ struct SkillDiscoveryEntry SkillDiscoveryEntry() : spellId(0), reqSkillValue(0), chance(0) {} - SkillDiscoveryEntry(uint16 _spellId, uint32 req_skill_val, float _chance) + SkillDiscoveryEntry(uint32 _spellId, uint32 req_skill_val, float _chance) : spellId(_spellId), reqSkillValue(req_skill_val), chance(_chance) {} }; diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index eef4b9311..67ece8a60 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -279,7 +279,7 @@ pAuraHandler AuraHandler[TOTAL_AURAS]= &Aura::HandleAuraPeriodicDummy, //226 SPELL_AURA_PERIODIC_DUMMY &Aura::HandlePeriodicTriggerSpellWithValue, //227 SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE &Aura::HandleNoImmediateEffect, //228 stealth detection - &Aura::HandleNULL, //229 SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE + &Aura::HandleNoImmediateEffect, //229 SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE implemented in Unit::SpellDamageBonus &Aura::HandleAuraModIncreaseMaxHealth, //230 Commanding Shout &Aura::HandleNoImmediateEffect, //231 SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE &Aura::HandleNoImmediateEffect, //232 SPELL_AURA_MECHANIC_DURATION_MOD implement in Unit::CalculateSpellDuration @@ -3087,6 +3087,7 @@ void Aura::HandleModPossess(bool apply, bool Real) { ((Player*)caster)->SetFarSightGUID(m_target->GetGUID()); ((Player*)caster)->SetClientControl(m_target, 1); + ((Player*)caster)->SetMover(m_target); } m_target->CombatStop(); @@ -3130,6 +3131,7 @@ void Aura::HandleModPossess(bool apply, bool Real) { ((Player*)caster)->SetFarSightGUID(0); ((Player*)caster)->SetClientControl(m_target, 0); + ((Player*)caster)->SetMover(NULL); WorldPacket data(SMSG_PET_SPELLS, 8); data << uint64(0); @@ -3167,6 +3169,7 @@ void Aura::HandleModPossessPet(bool apply, bool Real) ((Player*)caster)->SetFarSightGUID(apply ? pet->GetGUID() : 0); ((Player*)caster)->SetCharm(apply ? pet : NULL); ((Player*)caster)->SetClientControl(pet, apply ? 1 : 0); + ((Player*)caster)->SetMover(apply ? pet : NULL); if(apply) { diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index c1fbf09a4..651cf8b1a 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -398,6 +398,11 @@ void Spell::EffectSchoolDMG(uint32 effect_idx) damage+= int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * pct / 100); break; } + // Thunder Clap + else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000080)) + { + damage+=int32(m_caster->GetTotalAttackPowerValue(BASE_ATTACK) * 12 / 100); + } break; } case SPELLFAMILY_WARLOCK: @@ -3271,7 +3276,7 @@ void Spell::EffectSummon(uint32 i) spawnCreature->SetCreatorGUID(m_caster->GetGUID()); spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id); - spawnCreature->InitStatsForLevel(level); + spawnCreature->InitStatsForLevel(level, m_caster); spawnCreature->GetCharmInfo()->SetPetNumber(pet_number, false); @@ -3701,7 +3706,7 @@ void Spell::EffectSummonGuardian(uint32 i) spawnCreature->SetCreatorGUID(m_caster->GetGUID()); spawnCreature->SetUInt32Value(UNIT_CREATED_BY_SPELL, m_spellInfo->Id); - spawnCreature->InitStatsForLevel(level); + spawnCreature->InitStatsForLevel(level, m_caster); spawnCreature->GetCharmInfo()->SetPetNumber(pet_number, false); spawnCreature->AIM_Initialize(); @@ -4191,7 +4196,7 @@ void Spell::EffectSummonPet(uint32 i) if(m_caster->IsPvP()) NewSummon->SetPvP(true); - NewSummon->InitStatsForLevel(petlevel); + NewSummon->InitStatsForLevel(petlevel, m_caster); NewSummon->InitPetCreateSpells(); NewSummon->InitLevelupSpellsForLevel(); NewSummon->InitTalentForLevel(); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 23b2762bc..6f68c336d 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2722,6 +2722,16 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto // Explicit Diminishing Groups switch(spellproto->SpellFamilyName) { + case SPELLFAMILY_MAGE: + { + // Shattered Barrier (triggered so doesn't share with Frost Nova) + if (spellproto->SpellFamilyFlags & UI64LIT(0x00000080000)) + return DIMINISHING_TRIGGER_ROOT; + // Frost Nova / Freeze (Water Elemental) + else if (spellproto->SpellIconID == 193) + return DIMINISHING_CONTROL_ROOT; + break; + } case SPELLFAMILY_ROGUE: { // Blind @@ -2730,6 +2740,9 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto // Cheap Shot else if (spellproto->SpellFamilyFlags & UI64LIT(0x00000000400)) return DIMINISHING_CHEAPSHOT_POUNCE; + // Crippling poison - Limit to 10 seconds in PvP (No SpellFamilyFlags) + else if (spellproto->SpellIconID == 163) + return DIMINISHING_LIMITONLY; break; } case SPELLFAMILY_WARLOCK: @@ -2750,6 +2763,9 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto // Pounce else if (spellproto->SpellFamilyFlags & UI64LIT(0x00000020000)) return DIMINISHING_CHEAPSHOT_POUNCE; + // Faerie Fire + else if (spellproto->SpellFamilyFlags & UI64LIT(0x00000000400)) + return DIMINISHING_LIMITONLY; break; } case SPELLFAMILY_WARRIOR: @@ -2787,7 +2803,7 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto if (mechanic & (1<SpellFamilyFlags & UI64LIT(0x00000000400)) + return 40000; + break; + } default: break; } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 18030a63d..9c29a7d89 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -6704,6 +6704,21 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggeredB return false; break; } + // Decimation + case 63156: + case 63158: + { + // Looking for dummy effect + Aura *aur = GetAura(auraSpellInfo->Id, 1); + if (!aur) + return false; + + // If target's health is not below equal certain value (35%) not proc + if ((pVictim->GetHealth() * 100 / pVictim->GetMaxHealth()) > aur->GetModifier()->m_amount) + return false; + + break; + } } // Custom basepoints/target for exist spell @@ -7549,9 +7564,6 @@ void Unit::SetPet(Pet* pet) void Unit::SetCharm(Unit* pet) { SetUInt64Value(UNIT_FIELD_CHARM, pet ? pet->GetGUID() : 0); - - if(GetTypeId() == TYPEID_PLAYER) - ((Player*)this)->m_mover = pet ? pet : this; } @@ -7894,6 +7906,14 @@ uint32 Unit::SpellDamageBonus(Unit *pVictim, SpellEntry const *spellProto, uint3 TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; } + // Mod damage taken from AoE spells + if(IsAreaOfEffectSpell(spellProto)) + { + AuraList const& avoidAuras = pVictim->GetAurasByType(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE); + for(AuraList::const_iterator itr = avoidAuras.begin(); itr != avoidAuras.end(); ++itr) + TakenTotalMod *= ((*itr)->GetModifier()->m_amount+100.0f)/100.0f; + } + // Taken/Done fixed damage bonus auras int32 DoneAdvertisedBenefit = SpellBaseDamageBonus(GetSpellSchoolMask(spellProto)); int32 TakenAdvertisedBenefit = SpellBaseDamageBonusForVictim(GetSpellSchoolMask(spellProto), pVictim); @@ -8737,6 +8757,14 @@ void Unit::MeleeDamageBonus(Unit *pVictim, uint32 *pdamage,WeaponAttackType attT TakenTotalMod *= ((*i)->GetModifier()->m_amount+100.0f)/100.0f; } + // Mod damage taken from AoE spells + if(spellProto && IsAreaOfEffectSpell(spellProto)) + { + AuraList const& avoidAuras = pVictim->GetAurasByType(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE); + for(AuraList::const_iterator itr = avoidAuras.begin(); itr != avoidAuras.end(); ++itr) + TakenTotalMod *= ((*itr)->GetModifier()->m_amount+100.0f)/100.0f; + } + float tmpDamage = float(int32(*pdamage) + DoneFlatBenefit) * DoneTotalMod; // apply spellmod to Done damage diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index d8c5088ea..4312804a9 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8107" + #define REVISION_NR "8118" #endif // __REVISION_NR_H__