Added CanDoCombat() checks to certain actions

This commit is contained in:
Uleat 2018-04-11 18:49:49 -04:00
parent 9344896238
commit 714f8172ec
3 changed files with 24 additions and 13 deletions

View File

@ -13712,6 +13712,11 @@ void Client::Handle_OP_Taunt(const EQApplicationPacket *app)
if (GetTarget() == nullptr || !GetTarget()->IsNPC())
return;
if (!zone->CanDoCombat()) {
Message(13, "You cannot taunt in a no combat zone.");
return;
}
Taunt(GetTarget()->CastToNPC(), false);
return;
}

View File

@ -279,6 +279,7 @@ void Client::GoFish()
//check for add NPC
if (npc_chance > 0 && npc_id) {
if (zone->random.Roll(npc_chance)) {
if (zone->CanDoCombat()) {
const NPCType *tmp = database.LoadNPCTypesData(npc_id);
if (tmp != nullptr) {
auto positionNPC = GetPosition();
@ -296,6 +297,10 @@ void Client::GoFish()
"You fish up a little more than you bargained for...");
}
}
else {
Message(MT_Emote, "You notice something lurking just below the water's surface...");
}
}
}
}

View File

@ -1534,6 +1534,7 @@ void NPC::PickPocket(Client* thief)
}
if(zone->random.Roll(5)) {
if (zone->CanDoCombat())
AddToHateList(thief, 50);
Say("Stop thief!");
thief->Message(13, "You are noticed trying to steal!");