Skip to content

Commit

Permalink
Implement remaining changes from 1.7 patch notes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ratkosrb committed Apr 14, 2024
1 parent e0e5b98 commit 13057b9
Show file tree
Hide file tree
Showing 8 changed files with 314 additions and 12 deletions.
265 changes: 265 additions & 0 deletions sql/migrations/20240414162402_world.sql

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions src/game/AI/PetAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,17 @@ int PetAI::Permissible(Creature const* creature)
PetAI::PetAI(Creature* c) : CreatureAI(c), m_updateAlliesTimer(0)
{
UpdateAllies();

// Warlock imp has no melee attack
m_bMeleeAttack = (c->GetEntry() != 416);

// World of Warcraft Client Patch 1.7.0 (2005-09-13)
//- If you call a tamed Deepmoss Hatchling, you are no longer notified
// that you hatched.
#if SUPPORTED_CLIENT_BUILD <= CLIENT_BUILD_1_6_1
if (c->GetEntry() == 4263)
DoScriptText(1413, c);
#endif
}

bool PetAI::_needToStop() const
Expand Down
8 changes: 8 additions & 0 deletions src/game/Handlers/GroupHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,18 @@ void WorldSession::HandleRandomRollOpcode(WorldPacket& recv_data)
data << uint32(maximum);
data << uint32(roll);
data << GetPlayer()->GetObjectGuid();

// World of Warcraft Client Patch 1.7.0 (2005-09-13)
// - Using /random will now send the text to your party or raid wherever
// they are instead of the local area around the player that used /random.
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_6_1
if (GetPlayer()->GetGroup())
GetPlayer()->GetGroup()->BroadcastPacket(&data, false);
else
SendPacket(&data);
#else
GetPlayer()->SendObjectMessageToSet(&data, true);
#endif
}

void WorldSession::HandleRaidTargetUpdateOpcode(WorldPacket& recv_data)
Expand Down
13 changes: 12 additions & 1 deletion src/game/Handlers/ItemHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,9 +821,20 @@ void WorldSession::SendListInventory(ObjectGuid vendorguid, uint8 menu_type)

// when no faction required but rank > 0 will be used faction id from the vendor faction template to compare the rank
if (!pProto->RequiredReputationFaction && pProto->RequiredReputationRank > 0 &&
ReputationRank(pProto->RequiredReputationRank) > _player->GetReputationRank(pCreature->GetFactionId()))
ReputationRank(pProto->RequiredReputationRank) > _player->GetReputationRank(pCreature->GetFactionId()))
continue;

// World of Warcraft Client Patch 1.7.0 (2005-09-13)
// - Argent Dawn, Timbermaw, Zandalar and Arathi Basin vendors now show
// you their entire inventory regardless of current reputation, allowing
// players to peruse their full range of wares.The items in question
// now require the appropriate reputation level to make use of them.
#if SUPPORTED_CLIENT_BUILD <= CLIENT_BUILD_1_6_1
if (pProto->RequiredReputationFaction && pProto->RequiredReputationRank > 0 &&
ReputationRank(pProto->RequiredReputationRank) > _player->GetReputationRank(pProto->RequiredReputationFaction))
continue;
#endif

if (crItem->conditionId && !IsConditionSatisfied(crItem->conditionId, _player, pCreature->GetMap(), pCreature, CONDITION_FROM_VENDOR))
continue;
}
Expand Down
3 changes: 1 addition & 2 deletions src/game/Maps/MapManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,8 @@ bool MapManager::CanPlayerEnter(uint32 mapid, Player* player)
Group* group = player->GetGroup();
if (!group || !group->isRaidGroup())
{
// probably there must be special opcode, because client has this string constant in GlobalStrings.lua
// TODO: this is not a good place to send the message
player->GetSession()->SendAreaTriggerMessage("You must be in a raid group to enter %s instance", mapName);
player->SendRaidGroupOnlyError(0, ERR_RAID_GROUP_REQUIRED);
sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "MAP: Player '%s' must be in a raid group to enter instance of '%s'", player->GetName(), mapName);
return false;
}
Expand Down
25 changes: 17 additions & 8 deletions src/game/Objects/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7192,9 +7192,16 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
// resting and not in tavern (leave city then); tavern leave handled in CheckAreaExploreAndOutdoor
SetRestType(REST_TYPE_NO);

// World of Warcraft Client Patch 1.7.0 (2005-09-13)
// - Zone bound items, such as the Gordok Courtyard Key, will no longer
// leave your inventory if you are a ghost outside their intended zone.
// Reviving in a zone outside the item's listed zone binding will still
// cause the item to disappear, however.
// remove items with area/map limitations (delete only for alive player to allow back in ghost mode)
// if player resurrected at teleport this will be applied in resurrect code
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_6_1
if (IsAlive())
#endif
DestroyZoneLimitedItem(true, newZone);

// recent client version not send leave/join channel packets for built-in local channels
Expand Down Expand Up @@ -18838,6 +18845,14 @@ bool Player::BuyItemFromVendor(ObjectGuid vendorGuid, uint32 item, uint8 count,
return crItem->maxcount != 0;
}

void Player::SendRaidGroupOnlyError(uint32 timer, RaidGroupError error)
{
WorldPacket data(SMSG_RAID_GROUP_ONLY, 4 + 4);
data << uint32(timer);
data << uint32(error); // error used only when timer = 0
GetSession()->SendPacket(&data);
}

void Player::UpdateHomebindTime(uint32 time)
{
// GMs never get homebind timer online
Expand All @@ -18846,10 +18861,7 @@ void Player::UpdateHomebindTime(uint32 time)
if (m_HomebindTimer) // instance valid, but timer not reset
{
// hide reminder
WorldPacket data(SMSG_RAID_GROUP_ONLY, 4 + 4);
data << uint32(0);
data << uint32(ERR_RAID_GROUP_REQUIRED); // error used only when timer = 0
GetSession()->SendPacket(&data);
SendRaidGroupOnlyError(0, ERR_RAID_GROUP_REQUIRED);
}
// instance is valid, reset homebind timer
m_HomebindTimer = 0;
Expand All @@ -18870,10 +18882,7 @@ void Player::UpdateHomebindTime(uint32 time)
// instance is invalid, start homebind timer
m_HomebindTimer = 60000;
// send message to player
WorldPacket data(SMSG_RAID_GROUP_ONLY, 4 + 4);
data << uint32(m_HomebindTimer);
data << uint32(ERR_RAID_GROUP_REQUIRED); // error used only when timer = 0
GetSession()->SendPacket(&data);
SendRaidGroupOnlyError(m_HomebindTimer, ERR_RAID_GROUP_REQUIRED);
sLog.Out(LOG_BASIC, LOG_LVL_DEBUG, "PLAYER: Player '%s' (GUID: %u) will be teleported to homebind in 60 seconds", GetName(), GetGUIDLow());
}
}
Expand Down
1 change: 1 addition & 0 deletions src/game/Objects/Player.h
Original file line number Diff line number Diff line change
Expand Up @@ -2029,6 +2029,7 @@ class Player final: public Unit
float GetXYSpeed() const { return xy_speed; }
void SetXYSpeed(float speed) { xy_speed = speed; }

void SendRaidGroupOnlyError(uint32 timer, RaidGroupError error);
void SendInitialPacketsBeforeAddToMap();
void SendInitialPacketsAfterAddToMap(bool login = true);

Expand Down
2 changes: 1 addition & 1 deletion src/shared/Progression.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// Change this to define which build of the game to emulate.
// Has an effect on things such as core gameplay mechanics,
// loading of client data, and network packets structure.
#define SUPPORTED_CLIENT_BUILD CLIENT_BUILD_1_12_1
#define SUPPORTED_CLIENT_BUILD CLIENT_BUILD_1_6_1

// This defines which client builds the world server will accept.
#if SUPPORTED_CLIENT_BUILD >= CLIENT_BUILD_1_12_1
Expand Down

0 comments on commit 13057b9

Please sign in to comment.