From 3fbc1c95f9bf4c50703e0b3a69f66e8e1e398bc0 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Fri, 18 Dec 2009 00:14:41 +0300 Subject: [PATCH 01/11] [9016] Add missing value for recently aded field in `realmd.sql --- sql/realmd.sql | 2 +- src/shared/revision_nr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/realmd.sql b/sql/realmd.sql index 03f604064..267b882db 100644 --- a/sql/realmd.sql +++ b/sql/realmd.sql @@ -173,7 +173,7 @@ CREATE TABLE `realmlist` ( LOCK TABLES `realmlist` WRITE; /*!40000 ALTER TABLE `realmlist` DISABLE KEYS */; INSERT INTO `realmlist` VALUES -(1,'MaNGOS','127.0.0.1',8085,1,0,1,0,0); +(1,'MaNGOS','127.0.0.1',8085,1,0,1,0,0,''); /*!40000 ALTER TABLE `realmlist` ENABLE KEYS */; UNLOCK TABLES; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f05350f6f..b0b1ae192 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 "9015" + #define REVISION_NR "9016" #endif // __REVISION_NR_H__ From cccb85dbe20a8177817bf733c0d80cde26316599 Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Thu, 17 Dec 2009 22:35:22 +0100 Subject: [PATCH 02/11] [9017] Fix typo in GO gossipID check for type 10 Signed-off-by: NoFantasy --- src/game/GameObject.cpp | 5 ++--- src/shared/revision_nr.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index e8aa32b67..fa5ada1aa 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -951,14 +951,13 @@ void GameObject::Use(Unit* user) { Player* player = (Player*)user; - // show page - if (info->goober.pageId) + if (info->goober.pageId) // show page... { WorldPacket data(SMSG_GAMEOBJECT_PAGETEXT, 8); data << GetGUID(); player->GetSession()->SendPacket(&data); } - else if (info->questgiver.gossipID) + else if (info->goober.gossipID) // ...or gossip, if page does not exist { player->PrepareGossipMenu(this, info->goober.gossipID); player->SendPreparedGossip(this); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index b0b1ae192..cc0ad5ed1 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 "9016" + #define REVISION_NR "9017" #endif // __REVISION_NR_H__ From 393ab4a7cad3833e7793aa37741cd82468325881 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Fri, 18 Dec 2009 03:01:03 +0300 Subject: [PATCH 03/11] [9018] Implement aditional form specific bonus for 16857. SQL data prepered by MrLama. Signed-off-by: VladimirMangos --- sql/mangos.sql | 3 ++- sql/updates/9018_01_mangos_spell_bonus_data.sql | 5 +++++ sql/updates/Makefile.am | 2 ++ src/game/Spell.cpp | 7 +++++++ src/shared/revision_nr.h | 2 +- src/shared/revision_sql.h | 2 +- 6 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 sql/updates/9018_01_mangos_spell_bonus_data.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index bfcacd221..aae268e12 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -24,7 +24,7 @@ CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, `cache_id` int(10) default '0', - `required_9015_01_mangos_spell_bonus_data` bit(1) default NULL + `required_9018_01_mangos_spell_bonus_data` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -14036,6 +14036,7 @@ INSERT INTO `spell_bonus_data` VALUES /* Druid */ (5185, 1.6104, 0, 0, 'Druid - Healing Touch'), (339, 0, 0.1, 0, 'Druid - Entangling Roots'), +(60089, 0, 0, 0.05, 'Druid - Faerie Fire (Feral) Triggered'), (42231, 0.12898,0, 0, 'Druid - Hurricane Triggered'), (5570, 0, 0.2, 0, 'Druid - Insect Swarm'), (33763, 0, 0.09518, 0, 'Druid - Lifebloom'), diff --git a/sql/updates/9018_01_mangos_spell_bonus_data.sql b/sql/updates/9018_01_mangos_spell_bonus_data.sql new file mode 100644 index 000000000..a1cd63a0e --- /dev/null +++ b/sql/updates/9018_01_mangos_spell_bonus_data.sql @@ -0,0 +1,5 @@ +ALTER TABLE db_version CHANGE COLUMN required_9015_01_mangos_spell_bonus_data required_9018_01_mangos_spell_bonus_data bit; + +DELETE FROM spell_bonus_data WHERE entry = 60089; +INSERT INTO spell_bonus_data VALUES +(60089,0,0,0.05,'Druid - Faerie Fire (Feral) Triggered'); diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index a6ba8b72d..6ccc1d03d 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -213,6 +213,7 @@ pkgdata_DATA = \ 9007_01_mangos_spell_proc_event.sql \ 9010_01_realmd_realmlist.sql \ 9015_01_mangos_spell_bonus_data.sql \ + 9018_01_mangos_spell_bonus_data.sql \ README ## Additional files to include when running 'make dist' @@ -406,4 +407,5 @@ EXTRA_DIST = \ 9007_01_mangos_spell_proc_event.sql \ 9010_01_realmd_realmlist.sql \ 9015_01_mangos_spell_bonus_data.sql \ + 9018_01_mangos_spell_bonus_data.sql \ README diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 350eb4030..101c7b7c5 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2525,6 +2525,13 @@ void Spell::cast(bool skipCheck) } break; } + case SPELLFAMILY_DRUID: + { + // Faerie Fire (Feral) + if (m_spellInfo->Id == 16857 && m_caster->m_form != FORM_CAT) + AddTriggeredSpell(60089); + break; + } case SPELLFAMILY_ROGUE: // Fan of Knives (main hand) if (m_spellInfo->Id == 51723 && m_caster->GetTypeId() == TYPEID_PLAYER && diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index cc0ad5ed1..be2f9a893 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 "9017" + #define REVISION_NR "9018" #endif // __REVISION_NR_H__ diff --git a/src/shared/revision_sql.h b/src/shared/revision_sql.h index 168dbac0b..9a3c03faa 100644 --- a/src/shared/revision_sql.h +++ b/src/shared/revision_sql.h @@ -1,6 +1,6 @@ #ifndef __REVISION_SQL_H__ #define __REVISION_SQL_H__ #define REVISION_DB_CHARACTERS "required_8874_01_characters_character_skills" - #define REVISION_DB_MANGOS "required_9015_01_mangos_spell_bonus_data" + #define REVISION_DB_MANGOS "required_9018_01_mangos_spell_bonus_data" #define REVISION_DB_REALMD "required_9010_01_realmd_realmlist" #endif // __REVISION_SQL_H__ From cc9072c89f90fa7c6f6cb9e5485c4536b3696edc Mon Sep 17 00:00:00 2001 From: Seizer Date: Fri, 18 Dec 2009 04:11:43 +0300 Subject: [PATCH 04/11] [9019] Add/update some hidden threat values for warrior/druid spells. Signed-off-by: VladimirMangos --- sql/mangos.sql | 67 ++++++++++-- sql/updates/9019_01_mangos_spell_threat.sql | 108 ++++++++++++++++++++ sql/updates/Makefile.am | 2 + src/shared/revision_nr.h | 2 +- src/shared/revision_sql.h | 2 +- 5 files changed, 170 insertions(+), 11 deletions(-) create mode 100644 sql/updates/9019_01_mangos_spell_threat.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index aae268e12..c295bed31 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -24,7 +24,7 @@ CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, `cache_id` int(10) default '0', - `required_9018_01_mangos_spell_bonus_data` bit(1) default NULL + `required_9019_01_mangos_spell_threat` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -18647,18 +18647,33 @@ CREATE TABLE `spell_threat` ( LOCK TABLES `spell_threat` WRITE; /*!40000 ALTER TABLE `spell_threat` DISABLE KEYS */; INSERT INTO `spell_threat` VALUES +(72,293), (78,20), +(99,42), (284,39), (285,59), +(469,40), +(676,104), (770,108), +(845,10), +(1160,16), (1608,78), (1672,180), (1715,61), +(1735,42), +(2048,70), (2139,300), +(5242,26), +(6190,26), +(6192,32), (6343,17), (6572,155), +(6673,18), (6574,195), -(6809,89), +(6807,322), +(6808,322), +(6809,322), +(7369,40), (7372,101), (7373,141), (7379,235), @@ -18666,10 +18681,18 @@ INSERT INTO `spell_threat` VALUES (8198,40), (8204,64), (8205,96), -(8972,118), -(9745,148), -(9880,178), -(9881,207), +(8972,322), +(9490,42), +(9745,322), +(9747,42), +(9880,322), +(9881,322), +(9898,42), +(11549,40), +(11550,48), +(11551,56), +(11554,30), +(11555,37), (11556,43), (11564,98), (11565,118), @@ -18679,6 +18702,8 @@ INSERT INTO `spell_threat` VALUES (11581,180), (11600,275), (11601,315), +(11608,60), +(11609,70), (11775,395), (14921,415), (16857,108), @@ -18697,14 +18722,17 @@ INSERT INTO `spell_threat` VALUES (23925,250), (24394,580), (24583,5), +(25202,50), +(25203,55), (25231,130), (25258,286), (25264,215), (25269,400), (25286,175), (25288,355), -(25289,60), -(26996,176), +(25289,62), +(26996,322), +(26998,42), (27179,54), (29704,230), (29707,196), @@ -18714,7 +18742,28 @@ INSERT INTO `spell_threat` VALUES (33745,285), (33878,129), (33986,180), -(33987,232); +(33987,232), +(47436,78), +(47437,63), +(47439,60), +(47440,80), +(47449,236), +(47450,259), +(47487,520), +(47488,770), +(47497,101), +(47498,101), +(47501,235), +(47502,260), +(47519,180), +(47520,225), +(48479,322), +(48480,322), +(48559,42), +(48560,42), +(48567,285), +(48568,285), +(57823,500); /*!40000 ALTER TABLE `spell_threat` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/updates/9019_01_mangos_spell_threat.sql b/sql/updates/9019_01_mangos_spell_threat.sql new file mode 100644 index 000000000..cb8ccb7da --- /dev/null +++ b/sql/updates/9019_01_mangos_spell_threat.sql @@ -0,0 +1,108 @@ +ALTER TABLE db_version CHANGE COLUMN required_9018_01_mangos_spell_bonus_data required_9019_01_mangos_spell_threat bit; + +DELETE FROM spell_threat WHERE entry IN ( +-- Battle Shout +6673, 5242, 6192, 11549, 11550, 11551, 25289, 2048, 47436, +-- Commanding Shout +469, 47439, 47440, +-- Demoralizing Shout +1160, 6190, 11554, 11555, 11556, 25202, 25203, 47437, +-- Cleave +845, 7369, 11608, 11609, 20569, 25231, 47519, 47520, +-- Devastate +47497, 47498, +-- Disarm +676, +-- Heroic Strike +47450, 47449, +-- Revenge +57823, +-- Shield Bash +72, +-- Shield Slam +47488, 47487, +-- Sunder Armor (remove only) +47467, 25225, 11597, 11596, 8380, 7405, +-- Thunder Clap +47502, 47501, +-- Maul +6807, 6808, 6809, 8972, 9745, 9880, 9881, 26996, 48479, 48480, +-- Demoralizing Roar +99, 1735, 9490, 9747, 9898, 26998, 48559, 48560, +-- Lacerate +48567, 48568); + +INSERT INTO spell_threat VALUES +-- Battle Shout +(6673, 18), +(5242, 26), +(6192, 32), +(11549, 40), +(11550, 48), +(11551, 56), +(25289, 62), +(2048, 70), +(47436, 78), +-- Commanding Shout +(469, 40), +(47439, 60), +(47440, 80), +-- Demoralizing Shout +(1160, 16), +(6190, 26), +(11554, 30), +(11555, 37), +(11556, 43), +(25202, 50), +(25203, 55), +(47437, 63), +-- Cleave +(845, 10), +(7369, 40), +(11608, 60), +(11609, 70), +(20569,100), +(25231,130), +(47519, 180), +(47520, 225), +-- Devastate +(47497, 101), +(47498, 101), +-- Disarm +(676, 104), +-- Heroic Strike +(47450, 259), +(47449, 236), +-- Revenge +(57823, 500), +-- Shield Bash +(72, 293), +-- Shield Slam +(47488, 770), +(47487, 520), +-- Thunder Clap +(47502, 260), +(47501, 235), +-- Maul +(6807, 322), +(6808, 322), +(6809, 322), +(8972, 322), +(9745, 322), +(9880, 322), +(9881, 322), +(26996, 322), +(48479, 322), +(48480, 322), +-- Demoralizing Roar +(99, 42), +(1735, 42), +(9490, 42), +(9747, 42), +(9898, 42), +(26998, 42), +(48559, 42), +(48560, 42), +-- Lacerate +(48567, 285), +(48568, 285); diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 6ccc1d03d..67f836c4e 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -214,6 +214,7 @@ pkgdata_DATA = \ 9010_01_realmd_realmlist.sql \ 9015_01_mangos_spell_bonus_data.sql \ 9018_01_mangos_spell_bonus_data.sql \ + 9019_01_mangos_spell_threat.sql \ README ## Additional files to include when running 'make dist' @@ -408,4 +409,5 @@ EXTRA_DIST = \ 9010_01_realmd_realmlist.sql \ 9015_01_mangos_spell_bonus_data.sql \ 9018_01_mangos_spell_bonus_data.sql \ + 9019_01_mangos_spell_threat.sql \ README diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index be2f9a893..9ef3be525 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 "9018" + #define REVISION_NR "9019" #endif // __REVISION_NR_H__ diff --git a/src/shared/revision_sql.h b/src/shared/revision_sql.h index 9a3c03faa..1ffd23c72 100644 --- a/src/shared/revision_sql.h +++ b/src/shared/revision_sql.h @@ -1,6 +1,6 @@ #ifndef __REVISION_SQL_H__ #define __REVISION_SQL_H__ #define REVISION_DB_CHARACTERS "required_8874_01_characters_character_skills" - #define REVISION_DB_MANGOS "required_9018_01_mangos_spell_bonus_data" + #define REVISION_DB_MANGOS "required_9019_01_mangos_spell_threat" #define REVISION_DB_REALMD "required_9010_01_realmd_realmlist" #endif // __REVISION_SQL_H__ From 6b78ed534df4e5089906663311cacaf3cec27c4d Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Fri, 18 Dec 2009 06:11:00 +0300 Subject: [PATCH 05/11] [9020] Re-implement 1680 (and triggred spell for 46924) in less hack way. --- src/game/Spell.cpp | 12 +++++++----- src/game/SpellEffects.cpp | 8 +------- src/shared/revision_nr.h | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 101c7b7c5..827152b42 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -581,11 +581,13 @@ void Spell::FillTargetMap() SetTargetMap(i, m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap); } break; + case 0: + SetTargetMap(i, m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap); + tmpUnitMap.push_back(m_caster); + break; default: - { - SetTargetMap(i, m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap); - SetTargetMap(i, m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap); - } + SetTargetMap(i, m_spellInfo->EffectImplicitTargetA[i], tmpUnitMap); + SetTargetMap(i, m_spellInfo->EffectImplicitTargetB[i], tmpUnitMap); break; } break; @@ -1304,7 +1306,7 @@ void Spell::SetTargetMap(uint32 effIndex,uint32 targetMode,UnitList& TagUnitMap) { case SPELLFAMILY_DRUID: // Starfall - if (m_spellInfo->SpellFamilyFlags2 & UI64LIT(0x00000100)) + if (m_spellInfo->SpellFamilyFlags2 & 0x00000100) unMaxTargets = 2; break; default: diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 1bdd7b04e..2172a0b74 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -4580,14 +4580,8 @@ void Spell::EffectWeaponDmg(uint32 i) { case SPELLFAMILY_WARRIOR: { - // Whirlwind, single only spell with 2 weapon white damage apply if have - if(m_caster->GetTypeId()==TYPEID_PLAYER && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x00000400000000))) - { - if(((Player*)m_caster)->GetWeaponForAttack(OFF_ATTACK, true, true)) - spell_bonus += m_caster->CalculateDamage (OFF_ATTACK, normalized); - } // Devastate bonus and sunder armor refresh - else if(m_spellInfo->SpellVisual[0] == 12295 && m_spellInfo->SpellIconID == 1508) + if(m_spellInfo->SpellVisual[0] == 12295 && m_spellInfo->SpellIconID == 1508) { uint32 stack = 0; // Need refresh all Sunder Armor auras from this caster diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 9ef3be525..e01b5e6a0 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 "9019" + #define REVISION_NR "9020" #endif // __REVISION_NR_H__ From a8d4254d33db2acc6517bbbd199644601111541e Mon Sep 17 00:00:00 2001 From: laise Date: Fri, 18 Dec 2009 22:23:45 +0300 Subject: [PATCH 06/11] [9021] Implement item 21213 effect work. Signed-off-by: VladimirMangos --- src/game/SpellAuras.cpp | 24 ++++++++++++++++++++---- src/shared/revision_nr.h | 2 +- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 8ee935d0d..6ab53198f 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -2273,9 +2273,15 @@ void Aura::HandleAuraDummy(bool apply, bool Real) } } return; - case 46699: // Requires No Ammo - if(m_target->GetTypeId() == TYPEID_PLAYER) - ((Player*)m_target)->RemoveAmmo(); // not use ammo and not allow use + case 46699: // Requires No Ammo + if (m_target->GetTypeId() == TYPEID_PLAYER) + // not use ammo and not allow use + ((Player*)m_target)->RemoveAmmo(); + return; + case 62061: // Festive Holiday Mount + if (m_target->HasAuraType(SPELL_AURA_MOUNTED)) + // Reindeer Transformation + m_target->CastSpell(m_target, 25860, true, NULL, this); return; } break; @@ -4252,13 +4258,18 @@ void Aura::HandleAuraModIncreaseSpeed(bool /*apply*/, bool Real) m_target->UpdateSpeed(MOVE_RUN, true); } -void Aura::HandleAuraModIncreaseMountedSpeed(bool /*apply*/, bool Real) +void Aura::HandleAuraModIncreaseMountedSpeed(bool apply, bool Real) { // all applied/removed only at real aura add/remove if(!Real) return; m_target->UpdateSpeed(MOVE_RUN, true); + + // Festive Holiday Mount + if (apply && GetSpellProto()->SpellIconID != 1794 && m_target->HasAura(62061)) + // Reindeer Transformation + m_target->CastSpell(m_target, 25860, true, NULL, this); } void Aura::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real) @@ -4286,6 +4297,11 @@ void Aura::HandleAuraModIncreaseFlightSpeed(bool apply, bool Real) // Dragonmaw Illusion (overwrite mount model, mounted aura already applied) if( apply && m_target->HasAura(42016,0) && m_target->GetMountID()) m_target->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID,16314); + + // Festive Holiday Mount + if (apply && GetSpellProto()->SpellIconID != 1794 && m_target->HasAura(62061)) + // Reindeer Transformation + m_target->CastSpell(m_target, 25860, true, NULL, this); } m_target->UpdateSpeed(MOVE_FLIGHT, true); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e01b5e6a0..bd35fe739 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 "9020" + #define REVISION_NR "9021" #endif // __REVISION_NR_H__ From b95e3046c0ea990fec9d117f0c2a7bdd611aa102 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sat, 19 Dec 2009 01:29:10 +0300 Subject: [PATCH 07/11] [9022] Fixed small typo in creature_template.difficulty_entry_N checks. --- src/game/ObjectMgr.cpp | 2 +- src/shared/revision_nr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 03046b2a1..476de5f6b 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -504,7 +504,7 @@ void ObjectMgr::LoadCreatureTemplates() if (difficultyEntries[diff].find(i) != difficultyEntries[diff].end()) { - sLog.outErrorDb("Creature (Entry: %u) listed as difficulty %u but have value in `difficulty_entry_1`.", i, diff + 1); + sLog.outErrorDb("Creature (Entry: %u) listed as difficulty %u but have value in `difficulty_entry_%u`.", i, diff + 1, diff + 1); continue; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index bd35fe739..364244d1d 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 "9021" + #define REVISION_NR "9022" #endif // __REVISION_NR_H__ From 29a096a348789686bc07fb250dd90085b150e87a Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sat, 19 Dec 2009 02:40:10 +0300 Subject: [PATCH 08/11] [9023] Fixed some hunter sting affects. * spell 1978 and ranks RAP bonus * spell 53209 affect from spell 3034 dot. --- src/game/SpellAuras.cpp | 4 ++-- src/game/SpellEffects.cpp | 24 ++++++++++++++++++++---- src/shared/revision_nr.h | 2 +- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 6ab53198f..3a19b613f 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -4788,8 +4788,8 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real) // Serpent Sting if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000004000)) { - // $RAP*0.1/5 bonus per tick - m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 10 / 500); + // $RAP*0.2/5 bonus per tick + m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(RANGED_ATTACK) * 0.2 / 5); return; } // Immolation Trap diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 2172a0b74..a652b6060 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -5458,19 +5458,35 @@ void Spell::EffectScriptEffect(uint32 effIndex) // Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting. if ((familyFlag & UI64LIT(0x0000000000004000)) && aura->GetEffIndex() == 0) { - spellId = 53353; // 53353 Chimera Shot - Serpent + // m_amount already include RAP bonus basePoint = aura->GetModifier()->m_amount * 5 * 40 / 100; + spellId = 53353; // Chimera Shot - Serpent } // Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting. if ((familyFlag & UI64LIT(0x0000008000000000)) && aura->GetEffIndex() == 0) { - spellId = 53358; // 53358 Chimera Shot - Viper - basePoint = aura->GetModifier()->m_amount * 4 * 60 / 100; + uint32 target_max_mana = unitTarget->GetMaxPower(POWER_MANA); + if (!target_max_mana) + continue; + + // ignore non positive values (can be result apply spellmods to aura damage + uint32 pdamage = aura->GetModifier()->m_amount > 0 ? aura->GetModifier()->m_amount : 0; + + // Special case: draining x% of mana (up to a maximum of 2*x% of the caster's maximum mana) + uint32 maxmana = m_caster->GetMaxPower(POWER_MANA) * pdamage * 2 / 100; + + pdamage = target_max_mana * pdamage / 100; + if (pdamage > maxmana) + pdamage = maxmana; + + pdamage *= 4; // total aura damage + basePoint = pdamage * 60 / 100; + spellId = 53358; // Chimera Shot - Viper target = m_caster; } // Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute. if (familyFlag & UI64LIT(0x0000000000008000)) - spellId = 53359; // 53359 Chimera Shot - Scorpid + spellId = 53359; // Chimera Shot - Scorpid // ?? nothing say in spell desc (possibly need addition check) //if ((familyFlag & UI64LIT(0x0000010000000000)) || // dot // (familyFlag & UI64LIT(0x0000100000000000))) // stun diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 364244d1d..5ff3b54bd 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 "9022" + #define REVISION_NR "9023" #endif // __REVISION_NR_H__ From aeaa5026f5204c7ccae87c6e86c28ec7544836a9 Mon Sep 17 00:00:00 2001 From: fisherman Date: Sat, 19 Dec 2009 04:15:46 +0300 Subject: [PATCH 09/11] [9024] Fixed RAP bonus percent for spell 56641 and ranks. Signed-off-by: VladimirMangos --- src/game/SpellEffects.cpp | 2 +- src/shared/revision_nr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index a652b6060..e61ba6462 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -630,7 +630,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx) else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x100000000)) { int32 base = irand((int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MINDAMAGE),(int32)m_caster->GetWeaponDamageRange(RANGED_ATTACK, MAXDAMAGE)); - damage += int32(float(base)/m_caster->GetAttackTime(RANGED_ATTACK)*2800 + m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.2f); + damage += int32(float(base)/m_caster->GetAttackTime(RANGED_ATTACK)*2800 + m_caster->GetTotalAttackPowerValue(RANGED_ATTACK)*0.1f); } // Explosive Trap Effect else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x00000004)) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 5ff3b54bd..9fb4ae76a 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 "9023" + #define REVISION_NR "9024" #endif // __REVISION_NR_H__ From 0c636c6e3eb3850ee442df61b04b2df423ea6841 Mon Sep 17 00:00:00 2001 From: laise Date: Sat, 19 Dec 2009 06:24:58 +0300 Subject: [PATCH 10/11] [9025] Implement talent 63373 and ranks. Idea with AddTriggeredSpell use suggested by darkstalker. Signed-off-by: VladimirMangos --- sql/mangos.sql | 3 ++- .../9025_01_mangos_spell_proc_event.sql | 5 +++++ sql/updates/Makefile.am | 2 ++ src/game/Unit.cpp | 20 ++++++++++++++++++- src/shared/revision_nr.h | 2 +- src/shared/revision_sql.h | 2 +- 6 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 sql/updates/9025_01_mangos_spell_proc_event.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index c295bed31..119f2ad9a 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -24,7 +24,7 @@ CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, `cache_id` int(10) default '0', - `required_9019_01_mangos_spell_threat` bit(1) default NULL + `required_9025_01_mangos_spell_proc_event` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -18521,6 +18521,7 @@ INSERT INTO `spell_proc_event` VALUES (63156, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (63245, 0x00000000, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (63320, 0x00000000, 5, 0x00040000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(63373, 0x00000000, 11, 0x80000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0), (63534, 0x00000000, 6, 0x00000040, 0x00000000, 0x00000000, 0x00004000, 0x00000000, 0.000000, 0.000000, 0), (63625, 0x00000000, 6, 0x02000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0), (63730, 0x00000000, 6, 0x00000800, 0x00000004, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), diff --git a/sql/updates/9025_01_mangos_spell_proc_event.sql b/sql/updates/9025_01_mangos_spell_proc_event.sql new file mode 100644 index 000000000..f374ad94c --- /dev/null +++ b/sql/updates/9025_01_mangos_spell_proc_event.sql @@ -0,0 +1,5 @@ +ALTER TABLE db_version CHANGE COLUMN required_9019_01_mangos_spell_threat required_9025_01_mangos_spell_proc_event bit; + +DELETE FROM `spell_proc_event` WHERE `entry` = 63373; +INSERT INTO `spell_proc_event` VALUES +(63373, 0x00000000,11, 0x80000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0.000000, 0.000000, 0); diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 67f836c4e..02ea4d4f8 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -215,6 +215,7 @@ pkgdata_DATA = \ 9015_01_mangos_spell_bonus_data.sql \ 9018_01_mangos_spell_bonus_data.sql \ 9019_01_mangos_spell_threat.sql \ + 9025_01_mangos_spell_proc_event.sql \ README ## Additional files to include when running 'make dist' @@ -410,4 +411,5 @@ EXTRA_DIST = \ 9015_01_mangos_spell_bonus_data.sql \ 9018_01_mangos_spell_bonus_data.sql \ 9019_01_mangos_spell_threat.sql \ + 9025_01_mangos_spell_proc_event.sql \ README diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index b1a5d84d2..7fc7db742 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -6594,7 +6594,25 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, Aura* triggeredByAu } } return false; - break; + } + // Frozen Power + if (dummySpell->SpellIconID == 3780) + { + Unit *caster = triggeredByAura->GetCaster(); + + if (!procSpell || !caster) + return false; + + float distance = caster->GetDistance(pVictim); + int32 chance = triggerAmount; + + if (distance < 15.0f || !roll_chance_i(chance)) + return false; + + // make triggered cast apply after current damage spell processing for prevent remove by it + if(Spell* spell = GetCurrentSpell(CURRENT_GENERIC_SPELL)) + spell->AddTriggeredSpell(63685); + return true; } break; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 9fb4ae76a..b7694a31f 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 "9024" + #define REVISION_NR "9025" #endif // __REVISION_NR_H__ diff --git a/src/shared/revision_sql.h b/src/shared/revision_sql.h index 1ffd23c72..51acf44ec 100644 --- a/src/shared/revision_sql.h +++ b/src/shared/revision_sql.h @@ -1,6 +1,6 @@ #ifndef __REVISION_SQL_H__ #define __REVISION_SQL_H__ #define REVISION_DB_CHARACTERS "required_8874_01_characters_character_skills" - #define REVISION_DB_MANGOS "required_9019_01_mangos_spell_threat" + #define REVISION_DB_MANGOS "required_9025_01_mangos_spell_proc_event" #define REVISION_DB_REALMD "required_9010_01_realmd_realmlist" #endif // __REVISION_SQL_H__ From 9b6900b9a3c495e87825b257741e0c77337113ab Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sat, 19 Dec 2009 18:00:48 +0300 Subject: [PATCH 11/11] [9026] Implement ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT. This achievement criteria requirement type let set in table `achievement_criteria_requirement` that specific criteria id for achievmenet connected with some instance must be checked by new InstanceData call bool CheckAchievementCriteriaMeet(uint32 criteria_id,Player const* source, Unit const* target, uint32 miscvalue1) It expected to be used for cases: kill boss without raid members death or for some limited time or without kill before some other boss helpers and etc. Implementation expected base at collection some data/counters update in instance data at specific event and then make check by query and retunr success for specific criteri or fail requirements. --- src/game/AchievementMgr.cpp | 20 ++++++++++++++++---- src/game/AchievementMgr.h | 8 ++++++-- src/game/InstanceData.h | 7 +++++++ src/shared/revision_nr.h | 2 +- 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index 1a4a55412..9fe0c1e9a 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -35,6 +35,8 @@ #include "MapManager.h" #include "BattleGround.h" #include "BattleGroundAB.h" +#include "Map.h" +#include "InstanceData.h" #include "Policies/SingletonImp.h" @@ -102,6 +104,8 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri case ACHIEVEMENT_CRITERIA_REQUIRE_NONE: case ACHIEVEMENT_CRITERIA_REQUIRE_VALUE: case ACHIEVEMENT_CRITERIA_REQUIRE_DISABLED: + case ACHIEVEMENT_CRITERIA_REQUIRE_BG_LOSS_TEAM_SCORE: + case ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT: return true; case ACHIEVEMENT_CRITERIA_REQUIRE_T_CREATURE: if (!creature.id || !ObjectMgr::GetCreatureTemplate(creature.id)) @@ -235,8 +239,6 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri return false; } return true; - case ACHIEVEMENT_CRITERIA_REQUIRE_BG_LOSS_TEAM_SCORE: - return true; // not check correctness node indexes default: sLog.outErrorDb( "Table `achievement_criteria_requirement` (Entry: %u Type: %u) have data for not supported data type (%u), ignore.", criteria->ID, criteria->requiredType,requirementType); return false; @@ -244,7 +246,7 @@ bool AchievementCriteriaRequirement::IsValid(AchievementCriteriaEntry const* cri return false; } -bool AchievementCriteriaRequirement::Meets(Player const* source, Unit const* target, uint32 miscvalue1 /*= 0*/) const +bool AchievementCriteriaRequirement::Meets(uint32 criteria_id, Player const* source, Unit const* target, uint32 miscvalue1 /*= 0*/) const { switch(requirementType) { @@ -312,6 +314,16 @@ bool AchievementCriteriaRequirement::Meets(Player const* source, Unit const* tar return false; return bg->IsTeamScoreInRange(source->GetTeam()==ALLIANCE ? HORDE : ALLIANCE,bg_loss_team_score.min_score,bg_loss_team_score.max_score); } + case ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT: + if (!source->IsInWorld()) + return false; + Map* map = source->GetMap(); + if (!map->Instanceable()) + return false; + InstanceData* data = ((InstanceMap*)map)->GetInstanceData(); + if (!data) + return false; + return data->CheckAchievementCriteriaMeet(criteria_id, source, target, miscvalue1); } return false; } @@ -319,7 +331,7 @@ bool AchievementCriteriaRequirement::Meets(Player const* source, Unit const* tar bool AchievementCriteriaRequirementSet::Meets(Player const* source, Unit const* target, uint32 miscvalue /*= 0*/) const { for(Storage::const_iterator itr = storage.begin(); itr != storage.end(); ++itr) - if(!itr->Meets(source,target,miscvalue)) + if(!itr->Meets(criteria_id, source, target, miscvalue)) return false; return true; diff --git a/src/game/AchievementMgr.h b/src/game/AchievementMgr.h index b13441194..be071a279 100644 --- a/src/game/AchievementMgr.h +++ b/src/game/AchievementMgr.h @@ -60,9 +60,10 @@ enum AchievementCriteriaRequirementType ACHIEVEMENT_CRITERIA_REQUIRE_S_DRUNK = 15, // drunken_state 0 (enum DrunkenState) of player ACHIEVEMENT_CRITERIA_REQUIRE_HOLIDAY = 16, // holiday_id 0 event in holiday time ACHIEVEMENT_CRITERIA_REQUIRE_BG_LOSS_TEAM_SCORE = 17, // min_score max_score player's team win bg and opposition team have team score in range + ACHIEVEMENT_CRITERIA_REQUIRE_INSTANCE_SCRIPT = 18, // 0 0 maker instance script call for check curent criteria requirements fit }; -#define MAX_ACHIEVEMENT_CRITERIA_REQUIREMENT_TYPE 18 // maximum value in AchievementCriteriaRequirementType enum +#define MAX_ACHIEVEMENT_CRITERIA_REQUIREMENT_TYPE 19 // maximum value in AchievementCriteriaRequirementType enum class Player; class Unit; @@ -175,15 +176,18 @@ struct AchievementCriteriaRequirement } bool IsValid(AchievementCriteriaEntry const* criteria); - bool Meets(Player const* source, Unit const* target, uint32 miscvalue1 = 0) const; + bool Meets(uint32 criteria_id, Player const* source, Unit const* target, uint32 miscvalue1 = 0) const; }; struct AchievementCriteriaRequirementSet { + AchievementCriteriaRequirementSet() : criteria_id(0) {} + explicit AchievementCriteriaRequirementSet(uint32 id) : criteria_id(id) {} typedef std::vector Storage; void Add(AchievementCriteriaRequirement const& data) { storage.push_back(data); } bool Meets(Player const* source, Unit const* target, uint32 miscvalue = 0) const; private: + uint32 criteria_id; Storage storage; }; diff --git a/src/game/InstanceData.h b/src/game/InstanceData.h index 4099e7aa3..b7539fc2f 100644 --- a/src/game/InstanceData.h +++ b/src/game/InstanceData.h @@ -70,5 +70,12 @@ class MANGOS_DLL_SPEC InstanceData //All-purpose data storage 32 bit virtual uint32 GetData(uint32 /*Type*/) { return 0; } virtual void SetData(uint32 /*Type*/, uint32 /*Data*/) {} + + // Achievement criteria additional requirements check + // NOTE: not use this if same can be checked existed requirement types from AchievementCriteriaRequirementType + virtual bool CheckAchievementCriteriaMeet(uint32 /*criteria_id*/, Player const* /*source*/, Unit const* /*target*/ = NULL, uint32 /*miscvalue1*/ = 0) + { + return false; + } }; #endif diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index b7694a31f..d5a4c8ce7 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 "9025" + #define REVISION_NR "9026" #endif // __REVISION_NR_H__