mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
Mobs will not trade anymore if they are currently in combat.
This commit is contained in:
parent
e46fcdd48a
commit
05b3c89729
@ -14099,16 +14099,25 @@ void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app)
|
|||||||
#else
|
#else
|
||||||
else if (tradee && (tradee->IsNPC() || tradee->IsBot())) {
|
else if (tradee && (tradee->IsNPC() || tradee->IsBot())) {
|
||||||
#endif
|
#endif
|
||||||
|
// If the NPC is engaged, we cannot trade with it.
|
||||||
|
// Note that this work as intended, if the NPC is charmed
|
||||||
|
// you can still trade with it.
|
||||||
|
if (tradee->IsEngaged()) {
|
||||||
|
Message(0, "Your target cannot trade with you at this moment.");
|
||||||
|
}
|
||||||
|
// If it not engaged, it will automatically accept the trade.
|
||||||
|
else {
|
||||||
//npcs always accept
|
//npcs always accept
|
||||||
trade->Start(msg->to_mob_id);
|
trade->Start(msg->to_mob_id);
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_TradeRequestAck, sizeof(TradeRequest_Struct));
|
EQApplicationPacket *outapp = new EQApplicationPacket(OP_TradeRequestAck, sizeof(TradeRequest_Struct));
|
||||||
TradeRequest_Struct *acc = (TradeRequest_Struct *) outapp->pBuffer;
|
TradeRequest_Struct *acc = (TradeRequest_Struct *) outapp->pBuffer;
|
||||||
acc->from_mob_id = msg->to_mob_id;
|
acc->from_mob_id = msg->to_mob_id;
|
||||||
acc->to_mob_id = msg->from_mob_id;
|
acc->to_mob_id = msg->from_mob_id;
|
||||||
FastQueuePacket(&outapp);
|
FastQueuePacket(&outapp);
|
||||||
safe_delete(outapp);
|
safe_delete(outapp);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user