mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 14:41:28 +00:00
parent
b9214bfdee
commit
6a42639386
@ -2613,10 +2613,11 @@ void Client::SetPVP(bool toggle, bool message) {
|
|||||||
m_pp.pvp = toggle ? 1 : 0;
|
m_pp.pvp = toggle ? 1 : 0;
|
||||||
|
|
||||||
if (message) {
|
if (message) {
|
||||||
if(GetPVP())
|
if(GetPVP()) {
|
||||||
this->MessageString(Chat::Shout,PVP_ON);
|
MessageString(Chat::Shout, PVP_ON);
|
||||||
else
|
} else {
|
||||||
Message(Chat::Red, "You no longer follow the ways of discord.");
|
Message(Chat::Shout, "You now follow the ways of Order.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SendAppearancePacket(AT_PVP, GetPVP());
|
SendAppearancePacket(AT_PVP, GetPVP());
|
||||||
|
|||||||
@ -283,7 +283,7 @@ int command_init(void)
|
|||||||
command_add("profanity", "Manage censored language.", AccountStatus::GMLeadAdmin, command_profanity) ||
|
command_add("profanity", "Manage censored language.", AccountStatus::GMLeadAdmin, command_profanity) ||
|
||||||
command_add("push", "Lets you do spell push", AccountStatus::GMLeadAdmin, command_push) ||
|
command_add("push", "Lets you do spell push", AccountStatus::GMLeadAdmin, command_push) ||
|
||||||
command_add("proximity", "Shows NPC proximity", AccountStatus::GMLeadAdmin, command_proximity) ||
|
command_add("proximity", "Shows NPC proximity", AccountStatus::GMLeadAdmin, command_proximity) ||
|
||||||
command_add("pvp", "[on/off] - Set your or your player target's PVP status", AccountStatus::GMAdmin, command_pvp) ||
|
command_add("pvp", "[On|Off] - Set you or your player target's PVP status", AccountStatus::GMAdmin, command_pvp) ||
|
||||||
command_add("qglobal", "[on/off/view] - Toggles qglobal functionality on an NPC", AccountStatus::GMAdmin, command_qglobal) ||
|
command_add("qglobal", "[on/off/view] - Toggles qglobal functionality on an NPC", AccountStatus::GMAdmin, command_qglobal) ||
|
||||||
command_add("questerrors", "Shows quest errors.", AccountStatus::GMAdmin, command_questerrors) ||
|
command_add("questerrors", "Shows quest errors.", AccountStatus::GMAdmin, command_questerrors) ||
|
||||||
command_add("race", "[racenum] - Change your or your target's race. Use racenum 0 to return to normal", AccountStatus::Guide, command_race) ||
|
command_add("race", "[racenum] - Change your or your target's race. Use racenum 0 to return to normal", AccountStatus::Guide, command_race) ||
|
||||||
|
|||||||
@ -2,19 +2,27 @@
|
|||||||
|
|
||||||
void command_pvp(Client *c, const Seperator *sep)
|
void command_pvp(Client *c, const Seperator *sep)
|
||||||
{
|
{
|
||||||
bool state = atobool(sep->arg[1]);
|
int arguments = sep->argnum;
|
||||||
Client *t = c;
|
if (!arguments) {
|
||||||
|
c->Message(Chat::White, "Usage: #pvp [On|Off]");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool pvp_state = atobool(sep->arg[1]);
|
||||||
|
Client* target = c;
|
||||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||||
t = c->GetTarget()->CastToClient();
|
target = c->GetTarget()->CastToClient();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sep->arg[1][0] != 0) {
|
target->SetPVP(pvp_state);
|
||||||
t->SetPVP(state);
|
if (c != target) {
|
||||||
c->Message(Chat::White, "%s now follows the ways of %s.", t->GetName(), state ? "discord" : "order");
|
c->Message(
|
||||||
}
|
Chat::White,
|
||||||
else {
|
fmt::format(
|
||||||
c->Message(Chat::White, "Usage: #pvp [on/off]");
|
"{} now follows the ways of {}.",
|
||||||
|
target->GetCleanName(),
|
||||||
|
pvp_state ? "Discord" : "Order"
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user