mirror of
https://github.com/EQEmu/Server.git
synced 2026-04-05 19:32:25 +00:00
- License was intended to be GPLv3 per earlier commit of GPLv3 LICENSE FILE - This is confirmed by the inclusion of libraries that are incompatible with GPLv2 - This is also confirmed by KLS and the agreement of KLS's predecessors - Added GPLv3 license headers to the compilable source files - Removed Folly licensing in strings.h since the string functions do not match the Folly functions and are standard functions - this must have been left over from previous implementations - Removed individual contributor license headers since the project has been under the "developer" mantle for many years - Removed comments on files that were previously automatically generated since they've been manually modified multiple times and there are no automatic scripts referencing them (removed in 2023)
319 lines
6.9 KiB
C++
319 lines
6.9 KiB
C++
/* EQEmu: EQEmulator
|
|
|
|
Copyright (C) 2001-2026 EQEmu Development Team
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
#include "common/evolving_items.h"
|
|
#include "zone/client.h"
|
|
#include "zone/command.h"
|
|
|
|
void command_evolvingitems(Client *c, const Seperator *sep)
|
|
{
|
|
const uint16 arguments = sep->argnum;
|
|
if (!arguments) {
|
|
SendEvolvingItemsSubCommands(c);
|
|
return;
|
|
}
|
|
|
|
Client* t = c;
|
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
|
t = c->GetTarget()->CastToClient();
|
|
}
|
|
|
|
const bool is_item = !strcasecmp(sep->arg[1], "item");
|
|
const bool is_target = !strcasecmp(sep->arg[1], "target");
|
|
|
|
if (!is_item && !is_target) {
|
|
SendEvolvingItemsSubCommands(c);
|
|
return;
|
|
}
|
|
|
|
if (is_target) {
|
|
if (arguments > 1) {
|
|
c->Message(Chat::White, "Usage: #evolve target");
|
|
} else {
|
|
c->Message(Chat::Red, "Worn Items");
|
|
for (auto const &[key, value]: t->GetInv().GetWorn()) {
|
|
if (!value->IsEvolving()) {
|
|
continue;
|
|
}
|
|
|
|
auto item = EvolvingItemsManager::Instance()->GetEvolvingItemsCache().at(value->GetID());
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Evolving Items | {:0d}",
|
|
value->GetID()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Unique ID | {:0d}",
|
|
value->GetEvolveUniqueID()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Final Item ID | {:0d}",
|
|
value->GetEvolveFinalItemID()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Activated | {}",
|
|
value->GetEvolveActivated() ? "Yes" : "No"
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Equipped | {}",
|
|
value->GetEvolveEquipped() ? "Yes" : "No"
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Current Amount | {:0d}",
|
|
value->GetEvolveCurrentAmount()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Required Amount | {:0d}",
|
|
item.required_amount
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Progression (%) | {:.2f}",
|
|
value->GetEvolveProgression()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Type | {}",
|
|
item.type
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Subtype | {}",
|
|
item.sub_type
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Timer | {}",
|
|
value->GetTimers().at("evolve").Enabled()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Timer Remaining | {}",
|
|
value->GetTimers().at("evolve").GetRemainingTime()
|
|
).c_str()
|
|
);
|
|
}
|
|
|
|
c->Message(Chat::Red, "Personal Items");
|
|
for (auto const &[key, value]: t->GetInv().GetPersonal()) {
|
|
if (!value->IsEvolving()) {
|
|
continue;
|
|
}
|
|
|
|
auto item = EvolvingItemsManager::Instance()->GetEvolvingItemsCache().at(value->GetID());
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Evolving Items | {:0d}",
|
|
value->GetID()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Unique ID | {:0d}",
|
|
value->GetEvolveUniqueID()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Final Item ID | {:0d}",
|
|
value->GetEvolveFinalItemID()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Activated | {}",
|
|
value->GetEvolveActivated() ? "Yes" : "No"
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Equipped | {}",
|
|
value->GetEvolveEquipped() ? "Yes" : "No"
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Current Amount | {:0d}",
|
|
value->GetEvolveCurrentAmount()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Required Amount | {:0d}",
|
|
item.required_amount
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Progression (%) | {:.2f}",
|
|
value->GetEvolveProgression()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Type | {}",
|
|
item.type
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Subtype | {}",
|
|
item.sub_type
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Timer | {}",
|
|
value->GetTimers().at("evolve").Enabled()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Timer Remaining | {}",
|
|
value->GetTimers().at("evolve").GetRemainingTime()
|
|
).c_str()
|
|
);
|
|
}
|
|
}
|
|
} else if (is_item) {
|
|
if (arguments > 2) {
|
|
c->Message(Chat::White, "Usage: #evolve item item_id");
|
|
} else if (sep->IsNumber(2)) {
|
|
auto item_id = Strings::ToUnsignedInt(sep->arg[2]);
|
|
auto item = c->GetInv().GetItem(c->GetInv().HasItem(item_id));
|
|
if (item) {
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Evolving Items | {:0d}",
|
|
item->GetID()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Slot | {:0d}",
|
|
c->GetInv().HasItem(item_id)
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Activated | {}",
|
|
item->GetEvolveActivated() ? "Yes" : "No"
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Equipped | {}",
|
|
item->GetEvolveEquipped() ? "Yes" : "No"
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Unique ID | {:0d}",
|
|
item->GetEvolveUniqueID()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Progression (%) | {:.2f}",
|
|
item->GetEvolveProgression()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Timer | {}",
|
|
item->GetTimers().at("evolve").Enabled()
|
|
).c_str()
|
|
);
|
|
c->Message(
|
|
Chat::Yellow,
|
|
fmt::format(
|
|
"Timer Remaining | {}",
|
|
item->GetTimers().at("evolve").GetRemainingTime()
|
|
).c_str()
|
|
);
|
|
} else {
|
|
c->Message(
|
|
Chat::Red,
|
|
fmt::format(
|
|
"Item {} could not be found in your inventory.",
|
|
item_id
|
|
).c_str()
|
|
);
|
|
}
|
|
} else {
|
|
SendEvolvingItemsSubCommands(c);
|
|
}
|
|
}
|
|
}
|
|
|
|
void SendEvolvingItemsSubCommands(Client *c)
|
|
{
|
|
c->Message(Chat::White, "#evolve item item_id (Shows evolve values within the iteminstance)");
|
|
c->Message(
|
|
Chat::White,
|
|
"#evolve target (Shows evolve values within the target's cache - Must have a player target selected.)"
|
|
);
|
|
}
|