aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp2
-rw-r--r--src/server/game/Entities/Player/Player.cpp12
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp64
-rw-r--r--src/server/game/Quests/QuestDef.cpp39
-rw-r--r--src/server/game/Quests/QuestDef.h1
-rw-r--r--src/server/scripts/Commands/cs_quest.cpp7
-rw-r--r--src/server/scripts/Spells/spell_quest.cpp161
7 files changed, 191 insertions, 95 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index febf2e789a2..a1862c07d14 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -312,7 +312,7 @@ void SmartAI::UpdatePath(const uint32 diff)
mWPReached = false;
}
}
- if (me->IsInCombat() || HasEscortState(SMART_ESCORT_PAUSED | SMART_ESCORT_RETURNING))
+ if ((!me->HasReactState(REACT_PASSIVE) && me->IsInCombat()) || HasEscortState(SMART_ESCORT_PAUSED | SMART_ESCORT_RETURNING))
return;
// handle next wp
if (mWPReached)//reached WP
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 594d33357b4..7ec9f30acdf 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -16372,10 +16372,6 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid /*= 0*/)
if (qInfo->RequiredNpcOrGo[j] <= 0)
continue;
- // skip Cast at creature objective
- if (qInfo->RequiredSpellCast[j] != 0)
- continue;
-
uint32 reqkill = qInfo->RequiredNpcOrGo[j];
if (reqkill == real_entry)
@@ -16465,10 +16461,6 @@ void Player::CastedCreatureOrGO(uint32 entry, uint64 guid, uint32 spell_id)
{
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
{
- // skip kill creature objective (0) or wrong spell casts
- if (qInfo->RequiredSpellCast[j] != spell_id)
- continue;
-
uint32 reqTarget = 0;
if (isCreature)
@@ -16548,8 +16540,8 @@ void Player::TalkedToCreature(uint32 entry, uint64 guid)
{
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
{
- // skip spell casts and Gameobject objectives
- if (qInfo->RequiredSpellCast[j] > 0 || qInfo->RequiredNpcOrGo[j] < 0)
+ // skip gameobject objectives
+ if (qInfo->RequiredNpcOrGo[j] < 0)
continue;
uint32 reqTarget = 0;
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 38971cd3e30..d383da5c9f6 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -3552,19 +3552,17 @@ void ObjectMgr::LoadQuests()
"RequiredSourceItemId1, RequiredSourceItemId2, RequiredSourceItemId3, RequiredSourceItemId4, RequiredSourceItemCount1, RequiredSourceItemCount2, RequiredSourceItemCount3, RequiredSourceItemCount4, "
// 111 112 113 114 115 116 117 118 119 120 121 122
"RequiredItemId1, RequiredItemId2, RequiredItemId3, RequiredItemId4, RequiredItemId5, RequiredItemId6, RequiredItemCount1, RequiredItemCount2, RequiredItemCount3, RequiredItemCount4, RequiredItemCount5, RequiredItemCount6, "
- // 123 124 125 126 127 128 129 130 131
- "RequiredSpell, RequiredSpellCast1, RequiredSpellCast2, RequiredSpellCast3, RequiredSpellCast4, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, "
- // 132 133 134 135 136 137 138 139
- "RewardCurrencyId1, RewardCurrencyId2, RewardCurrencyId3, RewardCurrencyId4, RewardCurrencyCount1, RewardCurrencyCount2, RewardCurrencyCount3, RewardCurrencyCount4, "
- // 140 141 142 143 144 145 146 147
+ // 123 124 125 126 127 128 129 130 131 132 133 134 136
+ "RequiredSpell, ObjectiveText1, ObjectiveText2, ObjectiveText3, ObjectiveText4, RewardCurrencyId1, RewardCurrencyId2, RewardCurrencyId3, RewardCurrencyId4, RewardCurrencyCount1, RewardCurrencyCount2, RewardCurrencyCount3, RewardCurrencyCount4, "
+ // 137 138 139 140 141 142 143 144
"RequiredCurrencyId1, RequiredCurrencyId2, RequiredCurrencyId3, RequiredCurrencyId4, RequiredCurrencyCount1, RequiredCurrencyCount2, RequiredCurrencyCount3, RequiredCurrencyCount4, "
- // 148 149 150 151 152 153
+ // 145 146 147 148 149 150
"QuestGiverTextWindow, QuestGiverTargetName, QuestTurnTextWindow, QuestTurnTargetName, SoundAccept, SoundTurnIn, "
- // 154 155 156 157 158 159 160 161 162 163
+ // 151 152 153 154 155 156 157 158 159 160
"DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, EmoteOnIncomplete, EmoteOnComplete, "
- // 164 165 166 167 168 169 170 171
+ // 161 162 163 164 165 166 167 168
"OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, "
- // 173
+ // 169
"WDBVerified"
" FROM quest_template");
if (!result)
@@ -3593,7 +3591,7 @@ void ObjectMgr::LoadQuests()
if (DisableMgr::IsDisabledFor(DISABLE_TYPE_QUEST, iter->first, NULL))
continue;
- Quest * qinfo = iter->second;
+ Quest* qinfo = iter->second;
// additional quest integrity checks (GO, creature_template and item_template must be loaded already)
@@ -3902,52 +3900,6 @@ void ObjectMgr::LoadQuests()
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
{
- uint32 id = qinfo->RequiredSpellCast[j];
- if (id)
- {
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(id);
- if (!spellInfo)
- {
- TC_LOG_ERROR(LOG_FILTER_SQL, "Quest %u has `ReqSpellCast%d` = %u but spell %u does not exist, quest can't be done.",
- qinfo->GetQuestId(), j+1, id, id);
- continue;
- }
-
- if (!qinfo->RequiredNpcOrGo[j])
- {
- bool found = false;
- for (uint8 k = 0; k < MAX_SPELL_EFFECTS; ++k)
- {
- if ((spellInfo->Effects[k].Effect == SPELL_EFFECT_QUEST_COMPLETE && uint32(spellInfo->Effects[k].MiscValue) == qinfo->Id) ||
- spellInfo->Effects[k].Effect == SPELL_EFFECT_SEND_EVENT)
- {
- found = true;
- break;
- }
- }
-
- if (found)
- {
- if (!qinfo->HasSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT))
- {
- TC_LOG_ERROR(LOG_FILTER_SQL, "Spell (id: %u) have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT for quest %u and RequiredNpcOrGo%d = 0, but quest not have flag QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT. Quest flags or RequiredNpcOrGo%d must be fixed, quest modified to enable objective.", spellInfo->Id, qinfo->Id, j+1, j+1);
-
- // this will prevent quest completing without objective
- const_cast<Quest*>(qinfo)->SetSpecialFlag(QUEST_SPECIAL_FLAGS_EXPLORATION_OR_EVENT);
- }
- }
- else
- {
- TC_LOG_ERROR(LOG_FILTER_SQL, "Quest %u has `ReqSpellCast%d` = %u and RequiredNpcOrGo%d = 0 but spell %u does not have SPELL_EFFECT_QUEST_COMPLETE or SPELL_EFFECT_SEND_EVENT effect for this quest, quest can't be done.",
- qinfo->GetQuestId(), j+1, id, j+1, id);
- // no changes, quest can't be done for this requirement
- }
- }
- }
- }
-
- for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j)
- {
int32 id = qinfo->RequiredNpcOrGo[j];
if (id < 0 && !sObjectMgr->GetGameObjectTemplate(-id))
{
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp
index 8d4f3b42e72..9f374dec8e4 100644
--- a/src/server/game/Quests/QuestDef.cpp
+++ b/src/server/game/Quests/QuestDef.cpp
@@ -126,47 +126,44 @@ Quest::Quest(Field* questRecord)
RequiredSpell = questRecord[123].GetUInt32();
- for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i) // To be removed
- RequiredSpellCast[i] = questRecord[124+i].GetUInt32();
-
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
- ObjectiveText[i] = questRecord[128+i].GetString();
+ ObjectiveText[i] = questRecord[124+i].GetString();
for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i)
- RewardCurrencyId[i] = questRecord[132+i].GetUInt16();
+ RewardCurrencyId[i] = questRecord[128+i].GetUInt16();
for (int i = 0; i < QUEST_REWARD_CURRENCY_COUNT; ++i)
- RewardCurrencyCount[i] = questRecord[136+i].GetUInt8();
+ RewardCurrencyCount[i] = questRecord[132+i].GetUInt8();
for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i)
- RequiredCurrencyId[i] = questRecord[140+i].GetUInt16();
+ RequiredCurrencyId[i] = questRecord[136+i].GetUInt16();
for (int i = 0; i < QUEST_REQUIRED_CURRENCY_COUNT; ++i)
- RequiredCurrencyCount[i] = questRecord[144+i].GetUInt8();
+ RequiredCurrencyCount[i] = questRecord[140+i].GetUInt8();
- QuestGiverTextWindow = questRecord[148].GetString();
- QuestGiverTargetName = questRecord[149].GetString();
- QuestTurnTextWindow = questRecord[150].GetString();
- QuestTurnTargetName = questRecord[151].GetString();
- SoundAccept = questRecord[152].GetUInt16();
- SoundTurnIn = questRecord[153].GetUInt16();
+ QuestGiverTextWindow = questRecord[144].GetString();
+ QuestGiverTargetName = questRecord[145].GetString();
+ QuestTurnTextWindow = questRecord[146].GetString();
+ QuestTurnTargetName = questRecord[147].GetString();
+ SoundAccept = questRecord[148].GetUInt16();
+ SoundTurnIn = questRecord[149].GetUInt16();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
- DetailsEmote[i] = questRecord[154+i].GetUInt16();
+ DetailsEmote[i] = questRecord[150+i].GetUInt16();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
- DetailsEmoteDelay[i] = questRecord[158+i].GetUInt32();
+ DetailsEmoteDelay[i] = questRecord[154+i].GetUInt32();
- EmoteOnIncomplete = questRecord[162].GetUInt16();
- EmoteOnComplete = questRecord[163].GetUInt16();
+ EmoteOnIncomplete = questRecord[158].GetUInt16();
+ EmoteOnComplete = questRecord[159].GetUInt16();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
- OfferRewardEmote[i] = questRecord[164+i].GetInt16();
+ OfferRewardEmote[i] = questRecord[160+i].GetInt16();
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
- OfferRewardEmoteDelay[i] = questRecord[168+i].GetInt32();
+ OfferRewardEmoteDelay[i] = questRecord[164+i].GetInt32();
- // int32 WDBVerified = questRecord[172].GetInt32();
+ // int32 WDBVerified = questRecord[168].GetInt32();
if (SpecialFlags & QUEST_SPECIAL_FLAGS_AUTO_ACCEPT)
Flags |= QUEST_FLAGS_AUTO_ACCEPT;
diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h
index 93db5c0ce65..8156c5b062d 100644
--- a/src/server/game/Quests/QuestDef.h
+++ b/src/server/game/Quests/QuestDef.h
@@ -302,7 +302,6 @@ class Quest
uint32 RequiredSourceItemCount[QUEST_SOURCE_ITEM_IDS_COUNT];
int32 RequiredNpcOrGo[QUEST_OBJECTIVES_COUNT]; // >0 Creature <0 Gameobject
uint32 RequiredNpcOrGoCount[QUEST_OBJECTIVES_COUNT];
- uint32 RequiredSpellCast[QUEST_OBJECTIVES_COUNT];
uint32 RewardChoiceItemId[QUEST_REWARD_CHOICES_COUNT];
uint32 RewardChoiceItemCount[QUEST_REWARD_CHOICES_COUNT];
uint32 RewardItemId[QUEST_REWARDS_COUNT];
diff --git a/src/server/scripts/Commands/cs_quest.cpp b/src/server/scripts/Commands/cs_quest.cpp
index 6b7d10ff7b1..12912f68bd5 100644
--- a/src/server/scripts/Commands/cs_quest.cpp
+++ b/src/server/scripts/Commands/cs_quest.cpp
@@ -207,12 +207,7 @@ public:
int32 creature = quest->RequiredNpcOrGo[i];
uint32 creaturecount = quest->RequiredNpcOrGoCount[i];
- if (uint32 spell_id = quest->RequiredSpellCast[i])
- {
- for (uint16 z = 0; z < creaturecount; ++z)
- player->CastedCreatureOrGO(creature, 0, spell_id);
- }
- else if (creature > 0)
+ if (creature > 0)
{
if (CreatureTemplate const* cInfo = sObjectMgr->GetCreatureTemplate(creature))
for (uint16 z = 0; z < creaturecount; ++z)
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp
index ca94f871d03..2a23d6d8135 100644
--- a/src/server/scripts/Spells/spell_quest.cpp
+++ b/src/server/scripts/Spells/spell_quest.cpp
@@ -1876,6 +1876,164 @@ class spell_q13086_cannons_target : public SpellScriptLoader
}
};
+enum BurstAtTheSeams
+{
+ NPC_DRAKKARI_CHIEFTAINK = 29099,
+
+ QUEST_BURST_AT_THE_SEAMS = 12690,
+
+ SPELL_BURST_AT_THE_SEAMS = 52510, // Burst at the Seams
+ SPELL_BURST_AT_THE_SEAMS_DMG = 52508, // Damage spell
+ SPELL_BURST_AT_THE_SEAMS_DMG_2 = 59580, // Abomination self damage spell
+ SPELL_BURST_AT_THE_SEAMS_BONE = 52516, // Burst at the Seams:Bone
+ SPELL_BURST_AT_THE_SEAMS_MEAT = 52520, // Explode Abomination:Meat
+ SPELL_BURST_AT_THE_SEAMS_BMEAT = 52523, // Explode Abomination:Bloody Meat
+ SPELL_DRAKKARI_SKULLCRUSHER_CREDIT = 52590, // Credit for Drakkari Skullcrusher
+ SPELL_SUMMON_DRAKKARI_CHIEFTAIN = 52616, // Summon Drakkari Chieftain
+ SPELL_DRAKKARI_CHIEFTAINK_KILL_CREDIT = 52620 // Drakkari Chieftain Kill Credit
+};
+
+class spell_q12690_burst_at_the_seams : public SpellScriptLoader
+{
+ public:
+ spell_q12690_burst_at_the_seams() : SpellScriptLoader("spell_q12690_burst_at_the_seams") { }
+
+ class spell_q12690_burst_at_the_seams_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q12690_burst_at_the_seams_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS)
+ || !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_DMG)
+ || !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_DMG_2)
+ || !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_BONE)
+ || !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_MEAT)
+ || !sSpellMgr->GetSpellInfo(SPELL_BURST_AT_THE_SEAMS_BMEAT))
+ return false;
+ return true;
+ }
+
+ bool Load() OVERRIDE
+ {
+ return GetCaster()->GetTypeId() == TYPEID_UNIT;
+ }
+
+ void HandleKnockBack(SpellEffIndex /*effIndex*/)
+ {
+ if (Unit* creature = GetHitCreature())
+ {
+ if (Unit* charmer = GetCaster()->GetCharmerOrOwner())
+ {
+ if (Player* player = charmer->ToPlayer())
+ {
+ if (player->GetQuestStatus(QUEST_BURST_AT_THE_SEAMS) == QUEST_STATUS_INCOMPLETE)
+ {
+ creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BONE, true);
+ creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_MEAT, true);
+ creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_BMEAT, true);
+ creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_DMG, true);
+ creature->CastSpell(creature, SPELL_BURST_AT_THE_SEAMS_DMG_2, true);
+
+ player->CastSpell(player, SPELL_DRAKKARI_SKULLCRUSHER_CREDIT, true);
+ uint16 count = player->GetReqKillOrCastCurrentCount(QUEST_BURST_AT_THE_SEAMS, NPC_DRAKKARI_CHIEFTAINK);
+ if ((count % 20) == 0)
+ player->CastSpell(player, SPELL_SUMMON_DRAKKARI_CHIEFTAIN, true);
+ }
+ }
+ }
+ }
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ GetCaster()->ToCreature()->DespawnOrUnsummon(2 * IN_MILLISECONDS);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_q12690_burst_at_the_seams_SpellScript::HandleKnockBack, EFFECT_1, SPELL_EFFECT_KNOCK_BACK);
+ OnEffectHitTarget += SpellEffectFn(spell_q12690_burst_at_the_seams_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_q12690_burst_at_the_seams_SpellScript();
+ }
+};
+
+enum EscapeFromSilverbrook
+{
+ SPELL_SUMMON_WORGEN = 48681
+};
+
+// 48682 - Escape from Silverbrook - Periodic Dummy
+class spell_q12308_escape_from_silverbrook : public SpellScriptLoader
+{
+ public:
+ spell_q12308_escape_from_silverbrook() : SpellScriptLoader("spell_q12308_escape_from_silverbrook") { }
+
+ class spell_q12308_escape_from_silverbrook_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q12308_escape_from_silverbrook_SpellScript);
+
+ bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_WORGEN))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(SpellEffIndex /*effIndex*/)
+ {
+ GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_WORGEN, true);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectHit += SpellEffectFn(spell_q12308_escape_from_silverbrook_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_q12308_escape_from_silverbrook_SpellScript();
+ }
+};
+
+// 48681 - Summon Silverbrook Worgen
+class spell_q12308_escape_from_silverbrook_summon_worgen : public SpellScriptLoader
+{
+ public:
+ spell_q12308_escape_from_silverbrook_summon_worgen() : SpellScriptLoader("spell_q12308_escape_from_silverbrook_summon_worgen") { }
+
+ class spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript);
+
+ void ModDest(SpellEffIndex effIndex)
+ {
+ float dist = GetSpellInfo()->Effects[effIndex].CalcRadius(GetCaster());
+ float angle = (urand(0, 1) ? -1 : 1) * (frand(0.75f, 1.0f) * M_PI);
+
+ Position pos;
+ GetCaster()->GetNearPosition(pos, dist, angle);
+ GetHitDest()->Relocate(&pos);
+ }
+
+ void Register() OVERRIDE
+ {
+ OnEffectHit += SpellEffectFn(spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript::ModDest, EFFECT_0, SPELL_EFFECT_SUMMON);
+ }
+ };
+
+ SpellScript* GetSpellScript() const OVERRIDE
+ {
+ return new spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript();
+ }
+};
+
void AddSC_quest_spell_scripts()
{
new spell_q55_sacred_cleansing();
@@ -1922,4 +2080,7 @@ void AddSC_quest_spell_scripts()
new spell_q12847_summon_soul_moveto_bunny();
new spell_q13011_bear_flank_master();
new spell_q13086_cannons_target();
+ new spell_q12690_burst_at_the_seams();
+ new spell_q12308_escape_from_silverbrook_summon_worgen();
+ new spell_q12308_escape_from_silverbrook();
}