From e51976e17a29bd2a318dc84e42cc24d3e9c877ae Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 13 Apr 2014 01:06:46 +0200 Subject: Core/Spells: Fixed players being able to mount with all transform auras Closes #11852 --- src/server/game/DataStores/DBCStores.cpp | 2 ++ src/server/game/DataStores/DBCStores.h | 1 + src/server/game/DataStores/DBCStructure.h | 31 +++++++++++++++++++++++++++--- src/server/game/DataStores/DBCfmt.h | 7 ++++--- src/server/game/Entities/Unit/Unit.cpp | 32 ++++++++++++++++++++++++++++--- 5 files changed, 64 insertions(+), 9 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/DataStores/DBCStores.cpp b/src/server/game/DataStores/DBCStores.cpp index 37f4f4c1930..9b0465a4536 100644 --- a/src/server/game/DataStores/DBCStores.cpp +++ b/src/server/game/DataStores/DBCStores.cpp @@ -73,6 +73,7 @@ DBCStorage sChrClassesStore(ChrClassesEntryfmt); DBCStorage sChrRacesStore(ChrRacesEntryfmt); DBCStorage sCinematicSequencesStore(CinematicSequencesEntryfmt); DBCStorage sCreatureDisplayInfoStore(CreatureDisplayInfofmt); +DBCStorage sCreatureDisplayInfoExtraStore(CreatureDisplayInfoExtrafmt); DBCStorage sCreatureFamilyStore(CreatureFamilyfmt); DBCStorage sCreatureModelDataStore(CreatureModelDatafmt); DBCStorage sCreatureSpellDataStore(CreatureSpellDatafmt); @@ -306,6 +307,7 @@ void LoadDBCStores(const std::string& dataPath) LoadDBC(availableDbcLocales, bad_dbc_files, sChrRacesStore, dbcPath, "ChrRaces.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sCinematicSequencesStore, dbcPath, "CinematicSequences.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureDisplayInfoStore, dbcPath, "CreatureDisplayInfo.dbc"); + LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureDisplayInfoExtraStore, dbcPath, "CreatureDisplayInfoExtra.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureFamilyStore, dbcPath, "CreatureFamily.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureModelDataStore, dbcPath, "CreatureModelData.dbc"); LoadDBC(availableDbcLocales, bad_dbc_files, sCreatureSpellDataStore, dbcPath, "CreatureSpellData.dbc"); diff --git a/src/server/game/DataStores/DBCStores.h b/src/server/game/DataStores/DBCStores.h index 39747141322..b77db950541 100644 --- a/src/server/game/DataStores/DBCStores.h +++ b/src/server/game/DataStores/DBCStores.h @@ -92,6 +92,7 @@ extern DBCStorage sChrClassesStore; extern DBCStorage sChrRacesStore; extern DBCStorage sCinematicSequencesStore; extern DBCStorage sCreatureDisplayInfoStore; +extern DBCStorage sCreatureDisplayInfoExtraStore; extern DBCStorage sCreatureFamilyStore; extern DBCStorage sCreatureModelDataStore; extern DBCStorage sCreatureSpellDataStore; diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index 976b4355957..abe7bde4bf5 100644 --- a/src/server/game/DataStores/DBCStructure.h +++ b/src/server/game/DataStores/DBCStructure.h @@ -690,7 +690,7 @@ struct ChrClassesEntry struct ChrRacesEntry { uint32 RaceID; // 0 - // 1 unused + uint32 Flags; // 1 uint32 FactionID; // 2 facton template id // 3 unused uint32 model_m; // 4 @@ -736,7 +736,7 @@ struct CreatureDisplayInfoEntry uint32 Displayid; // 0 m_ID uint32 ModelId; // 1 m_modelID // 2 m_soundID - // 3 m_extendedDisplayInfoID + uint32 ExtraId; // 3 m_extendedDisplayInfoID float scale; // 4 m_creatureModelScale // 5 m_creatureModelAlpha // 6-8 m_textureVariation[3] @@ -749,6 +749,31 @@ struct CreatureDisplayInfoEntry // 15 m_objectEffectPackageID }; +struct CreatureDisplayInfoExtraEntry +{ + //uint32 Id; // 0 + uint32 Race; // 1 + uint32 Gender; // 2 + //uint32 SkinColor; // 3 + //uint32 FaceType; // 4 + //uint32 HairType; // 5 + //uint32 HairStyle; // 6 + //uint32 FacialHair; // 7 + //uint32 HelmDisplayId; // 8 + //uint32 ShoulderDisplayId; // 9 + //uint32 ShirtDisplayId; // 10 + //uint32 ChestDisplayId; // 11 + //uint32 BeltDisplayId; // 12 + //uint32 LegsDisplayId; // 13 + //uint32 BootsDisplayId; // 14 + //uint32 WristDisplayId; // 15 + //uint32 GlovesDisplayId; // 16 + //uint32 TabardDisplayId; // 17 + //uint32 CloakDisplayId; // 18 + //uint32 CanEquip; // 19 + //char const* Texture; // 20 +}; + struct CreatureFamilyEntry { uint32 ID; // 0 m_ID @@ -768,7 +793,7 @@ struct CreatureFamilyEntry struct CreatureModelDataEntry { uint32 Id; - //uint32 Flags; + uint32 Flags; //char* ModelPath[16] //uint32 Unk1; float Scale; // Used in calculation of unit collision data diff --git a/src/server/game/DataStores/DBCfmt.h b/src/server/game/DataStores/DBCfmt.h index 448a8066434..35a8eecb708 100644 --- a/src/server/game/DataStores/DBCfmt.h +++ b/src/server/game/DataStores/DBCfmt.h @@ -36,11 +36,12 @@ char const CharStartOutfitEntryfmt[] = "dbbbXiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxx char const CharTitlesEntryfmt[] = "nxssssssssssssssssxssssssssssssssssxi"; char const ChatChannelsEntryfmt[] = "nixssssssssssssssssxxxxxxxxxxxxxxxxxx"; char const ChrClassesEntryfmt[] = "nxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii"; -char const ChrRacesEntryfmt[] = "nxixiixixxxxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi"; +char const ChrRacesEntryfmt[] = "niixiixixxxxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi"; char const CinematicSequencesEntryfmt[] = "nxxxxxxxxx"; -char const CreatureDisplayInfofmt[] = "nixxfxxxxxxxxxxx"; +char const CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxx"; +char const CreatureDisplayInfoExtrafmt[] = "diixxxxxxxxxxxxxxxxxx"; char const CreatureFamilyfmt[] = "nfifiiiiixssssssssssssssssxx"; -char const CreatureModelDatafmt[] = "nxxxfxxxxxxxxxxffxxxxxxxxxxx"; +char const CreatureModelDatafmt[] = "nixxfxxxxxxxxxxffxxxxxxxxxxx"; char const CreatureSpellDatafmt[] = "niiiixxxx"; char const CreatureTypefmt[] = "nxxxxxxxxxxxxxxxxxx"; char const CurrencyTypesfmt[] = "xnxi"; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 5bf3193fc14..9cc214b7390 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -13051,9 +13051,35 @@ bool Unit::IsInFeralForm() const bool Unit::IsInDisallowedMountForm() const { - ShapeshiftForm form = GetShapeshiftForm(); - return form != FORM_NONE && form != FORM_BATTLESTANCE && form != FORM_BERSERKERSTANCE && form != FORM_DEFENSIVESTANCE && - form != FORM_SHADOW && form != FORM_STEALTH && form != FORM_UNDEAD; + if (ShapeshiftForm form = GetShapeshiftForm()) + { + SpellShapeshiftEntry const* shapeshift = sSpellShapeshiftStore.LookupEntry(form); + if (!shapeshift) + return true; + + if (!(shapeshift->flags1 & 0x1)) + return true; + } + + if (GetDisplayId() == GetNativeDisplayId()) + return false; + + CreatureDisplayInfoEntry const* display = sCreatureDisplayInfoStore.LookupEntry(GetDisplayId()); + if (!display) + return true; + + CreatureDisplayInfoExtraEntry const* displayExtra = sCreatureDisplayInfoExtraStore.LookupEntry(display->ExtraId); + if (!displayExtra) + return true; + + CreatureModelDataEntry const* model = sCreatureModelDataStore.LookupEntry(display->ModelId); + ChrRacesEntry const* race = sChrRacesStore.LookupEntry(displayExtra->Race); + + if (model && !(model->Flags & 0x80)) + if (race && !(race->Flags & 0x4)) + return true; + + return false; } /*####################################### -- cgit v1.2.3 From dc58ec0d6c4d33e04b74a5ca43340941bcab331c Mon Sep 17 00:00:00 2001 From: jackpoz Date: Sun, 13 Apr 2014 14:06:21 +0200 Subject: Scripts/Commands: ".modify speed" targets current Player by default Allow ".modify speed" command to target current Player if there is no target or if the selected Unit is a Creature. This behavior could be extended to other commands that require target Players. --- src/server/game/Chat/Chat.cpp | 18 ++++++++++++++++++ src/server/game/Chat/Chat.h | 2 ++ src/server/scripts/Commands/cs_modify.cpp | 10 +++++----- 3 files changed, 25 insertions(+), 5 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 2d2266a865d..d77ee5b7f61 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -782,6 +782,24 @@ Creature* ChatHandler::getSelectedCreature() return ObjectAccessor::GetCreatureOrPetOrVehicle(*m_session->GetPlayer(), m_session->GetPlayer()->GetTarget()); } +Player* ChatHandler::getSelectedPlayerOrSelf() +{ + if (!m_session) + return NULL; + + uint64 selected = m_session->GetPlayer()->GetTarget(); + if (!selected) + return m_session->GetPlayer(); + + // first try with selected target + Player* targetPlayer = ObjectAccessor::FindPlayer(selected); + // if the target is not a player, then return self + if (!targetPlayer) + targetPlayer = m_session->GetPlayer(); + + return targetPlayer; +} + char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** something1) { // skip empty diff --git a/src/server/game/Chat/Chat.h b/src/server/game/Chat/Chat.h index f9000f636c5..a56b79077d7 100644 --- a/src/server/game/Chat/Chat.h +++ b/src/server/game/Chat/Chat.h @@ -97,6 +97,8 @@ class ChatHandler Creature* getSelectedCreature(); Unit* getSelectedUnit(); WorldObject* getSelectedObject(); + // Returns either the selected player or self if there is no selected player + Player* getSelectedPlayerOrSelf(); char* extractKeyFromLink(char* text, char const* linkType, char** something1 = NULL); char* extractKeyFromLink(char* text, char const* const* linkTypes, int* found_idx, char** something1 = NULL); diff --git a/src/server/scripts/Commands/cs_modify.cpp b/src/server/scripts/Commands/cs_modify.cpp index c2d6bf47154..4cd7228a24a 100644 --- a/src/server/scripts/Commands/cs_modify.cpp +++ b/src/server/scripts/Commands/cs_modify.cpp @@ -476,7 +476,7 @@ public: return false; } - Player* target = handler->getSelectedPlayer(); + Player* target = handler->getSelectedPlayerOrSelf(); if (!target) { handler->SendSysMessage(LANG_NO_CHAR_SELECTED); @@ -524,7 +524,7 @@ public: return false; } - Player* target = handler->getSelectedPlayer(); + Player* target = handler->getSelectedPlayerOrSelf(); if (!target) { handler->SendSysMessage(LANG_NO_CHAR_SELECTED); @@ -569,7 +569,7 @@ public: return false; } - Player* target = handler->getSelectedPlayer(); + Player* target = handler->getSelectedPlayerOrSelf(); if (!target) { handler->SendSysMessage(LANG_NO_CHAR_SELECTED); @@ -614,7 +614,7 @@ public: return false; } - Player* target = handler->getSelectedPlayer(); + Player* target = handler->getSelectedPlayerOrSelf(); if (!target) { handler->SendSysMessage(LANG_NO_CHAR_SELECTED); @@ -659,7 +659,7 @@ public: return false; } - Player* target = handler->getSelectedPlayer(); + Player* target = handler->getSelectedPlayerOrSelf(); if (!target) { handler->SendSysMessage(LANG_NO_CHAR_SELECTED); -- cgit v1.2.3 From 057169c21c141f690891c908b8f09e63d917289d Mon Sep 17 00:00:00 2001 From: Unholychick Date: Mon, 7 Apr 2014 18:36:53 +0200 Subject: Fix done & taken procs Corrects the logic for dot/hot procs and fixes spells such as althor's abacus, egg of mortal essence, black magic, spiritual attunement etc etc. Reverts the remaining part of 8edf6247c087884acd8c873a57c6f414e19091ec --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 2 +- src/server/game/Spells/SpellMgr.cpp | 55 +++++++++++++++-------- 2 files changed, 38 insertions(+), 19 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index bd24038d88d..06bd12911ad 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -6096,7 +6096,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const } uint32 procAttacker = PROC_FLAG_DONE_PERIODIC; - uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS; + uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC; uint32 procEx = (crit ? PROC_EX_CRITICAL_HIT : PROC_EX_NORMAL_HIT) | PROC_EX_INTERNAL_HOT; // ignore item heals if (!haveCastItem) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 0ae4b22b3e4..700e348c382 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -784,42 +784,61 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr bool hasFamilyMask = false; - /* Check Periodic Auras + /** + + * @brief Check auras procced by periodics - *Dots can trigger if spell has no PROC_FLAG_SUCCESSFUL_NEGATIVE_MAGIC_SPELL - nor PROC_FLAG_TAKEN_POSITIVE_MAGIC_SPELL + *Only damaging Dots can proc auras with PROC_FLAG_TAKEN_DAMAGE - *Only Hots can trigger if spell has PROC_FLAG_TAKEN_POSITIVE_MAGIC_SPELL + *Both Dots and hots can proc if ONLY has PROC_FLAG_DONE_PERIODIC or PROC_FLAG_TAKEN_PERIODIC. Such auras need support in Unit::HandleAuraProc. - *Only dots can trigger if spell has both positivity flags or PROC_FLAG_SUCCESSFUL_NEGATIVE_MAGIC_SPELL + *Only Dots can proc auras with PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG or PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG - *Aura has to have PROC_FLAG_TAKEN_POSITIVE_MAGIC_SPELL or spellfamily specified to trigger from Hot + *Only Hots can proc auras with PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS or PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS + + *Only Dots can proc auras with PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG or PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG + + *Only Hots can proc auras with PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS or PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS + + * @param procSpell the spell proccing the aura + * @param procFlags proc_flags of spellProc + * @param procExtra proc_EX of procSpell + * @param EventProcFlag proc_flags of aura to be procced + */ - if (procFlags & PROC_FLAG_DONE_PERIODIC) + /// Quick Check - If PROC_FLAG_TAKEN_DAMAGE is set for aura and procSpell dealt damage, proc no matter what kind of spell that deals the damage. + if (procFlags & PROC_FLAG_TAKEN_DAMAGE && EventProcFlag & PROC_FLAG_TAKEN_DAMAGE) + return true; + + /// Any aura that has only PROC_FLAG_DONE_PERIODIC or PROC_FLAG_TAKEN_PERIODIC should always proc, if procSpell is correct or not is checked in Unit::HandleAuraProc + if (EventProcFlag == PROC_FLAG_DONE_PERIODIC || EventProcFlag == PROC_FLAG_TAKEN_PERIODIC) + return true; + + if (procFlags & PROC_FLAG_DONE_PERIODIC && EventProcFlag & PROC_FLAG_DONE_PERIODIC) { - if (EventProcFlag & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG) + /// Aura must have positive procflags for a HOT to proc + if (procExtra & PROC_EX_INTERNAL_HOT) { - if (!(procExtra & PROC_EX_INTERNAL_DOT)) + if (!(EventProcFlag & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS))) return false; } - else if (procExtra & PROC_EX_INTERNAL_HOT) - procExtra |= PROC_EX_INTERNAL_REQ_FAMILY; - else if (EventProcFlag & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS) + /// Aura must have negative procflags for a DOT to proc + else if (!(EventProcFlag & (PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG))) return false; } - if (procFlags & PROC_FLAG_TAKEN_PERIODIC) + if (procFlags & PROC_FLAG_TAKEN_PERIODIC && EventProcFlag & PROC_FLAG_TAKEN_PERIODIC) { - if (EventProcFlag & PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS) + /// Aura must have positive procflags for a HOT to proc + if (procExtra & PROC_EX_INTERNAL_HOT) { - if (!(procExtra & PROC_EX_INTERNAL_DOT)) + if (!(EventProcFlag & (PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS))) return false; } - else if (procExtra & PROC_EX_INTERNAL_HOT) - procExtra |= PROC_EX_INTERNAL_REQ_FAMILY; - else if (EventProcFlag & PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS) + /// Aura must have negative procflags for a DOT to proc + else if (!(EventProcFlag & (PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG))) return false; } // Trap casts are active by default -- cgit v1.2.3 From 0a014e1431647cc008cc4af760eb6d7a0e35d046 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Thu, 17 Apr 2014 00:09:43 +0200 Subject: Scripts/UtgardeKeep: fixed some issues on Ingvar the Plunderer Closes #10859 --- sql/updates/world/2014_04_17_00_world_misc.sql | 29 +++ src/server/game/Spells/SpellMgr.cpp | 6 - .../UtgardeKeep/boss_ingvar_the_plunderer.cpp | 194 +++++++++++++-------- 3 files changed, 151 insertions(+), 78 deletions(-) create mode 100644 sql/updates/world/2014_04_17_00_world_misc.sql (limited to 'src/server/game') diff --git a/sql/updates/world/2014_04_17_00_world_misc.sql b/sql/updates/world/2014_04_17_00_world_misc.sql new file mode 100644 index 00000000000..9deeb5ddef0 --- /dev/null +++ b/sql/updates/world/2014_04_17_00_world_misc.sql @@ -0,0 +1,29 @@ +DELETE FROM `spelldifficulty_dbc` WHERE `id`=42739; +INSERT INTO `spelldifficulty_dbc` (`id`, `spellid0`, `spellid1`) VALUES +(42739,42739,59736); + +DELETE FROM `spell_script_names` WHERE `spell_id` IN (42730,59735,42912); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(42730,'spell_ingvar_woe_strike'), +(59735,'spell_ingvar_woe_strike'), +(42912,'spell_ingvar_summon_banshee'); + +UPDATE `creature_text` SET `entry`=23980, `groupid`=`groupid`-3 WHERE `entry`=23954 AND `groupid` IN (3,4,5); + +UPDATE `creature_template` SET `flags_extra`=0 WHERE `entry` IN (23997,31835); + +UPDATE `creature_template` SET `mingold`=0, `maxgold`=0, `lootid`=0 WHERE `entry` IN (23954,31673); +UPDATE `creature_template` SET `mingold`=4056, `maxgold`=6760, `lootid`=23980 WHERE `entry`=23980; +UPDATE `creature_template` SET `mingold`=8112, `maxgold`=13520, `lootid`=31674 WHERE `entry`=31674; + +UPDATE `creature_loot_template` SET `entry`=23980 WHERE `entry`=23954; +UPDATE `creature_loot_template` SET `entry`=31674 WHERE `entry`=31673; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=1 AND `SourceGroup` IN (23980,31674,23954,31673); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(1,23980,43228,0,0,1,0,57940,0,0,0,0,0,'','Can loot Stone Keeper''s Shard only with aura Essence of Wintergrasp'), +(1,31674,43228,0,0,1,0,57940,0,0,0,0,0,'','Can loot Stone Keeper''s Shard only with aura Essence of Wintergrasp'); + +UPDATE `instance_encounters` SET `creditEntry`=23980 WHERE `entry` IN (575,576); + +UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (24068,31655); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 0ae4b22b3e4..e8f20441605 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -2913,15 +2913,9 @@ void SpellMgr::LoadSpellInfoCorrections() case 53096: // Quetz'lun's Judgment spellInfo->MaxAffectedTargets = 1; break; - case 42730: - spellInfo->Effects[EFFECT_1].TriggerSpell = 42739; - break; case 42436: // Drink! (Brewfest) spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_TARGET_ANY); break; - case 59735: - spellInfo->Effects[EFFECT_1].TriggerSpell = 59736; - break; case 52611: // Summon Skeletons case 52612: // Summon Skeletons spellInfo->Effects[EFFECT_0].MiscValueB = 64; diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp index cc37dde57dd..fe29f4e9f7c 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_ingvar_the_plunderer.cpp @@ -18,28 +18,25 @@ /* ScriptData SDName: Boss_Ingvar_The_Plunderer SD%Complete: 95 -SDComment: Some Problems with Annhylde Movement, Blizzlike Timers (just shadow axe summon needs a new timer) -SDCategory: Udgarde Keep +SDComment: Blizzlike Timers (just shadow axe summon needs a new timer) +SDCategory: Utgarde Keep EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" #include "utgarde_keep.h" enum Yells { - // Ingvar (Human) - SAY_AGGRO_1 = 0, - SAY_SLAY_1 = 1, - SAY_DEATH_1 = 2, - - // Ingvar (Undead) - SAY_AGGRO_2 = 3, - SAY_SLAY_2 = 4, - SAY_DEATH_2 = 5, + // Ingvar (Human/Undead) + SAY_AGGRO = 0, + SAY_SLAY = 1, + SAY_DEATH = 2, // Annhylde The Caller - YELL_RESURRECT = 0 + YELL_RESURRECT = 0 }; enum Events @@ -83,8 +80,10 @@ enum Spells SPELL_DARK_SMASH = 42723, SPELL_DREADFUL_ROAR = 42729, SPELL_WOE_STRIKE = 42730, + SPELL_WOE_STRIKE_EFFECT = 42739, SPELL_SHADOW_AXE_SUMMON = 42748, + SPELL_SHADOW_AXE_PERIODIC_DAMAGE = 42750, // Spells for Annhylde SPELL_SCOURG_RESURRECTION_HEAL = 42704, // Heal Max + DummyAura @@ -105,16 +104,14 @@ class boss_ingvar_the_plunderer : public CreatureScript struct boss_ingvar_the_plundererAI : public BossAI { - boss_ingvar_the_plundererAI(Creature* creature) : BossAI(creature, DATA_INGVAR) - { - _isUndead = false; - } + boss_ingvar_the_plundererAI(Creature* creature) : BossAI(creature, DATA_INGVAR) { } void Reset() OVERRIDE { - _isUndead = false; + if (me->GetEntry() != NPC_INGVAR) + me->UpdateEntry(NPC_INGVAR); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); _Reset(); events.SetPhase(PHASE_HUMAN); @@ -132,12 +129,12 @@ class boss_ingvar_the_plunderer : public CreatureScript me->RemoveAllAuras(); DoCast(me, SPELL_INGVAR_FEIGN_DEATH, true); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); events.SetPhase(PHASE_EVENT); events.ScheduleEvent(EVENT_SUMMON_BANSHEE, 3 * IN_MILLISECONDS, 0, PHASE_EVENT); - Talk(SAY_DEATH_1); + Talk(SAY_DEATH); } if (events.IsInPhase(PHASE_EVENT)) @@ -152,26 +149,22 @@ class boss_ingvar_the_plunderer : public CreatureScript void StartZombiePhase() { - _isUndead = true; me->RemoveAura(SPELL_INGVAR_FEIGN_DEATH); - DoCast(me, SPELL_INGVAR_TRANSFORM, true); /// @todo: should be death persistent + DoCast(me, SPELL_INGVAR_TRANSFORM, true); + me->UpdateEntry(NPC_INGVAR_UNDEAD); events.ScheduleEvent(EVENT_JUST_TRANSFORMED, 2 * IN_MILLISECONDS, 0, PHASE_EVENT); - - Talk(SAY_AGGRO_2); } void EnterCombat(Unit* /*who*/) OVERRIDE { _EnterCombat(); - - if (!_isUndead) - Talk(SAY_AGGRO_1); + Talk(SAY_AGGRO); } void JustDied(Unit* /*killer*/) OVERRIDE { _JustDied(); - Talk(SAY_DEATH_2); + Talk(SAY_DEATH); } void ScheduleSecondPhase() @@ -183,9 +176,10 @@ class boss_ingvar_the_plunderer : public CreatureScript events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(_isUndead ? SAY_SLAY_1 : SAY_SLAY_2); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SLAY); } void UpdateAI(uint32 diff) OVERRIDE @@ -220,7 +214,7 @@ class boss_ingvar_the_plunderer : public CreatureScript events.ScheduleEvent(EVENT_SMASH, urand(12, 16)*IN_MILLISECONDS, 0, PHASE_HUMAN); break; case EVENT_JUST_TRANSFORMED: - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_NOT_SELECTABLE); DoZoneInCombat(); ScheduleSecondPhase(); return; @@ -241,20 +235,18 @@ class boss_ingvar_the_plunderer : public CreatureScript events.ScheduleEvent(EVENT_WOE_STRIKE, urand(10, 14)*IN_MILLISECONDS, 0, PHASE_UNDEAD); break; case EVENT_SHADOW_AXE: - if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1)) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true)) DoCast(target, SPELL_SHADOW_AXE_SUMMON); - events.ScheduleEvent(EVENT_SHADOW_AXE, 30*IN_MILLISECONDS, 0, PHASE_UNDEAD); break; + default: + break; } } if (!events.IsInPhase(PHASE_EVENT)) DoMeleeAttackIfReady(); } - - private: - bool _isUndead; }; CreatureAI* GetAI(Creature* creature) const OVERRIDE @@ -279,12 +271,8 @@ class npc_annhylde_the_caller : public CreatureScript { _events.Reset(); - //! HACK: Creature's can't have MOVEMENTFLAG_FLYING - me->SetHover(true); - me->GetPosition(x, y, z); - DoTeleportTo(x+1, y, z+30); - me->GetMotionMaster()->MovePoint(1, x, y, z+15); + me->GetMotionMaster()->MovePoint(1, x, y, z - 15.0f); } void MovementInform(uint32 type, uint32 id) OVERRIDE @@ -339,7 +327,7 @@ class npc_annhylde_the_caller : public CreatureScript ingvar->AI()->DoAction(ACTION_START_PHASE_2); } - me->GetMotionMaster()->MovePoint(2, x+1, y, z+30); + me->GetMotionMaster()->MovePoint(2, x, y, z + 15.0f); break; default: break; @@ -359,52 +347,112 @@ class npc_annhylde_the_caller : public CreatureScript } }; -enum ShadowAxe -{ - SPELL_SHADOW_AXE_DAMAGE = 42750, - H_SPELL_SHADOW_AXE_DAMAGE = 59719, - POINT_TARGET = 28 -}; - class npc_ingvar_throw_dummy : public CreatureScript { -public: - npc_ingvar_throw_dummy() : CreatureScript("npc_ingvar_throw_dummy") { } + public: + npc_ingvar_throw_dummy() : CreatureScript("npc_ingvar_throw_dummy") { } - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_ingvar_throw_dummyAI(creature); - } + struct npc_ingvar_throw_dummyAI : public ScriptedAI + { + npc_ingvar_throw_dummyAI(Creature* creature) : ScriptedAI(creature) { } + + void Reset() OVERRIDE + { + me->SetReactState(REACT_PASSIVE); + + if (Creature* target = me->FindNearestCreature(NPC_THROW_TARGET, 200.0f)) + { + float x, y, z; + target->GetPosition(x, y, z); + me->GetMotionMaster()->MoveCharge(x, y, z); + target->DespawnOrUnsummon(); + } + else + me->DespawnOrUnsummon(); + } + + void MovementInform(uint32 type, uint32 id) OVERRIDE + { + if (type == EFFECT_MOTION_TYPE && id == EVENT_CHARGE) + { + me->CastSpell(me, SPELL_SHADOW_AXE_PERIODIC_DAMAGE, true); + me->DespawnOrUnsummon(10000); + } + } + }; - struct npc_ingvar_throw_dummyAI : public ScriptedAI - { - npc_ingvar_throw_dummyAI(Creature* creature) : ScriptedAI(creature) + CreatureAI* GetAI(Creature* creature) const OVERRIDE { + return new npc_ingvar_throw_dummyAI(creature); } +}; + +// 42912 - Summon Banshee +class spell_ingvar_summon_banshee : public SpellScriptLoader +{ + public: + spell_ingvar_summon_banshee() : SpellScriptLoader("spell_ingvar_summon_banshee") { } - void Reset() OVERRIDE + class spell_ingvar_summon_banshee_SpellScript : public SpellScript { - if (Creature* target = me->FindNearestCreature(NPC_THROW_TARGET, 50.0f)) + PrepareSpellScript(spell_ingvar_summon_banshee_SpellScript); + + void SetDest(SpellDestination& dest) { - float x, y, z; - target->GetPosition(x, y, z); - me->GetMotionMaster()->MoveCharge(x, y, z, 42.0f, POINT_TARGET); - target->DisappearAndDie(); + dest.RelocateOffset({ 0.0f, 0.0f, 30.0f, 0.0f }); } - else - me->DisappearAndDie(); + + void Register() OVERRIDE + { + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_ingvar_summon_banshee_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_BACK); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_ingvar_summon_banshee_SpellScript(); } +}; - void MovementInform(uint32 type, uint32 id) OVERRIDE +// 42730, 59735 - Woe Strike +class spell_ingvar_woe_strike : public SpellScriptLoader +{ + public: + spell_ingvar_woe_strike() : SpellScriptLoader("spell_ingvar_woe_strike") { } + + class spell_ingvar_woe_strike_AuraScript : public AuraScript { - if (type == EFFECT_MOTION_TYPE && id == POINT_TARGET) + PrepareAuraScript(spell_ingvar_woe_strike_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_WOE_STRIKE_EFFECT)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetHealInfo()->GetHeal(); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(eventInfo.GetActor(), SPELL_WOE_STRIKE_EFFECT, true, NULL, aurEff); + } + + void Register() OVERRIDE { - DoCast(me, SPELL_SHADOW_AXE_DAMAGE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); - me->DespawnOrUnsummon(10000); + DoCheckProc += AuraCheckProcFn(spell_ingvar_woe_strike_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_ingvar_woe_strike_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_PROC_TRIGGER_SPELL); } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_ingvar_woe_strike_AuraScript(); } - }; }; void AddSC_boss_ingvar_the_plunderer() @@ -412,4 +460,6 @@ void AddSC_boss_ingvar_the_plunderer() new boss_ingvar_the_plunderer(); new npc_annhylde_the_caller(); new npc_ingvar_throw_dummy(); + new spell_ingvar_summon_banshee(); + new spell_ingvar_woe_strike(); } -- cgit v1.2.3 From 20c9981578fc927da8b4c6c09c4431b7d0e1e538 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Fri, 18 Apr 2014 16:55:12 +0200 Subject: Core/Misc: Added missing field in npc_text table for loading --- src/server/game/Globals/ObjectMgr.cpp | 2 ++ src/server/game/Handlers/NPCHandler.h | 1 + 2 files changed, 3 insertions(+) (limited to 'src/server/game') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 8784e2ca4e7..3cdfff7dc4b 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5236,6 +5236,8 @@ void ObjectMgr::LoadGossipText() gText.Options[i].Text_0 = fields[cic++].GetString(); gText.Options[i].Text_1 = fields[cic++].GetString(); + gText.Options[i].BroadcastTextID = fields[cic++].GetUInt32(); // Need for correct loading order + gText.Options[i].Language = fields[cic++].GetUInt8(); gText.Options[i].Probability = fields[cic++].GetFloat(); diff --git a/src/server/game/Handlers/NPCHandler.h b/src/server/game/Handlers/NPCHandler.h index 8aa34eaafa7..7cf80bf0b9b 100644 --- a/src/server/game/Handlers/NPCHandler.h +++ b/src/server/game/Handlers/NPCHandler.h @@ -31,6 +31,7 @@ struct GossipTextOption { std::string Text_0; std::string Text_1; + uint32 BroadcastTextID; uint32 Language; float Probability; QEmote Emotes[MAX_GOSSIP_TEXT_EMOTES]; -- cgit v1.2.3 From 89cc056a506e6df2e9819860ae55bfba1699dd49 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Fri, 18 Apr 2014 17:02:04 +0200 Subject: Fix --- src/server/game/Entities/Player/Player.cpp | 2 +- src/server/game/Globals/ObjectMgr.cpp | 2 +- src/server/game/Handlers/NPCHandler.h | 2 +- src/server/game/Scripting/ScriptMgr.h | 2 +- src/server/game/Spells/SpellMgr.cpp | 8 ++++---- src/server/game/Spells/SpellMgr.h | 2 +- .../Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp | 4 ++-- .../AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp | 6 +++--- 8 files changed, 14 insertions(+), 14 deletions(-) (limited to 'src/server/game') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 2691a6870f2..13635424cf0 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -25058,7 +25058,7 @@ void Player::HandleFall(MovementInfo const& movementInfo) if (damageperc > 0) { uint32 damage = (uint32)(damageperc * GetMaxHealth()*sWorld->getRate(RATE_DAMAGE_FALL)); - + if (GetCommandStatus(CHEAT_GOD)) damage = 0; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 3cdfff7dc4b..e4dbe60535d 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5236,7 +5236,7 @@ void ObjectMgr::LoadGossipText() gText.Options[i].Text_0 = fields[cic++].GetString(); gText.Options[i].Text_1 = fields[cic++].GetString(); - gText.Options[i].BroadcastTextID = fields[cic++].GetUInt32(); // Need for correct loading order + gText.Options[i].BroadcastTextID = fields[cic++].GetUInt32(); // Need for correct loading order gText.Options[i].Language = fields[cic++].GetUInt8(); gText.Options[i].Probability = fields[cic++].GetFloat(); diff --git a/src/server/game/Handlers/NPCHandler.h b/src/server/game/Handlers/NPCHandler.h index 7cf80bf0b9b..7210d9a53b5 100644 --- a/src/server/game/Handlers/NPCHandler.h +++ b/src/server/game/Handlers/NPCHandler.h @@ -31,7 +31,7 @@ struct GossipTextOption { std::string Text_0; std::string Text_1; - uint32 BroadcastTextID; + uint32 BroadcastTextID; uint32 Language; float Probability; QEmote Emotes[MAX_GOSSIP_TEXT_EMOTES]; diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 726ac025d3c..8ed8a2b3c49 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -388,7 +388,7 @@ class ItemScript : public ScriptObject // Called when the item expires (is destroyed). virtual bool OnExpire(Player* /*player*/, ItemTemplate const* /*proto*/) { return false; } - + // Called when the item is destroyed. virtual bool OnRemove(Player* /*player*/, Item* /*item*/) { return false; } }; diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 93bd409652a..0342b22d735 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -784,8 +784,8 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr bool hasFamilyMask = false; - /** - + /** + * @brief Check auras procced by periodics *Only damaging Dots can proc auras with PROC_FLAG_TAKEN_DAMAGE @@ -799,12 +799,12 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr *Only Dots can proc auras with PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG or PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG *Only Hots can proc auras with PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS or PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS - + * @param procSpell the spell proccing the aura * @param procFlags proc_flags of spellProc * @param procExtra proc_EX of procSpell * @param EventProcFlag proc_flags of aura to be procced - + */ diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h index 76d59bd1e85..5f11870b3e9 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -691,7 +691,7 @@ class SpellMgr // SpellInfo object management SpellInfo const* GetSpellInfo(uint32 spellId) const { return spellId < GetSpellInfoStoreSize() ? mSpellInfoMap[spellId] : NULL; } // Use this only with 100% valid spellIds - SpellInfo const* EnsureSpellInfo(uint32 spellId) const + SpellInfo const* EnsureSpellInfo(uint32 spellId) const { ASSERT(spellId < GetSpellInfoStoreSize()); SpellInfo const* spellInfo = mSpellInfoMap[spellId]; diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp index 31c565e5be2..3541ad0f1a3 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_prince_taldaram.cpp @@ -286,8 +286,8 @@ class npc_prince_taldaram_flame_sphere : public CreatureScript struct npc_prince_taldaram_flame_sphereAI : public ScriptedAI { - npc_prince_taldaram_flame_sphereAI(Creature* creature) : ScriptedAI(creature) - { + npc_prince_taldaram_flame_sphereAI(Creature* creature) : ScriptedAI(creature) + { _flameSphereTargetGUID = 0; } diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp index 1281d40fe5c..916f60bd78a 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp @@ -438,7 +438,7 @@ class npc_watcher_gashra : public CreatureScript _events.ScheduleEvent(EVENT_WEB_WRAP_GASHRA, 11000); _events.ScheduleEvent(EVENT_INFECTED_BITE_GASHRA, 4000); } - + void JustDied(Unit* /*killer*/) OVERRIDE { Creature* krikthir = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_KRIKTHIR_THE_GATEWATCHER)); @@ -511,7 +511,7 @@ class npc_watcher_narjil : public CreatureScript _events.ScheduleEvent(EVENT_INFECTED_BITE_NARJIL, 4000); _events.ScheduleEvent(EVENT_BINDING_WEBS, 17000); } - + void JustDied(Unit* /*killer*/) OVERRIDE { Creature* krikthir = ObjectAccessor::GetCreature(*me, _instance->GetData64(DATA_KRIKTHIR_THE_GATEWATCHER)); @@ -600,7 +600,7 @@ class npc_watcher_silthik : public CreatureScript { if (!UpdateVictim()) return; - + _events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) -- cgit v1.2.3 From 574fa30ea6924902af1d845e667f38c043b32e94 Mon Sep 17 00:00:00 2001 From: Unholychick Date: Fri, 18 Apr 2014 20:21:05 +0200 Subject: Core/Spells: Convert Avenging Wrath to spellscript Closes #11896 Closes #3464 --- .../2014_04_18_00_world_spell_script_names.sql | 7 +++ src/server/game/Entities/Unit/Unit.cpp | 9 ---- src/server/scripts/Spells/spell_paladin.cpp | 50 ++++++++++++++++++++++ 3 files changed, 57 insertions(+), 9 deletions(-) create mode 100644 sql/updates/world/2014_04_18_00_world_spell_script_names.sql (limited to 'src/server/game') diff --git a/sql/updates/world/2014_04_18_00_world_spell_script_names.sql b/sql/updates/world/2014_04_18_00_world_spell_script_names.sql new file mode 100644 index 00000000000..a1cf5402219 --- /dev/null +++ b/sql/updates/world/2014_04_18_00_world_spell_script_names.sql @@ -0,0 +1,7 @@ +-- +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_pal_avenging_wrath'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(31884,'spell_pal_avenging_wrath'); + +-- +DELETE FROM `spell_proc_event` WHERE `entry`=-53375; diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 9cc214b7390..06628de4050 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -6363,15 +6363,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere CastSpell(this, 57669, true, castItem, triggeredByAura); break; } - // Sanctified Wrath - if (dummySpell->SpellIconID == 3029) - { - triggered_spell_id = 57318; - target = this; - basepoints0 = triggerAmount; - CastCustomSpell(target, triggered_spell_id, &basepoints0, &basepoints0, NULL, true, castItem, triggeredByAura); - return true; - } // Righteous Vengeance if (dummySpell->SpellIconID == 3025) { diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index b5265561d85..2b1cafbdd26 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -66,6 +66,9 @@ enum PaladinSpells SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT = 31790, + SPELL_PALADIN_SANCTIFIED_WRATH = 57318, + SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1 = 53375, + SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS = 25742, SPELL_PALADIN_CONCENTRACTION_AURA = 19746, @@ -236,6 +239,52 @@ class spell_pal_aura_mastery_immune : public SpellScriptLoader } }; +// 31884 - Avenging Wrath +class spell_pal_avenging_wrath : public SpellScriptLoader +{ + public: + spell_pal_avenging_wrath() : SpellScriptLoader("spell_pal_avenging_wrath") { } + + class spell_pal_avenging_wrath_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_avenging_wrath_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_SANCTIFIED_WRATH) + || !sSpellMgr->GetSpellInfo(SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1)) + return false; + return true; + } + + void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (AuraEffect const* aurEff = target->GetAuraEffectOfRankedSpell(SPELL_PALADIN_SANCTIFIED_WRATH_TALENT_R1, EFFECT_2)) + { + int32 basepoints = aurEff->GetAmount(); + target->CastCustomSpell(target, SPELL_PALADIN_SANCTIFIED_WRATH, &basepoints, &basepoints, NULL, true, NULL, aurEff); + } + } + + void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->RemoveAurasDueToSpell(SPELL_PALADIN_SANCTIFIED_WRATH); + } + + void Register() OVERRIDE + { + OnEffectApply += AuraEffectApplyFn(spell_pal_avenging_wrath_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_pal_avenging_wrath_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_pal_avenging_wrath_AuraScript(); + } +}; + // 37877 - Blessing of Faith class spell_pal_blessing_of_faith : public SpellScriptLoader { @@ -1233,6 +1282,7 @@ void AddSC_paladin_spell_scripts() new spell_pal_ardent_defender(); new spell_pal_aura_mastery(); new spell_pal_aura_mastery_immune(); + new spell_pal_avenging_wrath(); new spell_pal_blessing_of_faith(); new spell_pal_blessing_of_sanctuary(); new spell_pal_divine_sacrifice(); -- cgit v1.2.3