mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
Added CanDoCombat() checks to certain actions
This commit is contained in:
parent
9344896238
commit
714f8172ec
@ -13712,6 +13712,11 @@ void Client::Handle_OP_Taunt(const EQApplicationPacket *app)
|
|||||||
if (GetTarget() == nullptr || !GetTarget()->IsNPC())
|
if (GetTarget() == nullptr || !GetTarget()->IsNPC())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!zone->CanDoCombat()) {
|
||||||
|
Message(13, "You cannot taunt in a no combat zone.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Taunt(GetTarget()->CastToNPC(), false);
|
Taunt(GetTarget()->CastToNPC(), false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -279,21 +279,26 @@ void Client::GoFish()
|
|||||||
//check for add NPC
|
//check for add NPC
|
||||||
if (npc_chance > 0 && npc_id) {
|
if (npc_chance > 0 && npc_id) {
|
||||||
if (zone->random.Roll(npc_chance)) {
|
if (zone->random.Roll(npc_chance)) {
|
||||||
const NPCType *tmp = database.LoadNPCTypesData(npc_id);
|
if (zone->CanDoCombat()) {
|
||||||
if (tmp != nullptr) {
|
const NPCType *tmp = database.LoadNPCTypesData(npc_id);
|
||||||
auto positionNPC = GetPosition();
|
if (tmp != nullptr) {
|
||||||
positionNPC.x = positionNPC.x + 3;
|
auto positionNPC = GetPosition();
|
||||||
auto npc = new NPC(tmp, nullptr, positionNPC, FlyMode3);
|
positionNPC.x = positionNPC.x + 3;
|
||||||
npc->AddLootTable();
|
auto npc = new NPC(tmp, nullptr, positionNPC, FlyMode3);
|
||||||
if (npc->DropsGlobalLoot())
|
npc->AddLootTable();
|
||||||
npc->CheckGlobalLootTables();
|
if (npc->DropsGlobalLoot())
|
||||||
|
npc->CheckGlobalLootTables();
|
||||||
|
|
||||||
npc->AddToHateList(this, 1, 0, false); // no help yelling
|
npc->AddToHateList(this, 1, 0, false); // no help yelling
|
||||||
|
|
||||||
entity_list.AddNPC(npc);
|
entity_list.AddNPC(npc);
|
||||||
|
|
||||||
Message(MT_Emote,
|
Message(MT_Emote,
|
||||||
"You fish up a little more than you bargained for...");
|
"You fish up a little more than you bargained for...");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Message(MT_Emote, "You notice something lurking just below the water's surface...");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1534,7 +1534,8 @@ void NPC::PickPocket(Client* thief)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(zone->random.Roll(5)) {
|
if(zone->random.Roll(5)) {
|
||||||
AddToHateList(thief, 50);
|
if (zone->CanDoCombat())
|
||||||
|
AddToHateList(thief, 50);
|
||||||
Say("Stop thief!");
|
Say("Stop thief!");
|
||||||
thief->Message(13, "You are noticed trying to steal!");
|
thief->Message(13, "You are noticed trying to steal!");
|
||||||
thief->SendPickPocketResponse(this, 0, PickPocketFailed);
|
thief->SendPickPocketResponse(this, 0, PickPocketFailed);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user