[Commands] Consolidate #merchant_close_shop and #merchant_open_shop to #merchantshop (#3433)

* [Commands] Consolidate #merchant_close_shop and #merchant_open_shop to #merchantshop

# Notes
- `#merchant_close_shop` and `#merchant_open_shop` are now consolidated into `#merchantshop`.
- Command now works on any type of merchant instead of just regular merchants.
- Can be used on Merchants, Discord Merchants, Adventure Merchants, Norrath's Keepers Merchants, Dark Reign Merchants, and Alternate Currency Merchants.

* Update merchantshop.cpp

* Update merchantshop.cpp

* Update merchantshop.cpp
This commit is contained in:
Alex King
2023-06-24 14:14:19 -04:00
committed by GitHub
parent 3ceb743195
commit f2ff4245c0
7 changed files with 66 additions and 36 deletions
+8 -4
View File
@@ -2120,6 +2120,11 @@ void Client::Handle_OP_AdventureMerchantRequest(const EQApplicationPacket *app)
(tmp->GetClass() != DISCORD_MERCHANT) && (tmp->GetClass() != NORRATHS_KEEPERS_MERCHANT) && (tmp->GetClass() != DARK_REIGN_MERCHANT)))
return;
if (!tmp->CastToNPC()->IsMerchantOpen()) {
tmp->SayString(zone->random.Int(MERCHANT_CLOSED_ONE, MERCHANT_CLOSED_THREE));
return;
}
//you have to be somewhat close to them to be properly using them
if (DistanceSquared(m_Position, tmp->GetPosition()) > USE_NPC_RANGE2)
return;
@@ -14021,9 +14026,8 @@ void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app)
if (tmp->Charmed())
action = 0;
// 1199 I don't have time for that now. etc
if (!tmp->CastToNPC()->IsMerchantOpen()) {
tmp->SayString(zone->random.Int(1199, 1202));
tmp->SayString(zone->random.Int(MERCHANT_CLOSED_ONE, MERCHANT_CLOSED_THREE));
action = 0;
}
@@ -14428,8 +14432,8 @@ void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app)
if (nt) {
if (GetGM() || (!nt->IsInvisible(this) && (DistanceSquared(m_Position, nt->GetPosition()) <= TARGETING_RANGE*TARGETING_RANGE))) {
if (nt->GetBodyType() == BT_NoTarget2 ||
nt->GetBodyType() == BT_Special ||
if (nt->GetBodyType() == BT_NoTarget2 ||
nt->GetBodyType() == BT_Special ||
nt->GetBodyType() == BT_NoTarget) {
can_target = false;
}