From f1850c9ebe474515568b331a53b1c1e417166bc9 Mon Sep 17 00:00:00 2001 From: pasdVn Date: Tue, 22 Dec 2009 20:28:56 +0300 Subject: [PATCH 01/10] [9046] Correctly send channeling start/update packets to clients (cherry-picked from commit 1bc38f7) Signed-off-by: VladimirMangos --- src/game/Spell.cpp | 18 ++++++------------ src/shared/revision_nr.h | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 9f141df99..893e8653b 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -3463,14 +3463,11 @@ void Spell::SendChannelUpdate(uint32 time) m_caster->SetUInt32Value(UNIT_CHANNEL_SPELL, 0); } - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return; - WorldPacket data( MSG_CHANNEL_UPDATE, 8+4 ); data.append(m_caster->GetPackGUID()); data << uint32(time); - ((Player*)m_caster)->GetSession()->SendPacket( &data ); + m_caster->SendMessageToSet(&data, true); } void Spell::SendChannelStart(uint32 duration) @@ -3501,15 +3498,12 @@ void Spell::SendChannelStart(uint32 duration) } } - if (m_caster->GetTypeId() == TYPEID_PLAYER) - { - WorldPacket data( MSG_CHANNEL_START, (8+4+4) ); - data.append(m_caster->GetPackGUID()); - data << uint32(m_spellInfo->Id); - data << uint32(duration); + WorldPacket data( MSG_CHANNEL_START, (8+4+4) ); + data.append(m_caster->GetPackGUID()); + data << uint32(m_spellInfo->Id); + data << uint32(duration); - ((Player*)m_caster)->GetSession()->SendPacket( &data ); - } + m_caster->SendMessageToSet(&data, true); m_timer = duration; if(target) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index a2bc8953f..a191d0cb4 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 "9045" + #define REVISION_NR "9046" #endif // __REVISION_NR_H__ From d36281f315f34608671a10280fe622b624094778 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Wed, 23 Dec 2009 12:32:10 +0300 Subject: [PATCH 02/10] [9047] Support triggered spells that have cast time. Like spell will placed in unit event list for cast at next tick or later dependent from cast timer. Before all triggered spell ignore cast time and casted explcitly from related cast caller code. This must fix some spell work like 17086 in damage apply time part and also in preventing possible stack overflow because this spell triggering by chain 19 spell casts from each other. This also exclude from triggered arg of CastSpell function meaning that this cast will instant alsways. So triggred arg now meaning only that this seppl casted nit from player side and then not send in some cases cast info to client if not vosula effect expected. --- src/game/Spell.cpp | 14 +++++++++++--- src/shared/revision_nr.h | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 893e8653b..b4c2a665e 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2390,13 +2390,21 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura) m_caster->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); } - if(m_IsTriggeredSpell) - cast(true); - else + // add non-triggered (with cast time and without) + if (!m_IsTriggeredSpell) { + // add to cast type slot m_caster->SetCurrentCastedSpell( this ); + + // will show cast bar SendSpellStart(); } + // execute triggered without cast time explicitly in call point + else if(m_timer == 0) + cast(true); + // else triggered with cast time will execute execute at next tick or later + // without adding to cast type slot + // will not show cast bar but will show effects at casting time etc } void Spell::cancel() diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index a191d0cb4..f21aca8d6 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 "9046" + #define REVISION_NR "9047" #endif // __REVISION_NR_H__ From 503496e09c6eb75305cab2c721ab450b3285e602 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Wed, 23 Dec 2009 16:58:48 +0300 Subject: [PATCH 03/10] [9048] Add src\bindings\universal\Scripts\sc_defines.cpp to script.vcproj --- src/bindings/universal/Scripts/sc_defines.cpp | 2 +- src/shared/revision_nr.h | 2 +- win/VC100/script.vcxproj | 1 + win/VC80/script.vcproj | 4 ++++ win/VC90/script.vcproj | 4 ++++ 5 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/bindings/universal/Scripts/sc_defines.cpp b/src/bindings/universal/Scripts/sc_defines.cpp index 0f12248d2..62e848913 100644 --- a/src/bindings/universal/Scripts/sc_defines.cpp +++ b/src/bindings/universal/Scripts/sc_defines.cpp @@ -18,7 +18,7 @@ #include "sc_defines.h" -#include "../../game/Player.h" +#include "../../../game/Player.h" uint32 GetSkillLevel(Player *player,uint32 trskill) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f21aca8d6..c581e2347 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 "9047" + #define REVISION_NR "9048" #endif // __REVISION_NR_H__ diff --git a/win/VC100/script.vcxproj b/win/VC100/script.vcxproj index cd0a48fae..09c3d4e27 100644 --- a/win/VC100/script.vcxproj +++ b/win/VC100/script.vcxproj @@ -321,6 +321,7 @@ + diff --git a/win/VC80/script.vcproj b/win/VC80/script.vcproj index 37ae2ce5a..235db2bb0 100644 --- a/win/VC80/script.vcproj +++ b/win/VC80/script.vcproj @@ -533,6 +533,10 @@ RelativePath="..\..\src\bindings\universal\Scripts\sc_default.cpp" > + + + + Date: Wed, 23 Dec 2009 19:29:40 +0300 Subject: [PATCH 04/10] [9049] Additional fixes for talent 17056 and ranks. Thanks to Sarjuuk for clarify existed problems and help in prepare fix. --- src/game/SpellAuras.cpp | 15 ++++++++------- src/game/Unit.cpp | 1 - src/shared/revision_nr.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index e2c1993d7..990ce43b4 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3019,16 +3019,17 @@ void Aura::HandleAuraModShapeshift(bool apply, bool Real) } } - if(!furorChance) - break; - if (m_modifier.m_miscvalue == FORM_CAT) { - m_target->SetPower(POWER_ENERGY, 0); - // Furor chance is now amount of energy for cat form - m_target->CastCustomSpell(m_target, 17099, &furorChance, NULL, NULL, this); + // Furor chance is now amount allowed to save energy for cat form + // without talent it reset to 0 + if (m_target->GetPower(POWER_ENERGY) > furorChance) + { + m_target->SetPower(POWER_ENERGY, 0); + m_target->CastCustomSpell(m_target, 17099, &furorChance, NULL, NULL, this); + } } - else + else if(furorChance) // only if talent known { m_target->SetPower(POWER_RAGE, 0); if(urand(1,100) <= furorChance) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 65275da7b..c2baad92e 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7741,7 +7741,6 @@ void Unit::setPowerType(Powers new_powertype) break; case POWER_ENERGY: SetMaxPower(POWER_ENERGY,GetCreatePowers(POWER_ENERGY)); - SetPower( POWER_ENERGY,0); break; case POWER_HAPPINESS: SetMaxPower(POWER_HAPPINESS,GetCreatePowers(POWER_HAPPINESS)); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c581e2347..e530e3d21 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 "9048" + #define REVISION_NR "9049" #endif // __REVISION_NR_H__ From fb21f4c16e07bfdb2a3c10aa0e244185f49e424f Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Wed, 23 Dec 2009 20:16:47 +0300 Subject: [PATCH 05/10] [9050] Add MAX_EXPANSION define for config option Expansion check. This will prevent case when expansion set to high for supported client in config and account have also too high expansion setting. Client in like case receive too high expnasion and reject connection because it think that have not installed expansion for connection account. This possible for example for account case when single realmd used for diff client versions and account have high expansion setting for most recent client support. And in same time mamngos.conf for specific realm have wrong Expansion value. --- src/game/SharedDefines.h | 7 +++++++ src/game/World.cpp | 10 ++++++++-- src/shared/revision_nr.h | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 7f8fe3728..afe7890e2 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -2646,4 +2646,11 @@ enum PetTameFailureReason #define EXPECTED_MANGOSD_CLIENT_BUILD {10505, 0} +// max supported expansion level in mangosd +// NOTE: not set it more that supported by targeted client version with all expansions installed +// account with expansion > client supported will rejected at connection by client +// because if client receive unsupported expansion level it think +// that it not have expansion installed and reject +#define MAX_EXPANSION 2 + #endif diff --git a/src/game/World.cpp b/src/game/World.cpp index ad772bdf7..d17426252 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -897,12 +897,18 @@ void World::LoadConfigSettings(bool reload) if(reload) { - uint32 val = sConfig.GetIntDefault("Expansion",1); + uint32 val = sConfig.GetIntDefault("Expansion",MAX_EXPANSION); if(val!=m_configs[CONFIG_EXPANSION]) sLog.outError("Expansion option can't be changed at mangosd.conf reload, using current value (%u).",m_configs[CONFIG_EXPANSION]); } else - m_configs[CONFIG_EXPANSION] = sConfig.GetIntDefault("Expansion",1); + m_configs[CONFIG_EXPANSION] = sConfig.GetIntDefault("Expansion",MAX_EXPANSION); + + if(m_configs[CONFIG_EXPANSION] > MAX_EXPANSION) + { + sLog.outError("Expansion option can't be greater %u but set to %u, used %u",MAX_EXPANSION,m_configs[CONFIG_EXPANSION],MAX_EXPANSION); + m_configs[CONFIG_EXPANSION] = MAX_EXPANSION; + } m_configs[CONFIG_CHATFLOOD_MESSAGE_COUNT] = sConfig.GetIntDefault("ChatFlood.MessageCount",10); m_configs[CONFIG_CHATFLOOD_MESSAGE_DELAY] = sConfig.GetIntDefault("ChatFlood.MessageDelay",1); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e530e3d21..5967b91d9 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 "9049" + #define REVISION_NR "9050" #endif // __REVISION_NR_H__ From 0e42b1894680a406403cc97d2fb281e711cd8fc7 Mon Sep 17 00:00:00 2001 From: Insider Date: Wed, 23 Dec 2009 21:19:00 +0300 Subject: [PATCH 06/10] [9051] Fixed typo in [8959] (backported from commit eedbc3f) Signed-off-by: VladimirMangos --- src/game/SpellAuras.cpp | 3 +++ src/shared/revision_nr.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 990ce43b4..dbf976718 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -5899,6 +5899,7 @@ void Aura::HandleSpellSpecificBoosts(bool apply) } else return; + break; } case SPELLFAMILY_WARRIOR: { @@ -5922,6 +5923,7 @@ void Aura::HandleSpellSpecificBoosts(bool apply) break; } case SPELLFAMILY_WARLOCK: + { // Fear (non stacking) if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000040000000000)) { @@ -5956,6 +5958,7 @@ void Aura::HandleSpellSpecificBoosts(bool apply) else return; break; + } case SPELLFAMILY_PRIEST: { // Shadow Word: Pain (need visual check fro skip improvement talent) or Vampiric Touch diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 5967b91d9..17ef69ea5 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 "9050" + #define REVISION_NR "9051" #endif // __REVISION_NR_H__ From 391133cb8fa98d43b2068b06f4c2d1e371607837 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Thu, 24 Dec 2009 01:23:40 +0300 Subject: [PATCH 07/10] [9052] Fixed possible crash at fake items swap packet. --- src/game/Player.cpp | 19 +++++++++++++------ src/shared/revision_nr.h | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 968299f28..fdc8e9adf 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -11221,12 +11221,12 @@ void Player::SwapItem( uint16 src, uint16 dst ) Item *pSrcItem = GetItemByPos( srcbag, srcslot ); Item *pDstItem = GetItemByPos( dstbag, dstslot ); - if( !pSrcItem ) + if (!pSrcItem) return; sLog.outDebug( "STORAGE: SwapItem bag = %u, slot = %u, item = %u", dstbag, dstslot, pSrcItem->GetEntry()); - if(!isAlive() ) + if (!isAlive()) { SendEquipError( EQUIP_ERR_YOU_ARE_DEAD, pSrcItem, pDstItem ); return; @@ -11234,7 +11234,7 @@ void Player::SwapItem( uint16 src, uint16 dst ) // SRC checks - if(pSrcItem->m_lootGenerated) // prevent swap looting item + if (pSrcItem->m_lootGenerated) // prevent swap looting item { //best error message found for attempting to swap while looting SendEquipError( EQUIP_ERR_CANT_DO_RIGHT_NOW, pSrcItem, NULL ); @@ -11242,11 +11242,11 @@ void Player::SwapItem( uint16 src, uint16 dst ) } // check unequip potability for equipped items and bank bags - if(IsEquipmentPos ( src ) || IsBagPos ( src )) + if (IsEquipmentPos(src) || IsBagPos(src)) { // bags can be swapped with empty bag slots, or with empty bag (items move possibility checked later) uint8 msg = CanUnequipItem( src, !IsBagPos ( src ) || IsBagPos ( dst ) || (pDstItem && pDstItem->IsBag() && ((Bag*)pDstItem)->IsEmpty())); - if(msg != EQUIP_ERR_OK) + if (msg != EQUIP_ERR_OK) { SendEquipError( msg, pSrcItem, pDstItem ); return; @@ -11254,12 +11254,19 @@ void Player::SwapItem( uint16 src, uint16 dst ) } // prevent put equipped/bank bag in self - if( IsBagPos ( src ) && srcslot == dstbag) + if (IsBagPos(src) && srcslot == dstbag) { SendEquipError( EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pSrcItem, pDstItem ); return; } + // prevent put equipped/bank bag in self + if (IsBagPos(dst) && dstslot == srcbag) + { + SendEquipError( EQUIP_ERR_NONEMPTY_BAG_OVER_OTHER_BAG, pDstItem, pSrcItem ); + return; + } + // DST checks if (pDstItem) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 17ef69ea5..a0819017f 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 "9051" + #define REVISION_NR "9052" #endif // __REVISION_NR_H__ From 2a189d7275c49329afa54981a1075528555b2609 Mon Sep 17 00:00:00 2001 From: laise Date: Thu, 24 Dec 2009 02:37:29 +0300 Subject: [PATCH 08/10] [9053] Fxied some mage DoTs stacking. Signed-off-by: VladimirMangos --- src/game/SpellMgr.cpp | 10 ++++++++++ src/shared/revision_nr.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index bdcbf71c5..b361a2825 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -1454,6 +1454,16 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellInfo_2->SpellVisual[0] == 72 && spellInfo_2->SpellIconID == 1499) || (spellInfo_2->SpellFamilyFlags & UI64LIT(0x0000000000010000)) && (spellInfo_1->SpellVisual[0] == 72 && spellInfo_1->SpellIconID == 1499) ) return false; + + // Living Bomb & Ignite (Dots) + if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x2000000000000)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x8000000)) || + (spellInfo_2->SpellFamilyFlags & UI64LIT(0x2000000000000)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x8000000)) ) + return false; + + // Fireball & Pyroblast (Dots) + if( (spellInfo_1->SpellFamilyFlags & UI64LIT(0x1)) && (spellInfo_2->SpellFamilyFlags & UI64LIT(0x400000)) || + (spellInfo_2->SpellFamilyFlags & UI64LIT(0x1)) && (spellInfo_1->SpellFamilyFlags & UI64LIT(0x400000)) ) + return false; } // Detect Invisibility and Mana Shield (multi-family check) if( spellInfo_2->Id == 132 && spellInfo_1->SpellIconID == 209 && spellInfo_1->SpellVisual[0] == 968 ) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index a0819017f..32bd9e263 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 "9052" + #define REVISION_NR "9053" #endif // __REVISION_NR_H__ From ce26fcf4aa50bbc546f6bebb7689d4bbf5611e3e Mon Sep 17 00:00:00 2001 From: Astellar Date: Thu, 24 Dec 2009 03:23:41 +0300 Subject: [PATCH 09/10] [9054] Implement expire/dispell damage for spell 44457 and ranks. Signed-off-by: VladimirMangos --- src/game/SpellAuras.cpp | 10 ++++++++++ src/shared/revision_nr.h | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index dbf976718..057c4a84f 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2408,6 +2408,16 @@ void Aura::HandleAuraDummy(bool apply, bool Real) } } + // Living Bomb + if (m_spellProto->SpellFamilyName == SPELLFAMILY_MAGE && (m_spellProto->SpellFamilyFlags & UI64LIT(0x2000000000000))) + { + // Zero duration is equal to AURA_REMOVE_BY_DEFAULT. We can't use it directly, as it is set even + // when removing aura from one target due to casting Living Bomb at other. + if (m_duration == 0 || m_removeMode == AURA_REMOVE_BY_DISPEL) + m_target->CastSpell(m_target,m_modifier.m_amount,true,NULL,this); + return; + } + if (m_removeMode == AURA_REMOVE_BY_DEATH) { // Stop caster Arcane Missle chanelling on death diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 32bd9e263..fae8a050e 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 "9053" + #define REVISION_NR "9054" #endif // __REVISION_NR_H__ From bfca1ca7fa1042661b3e057908fbd9eff9b05ec6 Mon Sep 17 00:00:00 2001 From: tehmarto Date: Thu, 24 Dec 2009 04:48:16 +0300 Subject: [PATCH 10/10] [9055] Fixed charge amount for spell 64823 to expected 1 Signed-off-by: VladimirMangos --- src/game/SpellAuras.cpp | 1 + src/shared/revision_nr.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 057c4a84f..c0ca42eb7 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1391,6 +1391,7 @@ void Aura::HandleAddModifier(bool apply, bool Real) case 51124: // Killing Machine case 54741: // Firestarter case 57761: // Fireball! + case 64823: // Elune's Wrath (Balance druid t8 set SetAuraCharges(1); break; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index fae8a050e..343a65f99 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 "9054" + #define REVISION_NR "9055" #endif // __REVISION_NR_H__