aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp2
-rw-r--r--src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp4
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp6
-rw-r--r--src/server/game/AuctionHouse/AuctionHouseMgr.cpp4
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp6
-rw-r--r--src/server/game/Battlegrounds/Zones/BattlegroundSA.h1
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp7
-rw-r--r--src/server/game/Entities/Creature/Creature.h3
-rw-r--r--src/server/game/Entities/Object/Object.h1
-rw-r--r--src/server/game/Entities/Player/Player.cpp3
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp5
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp162
-rw-r--r--src/server/game/Handlers/TradeHandler.cpp9
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp2
-rw-r--r--src/server/game/Spells/SpellMgr.cpp2
-rw-r--r--src/server/game/Texts/CreatureTextMgr.cpp12
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp8
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp127
-rw-r--r--src/server/scripts/Northrend/zone_sholazar_basin.cpp8
-rw-r--r--src/server/scripts/Northrend/zone_zuldrak.cpp2
-rw-r--r--src/server/shared/Database/Implementation/WorldDatabase.cpp4
22 files changed, 202 insertions, 178 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
index 43596ffb4cb..d06f90c1aeb 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
@@ -166,7 +166,7 @@ void npc_escortAI::JustRespawned()
//add a small delay before going to first waypoint, normal in near all cases
m_uiWPWaitTimer = 2500;
- if (me->getFaction() != me->GetCreatureTemplate()->faction_A)
+ if (me->getFaction() != me->GetCreatureTemplate()->faction)
me->RestoreFaction();
Reset();
diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
index df6bee51642..a106c98c786 100644
--- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
+++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
@@ -165,8 +165,8 @@ void FollowerAI::JustRespawned()
if (!IsCombatMovementAllowed())
SetCombatMovement(true);
- if (me->getFaction() != me->GetCreatureTemplate()->faction_A)
- me->setFaction(me->GetCreatureTemplate()->faction_A);
+ if (me->getFaction() != me->GetCreatureTemplate()->faction)
+ me->setFaction(me->GetCreatureTemplate()->faction);
Reset();
}
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index 521f39171af..098f3130fed 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -532,7 +532,7 @@ void SmartAI::JustRespawned()
mDespawnState = 0;
mEscortState = SMART_ESCORT_NONE;
me->SetVisible(true);
- if (me->getFaction() != me->GetCreatureTemplate()->faction_A)
+ if (me->getFaction() != me->GetCreatureTemplate()->faction)
me->RestoreFaction();
GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN);
mJustReset = true;
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index a0e516ca819..1032af57460 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -261,11 +261,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
{
if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate((*itr)->ToCreature()->GetEntry()))
{
- if ((*itr)->ToCreature()->getFaction() != ci->faction_A)
+ if ((*itr)->ToCreature()->getFaction() != ci->faction)
{
- (*itr)->ToCreature()->setFaction(ci->faction_A);
+ (*itr)->ToCreature()->setFaction(ci->faction);
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_SET_FACTION: Creature entry %u, GuidLow %u set faction to %u",
- (*itr)->GetEntry(), (*itr)->GetGUIDLow(), ci->faction_A);
+ (*itr)->GetEntry(), (*itr)->GetGUIDLow(), ci->faction);
}
}
}
diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
index 29d80f5fa6b..f4699f0519e 100644
--- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
+++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp
@@ -702,7 +702,7 @@ bool AuctionEntry::LoadFromDB(Field* fields)
return false;
}
- factionTemplateId = auctioneerInfo->faction_A;
+ factionTemplateId = auctioneerInfo->faction;
auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(factionTemplateId);
if (!auctionHouseEntry)
{
@@ -825,7 +825,7 @@ bool AuctionEntry::LoadFromFieldList(Field* fields)
return false;
}
- factionTemplateId = auctioneerInfo->faction_A;
+ factionTemplateId = auctioneerInfo->faction;
auctionHouseEntry = AuctionHouseMgr::GetAuctionHouseEntry(factionTemplateId);
if (!auctionHouseEntry)
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
index 72ffddadf56..c057591e4eb 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.cpp
@@ -569,7 +569,7 @@ void BattlegroundSA::ProcessEvent(WorldObject* obj, uint32 eventId, WorldObject*
if (Creature* c = obj->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f))
SendChatMessage(c, gate->DamagedText, invoker);
- PlaySoundToAll(Attackers == ALLIANCE ? SOUND_WALL_ATTACKED_ALLIANCE : SOUND_WALL_ATTACKED_HORDE);
+ PlaySoundToAll(Attackers == TEAM_ALLIANCE ? SOUND_WALL_ATTACKED_ALLIANCE : SOUND_WALL_ATTACKED_HORDE);
}
// destroyed
else if (eventId == go->GetGOInfo()->building.destroyedEvent)
@@ -617,7 +617,7 @@ void BattlegroundSA::ProcessEvent(WorldObject* obj, uint32 eventId, WorldObject*
if (Creature* c = obj->FindNearestCreature(NPC_WORLD_TRIGGER, 500.0f))
SendChatMessage(c, gate->DestroyedText, invoker);
- PlaySoundToAll(Attackers == ALLIANCE ? SOUND_WALL_DESTROYED_ALLIANCE : SOUND_WALL_DESTROYED_HORDE);
+ PlaySoundToAll(Attackers == TEAM_ALLIANCE ? SOUND_WALL_DESTROYED_ALLIANCE : SOUND_WALL_DESTROYED_HORDE);
}
else
break;
@@ -681,7 +681,7 @@ void BattlegroundSA::DemolisherStartState(bool start)
}
}
-void BattlegroundSA::DestroyGate(Player* player, GameObject* go)
+void BattlegroundSA::DestroyGate(Player* /*player*/, GameObject* /*go*/)
{
}
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
index 2a5c8fc15e4..8e3c933f893 100644
--- a/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundSA.h
@@ -20,6 +20,7 @@
#define __BATTLEGROUNDSA_H
#include "Battleground.h"
+#include "Object.h"
struct BattlegroundSAScore : public BattlegroundScore
{
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 58a55d263df..0a02339adfa 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -367,10 +367,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data)
if (!GetCreatureAddon())
SetSheath(SHEATH_STATE_MELEE);
- if (team == HORDE)
- setFaction(cInfo->faction_H);
- else
- setFaction(cInfo->faction_A);
+ setFaction(cInfo->faction);
uint32 npcflag, unit_flags, dynamicflags;
ObjectMgr::ChooseCreatureFlags(cInfo, npcflag, unit_flags, dynamicflags, data);
@@ -408,7 +405,7 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData* data)
UpdateAllStats();
// checked and error show at loading templates
- if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction_A))
+ if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction))
{
if (factionTemplate->factionFlags & FACTION_TEMPLATE_FLAG_PVP)
SetPvP(true);
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index 69c3d169170..e702df51637 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -88,8 +88,7 @@ struct CreatureTemplate
uint8 minlevel;
uint8 maxlevel;
uint32 expansion;
- uint32 faction_A;
- uint32 faction_H;
+ uint32 faction;
uint32 npcflag;
float speed_walk;
float speed_run;
diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h
index 3d308ee88c1..7bd253ab704 100644
--- a/src/server/game/Entities/Object/Object.h
+++ b/src/server/game/Entities/Object/Object.h
@@ -33,6 +33,7 @@
#define INTERACTION_DISTANCE 5.0f
#define ATTACK_DISTANCE 5.0f
#define INSPECT_DISTANCE 28.0f
+#define TRADE_DISTANCE 11.11f
#define MAX_VISIBILITY_DISTANCE SIZE_OF_GRIDS // max distance for visible objects
#define SIGHT_RANGE_UNIT 50.0f
#define DEFAULT_VISIBILITY_DISTANCE 90.0f // default visible distance, 90 yards on continents
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 11f1050684b..ecea7104c5e 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -6764,9 +6764,6 @@ bool Player::UpdatePosition(float x, float y, float z, float orientation, bool t
if (GetGroup())
SetGroupUpdateFlag(GROUP_UPDATE_FLAG_POSITION);
- if (GetTrader() && !IsWithinDistInMap(GetTrader(), INTERACTION_DISTANCE))
- GetSession()->SendCancelTrade();
-
CheckAreaExploreAndOutdoor();
return true;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index a6871cd9906..91c25a0f069 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -15952,10 +15952,7 @@ void Unit::RestoreFaction()
}
if (CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate()) // normal creature
- {
- FactionTemplateEntry const* faction = GetFactionTemplateEntry();
- setFaction((faction && faction->friendlyMask & 0x004) ? cinfo->faction_H : cinfo->faction_A);
- }
+ setFaction(cinfo->faction);
}
}
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index fce89b22b53..454ab920531 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -396,7 +396,7 @@ void ObjectMgr::LoadCreatureTemplates()
// 0 1 2 3 4 5 6 7 8
QueryResult result = WorldDatabase.Query("SELECT entry, difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, "
// 9 10 11 12 13 14 15 16 17 18 19 20 21
- "modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, "
+ "modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction, npcflag, speed_walk, speed_run, "
// 22 23 24 25 26 27 28 29 30 31 32 33
"scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, "
// 34 35 36 37 38 39 40 41 42 43
@@ -447,65 +447,64 @@ void ObjectMgr::LoadCreatureTemplates()
creatureTemplate.minlevel = fields[14].GetUInt8();
creatureTemplate.maxlevel = fields[15].GetUInt8();
creatureTemplate.expansion = uint32(fields[16].GetInt16());
- creatureTemplate.faction_A = uint32(fields[17].GetUInt16());
- creatureTemplate.faction_H = uint32(fields[18].GetUInt16());
- creatureTemplate.npcflag = fields[19].GetUInt32();
- creatureTemplate.speed_walk = fields[20].GetFloat();
- creatureTemplate.speed_run = fields[21].GetFloat();
- creatureTemplate.scale = fields[22].GetFloat();
- creatureTemplate.rank = uint32(fields[23].GetUInt8());
- creatureTemplate.mindmg = fields[24].GetFloat();
- creatureTemplate.maxdmg = fields[25].GetFloat();
- creatureTemplate.dmgschool = uint32(fields[26].GetInt8());
- creatureTemplate.attackpower = fields[27].GetUInt32();
- creatureTemplate.dmg_multiplier = fields[28].GetFloat();
- creatureTemplate.baseattacktime = fields[29].GetUInt32();
- creatureTemplate.rangeattacktime = fields[30].GetUInt32();
- creatureTemplate.unit_class = uint32(fields[31].GetUInt8());
- creatureTemplate.unit_flags = fields[32].GetUInt32();
- creatureTemplate.unit_flags2 = fields[33].GetUInt32();
- creatureTemplate.dynamicflags = fields[34].GetUInt32();
- creatureTemplate.family = uint32(fields[35].GetUInt8());
- creatureTemplate.trainer_type = uint32(fields[36].GetUInt8());
- creatureTemplate.trainer_spell = fields[37].GetUInt32();
- creatureTemplate.trainer_class = uint32(fields[38].GetUInt8());
- creatureTemplate.trainer_race = uint32(fields[39].GetUInt8());
- creatureTemplate.minrangedmg = fields[40].GetFloat();
- creatureTemplate.maxrangedmg = fields[41].GetFloat();
- creatureTemplate.rangedattackpower = uint32(fields[42].GetUInt16());
- creatureTemplate.type = uint32(fields[43].GetUInt8());
- creatureTemplate.type_flags = fields[44].GetUInt32();
- creatureTemplate.lootid = fields[45].GetUInt32();
- creatureTemplate.pickpocketLootId = fields[46].GetUInt32();
- creatureTemplate.SkinLootId = fields[47].GetUInt32();
+ creatureTemplate.faction = uint32(fields[17].GetUInt16());
+ creatureTemplate.npcflag = fields[18].GetUInt32();
+ creatureTemplate.speed_walk = fields[19].GetFloat();
+ creatureTemplate.speed_run = fields[20].GetFloat();
+ creatureTemplate.scale = fields[21].GetFloat();
+ creatureTemplate.rank = uint32(fields[22].GetUInt8());
+ creatureTemplate.mindmg = fields[23].GetFloat();
+ creatureTemplate.maxdmg = fields[24].GetFloat();
+ creatureTemplate.dmgschool = uint32(fields[25].GetInt8());
+ creatureTemplate.attackpower = fields[26].GetUInt32();
+ creatureTemplate.dmg_multiplier = fields[27].GetFloat();
+ creatureTemplate.baseattacktime = fields[28].GetUInt32();
+ creatureTemplate.rangeattacktime = fields[29].GetUInt32();
+ creatureTemplate.unit_class = uint32(fields[30].GetUInt8());
+ creatureTemplate.unit_flags = fields[31].GetUInt32();
+ creatureTemplate.unit_flags2 = fields[32].GetUInt32();
+ creatureTemplate.dynamicflags = fields[33].GetUInt32();
+ creatureTemplate.family = uint32(fields[34].GetUInt8());
+ creatureTemplate.trainer_type = uint32(fields[35].GetUInt8());
+ creatureTemplate.trainer_spell = fields[36].GetUInt32();
+ creatureTemplate.trainer_class = uint32(fields[37].GetUInt8());
+ creatureTemplate.trainer_race = uint32(fields[38].GetUInt8());
+ creatureTemplate.minrangedmg = fields[39].GetFloat();
+ creatureTemplate.maxrangedmg = fields[40].GetFloat();
+ creatureTemplate.rangedattackpower = uint32(fields[41].GetUInt16());
+ creatureTemplate.type = uint32(fields[42].GetUInt8());
+ creatureTemplate.type_flags = fields[43].GetUInt32();
+ creatureTemplate.lootid = fields[44].GetUInt32();
+ creatureTemplate.pickpocketLootId = fields[45].GetUInt32();
+ creatureTemplate.SkinLootId = fields[46].GetUInt32();
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
- creatureTemplate.resistance[i] = fields[48 + i -1].GetInt16();
+ creatureTemplate.resistance[i] = fields[47 + i -1].GetInt16();
for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i)
- creatureTemplate.spells[i] = fields[54 + i].GetUInt32();
-
- creatureTemplate.PetSpellDataId = fields[62].GetUInt32();
- creatureTemplate.VehicleId = fields[63].GetUInt32();
- creatureTemplate.mingold = fields[64].GetUInt32();
- creatureTemplate.maxgold = fields[65].GetUInt32();
- creatureTemplate.AIName = fields[66].GetString();
- creatureTemplate.MovementType = uint32(fields[67].GetUInt8());
- creatureTemplate.InhabitType = uint32(fields[68].GetUInt8());
- creatureTemplate.HoverHeight = fields[69].GetFloat();
- creatureTemplate.ModHealth = fields[70].GetFloat();
- creatureTemplate.ModMana = fields[71].GetFloat();
- creatureTemplate.ModArmor = fields[72].GetFloat();
- creatureTemplate.RacialLeader = fields[73].GetBool();
+ creatureTemplate.spells[i] = fields[53 + i].GetUInt32();
+
+ creatureTemplate.PetSpellDataId = fields[61].GetUInt32();
+ creatureTemplate.VehicleId = fields[62].GetUInt32();
+ creatureTemplate.mingold = fields[63].GetUInt32();
+ creatureTemplate.maxgold = fields[64].GetUInt32();
+ creatureTemplate.AIName = fields[65].GetString();
+ creatureTemplate.MovementType = uint32(fields[66].GetUInt8());
+ creatureTemplate.InhabitType = uint32(fields[67].GetUInt8());
+ creatureTemplate.HoverHeight = fields[68].GetFloat();
+ creatureTemplate.ModHealth = fields[69].GetFloat();
+ creatureTemplate.ModMana = fields[70].GetFloat();
+ creatureTemplate.ModArmor = fields[71].GetFloat();
+ creatureTemplate.RacialLeader = fields[72].GetBool();
for (uint8 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i)
- creatureTemplate.questItems[i] = fields[74 + i].GetUInt32();
+ creatureTemplate.questItems[i] = fields[73 + i].GetUInt32();
- creatureTemplate.movementId = fields[80].GetUInt32();
- creatureTemplate.RegenHealth = fields[81].GetBool();
- creatureTemplate.MechanicImmuneMask = fields[82].GetUInt32();
- creatureTemplate.flags_extra = fields[83].GetUInt32();
- creatureTemplate.ScriptID = GetScriptId(fields[84].GetCString());
+ creatureTemplate.movementId = fields[79].GetUInt32();
+ creatureTemplate.RegenHealth = fields[80].GetBool();
+ creatureTemplate.MechanicImmuneMask = fields[81].GetUInt32();
+ creatureTemplate.flags_extra = fields[82].GetUInt32();
+ creatureTemplate.ScriptID = GetScriptId(fields[83].GetCString());
++count;
}
@@ -637,37 +636,51 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
}
ok2 = true;
}
+
if (!ok2)
continue;
if (cInfo->expansion > difficultyInfo->expansion)
{
- TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, expansion %u) has different `expansion` in difficulty %u mode (Entry: %u, expansion %u).",
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, exp %u) has different `exp` in difficulty %u mode (Entry: %u, exp %u).",
cInfo->Entry, cInfo->expansion, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->expansion);
}
- if (cInfo->faction_A != difficultyInfo->faction_A)
+ if (cInfo->minlevel > difficultyInfo->minlevel)
+ {
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, minlevel %u) has different `minlevel` in difficulty %u mode (Entry: %u, minlevel %u).",
+ cInfo->Entry, cInfo->minlevel, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->minlevel);
+ }
+
+ if (cInfo->maxlevel > difficultyInfo->maxlevel)
{
- TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, faction_A %u) has different `faction_A` in difficulty %u mode (Entry: %u, faction_A %u).",
- cInfo->Entry, cInfo->faction_A, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->faction_A);
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, maxlevel %u) has different `maxlevel` in difficulty %u mode (Entry: %u, maxlevel %u).",
+ cInfo->Entry, cInfo->maxlevel, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->maxlevel);
}
- if (cInfo->faction_H != difficultyInfo->faction_H)
+ if (cInfo->faction != difficultyInfo->faction)
{
- TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, faction_H %u) has different `faction_H` in difficulty %u mode (Entry: %u, faction_H %u).",
- cInfo->Entry, cInfo->faction_H, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->faction_H);
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, faction %u) has different `faction` in difficulty %u mode (Entry: %u, faction %u).",
+ cInfo->Entry, cInfo->faction, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->faction);
+ TC_LOG_ERROR("sql.sql", "Possible FIX: UPDATE `creature_template` SET `faction`=%u WHERE `entry`=%u;",
+ cInfo->faction, cInfo->DifficultyEntry[diff]);
}
if (cInfo->unit_class != difficultyInfo->unit_class)
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, class %u) has different `unit_class` in difficulty %u mode (Entry: %u, class %u).",
cInfo->Entry, cInfo->unit_class, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->unit_class);
+ TC_LOG_ERROR("sql.sql", "Possible FIX: UPDATE `creature_template` SET `unit_class`=%u WHERE `entry`=%u;",
+ cInfo->unit_class, cInfo->DifficultyEntry[diff]);
continue;
}
if (cInfo->npcflag != difficultyInfo->npcflag)
{
- TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has different `npcflag` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, `npcflag`: %u) has different `npcflag` in difficulty %u mode (Entry: %u, `npcflag`: %u).",
+ cInfo->Entry, cInfo->npcflag, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->npcflag);
+ TC_LOG_ERROR("sql.sql", "Possible FIX: UPDATE `creature_template` SET `npcflag`=%u WHERE `entry`=%u;",
+ cInfo->npcflag, cInfo->DifficultyEntry[diff]);
continue;
}
@@ -675,23 +688,34 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, family %u) has different `family` in difficulty %u mode (Entry: %u, family %u).",
cInfo->Entry, cInfo->family, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->family);
+ TC_LOG_ERROR("sql.sql", "Possible FIX: UPDATE `creature_template` SET `family`=%u WHERE `entry`=%u;",
+ cInfo->family, cInfo->DifficultyEntry[diff]);
}
if (cInfo->trainer_class != difficultyInfo->trainer_class)
{
- TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has different `trainer_class` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, trainer_class: %u) has different `trainer_class` in difficulty %u mode (Entry: %u, trainer_class: %u).",
+ cInfo->Entry, cInfo->trainer_class, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->trainer_class);
+ TC_LOG_ERROR("sql.sql", "Possible FIX: UPDATE `creature_template` SET `trainer_class`=%u WHERE `entry`=%u;",
+ cInfo->trainer_class, cInfo->DifficultyEntry[diff]);
continue;
}
if (cInfo->trainer_race != difficultyInfo->trainer_race)
{
- TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has different `trainer_race` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, trainer_race: %u) has different `trainer_race` in difficulty %u mode (Entry: %u, trainer_race: %u).",
+ cInfo->Entry, cInfo->trainer_race, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->trainer_race);
+ TC_LOG_ERROR("sql.sql", "Possible FIX: UPDATE `creature_template` SET `trainer_race`=%u WHERE `entry`=%u;",
+ cInfo->trainer_race, cInfo->DifficultyEntry[diff]);
continue;
}
if (cInfo->trainer_type != difficultyInfo->trainer_type)
{
- TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has different `trainer_type` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]);
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, trainer_type: %u) has different `trainer_type` in difficulty %u mode (Entry: %u, trainer_type: %u).",
+ cInfo->Entry, cInfo->trainer_type, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->trainer_type);
+ TC_LOG_ERROR("sql.sql", "Possible FIX: UPDATE `creature_template` SET `trainer_type`=%u WHERE `entry`=%u;",
+ cInfo->trainer_type, cInfo->DifficultyEntry[diff]);
continue;
}
@@ -705,6 +729,8 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
{
TC_LOG_ERROR("sql.sql", "Creature (Entry: %u, type %u) has different `type` in difficulty %u mode (Entry: %u, type %u).",
cInfo->Entry, cInfo->type, diff + 1, cInfo->DifficultyEntry[diff], difficultyInfo->type);
+ TC_LOG_ERROR("sql.sql", "Possible FIX: UPDATE `creature_template` SET `type`=%u WHERE `entry`=%u;",
+ cInfo->type, cInfo->DifficultyEntry[diff]);
}
if (!cInfo->VehicleId && difficultyInfo->VehicleId)
@@ -732,13 +758,9 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
ok = true;
}
- FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction_A);
- if (!factionTemplate)
- TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has non-existing faction_A template (%u).", cInfo->Entry, cInfo->faction_A);
-
- factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction_H);
+ FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction);
if (!factionTemplate)
- TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has non-existing faction_H template (%u).", cInfo->Entry, cInfo->faction_H);
+ TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has non-existing faction template (%u).", cInfo->Entry, cInfo->faction);
// used later for scale
CreatureDisplayInfoEntry const* displayScaleEntry = NULL;
diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp
index 28a511ad9d3..4372de9eafe 100644
--- a/src/server/game/Handlers/TradeHandler.cpp
+++ b/src/server/game/Handlers/TradeHandler.cpp
@@ -276,6 +276,13 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
// set before checks for propertly undo at problems (it already set in to client)
my_trade->SetAccepted(true);
+ if (!_player->IsWithinDistInMap(trader, TRADE_DISTANCE, false))
+ {
+ SendTradeStatus(TRADE_STATUS_TARGET_TO_FAR);
+ my_trade->SetAccepted(false);
+ return;
+ }
+
// not accept case incorrect money amount
if (!_player->HasEnoughMoney(my_trade->GetMoney()))
{
@@ -648,7 +655,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
return;
}
- if (!pOther->IsWithinDistInMap(_player, 10.0f, false))
+ if (!pOther->IsWithinDistInMap(_player, TRADE_DISTANCE, false))
{
SendTradeStatus(TRADE_STATUS_TARGET_TO_FAR);
return;
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index b87524357d2..0175c685076 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -6099,7 +6099,7 @@ void AuraEffect::HandlePeriodicHealAurasTick(Unit* target, Unit* caster) const
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)
+ if (!haveCastItem && GetAuraType() != SPELL_AURA_OBS_MOD_HEALTH)
caster->ProcDamageAndSpell(target, procAttacker, procVictim, procEx, damage, BASE_ATTACK, GetSpellInfo());
}
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 0342b22d735..548685b9bb6 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -813,7 +813,7 @@ bool SpellMgr::IsSpellProcEventCanTriggeredBy(SpellProcEventEntry const* spellPr
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)
+ if ((EventProcFlag == PROC_FLAG_DONE_PERIODIC && procFlags == PROC_FLAG_DONE_PERIODIC) || (EventProcFlag == PROC_FLAG_TAKEN_PERIODIC && procFlags == PROC_FLAG_TAKEN_PERIODIC))
return true;
if (procFlags & PROC_FLAG_DONE_PERIODIC && EventProcFlag & PROC_FLAG_DONE_PERIODIC)
diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp
index 77592ab4a8e..72aaa17394f 100644
--- a/src/server/game/Texts/CreatureTextMgr.cpp
+++ b/src/server/game/Texts/CreatureTextMgr.cpp
@@ -82,7 +82,7 @@ void CreatureTextMgr::LoadCreatureTexts()
if (!result)
{
- TC_LOG_INFO("server.loading", ">> Loaded 0 ceature texts. DB table `creature_texts` is empty.");
+ TC_LOG_INFO("server.loading", ">> Loaded 0 ceature texts. DB table `creature_text` is empty.");
return;
}
@@ -111,20 +111,20 @@ void CreatureTextMgr::LoadCreatureTexts()
{
if (!sSoundEntriesStore.LookupEntry(temp.sound))
{
- TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Sound %u but sound does not exist.", temp.entry, temp.group, temp.sound);
+ TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Sound %u but sound does not exist.", temp.entry, temp.group, temp.sound);
temp.sound = 0;
}
}
if (!GetLanguageDescByID(temp.lang))
{
- TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` using Language %u but Language does not exist.", temp.entry, temp.group, uint32(temp.lang));
+ TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` using Language %u but Language does not exist.", temp.entry, temp.group, uint32(temp.lang));
temp.lang = LANG_UNIVERSAL;
}
if (temp.type >= MAX_CHAT_MSG_TYPE)
{
- TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Type %u but this Chat Type does not exist.", temp.entry, temp.group, uint32(temp.type));
+ TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Type %u but this Chat Type does not exist.", temp.entry, temp.group, uint32(temp.type));
temp.type = CHAT_MSG_SAY;
}
@@ -132,7 +132,7 @@ void CreatureTextMgr::LoadCreatureTexts()
{
if (!sEmotesStore.LookupEntry(temp.emote))
{
- TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_texts` has Emote %u but emote does not exist.", temp.entry, temp.group, uint32(temp.emote));
+ TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u in table `creature_text` has Emote %u but emote does not exist.", temp.entry, temp.group, uint32(temp.emote));
temp.emote = EMOTE_ONESHOT_NONE;
}
}
@@ -141,7 +141,7 @@ void CreatureTextMgr::LoadCreatureTexts()
{
if (!sObjectMgr->GetBroadcastText(temp.BroadcastTextId))
{
- TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u, Id %u in table `creature_texts` has non-existing or incompatible BroadcastTextId %u.", temp.entry, temp.group, temp.id, temp.BroadcastTextId);
+ TC_LOG_ERROR("sql.sql", "CreatureTextMgr: Entry %u, Group %u, Id %u in table `creature_text` has non-existing or incompatible BroadcastTextId %u.", temp.entry, temp.group, temp.id, temp.BroadcastTextId);
temp.BroadcastTextId = 0;
}
}
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index a5b13301403..9856a77b61f 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -596,17 +596,13 @@ public:
// Update in memory..
if (CreatureTemplate const* cinfo = creature->GetCreatureTemplate())
- {
- const_cast<CreatureTemplate*>(cinfo)->faction_A = factionId;
- const_cast<CreatureTemplate*>(cinfo)->faction_H = factionId;
- }
+ const_cast<CreatureTemplate*>(cinfo)->faction = factionId;
// ..and DB
PreparedStatement* stmt = WorldDatabase.GetPreparedStatement(WORLD_UPD_CREATURE_FACTION);
stmt->setUInt16(0, uint16(factionId));
- stmt->setUInt16(1, uint16(factionId));
- stmt->setUInt32(2, creature->GetEntry());
+ stmt->setUInt32(1, creature->GetEntry());
WorldDatabase.Execute(stmt);
diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp
index 4de697f2597..89dc08d5737 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -456,72 +456,71 @@ public:
cInfo->minlevel = fields[13].GetUInt8();
cInfo->maxlevel = fields[14].GetUInt8();
cInfo->expansion = fields[15].GetUInt16();
- cInfo->faction_A = fields[16].GetUInt16();
- cInfo->faction_H = fields[17].GetUInt16();
- cInfo->npcflag = fields[18].GetUInt32();
- cInfo->speed_walk = fields[19].GetFloat();
- cInfo->speed_run = fields[20].GetFloat();
- cInfo->scale = fields[21].GetFloat();
- cInfo->rank = fields[22].GetUInt8();
- cInfo->mindmg = fields[23].GetFloat();
- cInfo->maxdmg = fields[24].GetFloat();
- cInfo->dmgschool = fields[25].GetUInt8();
- cInfo->attackpower = fields[26].GetUInt32();
- cInfo->dmg_multiplier = fields[27].GetFloat();
- cInfo->baseattacktime = fields[28].GetUInt32();
- cInfo->rangeattacktime = fields[29].GetUInt32();
- cInfo->unit_class = fields[30].GetUInt8();
- cInfo->unit_flags = fields[31].GetUInt32();
- cInfo->unit_flags2 = fields[32].GetUInt32();
- cInfo->dynamicflags = fields[33].GetUInt32();
- cInfo->family = fields[34].GetUInt8();
- cInfo->trainer_type = fields[35].GetUInt8();
- cInfo->trainer_spell = fields[36].GetUInt32();
- cInfo->trainer_class = fields[37].GetUInt8();
- cInfo->trainer_race = fields[38].GetUInt8();
- cInfo->minrangedmg = fields[39].GetFloat();
- cInfo->maxrangedmg = fields[40].GetFloat();
- cInfo->rangedattackpower = fields[41].GetUInt16();
- cInfo->type = fields[42].GetUInt8();
- cInfo->type_flags = fields[43].GetUInt32();
- cInfo->lootid = fields[44].GetUInt32();
- cInfo->pickpocketLootId = fields[45].GetUInt32();
- cInfo->SkinLootId = fields[46].GetUInt32();
+ cInfo->faction = fields[16].GetUInt16();
+ cInfo->npcflag = fields[17].GetUInt32();
+ cInfo->speed_walk = fields[18].GetFloat();
+ cInfo->speed_run = fields[19].GetFloat();
+ cInfo->scale = fields[20].GetFloat();
+ cInfo->rank = fields[21].GetUInt8();
+ cInfo->mindmg = fields[22].GetFloat();
+ cInfo->maxdmg = fields[23].GetFloat();
+ cInfo->dmgschool = fields[24].GetUInt8();
+ cInfo->attackpower = fields[25].GetUInt32();
+ cInfo->dmg_multiplier = fields[26].GetFloat();
+ cInfo->baseattacktime = fields[27].GetUInt32();
+ cInfo->rangeattacktime = fields[28].GetUInt32();
+ cInfo->unit_class = fields[29].GetUInt8();
+ cInfo->unit_flags = fields[30].GetUInt32();
+ cInfo->unit_flags2 = fields[31].GetUInt32();
+ cInfo->dynamicflags = fields[32].GetUInt32();
+ cInfo->family = fields[33].GetUInt8();
+ cInfo->trainer_type = fields[34].GetUInt8();
+ cInfo->trainer_spell = fields[35].GetUInt32();
+ cInfo->trainer_class = fields[36].GetUInt8();
+ cInfo->trainer_race = fields[37].GetUInt8();
+ cInfo->minrangedmg = fields[38].GetFloat();
+ cInfo->maxrangedmg = fields[39].GetFloat();
+ cInfo->rangedattackpower = fields[40].GetUInt16();
+ cInfo->type = fields[41].GetUInt8();
+ cInfo->type_flags = fields[42].GetUInt32();
+ cInfo->lootid = fields[43].GetUInt32();
+ cInfo->pickpocketLootId = fields[44].GetUInt32();
+ cInfo->SkinLootId = fields[45].GetUInt32();
for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
- cInfo->resistance[i] = fields[47 + i -1].GetUInt16();
-
- cInfo->spells[0] = fields[53].GetUInt32();
- cInfo->spells[1] = fields[54].GetUInt32();
- cInfo->spells[2] = fields[55].GetUInt32();
- cInfo->spells[3] = fields[56].GetUInt32();
- cInfo->spells[4] = fields[57].GetUInt32();
- cInfo->spells[5] = fields[58].GetUInt32();
- cInfo->spells[6] = fields[59].GetUInt32();
- cInfo->spells[7] = fields[60].GetUInt32();
- cInfo->PetSpellDataId = fields[61].GetUInt32();
- cInfo->VehicleId = fields[62].GetUInt32();
- cInfo->mingold = fields[63].GetUInt32();
- cInfo->maxgold = fields[64].GetUInt32();
- cInfo->AIName = fields[65].GetString();
- cInfo->MovementType = fields[66].GetUInt8();
- cInfo->InhabitType = fields[67].GetUInt8();
- cInfo->HoverHeight = fields[68].GetFloat();
- cInfo->ModHealth = fields[69].GetFloat();
- cInfo->ModMana = fields[70].GetFloat();
- cInfo->ModArmor = fields[71].GetFloat();
- cInfo->RacialLeader = fields[72].GetBool();
- cInfo->questItems[0] = fields[73].GetUInt32();
- cInfo->questItems[1] = fields[74].GetUInt32();
- cInfo->questItems[2] = fields[75].GetUInt32();
- cInfo->questItems[3] = fields[76].GetUInt32();
- cInfo->questItems[4] = fields[77].GetUInt32();
- cInfo->questItems[5] = fields[78].GetUInt32();
- cInfo->movementId = fields[79].GetUInt32();
- cInfo->RegenHealth = fields[80].GetBool();
- cInfo->MechanicImmuneMask = fields[81].GetUInt32();
- cInfo->flags_extra = fields[82].GetUInt32();
- cInfo->ScriptID = sObjectMgr->GetScriptId(fields[83].GetCString());
+ cInfo->resistance[i] = fields[46 + i -1].GetUInt16();
+
+ cInfo->spells[0] = fields[52].GetUInt32();
+ cInfo->spells[1] = fields[53].GetUInt32();
+ cInfo->spells[2] = fields[54].GetUInt32();
+ cInfo->spells[3] = fields[55].GetUInt32();
+ cInfo->spells[4] = fields[56].GetUInt32();
+ cInfo->spells[5] = fields[57].GetUInt32();
+ cInfo->spells[6] = fields[58].GetUInt32();
+ cInfo->spells[7] = fields[59].GetUInt32();
+ cInfo->PetSpellDataId = fields[60].GetUInt32();
+ cInfo->VehicleId = fields[61].GetUInt32();
+ cInfo->mingold = fields[62].GetUInt32();
+ cInfo->maxgold = fields[63].GetUInt32();
+ cInfo->AIName = fields[64].GetString();
+ cInfo->MovementType = fields[65].GetUInt8();
+ cInfo->InhabitType = fields[66].GetUInt8();
+ cInfo->HoverHeight = fields[67].GetFloat();
+ cInfo->ModHealth = fields[68].GetFloat();
+ cInfo->ModMana = fields[69].GetFloat();
+ cInfo->ModArmor = fields[70].GetFloat();
+ cInfo->RacialLeader = fields[71].GetBool();
+ cInfo->questItems[0] = fields[72].GetUInt32();
+ cInfo->questItems[1] = fields[73].GetUInt32();
+ cInfo->questItems[2] = fields[74].GetUInt32();
+ cInfo->questItems[3] = fields[75].GetUInt32();
+ cInfo->questItems[4] = fields[76].GetUInt32();
+ cInfo->questItems[5] = fields[77].GetUInt32();
+ cInfo->movementId = fields[78].GetUInt32();
+ cInfo->RegenHealth = fields[79].GetBool();
+ cInfo->MechanicImmuneMask = fields[80].GetUInt32();
+ cInfo->flags_extra = fields[81].GetUInt32();
+ cInfo->ScriptID = sObjectMgr->GetScriptId(fields[82].GetCString());
sObjectMgr->CheckCreatureTemplate(cInfo);
}
diff --git a/src/server/scripts/Northrend/zone_sholazar_basin.cpp b/src/server/scripts/Northrend/zone_sholazar_basin.cpp
index 6e39d341c58..770a95c23d7 100644
--- a/src/server/scripts/Northrend/zone_sholazar_basin.cpp
+++ b/src/server/scripts/Northrend/zone_sholazar_basin.cpp
@@ -1021,7 +1021,14 @@ public:
void PassengerBoarded(Unit* passenger, int8 /*seatId*/, bool apply) OVERRIDE
{
if (apply && passenger->GetTypeId() == TYPEID_PLAYER)
+ {
+ /// @workaround - Because accessory gets unmounted when using vehicle_template_accessory.
+ /// When vehicle spawns accessory is mounted to seat 0,but when player mounts
+ /// he uses the same seat (instead of mounting to seat 1) kicking the accessory out.
+ passenger->ChangeSeat(1, false);
+ me->GetVehicleKit()->InstallAccessory(NPC_PILOT, 0, true, TEMPSUMMON_DEAD_DESPAWN, 0);
me->GetMotionMaster()->MovePath(NPC_PLANE, false);
+ }
}
void MovementInform(uint32 type, uint32 id) OVERRIDE
@@ -1056,6 +1063,7 @@ public:
case 25:
Talk(PLANE_EMOTE);
DoCast(SPELL_ENGINE);
+ me->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FORCE_MOVEMENT);
break;
}
}
diff --git a/src/server/scripts/Northrend/zone_zuldrak.cpp b/src/server/scripts/Northrend/zone_zuldrak.cpp
index 0f542b3aca7..fbf9a38512b 100644
--- a/src/server/scripts/Northrend/zone_zuldrak.cpp
+++ b/src/server/scripts/Northrend/zone_zuldrak.cpp
@@ -148,7 +148,7 @@ public:
me->RemoveAurasDueToSpell(SPELL_LEFT_CHAIN);
me->RemoveAurasDueToSpell(SPELL_RIGHT_CHAIN);
me->RemoveAurasDueToSpell(SPELL_KNEEL);
- me->setFaction(me->GetCreatureTemplate()->faction_H);
+ me->setFaction(me->GetCreatureTemplate()->faction);
DoCast(me, SPELL_UNSHACKLED, true);
Talk(SAY_RAGECLAW);
me->GetMotionMaster()->MoveRandom(10);
diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp
index 78fd859ea8f..d0e9c463ad7 100644
--- a/src/server/shared/Database/Implementation/WorldDatabase.cpp
+++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp
@@ -38,7 +38,7 @@ void WorldDatabaseConnection::DoPrepareStatements()
PrepareStatement(WORLD_DEL_NPC_VENDOR, "DELETE FROM npc_vendor WHERE entry = ? AND item = ?", CONNECTION_ASYNC);
PrepareStatement(WORLD_SEL_NPC_VENDOR_REF, "SELECT item, maxcount, incrtime, ExtendedCost FROM npc_vendor WHERE entry = ? ORDER BY slot ASC", CONNECTION_SYNCH);
PrepareStatement(WORLD_UPD_CREATURE_MOVEMENT_TYPE, "UPDATE creature SET MovementType = ? WHERE guid = ?", CONNECTION_ASYNC);
- PrepareStatement(WORLD_UPD_CREATURE_FACTION, "UPDATE creature_template SET faction_A = ?, faction_H = ? WHERE entry = ?", CONNECTION_ASYNC);
+ PrepareStatement(WORLD_UPD_CREATURE_FACTION, "UPDATE creature_template SET faction = ? WHERE entry = ?", CONNECTION_ASYNC);
PrepareStatement(WORLD_UPD_CREATURE_NPCFLAG, "UPDATE creature_template SET npcflag = ? WHERE entry = ?", CONNECTION_ASYNC);
PrepareStatement(WORLD_UPD_CREATURE_POSITION, "UPDATE creature SET position_x = ?, position_y = ?, position_z = ?, orientation = ? WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(WORLD_UPD_CREATURE_SPAWN_DISTANCE, "UPDATE creature SET spawndist = ?, MovementType = ? WHERE guid = ?", CONNECTION_ASYNC);
@@ -76,7 +76,7 @@ void WorldDatabaseConnection::DoPrepareStatements()
PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_ID_BY_GUID, "SELECT id FROM waypoint_scripts WHERE guid = ?", CONNECTION_SYNCH);
PrepareStatement(WORLD_DEL_CREATURE, "DELETE FROM creature WHERE guid = ?", CONNECTION_ASYNC);
PrepareStatement(WORLD_SEL_COMMANDS, "SELECT name, permission, help FROM command", CONNECTION_SYNCH);
- PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH);
+ PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH);
PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH);
PrepareStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH);
PrepareStatement(WORLD_SEL_CREATURE_BY_ID, "SELECT guid FROM creature WHERE id = ?", CONNECTION_SYNCH);