aboutsummaryrefslogtreecommitdiff
path: root/src/server/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game')
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScriptMgr.cpp1
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAB.cpp3
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAB.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAV.cpp3
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundAV.h2
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundEY.cpp3
-rwxr-xr-xsrc/server/game/Battlegrounds/Zones/BattlegroundEY.h2
-rwxr-xr-xsrc/server/game/Conditions/ConditionMgr.cpp2
-rwxr-xr-xsrc/server/game/DungeonFinding/LFGMgr.cpp2
-rwxr-xr-xsrc/server/game/Entities/Player/Player.cpp25
-rwxr-xr-xsrc/server/game/Entities/Player/Player.h6
-rwxr-xr-xsrc/server/game/Entities/Unit/Unit.cpp8
-rwxr-xr-xsrc/server/game/Entities/Vehicle/Vehicle.cpp4
-rwxr-xr-xsrc/server/game/Groups/Group.cpp4
-rwxr-xr-xsrc/server/game/Movement/MotionMaster.cpp9
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp14
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h2
-rwxr-xr-xsrc/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp7
-rwxr-xr-xsrc/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp16
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp14
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuras.cpp14
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuras.h3
23 files changed, 103 insertions, 45 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index 1a26e241c5e..01fb936b847 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -46,7 +46,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
// spawn in run mode
me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALKING);
- mRun = true;
+ mRun = false;
me->GetPosition(&mLastOOCPos);
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
index 15423c7aff2..ce357393515 100644
--- a/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.cpp
@@ -282,6 +282,7 @@ bool SmartAIMgr::IsTargetValid(SmartScriptHolder const& e)
case SMART_TARGET_HOSTILE_RANDOM:
case SMART_TARGET_HOSTILE_RANDOM_NOT_TOP:
case SMART_TARGET_ACTION_INVOKER:
+ case SMART_TARGET_INVOKER_PARTY:
case SMART_TARGET_POSITION:
case SMART_TARGET_NONE:
case SMART_TARGET_ACTION_INVOKER_VEHICLE:
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
index d64b2a9913d..5e529768c04 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.cpp
@@ -202,6 +202,9 @@ void BattlegroundAB::StartingEventOpenDoors()
}
DoorOpen(BG_AB_OBJECT_GATE_A);
DoorOpen(BG_AB_OBJECT_GATE_H);
+
+ // Achievement: Let's Get This Done
+ StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, AB_EVENT_START_BATTLE);
}
void BattlegroundAB::AddPlayer(Player* player)
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
index 38c8f4a21d4..c86076f0250 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAB.h
@@ -181,6 +181,8 @@ enum BG_AB_Objectives
#define BG_AB_NotABBGWeekendReputationTicks 200
#define BG_AB_ABBGWeekendReputationTicks 150
+#define AB_EVENT_START_BATTLE 9158 // Achievement: Let's Get This Done
+
// x, y, z, o
const float BG_AB_NodePositions[BG_AB_DYNAMIC_NODES_COUNT][4] = {
{1166.785f, 1200.132f, -56.70859f, 0.9075713f}, // stables
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
index 01f62bfcf35..f2e8c2bf0af 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.cpp
@@ -420,6 +420,9 @@ void BattlegroundAV::StartingEventOpenDoors()
DoorOpen(BG_AV_OBJECT_DOOR_H);
DoorOpen(BG_AV_OBJECT_DOOR_A);
+
+ // Achievement: The Alterac Blitz
+ StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, AV_EVENT_START_BATTLE);
}
void BattlegroundAV::AddPlayer(Player* player)
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
index e2902f8fd2d..82e231c63fa 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundAV.h
@@ -50,6 +50,8 @@ class Battleground;
#define BG_AV_KILL_SURVIVING_CAPTAIN 2
#define BG_AV_REP_SURVIVING_CAPTAIN 125
+#define AV_EVENT_START_BATTLE 9166 // Achievement: The Alterac Blitz
+
enum BG_AV_Sounds
{ //TODO: get out if there comes a sound when neutral team captures mine
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
index 4595a061e1a..1e7f79b8391 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.cpp
@@ -120,6 +120,9 @@ void BattlegroundEY::StartingEventOpenDoors()
uint8 buff = urand(0, 2);
SpawnBGObject(BG_EY_OBJECT_SPEEDBUFF_FEL_REAVER + buff + i * 3, RESPAWN_IMMEDIATELY);
}
+
+ // Achievement: Flurry
+ StartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, EY_EVENT_START_BATTLE);
}
void BattlegroundEY::AddPoints(uint32 Team, uint32 Points)
diff --git a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
index 5f89e0d7021..baa9ca30cff 100755
--- a/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
+++ b/src/server/game/Battlegrounds/Zones/BattlegroundEY.h
@@ -220,6 +220,8 @@ enum EYBattlegroundObjectTypes
#define BG_EY_NotEYWeekendHonorTicks 330
#define BG_EY_EYWeekendHonorTicks 200
+#define EY_EVENT_START_BATTLE 13180 // Achievement: Flurry
+
enum BG_EY_Score
{
BG_EY_WARNING_NEAR_VICTORY_SCORE = 1400,
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index 0bcd1a7864b..49b5d4cba65 100755
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -63,7 +63,7 @@ bool Condition::Meets(Player* player, Unit* invoker)
case CONDITION_REPUTATION_RANK:
{
if (FactionEntry const* faction = sFactionStore.LookupEntry(mConditionValue1))
- condMeets = uint32(player->GetReputationMgr().GetRank(faction)) == mConditionValue2;
+ condMeets = (mConditionValue2 & (1 << player->GetReputationMgr().GetRank(faction)));
break;
}
case CONDITION_ACHIEVEMENT:
diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp
index 0f146598a6e..ac7343e8f23 100755
--- a/src/server/game/DungeonFinding/LFGMgr.cpp
+++ b/src/server/game/DungeonFinding/LFGMgr.cpp
@@ -483,7 +483,7 @@ void LFGMgr::InitializeLockedDungeons(Player* player)
void LFGMgr::Join(Player* player, uint8 roles, const LfgDungeonSet& selectedDungeons, const std::string& comment)
{
if (!player || !player->GetSession() || selectedDungeons.empty())
- return;
+ return;
Group* grp = player->GetGroup();
uint64 guid = player->GetGUID();
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index bed3c0cb1a7..ce80d7a7af3 100755
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -296,15 +296,24 @@ Item* TradeData::GetItem(TradeSlots slot) const
return m_items[slot] ? m_player->GetItemByGuid(m_items[slot]) : NULL;
}
-bool TradeData::HasItem(uint64 item_guid) const
+bool TradeData::HasItem(uint64 itemGuid) const
{
for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i)
- if (m_items[i] == item_guid)
+ if (m_items[i] == itemGuid)
return true;
return false;
}
+TradeSlots const TradeData::GetTradeSlotForItem(uint64 itemGuid)
+{
+ for (uint8 i = 0; i < TRADE_SLOT_COUNT; ++i)
+ if (m_items[i] == itemGuid)
+ return TradeSlots(i);
+
+ return TRADE_SLOT_INVALID;
+}
+
Item* TradeData::GetSpellCastItem() const
{
return m_spellCastItem ? m_player->GetItemByGuid(m_spellCastItem) : NULL;
@@ -12805,6 +12814,14 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
return;
}
+ //! If trading
+ if (TradeData* tradeData = GetTradeData())
+ {
+ //! If current item is in trade window (only possible with packet spoofing - silent return)
+ if (tradeData->GetTradeSlotForItem(pSrcItem->GetGUID()) != TRADE_SLOT_INVALID)
+ return;
+ }
+
sLog->outDebug(LOG_FILTER_PLAYER_ITEMS, "STORAGE: SplitItem bag = %u, slot = %u, item = %u, count = %u", dstbag, dstslot, pSrcItem->GetEntry(), count);
Item* pNewItem = pSrcItem->CloneItem(count, this);
if (!pNewItem)
@@ -12833,7 +12850,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
pSrcItem->SetState(ITEM_CHANGED, this);
StoreItem(dest, pNewItem, true);
}
- else if (IsBankPos (dst))
+ else if (IsBankPos(dst))
{
// change item amount before check (for unique max count check)
pSrcItem->SetCount(pSrcItem->GetCount() - count);
@@ -12853,7 +12870,7 @@ void Player::SplitItem(uint16 src, uint16 dst, uint32 count)
pSrcItem->SetState(ITEM_CHANGED, this);
BankItem(dest, pNewItem, true);
}
- else if (IsEquipmentPos (dst))
+ else if (IsEquipmentPos(dst))
{
// change item amount before check (for unique max count check), provide space for splitted items
pSrcItem->SetCount(pSrcItem->GetCount() - count);
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 7a455590506..fccd380bd29 100755
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -686,7 +686,8 @@ enum TradeSlots
{
TRADE_SLOT_COUNT = 7,
TRADE_SLOT_TRADED_COUNT = 6,
- TRADE_SLOT_NONTRADED = 6
+ TRADE_SLOT_NONTRADED = 6,
+ TRADE_SLOT_INVALID = -1,
};
enum TransferAbortReason
@@ -1001,7 +1002,8 @@ class TradeData
TradeData* GetTraderData() const;
Item* GetItem(TradeSlots slot) const;
- bool HasItem(uint64 item_guid) const;
+ bool HasItem(uint64 itemGuid) const;
+ TradeSlots const GetTradeSlotForItem(uint64 itemGuid);
void SetItem(TradeSlots slot, Item* item);
uint32 GetSpell() const { return m_spell; }
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 63aa7771063..6bab63acf1b 100755
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -2114,12 +2114,12 @@ void Unit::SendMeleeAttackStart(Unit* victim)
void Unit::SendMeleeAttackStop(Unit* victim)
{
- WorldPacket data(SMSG_ATTACKSTOP, (8+8+4)); // we guess size
+ WorldPacket data(SMSG_ATTACKSTOP, (8+8+4));
data.append(GetPackGUID());
data.append(victim ? victim->GetPackGUID() : 0); // can be 0x00...
data << uint32(0); // can be 0x1
SendMessageToSet(&data, true);
- sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTART");
+ sLog->outStaticDebug("WORLD: Sent SMSG_ATTACKSTOP");
if (victim)
sLog->outDetail("%s %u stopped attacking %s %u", (GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature"), GetGUIDLow(), (victim->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), victim->GetGUIDLow());
@@ -7068,6 +7068,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere
return false;
basepoints0 = CalculatePctN(int32(damage), triggerAmount);
triggered_spell_id = 58879;
+ // Cast on spirit wolf
+ CastCustomSpell(this, triggered_spell_id, &basepoints0, NULL, NULL, true, NULL, triggeredByAura);
break;
}
// Shaman T8 Elemental 4P Bonus
@@ -15847,6 +15849,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
case CHARM_TYPE_VEHICLE:
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
charmer->ToPlayer()->SetClientControl(this, 1);
+ charmer->ToPlayer()->SetMover(this);
charmer->ToPlayer()->SetViewpoint(this, true);
charmer->ToPlayer()->VehicleSpellInitialize();
break;
@@ -15855,6 +15858,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED);
charmer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
charmer->ToPlayer()->SetClientControl(this, 1);
+ charmer->ToPlayer()->SetMover(this);
charmer->ToPlayer()->SetViewpoint(this, true);
charmer->ToPlayer()->PossessSpellInitialize();
break;
diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp
index b3531d585c3..7e4bebaab95 100755
--- a/src/server/game/Entities/Vehicle/Vehicle.cpp
+++ b/src/server/game/Entities/Vehicle/Vehicle.cpp
@@ -359,7 +359,6 @@ bool Vehicle::AddPassenger(Unit* unit, int8 seatId)
{
if (!_me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE))
ASSERT(false);
- unit->ToPlayer()->SetMover(this->GetBase());
}
if (_me->IsInWorld())
@@ -411,10 +410,7 @@ void Vehicle::RemovePassenger(Unit* unit)
unit->ClearUnitState(UNIT_STAT_ONVEHICLE);
if (_me->GetTypeId() == TYPEID_UNIT && unit->GetTypeId() == TYPEID_PLAYER && seat->first == 0 && seat->second.SeatInfo->m_flags & VEHICLE_SEAT_FLAG_CAN_CONTROL)
- {
_me->RemoveCharmedBy(unit);
- unit->ToPlayer()->SetMover(unit->ToPlayer());
- }
if (_me->IsInWorld())
{
diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp
index 19bc1ab7dea..b31b632e963 100755
--- a/src/server/game/Groups/Group.cpp
+++ b/src/server/game/Groups/Group.cpp
@@ -203,7 +203,9 @@ void Group::LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup,
// skip non-existed member
if (!sObjectMgr->GetPlayerNameByGUID(member.guid, member.name))
{
- CharacterDatabase.PQuery("DELETE FROM group_member WHERE memberGuid=%u", guidLow);
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GROUP_MEMBER);
+ stmt->setUInt32(0, guidLow);
+ CharacterDatabase.Execute(stmt);
return;
}
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp
index c17f5096748..8975a2d7d7b 100755
--- a/src/server/game/Movement/MotionMaster.cpp
+++ b/src/server/game/Movement/MotionMaster.cpp
@@ -307,7 +307,7 @@ void MotionMaster::MoveLand(uint32 id, Position const& pos, float speed)
init.SetVelocity(speed);
init.SetAnimation(Movement::ToGround);
init.Launch();
- Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED);
+ Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE);
}
void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, float speed)
@@ -322,7 +322,7 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos, float speed)
init.SetVelocity(speed);
init.SetAnimation(Movement::ToFly);
init.Launch();
- Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED);
+ Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE);
}
void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ)
@@ -365,7 +365,10 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee
init.SetParabolic(max_height,0);
init.SetVelocity(speedXY);
init.Launch();
- Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED);
+ if (i_owner->GetTypeId() == TYPEID_PLAYER)
+ Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED);
+ else
+ Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE);
}
void MotionMaster::MoveFall(uint32 id/*=0*/)
diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
index bded2fd512c..b03e13f91f4 100755
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.cpp
@@ -211,6 +211,19 @@ void ChaseMovementGenerator<T>::Reset(T &owner)
Initialize(owner);
}
+template<class T>
+void ChaseMovementGenerator<T>::MovementInform(T & /*unit*/)
+{
+}
+
+template<>
+void ChaseMovementGenerator<Creature>::MovementInform(Creature &unit)
+{
+ // Pass back the GUIDLow of the target. If it is pet's owner then PetAI will handle
+ if (unit.AI())
+ unit.AI()->MovementInform(CHASE_MOTION_TYPE, i_target.getTarget()->GetGUIDLow());
+}
+
//-----------------------------------------------//
template<>
bool FollowMovementGenerator<Creature>::EnableWalking() const
@@ -300,6 +313,7 @@ template void ChaseMovementGenerator<Player>::Finalize(Player &);
template void ChaseMovementGenerator<Creature>::Finalize(Creature &);
template void ChaseMovementGenerator<Player>::Reset(Player &);
template void ChaseMovementGenerator<Creature>::Reset(Creature &);
+template void ChaseMovementGenerator<Player>::MovementInform(Player &unit);
template void FollowMovementGenerator<Player>::Finalize(Player &);
template void FollowMovementGenerator<Creature>::Finalize(Creature &);
diff --git a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
index 785d12ba6d2..982f7fc875c 100755
--- a/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
+++ b/src/server/game/Movement/MovementGenerators/TargetedMovementGenerator.h
@@ -76,7 +76,7 @@ class ChaseMovementGenerator : public TargetedMovementGeneratorMedium<T, ChaseMo
void Initialize(T &);
void Finalize(T &);
void Reset(T &);
- void MovementInform(T &){}
+ void MovementInform(T &);
static void _clearUnitStateMove(T &u) { u.ClearUnitState(UNIT_STAT_CHASE_MOVE); }
static void _addUnitStateMove(T &u) { u.AddUnitState(UNIT_STAT_CHASE_MOVE); }
diff --git a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
index ea858eaba84..ce8628af1ca 100755
--- a/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/WaypointMovementGenerator.cpp
@@ -84,6 +84,7 @@ void WaypointMovementGenerator<Creature>::OnArrived(Creature& creature)
// Inform script
MovementInform(creature);
+ creature.UpdateWaypointID(i_currentNode);
Stop(i_path->at(i_currentNode)->delay);
}
@@ -94,13 +95,11 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature &creature)
if (Stopped())
return true;
- const WaypointData *node = i_path->at(i_currentNode);
-
if (m_isArrivalDone)
{
if ((i_currentNode == i_path->size() - 1) && !repeating) // If that's our last waypoint
{
- creature.SetHomePosition(node->x, node->y, node->z, creature.GetOrientation());
+ creature.SetHomePosition(i_path->at(i_currentNode)->x, i_path->at(i_currentNode)->y, i_path->at(i_currentNode)->z, creature.GetOrientation());
creature.GetMotionMaster()->Initialize();
return false;
}
@@ -108,6 +107,8 @@ bool WaypointMovementGenerator<Creature>::StartMove(Creature &creature)
i_currentNode = (i_currentNode+1) % i_path->size();
}
+ const WaypointData *node = i_path->at(i_currentNode);
+
m_isArrivalDone = false;
creature.AddUnitState(UNIT_STAT_ROAMING_MOVE);
diff --git a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp
index aaafb09115d..59eefb9fa77 100755
--- a/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp
+++ b/src/server/game/Server/Protocol/Handlers/AuctionHouseHandler.cpp
@@ -101,14 +101,14 @@ void WorldSession::SendAuctionBidderNotification(uint32 location, uint32 auction
//this void causes on client to display: "Your auction sold"
void WorldSession::SendAuctionOwnerNotification(AuctionEntry* auction)
{
- WorldPacket data(SMSG_AUCTION_OWNER_NOTIFICATION, (7*4));
- data << auction->Id;
- data << auction->bid;
- data << (uint32) 0; //unk
- data << (uint32) 0; //unk
- data << (uint32) 0; //unk
- data << auction->item_template;
- data << (uint32) 0; //unk
+ WorldPacket data(SMSG_AUCTION_OWNER_NOTIFICATION, (8*4));
+ data << uint32(auction->Id);
+ data << uint32(auction->bid);
+ data << uint32(0); //unk
+ data << uint64(0); //unk (bidder guid?)
+ data << uint32(auction->item_template);
+ data << uint32(0); //unk
+ data << float(0); //unk (time?)
SendPacket(&data);
}
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 535253f4e13..7c09a2f32c6 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -3096,17 +3096,9 @@ void AuraEffect::HandleModPossess(AuraApplication const* aurApp, uint8 mode, boo
}
if (apply)
- {
- if (target->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp))
- caster->ToPlayer()->SetMover(target);
- }
+ target->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
else
- {
target->RemoveCharmedBy(caster);
- caster->ToPlayer()->SetMover(caster);
- if (target->GetTypeId() == TYPEID_PLAYER)
- target->ToPlayer()->SetMover(target);
- }
}
// only one spell has this aura
@@ -3134,13 +3126,11 @@ void AuraEffect::HandleModPossessPet(AuraApplication const* aurApp, uint8 mode,
if (caster->ToPlayer()->GetPet() != pet)
return;
- if (pet->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp))
- caster->ToPlayer()->SetMover(pet);
+ pet->SetCharmedBy(caster, CHARM_TYPE_POSSESS, aurApp);
}
else
{
pet->RemoveCharmedBy(caster);
- caster->ToPlayer()->SetMover(caster);
if (!pet->IsWithinDistInMap(caster, pet->GetMap()->GetVisibilityRange()))
pet->Remove(PET_SAVE_NOT_IN_SLOT, true);
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index 5577422919f..b32e346757f 100755
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -1963,6 +1963,13 @@ bool Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventI
if (!sSpellMgr->CanSpellTriggerProcOnEvent(*procEntry, eventInfo))
return false;
+ // TODO:
+ // - do checks using conditions table for eventInfo->GetActor() and eventInfo->GetActionTarget()
+ // - add DoCheckProc() AuraScript hook
+ // to allow additional requirements for procs
+ // this is needed because this is the last moment in which you can prevent aura charge drop on proc
+ // and possibly a way to prevent default checks (if there're going to be any)
+
// Check if current equipment meets aura requirements
// do that only for passive spells
// TODO: this needs to be unified for all kinds of auras
@@ -2023,11 +2030,14 @@ float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& event
void Aura::TriggerProcOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo)
{
- // TODO: script hooks here (allowing prevention of selected effects)
+ // TODO: OnProc hook here
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
if (aurApp->HasEffect(i))
+ // TODO: OnEffectProc hook here (allowing prevention of selected effects)
GetEffect(i)->HandleProc(aurApp, eventInfo);
- // TODO: script hooks here
+ // TODO: AfterEffectProc hook here
+
+ // TODO: AfterProc hook here
// Remove aura if we've used last charge to proc
if (IsUsingCharges() && !GetCharges())
diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h
index 8c9cde37c15..de743eb2991 100755
--- a/src/server/game/Spells/Auras/SpellAuras.h
+++ b/src/server/game/Spells/Auras/SpellAuras.h
@@ -186,6 +186,9 @@ class Aura
bool CanStackWith(Aura const* existingAura) const;
// Proc system
+ // this subsystem is not yet in use - the core of it is functional, but still some research has to be done
+ // and some dependant problems fixed before it can replace old proc system (for example cooldown handling)
+ // currently proc system functionality is implemented in Unit::ProcDamageAndSpell
bool IsProcOnCooldown() const;
void AddProcCooldown(uint32 msec);
bool IsUsingCharges() const { return m_isUsingCharges; }