aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Battlegrounds/Battleground.cpp6
-rw-r--r--src/server/game/DataStores/DBCEnums.h2
-rw-r--r--src/server/game/Entities/Object/Object.cpp14
-rw-r--r--src/server/game/Entities/Player/Player.cpp7
-rw-r--r--src/server/game/Entities/Player/Player.h2
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp4
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp24
-rw-r--r--src/server/game/Globals/ObjectMgr.h5
-rw-r--r--src/server/game/Miscellaneous/SharedDefines.h8
-rw-r--r--src/server/game/Quests/QuestDef.cpp4
-rw-r--r--src/server/game/Quests/QuestDef.h2
-rw-r--r--src/server/game/Server/Protocol/Opcodes.cpp2
-rw-r--r--src/server/game/Server/Protocol/Opcodes.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp3
-rw-r--r--src/server/game/Spells/Spell.cpp3
-rw-r--r--src/server/game/Spells/SpellEffects.cpp1
-rw-r--r--src/server/game/Spells/SpellMgr.cpp64
-rw-r--r--src/server/game/Texts/CreatureTextMgr.cpp4
-rw-r--r--src/server/game/World/World.cpp1
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp19
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp4
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp6
-rw-r--r--src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp4
23 files changed, 79 insertions, 112 deletions
diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp
index a5c92962f57..d85b521af04 100644
--- a/src/server/game/Battlegrounds/Battleground.cpp
+++ b/src/server/game/Battlegrounds/Battleground.cpp
@@ -1237,13 +1237,9 @@ void Battleground::AddPlayer(Player* player)
player->CastSpell(player, SPELL_ARENA_PREPARATION, true);
player->ResetAllPowers();
}
-
// Correctly display EnemyUnitFrame
player->SetByteValue(PLAYER_BYTES_3, 3, player->GetBGTeam());
- WorldPacket data(SMSG_ARENA_OPPONENT_UPDATE, 8);
- data << uint64(player->GetGUID());
- SendPacketToTeam(team, &data, player, false);
}
else
{
@@ -1944,7 +1940,7 @@ int32 Battleground::GetObjectType(uint64 guid)
return -1;
}
-void Battleground::HandleKillUnit(Creature* /*creature*/, Player* /*killer*/)
+void Battleground::HandleKillUnit(Creature* /*victim*/, Player* /*killer*/)
{
}
diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h
index dc91a0642c4..802fcb3f2fb 100644
--- a/src/server/game/DataStores/DBCEnums.h
+++ b/src/server/game/DataStores/DBCEnums.h
@@ -454,7 +454,7 @@ enum SummonPropType
SUMMON_PROP_TYPE_DRAKE_VEH = 10, // summon drake (vehicle), 3 spells
SUMMON_PROP_TYPE_LIGHTWELL = 11, // summon lightwell, 6 spells in 3.0.3
SUMMON_PROP_TYPE_JEEVES = 12, // summon Jeeves, 1 spell in 3.3.5a
- SUMMON_PROP_TYPE_LASHTAIL = 13, // Lashtail Hatchling, 1 spell in 4.2.2
+ SUMMON_PROP_TYPE_LASHTAIL = 13 // Lashtail Hatchling, 1 spell in 4.2.2
};
// SummonProperties.dbc, col 5
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index 9bd04a17c78..ac3c866fbc5 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -291,6 +291,19 @@ void Object::DestroyForPlayer(Player* target, bool onDeath) const
{
ASSERT(target);
+ if (isType(TYPEMASK_UNIT) || isType(TYPEMASK_PLAYER))
+ {
+ if (Battleground* bg = target->GetBattleground())
+ {
+ if (bg->isArena())
+ {
+ WorldPacket data(SMSG_ARENA_UNIT_DESTROYED, 8);
+ data << uint64(GetGUID());
+ target->GetSession()->SendPacket(&data);
+ }
+ }
+ }
+
WorldPacket data(SMSG_DESTROY_OBJECT, 8 + 1);
data << uint64(GetGUID());
//! If the following bool is true, the client will call "void CGUnit_C::OnDeath()" for this object.
@@ -2411,6 +2424,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert
mask = UNIT_MASK_GUARDIAN;
break;
case SUMMON_TYPE_TOTEM:
+ case SUMMON_TYPE_LIGHTWELL:
mask = UNIT_MASK_TOTEM;
break;
case SUMMON_TYPE_VEHICLE:
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index e759759e769..bfe86337b4d 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -15239,7 +15239,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
_SaveQuestStatus(trans);
if (announce)
- SendQuestReward(quest, XP, questGiver);
+ SendQuestReward(quest, XP);
// cast spells after mark quest complete (some spells have quest completed state requirements in spell_area data)
if (quest->GetRewSpellCast() > 0)
@@ -16436,7 +16436,7 @@ void Player::SendQuestComplete(Quest const* quest)
}
}
-void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver)
+void Player::SendQuestReward(Quest const* quest, uint32 XP)
{
uint32 questId = quest->GetQuestId();
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questId);
@@ -16470,9 +16470,6 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver)
data.FlushBits();
GetSession()->SendPacket(&data);
-
- if (quest->GetQuestCompleteScript() != 0)
- GetMap()->ScriptsStart(sQuestEndScripts, quest->GetQuestCompleteScript(), questGiver, this);
}
void Player::SendQuestFailed(uint32 questId, InventoryResult reason)
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index c4f4c109e2b..12674552666 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1688,7 +1688,7 @@ class Player : public Unit, public GridObject<Player>
bool CanShareQuest(uint32 quest_id) const;
void SendQuestComplete(Quest const* quest);
- void SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver);
+ void SendQuestReward(Quest const* quest, uint32 XP);
void SendQuestFailed(uint32 questId, InventoryResult reason = EQUIP_ERR_OK);
void SendQuestTimerFailed(uint32 quest_id);
void SendCanTakeQuestResponse(uint32 msg) const;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index f5c054df823..d647ad8184d 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -16363,7 +16363,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
}
if (IsInMap(caster))
- caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID);
+ caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId, target, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID);
else // This can happen during Player::_LoadAuras
{
int32 bp0 = seatId;
@@ -16393,7 +16393,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId)
void Unit::EnterVehicle(Unit* base, int8 seatId)
{
- CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId+1, base, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
+ CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId, base, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
}
void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp)
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 596f0ebbc28..13e9425b961 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -51,7 +51,6 @@
#include "WaypointManager.h"
#include "World.h"
-ScriptMapMap sQuestEndScripts;
ScriptMapMap sSpellScripts;
ScriptMapMap sGameObjectScripts;
ScriptMapMap sEventScripts;
@@ -62,7 +61,6 @@ std::string GetScriptsTableNameByType(ScriptsType type)
std::string res = "";
switch (type)
{
- case SCRIPTS_QUEST_END: res = "quest_end_scripts"; break;
case SCRIPTS_SPELL: res = "spell_scripts"; break;
case SCRIPTS_GAMEOBJECT: res = "gameobject_scripts"; break;
case SCRIPTS_EVENT: res = "event_scripts"; break;
@@ -77,7 +75,6 @@ ScriptMapMap* GetScriptsMapByType(ScriptsType type)
ScriptMapMap* res = NULL;
switch (type)
{
- case SCRIPTS_QUEST_END: res = &sQuestEndScripts; break;
case SCRIPTS_SPELL: res = &sSpellScripts; break;
case SCRIPTS_GAMEOBJECT: res = &sGameObjectScripts; break;
case SCRIPTS_EVENT: res = &sEventScripts; break;
@@ -3466,13 +3463,12 @@ void ObjectMgr::LoadQuests()
"DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, EmoteOnIncomplete, EmoteOnComplete, "
// 164 165 166 167 168 169 170 171
"OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, "
- // 173 174
- "CompleteScript, WDBVerified"
+ // 173
+ "WDBVerified"
" FROM quest_template");
if (!result)
{
sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 quests definitions. DB table `quest_template` is empty.");
-
return;
}
@@ -4247,7 +4243,7 @@ void ObjectMgr::LoadQuestLocales()
_questLocaleStore.clear(); // need for reload case
- QueryResult result = WorldDatabase.Query("SELECT entry, "
+ QueryResult result = WorldDatabase.Query("SELECT Id, "
"Title_loc1, Details_loc1, Objectives_loc1, OfferRewardText_loc1, RequestItemsText_loc1, EndText_loc1, CompletedText_loc1, ObjectiveText1_loc1, ObjectiveText2_loc1, ObjectiveText3_loc1, ObjectiveText4_loc1, QuestGiverTextWindow_loc1, QuestGiverTargetName_loc1, QuestTurnTextWindow_loc1, QuestTurnTargetName_loc1,"
"Title_loc2, Details_loc2, Objectives_loc2, OfferRewardText_loc2, RequestItemsText_loc2, EndText_loc2, CompletedText_loc2, ObjectiveText1_loc2, ObjectiveText2_loc2, ObjectiveText3_loc2, ObjectiveText4_loc2, QuestGiverTextWindow_loc2, QuestGiverTargetName_loc2, QuestTurnTextWindow_loc2, QuestTurnTargetName_loc2,"
"Title_loc3, Details_loc3, Objectives_loc3, OfferRewardText_loc3, RequestItemsText_loc3, EndText_loc3, CompletedText_loc3, ObjectiveText1_loc3, ObjectiveText2_loc3, ObjectiveText3_loc3, ObjectiveText4_loc3, QuestGiverTextWindow_loc3, QuestGiverTargetName_loc3, QuestTurnTextWindow_loc3, QuestTurnTargetName_loc3,"
@@ -4625,18 +4621,6 @@ void ObjectMgr::LoadGameObjectScripts()
}
}
-void ObjectMgr::LoadQuestEndScripts()
-{
- LoadScripts(SCRIPTS_QUEST_END);
-
- // check ids
- for (ScriptMapMap::const_iterator itr = sQuestEndScripts.begin(); itr != sQuestEndScripts.end(); ++itr)
- {
- if (!GetQuestTemplate(itr->first))
- sLog->outError(LOG_FILTER_SQL, "Table `quest_end_scripts` has not existing quest (Id: %u) as script id", itr->first);
- }
-}
-
void ObjectMgr::LoadSpellScripts()
{
LoadScripts(SCRIPTS_SPELL);
@@ -5119,7 +5103,7 @@ void ObjectMgr::LoadNpcTextLocales()
_npcTextLocaleStore.clear(); // need for reload case
- QueryResult result = WorldDatabase.Query("SELECT entry, "
+ QueryResult result = WorldDatabase.Query("SELECT ID, "
"Text0_0_loc1, Text0_1_loc1, Text1_0_loc1, Text1_1_loc1, Text2_0_loc1, Text2_1_loc1, Text3_0_loc1, Text3_1_loc1, Text4_0_loc1, Text4_1_loc1, Text5_0_loc1, Text5_1_loc1, Text6_0_loc1, Text6_1_loc1, Text7_0_loc1, Text7_1_loc1, "
"Text0_0_loc2, Text0_1_loc2, Text1_0_loc2, Text1_1_loc2, Text2_0_loc2, Text2_1_loc2, Text3_0_loc2, Text3_1_loc1, Text4_0_loc2, Text4_1_loc2, Text5_0_loc2, Text5_1_loc2, Text6_0_loc2, Text6_1_loc2, Text7_0_loc2, Text7_1_loc2, "
"Text0_0_loc3, Text0_1_loc3, Text1_0_loc3, Text1_1_loc3, Text2_0_loc3, Text2_1_loc3, Text3_0_loc3, Text3_1_loc1, Text4_0_loc3, Text4_1_loc3, Text5_0_loc3, Text5_1_loc3, Text6_0_loc3, Text6_1_loc3, Text7_0_loc3, Text7_1_loc3, "
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h
index a822ac7752c..1cc0ce2e70f 100644
--- a/src/server/game/Globals/ObjectMgr.h
+++ b/src/server/game/Globals/ObjectMgr.h
@@ -127,8 +127,7 @@ enum ScriptsType
{
SCRIPTS_FIRST = 1,
- SCRIPTS_QUEST_END = SCRIPTS_FIRST,
- SCRIPTS_SPELL,
+ SCRIPTS_SPELL = SCRIPTS_FIRST,
SCRIPTS_GAMEOBJECT,
SCRIPTS_EVENT,
SCRIPTS_WAYPOINT,
@@ -361,7 +360,6 @@ typedef std::multimap<uint32, ScriptInfo> ScriptMap;
typedef std::map<uint32, ScriptMap > ScriptMapMap;
typedef std::multimap<uint32, uint32> SpellScriptsContainer;
typedef std::pair<SpellScriptsContainer::iterator, SpellScriptsContainer::iterator> SpellScriptsBounds;
-extern ScriptMapMap sQuestEndScripts;
extern ScriptMapMap sSpellScripts;
extern ScriptMapMap sGameObjectScripts;
extern ScriptMapMap sEventScripts;
@@ -858,7 +856,6 @@ class ObjectMgr
}
void LoadGameObjectScripts();
- void LoadQuestEndScripts();
void LoadEventScripts();
void LoadSpellScripts();
void LoadWaypointScripts();
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index 4571bc2e099..b50e4581908 100644
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -3427,11 +3427,11 @@ enum SummonType
SUMMON_TYPE_MINIPET = 5,
SUMMON_TYPE_GUARDIAN2 = 6,
SUMMON_TYPE_WILD2 = 7,
- SUMMON_TYPE_WILD3 = 8,
+ SUMMON_TYPE_WILD3 = 8, // Related to phases and DK prequest line (3.3.5a)
SUMMON_TYPE_VEHICLE = 9,
- SUMMON_TYPE_VEHICLE2 = 10,
- SUMMON_TYPE_OBJECT = 11,
- SUMMON_TYPE_UNK12 = 12,
+ SUMMON_TYPE_VEHICLE2 = 10, // Oculus and Argent Tournament vehicles (3.3.5a)
+ SUMMON_TYPE_LIGHTWELL = 11,
+ SUMMON_TYPE_JEEVES = 12,
SUMMON_TYPE_UNK13 = 13
};
diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp
index 1c8fdfacf11..3af7d071f42 100644
--- a/src/server/game/Quests/QuestDef.cpp
+++ b/src/server/game/Quests/QuestDef.cpp
@@ -166,9 +166,7 @@ Quest::Quest(Field* questRecord)
for (int i = 0; i < QUEST_EMOTE_COUNT; ++i)
OfferRewardEmoteDelay[i] = questRecord[168+i].GetInt32();
- CompleteScript = questRecord[172].GetUInt32();
-
- // int32 WDBVerified = questRecord[173].GetInt32();
+ // int32 WDBVerified = questRecord[172].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 d8cb8cdbb4e..2ec2ba8ef1b 100644
--- a/src/server/game/Quests/QuestDef.h
+++ b/src/server/game/Quests/QuestDef.h
@@ -275,7 +275,6 @@ class Quest
uint32 GetSoundTurnIn() const { return SoundTurnIn; }
uint32 GetIncompleteEmote() const { return EmoteOnIncomplete; }
uint32 GetCompleteEmote() const { return EmoteOnComplete; }
- uint32 GetQuestCompleteScript() const { return CompleteScript; }
bool IsRepeatable() const { return SpecialFlags & QUEST_SPECIAL_FLAGS_REPEATABLE; }
bool IsAutoAccept() const;
bool IsAutoComplete() const;
@@ -403,7 +402,6 @@ class Quest
uint32 PointOption;
uint32 EmoteOnIncomplete;
uint32 EmoteOnComplete;
- uint32 CompleteScript;
// new in 4.x
uint32 MinimapTargetMark;
uint32 RewardSkillId;
diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp
index 79c566e08a5..3a370333925 100644
--- a/src/server/game/Server/Protocol/Opcodes.cpp
+++ b/src/server/game/Server/Protocol/Opcodes.cpp
@@ -631,7 +631,7 @@ void OpcodeTable::Initialize()
DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MESSAGE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
DEFINE_OPCODE_HANDLER(SMSG_AREA_TRIGGER_MOVEMENT_UPDATE, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
DEFINE_OPCODE_HANDLER(SMSG_ARENA_ERROR, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
- DEFINE_OPCODE_HANDLER(SMSG_ARENA_OPPONENT_UPDATE, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
+ DEFINE_OPCODE_HANDLER(SMSG_ARENA_UNIT_DESTROYED, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED, STATUS_UNHANDLED, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_COMMAND_RESULT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
DEFINE_OPCODE_HANDLER(SMSG_ARENA_TEAM_EVENT, STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide );
diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h
index be0b8ad4d89..2c467ff7099 100644
--- a/src/server/game/Server/Protocol/Opcodes.h
+++ b/src/server/game/Server/Protocol/Opcodes.h
@@ -680,7 +680,7 @@ enum Opcodes
SMSG_AREA_TRIGGER_MESSAGE = 0x4505,
SMSG_AREA_TRIGGER_MOVEMENT_UPDATE = 0x3DB1,
SMSG_ARENA_ERROR = 0x2D17,
- SMSG_ARENA_OPPONENT_UPDATE = 0x2637,
+ SMSG_ARENA_UNIT_DESTROYED = 0x2637,
SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x6E34,
SMSG_ARENA_TEAM_COMMAND_RESULT = 0x39B3,
SMSG_ARENA_TEAM_EVENT = 0x0617,
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 0f9962f58df..4ecbe8dbadb 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -3180,7 +3180,8 @@ void AuraEffect::HandleAuraControlVehicle(AuraApplication const* aurApp, uint8 m
if (apply)
{
- caster->_EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp);
+ // correct amount is already calculated adding one more -1 meant calculated amount - 1
+ caster->_EnterVehicle(target->GetVehicleKit(), m_amount, aurApp);
}
else
{
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 25dcd0c43ba..6a6caed68f0 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4871,9 +4871,10 @@ SpellCastResult Spell::CheckCast(bool strict)
if (!checkMask)
checkMask = VEHICLE_SEAT_FLAG_CAN_ATTACK;
+ // All creatures should be able to cast as passengers freely, restriction and attribute are only for players
VehicleSeatEntry const* vehicleSeat = vehicle->GetSeatForPassenger(m_caster);
if (!(m_spellInfo->AttributesEx6 & SPELL_ATTR6_CASTABLE_WHILE_ON_VEHICLE) && !(m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_MOUNTED)
- && (vehicleSeat->m_flags & checkMask) != checkMask)
+ && (vehicleSeat->m_flags & checkMask) != checkMask && m_caster->GetTypeId() == TYPEID_PLAYER)
return SPELL_FAILED_DONT_REPORT;
}
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index 81cf5522db8..444704e2372 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -2200,6 +2200,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex)
case SUMMON_TYPE_VEHICLE2:
summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id);
break;
+ case SUMMON_TYPE_LIGHTWELL:
case SUMMON_TYPE_TOTEM:
{
summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id);
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index d1ec90c2ff3..2f7908078c3 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -1837,14 +1837,14 @@ void SpellMgr::LoadSpellProcs()
int32 spellId = fields[0].GetInt32();
bool allRanks = false;
- if (spellId <=0)
+ if (spellId < 0)
{
allRanks = true;
spellId = -spellId;
}
- SpellInfo const* spellEntry = GetSpellInfo(spellId);
- if (!spellEntry)
+ SpellInfo const* spellInfo = GetSpellInfo(spellId);
+ if (!spellInfo)
{
sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` does not exist", spellId);
continue;
@@ -1852,9 +1852,9 @@ void SpellMgr::LoadSpellProcs()
if (allRanks)
{
- if (GetFirstSpellInChain(spellId) != uint32(spellId))
+ if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId))
{
- sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` is not first rank of spell.", fields[0].GetInt32());
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` is not first rank of spell.", spellId);
continue;
}
}
@@ -1877,79 +1877,77 @@ void SpellMgr::LoadSpellProcs()
baseProcEntry.cooldown = uint32(cooldown);
baseProcEntry.charges = fields[14].GetUInt32();
- while (true)
+ while (spellInfo)
{
- if (mSpellProcMap.find(spellId) != mSpellProcMap.end())
+ if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end())
{
- sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` has duplicate entry in the table", spellId);
+ sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` has duplicate entry in the table", spellInfo->Id);
break;
}
SpellProcEntry procEntry = SpellProcEntry(baseProcEntry);
// take defaults from dbcs
if (!procEntry.typeMask)
- procEntry.typeMask = spellEntry->ProcFlags;
+ procEntry.typeMask = spellInfo->ProcFlags;
if (!procEntry.charges)
- procEntry.charges = spellEntry->ProcCharges;
+ procEntry.charges = spellInfo->ProcCharges;
if (!procEntry.chance && !procEntry.ratePerMinute)
- procEntry.chance = float(spellEntry->ProcChance);
+ procEntry.chance = float(spellInfo->ProcChance);
// validate data
if (procEntry.schoolMask & ~SPELL_SCHOOL_MASK_ALL)
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `schoolMask` set: %u", spellId, procEntry.schoolMask);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `schoolMask` set: %u", spellInfo->Id, procEntry.schoolMask);
if (procEntry.spellFamilyName && (procEntry.spellFamilyName < 3 || procEntry.spellFamilyName > 17 || procEntry.spellFamilyName == 14 || procEntry.spellFamilyName == 16))
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellFamilyName` set: %u", spellId, procEntry.spellFamilyName);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellFamilyName` set: %u", spellInfo->Id, procEntry.spellFamilyName);
if (procEntry.chance < 0)
{
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `chance` field", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `chance` field", spellInfo->Id);
procEntry.chance = 0;
}
if (procEntry.ratePerMinute < 0)
{
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `ratePerMinute` field", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `ratePerMinute` field", spellInfo->Id);
procEntry.ratePerMinute = 0;
}
if (cooldown < 0)
{
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `cooldown` field", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `cooldown` field", spellInfo->Id);
procEntry.cooldown = 0;
}
if (procEntry.chance == 0 && procEntry.ratePerMinute == 0)
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `chance` and `ratePerMinute` values defined, proc will not be triggered", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `chance` and `ratePerMinute` values defined, proc will not be triggered", spellInfo->Id);
if (procEntry.charges > 99)
{
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has too big value in `charges` field", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has too big value in `charges` field", spellInfo->Id);
procEntry.charges = 99;
}
if (!procEntry.typeMask)
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `typeMask` value defined, proc will not be triggered", spellId);
- if (procEntry.spellTypeMask & ~PROC_SPELL_PHASE_MASK_ALL)
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellTypeMask` set: %u", spellId, procEntry.spellTypeMask);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `typeMask` value defined, proc will not be triggered", spellInfo->Id);
+ if (procEntry.spellTypeMask & ~PROC_SPELL_TYPE_MASK_ALL)
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellTypeMask` set: %u", spellInfo->Id, procEntry.spellTypeMask);
if (procEntry.spellTypeMask && !(procEntry.typeMask & (SPELL_PROC_FLAG_MASK | PERIODIC_PROC_FLAG_MASK)))
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellTypeMask` value defined, but it won't be used for defined `typeMask` value", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellTypeMask` value defined, but it won't be used for defined `typeMask` value", spellInfo->Id);
if (!procEntry.spellPhaseMask && procEntry.typeMask & REQ_SPELL_PHASE_PROC_FLAG_MASK)
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `spellPhaseMask` value defined, but it's required for defined `typeMask` value, proc will not be triggered", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `spellPhaseMask` value defined, but it's required for defined `typeMask` value, proc will not be triggered", spellInfo->Id);
if (procEntry.spellPhaseMask & ~PROC_SPELL_PHASE_MASK_ALL)
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellPhaseMask` set: %u", spellId, procEntry.spellPhaseMask);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellPhaseMask` set: %u", spellInfo->Id, procEntry.spellPhaseMask);
if (procEntry.spellPhaseMask && !(procEntry.typeMask & REQ_SPELL_PHASE_PROC_FLAG_MASK))
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellPhaseMask` value defined, but it won't be used for defined `typeMask` value", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellPhaseMask` value defined, but it won't be used for defined `typeMask` value", spellInfo->Id);
if (procEntry.hitMask & ~PROC_HIT_MASK_ALL)
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `hitMask` set: %u", spellId, procEntry.hitMask);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `hitMask` set: %u", spellInfo->Id, procEntry.hitMask);
if (procEntry.hitMask && !(procEntry.typeMask & TAKEN_HIT_PROC_FLAG_MASK || (procEntry.typeMask & DONE_HIT_PROC_FLAG_MASK && (!procEntry.spellPhaseMask || procEntry.spellPhaseMask & (PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH)))))
- sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `hitMask` value defined, but it won't be used for defined `typeMask` and `spellPhaseMask` values", spellId);
+ sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `hitMask` value defined, but it won't be used for defined `typeMask` and `spellPhaseMask` values", spellInfo->Id);
- mSpellProcMap[spellId] = procEntry;
+ mSpellProcMap[spellInfo->Id] = procEntry;
if (allRanks)
- {
- spellId = GetNextSpellInChain(spellId);
- spellEntry = GetSpellInfo(spellId);
- }
+ spellInfo = spellInfo->GetNextRankSpell();
else
break;
}
++count;
- } while (result->NextRow());
+ }
+ while (result->NextRow());
sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
}
diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp
index fc0cea04013..6dc9610355f 100644
--- a/src/server/game/Texts/CreatureTextMgr.cpp
+++ b/src/server/game/Texts/CreatureTextMgr.cpp
@@ -196,7 +196,7 @@ void CreatureTextMgr::LoadCreatureTextLocales()
mLocaleTextMap.clear(); // for reload case
- QueryResult result = WorldDatabase.Query("SELECT entry, textGroup, id, text_loc1, text_loc2, text_loc3, text_loc4, text_loc5, text_loc6, text_loc7, text_loc8 FROM locales_creature_text");
+ QueryResult result = WorldDatabase.Query("SELECT entry, groupid, id, text_loc1, text_loc2, text_loc3, text_loc4, text_loc5, text_loc6, text_loc7, text_loc8 FROM locales_creature_text");
if (!result)
return;
@@ -206,7 +206,7 @@ void CreatureTextMgr::LoadCreatureTextLocales()
do
{
Field* fields = result->Fetch();
- CreatureTextLocale& loc = mLocaleTextMap[CreatureTextId(fields[0].GetUInt32(), uint32(fields[1].GetUInt8()), fields[2].GetUInt32())];
+ CreatureTextLocale& loc = mLocaleTextMap[CreatureTextId(fields[0].GetUInt32(), uint32(fields[1].GetUInt8()), uint32(fields[2].GetUInt8()))];
for (uint8 i = 1; i < TOTAL_LOCALES; ++i)
{
LocaleConstant locale = LocaleConstant(i);
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index dd40357a2fb..92f3bd6629b 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1698,7 +1698,6 @@ void World::SetInitialWorldSettings()
LoadAutobroadcasts();
///- Load and initialize scripts
- sObjectMgr->LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
sObjectMgr->LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
sObjectMgr->LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
sObjectMgr->LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index e8998e8db30..852bc176040 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -121,7 +121,6 @@ public:
{ "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesPickpocketingCommand, "", NULL},
{ "points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadPointsOfInterestCommand, "", NULL },
{ "prospecting_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesProspectingCommand, "", NULL },
- { "quest_end_scripts", SEC_ADMINISTRATOR, true, &HandleReloadQuestEndScriptsCommand, "", NULL },
{ "quest_poi", SEC_ADMINISTRATOR, true, &HandleReloadQuestPOICommand, "", NULL },
{ "quest_template", SEC_ADMINISTRATOR, true, &HandleReloadQuestTemplateCommand, "", NULL },
{ "reference_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesReferenceCommand, "", NULL },
@@ -257,7 +256,6 @@ public:
sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts...");
HandleReloadGameObjectScriptsCommand(handler, "a");
HandleReloadEventScriptsCommand(handler, "a");
- HandleReloadQuestEndScriptsCommand(handler, "a");
HandleReloadSpellScriptsCommand(handler, "a");
handler->SendGlobalGMSysMessage("DB tables `*_scripts` reloaded.");
HandleReloadDbScriptStringCommand(handler, "a");
@@ -1006,23 +1004,6 @@ public:
return true;
}
- static bool HandleReloadQuestEndScriptsCommand(ChatHandler* handler, const char* args)
- {
- if (sScriptMgr->IsScriptScheduled())
- {
- handler->SendSysMessage("DB scripts used currently, please attempt reload later.");
- handler->SetSentErrorMessage(true);
- return false;
- }
-
- if (*args != 'a')
- sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `quest_end_scripts`...");
-
- sObjectMgr->LoadQuestEndScripts();
-
- if (*args != 'a')
- handler->SendGlobalGMSysMessage("DB table `quest_end_scripts` reloaded.");
-
return true;
}
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
index 2d09feef089..b0edbf214e8 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
@@ -1006,7 +1006,7 @@ class boss_icehowl : public CreatureScript
events.ScheduleEvent(EVENT_WHIRL, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS));
return;
case EVENT_MASSIVE_CRASH:
- me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 20.0f, 20.0f); // 1: Middle of the room
+ me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 20.0f, 20.0f, 0); // 1: Middle of the room
SetCombatMovement(false);
me->AttackStop();
_stage = 7; //Invalid (Do nothing more than move)
@@ -1059,7 +1059,7 @@ class boss_icehowl : public CreatureScript
_trampleTargetY = target->GetPositionY();
_trampleTargetZ = target->GetPositionZ();
// 2: Hop Backwards
- me->GetMotionMaster()->MoveJump(2*me->GetPositionX() - _trampleTargetX, 2*me->GetPositionY() - _trampleTargetY, me->GetPositionZ(), 30.0f, 20.0f);
+ me->GetMotionMaster()->MoveJump(2*me->GetPositionX() - _trampleTargetX, 2*me->GetPositionY() - _trampleTargetY, me->GetPositionZ(), 30.0f, 20.0f, 0);
_stage = 7; //Invalid (Do nothing more than move)
}
else
diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
index ed196d2cd0c..f94b028bfaf 100644
--- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp
@@ -226,13 +226,13 @@ class boss_ick : public CreatureScript
case EVENT_TOXIC_WASTE:
if (Creature* krick = GetKrick())
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
- krick->CastSpell(target, SPELL_TOXIC_WASTE, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
+ krick->CastSpell(target, SPELL_TOXIC_WASTE);
events.ScheduleEvent(EVENT_TOXIC_WASTE, urand(7000, 10000));
break;
case EVENT_SHADOW_BOLT:
if (Creature* krick = GetKrick())
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
- krick->CastSpell(target, SPELL_SHADOW_BOLT, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
+ krick->CastSpell(target, SPELL_SHADOW_BOLT);
events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000);
return;
case EVENT_MIGHTY_KICK:
@@ -322,7 +322,7 @@ class boss_krick : public CreatureScript
void KilledUnit(Unit* victim)
{
- if (victim == me)
+ if (victim->GetTypeId() != TYPEID_PLAYER)
return;
Talk(SAY_KRICK_SLAY);
diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp
index 4288061860e..53277afdc54 100644
--- a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp
+++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp
@@ -31,7 +31,9 @@ enum eSays
SAY_AGGRO = 0,
SAY_KILL = 1,
SAY_TREE = 2,
- SAY_DEATH = 3
+ SAY_SUMMON = 3,
+ SAY_DEATH = 4,
+ SAY_OOC_RANDOM = 5,
};
enum eSpells