From dfb3ca2611b3fd3acb6a1e61172fd10470e1c141 Mon Sep 17 00:00:00 2001 From: p0wer Date: Sun, 20 Dec 2009 18:18:20 -0600 Subject: [PATCH 1/7] Add missed change from rev6672. --HG-- branch : trunk --- src/game/SpellEffects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 66921aaa2f..3f3ce8e12f 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -534,7 +534,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) m_caster->CastCustomSpell(m_caster, 32409, &back_damage, 0, 0, true); } // Mind Blast - applies Mind Trauma if: - else if (m_spellInfo->SpellFamilyFlags & 0x2000) + else if (m_spellInfo->SpellFamilyFlags[0] & 0x2000) { // We are in Shadow Form if (m_caster->m_form == FORM_SHADOW) From 920c91941787f0935d46ae74a36dc1c2d8b620da Mon Sep 17 00:00:00 2001 From: Brian Date: Sun, 20 Dec 2009 21:56:38 -0700 Subject: [PATCH 2/7] * Some updates to the base class level stats * Thanks Malcrom --HG-- branch : trunk --- sql/6676_world_creature_classlevelstats.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sql/6676_world_creature_classlevelstats.sql diff --git a/sql/6676_world_creature_classlevelstats.sql b/sql/6676_world_creature_classlevelstats.sql new file mode 100644 index 0000000000..89a9260689 --- /dev/null +++ b/sql/6676_world_creature_classlevelstats.sql @@ -0,0 +1,8 @@ +UPDATE `creature_classlevelstats` SET `basehp`=3624 WHERE `exp`=0 AND `class`=1 AND `level`=66; +UPDATE `creature_classlevelstats` SET `basehp`=2899 WHERE `exp`=0 AND `class`=2 AND `level`=66; +UPDATE `creature_classlevelstats` SET `basehp`=3624 WHERE `exp`=0 AND `class`=4 AND `level`=66; +UPDATE `creature_classlevelstats` SET `basehp`=2537 WHERE `exp`=0 AND `class`=8 AND `level`=66; +UPDATE `creature_classlevelstats` SET `basehp`=4646 WHERE `exp`=0 AND `class`=2 AND `level`=83; +UPDATE `creature_classlevelstats` SET `basehp`=5808 WHERE `exp`=0 AND `class`=4 AND `level`=83; +UPDATE `creature_classlevelstats` SET `basehp`=4090 WHERE `exp`=0 AND `class`=8 AND `level`=83; +UPDATE `creature_classlevelstats` SET `basehp`=1 WHERE `basehp`=0; From e55710fc688af037938bf6ebc21ca24c0eb94547 Mon Sep 17 00:00:00 2001 From: Brian Date: Sun, 20 Dec 2009 22:15:24 -0700 Subject: [PATCH 3/7] * Massive cleanup of realmd * Patch by w12x -- THANK YOU! --HG-- branch : trunk --- src/trinityrealm/AuthCodes.h | 15 +++++++++++++-- src/trinityrealm/AuthSocket.cpp | 33 +++++++++++---------------------- src/trinityrealm/AuthSocket.h | 1 + src/trinityrealm/CMakeLists.txt | 1 + 4 files changed, 26 insertions(+), 24 deletions(-) diff --git a/src/trinityrealm/AuthCodes.h b/src/trinityrealm/AuthCodes.h index 53ae2236bc..e0bfcf96ce 100644 --- a/src/trinityrealm/AuthCodes.h +++ b/src/trinityrealm/AuthCodes.h @@ -72,8 +72,19 @@ enum LoginResult //2.4.3 build 8606 //3.1.3 build 9947 //3.1.3 build 10146 Chinese build -//3.2.2a build 10505 -#define EXPECTED_TRINITY_CLIENT_BUILD {10505, 10146, 9947, 8606, 5875, 6005, 0} +#define POST_BC_ACCEPTED_CLIENT_BUILD {10505, 10146, 9947, 8606, 0} +#define PRE_BC_ACCEPTED_CLIENT_BUILD {5875, 6005, 0} + +#define POST_BC_EXP_FLAG 0x2 +#define PRE_BC_EXP_FLAG 0x1 +#define NO_VALID_EXP_FLAG 0x0 + +namespace AuthHelper +{ + bool IsAcceptedClientBuild(int build); + bool IsPostBCAcceptedClientBuild(int build); + bool IsPreBCAcceptedClientBuild(int build); +}; #endif diff --git a/src/trinityrealm/AuthSocket.cpp b/src/trinityrealm/AuthSocket.cpp index bd79fc5d20..a19d16106f 100644 --- a/src/trinityrealm/AuthSocket.cpp +++ b/src/trinityrealm/AuthSocket.cpp @@ -379,6 +379,7 @@ bool AuthSocket::_HandleLogonChallenge() _login = (const char*)ch->I; _build = ch->build; + _expversion = (AuthHelper::IsPostBCAcceptedClientBuild(_build) ? POST_BC_EXP_FLAG : NO_VALID_EXP_FLAG) + (AuthHelper::IsPreBCAcceptedClientBuild(_build) ? PRE_BC_EXP_FLAG : NO_VALID_EXP_FLAG); ///- Normalize account name //utf8ToUpperOnlyLatin(_login); -- client already send account in expected form @@ -549,22 +550,10 @@ bool AuthSocket::_HandleLogonProof() sAuthLogonProof_C lp; ibuf.Read((char *)&lp, sizeof(sAuthLogonProof_C)); - ///- Check if the client has one of the expected version numbers - bool valid_version = false; - int accepted_versions[] = EXPECTED_TRINITY_CLIENT_BUILD; - for (int i = 0; accepted_versions[i]; ++i) - { - if (_build == accepted_versions[i]) - { - valid_version = true; - break; - } - } - ///
  • If the client has no valid version - if (!valid_version) + if (_expversion == NO_VALID_EXP_FLAG) { - ///- Check if we have the apropriate patch on the disk + ///- Check if we have the appropriate patch on the disk // 24 = len("./patches/65535enGB.mpq")+1 char tmp[24]; @@ -706,7 +695,7 @@ bool AuthSocket::_HandleLogonProof() sha.UpdateBigNumbers(&A, &M, &K, NULL); sha.Finalize(); - if (_build == 8606 || _build == 9947 || _build == 10146 || _build == 10505)//2.4.3, 3.1.3 and 3.2.2a clients (10146 is Chinese build for 3.1.3) + if (_expversion & POST_BC_EXP_FLAG)//2.4.3 and 3.1.3 clients (10146 is Chinese build for 3.1.3) { sAuthLogonProof_S proof; memcpy(proof.M2, sha.GetDigest(), 20); @@ -909,14 +898,14 @@ bool AuthSocket::_HandleRealmList() RealmList built_realmList; for (rlm = m_realmList.begin(); rlm != m_realmList.end(); ++rlm) { - if (_build == 8606 || _build == 9947 || _build == 10146 || _build == 10505)//2.4.3, 3.1.3 and 3.2.2a clients + if ( _expversion & POST_BC_EXP_FLAG )//2.4.3 and 3.1.3 cliens { if (rlm->second.gamebuild == _build) built_realmList.AddRealm(rlm->second); } - else if (_build == 5875 || _build == 6005)//1.12.1 and 1.12.2 clients are compatible with eachother + else if ( _expversion & PRE_BC_EXP_FLAG )//1.12.1 and 1.12.2 clients are compatible with eachother { - if (rlm->second.gamebuild == 5875 || rlm->second.gamebuild == 6005) + if ( AuthHelper::IsPreBCAcceptedClientBuild ( rlm->second.gamebuild ) ) built_realmList.AddRealm(rlm->second); } @@ -925,7 +914,7 @@ bool AuthSocket::_HandleRealmList() ///- Circle through realms in the RealmList and construct the return packet (including # of user characters in each realm) ByteBuffer pkt; pkt << (uint32) 0; - if (_build == 8606 || _build == 9947 || _build == 10146 || _build == 10505)//only 2.4.3, 3.1.3 and 3.2.2a clients + if ( _expversion & POST_BC_EXP_FLAG )//only 2.4.3 and 3.1.3 cliens pkt << (uint16) built_realmList.size(); else pkt << (uint32) built_realmList.size(); @@ -948,7 +937,7 @@ bool AuthSocket::_HandleRealmList() uint8 lock = (i->second.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0; pkt << i->second.icon; // realm type - if (i->second.gamebuild == 10505 || i->second.gamebuild == 9947 || i->second.gamebuild == 10146 || i->second.gamebuild == 8606)//only 2.4.3, 3.1.3 and 3.2.2a clients + if ( _expversion & POST_BC_EXP_FLAG )//only 2.4.3 and 3.1.3 cliens pkt << lock; // if 1, then realm locked pkt << i->second.color; // if 2, then realm is offline pkt << i->first; @@ -956,13 +945,13 @@ bool AuthSocket::_HandleRealmList() pkt << i->second.populationLevel; pkt << AmountOfCharacters; pkt << i->second.timezone; // realm category - if (i->second.gamebuild == 10505 || i->second.gamebuild == 9947 || i->second.gamebuild == 10146 || i->second.gamebuild == 8606)//2.4.3, 3.1.3 and 3.2.2a clients + if ( _expversion & POST_BC_EXP_FLAG )//2.4.3 and 3.1.3 clients pkt << (uint8) 0x2C; // unk, may be realm number/id? else pkt << (uint8) 0x0; //1.12.1 and 1.12.2 clients } - if (_build == 10505 || _build == 9947 || _build == 10146 || _build == 8606)//2.4.3, 3.1.3 and 3.2.2a clients + if ( _expversion & POST_BC_EXP_FLAG )//2.4.3 and 3.1.3 cliens { pkt << (uint8) 0x10; pkt << (uint8) 0x00; diff --git a/src/trinityrealm/AuthSocket.h b/src/trinityrealm/AuthSocket.h index ecfdd15900..474ead8659 100644 --- a/src/trinityrealm/AuthSocket.h +++ b/src/trinityrealm/AuthSocket.h @@ -79,6 +79,7 @@ class AuthSocket: public TcpSocket // between enUS and enGB, which is important for the patch system std::string _localizationName; uint16 _build; + uint8 _expversion; AccountTypes _accountSecurityLevel; }; #endif diff --git a/src/trinityrealm/CMakeLists.txt b/src/trinityrealm/CMakeLists.txt index 85c2120b5d..e39dc088e9 100644 --- a/src/trinityrealm/CMakeLists.txt +++ b/src/trinityrealm/CMakeLists.txt @@ -1,6 +1,7 @@ ########### next target ############### SET(trinity-realm_SRCS +AuthCodes.cpp AuthCodes.h AuthSocket.cpp AuthSocket.h From 34fe36ecac117c9e030949e19619575d9a688267 Mon Sep 17 00:00:00 2001 From: p0wer Date: Sun, 20 Dec 2009 18:51:10 -0600 Subject: [PATCH 4/7] Fix Preserved Holly. Patch by laise. Closes #822. --HG-- branch : trunk --- src/game/SpellAuras.cpp | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 74f438e563..73400d362c 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2979,6 +2979,10 @@ void AuraEffect::HandleAuraDummy(bool apply, bool Real, bool changeAmount) if(m_target->GetTypeId() == TYPEID_PLAYER) ((Player*)m_target)->RemoveAmmo(); // not use ammo and not allow use return; + case 62061: // Festive Holiday Mount + if(m_target->HasAuraType(SPELL_AURA_MOUNTED)) + m_target->CastSpell(m_target, 25860, true, NULL, this); // Reindeer Transformation + return; case 52916: // Honor Among Thieves if(m_target->GetTypeId() == TYPEID_PLAYER) if (Unit * target = ObjectAccessor::GetUnit(*m_target,((Player*)m_target)->GetComboTarget())) @@ -4438,12 +4442,19 @@ void AuraEffect::HandleAuraModIncreaseSpeed(bool apply, bool Real, bool changeAm m_target->UpdateSpeed(MOVE_RUN, true); } -void AuraEffect::HandleAuraModIncreaseMountedSpeed(bool /*apply*/, bool Real, bool changeAmount) +void AuraEffect::HandleAuraModIncreaseMountedSpeed(bool apply, bool Real, bool changeAmount) { // all applied/removed only at real aura add/remove if(!Real && !changeAmount) return; + if(apply) + { + // Festive Holiday Mount + if(m_target->HasAura(62061) && GetSpellProto()->SpellIconID != 1794) + m_target->CastSpell(m_target, 25860, true, NULL, this); // Reindeer Transformation + } + m_target->UpdateSpeed(MOVE_RUN, true); } @@ -4469,9 +4480,16 @@ void AuraEffect::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real, bool ch if (m_target->GetTypeId() == TYPEID_PLAYER) m_target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,MECHANIC_POLYMORPH,apply); - // Dragonmaw Illusion (overwrite mount model, mounted aura already applied) - if( apply && m_target->HasAuraEffect(42016,0) && m_target->GetMountID()) - m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314); + if(apply) + { + // Dragonmaw Illusion (overwrite mount model, mounted aura already applied) + if(m_target->HasAuraEffect(42016,0) && m_target->GetMountID()) + m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314); + + // Festive Holiday Mount + if(m_target->HasAura(62061) && GetSpellProto()->SpellIconID != 1794) + m_target->CastSpell(m_target, 25860, true, NULL, this); // Reindeer Transformation + } } m_target->UpdateSpeed(MOVE_FLIGHT, true); From 5ae3686d710784cab9fe4fd4ac6134ade607b707 Mon Sep 17 00:00:00 2001 From: p0wer Date: Sun, 20 Dec 2009 18:51:58 -0600 Subject: [PATCH 5/7] Fix whitespace. Sorry about that. --HG-- branch : trunk --- src/game/SpellAuras.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 73400d362c..8a1fba69b0 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2982,7 +2982,7 @@ void AuraEffect::HandleAuraDummy(bool apply, bool Real, bool changeAmount) case 62061: // Festive Holiday Mount if(m_target->HasAuraType(SPELL_AURA_MOUNTED)) m_target->CastSpell(m_target, 25860, true, NULL, this); // Reindeer Transformation - return; + return; case 52916: // Honor Among Thieves if(m_target->GetTypeId() == TYPEID_PLAYER) if (Unit * target = ObjectAccessor::GetUnit(*m_target,((Player*)m_target)->GetComboTarget())) From 85a89ab3017cf62575b1ad167a7eec4facade71d Mon Sep 17 00:00:00 2001 From: Brian Date: Sun, 20 Dec 2009 22:30:32 -0700 Subject: [PATCH 6/7] * Added missing file in rev 6678 AuthCodes.cpp --HG-- branch : trunk --- src/trinityrealm/AuthCodes.cpp | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/trinityrealm/AuthCodes.cpp diff --git a/src/trinityrealm/AuthCodes.cpp b/src/trinityrealm/AuthCodes.cpp new file mode 100644 index 0000000000..812949e082 --- /dev/null +++ b/src/trinityrealm/AuthCodes.cpp @@ -0,0 +1,37 @@ +#include "AuthCodes.h" + +namespace AuthHelper +{ + +bool IsPreBCAcceptedClientBuild(int build) +{ + int accepted_versions[] = PRE_BC_ACCEPTED_CLIENT_BUILD; + for (int i = 0; accepted_versions[i]; ++i) + { + if (build == accepted_versions[i]) + { + return true; + } + } + return false; +} + +bool IsPostBCAcceptedClientBuild(int build) +{ + int accepted_versions[] = POST_BC_ACCEPTED_CLIENT_BUILD; + for (int i = 0; accepted_versions[i]; ++i) + { + if (build == accepted_versions[i]) + { + return true; + } + } + return false; +} + +bool IsAcceptedClientBuild(int build) +{ + return (IsPostBCAcceptedClientBuild(build) || IsPreBCAcceptedClientBuild(build)); +} + +}; From 0e8dd6d97e015340f3f1ccb7be30d9f0c22b46bb Mon Sep 17 00:00:00 2001 From: p0wer Date: Sun, 20 Dec 2009 19:02:21 -0600 Subject: [PATCH 7/7] Fix Replenishment to apply 1% every 5 seconds rather then 4. Thanks to Morpheux for pointing it out. --HG-- branch : trunk --- src/game/SpellAuras.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 8a1fba69b0..04a79e2963 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1536,7 +1536,7 @@ void AuraEffect::HandleAuraEffectSpecificMods(bool apply, bool Real, bool change // Replenishment (0.25% from max) // Infinite Replenishment if (m_spellProto->SpellIconID == 3184 && m_spellProto->SpellVisual[0] == 12495 && GetAuraName() == SPELL_AURA_PERIODIC_ENERGIZE) - m_amount = m_target->GetMaxPower(POWER_MANA) * 25 / 10000; + m_amount = m_target->GetMaxPower(POWER_MANA) * 20 / 10000; break; case SPELLFAMILY_MAGE: // Mana Shield