mirror of
https://github.com/EQEmu/Server.git
synced 2026-03-31 02:02:26 +00:00
[Feature] Add humanoid and non-wielded restrictions to pick pocket (#2276)
* Add humanoid and non-wielded restructions to pick pocket * Use constants for message string and char color * Fixed more magic #s * Fix to include valie bodytypes * Fix incorrect scope of final else * My extra message was not needed. Client handles based on packet reply * Removed string ID I added - issued by client * Use existing pick pocket reply function / clean up
This commit is contained in:
parent
30f35a920b
commit
5c60913583
@ -11074,35 +11074,30 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
p_timers.Start(pTimerBeggingPickPocket, 8);
|
p_timers.Start(pTimerBeggingPickPocket, 8);
|
||||||
auto outapp = new EQApplicationPacket(OP_PickPocket, sizeof(sPickPocket_Struct));
|
|
||||||
sPickPocket_Struct* pick_out = (sPickPocket_Struct*)outapp->pBuffer;
|
|
||||||
pick_out->coin = 0;
|
|
||||||
pick_out->from = victim->GetID();
|
|
||||||
pick_out->to = GetID();
|
|
||||||
pick_out->myskill = GetSkill(EQ::skills::SkillPickPockets);
|
|
||||||
pick_out->type = 0;
|
|
||||||
//if we do not send this packet the client will lock up and require the player to relog.
|
|
||||||
|
|
||||||
if (victim == this) {
|
if (victim == this) {
|
||||||
Message(0, "You catch yourself red-handed.");
|
Message(Chat::White, "You catch yourself red-handed.");
|
||||||
}
|
}
|
||||||
else if (victim->GetOwnerID()) {
|
else if (victim->GetOwnerID()) {
|
||||||
Message(0, "You cannot steal from pets!");
|
Message(Chat::White, "You cannot steal from pets!");
|
||||||
|
}
|
||||||
|
else if (victim->IsClient()) {
|
||||||
|
Message(Chat::White, "Stealing from clients not yet supported.");
|
||||||
}
|
}
|
||||||
else if (Distance(GetPosition(), victim->GetPosition()) > 20) {
|
else if (Distance(GetPosition(), victim->GetPosition()) > 20) {
|
||||||
Message(Chat::Red, "Attempt to pickpocket out of range detected.");
|
Message(Chat::Red, "Attempt to pickpocket out of range detected.");
|
||||||
database.SetMQDetectionFlag(AccountName(), GetName(), "OP_PickPocket was sent from outside combat range.", zone->GetShortName());
|
database.SetMQDetectionFlag(AccountName(), GetName(), "OP_PickPocket was sent from outside combat range.", zone->GetShortName());
|
||||||
}
|
}
|
||||||
else if (victim->IsNPC()) {
|
else if (victim->IsNPC()) {
|
||||||
safe_delete(outapp);
|
auto body = victim->GetBodyType();
|
||||||
victim->CastToNPC()->PickPocket(this);
|
if (body == BT_Humanoid || body == BT_Monster || body == BT_Giant ||
|
||||||
return;
|
body == BT_Lycanthrope) {
|
||||||
|
victim->CastToNPC()->PickPocket(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
Message(0, "Stealing from clients not yet supported.");
|
SendPickPocketResponse(victim, 0, PickPocketFailed);
|
||||||
}
|
|
||||||
QueuePacket(outapp);
|
|
||||||
safe_delete(outapp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app)
|
void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app)
|
||||||
|
|||||||
@ -1867,7 +1867,7 @@ void NPC::PickPocket(Client* thief)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
auto item_test = database.GetItem(item_iter->item_id);
|
auto item_test = database.GetItem(item_iter->item_id);
|
||||||
if (item_test->Magic || !item_test->NoDrop || item_test->IsClassBag() || thief->CheckLoreConflict(item_test))
|
if (item_test->Magic || !item_test->NoDrop || item_test->IsClassBag() || thief->CheckLoreConflict(item_test) || item_iter->equip_slot != EQ::invslot::SLOT_INVALID)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
loot_selection.push_back(std::make_pair(item_test, ((item_test->Stackable) ? (1) : (item_iter->charges))));
|
loot_selection.push_back(std::make_pair(item_test, ((item_test->Stackable) ? (1) : (item_iter->charges))));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user