mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 11:48:37 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
+128
@@ -1,3 +1,131 @@
|
||||
## [22.19.0] - 07/08/2023
|
||||
|
||||
### Bots
|
||||
|
||||
* Add Pickpocket Command ([#3484](https://github.com/EQEmu/Server/pull/3484)) @tuday2 2023-07-08
|
||||
|
||||
### Code
|
||||
|
||||
* Move #find item summon links to front ([#3483](https://github.com/EQEmu/Server/pull/3483)) @Kinglykrab 2023-07-05
|
||||
* Remove LoadItemDBFieldNames() from common/misc.cpp and common/misc.h ([#3473](https://github.com/EQEmu/Server/pull/3473)) @Kinglykrab 2023-07-04
|
||||
|
||||
### Commands
|
||||
|
||||
* Add #itemsearch alias to #find aliases ([#3485](https://github.com/EQEmu/Server/pull/3485)) @Kinglykrab 2023-07-08
|
||||
* Consolidate #show commands into a singular #show command ([#3478](https://github.com/EQEmu/Server/pull/3478)) @Kinglykrab 2023-07-08
|
||||
|
||||
### Fixes
|
||||
|
||||
* Fix _PutItem having a slot_id of -1 on mobs with no items ([#3474](https://github.com/EQEmu/Server/pull/3474)) @Kinglykrab 2023-07-04
|
||||
|
||||
### Rules
|
||||
|
||||
* Add Skills:TrivialTradeskillCombinesNoFail Rule ([#3481](https://github.com/EQEmu/Server/pull/3481)) @JasXSL 2023-07-05
|
||||
|
||||
## [22.18.0] - 07/04/2023
|
||||
|
||||
### Commands
|
||||
|
||||
* Add #emotesearch to #find command ([#3480](https://github.com/EQEmu/Server/pull/3480)) @Kinglykrab 2023-07-04
|
||||
* Cleanup #copycharacter Command ([#3479](https://github.com/EQEmu/Server/pull/3479)) @Kinglykrab 2023-07-04
|
||||
|
||||
### Fixes
|
||||
|
||||
* Add chatchannel_reserved_names to a new manifest ([#3482](https://github.com/EQEmu/Server/pull/3482)) @Kinglykrab 2023-07-04
|
||||
* Fix issue in zone store of returning reference to local variable ([#3477](https://github.com/EQEmu/Server/pull/3477)) @Kinglykrab 2023-07-04
|
||||
|
||||
## [22.17.0] - 07/03/2023
|
||||
|
||||
### Cleanup/Feature
|
||||
|
||||
* Add support for bots to #showstats/#mystats ([#3427](https://github.com/EQEmu/Server/pull/3427)) @Kinglykrab 2023-07-01
|
||||
|
||||
### Code
|
||||
|
||||
* Remove LoadItemDBFieldNames() from common/misc.cpp and common/misc.h ([#3473](https://github.com/EQEmu/Server/pull/3473)) @Kinglykrab 2023-07-04
|
||||
* Remove handle_npc_single_npc from zone/lua_parser_events.cpp and zone/lua_parser_events.h ([#3467](https://github.com/EQEmu/Server/pull/3467)) @Kinglykrab 2023-07-03
|
||||
|
||||
### Database
|
||||
|
||||
* Set multi statements off when returning early ([#3462](https://github.com/EQEmu/Server/pull/3462)) @Akkadius 2023-07-01
|
||||
|
||||
### Feature
|
||||
|
||||
* Add Strings::BeginsWith() and Strings::EndsWith() ([#3471](https://github.com/EQEmu/Server/pull/3471)) @Kinglykrab 2023-07-03
|
||||
|
||||
### Fixes
|
||||
|
||||
* Add check for underscores in botcreate command ([#3458](https://github.com/EQEmu/Server/pull/3458)) @tuday2 2023-06-29
|
||||
* EVENT_LANGUAGE_SKILL_UP in Lua was using EVENT_SKILL_UP logic ([#3466](https://github.com/EQEmu/Server/pull/3466)) @Kinglykrab 2023-07-03
|
||||
* Fix _PutItem having a slot_id of -1 on mobs with no items ([#3474](https://github.com/EQEmu/Server/pull/3474)) @Kinglykrab 2023-07-04
|
||||
* Fix data type of GetAggroCount() ([#3470](https://github.com/EQEmu/Server/pull/3470)) @Kinglykrab 2023-07-03
|
||||
|
||||
### Logging
|
||||
|
||||
* Fix logging crash when % are sent through query logs ([#3461](https://github.com/EQEmu/Server/pull/3461)) @Akkadius 2023-07-01
|
||||
|
||||
### Quest API
|
||||
|
||||
* Add ClearAccountFlag() and GetAccountFlags() to Perl/Lua ([#3469](https://github.com/EQEmu/Server/pull/3469)) @Kinglykrab 2023-07-03
|
||||
* Add GetClassAbbreviation() and GetRaceAbbreviation() to Perl/Lua ([#3463](https://github.com/EQEmu/Server/pull/3463)) @Kinglykrab 2023-07-02
|
||||
* Add GetClassPlural() and GetRacePlural() to Perl/Lua ([#3468](https://github.com/EQEmu/Server/pull/3468)) @Kinglykrab 2023-07-03
|
||||
* Add GetCloseMobList() and CalculateDistance() overload to Perl/Lua ([#3455](https://github.com/EQEmu/Server/pull/3455)) @Kinglykrab 2023-07-02
|
||||
* Add Hate Entry Methods to Perl ([#3459](https://github.com/EQEmu/Server/pull/3459)) @Kinglykrab 2023-07-02
|
||||
* Add ItemData Class to Perl ([#3465](https://github.com/EQEmu/Server/pull/3465)) @Kinglykrab 2023-07-02
|
||||
* Add Spawn2 Class to Perl ([#3456](https://github.com/EQEmu/Server/pull/3456)) @Kinglykrab 2023-07-02
|
||||
* Add StatBonuses Class to Perl ([#3460](https://github.com/EQEmu/Server/pull/3460)) @Kinglykrab 2023-07-02
|
||||
* Add missing Item Methods to Perl/Lua. ([#3464](https://github.com/EQEmu/Server/pull/3464)) @Kinglykrab 2023-07-02
|
||||
|
||||
## [22.16.0] - 06/27/2023
|
||||
|
||||
### Code
|
||||
|
||||
* Default skill type to Hand to Hand in #npcedit meleetype ([#3422](https://github.com/EQEmu/Server/pull/3422)) @Kinglykrab 2023-06-19
|
||||
* Delete common/worldconn.cpp ([#3436](https://github.com/EQEmu/Server/pull/3436)) @Kinglykrab 2023-06-24
|
||||
* Remove DatabaseCastAccepted() from zone/npc.cpp and zone/npc.h ([#3449](https://github.com/EQEmu/Server/pull/3449)) @Kinglykrab 2023-06-24
|
||||
* Remove GetACAvoid() from zone/merc.h ([#3447](https://github.com/EQEmu/Server/pull/3447)) @Kinglykrab 2023-06-25
|
||||
* Remove GetACMit() from zone/merc.h ([#3446](https://github.com/EQEmu/Server/pull/3446)) @Kinglykrab 2023-06-24
|
||||
* Remove _ClearWaypints() from zone/npc.h ([#3445](https://github.com/EQEmu/Server/pull/3445)) @Kinglykrab 2023-06-24
|
||||
* Remove acmod() from zone/merc.h ([#3448](https://github.com/EQEmu/Server/pull/3448)) @Kinglykrab 2023-06-24
|
||||
* Remove command_packetprofile from zone/command.h ([#3432](https://github.com/EQEmu/Server/pull/3432)) @Kinglykrab 2023-06-24
|
||||
* Remove command_showpetspell in zone/command.h ([#3430](https://github.com/EQEmu/Server/pull/3430)) @Kinglykrab 2023-06-24
|
||||
* Remove command_unlock from zone/command.h ([#3431](https://github.com/EQEmu/Server/pull/3431)) @Kinglykrab 2023-06-24
|
||||
|
||||
### Commands
|
||||
|
||||
* Add #finddeity Command ([#3435](https://github.com/EQEmu/Server/pull/3435)) @Kinglykrab 2023-06-26
|
||||
* Add #findlanguage Command ([#3434](https://github.com/EQEmu/Server/pull/3434)) @Kinglykrab 2023-06-25
|
||||
* Add #showspells Command ([#3429](https://github.com/EQEmu/Server/pull/3429)) @Kinglykrab 2023-06-24
|
||||
* Add missing subcommands to #npcedit ([#3423](https://github.com/EQEmu/Server/pull/3423)) @Kinglykrab 2023-06-19
|
||||
* Cleanup #showbuffs Command ([#3439](https://github.com/EQEmu/Server/pull/3439)) @Kinglykrab 2023-06-26
|
||||
* Cleanup #shownpcgloballoot and #showzonegloballoot Commands ([#3440](https://github.com/EQEmu/Server/pull/3440)) @Kinglykrab 2023-06-24
|
||||
* Cleanup #viewcurrencies Command ([#3441](https://github.com/EQEmu/Server/pull/3441)) @Kinglykrab 2023-06-25
|
||||
* Consolidate #findX commands to a singular #find Command ([#3452](https://github.com/EQEmu/Server/pull/3452)) @Kinglykrab 2023-06-28
|
||||
* Consolidate #merchant_close_shop and #merchant_open_shop to #merchantshop ([#3433](https://github.com/EQEmu/Server/pull/3433)) @Kinglykrab 2023-06-24
|
||||
* Delete #showbonusstats Command ([#3437](https://github.com/EQEmu/Server/pull/3437)) @Kinglykrab 2023-06-24
|
||||
* Delete #spellinfo Command ([#3438](https://github.com/EQEmu/Server/pull/3438)) @Kinglykrab 2023-06-24
|
||||
|
||||
### Database
|
||||
|
||||
* Fix database version checking edge case issue ([#3428](https://github.com/EQEmu/Server/pull/3428)) @Akkadius 2023-06-22
|
||||
* Fix multi-statement error reporting ([#3425](https://github.com/EQEmu/Server/pull/3425)) @Akkadius 2023-06-19
|
||||
* Implement native database migrations in server ([#2857](https://github.com/EQEmu/Server/pull/2857)) @Akkadius 2023-06-19
|
||||
|
||||
### Fixes
|
||||
|
||||
* Fix NPC Item Stat Bonuses ([#3444](https://github.com/EQEmu/Server/pull/3444)) @Kinglykrab 2023-06-26
|
||||
* Fix error in 023_01_21_bots_raid_members.sql ([#3453](https://github.com/EQEmu/Server/pull/3453)) @mibastian 2023-06-28
|
||||
* Fix possible crash with #npcedit weapon ([#3421](https://github.com/EQEmu/Server/pull/3421)) @Kinglykrab 2023-06-19
|
||||
* Merchant Open Flag set only for regular Merchants ([#3454](https://github.com/EQEmu/Server/pull/3454)) @Kinglykrab 2023-06-27
|
||||
|
||||
### Readme
|
||||
|
||||
* Update new location of database updates ([#3424](https://github.com/EQEmu/Server/pull/3424)) @joligario 2023-06-19
|
||||
|
||||
### Rules
|
||||
|
||||
* Add ClientPetsUserOwnerNameInLastName rule ([#3442](https://github.com/EQEmu/Server/pull/3442)) @Kinglykrab 2023-06-25
|
||||
|
||||
## [22.15.3] - 06/19/2023
|
||||
|
||||
### Fixes
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
#include "../common/global_define.h"
|
||||
#include "../common/classes.h"
|
||||
#include "data_verification.h"
|
||||
|
||||
const char *GetClassIDName(uint8 class_id, uint8 level)
|
||||
{
|
||||
@@ -750,3 +751,51 @@ uint8 ClassArmorType(uint8 class_id)
|
||||
return ARMOR_TYPE_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
const std::string GetPlayerClassAbbreviation(uint8 class_id)
|
||||
{
|
||||
if (!EQ::ValueWithin(class_id, WARRIOR, BERSERKER)) {
|
||||
return std::string("UNK");
|
||||
}
|
||||
|
||||
switch (class_id) {
|
||||
case WARRIOR:
|
||||
return "WAR";
|
||||
case CLERIC:
|
||||
return "CLR";
|
||||
case PALADIN:
|
||||
return "PAL";
|
||||
case RANGER:
|
||||
return "RNG";
|
||||
case SHADOWKNIGHT:
|
||||
return "SHD";
|
||||
case DRUID:
|
||||
return "DRU";
|
||||
case MONK:
|
||||
return "MNK";
|
||||
case BARD:
|
||||
return "BRD";
|
||||
case ROGUE:
|
||||
return "ROG";
|
||||
case SHAMAN:
|
||||
return "SHM";
|
||||
case NECROMANCER:
|
||||
return "NEC";
|
||||
case WIZARD:
|
||||
return "WIZ";
|
||||
case MAGICIAN:
|
||||
return "MAG";
|
||||
case ENCHANTER:
|
||||
return "ENC";
|
||||
case BEASTLORD:
|
||||
return "BST";
|
||||
case BERSERKER:
|
||||
return "BER";
|
||||
}
|
||||
|
||||
return std::string("UNK");
|
||||
}
|
||||
|
||||
bool IsPlayerClass(uint8 class_id) {
|
||||
return EQ::ValueWithin(class_id, WARRIOR, BERSERKER);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#define CLASSES_CH
|
||||
|
||||
#include "../common/types.h"
|
||||
#include <string>
|
||||
|
||||
#define NO_CLASS 0
|
||||
#define WARRIOR 1
|
||||
@@ -127,6 +128,9 @@
|
||||
const char* GetClassIDName(uint8 class_id, uint8 level = 0);
|
||||
const char* GetPlayerClassName(uint32 player_class_value, uint8 level = 0);
|
||||
|
||||
bool IsPlayerClass(uint8 class_id);
|
||||
const std::string GetPlayerClassAbbreviation(uint8 class_id);
|
||||
|
||||
uint32 GetPlayerClassValue(uint8 class_id);
|
||||
uint32 GetPlayerClassBit(uint8 class_id);
|
||||
|
||||
|
||||
@@ -4642,11 +4642,10 @@ ADD COLUMN `avoidance` int(11) unsigned NOT NULL DEFAULT 0 AFTER `heal_scale`;
|
||||
.condition = "empty",
|
||||
.match = "",
|
||||
.sql = R"(
|
||||
ALTER TABLE `npc_scale_global_base`
|
||||
MODIFY COLUMN `hp` bigint(20) NOT NULL DEFAULT 0 AFTER `ac`,
|
||||
MODIFY COLUMN `hp_regen_rate` bigint(20) NOT NULL DEFAULT 0 AFTER `max_dmg`,
|
||||
ADD COLUMN `hp_regen_per_second` bigint(20) NOT NULL DEFAULT 0 AFTER `hp_regen_rate`,
|
||||
ADD COLUMN `avoidance` int(11) unsigned NOT NULL DEFAULT 0 AFTER `heal_scale`;
|
||||
DROP INDEX `PRIMARY` ON `raid_members`;
|
||||
CREATE UNIQUE INDEX `UNIQUE` ON `raid_members`(`name`);
|
||||
ALTER TABLE `raid_members` ADD COLUMN `bot_id` int(4) NOT NULL DEFAULT 0 AFTER `charid`;
|
||||
ALTER TABLE `raid_members` ADD COLUMN `id` BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT FIRST;
|
||||
|
||||
)"
|
||||
},
|
||||
@@ -4745,6 +4744,22 @@ ADD COLUMN `id` int(11) NOT NULL AUTO_INCREMENT FIRST,
|
||||
ADD PRIMARY KEY (`id`);
|
||||
)",
|
||||
},
|
||||
ManifestEntry{
|
||||
.version = 9229,
|
||||
.description = "2023_07_04_chatchannel_reserved_names_fix.sql",
|
||||
.check = "SHOW TABLES LIKE 'chatchannel_reserved_names'",
|
||||
.condition = "empty",
|
||||
.match = "",
|
||||
.sql = R"(
|
||||
CREATE TABLE `chatchannel_reserved_names`
|
||||
(
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(64) NOT NULL,
|
||||
PRIMARY KEY (`id`) USING BTREE,
|
||||
UNIQUE KEY `name` (`name`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
)"
|
||||
},
|
||||
|
||||
// -- template; copy/paste this when you need to create a new entry
|
||||
// ManifestEntry{
|
||||
|
||||
@@ -365,6 +365,8 @@ MySQLRequestResult DBcore::QueryDatabaseMulti(const std::string &query)
|
||||
mysql_free_result(res);
|
||||
}
|
||||
|
||||
SetMultiStatementsOff();
|
||||
|
||||
return r;
|
||||
}
|
||||
}
|
||||
@@ -418,6 +420,8 @@ MySQLRequestResult DBcore::QueryDatabaseMulti(const std::string &query)
|
||||
r.SetErrorMessage(error_message);
|
||||
r.SetErrorNumber(mysql_errno(mysql));
|
||||
|
||||
SetMultiStatementsOff();
|
||||
|
||||
// we handle errors elsewhere
|
||||
return r;
|
||||
}
|
||||
|
||||
+69
-119
@@ -11,7 +11,7 @@
|
||||
are required to give you total support for your newly bought product;
|
||||
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, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
@@ -19,131 +19,81 @@
|
||||
|
||||
#include "deity.h"
|
||||
|
||||
|
||||
EQ::deity::DeityTypeBit EQ::deity::ConvertDeityTypeToDeityTypeBit(DeityType deity_type)
|
||||
EQ::deity::DeityTypeBit EQ::deity::GetDeityBitmask(DeityType deity_type)
|
||||
{
|
||||
switch (deity_type) {
|
||||
case DeityBertoxxulous:
|
||||
return bit_DeityBertoxxulous;
|
||||
case DeityBrellSirilis:
|
||||
return bit_DeityBrellSirilis;
|
||||
case DeityCazicThule:
|
||||
return bit_DeityCazicThule;
|
||||
case DeityErollisiMarr:
|
||||
return bit_DeityErollisiMarr;
|
||||
case DeityBristlebane:
|
||||
return bit_DeityBristlebane;
|
||||
case DeityInnoruuk:
|
||||
return bit_DeityInnoruuk;
|
||||
case DeityKarana:
|
||||
return bit_DeityKarana;
|
||||
case DeityMithanielMarr:
|
||||
return bit_DeityMithanielMarr;
|
||||
case DeityPrexus:
|
||||
return bit_DeityPrexus;
|
||||
case DeityQuellious:
|
||||
return bit_DeityQuellious;
|
||||
case DeityRallosZek:
|
||||
return bit_DeityRallosZek;
|
||||
case DeityRodcetNife:
|
||||
return bit_DeityRodcetNife;
|
||||
case DeitySolusekRo:
|
||||
return bit_DeitySolusekRo;
|
||||
case DeityTheTribunal:
|
||||
return bit_DeityTheTribunal;
|
||||
case DeityTunare:
|
||||
return bit_DeityTunare;
|
||||
case DeityVeeshan:
|
||||
return bit_DeityVeeshan;
|
||||
case DeityAgnostic_LB:
|
||||
case DeityAgnostic:
|
||||
return bit_DeityAgnostic;
|
||||
default:
|
||||
return bit_DeityAll;
|
||||
};
|
||||
case DeityBertoxxulous:
|
||||
return bit_DeityBertoxxulous;
|
||||
case DeityBrellSirilis:
|
||||
return bit_DeityBrellSirilis;
|
||||
case DeityCazicThule:
|
||||
return bit_DeityCazicThule;
|
||||
case DeityErollisiMarr:
|
||||
return bit_DeityErollisiMarr;
|
||||
case DeityBristlebane:
|
||||
return bit_DeityBristlebane;
|
||||
case DeityInnoruuk:
|
||||
return bit_DeityInnoruuk;
|
||||
case DeityKarana:
|
||||
return bit_DeityKarana;
|
||||
case DeityMithanielMarr:
|
||||
return bit_DeityMithanielMarr;
|
||||
case DeityPrexus:
|
||||
return bit_DeityPrexus;
|
||||
case DeityQuellious:
|
||||
return bit_DeityQuellious;
|
||||
case DeityRallosZek:
|
||||
return bit_DeityRallosZek;
|
||||
case DeityRodcetNife:
|
||||
return bit_DeityRodcetNife;
|
||||
case DeitySolusekRo:
|
||||
return bit_DeitySolusekRo;
|
||||
case DeityTheTribunal:
|
||||
return bit_DeityTheTribunal;
|
||||
case DeityTunare:
|
||||
return bit_DeityTunare;
|
||||
case DeityVeeshan:
|
||||
return bit_DeityVeeshan;
|
||||
case DeityAgnostic_LB:
|
||||
case DeityAgnostic:
|
||||
return bit_DeityAgnostic;
|
||||
default:
|
||||
return bit_DeityAll;
|
||||
}
|
||||
}
|
||||
|
||||
EQ::deity::DeityType EQ::deity::ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit)
|
||||
const std::map<EQ::deity::DeityType, std::string>& EQ::deity::GetDeityMap()
|
||||
{
|
||||
switch (deity_type_bit) {
|
||||
case bit_DeityAgnostic:
|
||||
return DeityAgnostic;
|
||||
case bit_DeityBertoxxulous:
|
||||
return DeityBertoxxulous;
|
||||
case bit_DeityBrellSirilis:
|
||||
return DeityBrellSirilis;
|
||||
case bit_DeityCazicThule:
|
||||
return DeityCazicThule;
|
||||
case bit_DeityErollisiMarr:
|
||||
return DeityErollisiMarr;
|
||||
case bit_DeityBristlebane:
|
||||
return DeityBristlebane;
|
||||
case bit_DeityInnoruuk:
|
||||
return DeityInnoruuk;
|
||||
case bit_DeityKarana:
|
||||
return DeityKarana;
|
||||
case bit_DeityMithanielMarr:
|
||||
return DeityMithanielMarr;
|
||||
case bit_DeityPrexus:
|
||||
return DeityPrexus;
|
||||
case bit_DeityQuellious:
|
||||
return DeityQuellious;
|
||||
case bit_DeityRallosZek:
|
||||
return DeityRallosZek;
|
||||
case bit_DeityRodcetNife:
|
||||
return DeityRodcetNife;
|
||||
case bit_DeitySolusekRo:
|
||||
return DeitySolusekRo;
|
||||
case bit_DeityTheTribunal:
|
||||
return DeityTheTribunal;
|
||||
case bit_DeityTunare:
|
||||
return DeityTunare;
|
||||
case bit_DeityVeeshan:
|
||||
return DeityVeeshan;
|
||||
default:
|
||||
return DeityUnknown;
|
||||
static const std::map<EQ::deity::DeityType, std::string> deity_map = {
|
||||
{ DeityAgnostic, "Agnostic" },
|
||||
{ DeityAgnostic_LB, "Agnostic" },
|
||||
{ DeityBertoxxulous, "Bertoxxulous" },
|
||||
{ DeityBrellSirilis, "Brell Serilis" },
|
||||
{ DeityBristlebane, "Bristlebane" },
|
||||
{ DeityCazicThule, "Cazic-Thule" },
|
||||
{ DeityErollisiMarr, "Erollisi Marr" },
|
||||
{ DeityInnoruuk, "Innoruuk" },
|
||||
{ DeityKarana, "Karana" },
|
||||
{ DeityMithanielMarr, "Mithaniel Marr" },
|
||||
{ DeityPrexus, "Prexus" },
|
||||
{ DeityQuellious, "Quellious" },
|
||||
{ DeityRallosZek, "Rallos Zek" },
|
||||
{ DeityRodcetNife, "Rodcet Nife" },
|
||||
{ DeitySolusekRo, "Solusek Ro" },
|
||||
{ DeityTheTribunal, "The Tribunal" },
|
||||
{ DeityTunare, "Tunare" },
|
||||
{ DeityVeeshan, "Veeshan" }
|
||||
};
|
||||
|
||||
return deity_map;
|
||||
}
|
||||
|
||||
const char* EQ::deity::DeityName(DeityType deity_type)
|
||||
std::string EQ::deity::GetDeityName(DeityType deity_type)
|
||||
{
|
||||
switch (deity_type) {
|
||||
case DeityBertoxxulous:
|
||||
return "Bertoxxulous";
|
||||
case DeityBrellSirilis:
|
||||
return "Brell Serilis";
|
||||
case DeityCazicThule:
|
||||
return "Cazic-Thule";
|
||||
case DeityErollisiMarr:
|
||||
return "Erollisi Marr";
|
||||
case DeityBristlebane:
|
||||
return "Bristlebane";
|
||||
case DeityInnoruuk:
|
||||
return "Innoruuk";
|
||||
case DeityKarana:
|
||||
return "Karana";
|
||||
case DeityMithanielMarr:
|
||||
return "Mithaniel Marr";
|
||||
case DeityPrexus:
|
||||
return "Prexus";
|
||||
case DeityQuellious:
|
||||
return "Quellious";
|
||||
case DeityRallosZek:
|
||||
return "Rallos Zek";
|
||||
case DeityRodcetNife:
|
||||
return "Rodcet Nife";
|
||||
case DeitySolusekRo:
|
||||
return "Solusek Ro";
|
||||
case DeityTheTribunal:
|
||||
return "The Tribunal";
|
||||
case DeityTunare:
|
||||
return "Tunare";
|
||||
case DeityVeeshan:
|
||||
return "Veeshan";
|
||||
case DeityAgnostic_LB:
|
||||
case DeityAgnostic:
|
||||
return "Agnostic";
|
||||
default:
|
||||
return "Unknown";
|
||||
};
|
||||
|
||||
if (EQ::deity::GetDeityMap().find(deity_type) != EQ::deity::GetDeityMap().end()) {
|
||||
return EQ::deity::GetDeityMap().find(deity_type)->second;
|
||||
}
|
||||
|
||||
return std::string();
|
||||
}
|
||||
|
||||
+22
-21
@@ -21,6 +21,8 @@
|
||||
#define COMMON_DEITY_H
|
||||
|
||||
#include "types.h"
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
|
||||
namespace EQ
|
||||
@@ -49,30 +51,29 @@ namespace EQ
|
||||
};
|
||||
|
||||
enum DeityTypeBit : uint32 {
|
||||
bit_DeityNone = 0x00000000,
|
||||
bit_DeityAgnostic = 0x00000001,
|
||||
bit_DeityBertoxxulous = 0x00000002,
|
||||
bit_DeityBrellSirilis = 0x00000004,
|
||||
bit_DeityCazicThule = 0x00000008,
|
||||
bit_DeityErollisiMarr = 0x00000010,
|
||||
bit_DeityBristlebane = 0x00000020,
|
||||
bit_DeityInnoruuk = 0x00000040,
|
||||
bit_DeityKarana = 0x00000080,
|
||||
bit_DeityAgnostic = 0x00000001,
|
||||
bit_DeityBertoxxulous = 0x00000002,
|
||||
bit_DeityBrellSirilis = 0x00000004,
|
||||
bit_DeityCazicThule = 0x00000008,
|
||||
bit_DeityErollisiMarr = 0x00000010,
|
||||
bit_DeityBristlebane = 0x00000020,
|
||||
bit_DeityInnoruuk = 0x00000040,
|
||||
bit_DeityKarana = 0x00000080,
|
||||
bit_DeityMithanielMarr = 0x00000100,
|
||||
bit_DeityPrexus = 0x00000200,
|
||||
bit_DeityQuellious = 0x00000400,
|
||||
bit_DeityRallosZek = 0x00000800,
|
||||
bit_DeityRodcetNife = 0x00001000,
|
||||
bit_DeitySolusekRo = 0x00002000,
|
||||
bit_DeityTheTribunal = 0x00004000,
|
||||
bit_DeityTunare = 0x00008000,
|
||||
bit_DeityVeeshan = 0x00010000,
|
||||
bit_DeityAll = 0xFFFFFFFF
|
||||
bit_DeityPrexus = 0x00000200,
|
||||
bit_DeityQuellious = 0x00000400,
|
||||
bit_DeityRallosZek = 0x00000800,
|
||||
bit_DeityRodcetNife = 0x00001000,
|
||||
bit_DeitySolusekRo = 0x00002000,
|
||||
bit_DeityTheTribunal = 0x00004000,
|
||||
bit_DeityTunare = 0x00008000,
|
||||
bit_DeityVeeshan = 0x00010000,
|
||||
bit_DeityAll = UINT32_MAX
|
||||
};
|
||||
|
||||
extern DeityTypeBit ConvertDeityTypeToDeityTypeBit(DeityType deity_type);
|
||||
extern DeityType ConvertDeityTypeBitToDeityType(DeityTypeBit deity_type_bit);
|
||||
extern const char* DeityName(DeityType deity_type);
|
||||
extern DeityTypeBit GetDeityBitmask(DeityType deity_type);
|
||||
extern std::string GetDeityName(DeityType deity_type);
|
||||
extern const std::map<DeityType, std::string>& GetDeityMap();
|
||||
|
||||
} /*deity*/
|
||||
|
||||
|
||||
@@ -446,6 +446,8 @@ void EQEmuLogSys::Out(
|
||||
// remove this when we remove all legacy logs
|
||||
bool ignore_log_legacy_format = (
|
||||
log_category == Logs::Netcode ||
|
||||
log_category == Logs::MySQLQuery ||
|
||||
log_category == Logs::MySQLError ||
|
||||
log_category == Logs::PacketServerClient ||
|
||||
log_category == Logs::PacketClientServer ||
|
||||
log_category == Logs::PacketServerToServer
|
||||
|
||||
@@ -353,7 +353,7 @@ bool EQ::InventoryProfile::SwapItem(
|
||||
fail_state = swapRaceClass;
|
||||
return false;
|
||||
}
|
||||
if (deity_id && source_item->Deity && !(deity::ConvertDeityTypeToDeityTypeBit((deity::DeityType)deity_id) & source_item->Deity)) {
|
||||
if (deity_id && source_item->Deity && !(deity::GetDeityBitmask((deity::DeityType)deity_id) & source_item->Deity)) {
|
||||
fail_state = swapDeity;
|
||||
return false;
|
||||
}
|
||||
@@ -379,7 +379,7 @@ bool EQ::InventoryProfile::SwapItem(
|
||||
fail_state = swapRaceClass;
|
||||
return false;
|
||||
}
|
||||
if (deity_id && destination_item->Deity && !(deity::ConvertDeityTypeToDeityTypeBit((deity::DeityType)deity_id) & destination_item->Deity)) {
|
||||
if (deity_id && destination_item->Deity && !(deity::GetDeityBitmask((deity::DeityType)deity_id) & destination_item->Deity)) {
|
||||
fail_state = swapDeity;
|
||||
return false;
|
||||
}
|
||||
@@ -1444,7 +1444,7 @@ int16 EQ::InventoryProfile::_PutItem(int16 slot_id, ItemInstance* inst)
|
||||
}
|
||||
|
||||
if (result == INVALID_INDEX) {
|
||||
LogError("InventoryProfile::_PutItem: Invalid slot_id specified ({}) with parent slot id ({})", slot_id, parentSlot);
|
||||
LogError("Invalid slot_id specified ({}) with parent slot id ({})", slot_id, parentSlot);
|
||||
InventoryProfile::MarkDirty(inst); // Slot not found, clean up
|
||||
}
|
||||
|
||||
|
||||
@@ -48,5 +48,7 @@
|
||||
#define LANG_HADAL 26
|
||||
#define LANG_UNKNOWN 27
|
||||
|
||||
#define MAX_LANGUAGE_SKILL 100
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
-117
@@ -214,123 +214,6 @@ std::string x;
|
||||
return i;
|
||||
}
|
||||
|
||||
void LoadItemDBFieldNames() {
|
||||
DBFieldNames[0]="N/A"; // Charges
|
||||
DBFieldNames[1]="unknown002"; // ?
|
||||
DBFieldNames[2]="N/A"; // Current Equip Slot
|
||||
DBFieldNames[3]="unknown004";
|
||||
DBFieldNames[4]="unknown005"; // ?
|
||||
DBFieldNames[5]="itemclass"; // "Item Type (0=common, 1=container, 2=book)"
|
||||
DBFieldNames[6]="name"; // Name
|
||||
DBFieldNames[7]="lore"; // "Lore Name (*=lore, &=summoned, #=artifact)"
|
||||
DBFieldNames[8]="idfile"; // IDFile
|
||||
DBFieldNames[9]="id"; // ItemNumber
|
||||
DBFieldNames[10]="weight"; // Weight
|
||||
DBFieldNames[11]="norent"; // "NoRent (0=norent, 255=not norent)"
|
||||
DBFieldNames[12]="nodrop"; // "NoDrop (0=nodrop, 255=not nodrop)"
|
||||
DBFieldNames[13]="size"; // "Size (0=tiny, 1=small, 2=medium, 3=large, 4=giant)"
|
||||
DBFieldNames[14]="slots"; // EquipSlots
|
||||
DBFieldNames[15]="cost"; // Cost
|
||||
DBFieldNames[16]="icon"; // IconNumber
|
||||
DBFieldNames[17]="unknown018";
|
||||
DBFieldNames[18]="unknown019";
|
||||
DBFieldNames[19]="unknown020"; // ?
|
||||
DBFieldNames[20]="tradeskills"; // "Tradeskill Item (1=is a tradeskill item, 0=not)"
|
||||
DBFieldNames[21]="cr"; // SvCold
|
||||
DBFieldNames[22]="dr"; // SvDisease
|
||||
DBFieldNames[23]="pr"; // SvPoison
|
||||
DBFieldNames[24]="mr"; // SvMagic
|
||||
DBFieldNames[25]="fr"; // SvFire
|
||||
DBFieldNames[26]="astr"; // STR
|
||||
DBFieldNames[27]="asta"; // STA
|
||||
DBFieldNames[28]="aagi"; // AGI
|
||||
DBFieldNames[29]="adex"; // DEX
|
||||
DBFieldNames[30]="acha"; // CHA
|
||||
DBFieldNames[31]="aint"; // INT
|
||||
DBFieldNames[32]="awis"; // WIS
|
||||
DBFieldNames[33]="hp"; // HP
|
||||
DBFieldNames[34]="mana"; // Mana
|
||||
DBFieldNames[35]="ac"; // AC
|
||||
DBFieldNames[36]="deity"; // Deity
|
||||
DBFieldNames[37]="skillmodvalue"; // Skill Mod Value
|
||||
DBFieldNames[38]="skillmodtype"; // Skill Mod Type
|
||||
DBFieldNames[39]="banedmgrace"; // Bane Dmg Race
|
||||
DBFieldNames[40]="banedmgamt"; // Band Dmg
|
||||
DBFieldNames[41]="banedmgbody"; // Band Dmg Body
|
||||
DBFieldNames[42]="magic"; // "Magic (0=not magic, 1=magic)"
|
||||
DBFieldNames[43]="casttime2"; // Casttime appears twice
|
||||
DBFieldNames[44]="hasteproclvl"; // "Level (Haste value, rather)"
|
||||
DBFieldNames[45]="reqlevel"; // Required Level
|
||||
DBFieldNames[46]="bardtype"; // Bard Type
|
||||
DBFieldNames[47]="bardvalue"; // Bard Type Amount
|
||||
DBFieldNames[48]="light"; // Light
|
||||
DBFieldNames[49]="delay"; // Attack Delay
|
||||
DBFieldNames[50]="reclevel"; // Recommended Level
|
||||
DBFieldNames[51]="recskill"; // Recommended Skill
|
||||
DBFieldNames[52]="elemdmgamt"; // "Elemental Dmg Type (1=magic, 2=fire, 3=cold, 4=poison, 5=disease)"
|
||||
DBFieldNames[53]="elemdmgtype"; // Elemental Dmg
|
||||
DBFieldNames[54]="effecttype"; // "Effect Type (0=combat, 1=clicky, 2=Worn, 3=Expendable charges, 4=Must Equip Clicky, 5=clicky)"
|
||||
DBFieldNames[55]="range"; // Range
|
||||
DBFieldNames[56]="damage"; // Damage
|
||||
DBFieldNames[57]="color"; // Color
|
||||
DBFieldNames[58]="classes"; // Classes
|
||||
DBFieldNames[59]="races"; // Races
|
||||
DBFieldNames[60]="unknown061";
|
||||
DBFieldNames[61]="spellid"; // SpellId
|
||||
DBFieldNames[62]="maxcharges"; // MaxCharges
|
||||
DBFieldNames[63]="itemtype"; // "Skill (ItemType: 1hs, etc)"
|
||||
DBFieldNames[64]="material"; // Material
|
||||
DBFieldNames[65]="sellrate"; // ** Sell Rate
|
||||
DBFieldNames[66]="unknown067";
|
||||
DBFieldNames[67]="casttime"; // CastTime (milliseconds)
|
||||
DBFieldNames[68]="unknown069";
|
||||
DBFieldNames[69]="unknown070"; // ?
|
||||
DBFieldNames[70]="focusid"; // Focus Effect Spell Id
|
||||
DBFieldNames[71]="combateffects"; // CombatEffects
|
||||
DBFieldNames[72]="shielding"; // Shielding
|
||||
DBFieldNames[73]="stunresist"; // StunResist
|
||||
DBFieldNames[74]="strikethrough"; // StrikeThrough
|
||||
DBFieldNames[75]="unknown076";
|
||||
DBFieldNames[76]="unknown077"; // ?
|
||||
DBFieldNames[77]="spellshield"; // Spell Shield
|
||||
DBFieldNames[78]="avoidance"; // Avoidance
|
||||
DBFieldNames[79]="accuracy"; // Accuracy
|
||||
DBFieldNames[80]="factionmod1"; // Faction Mod Index 1
|
||||
DBFieldNames[81]="factionmod2"; // Faction Mod Index 2
|
||||
DBFieldNames[82]="factionmod3"; // Faction Mod Index 3
|
||||
DBFieldNames[83]="factionmod4"; // Faction Mod Index 4
|
||||
DBFieldNames[84]="factionamt1"; // Faction Mod Value 1
|
||||
DBFieldNames[85]="factionamt2"; // Faction Mod Value 2
|
||||
DBFieldNames[86]="factionamt3"; // Faction Mod Value 3
|
||||
DBFieldNames[87]="factionamt4"; // Faction Mod Value 4
|
||||
DBFieldNames[88]="unknown089";
|
||||
DBFieldNames[89]="charmfile"; // ** Charm File
|
||||
DBFieldNames[90]="unknown091";
|
||||
DBFieldNames[91]="augslot1type"; // Slot1Type
|
||||
DBFieldNames[92]="augslot2type"; // Slot2Type
|
||||
DBFieldNames[93]="augslot3type"; // Slot3Type
|
||||
DBFieldNames[94]="augslot4type"; // Slot4Type
|
||||
DBFieldNames[95]="augslot5type"; // Slot5Type
|
||||
DBFieldNames[96]="ldonpointtheme";
|
||||
DBFieldNames[97]="ldonpointcost"; // ?
|
||||
DBFieldNames[98]="unknown099";
|
||||
DBFieldNames[99]="bagtype"; // bag type
|
||||
DBFieldNames[100]="bagslots"; // bag slots
|
||||
DBFieldNames[101]="bagsize"; // bag size capacity
|
||||
DBFieldNames[102]="bagwr"; // bag weight reduction
|
||||
DBFieldNames[103]="booktype"; // "book type (0=rolled up note, 1=book)"
|
||||
DBFieldNames[104]="unknown105";
|
||||
DBFieldNames[105]="filename"; // Book Filename
|
||||
DBFieldNames[106]="unknown107";
|
||||
DBFieldNames[107]="unknown108";
|
||||
DBFieldNames[108]="loreflag";
|
||||
DBFieldNames[109]="unknown111";
|
||||
DBFieldNames[110]="unknown112";
|
||||
DBFieldNames[111]="unknown113";
|
||||
DBFieldNames[112]="unknown114";
|
||||
DBFieldNames[113]="unknown115"; // ? (end quote)
|
||||
}
|
||||
|
||||
void dump_message_column(unsigned char *buffer, unsigned long length, std::string leader, FILE *to)
|
||||
{
|
||||
unsigned long i,j;
|
||||
|
||||
@@ -15,8 +15,6 @@ bool ItemParse(const char *data, int length, std::map<int,std::map<int,std::stri
|
||||
|
||||
int Tokenize(std::string s, std::map<int,std::string> & tokens, char delim='|');
|
||||
|
||||
void LoadItemDBFieldNames();
|
||||
|
||||
#ifndef WIN32
|
||||
int print_stacktrace();
|
||||
#endif
|
||||
|
||||
+60
-5
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "../common/races.h"
|
||||
#include "data_verification.h"
|
||||
|
||||
const char* GetRaceIDName(uint16 race_id)
|
||||
{
|
||||
@@ -67,7 +68,7 @@ const char* GetRaceIDName(uint16 race_id)
|
||||
// return "Froglok";
|
||||
//case DRAKKIN:
|
||||
// return "Drakkin";
|
||||
|
||||
|
||||
// RoF2 Race Labels
|
||||
case RT_ABHORRENT:
|
||||
return "Abhorrent";
|
||||
@@ -1696,7 +1697,7 @@ bool PlayerAppearance::IsValidBeardColor(uint16 race_id, uint8 gender_id, uint8
|
||||
{
|
||||
if (beard_color_value == 0xFF)
|
||||
return true;
|
||||
|
||||
|
||||
switch (BINDRG(race_id, gender_id)) {
|
||||
case GNOME_MALE:
|
||||
if (beard_color_value <= 24)
|
||||
@@ -1783,7 +1784,7 @@ bool PlayerAppearance::IsValidEyeColor(uint16 race_id, uint8 gender_id, uint8 ey
|
||||
case VAHSHIR_FEMALE:
|
||||
if (eye_color_value <= 9)
|
||||
return true;
|
||||
break;
|
||||
break;
|
||||
case TROLL_MALE:
|
||||
case TROLL_FEMALE:
|
||||
if (eye_color_value <= 10)
|
||||
@@ -2109,7 +2110,7 @@ bool PlayerAppearance::IsValidTexture(uint16 race_id, uint8 gender_id, uint8 tex
|
||||
{
|
||||
if (texture_value == 0xFF)
|
||||
return true;
|
||||
|
||||
|
||||
if (use_luclin) {
|
||||
switch (BINDRG(race_id, gender_id)) {
|
||||
case HUMAN_MALE:
|
||||
@@ -2243,4 +2244,58 @@ const char* GetGenderName(uint32 gender_id) {
|
||||
gender_name = "Neuter";
|
||||
}
|
||||
return gender_name;
|
||||
}
|
||||
}
|
||||
|
||||
const std::string GetPlayerRaceAbbreviation(uint16 race_id)
|
||||
{
|
||||
if (!IsPlayerRace(race_id)) {
|
||||
return std::string("UNK");
|
||||
}
|
||||
|
||||
switch (race_id) {
|
||||
case RACE_HUMAN_1:
|
||||
return "HUM";
|
||||
case RACE_BARBARIAN_2:
|
||||
return "BAR";
|
||||
case RACE_ERUDITE_3:
|
||||
return "ERU";
|
||||
case RACE_WOOD_ELF_4:
|
||||
return "ELF";
|
||||
case RACE_HIGH_ELF_5:
|
||||
return "HIE";
|
||||
case RACE_DARK_ELF_6:
|
||||
return "DEF";
|
||||
case RACE_HALF_ELF_7:
|
||||
return "HEF";
|
||||
case RACE_DWARF_8:
|
||||
return "DWF";
|
||||
case RACE_TROLL_9:
|
||||
return "TRL";
|
||||
case RACE_OGRE_10:
|
||||
return "OGR";
|
||||
case RACE_HALFLING_11:
|
||||
return "HFL";
|
||||
case RACE_GNOME_12:
|
||||
return "GNM";
|
||||
case RACE_IKSAR_128:
|
||||
return "IKS";
|
||||
case RACE_VAH_SHIR_130:
|
||||
return "VAH";
|
||||
case RACE_FROGLOK_330:
|
||||
return "FRG";
|
||||
case RACE_DRAKKIN_522:
|
||||
return "DRK";
|
||||
}
|
||||
|
||||
return std::string("UNK");
|
||||
}
|
||||
|
||||
bool IsPlayerRace(uint16 race_id) {
|
||||
return (
|
||||
EQ::ValueWithin(race_id, RACE_HUMAN_1, RACE_GNOME_12) ||
|
||||
race_id == RACE_IKSAR_128 ||
|
||||
race_id == RACE_VAH_SHIR_130 ||
|
||||
race_id == RACE_FROGLOK_330 ||
|
||||
race_id == RACE_DRAKKIN_522
|
||||
);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#ifndef RACES_H
|
||||
#define RACES_H
|
||||
#include "../common/types.h"
|
||||
#include <string>
|
||||
|
||||
#define MALE 0
|
||||
#define FEMALE 1
|
||||
@@ -853,6 +854,9 @@ const char* GetRaceIDName(uint16 race_id);
|
||||
const char* GetPlayerRaceName(uint32 player_race_value);
|
||||
const char* GetGenderName(uint32 gender_id);
|
||||
|
||||
bool IsPlayerRace(uint16 race_id);
|
||||
const std::string GetPlayerRaceAbbreviation(uint16 race_id);
|
||||
|
||||
uint32 GetPlayerRaceValue(uint16 race_id);
|
||||
uint32 GetPlayerRaceBit(uint16 race_id);
|
||||
|
||||
|
||||
@@ -44,7 +44,35 @@ public:
|
||||
*/
|
||||
|
||||
// Custom extended repository methods here
|
||||
static void ClearFlag(
|
||||
Database& db,
|
||||
AccountFlagsRepository::AccountFlags e
|
||||
) {
|
||||
AccountFlagsRepository::DeleteWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"p_accid = {} AND p_flag = '{}'",
|
||||
e.p_accid,
|
||||
Strings::Escape(e.p_flag)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
static void ReplaceFlag(
|
||||
Database& db,
|
||||
AccountFlagsRepository::AccountFlags e
|
||||
) {
|
||||
db.QueryDatabase(
|
||||
fmt::format(
|
||||
"REPLACE INTO {} ({}) VALUES ({}, '{}', '{}')",
|
||||
TableName(),
|
||||
ColumnsRaw(),
|
||||
e.p_accid,
|
||||
Strings::Escape(e.p_flag),
|
||||
Strings::Escape(e.p_value)
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_ACCOUNT_FLAGS_REPOSITORY_H
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "../../strings.h"
|
||||
#include <ctime>
|
||||
|
||||
|
||||
class BaseItemsRepository {
|
||||
public:
|
||||
struct Items {
|
||||
@@ -122,7 +123,7 @@ public:
|
||||
int32_t pr;
|
||||
int32_t procrate;
|
||||
int32_t races;
|
||||
int32_t range;
|
||||
int32_t range_;
|
||||
int32_t reclevel;
|
||||
int32_t recskill;
|
||||
int32_t reqlevel;
|
||||
@@ -417,7 +418,7 @@ public:
|
||||
"pr",
|
||||
"procrate",
|
||||
"races",
|
||||
"range",
|
||||
"`range`",
|
||||
"reclevel",
|
||||
"recskill",
|
||||
"reqlevel",
|
||||
@@ -708,7 +709,7 @@ public:
|
||||
"pr",
|
||||
"procrate",
|
||||
"races",
|
||||
"range",
|
||||
"`range`",
|
||||
"reclevel",
|
||||
"recskill",
|
||||
"reqlevel",
|
||||
@@ -1033,7 +1034,7 @@ public:
|
||||
e.pr = 0;
|
||||
e.procrate = 0;
|
||||
e.races = 0;
|
||||
e.range = 0;
|
||||
e.range_ = 0;
|
||||
e.reclevel = 0;
|
||||
e.recskill = 0;
|
||||
e.reqlevel = 0;
|
||||
@@ -1240,8 +1241,9 @@ public:
|
||||
{
|
||||
auto results = db.QueryDatabase(
|
||||
fmt::format(
|
||||
"{} WHERE id = {} LIMIT 1",
|
||||
"{} WHERE {} = {} LIMIT 1",
|
||||
BaseSelect(),
|
||||
PrimaryKey(),
|
||||
items_id
|
||||
)
|
||||
);
|
||||
@@ -1353,7 +1355,7 @@ public:
|
||||
e.pr = static_cast<int32_t>(atoi(row[100]));
|
||||
e.procrate = static_cast<int32_t>(atoi(row[101]));
|
||||
e.races = static_cast<int32_t>(atoi(row[102]));
|
||||
e.range = static_cast<int32_t>(atoi(row[103]));
|
||||
e.range_ = static_cast<int32_t>(atoi(row[103]));
|
||||
e.reclevel = static_cast<int32_t>(atoi(row[104]));
|
||||
e.recskill = static_cast<int32_t>(atoi(row[105]));
|
||||
e.reqlevel = static_cast<int32_t>(atoi(row[106]));
|
||||
@@ -1671,7 +1673,7 @@ public:
|
||||
v.push_back(columns[100] + " = " + std::to_string(e.pr));
|
||||
v.push_back(columns[101] + " = " + std::to_string(e.procrate));
|
||||
v.push_back(columns[102] + " = " + std::to_string(e.races));
|
||||
v.push_back(columns[103] + " = " + std::to_string(e.range));
|
||||
v.push_back(columns[103] + " = " + std::to_string(e.range_));
|
||||
v.push_back(columns[104] + " = " + std::to_string(e.reclevel));
|
||||
v.push_back(columns[105] + " = " + std::to_string(e.recskill));
|
||||
v.push_back(columns[106] + " = " + std::to_string(e.reqlevel));
|
||||
@@ -1977,7 +1979,7 @@ public:
|
||||
v.push_back(std::to_string(e.pr));
|
||||
v.push_back(std::to_string(e.procrate));
|
||||
v.push_back(std::to_string(e.races));
|
||||
v.push_back(std::to_string(e.range));
|
||||
v.push_back(std::to_string(e.range_));
|
||||
v.push_back(std::to_string(e.reclevel));
|
||||
v.push_back(std::to_string(e.recskill));
|
||||
v.push_back(std::to_string(e.reqlevel));
|
||||
@@ -2291,7 +2293,7 @@ public:
|
||||
v.push_back(std::to_string(e.pr));
|
||||
v.push_back(std::to_string(e.procrate));
|
||||
v.push_back(std::to_string(e.races));
|
||||
v.push_back(std::to_string(e.range));
|
||||
v.push_back(std::to_string(e.range_));
|
||||
v.push_back(std::to_string(e.reclevel));
|
||||
v.push_back(std::to_string(e.recskill));
|
||||
v.push_back(std::to_string(e.reqlevel));
|
||||
@@ -2609,7 +2611,7 @@ public:
|
||||
e.pr = static_cast<int32_t>(atoi(row[100]));
|
||||
e.procrate = static_cast<int32_t>(atoi(row[101]));
|
||||
e.races = static_cast<int32_t>(atoi(row[102]));
|
||||
e.range = static_cast<int32_t>(atoi(row[103]));
|
||||
e.range_ = static_cast<int32_t>(atoi(row[103]));
|
||||
e.reclevel = static_cast<int32_t>(atoi(row[104]));
|
||||
e.recskill = static_cast<int32_t>(atoi(row[105]));
|
||||
e.reqlevel = static_cast<int32_t>(atoi(row[106]));
|
||||
@@ -2918,7 +2920,7 @@ public:
|
||||
e.pr = static_cast<int32_t>(atoi(row[100]));
|
||||
e.procrate = static_cast<int32_t>(atoi(row[101]));
|
||||
e.races = static_cast<int32_t>(atoi(row[102]));
|
||||
e.range = static_cast<int32_t>(atoi(row[103]));
|
||||
e.range_ = static_cast<int32_t>(atoi(row[103]));
|
||||
e.reclevel = static_cast<int32_t>(atoi(row[104]));
|
||||
e.recskill = static_cast<int32_t>(atoi(row[105]));
|
||||
e.reqlevel = static_cast<int32_t>(atoi(row[106]));
|
||||
|
||||
@@ -44,7 +44,35 @@ public:
|
||||
*/
|
||||
|
||||
// Custom extended repository methods here
|
||||
static std::vector<int32> GetItemIDsBySearchCriteria(
|
||||
Database& db,
|
||||
std::string search_string,
|
||||
int query_limit = 0
|
||||
)
|
||||
{
|
||||
auto query = fmt::format(
|
||||
"SELECT `id` FROM {} WHERE LOWER(`name`) LIKE '%%{}%%' ORDER BY id ASC",
|
||||
TableName(),
|
||||
search_string
|
||||
);
|
||||
|
||||
if (query_limit >= 1) {
|
||||
query += fmt::format(" LIMIT {}", query_limit);
|
||||
}
|
||||
|
||||
std::vector<int32> item_id_list;
|
||||
|
||||
auto results = db.QueryDatabase(query);
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
return item_id_list;
|
||||
}
|
||||
|
||||
for (auto row : results) {
|
||||
item_id_list.emplace_back(Strings::ToInt(row[0]));
|
||||
}
|
||||
|
||||
return item_id_list;
|
||||
}
|
||||
};
|
||||
|
||||
#endif //EQEMU_ITEMS_REPOSITORY_H
|
||||
|
||||
@@ -241,6 +241,7 @@ RULE_CATEGORY_END()
|
||||
RULE_CATEGORY(Skills)
|
||||
RULE_INT(Skills, MaxTrainTradeskills, 21, "Highest level for trading skills that can be learnt by the trainer")
|
||||
RULE_BOOL(Skills, UseLimitTradeskillSearchSkillDiff, true, "Enables the limit for the maximum difference between trivial and skill for recipe searches and favorites")
|
||||
RULE_BOOL(Skills, TrivialTradeskillCombinesNoFail, false, "Enable to make all trivial tradeskill combines unable to fail")
|
||||
RULE_INT(Skills, MaxTradeskillSearchSkillDiff, 50, "The maximum difference in skill between the trivial of an item and the skill of the player if the trivial is higher than the skill. Recipes that have not been learnt or made at least once via the Experiment mode will be removed from searches based on this criteria.")
|
||||
RULE_INT(Skills, MaxTrainSpecializations, 50, "Maximum level a GM trainer will train casting specializations")
|
||||
RULE_INT(Skills, SwimmingStartValue, 100, "Start value of swimming skill")
|
||||
@@ -256,6 +257,7 @@ RULE_BOOL(Pets, UnTargetableSwarmPet, false, "Setting whether swarm pets should
|
||||
RULE_REAL(Pets, PetPowerLevelCap, 10, "Maximum number of levels a player pet can go up with pet power")
|
||||
RULE_BOOL(Pets, CanTakeNoDrop, false, "Setting whether anyone can give no-drop items to pets")
|
||||
RULE_BOOL(Pets, LivelikeBreakCharmOnInvis, true, "Default: true will break charm on any type of invis (hide/ivu/iva/etc) false will only break if the pet can not see you (ex. you have an undead pet and cast IVU")
|
||||
RULE_BOOL(Pets, ClientPetsUseOwnerNameInLastName, true, "Disable this to keep client pet's last names from being owner_name's pet")
|
||||
RULE_CATEGORY_END()
|
||||
|
||||
RULE_CATEGORY(GM)
|
||||
|
||||
@@ -1824,6 +1824,11 @@ struct ServerOOCMute_Struct {
|
||||
bool is_muted;
|
||||
};
|
||||
|
||||
struct ServerZoneStatus_Struct {
|
||||
char name[64];
|
||||
int16 admin;
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif
|
||||
|
||||
@@ -695,8 +695,31 @@ std::string Strings::ConvertToDigit(int n, const std::string& suffix)
|
||||
return NUM_TO_ENGLISH_X[n] + suffix;
|
||||
}
|
||||
}
|
||||
|
||||
bool Strings::BeginsWith(const std::string& subject, const std::string& search)
|
||||
{
|
||||
if (subject.length() < search.length()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return subject.starts_with(search);
|
||||
}
|
||||
|
||||
bool Strings::EndsWith(const std::string& subject, const std::string& search)
|
||||
{
|
||||
if (subject.length() < search.length()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return subject.ends_with(search);
|
||||
}
|
||||
|
||||
bool Strings::Contains(const std::string& subject, const std::string& search)
|
||||
{
|
||||
if (subject.length() < search.length()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return subject.find(search) != std::string::npos;
|
||||
}
|
||||
|
||||
|
||||
@@ -128,6 +128,8 @@ public:
|
||||
static bool ToBool(const std::string& bool_string);
|
||||
static inline bool EqualFold(const std::string &string_one, const std::string &string_two) { return strcasecmp(string_one.c_str(), string_two.c_str()) == 0; }
|
||||
static std::string Random(size_t length);
|
||||
static bool BeginsWith(const std::string& subject, const std::string& search);
|
||||
static bool EndsWith(const std::string& subject, const std::string& search);
|
||||
|
||||
template<typename T>
|
||||
static std::string
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@
|
||||
|
||||
// Build variables
|
||||
// these get injected during the build pipeline
|
||||
#define CURRENT_VERSION "22.15.3-dev" // always append -dev to the current version for custom-builds
|
||||
#define CURRENT_VERSION "22.19.0-dev" // always append -dev to the current version for custom-builds
|
||||
#define LOGIN_VERSION "0.8.0"
|
||||
#define COMPILE_DATE __DATE__
|
||||
#define COMPILE_TIME __TIME__
|
||||
@@ -42,7 +42,7 @@
|
||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||
*/
|
||||
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9228
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9229
|
||||
|
||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9039
|
||||
|
||||
|
||||
+9
-13
@@ -370,7 +370,7 @@ uint32 ZoneStore::GetZoneRuleSet(uint32 zone_id, int version)
|
||||
return 0;
|
||||
}
|
||||
|
||||
const std::string& ZoneStore::GetZoneNote(uint32 zone_id, int version)
|
||||
const std::string ZoneStore::GetZoneNote(uint32 zone_id, int version)
|
||||
{
|
||||
for (auto &z: m_zones) {
|
||||
if (z.zoneidnumber == zone_id && z.version == version) {
|
||||
@@ -384,8 +384,7 @@ const std::string& ZoneStore::GetZoneNote(uint32 zone_id, int version)
|
||||
}
|
||||
}
|
||||
|
||||
const auto& note = std::string();
|
||||
return note;
|
||||
return "";
|
||||
}
|
||||
|
||||
float ZoneStore::GetZoneUnderworld(uint32 zone_id, int version)
|
||||
@@ -736,7 +735,7 @@ float ZoneStore::GetZoneFogDensity(uint32 zone_id, int version)
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
const std::string& ZoneStore::GetZoneFlagNeeded(uint32 zone_id, int version)
|
||||
const std::string ZoneStore::GetZoneFlagNeeded(uint32 zone_id, int version)
|
||||
{
|
||||
for (auto &z: m_zones) {
|
||||
if (z.zoneidnumber == zone_id && z.version == version) {
|
||||
@@ -750,8 +749,7 @@ const std::string& ZoneStore::GetZoneFlagNeeded(uint32 zone_id, int version)
|
||||
}
|
||||
}
|
||||
|
||||
const auto& flag_needed = std::string();
|
||||
return flag_needed;
|
||||
return "";
|
||||
}
|
||||
|
||||
int8 ZoneStore::GetZoneCanBind(uint32 zone_id, int version)
|
||||
@@ -1259,7 +1257,7 @@ int8 ZoneStore::GetZoneMaximumExpansion(uint32 zone_id, int version)
|
||||
return DEFAULT_ZONE_MIN_MAX_EXPANSION;
|
||||
}
|
||||
|
||||
const std::string& ZoneStore::GetZoneContentFlags(uint32 zone_id, int version)
|
||||
const std::string ZoneStore::GetZoneContentFlags(uint32 zone_id, int version)
|
||||
{
|
||||
for (auto &z: m_zones) {
|
||||
if (z.zoneidnumber == zone_id && z.version == version) {
|
||||
@@ -1271,13 +1269,12 @@ const std::string& ZoneStore::GetZoneContentFlags(uint32 zone_id, int version)
|
||||
if (z.zoneidnumber == zone_id && z.version == 0) {
|
||||
return z.content_flags;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const auto& content_flags = std::string();
|
||||
return content_flags;
|
||||
return "";
|
||||
}
|
||||
|
||||
const std::string& ZoneStore::GetZoneContentFlagsDisabled(uint32 zone_id, int version)
|
||||
const std::string ZoneStore::GetZoneContentFlagsDisabled(uint32 zone_id, int version)
|
||||
{
|
||||
for (auto &z: m_zones) {
|
||||
if (z.zoneidnumber == zone_id && z.version == version) {
|
||||
@@ -1291,8 +1288,7 @@ const std::string& ZoneStore::GetZoneContentFlagsDisabled(uint32 zone_id, int ve
|
||||
}
|
||||
}
|
||||
|
||||
const auto& content_flags_disabled = std::string();
|
||||
return content_flags_disabled;
|
||||
return "";
|
||||
}
|
||||
|
||||
int ZoneStore::GetZoneUnderworldTeleportIndex(uint32 zone_id, int version)
|
||||
|
||||
+4
-4
@@ -54,7 +54,7 @@ public:
|
||||
int GetZoneTimeZone(uint32 zone_id, int version = 0);
|
||||
int GetZoneMaximumPlayers(uint32 zone_id, int version = 0);
|
||||
uint32 GetZoneRuleSet(uint32 zone_id, int version = 0);
|
||||
const std::string& GetZoneNote(uint32 zone_id, int version = 0);
|
||||
const std::string GetZoneNote(uint32 zone_id, int version = 0);
|
||||
float GetZoneUnderworld(uint32 zone_id, int version = 0);
|
||||
float GetZoneMinimumClip(uint32 zone_id, int version = 0);
|
||||
float GetZoneMaximumClip(uint32 zone_id, int version = 0);
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
float GetZoneWalkSpeed(uint32 zone_id, int version = 0);
|
||||
uint8 GetZoneTimeType(uint32 zone_id, int version = 0);
|
||||
float GetZoneFogDensity(uint32 zone_id, int version = 0);
|
||||
const std::string& GetZoneFlagNeeded(uint32 zone_id, int version = 0);
|
||||
const std::string GetZoneFlagNeeded(uint32 zone_id, int version = 0);
|
||||
int8 GetZoneCanBind(uint32 zone_id, int version = 0);
|
||||
int8 GetZoneCanCombat(uint32 zone_id, int version = 0);
|
||||
int8 GetZoneCanLevitate(uint32 zone_id, int version = 0);
|
||||
@@ -95,8 +95,8 @@ public:
|
||||
uint32 GetZoneMaximumMovementUpdateRange(uint32 zone_id, int version = 0);
|
||||
int8 GetZoneMinimumExpansion(uint32 zone_id, int version = 0);
|
||||
int8 GetZoneMaximumExpansion(uint32 zone_id, int version = 0);
|
||||
const std::string& GetZoneContentFlags(uint32 zone_id, int version = 0);
|
||||
const std::string& GetZoneContentFlagsDisabled(uint32 zone_id, int version = 0);
|
||||
const std::string GetZoneContentFlags(uint32 zone_id, int version = 0);
|
||||
const std::string GetZoneContentFlagsDisabled(uint32 zone_id, int version = 0);
|
||||
int GetZoneUnderworldTeleportIndex(uint32 zone_id, int version = 0);
|
||||
int GetZoneLavaDamage(uint32 zone_id, int version = 0);
|
||||
int GetZoneMinimumLavaDamage(uint32 zone_id, int version = 0);
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "eqemu-server",
|
||||
"version": "22.15.3",
|
||||
"version": "22.19.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/EQEmu/Server.git"
|
||||
|
||||
@@ -586,7 +586,8 @@ sub get_reserved_cpp_variable_names {
|
||||
return (
|
||||
"class",
|
||||
"int",
|
||||
"key"
|
||||
"key",
|
||||
"range"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -748,7 +748,8 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
}
|
||||
case ServerOP_ZoneStatus: {
|
||||
if (pack->size >= 1) {
|
||||
zoneserver_list.SendZoneStatus((char *)&pack->pBuffer[1], (uint8)pack->pBuffer[0], this);
|
||||
auto z = (ServerZoneStatus_Struct*) pack->pBuffer;
|
||||
zoneserver_list.SendZoneStatus(z->name, z->admin, this);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -118,8 +118,11 @@ SET(zone_sources
|
||||
perl_perlpacket.cpp
|
||||
perl_player_corpse.cpp
|
||||
perl_questitem.cpp
|
||||
perl_questitem_data.cpp
|
||||
perl_raids.cpp
|
||||
perl_spawn.cpp
|
||||
perl_spell.cpp
|
||||
perl_stat_bonuses.cpp
|
||||
perlpacket.cpp
|
||||
petitions.cpp
|
||||
pets.cpp
|
||||
|
||||
+2
-1
@@ -146,7 +146,8 @@ void Mob::CalcItemBonuses(StatBonuses* b) {
|
||||
int16 i;
|
||||
|
||||
for (i = EQ::invslot::BONUS_BEGIN; i <= EQ::invslot::BONUS_SKILL_END; i++) {
|
||||
const EQ::ItemInstance* inst = GetInv().GetItem(i);
|
||||
const auto* inst = GetInv().GetItem(i);
|
||||
|
||||
if (!inst) {
|
||||
continue;
|
||||
}
|
||||
|
||||
+200
-15
@@ -1423,6 +1423,7 @@ int bot_command_init(void)
|
||||
bot_command_add("petremove", "Orders a bot to remove its charmed pet", AccountStatus::Player, bot_subcommand_pet_remove) ||
|
||||
bot_command_add("petsettype", "Orders a Magician bot to use a specified pet type", AccountStatus::Player, bot_subcommand_pet_set_type) ||
|
||||
bot_command_add("picklock", "Orders a capable bot to pick the lock of the closest door", AccountStatus::Player, bot_command_pick_lock) ||
|
||||
bot_command_add("pickpocket", "Orders a capable bot to pickpocket a NPC", AccountStatus::Player, bot_command_pickpocket) ||
|
||||
bot_command_add("precombat", "Sets flag used to determine pre-combat behavior", AccountStatus::Player, bot_command_precombat) ||
|
||||
bot_command_add("portal", "Orders a Wizard bot to open a magical doorway to a specified destination", AccountStatus::Player, bot_subcommand_portal) ||
|
||||
bot_command_add("pull", "Orders a designated bot to 'pull' an enemy", AccountStatus::Player, bot_command_pull) ||
|
||||
@@ -2814,19 +2815,6 @@ void bot_command_bot(Client *c, const Seperator *sep)
|
||||
helper_send_available_subcommands(c, "bot", subcommand_list);
|
||||
}
|
||||
|
||||
void bot_command_botgroup(Client *c, const Seperator *sep)
|
||||
{
|
||||
const std::list<const char*> subcommand_list = {
|
||||
"botgroupaddmember", "botgroupcreate", "botgroupdelete", "botgrouplist", "botgroupload", "botgroupremovemember"
|
||||
};
|
||||
|
||||
if (helper_command_alias_fail(c, "bot_command_botgroup", sep->arg[0], "botgroup")) {
|
||||
return;
|
||||
}
|
||||
|
||||
helper_send_available_subcommands(c, "bot-group", subcommand_list);
|
||||
}
|
||||
|
||||
void bot_command_charm(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto local_list = &bot_command_spells[BCEnum::SpT_Charm];
|
||||
@@ -5316,7 +5304,7 @@ void bot_command_view_combos(Client *c, const Seperator *sep)
|
||||
const uint16 bot_race = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[1]));
|
||||
const std::string race_name = GetRaceIDName(bot_race);
|
||||
|
||||
if (!Mob::IsPlayerRace(bot_race)) {
|
||||
if (!IsPlayerRace(bot_race)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
@@ -5512,6 +5500,12 @@ void bot_subcommand_bot_create(Client *c, const Seperator *sep)
|
||||
|
||||
std::string bot_name = sep->arg[1];
|
||||
bot_name = Strings::UcFirst(bot_name);
|
||||
|
||||
if (Strings::Contains(bot_name, "_")) {
|
||||
c->Message(Chat::White, "Bot name cannot contain underscores!");
|
||||
return;
|
||||
}
|
||||
|
||||
if (arguments < 2 || !sep->IsNumber(2)) {
|
||||
c->Message(Chat::White, "Invalid class!");
|
||||
return;
|
||||
@@ -8894,7 +8888,7 @@ uint32 helper_bot_create(Client *bot_owner, std::string bot_name, uint8 bot_clas
|
||||
return bot_id;
|
||||
}
|
||||
|
||||
if (!Bot::IsValidRaceClassCombo(bot_race, bot_class) && bot_owner->IsPlayerRace(bot_race)) {
|
||||
if (!Bot::IsValidRaceClassCombo(bot_race, bot_class) && IsPlayerRace(bot_race)) {
|
||||
const std::string bot_race_name = GetRaceIDName(bot_race);
|
||||
const std::string bot_class_name = GetClassIDName(bot_class);
|
||||
const auto view_saylink = Saylink::Silent(
|
||||
@@ -10007,3 +10001,194 @@ void bot_command_caster_range(Client* c, const Seperator* sep)
|
||||
c->Message(Chat::White, "Incorrect argument, use help for a list of options.");
|
||||
}
|
||||
}
|
||||
|
||||
void bot_command_pickpocket(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (helper_command_alias_fail(c, "bot_command_pickpocket", sep->arg[0], "pickpocket")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (helper_is_help_or_usage(sep->arg[1])) {
|
||||
c->Message(Chat::White, "usage: <enemy_target>", sep->arg[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
std::list<Bot *> sbl;
|
||||
MyBots::PopulateSBL_BySpawnedBots(c, sbl);
|
||||
|
||||
// Check for capable rogue
|
||||
ActionableBots::Filter_ByClasses(c, sbl, PLAYER_CLASS_ROGUE_BIT);
|
||||
Bot *my_bot = ActionableBots::AsSpawned_ByMinLevelAndClass(c, sbl, 7, ROGUE);
|
||||
if (!my_bot) {
|
||||
c->Message(Chat::White, "No bots are capable of performing this action");
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure a mob is targetted and a valid NPC
|
||||
Mob *target_mob = ActionableTarget::AsSingle_ByAttackable(c);
|
||||
if (!target_mob || !target_mob->IsNPC()) {
|
||||
c->Message(Chat::White, "You must <target> an enemy to use this command");
|
||||
return;
|
||||
}
|
||||
|
||||
NPC *target_npc = ActionableTarget::AsSingle_ByAttackable(c)->CastToNPC();
|
||||
|
||||
// Check if mob is close enough
|
||||
glm::vec4 mob_distance = (c->GetPosition() - target_mob->GetPosition());
|
||||
float mob_xy_distance = ((mob_distance.x * mob_distance.x) + (mob_distance.y * mob_distance.y));
|
||||
float mob_z_distance = (mob_distance.z * mob_distance.z);
|
||||
if (mob_z_distance >= 25 || mob_xy_distance > 250) {
|
||||
c->Message(Chat::White, "You must be closer to an enemy to use this command");
|
||||
return;
|
||||
}
|
||||
|
||||
// Adapted from pickpock skill in npc.cpp
|
||||
// Make sure we are allowed to target them
|
||||
uint8 over_level = target_mob->GetLevel();
|
||||
if (over_level > (my_bot->GetLevel() + THIEF_PICKPOCKET_OVER)) {
|
||||
c->Message(Chat::Red, "You are too inexperienced to pick pocket this target");
|
||||
return;
|
||||
}
|
||||
|
||||
// Random fail roll
|
||||
if (zone->random.Roll(5)) {
|
||||
if (zone->CanDoCombat()) {
|
||||
target_mob->AddToHateList(c, 50);
|
||||
}
|
||||
target_mob->Say("Stop thief!");
|
||||
c->Message(Chat::Red, "You are noticed trying to steal!");
|
||||
return;
|
||||
}
|
||||
|
||||
// Setup variables for calcs
|
||||
bool steal_skill = my_bot->GetSkill(EQ::skills::SkillPickPockets);
|
||||
bool steal_chance = steal_skill * 100 / (5 * over_level + 5);
|
||||
|
||||
// Determine whether to steal money or an item.
|
||||
uint32 money[6] = {
|
||||
0,
|
||||
((steal_skill >= 125) ? (target_npc->GetPlatinum()) : (0)),
|
||||
((steal_skill >= 60) ? (target_npc->GetGold()) : (0)),
|
||||
target_npc->GetSilver(),
|
||||
target_npc->GetCopper(),
|
||||
0
|
||||
};
|
||||
|
||||
bool has_coin = ((money[PickPocketPlatinum] | money[PickPocketGold] | money[PickPocketSilver] | money[PickPocketCopper]) != 0);
|
||||
bool steal_item = (steal_skill >= steal_chance && (zone->random.Roll(50) || !has_coin));
|
||||
|
||||
// Steal item
|
||||
while (steal_item) {
|
||||
std::vector<std::pair<const EQ::ItemData *, uint16>> loot_selection; // <const ItemData*, charges>
|
||||
for (auto item_iter: target_npc->itemlist) {
|
||||
if (!item_iter || !item_iter->item_id) {
|
||||
continue;
|
||||
}
|
||||
auto item_test = database.GetItem(item_iter->item_id);
|
||||
if (item_test->Magic || !item_test->NoDrop || item_test->IsClassBag() || c->CheckLoreConflict(item_test) ||
|
||||
item_iter->equip_slot != EQ::invslot::SLOT_INVALID) {
|
||||
continue;
|
||||
}
|
||||
loot_selection.emplace_back(
|
||||
std::make_pair(
|
||||
item_test,
|
||||
((item_test->Stackable) ? (1) : (item_iter->charges))
|
||||
)
|
||||
);
|
||||
}
|
||||
if (loot_selection.empty()) {
|
||||
steal_item = false;
|
||||
break;
|
||||
}
|
||||
|
||||
int random = zone->random.Int(0, (loot_selection.size() - 1));
|
||||
|
||||
int16 slot_id = c->GetInv().FindFreeSlot(
|
||||
false,
|
||||
true,
|
||||
(loot_selection[random].first->Size),
|
||||
(loot_selection[random].first->ItemType == EQ::item::ItemTypeArrow)
|
||||
);
|
||||
if (slot_id == INVALID_INDEX) {
|
||||
steal_item = false;
|
||||
break;
|
||||
}
|
||||
|
||||
auto item_inst = database.CreateItem(loot_selection[random].first, loot_selection[random].second);
|
||||
if (item_inst == nullptr) {
|
||||
steal_item = false;
|
||||
break;
|
||||
}
|
||||
|
||||
// Successful item pickpocket
|
||||
if (item_inst->IsStackable() && RuleB(Character, UseStackablePickPocketing)) {
|
||||
if (!c->TryStacking(item_inst, ItemPacketTrade, false, false)) {
|
||||
c->PutItemInInventory(slot_id, *item_inst);
|
||||
c->SendItemPacket(slot_id, item_inst, ItemPacketTrade);
|
||||
}
|
||||
}
|
||||
else {
|
||||
c->PutItemInInventory(slot_id, *item_inst);
|
||||
c->SendItemPacket(slot_id, item_inst, ItemPacketTrade);
|
||||
}
|
||||
target_npc->RemoveItem(item_inst->GetID());
|
||||
c->Message(Chat::White, "You stole an item.");
|
||||
safe_delete(item_inst);
|
||||
return;
|
||||
}
|
||||
|
||||
// no items, try money
|
||||
while (!steal_item && has_coin) {
|
||||
uint32 coin_amount = zone->random.Int(1, (steal_skill / 25) + 1);
|
||||
|
||||
int coin_type = PickPocketPlatinum;
|
||||
while (coin_type <= PickPocketCopper) {
|
||||
if (money[coin_type]) {
|
||||
if (coin_amount > money[coin_type]) {
|
||||
coin_amount = money[coin_type];
|
||||
}
|
||||
break;
|
||||
}
|
||||
++coin_type;
|
||||
}
|
||||
if (coin_type > PickPocketCopper) {
|
||||
break;
|
||||
}
|
||||
|
||||
memset(money, 0, (sizeof(int) * 6));
|
||||
money[coin_type] = coin_amount;
|
||||
|
||||
if (zone->random.Roll(steal_chance)) { // Successful coin pickpocket
|
||||
switch (coin_type) {
|
||||
case PickPocketPlatinum:
|
||||
target_npc->SetPlatinum(target_npc->GetPlatinum() - coin_amount);
|
||||
break;
|
||||
case PickPocketGold:
|
||||
target_npc->SetGold(target_npc->GetGold() - coin_amount);
|
||||
break;
|
||||
case PickPocketSilver:
|
||||
target_npc->SetSilver(target_npc->GetSilver() - coin_amount);
|
||||
break;
|
||||
case PickPocketCopper:
|
||||
target_npc->SetCopper(target_npc->GetCopper() - coin_amount);
|
||||
break;
|
||||
default: // has_coin..but, doesn't have coin?
|
||||
c->Message(Chat::Red, "You failed to pickpocket.");
|
||||
return;
|
||||
}
|
||||
c->Message(Chat::White, "You stole money.");
|
||||
c->AddMoneyToPP(
|
||||
money[PickPocketCopper],
|
||||
money[PickPocketSilver],
|
||||
money[PickPocketGold],
|
||||
money[PickPocketPlatinum],
|
||||
true
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(Chat::Red, "You failed to pickpocket.");
|
||||
return;
|
||||
}
|
||||
c->Message(Chat::White, "This target's pockets are empty");
|
||||
}
|
||||
|
||||
+1
-1
@@ -552,7 +552,6 @@ void bot_command_apply_potion(Client* c, const Seperator* sep);
|
||||
void bot_command_attack(Client *c, const Seperator *sep);
|
||||
void bot_command_bind_affinity(Client *c, const Seperator *sep);
|
||||
void bot_command_bot(Client *c, const Seperator *sep);
|
||||
void bot_command_botgroup(Client *c, const Seperator *sep);
|
||||
void bot_command_caster_range(Client* c, const Seperator* sep);
|
||||
void bot_command_charm(Client *c, const Seperator *sep);
|
||||
void bot_command_cure(Client *c, const Seperator *sep);
|
||||
@@ -576,6 +575,7 @@ void bot_command_movement_speed(Client *c, const Seperator *sep);
|
||||
void bot_command_owner_option(Client *c, const Seperator *sep);
|
||||
void bot_command_pet(Client *c, const Seperator *sep);
|
||||
void bot_command_pick_lock(Client *c, const Seperator *sep);
|
||||
void bot_command_pickpocket(Client* c, const Seperator* sep);
|
||||
void bot_command_precombat(Client* c, const Seperator* sep);
|
||||
void bot_command_pull(Client *c, const Seperator *sep);
|
||||
void bot_command_release(Client *c, const Seperator *sep);
|
||||
|
||||
+107
-741
@@ -58,6 +58,7 @@ extern volatile bool RunLoops;
|
||||
#include "mob_movement_manager.h"
|
||||
#include "cheat_manager.h"
|
||||
|
||||
#include "../common/repositories/account_flags_repository.h"
|
||||
#include "../common/repositories/bug_reports_repository.h"
|
||||
#include "../common/repositories/char_recipe_list_repository.h"
|
||||
#include "../common/repositories/character_spells_repository.h"
|
||||
@@ -3958,32 +3959,32 @@ void Client::SendFullPopup(
|
||||
}
|
||||
|
||||
void Client::SendWindow(
|
||||
uint32 PopupID,
|
||||
uint32 NegativeID,
|
||||
uint32 Buttons,
|
||||
const char *ButtonName0,
|
||||
const char *ButtonName1,
|
||||
uint32 Duration,
|
||||
uint32 button_one_id,
|
||||
uint32 button_two_id,
|
||||
uint32 button_type,
|
||||
const char* button_one_text,
|
||||
const char* button_two_text,
|
||||
uint32 duration,
|
||||
int title_type,
|
||||
Client *target,
|
||||
const char *Title,
|
||||
const char *Text,
|
||||
Mob* target,
|
||||
const char* title,
|
||||
const char* text,
|
||||
...
|
||||
)
|
||||
{
|
||||
va_list argptr;
|
||||
char buffer[4096];
|
||||
|
||||
va_start(argptr, Text);
|
||||
vsnprintf(buffer, sizeof(buffer), Text, argptr);
|
||||
va_start(argptr, text);
|
||||
vsnprintf(buffer, sizeof(buffer), text, argptr);
|
||||
va_end(argptr);
|
||||
|
||||
size_t len = strlen(buffer);
|
||||
|
||||
auto app = new EQApplicationPacket(OP_OnLevelMessage, sizeof(OnLevelMessage_Struct));
|
||||
OnLevelMessage_Struct *olms = (OnLevelMessage_Struct *) app->pBuffer;
|
||||
auto app = new EQApplicationPacket(OP_OnLevelMessage, sizeof(OnLevelMessage_Struct));
|
||||
auto* olms = (OnLevelMessage_Struct *) app->pBuffer;
|
||||
|
||||
if (strlen(Text) > (sizeof(olms->Text) - 1)) {
|
||||
if (strlen(text) > (sizeof(olms->Text) - 1)) {
|
||||
safe_delete(app);
|
||||
return;
|
||||
}
|
||||
@@ -3996,47 +3997,47 @@ void Client::SendWindow(
|
||||
case 1: {
|
||||
char name[64] = "";
|
||||
strcpy(name, target->GetName());
|
||||
|
||||
if (strlen(target->GetLastName()) > 0) {
|
||||
char last_name[64] = "";
|
||||
strcpy(last_name, target->GetLastName());
|
||||
strcat(name, " ");
|
||||
strcat(name, last_name);
|
||||
}
|
||||
|
||||
strcpy(olms->Title, name);
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
if (target->GuildID()) {
|
||||
char *guild_name = (char *) guild_mgr.GetGuildName(target->GuildID());
|
||||
strcpy(olms->Title, guild_name);
|
||||
}
|
||||
else {
|
||||
if (target->IsClient() && target->CastToClient()->GuildID()) {
|
||||
auto guild_name = guild_mgr.GetGuildName(target->CastToClient()->GuildID());
|
||||
strn0cpy(olms->Title, guild_name, sizeof(olms->Title));
|
||||
} else {
|
||||
strcpy(olms->Title, "No Guild");
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
strcpy(olms->Title, Title);
|
||||
strcpy(olms->Title, title);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(olms->Text, buffer, len + 1);
|
||||
|
||||
olms->Buttons = Buttons;
|
||||
olms->Buttons = button_type;
|
||||
|
||||
sprintf(olms->ButtonName0, "%s", ButtonName0);
|
||||
sprintf(olms->ButtonName1, "%s", ButtonName1);
|
||||
strn0cpy(olms->ButtonName0, button_one_text, sizeof(olms->ButtonName0));
|
||||
strn0cpy(olms->ButtonName1, button_two_text, sizeof(olms->ButtonName1));
|
||||
|
||||
if (Duration > 0) {
|
||||
olms->Duration = Duration * 1000;
|
||||
}
|
||||
else {
|
||||
olms->Duration = 0xffffffff;
|
||||
if (duration > 0) {
|
||||
olms->Duration = duration * 1000;
|
||||
} else {
|
||||
olms->Duration = UINT32_MAX;
|
||||
}
|
||||
|
||||
olms->PopupID = PopupID;
|
||||
olms->NegativeID = NegativeID;
|
||||
olms->PopupID = button_one_id;
|
||||
olms->NegativeID = button_two_id;
|
||||
|
||||
FastQueuePacket(&app);
|
||||
}
|
||||
@@ -4530,7 +4531,7 @@ bool Client::IsLeadershipEXPOn() {
|
||||
|
||||
}
|
||||
|
||||
int Client::GetAggroCount() {
|
||||
uint32 Client::GetAggroCount() {
|
||||
return AggroCount;
|
||||
}
|
||||
|
||||
@@ -5938,90 +5939,64 @@ void Client::AdventureFinish(bool win, int theme, int points)
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
void Client::CheckLDoNHail(Mob *target)
|
||||
void Client::CheckLDoNHail(NPC* n)
|
||||
{
|
||||
if(!zone->adv_data)
|
||||
{
|
||||
if (!zone->adv_data || !n || n->GetOwnerID()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!target || !target->IsNPC())
|
||||
{
|
||||
auto* ds = (ServerZoneAdventureDataReply_Struct*) zone->adv_data;
|
||||
if (ds->type != Adventure_Rescue || ds->data_id != n->GetNPCTypeID()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(target->GetOwnerID() != 0)
|
||||
{
|
||||
if (entity_list.CheckNPCsClose(n)) {
|
||||
n->Say(
|
||||
"You're here to save me? I couldn't possibly risk leaving yet. There are "
|
||||
"far too many of those horrid things out there waiting to recapture me! Please get "
|
||||
"rid of some more of those vermin and then we can try to leave."
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
ServerZoneAdventureDataReply_Struct* ds = (ServerZoneAdventureDataReply_Struct*)zone->adv_data;
|
||||
if(ds->type != Adventure_Rescue)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(ds->data_id != target->GetNPCTypeID())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(entity_list.CheckNPCsClose(target) != 0)
|
||||
{
|
||||
target->Say("You're here to save me? I couldn't possibly risk leaving yet. There are "
|
||||
"far too many of those horrid things out there waiting to recapture me! Please get"
|
||||
" rid of some more of those vermin and then we can try to leave.");
|
||||
return;
|
||||
}
|
||||
|
||||
Mob *pet = GetPet();
|
||||
if(pet)
|
||||
{
|
||||
if(pet->GetPetType() == petCharmed)
|
||||
{
|
||||
auto pet = GetPet();
|
||||
if (pet) {
|
||||
if (pet->GetPetType() == petCharmed) {
|
||||
pet->BuffFadeByEffect(SE_Charm);
|
||||
}
|
||||
else if(pet->GetPetType() == petNPCFollow)
|
||||
{
|
||||
} else if (pet->GetPetType() == petNPCFollow) {
|
||||
pet->SetOwnerID(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
pet->Depop();
|
||||
}
|
||||
}
|
||||
|
||||
SetPet(target);
|
||||
target->SetOwnerID(GetID());
|
||||
target->Say("Wonderful! Someone to set me free! I feared for my life for so long,"
|
||||
" never knowing when they might choose to end my life. Now that you're here though"
|
||||
" I can rest easy. Please help me find my way out of here as soon as you can"
|
||||
" I'll stay close behind you!");
|
||||
SetPet(n);
|
||||
n->SetOwnerID(GetID());
|
||||
n->Say(
|
||||
"Wonderful! Someone to set me free! I feared for my life for so long, "
|
||||
"never knowing when they might choose to end my life. Now that you're here though "
|
||||
"I can rest easy. Please help me find my way out of here as soon as you can "
|
||||
"I'll stay close behind you!"
|
||||
);
|
||||
}
|
||||
|
||||
void Client::CheckEmoteHail(Mob *target, const char* message)
|
||||
void Client::CheckEmoteHail(NPC* n, const char* message)
|
||||
{
|
||||
if(
|
||||
(message[0] != 'H' &&
|
||||
message[0] != 'h') ||
|
||||
message[1] != 'a' ||
|
||||
message[2] != 'i' ||
|
||||
message[3] != 'l'){
|
||||
if (
|
||||
!Strings::BeginsWith(message, "hail") &&
|
||||
!Strings::BeginsWith(message, "Hail")
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(!target || !target->IsNPC())
|
||||
{
|
||||
if (!n || n->GetOwnerID()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(target->GetOwnerID() != 0)
|
||||
{
|
||||
return;
|
||||
const auto emote_id = n->GetEmoteID();
|
||||
if (emote_id) {
|
||||
n->DoNPCEmote(EQ::constants::EmoteEventTypes::Hailed, emote_id);
|
||||
}
|
||||
uint32 emoteid = target->GetEmoteID();
|
||||
if(emoteid != 0)
|
||||
target->CastToNPC()->DoNPCEmote(EQ::constants::EmoteEventTypes::Hailed, emoteid);
|
||||
}
|
||||
|
||||
void Client::MarkSingleCompassLoc(float in_x, float in_y, float in_z, uint8 count)
|
||||
@@ -6365,544 +6340,6 @@ void Client::RemoveFromInstance(uint16 instance_id)
|
||||
database.RemoveClientFromInstance(instance_id, CharacterID());
|
||||
}
|
||||
|
||||
void Client::SendStatsWindow(Client* client, bool use_window)
|
||||
{
|
||||
// Define the types of page breaks we need
|
||||
std::string indP = " ";
|
||||
std::string indS = " ";
|
||||
std::string indM = " ";
|
||||
std::string indL = " ";
|
||||
std::string div = " | ";
|
||||
|
||||
std::string color_red = "<c \"#993333\">";
|
||||
std::string color_blue = "<c \"#9999FF\">";
|
||||
std::string color_green = "<c \"#33FF99\">";
|
||||
std::string bright_green = "<c \"#7CFC00\">";
|
||||
std::string bright_red = "<c \"#FF0000\">";
|
||||
std::string heroic_color = "<c \"#d6b228\"> +";
|
||||
|
||||
// Set Class
|
||||
std::string class_Name = itoa(GetClass());
|
||||
std::string class_List[] = { "WAR", "CLR", "PAL", "RNG", "SHD", "DRU", "MNK", "BRD", "ROG", "SHM", "NEC", "WIZ", "MAG", "ENC", "BST", "BER" };
|
||||
|
||||
if (GetClass() < 17 && GetClass() > 0) {
|
||||
class_Name = class_List[GetClass() - 1];
|
||||
}
|
||||
|
||||
// Race
|
||||
std::string race_name = GetRaceIDName(GetRace());
|
||||
|
||||
/*##########################################################
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
H/M/E String
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
##########################################################*/
|
||||
std::string HME_row = "";
|
||||
//Loop Variables
|
||||
/*===========================*/
|
||||
std::string cur_field = "";
|
||||
std::string total_field = "";
|
||||
std::string cur_name = "";
|
||||
std::string cur_spacing = "";
|
||||
std::string cur_color = "";
|
||||
|
||||
int hme_rows = 3; // Rows in display
|
||||
int max_HME_value_len = 9; // 9 digits in the displayed value
|
||||
|
||||
for(int hme_row_counter = 0; hme_row_counter < hme_rows; hme_row_counter++)
|
||||
{
|
||||
switch(hme_row_counter) {
|
||||
case 0: {
|
||||
cur_name = " H: ";
|
||||
cur_field = itoa(GetHP());
|
||||
total_field = itoa(GetMaxHP());
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
if(CalcMaxMana() > 0) {
|
||||
cur_name = " M: ";
|
||||
cur_field = itoa(GetMana());
|
||||
total_field = itoa(GetMaxMana());
|
||||
}
|
||||
else { continue; }
|
||||
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
cur_name = " E: ";
|
||||
cur_field = itoa(GetEndurance());
|
||||
total_field = itoa(GetMaxEndurance());
|
||||
break;
|
||||
}
|
||||
default: { break; }
|
||||
}
|
||||
if(cur_field.compare(total_field) == 0) { cur_color = bright_green; }
|
||||
else { cur_color = bright_red; }
|
||||
|
||||
cur_spacing.clear();
|
||||
for(int a = cur_field.size(); a < max_HME_value_len; a++) { cur_spacing += " ."; }
|
||||
|
||||
HME_row += indM + cur_name + cur_spacing + cur_color + cur_field + "</c> / " + total_field + "<br>";
|
||||
}
|
||||
/*##########################################################
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Regen String
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
##########################################################*/
|
||||
std::string regen_string;
|
||||
//Loop Variables
|
||||
/*===========================*/
|
||||
std::string regen_row_header = "";
|
||||
std::string regen_row_color = "";
|
||||
std::string base_regen_field = "";
|
||||
std::string base_regen_spacing = "";
|
||||
std::string item_regen_field = "";
|
||||
std::string item_regen_spacing = "";
|
||||
std::string cap_regen_field = "";
|
||||
std::string cap_regen_spacing = "";
|
||||
std::string spell_regen_field = "";
|
||||
std::string spell_regen_spacing = "";
|
||||
std::string aa_regen_field = "";
|
||||
std::string aa_regen_spacing = "";
|
||||
std::string total_regen_field = "";
|
||||
int regen_rows = 3; // Number of rows
|
||||
int max_regen_value_len = 5; // 5 digits in the displayed value(larger values will not get cut off, this is just a baseline)
|
||||
|
||||
for(int regen_row_counter = 0; regen_row_counter < regen_rows; regen_row_counter++)
|
||||
{
|
||||
switch(regen_row_counter)
|
||||
{
|
||||
case 0: {
|
||||
regen_row_header = "H: ";
|
||||
regen_row_color = color_red;
|
||||
|
||||
base_regen_field = itoa(LevelRegen());
|
||||
item_regen_field = itoa(itembonuses.HPRegen + itembonuses.heroic_hp_regen);
|
||||
cap_regen_field = itoa(CalcHPRegenCap());
|
||||
spell_regen_field = itoa(spellbonuses.HPRegen);
|
||||
aa_regen_field = itoa(aabonuses.HPRegen);
|
||||
total_regen_field = itoa(CalcHPRegen(true));
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
if(GetMaxMana() > 0) {
|
||||
regen_row_header = "M: ";
|
||||
regen_row_color = color_blue;
|
||||
|
||||
base_regen_field = itoa(CalcBaseManaRegen());
|
||||
int32 heroic_mana_regen = itembonuses.heroic_mana_regen;
|
||||
item_regen_field = itoa(itembonuses.ManaRegen + heroic_mana_regen);
|
||||
cap_regen_field = itoa(CalcManaRegenCap());
|
||||
spell_regen_field = itoa(spellbonuses.ManaRegen);
|
||||
aa_regen_field = itoa(aabonuses.ManaRegen);
|
||||
total_regen_field = itoa(CalcManaRegen(true));
|
||||
}
|
||||
else { continue; }
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
regen_row_header = "E: ";
|
||||
regen_row_color = color_green;
|
||||
|
||||
base_regen_field = itoa(((GetLevel() * 4 / 10) + 2));
|
||||
item_regen_field = itoa(itembonuses.EnduranceRegen + itembonuses.heroic_end_regen);
|
||||
cap_regen_field = itoa(CalcEnduranceRegenCap());
|
||||
spell_regen_field = itoa(spellbonuses.EnduranceRegen);
|
||||
aa_regen_field = itoa(aabonuses.EnduranceRegen);
|
||||
total_regen_field = itoa(CalcEnduranceRegen(true));
|
||||
break;
|
||||
}
|
||||
default: { break; }
|
||||
}
|
||||
|
||||
base_regen_spacing.clear();
|
||||
item_regen_spacing.clear();
|
||||
cap_regen_spacing.clear();
|
||||
spell_regen_spacing.clear();
|
||||
aa_regen_spacing.clear();
|
||||
|
||||
for(int b = base_regen_field.size(); b < max_regen_value_len; b++) { base_regen_spacing += " ."; }
|
||||
for(int b = item_regen_field.size(); b < max_regen_value_len; b++) { item_regen_spacing += " ."; }
|
||||
for(int b = cap_regen_field.size(); b < max_regen_value_len; b++) { cap_regen_spacing += " ."; }
|
||||
for(int b = spell_regen_field.size(); b < max_regen_value_len; b++) { spell_regen_spacing += " ."; }
|
||||
for(int b = aa_regen_field.size(); b < max_regen_value_len; b++) { aa_regen_spacing += " ."; }
|
||||
|
||||
regen_string += indS + regen_row_color + regen_row_header + base_regen_spacing + base_regen_field;
|
||||
regen_string += div + item_regen_spacing + item_regen_field + " (" + cap_regen_field;
|
||||
regen_string += ") " + cap_regen_spacing + div + spell_regen_spacing + spell_regen_field;
|
||||
regen_string += div + aa_regen_spacing + aa_regen_field + div + total_regen_field + "</c><br>";
|
||||
}
|
||||
/*##########################################################
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Stat String
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
##########################################################*/
|
||||
std::string stat_field = "";
|
||||
//Loop Variables
|
||||
/*===========================*/
|
||||
//first field(stat)
|
||||
std::string a_stat = "";;
|
||||
std::string a_stat_name = "";
|
||||
std::string a_stat_spacing = "";
|
||||
//second field(heroic stat)
|
||||
std::string h_stat = "";
|
||||
std::string h_stat_spacing = "";
|
||||
//third field(resist)
|
||||
std::string a_resist = "";
|
||||
std::string a_resist_name = "";
|
||||
std::string a_resist_spacing = "";
|
||||
//fourth field(heroic resist)
|
||||
std::string h_resist_field = "";
|
||||
|
||||
int stat_rows = 7; // Number of rows
|
||||
int max_stat_value_len = 3; // 3 digits in the displayed value
|
||||
|
||||
for(int stat_row_counter = 0; stat_row_counter < stat_rows; stat_row_counter++)
|
||||
{
|
||||
switch(stat_row_counter) {
|
||||
case 0: {
|
||||
a_stat_name = " STR: ";
|
||||
a_resist_name = "MR: ";
|
||||
a_stat = itoa(GetSTR());
|
||||
h_stat = itoa(GetHeroicSTR());
|
||||
a_resist = itoa(GetMR());
|
||||
h_resist_field = itoa(GetHeroicMR());
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
a_stat_name = " STA: ";
|
||||
a_resist_name = "CR: ";
|
||||
a_stat = itoa(GetSTA());
|
||||
h_stat = itoa(GetHeroicSTA());
|
||||
a_resist = itoa(GetCR());
|
||||
h_resist_field = itoa(GetHeroicCR());
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
a_stat_name = " AGI : ";
|
||||
a_resist_name = "FR: ";
|
||||
a_stat = itoa(GetAGI());
|
||||
h_stat = itoa(GetHeroicAGI());
|
||||
a_resist = itoa(GetFR());
|
||||
h_resist_field = itoa(GetHeroicFR());
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
a_stat_name = " DEX: ";
|
||||
a_resist_name = "PR: ";
|
||||
a_stat = itoa(GetDEX());
|
||||
h_stat = itoa(GetHeroicDEX());
|
||||
a_resist = itoa(GetPR());
|
||||
h_resist_field = itoa(GetHeroicPR());
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
a_stat_name = " INT : ";
|
||||
a_resist_name = "DR: ";
|
||||
a_stat = itoa(GetINT());
|
||||
h_stat = itoa(GetHeroicINT());
|
||||
a_resist = itoa(GetDR());
|
||||
h_resist_field = itoa(GetHeroicDR());
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
a_stat_name = " WIS: ";
|
||||
a_resist_name = "Cp: ";
|
||||
a_stat = itoa(GetWIS());
|
||||
h_stat = itoa(GetHeroicWIS());
|
||||
a_resist = itoa(GetCorrup());
|
||||
h_resist_field = itoa(GetHeroicCorrup());
|
||||
break;
|
||||
}
|
||||
case 6: {
|
||||
a_stat_name = " CHA: ";
|
||||
a_resist_name = "PhR: "; // Not implemented for clients yet
|
||||
a_stat = itoa(GetCHA());
|
||||
h_stat = itoa(GetHeroicCHA());
|
||||
a_resist = itoa(GetPhR());
|
||||
h_resist_field = itoa(GetHeroicPhR());
|
||||
break;
|
||||
}
|
||||
default: { break; }
|
||||
}
|
||||
|
||||
a_stat_spacing.clear();
|
||||
h_stat_spacing.clear();
|
||||
a_resist_spacing.clear();
|
||||
|
||||
for(int a = a_stat.size(); a < max_stat_value_len; a++) { a_stat_spacing += " . "; }
|
||||
for(int h = h_stat.size(); h < 20; h++) { h_stat_spacing += " . "; }
|
||||
for(int h = a_resist.size(); h < max_stat_value_len; h++) { a_resist_spacing += " . "; }
|
||||
|
||||
stat_field += indP + a_stat_name + a_stat_spacing + a_stat + heroic_color + h_stat + "</c>";
|
||||
stat_field += h_stat_spacing + a_resist_name + a_resist_spacing + a_resist + heroic_color + h_resist_field + "</c>";
|
||||
if(stat_row_counter < 6) {
|
||||
stat_field += "<br>";
|
||||
}
|
||||
}
|
||||
/*##########################################################
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Mod2 String
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
##########################################################*/
|
||||
std::string mod2_field = "";
|
||||
//Loop Variables
|
||||
/*===========================*/
|
||||
std::string mod2a = "";
|
||||
std::string mod2a_name = "";
|
||||
std::string mod2a_spacing = "";
|
||||
std::string mod2a_cap = "";
|
||||
std::string mod_row_spacing = "";
|
||||
std::string mod2b = "";
|
||||
std::string mod2b_name = "";
|
||||
std::string mod2b_spacing = "";
|
||||
std::string mod2b_cap = "";
|
||||
int mod2a_space_count;
|
||||
int mod2b_space_count;
|
||||
|
||||
int mod2_rows = 4;
|
||||
int max_mod2_value_len = 3; // 3 digits in the displayed value
|
||||
|
||||
for(int mod2_row_counter = 0; mod2_row_counter < mod2_rows; mod2_row_counter++)
|
||||
{
|
||||
switch (mod2_row_counter)
|
||||
{
|
||||
case 0: {
|
||||
mod2a_name = "Avoidance: ";
|
||||
mod2b_name = "Combat Effects: ";
|
||||
mod2a = itoa(GetAvoidance());
|
||||
mod2a_cap = itoa(RuleI(Character, ItemAvoidanceCap));
|
||||
mod2b = itoa(GetCombatEffects());
|
||||
mod2b_cap = itoa(RuleI(Character, ItemCombatEffectsCap));
|
||||
mod2a_space_count = 2;
|
||||
mod2b_space_count = 0;
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
mod2a_name = "Accuracy: ";
|
||||
mod2b_name = "Strike Through: ";
|
||||
mod2a = itoa(GetAccuracy());
|
||||
mod2a_cap = itoa(RuleI(Character, ItemAccuracyCap));
|
||||
mod2b = itoa(GetStrikeThrough());
|
||||
mod2b_cap = itoa(RuleI(Character, ItemStrikethroughCap));
|
||||
mod2a_space_count = 3;
|
||||
mod2b_space_count = 1;
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
mod2a_name = "Shielding: ";
|
||||
mod2b_name = "Spell Shielding: ";
|
||||
mod2a = itoa(GetShielding());
|
||||
mod2a_cap = itoa(RuleI(Character, ItemShieldingCap));
|
||||
mod2b = itoa(GetSpellShield());
|
||||
mod2b_cap = itoa(RuleI(Character, ItemSpellShieldingCap));
|
||||
mod2a_space_count = 2;
|
||||
mod2b_space_count = 1;
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
mod2a_name = "Stun Resist: ";
|
||||
mod2b_name = "DoT Shielding: ";
|
||||
mod2a = itoa(GetStunResist());
|
||||
mod2a_cap = itoa(RuleI(Character, ItemStunResistCap));
|
||||
mod2b = itoa(GetDoTShield());
|
||||
mod2b_cap = itoa(RuleI(Character, ItemDoTShieldingCap));
|
||||
mod2a_space_count = 0;
|
||||
mod2b_space_count = 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
mod2a_spacing.clear();
|
||||
mod_row_spacing.clear();
|
||||
mod2b_spacing.clear();
|
||||
|
||||
for(int a = mod2a.size(); a < (max_mod2_value_len + mod2a_space_count); a++) { mod2a_spacing += " . "; }
|
||||
for(int a = mod2a_cap.size(); a < 6 ; a++) { mod_row_spacing += " . "; }
|
||||
for(int a = mod2b.size(); a < (max_mod2_value_len + mod2b_space_count); a++) { mod2b_spacing += " . "; }
|
||||
|
||||
mod2_field += indP + mod2a_name + mod2a_spacing + mod2a + " / " + mod2a_cap + mod_row_spacing;
|
||||
mod2_field += mod2b_name + mod2b_spacing + mod2b + " / " + mod2b_cap + "<br>";
|
||||
}
|
||||
|
||||
uint32 rune_number = 0;
|
||||
uint32 magic_rune_number = 0;
|
||||
uint32 buff_count = GetMaxTotalSlots();
|
||||
for (int i=0; i < buff_count; i++) {
|
||||
if (IsValidSpell(buffs[i].spellid)) {
|
||||
if (buffs[i].melee_rune > 0) { rune_number += buffs[i].melee_rune; }
|
||||
|
||||
if (buffs[i].magic_rune > 0) { magic_rune_number += buffs[i].magic_rune; }
|
||||
}
|
||||
}
|
||||
|
||||
int shield_ac = 0;
|
||||
GetRawACNoShield(shield_ac);
|
||||
|
||||
std::string skill_list[] = {
|
||||
"1H Blunt","1H Slashing","2H Blunt","2H Slashing","Abjuration",
|
||||
"Alteration","Apply Poison","Archery","Backstab","Bind Wound",
|
||||
"Bash","Block","Brass Instruments","Channeling","Conjuration",
|
||||
"Defense","Disarm","Disarm Traps","Divination","Dodge",
|
||||
"Double Attack","Dragon Punch","Dual Wield","Eagle Strike","Evocation",
|
||||
"Feign Death","Flying Kick","Forage","Hand To Hand","Hide",
|
||||
"Kick","Meditate","Mend","Offense","Parry",
|
||||
"Pick Lock","1H Piercing","Riposte","Round Kick","Safe Fall",
|
||||
"Sense Heading","Singing","Sneak","Specialize Abjuration","Specialize Alteration",
|
||||
"Specialize Conjuration","Specialize Divination","Specialize Evocation","Pick Pockets","Stringed Instruments",
|
||||
"Swimming","Throwing","Tiger Claw","Tracking","Wind Instruments",
|
||||
"Fishing","Make Poison","Tinkering","Research","Alchemy",
|
||||
"Baking","Tailoring","Sense Traps","Blacksmithing","Fletching",
|
||||
"Brewing","Alcohol_Tolerance","Begging","Jewelry Making","Pottery",
|
||||
"Percussion Instruments","Intimidation","Berserking","Taunt","Frenzy",
|
||||
"Remove Traps","Triple Attack","2H Piercing"
|
||||
};
|
||||
|
||||
std::string skill_mods = "";
|
||||
for (int j = 0; j <= EQ::skills::HIGHEST_SKILL; j++) {
|
||||
if(itembonuses.skillmod[j] > 0)
|
||||
skill_mods += indP + skill_list[j] + " : +" + itoa(itembonuses.skillmod[j]) + "%<br>";
|
||||
else if(itembonuses.skillmod[j] < 0)
|
||||
skill_mods += indP + skill_list[j] + " : -" + itoa(itembonuses.skillmod[j]) + "%<br>";
|
||||
}
|
||||
|
||||
std::string skill_dmgs = "";
|
||||
for (int j = 0; j <= EQ::skills::HIGHEST_SKILL; j++) {
|
||||
if((itembonuses.SkillDamageAmount[j] + spellbonuses.SkillDamageAmount[j]) > 0)
|
||||
skill_dmgs += indP + skill_list[j] + " : +" + itoa(itembonuses.SkillDamageAmount[j] + spellbonuses.SkillDamageAmount[j]) + "<br>";
|
||||
else if((itembonuses.SkillDamageAmount[j] + spellbonuses.SkillDamageAmount[j]) < 0)
|
||||
skill_dmgs += indP + skill_list[j] + " : -" + itoa(itembonuses.SkillDamageAmount[j] + spellbonuses.SkillDamageAmount[j]) + "<br>";
|
||||
}
|
||||
|
||||
std::string faction_item_string = "";
|
||||
char faction_buf[256];
|
||||
|
||||
for (auto iter = item_faction_bonuses.begin(); iter != item_faction_bonuses.end(); ++iter) {
|
||||
memset(&faction_buf, 0, sizeof(faction_buf));
|
||||
|
||||
if(!content_db.GetFactionName((int)((*iter).first), faction_buf, sizeof(faction_buf)))
|
||||
strcpy(faction_buf, "Not in DB");
|
||||
|
||||
if((*iter).second > 0) {
|
||||
faction_item_string += indP + faction_buf + " : +" + itoa((*iter).second) + "<br>";
|
||||
}
|
||||
else if((*iter).second < 0) {
|
||||
faction_item_string += indP + faction_buf + " : -" + itoa((*iter).second) + "<br>";
|
||||
}
|
||||
}
|
||||
|
||||
std::string bard_info = "";
|
||||
if(GetClass() == BARD) {
|
||||
bard_info = indP + "Singing: " + itoa(GetSingMod()) + "<br>" +
|
||||
indP + "Brass: " + itoa(GetBrassMod()) + "<br>" +
|
||||
indP + "String: " + itoa(GetStringMod()) + "<br>" +
|
||||
indP + "Percussion: " + itoa(GetPercMod()) + "<br>" +
|
||||
indP + "Wind: " + itoa(GetWindMod()) + "<br>";
|
||||
}
|
||||
|
||||
EQ::skills::SkillType skill = EQ::skills::SkillHandtoHand;
|
||||
auto *inst = GetInv().GetItem(EQ::invslot::slotPrimary);
|
||||
if (inst && inst->IsClassCommon()) {
|
||||
switch (inst->GetItem()->ItemType) {
|
||||
case EQ::item::ItemType1HSlash:
|
||||
skill = EQ::skills::Skill1HSlashing;
|
||||
break;
|
||||
case EQ::item::ItemType2HSlash:
|
||||
skill = EQ::skills::Skill2HSlashing;
|
||||
break;
|
||||
case EQ::item::ItemType1HPiercing:
|
||||
skill = EQ::skills::Skill1HPiercing;
|
||||
break;
|
||||
case EQ::item::ItemType1HBlunt:
|
||||
skill = EQ::skills::Skill1HBlunt;
|
||||
break;
|
||||
case EQ::item::ItemType2HBlunt:
|
||||
skill = EQ::skills::Skill2HBlunt;
|
||||
break;
|
||||
case EQ::item::ItemType2HPiercing:
|
||||
if (ClientVersion() < EQ::versions::ClientVersion::RoF2)
|
||||
skill = EQ::skills::Skill1HPiercing;
|
||||
else
|
||||
skill = EQ::skills::Skill2HPiercing;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::ostringstream final_string;
|
||||
final_string <<
|
||||
/* C/L/R */ indP << "Class: " << class_Name << indS << "Level: " << static_cast<int>(GetLevel()) << indS << "Race: " << race_name << "<br>" <<
|
||||
/* Runes */ indP << "Rune: " << rune_number << indL << indS << "Spell Rune: " << magic_rune_number << "<br>" <<
|
||||
/* HP/M/E */ HME_row <<
|
||||
/* DS */ indP << "DS: " << (itembonuses.DamageShield + spellbonuses.DamageShield*-1) << " (Spell: " << (spellbonuses.DamageShield*-1) << " + Item: " << itembonuses.DamageShield << " / " << RuleI(Character, ItemDamageShieldCap) << ")<br>" <<
|
||||
/* Atk */ indP << "<c \"#CCFF00\">tohit: " << compute_tohit(skill) << " / " << GetTotalToHit(skill, 0) << "</c><br>" <<
|
||||
/* Atk2 */ indP << "- Offense: " << offense(skill) << " | Item: " << itembonuses.ATK << " (" << RuleI(Character, ItemATKCap) << ")~Used: " << (itembonuses.ATK * 1.342) << " | Spell: " << spellbonuses.ATK << "<br>" <<
|
||||
/* AC */ indP << "<c \"#CCFF00\">mitigation AC: " << GetMitigationAC() << "</c><br>" <<
|
||||
/* AC2 */ indP << "- defense: " << compute_defense() << " / " << GetTotalDefense() << " | Spell: " << spellbonuses.AC << " | Shield: " << shield_ac << "<br>" <<
|
||||
/* Haste */ indP << "<c \"#CCFF00\">Haste: " << GetHaste() << "</c><br>" <<
|
||||
/* Haste2 */ indP << " - Item: " << itembonuses.haste << " + Spell: " << (spellbonuses.haste + spellbonuses.hastetype2) << " (Cap: " << RuleI(Character, HasteCap) << ") | Over: " << (spellbonuses.hastetype3 + ExtraHaste) << "<br>" <<
|
||||
/* RunSpeed*/ indP << "<c \"#CCFF00\">Runspeed: " << GetRunspeed() << "</c><br>" <<
|
||||
/* RegenLbl */ indL << indS << "Regen<br>" << indS << indP << indP << " Base | Items (Cap) " << indP << " | Spell | A.A.s | Total<br>" <<
|
||||
/* Regen */ regen_string << "<br>" <<
|
||||
/* Stats */ stat_field << "<br><br>" <<
|
||||
/* Mod2s */ mod2_field << "<br>" <<
|
||||
/* HealAmt */ indP << "Heal Amount: " << GetHealAmt() << " / " << RuleI(Character, ItemHealAmtCap) << "<br>" <<
|
||||
/* SpellDmg*/ indP << "Spell Dmg: " << GetSpellDmg() << " / " << RuleI(Character, ItemSpellDmgCap) << "<br>" <<
|
||||
/* Clair */ indP << "Clairvoyance: " << GetClair() << " / " << RuleI(Character, ItemClairvoyanceCap) << "<br>" <<
|
||||
/* DSMit */ indP << "Dmg Shld Mit: " << GetDSMit() << " / " << RuleI(Character, ItemDSMitigationCap) << "<br><br>";
|
||||
if(GetClass() == BARD)
|
||||
final_string << bard_info << "<br>";
|
||||
if(skill_mods.size() > 0)
|
||||
final_string << skill_mods << "<br>";
|
||||
if(skill_dmgs.size() > 0)
|
||||
final_string << skill_dmgs << "<br>";
|
||||
if(faction_item_string.size() > 0)
|
||||
final_string << faction_item_string;
|
||||
|
||||
std::string final_stats = final_string.str();
|
||||
|
||||
if(use_window) {
|
||||
if(final_stats.size() < 4096)
|
||||
{
|
||||
uint32 Buttons = (client->ClientVersion() < EQ::versions::ClientVersion::SoD) ? 0 : 1;
|
||||
client->SendWindow(0, POPUPID_UPDATE_SHOWSTATSWINDOW, Buttons, "Cancel", "Update", 0, 1, this, "", "%s", final_stats.c_str());
|
||||
goto Extra_Info;
|
||||
}
|
||||
else {
|
||||
client->Message(Chat::Yellow, "The window has exceeded its character limit, displaying stats to chat window:");
|
||||
}
|
||||
}
|
||||
|
||||
client->Message(Chat::Yellow, "~~~~~ %s %s ~~~~~", GetCleanName(), GetLastName());
|
||||
client->Message(Chat::White, " Level: %i Class: %i Race: %i DS: %i/%i Size: %1.1f Weight: %.1f/%d ", GetLevel(), GetClass(), GetRace(), GetDS(), RuleI(Character, ItemDamageShieldCap), GetSize(), (float)CalcCurrentWeight() / 10.0f, GetSTR());
|
||||
client->Message(Chat::White, " HP: %i/%i HP Regen: %i/%i",GetHP(), GetMaxHP(), CalcHPRegen(), CalcHPRegenCap());
|
||||
client->Message(Chat::White, " compute_tohit: %i TotalToHit: %i", compute_tohit(skill), GetTotalToHit(skill, 0));
|
||||
client->Message(Chat::White, " compute_defense: %i TotalDefense: %i", compute_defense(), GetTotalDefense());
|
||||
client->Message(Chat::White, " offense: %i mitigation ac: %i", offense(skill), GetMitigationAC());
|
||||
client->Message(Chat::White, " AFK: %i LFG: %i Anon: %i PVP: %i GM: %i Flymode: %i GMSpeed: %i Hideme: %i GMInvul: %d LD: %i ClientVersion: %i TellsOff: %i", AFK, LFG, GetAnon(), GetPVP(), GetGM(), flymode, GetGMSpeed(), GetHideMe(), GetGMInvul(), IsLD(), ClientVersionBit(), tellsoff);
|
||||
if(CalcMaxMana() > 0)
|
||||
client->Message(Chat::White, " Mana: %i/%i Mana Regen: %i/%i", GetMana(), GetMaxMana(), CalcManaRegen(), CalcManaRegenCap());
|
||||
client->Message(Chat::White, " End.: %i/%i End. Regen: %i/%i",GetEndurance(), GetMaxEndurance(), CalcEnduranceRegen(), CalcEnduranceRegenCap());
|
||||
client->Message(Chat::White, " ATK: %i Worn/Spell ATK %i/%i Server Side ATK: %i", GetTotalATK(), RuleI(Character, ItemATKCap), GetATKBonus(), GetATK());
|
||||
client->Message(Chat::White, " Haste: %i / %i (Item: %i + Spell: %i + Over: %i) Run speed: %i", GetHaste(), RuleI(Character, HasteCap), itembonuses.haste, spellbonuses.haste + spellbonuses.hastetype2, spellbonuses.hastetype3 + ExtraHaste, GetRunspeed());
|
||||
client->Message(Chat::White, " STR: %i STA: %i DEX: %i AGI: %i INT: %i WIS: %i CHA: %i", GetSTR(), GetSTA(), GetDEX(), GetAGI(), GetINT(), GetWIS(), GetCHA());
|
||||
client->Message(Chat::White, " hSTR: %i hSTA: %i hDEX: %i hAGI: %i hINT: %i hWIS: %i hCHA: %i", GetHeroicSTR(), GetHeroicSTA(), GetHeroicDEX(), GetHeroicAGI(), GetHeroicINT(), GetHeroicWIS(), GetHeroicCHA());
|
||||
client->Message(Chat::White, " MR: %i PR: %i FR: %i CR: %i DR: %i Corruption: %i PhR: %i", GetMR(), GetPR(), GetFR(), GetCR(), GetDR(), GetCorrup(), GetPhR());
|
||||
client->Message(Chat::White, " hMR: %i hPR: %i hFR: %i hCR: %i hDR: %i hCorruption: %i", GetHeroicMR(), GetHeroicPR(), GetHeroicFR(), GetHeroicCR(), GetHeroicDR(), GetHeroicCorrup());
|
||||
client->Message(Chat::White, " Shielding: %i Spell Shield: %i DoT Shielding: %i Stun Resist: %i Strikethrough: %i Avoidance: %i Accuracy: %i Combat Effects: %i", GetShielding(), GetSpellShield(), GetDoTShield(), GetStunResist(), GetStrikeThrough(), GetAvoidance(), GetAccuracy(), GetCombatEffects());
|
||||
client->Message(Chat::White, " Heal Amt.: %i Spell Dmg.: %i Clairvoyance: %i DS Mitigation: %i", GetHealAmt(), GetSpellDmg(), GetClair(), GetDSMit());
|
||||
if(GetClass() == BARD)
|
||||
client->Message(Chat::White, " Singing: %i Brass: %i String: %i Percussion: %i Wind: %i", GetSingMod(), GetBrassMod(), GetStringMod(), GetPercMod(), GetWindMod());
|
||||
|
||||
Extra_Info:
|
||||
|
||||
client->Message(Chat::White, " BaseRace: %i Gender: %i BaseGender: %i Texture: %i HelmTexture: %i", GetBaseRace(), GetGender(), GetBaseGender(), GetTexture(), GetHelmTexture());
|
||||
if (client->Admin() >= AccountStatus::GMAdmin) {
|
||||
client->Message(Chat::White, " CharID: %i EntityID: %i PetID: %i OwnerID: %i AIControlled: %i Targetted: %i", CharacterID(), GetID(), GetPetID(), GetOwnerID(), IsAIControlled(), targeted);
|
||||
}
|
||||
}
|
||||
|
||||
void Client::SendAltCurrencies() {
|
||||
if (ClientVersion() >= EQ::versions::ClientVersion::SoF) {
|
||||
uint32 count = zone->AlternateCurrencies.size();
|
||||
@@ -7442,87 +6879,6 @@ void Client::SetMaxXTargets(uint8 NewMax)
|
||||
FastQueuePacket(&outapp);
|
||||
}
|
||||
|
||||
const char* Client::GetRacePlural(Client* client) {
|
||||
|
||||
switch (client->CastToMob()->GetRace()) {
|
||||
case HUMAN:
|
||||
return "Humans"; break;
|
||||
case BARBARIAN:
|
||||
return "Barbarians"; break;
|
||||
case ERUDITE:
|
||||
return "Erudites"; break;
|
||||
case WOOD_ELF:
|
||||
return "Wood Elves"; break;
|
||||
case HIGH_ELF:
|
||||
return "High Elves"; break;
|
||||
case DARK_ELF:
|
||||
return "Dark Elves"; break;
|
||||
case HALF_ELF:
|
||||
return "Half Elves"; break;
|
||||
case DWARF:
|
||||
return "Dwarves"; break;
|
||||
case TROLL:
|
||||
return "Trolls"; break;
|
||||
case OGRE:
|
||||
return "Ogres"; break;
|
||||
case HALFLING:
|
||||
return "Halflings"; break;
|
||||
case GNOME:
|
||||
return "Gnomes"; break;
|
||||
case IKSAR:
|
||||
return "Iksar"; break;
|
||||
case VAHSHIR:
|
||||
return "Vah Shir"; break;
|
||||
case FROGLOK:
|
||||
return "Frogloks"; break;
|
||||
case DRAKKIN:
|
||||
return "Drakkin"; break;
|
||||
default:
|
||||
return "Races"; break;
|
||||
}
|
||||
}
|
||||
|
||||
const char* Client::GetClassPlural(Client* client) {
|
||||
|
||||
switch (client->CastToMob()->GetClass()) {
|
||||
case WARRIOR:
|
||||
return "Warriors"; break;
|
||||
case CLERIC:
|
||||
return "Clerics"; break;
|
||||
case PALADIN:
|
||||
return "Paladins"; break;
|
||||
case RANGER:
|
||||
return "Rangers"; break;
|
||||
case SHADOWKNIGHT:
|
||||
return "Shadowknights"; break;
|
||||
case DRUID:
|
||||
return "Druids"; break;
|
||||
case MONK:
|
||||
return "Monks"; break;
|
||||
case BARD:
|
||||
return "Bards"; break;
|
||||
case ROGUE:
|
||||
return "Rogues"; break;
|
||||
case SHAMAN:
|
||||
return "Shamen"; break;
|
||||
case NECROMANCER:
|
||||
return "Necromancers"; break;
|
||||
case WIZARD:
|
||||
return "Wizards"; break;
|
||||
case MAGICIAN:
|
||||
return "Magicians"; break;
|
||||
case ENCHANTER:
|
||||
return "Enchanters"; break;
|
||||
case BEASTLORD:
|
||||
return "Beastlords"; break;
|
||||
case BERSERKER:
|
||||
return "Berserkers"; break;
|
||||
default:
|
||||
return "Classes"; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Client::SendWebLink(const char *website)
|
||||
{
|
||||
if (website) {
|
||||
@@ -8099,36 +7455,57 @@ void Client::SendFactionMessage(int32 tmpvalue, int32 faction_id, int32 faction_
|
||||
|
||||
void Client::LoadAccountFlags()
|
||||
{
|
||||
|
||||
accountflags.clear();
|
||||
std::string query = StringFormat("SELECT p_flag, p_value "
|
||||
"FROM account_flags WHERE p_accid = '%d'",
|
||||
account_id);
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
|
||||
const auto& l = AccountFlagsRepository::GetWhere(database, fmt::format("p_accid = {}", account_id));
|
||||
if (l.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row)
|
||||
accountflags[row[0]] = row[1];
|
||||
}
|
||||
|
||||
void Client::SetAccountFlag(std::string flag, std::string val) {
|
||||
|
||||
std::string query = StringFormat("REPLACE INTO account_flags (p_accid, p_flag, p_value) "
|
||||
"VALUES( '%d', '%s', '%s')",
|
||||
account_id, flag.c_str(), val.c_str());
|
||||
auto results = database.QueryDatabase(query);
|
||||
if(!results.Success()) {
|
||||
return;
|
||||
for (const auto& e : l) {
|
||||
accountflags[e.p_flag] = e.p_value;
|
||||
}
|
||||
|
||||
accountflags[flag] = val;
|
||||
}
|
||||
|
||||
std::string Client::GetAccountFlag(std::string flag)
|
||||
void Client::ClearAccountFlag(const std::string& flag)
|
||||
{
|
||||
return(accountflags[flag]);
|
||||
auto e = AccountFlagsRepository::NewEntity();
|
||||
|
||||
e.p_accid = account_id;
|
||||
e.p_flag = flag;
|
||||
|
||||
AccountFlagsRepository::ClearFlag(database, e);
|
||||
}
|
||||
|
||||
void Client::SetAccountFlag(const std::string& flag, const std::string& value)
|
||||
{
|
||||
auto e = AccountFlagsRepository::NewEntity();
|
||||
|
||||
e.p_accid = account_id;
|
||||
e.p_flag = flag;
|
||||
e.p_value = value;
|
||||
|
||||
AccountFlagsRepository::ReplaceFlag(database, e);
|
||||
|
||||
accountflags[flag] = value;
|
||||
}
|
||||
|
||||
std::string Client::GetAccountFlag(const std::string& flag)
|
||||
{
|
||||
return accountflags[flag];
|
||||
}
|
||||
|
||||
std::vector<std::string> Client::GetAccountFlags()
|
||||
{
|
||||
std::vector<std::string> l;
|
||||
|
||||
l.reserve(accountflags.size());
|
||||
|
||||
for (const auto& e : accountflags) {
|
||||
l.emplace_back(e.first);
|
||||
}
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
void Client::TickItemCheck()
|
||||
@@ -8531,17 +7908,6 @@ void Client::ExpeditionSay(const char *str, int ExpID) {
|
||||
|
||||
}
|
||||
|
||||
void Client::ShowNumHits()
|
||||
{
|
||||
uint32 buffcount = GetMaxTotalSlots();
|
||||
for (uint32 buffslot = 0; buffslot < buffcount; buffslot++) {
|
||||
const Buffs_Struct &curbuff = buffs[buffslot];
|
||||
if (IsValidSpell(curbuff.spellid) && curbuff.hit_number)
|
||||
Message(0, "You have %d hits left on %s", curbuff.hit_number, GetSpellName(curbuff.spellid));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
int Client::GetQuiverHaste(int delay)
|
||||
{
|
||||
const EQ::ItemInstance *pi = nullptr;
|
||||
|
||||
+9
-12
@@ -772,7 +772,6 @@ public:
|
||||
void SetLanguageSkill(int langid, int value);
|
||||
void SetHoTT(uint32 mobid);
|
||||
void ShowSkillsWindow();
|
||||
void SendStatsWindow(Client* client, bool use_window);
|
||||
|
||||
uint16 MaxSkill(EQ::skills::SkillType skillid, uint16 class_, uint16 level) const;
|
||||
inline uint16 MaxSkill(EQ::skills::SkillType skillid) const { return MaxSkill(skillid, GetClass(), GetLevel()); }
|
||||
@@ -1095,7 +1094,7 @@ public:
|
||||
uint16 GetMaxSkillAfterSpecializationRules(EQ::skills::SkillType skillid, uint16 maxSkill);
|
||||
void SendPopupToClient(const char *Title, const char *Text, uint32 PopupID = 0, uint32 Buttons = 0, uint32 Duration = 0);
|
||||
void SendFullPopup(const char *Title, const char *Text, uint32 PopupID = 0, uint32 NegativeID = 0, uint32 Buttons = 0, uint32 Duration = 0, const char *ButtonName0 = 0, const char *ButtonName1 = 0, uint32 SoundControls = 0);
|
||||
void SendWindow(uint32 PopupID, uint32 NegativeID, uint32 Buttons, const char *ButtonName0, const char *ButtonName1, uint32 Duration, int title_type, Client* target, const char *Title, const char *Text, ...);
|
||||
void SendWindow(uint32 button_one_id, uint32 button_two_id, uint32 button_type, const char* button_one_text, const char* button_two_text, uint32 duration, int title_type, Mob* target, const char* title, const char* text, ...);
|
||||
bool PendingTranslocate;
|
||||
time_t TranslocateTime;
|
||||
bool PendingSacrifice;
|
||||
@@ -1348,7 +1347,7 @@ public:
|
||||
|
||||
bool CanEnterZone(const std::string& zone_short_name = "", int16 instance_version = -1);
|
||||
|
||||
int GetAggroCount();
|
||||
uint32 GetAggroCount();
|
||||
void IncrementAggroCount(bool raid_target = false);
|
||||
void DecrementAggroCount();
|
||||
void SendPVPStats();
|
||||
@@ -1361,8 +1360,8 @@ public:
|
||||
uint32 GetLDoNLossesTheme(uint32 t);
|
||||
uint32 GetLDoNPointsTheme(uint32 t);
|
||||
void UpdateLDoNWinLoss(uint32 theme_id, bool win = false, bool remove = false);
|
||||
void CheckLDoNHail(Mob *target);
|
||||
void CheckEmoteHail(Mob *target, const char* message);
|
||||
void CheckLDoNHail(NPC* n);
|
||||
void CheckEmoteHail(NPC* n, const char* message);
|
||||
|
||||
void HandleLDoNOpen(NPC *target);
|
||||
void HandleLDoNSenseTraps(NPC *target, uint16 skill, uint8 type);
|
||||
@@ -1560,8 +1559,6 @@ public:
|
||||
Timer* GetMercTimer() { return &merc_timer; };
|
||||
Timer* GetPickLockTimer() { return &pick_lock_timer; };
|
||||
|
||||
const char* GetRacePlural(Client* client);
|
||||
const char* GetClassPlural(Client* client);
|
||||
void SendWebLink(const char* website);
|
||||
void SendMarqueeMessage(uint32 type, std::string message, uint32 duration = 3000);
|
||||
void SendMarqueeMessage(uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, std::string message);
|
||||
@@ -1584,8 +1581,10 @@ public:
|
||||
int32 GetActWIS() { return( std::min(GetMaxWIS(), GetWIS()) ); }
|
||||
int32 GetActCHA() { return( std::min(GetMaxCHA(), GetCHA()) ); }
|
||||
void LoadAccountFlags();
|
||||
void SetAccountFlag(std::string flag, std::string val);
|
||||
std::string GetAccountFlag(std::string flag);
|
||||
void ClearAccountFlag(const std::string& flag);
|
||||
void SetAccountFlag(const std::string& flag, const std::string& value);
|
||||
std::string GetAccountFlag(const std::string& flag);
|
||||
std::vector<std::string> GetAccountFlags();
|
||||
void SetGMStatus(int16 new_status);
|
||||
void Consume(const EQ::ItemData *item, uint8 type, int16 slot, bool auto_consume);
|
||||
void PlayMP3(const char* fname);
|
||||
@@ -1597,8 +1596,6 @@ public:
|
||||
void SetInvulnerableEnvironmentDamage(bool val) { invulnerable_environment_damage = val; }
|
||||
void SetIntoxication(int32 in_intoxication);
|
||||
|
||||
void ShowNumHits(); // work around function for numhits not showing on buffs
|
||||
|
||||
void ApplyWeaponsStance();
|
||||
void TogglePassiveAlternativeAdvancement(const AA::Rank &rank, uint32 ability_id);
|
||||
bool UseTogglePassiveHotkey(const AA::Rank &rank);
|
||||
@@ -1908,7 +1905,7 @@ private:
|
||||
int8 last_reported_mana_percent;
|
||||
int8 last_reported_endurance_percent;
|
||||
|
||||
unsigned int AggroCount; // How many mobs are aggro on us.
|
||||
uint32 AggroCount; // How many mobs are aggro on us.
|
||||
|
||||
bool ooc_regen;
|
||||
float AreaHPRegen;
|
||||
|
||||
@@ -649,7 +649,7 @@ int64 Client::CalcBaseMana()
|
||||
int64 Client::CalcBaseManaRegen()
|
||||
{
|
||||
uint8 clevel = GetLevel();
|
||||
int32 regen = 0;
|
||||
int64 regen = 0;
|
||||
if (IsSitting() || (GetHorseId() != 0)) {
|
||||
if (HasSkill(EQ::skills::SkillMeditate)) {
|
||||
regen = (((GetSkill(EQ::skills::SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4;
|
||||
@@ -666,7 +666,7 @@ int64 Client::CalcBaseManaRegen()
|
||||
|
||||
int64 Client::CalcManaRegen(bool bCombat)
|
||||
{
|
||||
int regen = 0;
|
||||
int64 regen = 0;
|
||||
auto level = GetLevel();
|
||||
// so the new formulas break down with older skill caps where you don't have the skill until 4 or 8
|
||||
// so for servers that want to use the old skill progression they can set this rule so they
|
||||
@@ -688,9 +688,9 @@ int64 Client::CalcManaRegen(bool bCombat)
|
||||
}
|
||||
}
|
||||
if (old)
|
||||
regen = std::max(regen, 2);
|
||||
regen = std::max(regen, static_cast<int64>(2));
|
||||
} else if (old) {
|
||||
regen = std::max(regen, 1);
|
||||
regen = std::max(regen, static_cast<int64>(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+20
-17
@@ -6779,16 +6779,14 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app)
|
||||
|
||||
void Client::Handle_OP_GMServers(const EQApplicationPacket *app)
|
||||
{
|
||||
if (!worldserver.Connected())
|
||||
Message(Chat::Red, "Error: World server disconnected");
|
||||
else {
|
||||
auto pack = new ServerPacket(ServerOP_ZoneStatus, strlen(GetName()) + 2);
|
||||
memset(pack->pBuffer, (uint8)admin, 1);
|
||||
strcpy((char *)&pack->pBuffer[1], GetName());
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
return;
|
||||
auto pack = new ServerPacket(ServerOP_ZoneStatus, sizeof(ServerZoneStatus_Struct));
|
||||
|
||||
auto z = (ServerZoneStatus_Struct *) pack->pBuffer;
|
||||
z->admin = Admin();
|
||||
strn0cpy(z->name, GetName(), sizeof(z->name));
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
delete pack;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_GMSummon(const EQApplicationPacket *app)
|
||||
@@ -9147,8 +9145,14 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app)
|
||||
}
|
||||
else if (inst->IsClassCommon())
|
||||
{
|
||||
if (!RuleB(Skills, RequireTomeHandin) && item->ItemType == EQ::item::ItemTypeSpell && (strstr((const char*)item->Name, "Tome of ") || strstr((const char*)item->Name, "Skill: ")))
|
||||
{
|
||||
if (
|
||||
!RuleB(Skills, RequireTomeHandin) &&
|
||||
item->ItemType == EQ::item::ItemTypeSpell &&
|
||||
(
|
||||
Strings::BeginsWith(item->Name, "Tome of ") ||
|
||||
Strings::BeginsWith(item->Name, "Skill: ")
|
||||
)
|
||||
) {
|
||||
DeleteItemInInventory(slot_id, 1, true);
|
||||
TrainDiscipline(item->ID);
|
||||
}
|
||||
@@ -10712,7 +10716,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
|
||||
case PET_HEALTHREPORT: {
|
||||
if ((mypet->GetPetType() == petAnimation && aabonuses.PetCommands[PetCommand]) || mypet->GetPetType() != petAnimation) {
|
||||
MessageString(Chat::PetResponse, PET_REPORT_HP, ConvertArrayF(mypet->GetHPRatio(), val1));
|
||||
mypet->ShowBuffList(this);
|
||||
mypet->ShowBuffs(this);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -11462,10 +11466,9 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app)
|
||||
break;
|
||||
|
||||
case POPUPID_UPDATE_SHOWSTATSWINDOW:
|
||||
if (GetTarget() && GetTarget()->IsClient()) {
|
||||
GetTarget()->CastToClient()->SendStatsWindow(this, true);
|
||||
}
|
||||
else {
|
||||
if (GetTarget() && GetTarget()->IsOfClientBot()) {
|
||||
GetTarget()->SendStatsWindow(this, true);
|
||||
} else {
|
||||
SendStatsWindow(this, true);
|
||||
}
|
||||
return;
|
||||
|
||||
+108
-129
@@ -86,7 +86,6 @@ int command_init(void)
|
||||
if (
|
||||
command_add("acceptrules", "[acceptrules] - Accept the EQEmu Agreement", AccountStatus::Player, command_acceptrules) ||
|
||||
command_add("advnpcspawn", "[maketype|makegroup|addgroupentry|addgroupspawn][removegroupspawn|movespawn|editgroupbox|cleargroupbox]", AccountStatus::GMLeadAdmin, command_advnpcspawn) ||
|
||||
command_add("aggro", "[Distance] [-v] - Display aggro information for all mobs 'Distance' distance from your target. (-v is verbose Faction Information)", AccountStatus::QuestTroupe, command_aggro) ||
|
||||
command_add("aggrozone", "[aggro] - Aggro every mob in the zone with X aggro. Default is 0. Not recommend if you're not invulnerable.", AccountStatus::GMAdmin, command_aggrozone) ||
|
||||
command_add("ai", "[factionid/spellslist/con/guard/roambox/stop/start] - Modify AI on NPC target", AccountStatus::GMAdmin, command_ai) ||
|
||||
command_add("appearance", "[type] [value] - Send an appearance packet for you or your target", AccountStatus::GMLeadAdmin, command_appearance) ||
|
||||
@@ -101,12 +100,10 @@ int command_init(void)
|
||||
command_add("camerashake", "[Duration (Milliseconds)] [Intensity (1-10)] - Shakes the camera on everyone's screen globally.", AccountStatus::QuestTroupe, command_camerashake) ||
|
||||
command_add("castspell", "[Spell ID] [Instant (0 = False, 1 = True, Default is 1 if Unused)] - Cast a spell", AccountStatus::Guide, command_castspell) ||
|
||||
command_add("chat", "[Channel ID] [Message] - Send a channel message to all zones", AccountStatus::GMMgmt, command_chat) ||
|
||||
command_add("checklos", "Check for line of sight to your target", AccountStatus::Guide, command_checklos) ||
|
||||
command_add("copycharacter", "[source_char_name] [dest_char_name] [dest_account_name] - Copies character to destination account", AccountStatus::GMImpossible, command_copycharacter) ||
|
||||
command_add("corpse", "Manipulate corpses, use with no arguments for help", AccountStatus::Guide, command_corpse) ||
|
||||
command_add("corpsefix", "Attempts to bring corpses from underneath the ground within close proximity of the player", AccountStatus::Player, command_corpsefix) ||
|
||||
command_add("countitem", "[Item ID] - Counts the specified Item ID in your or your target's inventory", AccountStatus::GMLeadAdmin, command_countitem) ||
|
||||
command_add("cvs", "Summary of client versions currently online.", AccountStatus::GMMgmt, command_cvs) ||
|
||||
command_add("damage", "[Amount] - Damage yourself or your target", AccountStatus::GMAdmin, command_damage) ||
|
||||
command_add("databuckets", "View|Delete [key] [limit]- View data buckets, limit 50 default or Delete databucket by key", AccountStatus::QuestTroupe, command_databuckets) ||
|
||||
command_add("date", "[Year] [Month] [Day] [Hour] [Minute] - Set EQ time (Hour and Minute are optional)", AccountStatus::EQSupport, command_date) ||
|
||||
@@ -118,7 +115,6 @@ int command_init(void)
|
||||
command_add("devtools", "[Enable|Disable] - Manages Developer Tools (send no parameter for menu)", AccountStatus::GMMgmt, command_devtools) ||
|
||||
command_add("disablerecipe", "[Recipe ID] - Disables a Recipe", AccountStatus::QuestTroupe, command_disablerecipe) ||
|
||||
command_add("disarmtrap", "Analog for ldon disarm trap for the newer clients since we still don't have it working.", AccountStatus::QuestTroupe, command_disarmtrap) ||
|
||||
command_add("distance", "Reports the distance between you and your target.", AccountStatus::QuestTroupe, command_distance) ||
|
||||
command_add("door", "Door editing command", AccountStatus::QuestTroupe, command_door) ||
|
||||
command_add("doanim", "[Animation ID|Animation Name] [Speed] - Send an animation by ID or name at the specified speed to you or your target (Speed is optional)", AccountStatus::Guide, command_doanim) ||
|
||||
command_add("dye", "[slot|'help'] [red] [green] [blue] [use_tint] - Dyes the specified armor slot to Red, Green, and Blue provided, allows you to bypass darkness limits.", AccountStatus::ApprenticeGuide, command_dye) ||
|
||||
@@ -126,8 +122,6 @@ int command_init(void)
|
||||
command_add("dzkickplayers", "Removes all players from current expedition. (/kickplayers alternative for pre-RoF clients)", AccountStatus::Player, command_dzkickplayers) ||
|
||||
command_add("editmassrespawn", "[name-search] [second-value] - Mass (Zone wide) NPC respawn timer editing command", AccountStatus::GMAdmin, command_editmassrespawn) ||
|
||||
command_add("emote", "[Name|World|Zone] [type] [message] - Send an emote message by name, to the world, or to your zone (^ separator allows multiple messages to be sent at once)", AccountStatus::QuestTroupe, command_emote) ||
|
||||
command_add("emotesearch", "[Search Criteria] - Search for NPC Emotes", AccountStatus::QuestTroupe, command_emotesearch) ||
|
||||
command_add("emoteview", "Lists all NPC Emotes", AccountStatus::QuestTroupe, command_emoteview) ||
|
||||
command_add("emptyinventory", "Clears your or your target's entire inventory (Equipment, General, Bank, and Shared Bank)", AccountStatus::GMImpossible, command_emptyinventory) ||
|
||||
command_add("enablerecipe", "[Recipe ID] - Enables a Recipe", AccountStatus::QuestTroupe, command_enablerecipe) ||
|
||||
command_add("endurance", "Restores your or your target's endurance.", AccountStatus::Guide, command_endurance) ||
|
||||
@@ -137,35 +131,17 @@ int command_init(void)
|
||||
command_add("factionassociation", "[factionid] [amount] - triggers a faction hits via association", AccountStatus::GMLeadAdmin, command_faction_association) ||
|
||||
command_add("feature", "Change your or your target's feature's temporarily", AccountStatus::QuestTroupe, command_feature) ||
|
||||
command_add("size", "Change your targets size (alias of #feature size)", AccountStatus::QuestTroupe, command_feature) ||
|
||||
command_add("findaa", "[Search Criteria] - Search for an AA", AccountStatus::Guide, command_findaa) ||
|
||||
command_add("findaliases", "[Search Criteria]- Searches for available command aliases, by alias or command", AccountStatus::Player, command_findaliases) ||
|
||||
command_add("findcharacter", "[Search Criteria] - Search for a character", AccountStatus::Guide, command_findcharacter) ||
|
||||
command_add("findclass", "[Search Criteria] - Search for a class", AccountStatus::Guide, command_findclass) ||
|
||||
command_add("findcurrency", "[Search Criteria] - Search for an alternate currency", AccountStatus::Guide, command_findcurrency) ||
|
||||
command_add("findfaction", "[Search Criteria] - Search for a faction", AccountStatus::Guide, command_findfaction) ||
|
||||
command_add("findnpctype", "[Search Criteria] - Search database NPC types", AccountStatus::GMAdmin, command_findnpctype) ||
|
||||
command_add("findrace", "[Search Criteria] - Search for a race", AccountStatus::Guide, command_findrace) ||
|
||||
command_add("findrecipe", "[Search Criteria] - Search for a recipe", AccountStatus::Guide, command_findrecipe) ||
|
||||
command_add("findskill", "[Search Criteria] - Search for a skill", AccountStatus::Guide, command_findskill) ||
|
||||
command_add("findspell", "[Search Criteria] - Search for a spell", AccountStatus::Guide, command_findspell) ||
|
||||
command_add("findtask", "[Search Criteria] - Search for a task", AccountStatus::Guide, command_findtask) ||
|
||||
command_add("findzone", "[Search Criteria] - Search database zones", AccountStatus::GMAdmin, command_findzone) ||
|
||||
command_add("find", "Search command used to find various things", AccountStatus::Guide, command_find) ||
|
||||
command_add("fixmob", "[race|gender|texture|helm|face|hair|haircolor|beard|beardcolor|heritage|tattoo|detail] [next|prev] - Manipulate appearance of your target", AccountStatus::QuestTroupe, command_fixmob) ||
|
||||
command_add("flag", "[Status] [Account Name] - Refresh your admin status, or set an account's Admin status if arguments provided", AccountStatus::Player, command_flag) ||
|
||||
command_add("flagedit", "Edit zone flags on your target. Use #flagedit help for more info.", AccountStatus::GMAdmin, command_flagedit) ||
|
||||
command_add("flags", "displays the Zone Flags of you or your target", AccountStatus::Player, command_flags) ||
|
||||
command_add("flymode", "[0/1/2/3/4/5] - Set your or your player target's flymode to ground/flying/levitate/water/floating/levitate_running", AccountStatus::Guide, command_flymode) ||
|
||||
command_add("fov", "Check wether you're behind or in your target's field of view", AccountStatus::QuestTroupe, command_fov) ||
|
||||
command_add("freeze", "Freeze your target", AccountStatus::QuestTroupe, command_freeze) ||
|
||||
command_add("gassign", "[Grid ID] - Assign targetted NPC to predefined wandering grid id", AccountStatus::GMAdmin, command_gassign) ||
|
||||
command_add("gearup", "Developer tool to quickly equip yourself or your target", AccountStatus::GMMgmt, command_gearup) ||
|
||||
command_add("gender", "[0/1/2] - Change your or your target's gender to male/female/neuter", AccountStatus::Guide, command_gender) ||
|
||||
command_add("getplayerburiedcorpsecount", "Get your or your target's total number of buried player corpses.", AccountStatus::GMAdmin, command_getplayerburiedcorpsecount) ||
|
||||
command_add("getvariable", "[Variable Name] - Get the value of a variable from the database", AccountStatus::GMMgmt, command_getvariable) ||
|
||||
command_add("ginfo", "get group info on target.", AccountStatus::ApprenticeGuide, command_ginfo) ||
|
||||
command_add("giveitem", "[itemid] [charges] - Summon an item onto your target's cursor. Charges are optional.", AccountStatus::GMMgmt, command_giveitem) ||
|
||||
command_add("givemoney", "[Platinum] [Gold] [Silver] [Copper] - Gives specified amount of money to you or your player target", AccountStatus::GMMgmt, command_givemoney) ||
|
||||
command_add("globalview", "Lists all qglobals in cache if you were to do a quest with this target.", AccountStatus::QuestTroupe, command_globalview) ||
|
||||
command_add("gm", "[On|Off] - Modify your or your target's GM Flag", AccountStatus::QuestTroupe, command_gm) ||
|
||||
command_add("gmspeed", "[On|Off] - Turn GM Speed On or Off for you or your player target", AccountStatus::GMAdmin, command_gmspeed) ||
|
||||
command_add("gmzone", "[Zone ID|Zone Short Name] [Version] [Instance Identifier] - Zones to a private GM instance (Version defaults to 0 and Instance Identifier defaults to 'gmzone' if not used)", AccountStatus::GMAdmin, command_gmzone) ||
|
||||
@@ -174,7 +150,6 @@ int command_init(void)
|
||||
command_add("grid", "[add/delete] [grid_num] [wandertype] [pausetype] - Create/delete a wandering grid", AccountStatus::GMAreas, command_grid) ||
|
||||
command_add("guild", "Guild manipulation commands. Use argument help for more info.", AccountStatus::Steward, command_guild) ||
|
||||
command_add("haste", "[Percentage] - Set your or your target's GM Bonus Haste (100 is 100% more Attack Speed)", AccountStatus::GMAdmin, command_haste) ||
|
||||
command_add("hatelist", "Display hate list for NPC.", AccountStatus::QuestTroupe, command_hatelist) ||
|
||||
command_add("heal", "Completely heal your target", AccountStatus::Steward, command_heal) ||
|
||||
command_add("help", "[Search Criteria] - List available commands and their description, specify partial command as argument to search", AccountStatus::Player, command_help) ||
|
||||
command_add("heromodel", "[Hero Model] [Slot] - Set your or your target's appearance to a full set of Hero's Forge Armor, if slot is set, sends exact model just to slot.", AccountStatus::GMMgmt, command_heromodel) ||
|
||||
@@ -188,15 +163,12 @@ int command_init(void)
|
||||
command_add("invsnapshot", "Manipulates inventory snapshots for your current target", AccountStatus::QuestTroupe, command_invsnapshot) ||
|
||||
command_add("invul", "[On|Off]] - Turn player target's or your invulnerable flag on or off", AccountStatus::QuestTroupe, command_invul) ||
|
||||
command_add("ipban", "[IP] - Ban IP", AccountStatus::GMMgmt, command_ipban) ||
|
||||
command_add("iplookup", "[charname] - Look up IP address of charname", AccountStatus::GMMgmt, command_iplookup) ||
|
||||
command_add("itemsearch", "[Search Criteria] - Search for an item", AccountStatus::Steward, command_itemsearch) ||
|
||||
command_add("kick", "[Character Name] - Disconnect a player by name", AccountStatus::GMLeadAdmin, command_kick) ||
|
||||
command_add("kill", "Kill your target", AccountStatus::GMAdmin, command_kill) ||
|
||||
command_add("killallnpcs", "[npc_name] - Kills all npcs by search name, leave blank for all attackable NPC's", AccountStatus::GMMgmt, command_killallnpcs) ||
|
||||
command_add("lastname", "[Last Name] - Set your or your player target's last name (use \"-1\" to remove last name)", AccountStatus::Guide, command_lastname) ||
|
||||
command_add("level", "[Level] - Set your or your target's level", AccountStatus::Steward, command_level) ||
|
||||
command_add("list", "[npcs|players|corpses|doors|objects] [search] - Search entities", AccountStatus::ApprenticeGuide, command_list) ||
|
||||
command_add("listpetition", "List petitions", AccountStatus::Guide, command_listpetition) ||
|
||||
command_add("lootsim", "[npc_type_id] [loottable_id] [iterations] - Runs benchmark simulations using real loot logic to report numbers and data", AccountStatus::GMImpossible, command_lootsim) ||
|
||||
command_add("load_shared_memory", "[shared_memory_name] - Reloads shared memory and uses the input as output", AccountStatus::GMImpossible, command_load_shared_memory) ||
|
||||
command_add("loc", "Print out your or your target's current location and heading", AccountStatus::Player, command_loc) ||
|
||||
@@ -214,8 +186,6 @@ int command_init(void)
|
||||
command_add("mysql", "[Help|Query] [SQL Query] - Mysql CLI, see 'Help' for options.", AccountStatus::GMImpossible, command_mysql) ||
|
||||
command_add("mystats", "Show details about you or your pet", AccountStatus::Guide, command_mystats) ||
|
||||
command_add("name", "[New Name] - Rename your player target", AccountStatus::GMLeadAdmin, command_name) ||
|
||||
command_add("netstats", "Gets the network stats for a stream.", AccountStatus::GMMgmt, command_netstats) ||
|
||||
command_add("network", "Admin commands for the udp network interface.", AccountStatus::GMImpossible, command_network) ||
|
||||
command_add("npccast", "[targetname/entityid] [spellid] - Causes NPC target to cast spellid on targetname/entityid", AccountStatus::QuestTroupe, command_npccast) ||
|
||||
command_add("npcedit", "[column] [value] - Mega NPC editing command", AccountStatus::GMAdmin, command_npcedit) ||
|
||||
command_add("npceditmass", "[name-search] [column] [value] - Mass (Zone wide) NPC data editing command", AccountStatus::GMAdmin, command_npceditmass) ||
|
||||
@@ -224,7 +194,6 @@ int command_init(void)
|
||||
command_add("npcsay", "[Message] - Make your NPC target say a message.", AccountStatus::GMLeadAdmin, command_npcsay) ||
|
||||
command_add("npcshout", "[Message] - Make your NPC target shout a message.", AccountStatus::GMLeadAdmin, command_npcshout) ||
|
||||
command_add("npcspawn", "[create/add/update/remove/delete] - Manipulate spawn DB", AccountStatus::GMAreas, command_npcspawn) ||
|
||||
command_add("npcstats", "Show stats about target NPC", AccountStatus::QuestTroupe, command_npcstats) ||
|
||||
command_add("npctypespawn", "[NPC ID] [Faction ID] - Spawn an NPC by ID from the database with an option of setting its Faction ID", AccountStatus::Steward, command_npctypespawn) ||
|
||||
command_add("nudge", "Nudge your target's current position by specific values", AccountStatus::QuestTroupe, command_nudge) ||
|
||||
command_add("nukebuffs", "[Beneficial|Detrimental|Help] - Strip all buffs by type on you or your target (no argument to remove all buffs)", AccountStatus::Guide, command_nukebuffs) ||
|
||||
@@ -233,21 +202,16 @@ int command_init(void)
|
||||
command_add("oocmute", "[0|1] - Enable or Disable Server OOC", AccountStatus::GMMgmt, command_oocmute) ||
|
||||
command_add("opcode", "Reloads all opcodes from server patch files", AccountStatus::GMMgmt, command_reload) ||
|
||||
command_add("path", "view and edit pathing", AccountStatus::GMMgmt, command_path) ||
|
||||
command_add("peekinv", "[equip/gen/cursor/poss/limbo/curlim/trib/bank/shbank/allbank/trade/world/all] - Print out contents of your player target's inventory", AccountStatus::GMAdmin, command_peekinv) ||
|
||||
command_add("peqzone", "[Zone ID|Zone Short Name] - Teleports you to the specified zone if you meet the requirements.", AccountStatus::Player, command_peqzone) ||
|
||||
command_add("peqzone_flags", "displays the PEQZone Flags of you or your target", AccountStatus::Player, command_peqzone_flags) ||
|
||||
command_add("permaclass", "[Class ID] - Change your or your player target's class, changed client is disconnected", AccountStatus::QuestTroupe, command_permaclass) ||
|
||||
command_add("permagender", "[Gender ID] - Change your or your player target's gender", AccountStatus::QuestTroupe, command_permagender) ||
|
||||
command_add("permarace", "[Race ID] - Change your or your player target's race", AccountStatus::QuestTroupe, command_permarace) ||
|
||||
command_add("petitems", "View your pet's items if you have one", AccountStatus::ApprenticeGuide, command_petitems) ||
|
||||
command_add("petitioninfo", "[petition number] - Get info about a petition", AccountStatus::ApprenticeGuide, command_petitioninfo) ||
|
||||
command_add("picklock", "Analog for ldon pick lock for the newer clients since we still don't have it working.", AccountStatus::Player, command_picklock) ||
|
||||
command_add("profanity", "Manage censored language.", AccountStatus::GMLeadAdmin, command_profanity) ||
|
||||
command_add("push", "[Back Push] [Up Push] - Lets you do spell push on an NPC", AccountStatus::GMLeadAdmin, command_push) ||
|
||||
command_add("proximity", "Shows NPC proximity", AccountStatus::GMLeadAdmin, command_proximity) ||
|
||||
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 quest global functionality for your NPC target", AccountStatus::GMAdmin, command_qglobal) ||
|
||||
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("raidloot", "[All|GroupLeader|RaidLeader|Selected] - Sets your Raid Loot Type if you have permission to do so.", AccountStatus::Player, command_raidloot) ||
|
||||
command_add("randomfeatures", "Temporarily randomizes the Facial Features of your target", AccountStatus::QuestTroupe, command_randomfeatures) ||
|
||||
@@ -269,7 +233,6 @@ int command_init(void)
|
||||
command_add("scribespells", "[Max level] [Min level] - Scribe all spells for you or your player target that are usable by them, up to level specified. (may freeze client for a few seconds)", AccountStatus::GMLeadAdmin, command_scribespells) ||
|
||||
command_add("sendzonespawns", "Refresh spawn list for all clients in zone", AccountStatus::GMLeadAdmin, command_sendzonespawns) ||
|
||||
command_add("sensetrap", "Analog for ldon sense trap for the newer clients since we still don't have it working.", AccountStatus::Player, command_sensetrap) ||
|
||||
command_add("serverinfo", "Get CPU, Operating System, and Process Information about the server", AccountStatus::GMMgmt, command_serverinfo) ||
|
||||
command_add("serverlock", "[0|1] - Lock or Unlock the World Server (0 = Unlocked, 1 = Locked)", AccountStatus::GMLeadAdmin, command_serverlock) ||
|
||||
command_add("serverrules", "Read this server's rules", AccountStatus::Player, command_serverrules) ||
|
||||
command_add("setaapts", "[AA|Group|Raid] [AA Amount] - Set your or your player target's Available AA Points by Type", AccountStatus::GMAdmin, command_setaapts) ||
|
||||
@@ -292,20 +255,11 @@ int command_init(void)
|
||||
command_add("setstartzone", "[Zone ID|Zone Short Name] - Sets your or your target's starting zone (Use '0' or 'Reset' to allow the player use of /setstartcity)", AccountStatus::QuestTroupe, command_setstartzone) ||
|
||||
command_add("setstat", "Sets the stats to a specific value.", AccountStatus::Max, command_setstat) ||
|
||||
command_add("setxp", "[value] - Set your or your player target's experience", AccountStatus::GMAdmin, command_setxp) ||
|
||||
command_add("showbuffs", "List buffs active on your target or you if no target", AccountStatus::Guide, command_showbuffs) ||
|
||||
command_add("shownumhits", "Shows buffs numhits for yourself.", AccountStatus::Player, command_shownumhits) ||
|
||||
command_add("shownpcgloballoot", "Show global loot entries for your target NPC", AccountStatus::Guide, command_shownpcgloballoot) ||
|
||||
command_add("showskills", "[Start Skill ID] [All] - Show the values of your or your player target's skills in a popup 50 at a time, use 'all' as second argument to show non-usable skill's values", AccountStatus::Guide, command_showskills) ||
|
||||
command_add("showspells", "[disciplines|spells] - Show your or your target's memorized spells or learned disciplines", AccountStatus::GMAdmin, command_showspells) ||
|
||||
command_add("showspellslist", "Shows spell list of targeted NPC", AccountStatus::GMAdmin, command_showspellslist) ||
|
||||
command_add("showstats", "Show details about you or your target", AccountStatus::Guide, command_showstats) ||
|
||||
command_add("showzonegloballoot", "Show global loot entries for your current zone", AccountStatus::Guide, command_showzonegloballoot) ||
|
||||
command_add("showzonepoints", "Show zone points for current zone", AccountStatus::Guide, command_showzonepoints) ||
|
||||
command_add("show", "List command used to show various things", AccountStatus::Guide, command_show) ||
|
||||
command_add("shutdown", "Shut this zone process down", AccountStatus::GMLeadAdmin, command_shutdown) ||
|
||||
command_add("spawn", "[name] [race] [level] [material] [hp] [gender] [class] [priweapon] [secweapon] [merchantid] - Spawn an NPC", AccountStatus::Steward, command_spawn) ||
|
||||
command_add("spawneditmass", "[Search Criteria] [Edit Option] [Edit Value] [Apply] Mass editing spawn command (Apply is optional, 0 = False, 1 = True, default is False)", AccountStatus::GMLeadAdmin, command_spawneditmass) ||
|
||||
command_add("spawnfix", "Find targeted NPC in database based on its X/Y/heading and update the database to make it spawn at your current location/heading.", AccountStatus::GMAreas, command_spawnfix) ||
|
||||
command_add("spawnstatus", "[All|Disabled|Enabled|Spawn ID] - Show respawn timer status", AccountStatus::GMAdmin, command_spawnstatus) ||
|
||||
command_add("stun", "[duration] - Stuns you or your target for duration", AccountStatus::GMAdmin, command_stun) ||
|
||||
command_add("summon", "[Character Name] - Summons your corpse, NPC, or player target, or by character name if specified", AccountStatus::QuestTroupe, command_summon) ||
|
||||
command_add("summonburiedplayercorpse", "Summons the target's oldest buried corpse, if any exist.", AccountStatus::GMAdmin, command_summonburiedplayercorpse) ||
|
||||
@@ -317,12 +271,10 @@ int command_init(void)
|
||||
command_add("petname", "[newname] - Temporarily renames your pet. Leave name blank to restore the original name.", AccountStatus::GMAdmin, command_petname) ||
|
||||
command_add("texture", "[Texture] [Helmet Texture] - Change your or your target's texture (Helmet Texture defaults to 0 if not used)", AccountStatus::Steward, command_texture) ||
|
||||
command_add("time", "[Hour] [Minute] - Set world time to specified time", AccountStatus::EQSupport, command_time) ||
|
||||
command_add("timers", "Display persistent timers for target", AccountStatus::GMMgmt, command_timers) ||
|
||||
command_add("timezone", "[Hour] [Minutes] - Set timezone (Minutes are optional)", AccountStatus::EQSupport, command_timezone) ||
|
||||
command_add("title", "[Title] - Set your or your player target's title (use \"-1\" to remove title)", AccountStatus::Guide, command_title) ||
|
||||
command_add("titlesuffix", "[Title Suffix] - Set your or your player target's title suffix (use \"-1\" to remove title suffix)", AccountStatus::Guide, command_titlesuffix) ||
|
||||
command_add("traindisc", "[level] - Trains all the disciplines usable by the target, up to level specified. (may freeze client for a few seconds)", AccountStatus::GMLeadAdmin, command_traindisc) ||
|
||||
command_add("trapinfo", "Gets infomation about the traps currently spawned in the zone.", AccountStatus::QuestTroupe, command_trapinfo) ||
|
||||
command_add("tune", "Calculate statistical values related to combat.", AccountStatus::GMAdmin, command_tune) ||
|
||||
command_add("undye", "Remove dye from all of your or your target's armor slots", AccountStatus::GMAdmin, command_undye) ||
|
||||
command_add("unfreeze", "Unfreeze your target", AccountStatus::QuestTroupe, command_unfreeze) ||
|
||||
@@ -333,22 +285,12 @@ int command_init(void)
|
||||
command_add("untraindisc", "[Spell ID] - Untrain your or your target's discipline by Spell ID", AccountStatus::GMCoder, command_untraindisc) ||
|
||||
command_add("untraindiscs", "Untrains all disciplines from your target.", AccountStatus::GMCoder, command_untraindiscs) ||
|
||||
command_add("updatechecksum", "update client checksum", AccountStatus::GMImpossible, command_updatechecksum) ||
|
||||
command_add("uptime", "[zone server id] - Get uptime of worldserver, or zone server if argument provided", AccountStatus::Steward, command_uptime) ||
|
||||
command_add("version", "Display current version of EQEmu server", AccountStatus::Player, command_version) ||
|
||||
command_add("viewcurrencies", "View your or your target's currencies", AccountStatus::GMAdmin, command_viewcurrencies) ||
|
||||
command_add("viewnpctype", "[NPC ID] - Show stats for an NPC by NPC ID", AccountStatus::GMAdmin, command_viewnpctype) ||
|
||||
command_add("viewpetition", "[petition number] - View a petition", AccountStatus::ApprenticeGuide, command_viewpetition) ||
|
||||
command_add("viewrecipe", "[Recipe ID] - Show a recipe's entries", AccountStatus::GMAdmin, command_viewrecipe) ||
|
||||
command_add("viewzoneloot", "[item id] - Allows you to search a zone's loot for a specific item ID. (0 shows all loot in the zone)", AccountStatus::QuestTroupe, command_viewzoneloot) ||
|
||||
command_add("wc", "[Slot ID] [Material] [Hero Forge Model] [Elite Material] - Sets the specified slot for you or your target to a material, Hero Forge Model and Elite Material are optional", AccountStatus::GMMgmt, command_wc) ||
|
||||
command_add("weather", "[0/1/2/3] (Off/Rain/Snow/Manual) - Change the weather", AccountStatus::QuestTroupe, command_weather) ||
|
||||
command_add("who", "[search]", AccountStatus::ApprenticeGuide, command_who) ||
|
||||
command_add("worldshutdown", "Shut down world and all zones", AccountStatus::GMMgmt, command_worldshutdown) ||
|
||||
command_add("wp", "[add|delete] [grid_id] [pause] [waypoint_id] [-h] - Add or delete a waypoint by grid ID. (-h to use current heading)", AccountStatus::GMAreas, command_wp) ||
|
||||
command_add("wpadd", "[pause] [-h] - Add your current location as a waypoint to your NPC target's AI path. (-h to use current heading)", AccountStatus::GMAreas, command_wpadd) ||
|
||||
command_add("wpinfo", "Show waypoint info about your NPC target", AccountStatus::GMAreas, command_wpinfo) ||
|
||||
command_add("worldwide", "Performs world-wide GM functions such as cast (can be extended for other commands). Use caution", AccountStatus::GMImpossible, command_worldwide) ||
|
||||
command_add("xtargets", "[New Max XTargets] - Show your or your target's XTargets and optionally set max XTargets.", AccountStatus::GMImpossible, command_xtargets) ||
|
||||
command_add("zclip", "[Minimum Clip] [Maximum Clip] [Fog Minimum Clip] [Fog Maximum Clip] [Permanent (0 = False, 1 = True)] - Change zone clipping", AccountStatus::QuestTroupe, command_zclip) ||
|
||||
command_add("zcolor", "[Red] [Green] [Blue] [Permanent (0 = False, 1 = True)] - Change sky color", AccountStatus::QuestTroupe, command_zcolor) ||
|
||||
command_add("zheader", "[Zone ID|Zone Short Name] [Version] - Load a zone header from the database", AccountStatus::QuestTroupe, command_zheader) ||
|
||||
@@ -357,12 +299,10 @@ int command_init(void)
|
||||
command_add("zoneinstance", "[Instance ID] [X] [Y] [Z] - Teleport to specified Instance by ID (coordinates are optional)", AccountStatus::Guide, command_zone_instance) ||
|
||||
command_add("zonelock", "[List|Lock|Unlock] [Zone ID|Zone Short Name] - Set or get lock status of a Zone by ID or Short Name", AccountStatus::GMAdmin, command_zonelock) ||
|
||||
command_add("zoneshutdown", "[shortname] - Shut down a zone server", AccountStatus::GMLeadAdmin, command_zoneshutdown) ||
|
||||
command_add("zonestatus", "Show connected zoneservers, synonymous with /servers", AccountStatus::GMLeadAdmin, command_zonestatus) ||
|
||||
command_add("zopp", "Troubleshooting command - Sends a fake item packet to you. No server reference is created.", AccountStatus::GMImpossible, command_zopp) ||
|
||||
command_add("zsafecoords", "[X] [Y] [Z] [Heading] [Permanent (0 = False, 1 = True)] - Set the current zone's safe coordinates", AccountStatus::QuestTroupe, command_zsafecoords) ||
|
||||
command_add("zsave", " Saves zheader to the database", AccountStatus::QuestTroupe, command_zsave) ||
|
||||
command_add("zsky", "[Sky Type] [Permanent (0 = False, 1 = True)] - Change zone sky type", AccountStatus::QuestTroupe, command_zsky) ||
|
||||
command_add("zstats", "Show info about zone header", AccountStatus::QuestTroupe, command_zstats) ||
|
||||
command_add("zunderworld", "[Z] [Permanent (0 = False, 1 = True)] - Change zone underworld Z", AccountStatus::QuestTroupe, command_zunderworld)
|
||||
) {
|
||||
command_deinit();
|
||||
@@ -375,6 +315,104 @@ int command_init(void)
|
||||
std::vector<std::pair<std::string, uint8>> injected_command_settings;
|
||||
std::vector<std::string> orphaned_command_settings;
|
||||
|
||||
// static aliases
|
||||
struct StaticAlias {
|
||||
std::string command;
|
||||
std::vector<std::string> aliases;
|
||||
};
|
||||
|
||||
std::vector<StaticAlias> static_aliases = {
|
||||
{
|
||||
.command = "find",
|
||||
.aliases = {
|
||||
"fi",
|
||||
"fn",
|
||||
"fs",
|
||||
"fz",
|
||||
"findaa",
|
||||
"findcharacter",
|
||||
"findclass",
|
||||
"findcurrency",
|
||||
"finddeity",
|
||||
"findemote",
|
||||
"findfaction",
|
||||
"finditem",
|
||||
"findlanguage",
|
||||
"findnpc",
|
||||
"findnpctype",
|
||||
"findrace",
|
||||
"findrecipe",
|
||||
"findskill",
|
||||
"findspell",
|
||||
"findtask",
|
||||
"findzone",
|
||||
"itemsearch"
|
||||
}
|
||||
},
|
||||
{
|
||||
.command = "show",
|
||||
.aliases = {
|
||||
"aggro",
|
||||
"checklos",
|
||||
"cvs",
|
||||
"distance",
|
||||
"emoteview",
|
||||
"flags",
|
||||
"fov",
|
||||
"getplayerburiedcorpsecount",
|
||||
"getvariable",
|
||||
"ginfo",
|
||||
"globalview",
|
||||
"hatelist",
|
||||
"iplookup",
|
||||
"listpetition",
|
||||
"network",
|
||||
"netstats",
|
||||
"npcstats",
|
||||
"peekinv",
|
||||
"petitioninfo",
|
||||
"peqzone_flags",
|
||||
"proximity",
|
||||
"questerrors",
|
||||
"serverinfo",
|
||||
"showbuffs",
|
||||
"shownpcgloballoot",
|
||||
"showskills",
|
||||
"showspells",
|
||||
"showspellslist",
|
||||
"showstats",
|
||||
"showzonegloballoot",
|
||||
"showzonepoints",
|
||||
"spawnstatus",
|
||||
"timers",
|
||||
"trapinfo",
|
||||
"uptime",
|
||||
"version",
|
||||
"viewcurrencies",
|
||||
"viewnpctype",
|
||||
"viewpetition",
|
||||
"viewrecipe",
|
||||
"viewzoneloot",
|
||||
"who",
|
||||
"wpinfo",
|
||||
"xtargets",
|
||||
"zonestatus",
|
||||
"zstats"
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
// inject static aliases
|
||||
for (auto& cs : command_settings) {
|
||||
for (const auto& sa : static_aliases) {
|
||||
if (cs.first == sa.command) {
|
||||
for (const auto& alias : sa.aliases) {
|
||||
cs.second.second.emplace_back(alias);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& cs : command_settings) {
|
||||
auto cl = commandlist.find(cs.first);
|
||||
if (cl == commandlist.end()) {
|
||||
@@ -386,7 +424,7 @@ int command_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (orphaned_command_settings.size()) {
|
||||
if (!orphaned_command_settings.empty()) {
|
||||
if (!database.UpdateOrphanedCommandSettings(orphaned_command_settings)) {
|
||||
LogInfo("Failed to process 'Orphaned Commands' update operation.");
|
||||
}
|
||||
@@ -396,16 +434,16 @@ int command_init(void)
|
||||
for (const auto& w : working_cl) {
|
||||
auto cs = command_settings.find(w.first);
|
||||
if (cs == command_settings.end()) {
|
||||
injected_command_settings.emplace_back(std::pair<std::string, uint8>(w.first, w.second->admin));
|
||||
injected_command_settings.emplace_back(w.first, w.second->admin);
|
||||
LogInfo(
|
||||
"New Command [{}] found... Adding to `command_settings` table with admin [{}]...",
|
||||
"New Command [{}] found. Adding to `command_settings` table with admin [{}]...",
|
||||
w.first,
|
||||
w.second->admin
|
||||
);
|
||||
|
||||
if (w.second->admin == AccountStatus::Player) {
|
||||
LogCommands(
|
||||
"command_init(): Warning: Command [{}] defaulting to admin level 0!",
|
||||
"Warning: Command [{}] defaulting to admin level 0!",
|
||||
w.first
|
||||
);
|
||||
}
|
||||
@@ -415,7 +453,7 @@ int command_init(void)
|
||||
|
||||
w.second->admin = cs->second.first;
|
||||
LogCommands(
|
||||
"command_init(): - Command [{}] set to admin level [{}]",
|
||||
"Command [{}] set to admin level [{}]",
|
||||
w.first,
|
||||
cs->second.first
|
||||
);
|
||||
@@ -449,7 +487,7 @@ int command_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (injected_command_settings.size()) {
|
||||
if (!injected_command_settings.empty()) {
|
||||
if (!database.UpdateInjectedCommandSettings(injected_command_settings)) {
|
||||
LogInfo("Failed to process 'Injected Commands' update operation.");
|
||||
}
|
||||
@@ -932,7 +970,6 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
|
||||
#include "gm_commands/acceptrules.cpp"
|
||||
#include "gm_commands/advnpcspawn.cpp"
|
||||
#include "gm_commands/aggro.cpp"
|
||||
#include "gm_commands/aggrozone.cpp"
|
||||
#include "gm_commands/ai.cpp"
|
||||
#include "gm_commands/appearance.cpp"
|
||||
@@ -945,12 +982,10 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/camerashake.cpp"
|
||||
#include "gm_commands/castspell.cpp"
|
||||
#include "gm_commands/chat.cpp"
|
||||
#include "gm_commands/checklos.cpp"
|
||||
#include "gm_commands/copycharacter.cpp"
|
||||
#include "gm_commands/corpse.cpp"
|
||||
#include "gm_commands/corpsefix.cpp"
|
||||
#include "gm_commands/countitem.cpp"
|
||||
#include "gm_commands/cvs.cpp"
|
||||
#include "gm_commands/damage.cpp"
|
||||
#include "gm_commands/databuckets.cpp"
|
||||
#include "gm_commands/date.cpp"
|
||||
@@ -962,7 +997,6 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/devtools.cpp"
|
||||
#include "gm_commands/disablerecipe.cpp"
|
||||
#include "gm_commands/disarmtrap.cpp"
|
||||
#include "gm_commands/distance.cpp"
|
||||
#include "gm_commands/doanim.cpp"
|
||||
#include "gm_commands/door.cpp"
|
||||
#include "gm_commands/door_manipulation.cpp"
|
||||
@@ -971,8 +1005,6 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/dzkickplayers.cpp"
|
||||
#include "gm_commands/editmassrespawn.cpp"
|
||||
#include "gm_commands/emote.cpp"
|
||||
#include "gm_commands/emotesearch.cpp"
|
||||
#include "gm_commands/emoteview.cpp"
|
||||
#include "gm_commands/emptyinventory.cpp"
|
||||
#include "gm_commands/enablerecipe.cpp"
|
||||
#include "gm_commands/endurance.cpp"
|
||||
@@ -980,34 +1012,17 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/exptoggle.cpp"
|
||||
#include "gm_commands/faction.cpp"
|
||||
#include "gm_commands/feature.cpp"
|
||||
#include "gm_commands/findaa.cpp"
|
||||
#include "gm_commands/findcharacter.cpp"
|
||||
#include "gm_commands/findclass.cpp"
|
||||
#include "gm_commands/findcurrency.cpp"
|
||||
#include "gm_commands/findfaction.cpp"
|
||||
#include "gm_commands/findnpctype.cpp"
|
||||
#include "gm_commands/findrace.cpp"
|
||||
#include "gm_commands/findrecipe.cpp"
|
||||
#include "gm_commands/findskill.cpp"
|
||||
#include "gm_commands/findspell.cpp"
|
||||
#include "gm_commands/findtask.cpp"
|
||||
#include "gm_commands/findzone.cpp"
|
||||
#include "gm_commands/find.cpp"
|
||||
#include "gm_commands/fixmob.cpp"
|
||||
#include "gm_commands/flag.cpp"
|
||||
#include "gm_commands/flagedit.cpp"
|
||||
#include "gm_commands/flags.cpp"
|
||||
#include "gm_commands/flymode.cpp"
|
||||
#include "gm_commands/fov.cpp"
|
||||
#include "gm_commands/freeze.cpp"
|
||||
#include "gm_commands/gassign.cpp"
|
||||
#include "gm_commands/gearup.cpp"
|
||||
#include "gm_commands/gender.cpp"
|
||||
#include "gm_commands/getplayerburiedcorpsecount.cpp"
|
||||
#include "gm_commands/getvariable.cpp"
|
||||
#include "gm_commands/ginfo.cpp"
|
||||
#include "gm_commands/giveitem.cpp"
|
||||
#include "gm_commands/givemoney.cpp"
|
||||
#include "gm_commands/globalview.cpp"
|
||||
#include "gm_commands/gm.cpp"
|
||||
#include "gm_commands/gmspeed.cpp"
|
||||
#include "gm_commands/gmzone.cpp"
|
||||
@@ -1016,7 +1031,6 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/grid.cpp"
|
||||
#include "gm_commands/guild.cpp"
|
||||
#include "gm_commands/haste.cpp"
|
||||
#include "gm_commands/hatelist.cpp"
|
||||
#include "gm_commands/heal.cpp"
|
||||
#include "gm_commands/heromodel.cpp"
|
||||
#include "gm_commands/hideme.cpp"
|
||||
@@ -1028,15 +1042,12 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/invsnapshot.cpp"
|
||||
#include "gm_commands/invul.cpp"
|
||||
#include "gm_commands/ipban.cpp"
|
||||
#include "gm_commands/iplookup.cpp"
|
||||
#include "gm_commands/itemsearch.cpp"
|
||||
#include "gm_commands/kick.cpp"
|
||||
#include "gm_commands/kill.cpp"
|
||||
#include "gm_commands/killallnpcs.cpp"
|
||||
#include "gm_commands/lastname.cpp"
|
||||
#include "gm_commands/level.cpp"
|
||||
#include "gm_commands/list.cpp"
|
||||
#include "gm_commands/listpetition.cpp"
|
||||
#include "gm_commands/lootsim.cpp"
|
||||
#include "gm_commands/loc.cpp"
|
||||
#include "gm_commands/logs.cpp"
|
||||
@@ -1053,8 +1064,6 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/mysql.cpp"
|
||||
#include "gm_commands/mystats.cpp"
|
||||
#include "gm_commands/name.cpp"
|
||||
#include "gm_commands/netstats.cpp"
|
||||
#include "gm_commands/network.cpp"
|
||||
#include "gm_commands/npccast.cpp"
|
||||
#include "gm_commands/npcedit.cpp"
|
||||
#include "gm_commands/npceditmass.cpp"
|
||||
@@ -1063,7 +1072,6 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/npcsay.cpp"
|
||||
#include "gm_commands/npcshout.cpp"
|
||||
#include "gm_commands/npcspawn.cpp"
|
||||
#include "gm_commands/npcstats.cpp"
|
||||
#include "gm_commands/npctypespawn.cpp"
|
||||
#include "gm_commands/nudge.cpp"
|
||||
#include "gm_commands/nukebuffs.cpp"
|
||||
@@ -1071,22 +1079,17 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/object.cpp"
|
||||
#include "gm_commands/oocmute.cpp"
|
||||
#include "gm_commands/path.cpp"
|
||||
#include "gm_commands/peekinv.cpp"
|
||||
#include "gm_commands/peqzone.cpp"
|
||||
#include "gm_commands/peqzone_flags.cpp"
|
||||
#include "gm_commands/permaclass.cpp"
|
||||
#include "gm_commands/permagender.cpp"
|
||||
#include "gm_commands/permarace.cpp"
|
||||
#include "gm_commands/petitems.cpp"
|
||||
#include "gm_commands/petitioninfo.cpp"
|
||||
#include "gm_commands/petname.cpp"
|
||||
#include "gm_commands/picklock.cpp"
|
||||
#include "gm_commands/profanity.cpp"
|
||||
#include "gm_commands/proximity.cpp"
|
||||
#include "gm_commands/push.cpp"
|
||||
#include "gm_commands/pvp.cpp"
|
||||
#include "gm_commands/qglobal.cpp"
|
||||
#include "gm_commands/questerrors.cpp"
|
||||
#include "gm_commands/race.cpp"
|
||||
#include "gm_commands/raidloot.cpp"
|
||||
#include "gm_commands/randomfeatures.cpp"
|
||||
@@ -1106,7 +1109,6 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/scribespells.cpp"
|
||||
#include "gm_commands/sendzonespawns.cpp"
|
||||
#include "gm_commands/sensetrap.cpp"
|
||||
#include "gm_commands/serverinfo.cpp"
|
||||
#include "gm_commands/serverlock.cpp"
|
||||
#include "gm_commands/serverrules.cpp"
|
||||
#include "gm_commands/set_adventure_points.cpp"
|
||||
@@ -1129,20 +1131,11 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/setstartzone.cpp"
|
||||
#include "gm_commands/setstat.cpp"
|
||||
#include "gm_commands/setxp.cpp"
|
||||
#include "gm_commands/showbuffs.cpp"
|
||||
#include "gm_commands/shownpcgloballoot.cpp"
|
||||
#include "gm_commands/shownumhits.cpp"
|
||||
#include "gm_commands/showskills.cpp"
|
||||
#include "gm_commands/showspells.cpp"
|
||||
#include "gm_commands/showspellslist.cpp"
|
||||
#include "gm_commands/showstats.cpp"
|
||||
#include "gm_commands/showzonegloballoot.cpp"
|
||||
#include "gm_commands/showzonepoints.cpp"
|
||||
#include "gm_commands/show.cpp"
|
||||
#include "gm_commands/shutdown.cpp"
|
||||
#include "gm_commands/spawn.cpp"
|
||||
#include "gm_commands/spawneditmass.cpp"
|
||||
#include "gm_commands/spawnfix.cpp"
|
||||
#include "gm_commands/spawnstatus.cpp"
|
||||
#include "gm_commands/faction_association.cpp"
|
||||
#include "gm_commands/stun.cpp"
|
||||
#include "gm_commands/summon.cpp"
|
||||
@@ -1154,12 +1147,10 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/tempname.cpp"
|
||||
#include "gm_commands/texture.cpp"
|
||||
#include "gm_commands/time.cpp"
|
||||
#include "gm_commands/timers.cpp"
|
||||
#include "gm_commands/timezone.cpp"
|
||||
#include "gm_commands/title.cpp"
|
||||
#include "gm_commands/titlesuffix.cpp"
|
||||
#include "gm_commands/traindisc.cpp"
|
||||
#include "gm_commands/trapinfo.cpp"
|
||||
#include "gm_commands/tune.cpp"
|
||||
#include "gm_commands/undye.cpp"
|
||||
#include "gm_commands/unfreeze.cpp"
|
||||
@@ -1170,22 +1161,12 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/updatechecksum.cpp"
|
||||
#include "gm_commands/untraindisc.cpp"
|
||||
#include "gm_commands/untraindiscs.cpp"
|
||||
#include "gm_commands/uptime.cpp"
|
||||
#include "gm_commands/version.cpp"
|
||||
#include "gm_commands/viewcurrencies.cpp"
|
||||
#include "gm_commands/viewnpctype.cpp"
|
||||
#include "gm_commands/viewpetition.cpp"
|
||||
#include "gm_commands/viewrecipe.cpp"
|
||||
#include "gm_commands/viewzoneloot.cpp"
|
||||
#include "gm_commands/wc.cpp"
|
||||
#include "gm_commands/weather.cpp"
|
||||
#include "gm_commands/who.cpp"
|
||||
#include "gm_commands/worldshutdown.cpp"
|
||||
#include "gm_commands/worldwide.cpp"
|
||||
#include "gm_commands/wp.cpp"
|
||||
#include "gm_commands/wpadd.cpp"
|
||||
#include "gm_commands/wpinfo.cpp"
|
||||
#include "gm_commands/xtargets.cpp"
|
||||
#include "gm_commands/zclip.cpp"
|
||||
#include "gm_commands/zcolor.cpp"
|
||||
#include "gm_commands/zheader.cpp"
|
||||
@@ -1193,11 +1174,9 @@ void command_bot(Client *c, const Seperator *sep)
|
||||
#include "gm_commands/zonebootup.cpp"
|
||||
#include "gm_commands/zonelock.cpp"
|
||||
#include "gm_commands/zoneshutdown.cpp"
|
||||
#include "gm_commands/zonestatus.cpp"
|
||||
#include "gm_commands/zone_instance.cpp"
|
||||
#include "gm_commands/zopp.cpp"
|
||||
#include "gm_commands/zsafecoords.cpp"
|
||||
#include "gm_commands/zsave.cpp"
|
||||
#include "gm_commands/zsky.cpp"
|
||||
#include "gm_commands/zstats.cpp"
|
||||
#include "gm_commands/zunderworld.cpp"
|
||||
|
||||
+3
-63
@@ -33,12 +33,11 @@ std::string GetModifyNPCStatDescription(std::string stat);
|
||||
void SendNPCEditSubCommands(Client *c);
|
||||
void SendRuleSubCommands(Client *c);
|
||||
void SendGuildSubCommands(Client *c);
|
||||
void SendPeekInvSubCommands(Client *c);
|
||||
void SendShowInventorySubCommands(Client *c);
|
||||
|
||||
// Commands
|
||||
void command_acceptrules(Client *c, const Seperator *sep);
|
||||
void command_advnpcspawn(Client *c, const Seperator *sep);
|
||||
void command_aggro(Client *c, const Seperator *sep);
|
||||
void command_aggrozone(Client *c, const Seperator *sep);
|
||||
void command_ai(Client *c, const Seperator *sep);
|
||||
void command_appearance(Client *c, const Seperator *sep);
|
||||
@@ -52,12 +51,10 @@ void command_bugs(Client *c, const Seperator *sep);
|
||||
void command_camerashake(Client *c, const Seperator *sep);
|
||||
void command_castspell(Client *c, const Seperator *sep);
|
||||
void command_chat(Client *c, const Seperator *sep);
|
||||
void command_checklos(Client *c, const Seperator *sep);
|
||||
void command_copycharacter(Client *c, const Seperator *sep);
|
||||
void command_corpse(Client *c, const Seperator *sep);
|
||||
void command_corpsefix(Client *c, const Seperator *sep);
|
||||
void command_countitem(Client *c, const Seperator *sep);
|
||||
void command_cvs(Client *c, const Seperator *sep);
|
||||
void command_damage(Client *c, const Seperator *sep);
|
||||
void command_databuckets(Client *c, const Seperator *sep);
|
||||
void command_date(Client *c, const Seperator *sep);
|
||||
@@ -70,15 +67,12 @@ void command_devtools(Client *c, const Seperator *sep);
|
||||
void command_disablerecipe(Client *c, const Seperator *sep);
|
||||
void command_disarmtrap(Client *c, const Seperator *sep);
|
||||
void command_door(Client *c, const Seperator *sep);
|
||||
void command_distance(Client *c, const Seperator *sep);
|
||||
void command_doanim(Client *c, const Seperator *sep);
|
||||
void command_dye(Client *c, const Seperator *sep);
|
||||
void command_dz(Client *c, const Seperator *sep);
|
||||
void command_dzkickplayers(Client *c, const Seperator *sep);
|
||||
void command_editmassrespawn(Client *c, const Seperator *sep);
|
||||
void command_emote(Client *c, const Seperator *sep);
|
||||
void command_emotesearch(Client *c, const Seperator *sep);
|
||||
void command_emoteview(Client *c, const Seperator *sep);
|
||||
void command_emptyinventory(Client *c, const Seperator *sep);
|
||||
void command_enablerecipe(Client *c, const Seperator *sep);
|
||||
void command_endurance(Client *c, const Seperator *sep);
|
||||
@@ -87,35 +81,17 @@ void command_exptoggle(Client *c, const Seperator *sep);
|
||||
void command_faction(Client *c, const Seperator *sep);
|
||||
void command_faction_association(Client *c, const Seperator *sep);
|
||||
void command_feature(Client *c, const Seperator *sep);
|
||||
void command_findaa(Client *c, const Seperator *sep);
|
||||
void command_findaliases(Client *c, const Seperator *sep);
|
||||
void command_findcharacter(Client *c, const Seperator *sep);
|
||||
void command_findclass(Client *c, const Seperator *sep);
|
||||
void command_findcurrency(Client *c, const Seperator *sep);
|
||||
void command_findfaction(Client *c, const Seperator *sep);
|
||||
void command_findnpctype(Client *c, const Seperator *sep);
|
||||
void command_findrace(Client *c, const Seperator *sep);
|
||||
void command_findrecipe(Client *c, const Seperator *sep);
|
||||
void command_findskill(Client *c, const Seperator *sep);
|
||||
void command_findspell(Client *c, const Seperator *sep);
|
||||
void command_findtask(Client *c, const Seperator *sep);
|
||||
void command_findzone(Client *c, const Seperator *sep);
|
||||
void command_find(Client *c, const Seperator *sep);
|
||||
void command_fixmob(Client *c, const Seperator *sep);
|
||||
void command_flag(Client *c, const Seperator *sep);
|
||||
void command_flagedit(Client *c, const Seperator *sep);
|
||||
void command_flags(Client *c, const Seperator *sep);
|
||||
void command_flymode(Client *c, const Seperator *sep);
|
||||
void command_fov(Client *c, const Seperator *sep);
|
||||
void command_freeze(Client *c, const Seperator *sep);
|
||||
void command_gassign(Client *c, const Seperator *sep);
|
||||
void command_gearup(Client *c, const Seperator *sep);
|
||||
void command_gender(Client *c, const Seperator *sep);
|
||||
void command_getplayerburiedcorpsecount(Client *c, const Seperator *sep);
|
||||
void command_getvariable(Client *c, const Seperator *sep);
|
||||
void command_ginfo(Client *c, const Seperator *sep);
|
||||
void command_giveitem(Client *c, const Seperator *sep);
|
||||
void command_givemoney(Client *c, const Seperator *sep);
|
||||
void command_globalview(Client *c, const Seperator *sep);
|
||||
void command_gm(Client *c, const Seperator *sep);
|
||||
void command_gmspeed(Client *c, const Seperator *sep);
|
||||
void command_gmzone(Client *c, const Seperator *sep);
|
||||
@@ -124,7 +100,6 @@ void command_goto(Client *c, const Seperator *sep);
|
||||
void command_grid(Client *c, const Seperator *sep);
|
||||
void command_guild(Client *c, const Seperator *sep);
|
||||
void command_haste(Client *c, const Seperator *sep);
|
||||
void command_hatelist(Client *c, const Seperator *sep);
|
||||
void command_heal(Client *c, const Seperator *sep);
|
||||
void command_help(Client *c, const Seperator *sep);
|
||||
void command_heromodel(Client *c, const Seperator *sep);
|
||||
@@ -138,15 +113,12 @@ void command_interrupt(Client *c, const Seperator *sep);
|
||||
void command_invsnapshot(Client *c, const Seperator *sep);
|
||||
void command_invul(Client *c, const Seperator *sep);
|
||||
void command_ipban(Client *c, const Seperator *sep);
|
||||
void command_iplookup(Client *c, const Seperator *sep);
|
||||
void command_itemsearch(Client *c, const Seperator *sep);
|
||||
void command_kick(Client *c, const Seperator *sep);
|
||||
void command_killallnpcs(Client *c, const Seperator *sep);
|
||||
void command_kill(Client *c, const Seperator *sep);
|
||||
void command_lastname(Client *c, const Seperator *sep);
|
||||
void command_level(Client *c, const Seperator *sep);
|
||||
void command_list(Client *c, const Seperator *sep);
|
||||
void command_listpetition(Client *c, const Seperator *sep);
|
||||
void command_lootsim(Client *c, const Seperator *sep);
|
||||
void command_load_shared_memory(Client *c, const Seperator *sep);
|
||||
void command_loc(Client *c, const Seperator *sep);
|
||||
@@ -164,8 +136,6 @@ void command_myskills(Client *c, const Seperator *sep);
|
||||
void command_mysql(Client *c, const Seperator *sep);
|
||||
void command_mystats(Client *c, const Seperator *sep);
|
||||
void command_name(Client *c, const Seperator *sep);
|
||||
void command_netstats(Client *c, const Seperator *sep);
|
||||
void command_network(Client *c, const Seperator *sep);
|
||||
void command_npccast(Client *c, const Seperator *sep);
|
||||
void command_npcedit(Client *c, const Seperator *sep);
|
||||
void command_npceditmass(Client *c, const Seperator *sep);
|
||||
@@ -174,7 +144,6 @@ void command_npcloot(Client *c, const Seperator *sep);
|
||||
void command_npcsay(Client *c, const Seperator *sep);
|
||||
void command_npcshout(Client *c, const Seperator *sep);
|
||||
void command_npcspawn(Client *c, const Seperator *sep);
|
||||
void command_npcstats(Client *c, const Seperator *sep);
|
||||
void command_npctypespawn(Client *c, const Seperator *sep);
|
||||
void command_nudge(Client *c, const Seperator *sep);
|
||||
void command_nukebuffs(Client *c, const Seperator *sep);
|
||||
@@ -182,21 +151,16 @@ void command_nukeitem(Client *c, const Seperator *sep);
|
||||
void command_object(Client *c, const Seperator *sep);
|
||||
void command_oocmute(Client *c, const Seperator *sep);
|
||||
void command_path(Client *c, const Seperator *sep);
|
||||
void command_peekinv(Client *c, const Seperator *sep);
|
||||
void command_peqzone(Client *c, const Seperator *sep);
|
||||
void command_peqzone_flags(Client *c, const Seperator *sep);
|
||||
void command_permaclass(Client *c, const Seperator *sep);
|
||||
void command_permagender(Client *c, const Seperator *sep);
|
||||
void command_permarace(Client *c, const Seperator *sep);
|
||||
void command_petitems(Client *c, const Seperator *sep);
|
||||
void command_petitioninfo(Client *c, const Seperator *sep);
|
||||
void command_picklock(Client *c, const Seperator *sep);
|
||||
void command_profanity(Client *c, const Seperator *sep);
|
||||
void command_proximity(Client *c, const Seperator *sep);
|
||||
void command_push(Client *c, const Seperator *sep);
|
||||
void command_pvp(Client *c, const Seperator *sep);
|
||||
void command_qglobal(Client *c, const Seperator *sep);
|
||||
void command_questerrors(Client *c, const Seperator *sep);
|
||||
void command_race(Client *c, const Seperator *sep);
|
||||
void command_raidloot(Client* c, const Seperator* sep);
|
||||
void command_randomfeatures(Client *c, const Seperator *sep);
|
||||
@@ -217,7 +181,6 @@ void command_scribespell(Client *c, const Seperator *sep);
|
||||
void command_scribespells(Client *c, const Seperator *sep);
|
||||
void command_sendzonespawns(Client *c, const Seperator *sep);
|
||||
void command_sensetrap(Client *c, const Seperator *sep);
|
||||
void command_serverinfo(Client *c, const Seperator *sep);
|
||||
void command_serverrules(Client *c, const Seperator *sep);
|
||||
void command_set_adventure_points(Client *c, const Seperator *sep);
|
||||
void command_setaapts(Client *c, const Seperator *sep);
|
||||
@@ -239,20 +202,11 @@ void command_setskillall(Client *c, const Seperator *sep);
|
||||
void command_setstartzone(Client *c, const Seperator *sep);
|
||||
void command_setstat(Client *c, const Seperator *sep);
|
||||
void command_setxp(Client *c, const Seperator *sep);
|
||||
void command_showbuffs(Client *c, const Seperator *sep);
|
||||
void command_shownumhits(Client *c, const Seperator *sep);
|
||||
void command_shownpcgloballoot(Client *c, const Seperator *sep);
|
||||
void command_showskills(Client *c, const Seperator *sep);
|
||||
void command_showspells(Client *c, const Seperator *sep);
|
||||
void command_showspellslist(Client *c, const Seperator *sep);
|
||||
void command_showstats(Client *c, const Seperator *sep);
|
||||
void command_showzonegloballoot(Client *c, const Seperator *sep);
|
||||
void command_showzonepoints(Client *c, const Seperator *sep);
|
||||
void command_show(Client *c, const Seperator *sep);
|
||||
void command_shutdown(Client *c, const Seperator *sep);
|
||||
void command_spawn(Client *c, const Seperator *sep);
|
||||
void command_spawneditmass(Client *c, const Seperator *sep);
|
||||
void command_spawnfix(Client *c, const Seperator *sep);
|
||||
void command_spawnstatus(Client *c, const Seperator *sep);
|
||||
void command_stun(Client *c, const Seperator *sep);
|
||||
void command_summon(Client *c, const Seperator *sep);
|
||||
void command_summonburiedplayercorpse(Client *c, const Seperator *sep);
|
||||
@@ -264,12 +218,10 @@ void command_tempname(Client *c, const Seperator *sep);
|
||||
void command_petname(Client *c, const Seperator *sep);
|
||||
void command_texture(Client *c, const Seperator *sep);
|
||||
void command_time(Client *c, const Seperator *sep);
|
||||
void command_timers(Client *c, const Seperator *sep);
|
||||
void command_timezone(Client *c, const Seperator *sep);
|
||||
void command_title(Client *c, const Seperator *sep);
|
||||
void command_titlesuffix(Client *c, const Seperator *sep);
|
||||
void command_traindisc(Client *c, const Seperator *sep);
|
||||
void command_trapinfo(Client *c, const Seperator *sep);
|
||||
void command_tune(Client *c, const Seperator *sep);
|
||||
void command_undye(Client *c, const Seperator *sep);
|
||||
void command_unfreeze(Client *c, const Seperator *sep);
|
||||
@@ -280,22 +232,12 @@ void command_unscribespells(Client *c, const Seperator *sep);
|
||||
void command_untraindisc(Client *c, const Seperator *sep);
|
||||
void command_untraindiscs(Client *c, const Seperator *sep);
|
||||
void command_updatechecksum(Client* c, const Seperator* sep);
|
||||
void command_uptime(Client *c, const Seperator *sep);
|
||||
void command_version(Client *c, const Seperator *sep);
|
||||
void command_viewcurrencies(Client *c, const Seperator *sep);
|
||||
void command_viewnpctype(Client *c, const Seperator *sep);
|
||||
void command_viewpetition(Client *c, const Seperator *sep);
|
||||
void command_viewrecipe(Client *c, const Seperator *sep);
|
||||
void command_viewzoneloot(Client *c, const Seperator *sep);
|
||||
void command_wc(Client *c, const Seperator *sep);
|
||||
void command_weather(Client *c, const Seperator *sep);
|
||||
void command_who(Client *c, const Seperator *sep);
|
||||
void command_worldshutdown(Client *c, const Seperator *sep);
|
||||
void command_wp(Client *c, const Seperator *sep);
|
||||
void command_wpadd(Client *c, const Seperator *sep);
|
||||
void command_wpinfo(Client *c, const Seperator *sep);
|
||||
void command_worldwide(Client *c, const Seperator *sep);
|
||||
void command_xtargets(Client *c, const Seperator *sep);
|
||||
void command_zclip(Client *c, const Seperator *sep);
|
||||
void command_zcolor(Client *c, const Seperator *sep);
|
||||
void command_zheader(Client *c, const Seperator *sep);
|
||||
@@ -304,12 +246,10 @@ void command_zone_instance(Client *c, const Seperator *sep);
|
||||
void command_zonebootup(Client *c, const Seperator *sep);
|
||||
void command_zonelock(Client *c, const Seperator *sep);
|
||||
void command_zoneshutdown(Client *c, const Seperator *sep);
|
||||
void command_zonestatus(Client *c, const Seperator *sep);
|
||||
void command_zopp(Client *c, const Seperator *sep);
|
||||
void command_zsafecoords(Client *c, const Seperator *sep);
|
||||
void command_zsave(Client *c, const Seperator *sep);
|
||||
void command_zsky(Client *c, const Seperator *sep);
|
||||
void command_zstats(Client *c, const Seperator *sep);
|
||||
void command_zunderworld(Client *c, const Seperator *sep);
|
||||
|
||||
#include "bot.h"
|
||||
|
||||
+4
-4
@@ -622,8 +622,8 @@ bool Client::TrainDiscipline(uint32 itemid) {
|
||||
const std::string item_name = item->Name;
|
||||
|
||||
if (
|
||||
item_name.substr(0, 5) != std::string("Tome ") &&
|
||||
item_name.substr(0, 7) != std::string("Skill: ")
|
||||
!Strings::BeginsWith(item_name, "Tome of ") &&
|
||||
!Strings::BeginsWith(item_name, "Skill: ")
|
||||
) {
|
||||
Message(Chat::Red, "This item is not a tome.");
|
||||
//summon them the item back...
|
||||
@@ -709,8 +709,8 @@ bool Client::MemorizeSpellFromItem(uint32 item_id) {
|
||||
const std::string item_name = item->Name;
|
||||
|
||||
if (
|
||||
item_name.substr(0, 7) != std::string("Spell: ") &&
|
||||
item_name.substr(0, 6) != std::string("Song: ")
|
||||
!Strings::BeginsWith(item_name, "Spell: ") &&
|
||||
!Strings::BeginsWith(item_name, "Song: ")
|
||||
) {
|
||||
Message(Chat::Red, "This item is not a scroll.");
|
||||
SummonItem(item_id);
|
||||
|
||||
@@ -46,7 +46,10 @@ void perl_register_group();
|
||||
void perl_register_raid();
|
||||
void perl_register_inventory();
|
||||
void perl_register_questitem();
|
||||
void perl_register_questitem_data();
|
||||
void perl_register_spawn();
|
||||
void perl_register_spell();
|
||||
void perl_register_stat_bonuses();
|
||||
void perl_register_hateentry();
|
||||
void perl_register_object();
|
||||
void perl_register_doors();
|
||||
@@ -1068,7 +1071,10 @@ void PerlembParser::MapFunctions()
|
||||
perl_register_raid();
|
||||
perl_register_inventory();
|
||||
perl_register_questitem();
|
||||
perl_register_questitem_data();
|
||||
perl_register_spawn();
|
||||
perl_register_spell();
|
||||
perl_register_stat_bonuses();
|
||||
perl_register_hateentry();
|
||||
perl_register_object();
|
||||
perl_register_doors();
|
||||
|
||||
+2
-2
@@ -539,7 +539,7 @@ public:
|
||||
inline const std::unordered_map<uint16, Object *> &GetObjectList() { return object_list; }
|
||||
inline const std::unordered_map<uint16, Doors *> &GetDoorsList() { return door_list; }
|
||||
|
||||
std::unordered_map<uint16, Mob *> &GetCloseMobList(Mob *mob, float distance = 0);
|
||||
std::unordered_map<uint16, Mob *> &GetCloseMobList(Mob *mob, float distance = 0.0f);
|
||||
|
||||
void DepopAll(int NPCTypeID, bool StartSpawnTimer = true);
|
||||
|
||||
@@ -553,7 +553,7 @@ public:
|
||||
bool add_self_to_other_lists = false
|
||||
);
|
||||
|
||||
void GetTrapInfo(Client* client);
|
||||
void GetTrapInfo(Client* c);
|
||||
bool IsTrapGroupSpawned(uint32 trap_id, uint8 group);
|
||||
void UpdateAllTraps(bool respawn, bool repopnow = false);
|
||||
void ClearTrapPointers();
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_aggro(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments || !sep->IsNumber(1)) {
|
||||
c->Message(Chat::White, "Usage: #aggro [Distance] [-v] (-v is verbose Faction Information)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
!c->GetTarget() ||
|
||||
(
|
||||
c->GetTarget() &&
|
||||
!c->GetTarget()->IsNPC()
|
||||
)
|
||||
) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
NPC* target = c->GetTarget()->CastToNPC();
|
||||
|
||||
float distance = Strings::ToFloat(sep->arg[1]);
|
||||
bool verbose = !strcasecmp("-v", sep->arg[2]);
|
||||
entity_list.DescribeAggro(c, target, distance, verbose);
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_checklos(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget()) {
|
||||
c->Message(Chat::White, "You must have a target to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto target = c->GetTarget();
|
||||
|
||||
bool has_los = c->CheckLosFN(target);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You {}have line of sight to {}.",
|
||||
has_los ? "" : "do not ",
|
||||
c->GetTargetDescription(target)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,26 +2,31 @@
|
||||
|
||||
void command_copycharacter(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->argnum < 3) {
|
||||
if (
|
||||
sep->argnum < 3 ||
|
||||
sep->IsNumber(1) ||
|
||||
sep->IsNumber(2) ||
|
||||
sep->IsNumber(3)
|
||||
) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"Usage: [source_character_name] [destination_character_name] [destination_account_name]"
|
||||
"Usage: #copycharacter [source_character_name] [destination_character_name] [destination_account_name]"
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
std::string source_character_name = sep->arg[1];
|
||||
std::string destination_character_name = sep->arg[2];
|
||||
std::string destination_account_name = sep->arg[3];
|
||||
const std::string& source_character_name = sep->arg[1];
|
||||
const std::string& destination_character_name = sep->arg[2];
|
||||
const std::string& destination_account_name = sep->arg[3];
|
||||
|
||||
bool result = database.CopyCharacter(
|
||||
const bool result = database.CopyCharacter(
|
||||
source_character_name,
|
||||
destination_character_name,
|
||||
destination_account_name
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::Yellow,
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Character Copy [{}] to [{}] via account [{}] [{}]",
|
||||
source_character_name,
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../worldserver.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void command_cvs(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto pack = new ServerPacket(ServerOP_ClientVersionSummary, sizeof(ServerRequestClientVersionSummary_Struct));
|
||||
auto srcvss = (ServerRequestClientVersionSummary_Struct *) pack->pBuffer;
|
||||
strn0cpy(srcvss->Name, c->GetName(), sizeof(srcvss->Name));
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_distance(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (c->GetTarget()) {
|
||||
Mob *target = c->GetTarget();
|
||||
if (c != target) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} is {:.2f} units from you.",
|
||||
c->GetTargetDescription(target),
|
||||
Distance(
|
||||
c->GetPosition(),
|
||||
target->GetPosition()
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_emotesearch(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #emotesearch [Emote ID]");
|
||||
c->Message(Chat::White, "Usage: #emotesearch [Search Crteria]");
|
||||
return;
|
||||
}
|
||||
|
||||
auto emote_count = 0;
|
||||
auto emote_number = 1;
|
||||
|
||||
std::string search_criteria = sep->argplus[1];
|
||||
bool found_by_id = false;
|
||||
|
||||
if (!sep->IsNumber(1)) {
|
||||
LinkedListIterator<NPC_Emote_Struct *> iterator(zone->NPCEmoteList);
|
||||
iterator.Reset();
|
||||
while (iterator.MoreElements()) {
|
||||
auto &e = iterator.GetData();
|
||||
auto current_text = Strings::ToLower(e->text);
|
||||
|
||||
if (Strings::Contains(current_text, Strings::ToLower(search_criteria))) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Emote {} | Emote ID: {}",
|
||||
emote_number,
|
||||
e->emoteid
|
||||
).c_str()
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Emote {} | Event: {} ({}) Type: {} ({})",
|
||||
emote_number,
|
||||
EQ::constants::GetEmoteEventTypeName(e->event_),
|
||||
e->event_,
|
||||
EQ::constants::GetEmoteTypeName(e->type),
|
||||
e->type
|
||||
).c_str()
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Emote {} | Text: {}",
|
||||
emote_number,
|
||||
e->text
|
||||
).c_str()
|
||||
);
|
||||
|
||||
emote_count++;
|
||||
emote_number++;
|
||||
}
|
||||
|
||||
if (emote_count == 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
iterator.Advance();
|
||||
}
|
||||
} else {
|
||||
auto emote_id = Strings::ToUnsignedInt(search_criteria);
|
||||
|
||||
LinkedListIterator<NPC_Emote_Struct *> iterator(zone->NPCEmoteList);
|
||||
iterator.Reset();
|
||||
while (iterator.MoreElements()) {
|
||||
auto &e = iterator.GetData();
|
||||
if (emote_id == e->emoteid) {
|
||||
found_by_id = true;
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Emote {} | Event: {} ({}) Type: {} ({})",
|
||||
emote_number,
|
||||
EQ::constants::GetEmoteEventTypeName(e->event_),
|
||||
e->event_,
|
||||
EQ::constants::GetEmoteTypeName(e->type),
|
||||
e->type
|
||||
).c_str()
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Emote {} | Text: {}",
|
||||
emote_number,
|
||||
e->text
|
||||
).c_str()
|
||||
);
|
||||
|
||||
emote_count++;
|
||||
emote_number++;
|
||||
}
|
||||
|
||||
if (emote_count == 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
iterator.Advance();
|
||||
}
|
||||
}
|
||||
|
||||
auto found_string = (
|
||||
found_by_id ?
|
||||
fmt::format("ID {}", search_criteria) :
|
||||
search_criteria
|
||||
);
|
||||
|
||||
if (!emote_count) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"No Emotes found matching {}.",
|
||||
found_string
|
||||
).c_str()
|
||||
);
|
||||
} else if (emote_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 Emotes shown matching {}, too many results.",
|
||||
found_string
|
||||
).c_str()
|
||||
);
|
||||
} else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Emote{} found matching {}.",
|
||||
emote_count,
|
||||
emote_count != 1 ? "s" : "",
|
||||
found_string
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
#include "../client.h"
|
||||
#include "find/aa.cpp"
|
||||
#include "find/character.cpp"
|
||||
#include "find/class.cpp"
|
||||
#include "find/currency.cpp"
|
||||
#include "find/deity.cpp"
|
||||
#include "find/emote.cpp"
|
||||
#include "find/faction.cpp"
|
||||
#include "find/item.cpp"
|
||||
#include "find/language.cpp"
|
||||
#include "find/npctype.cpp"
|
||||
#include "find/race.cpp"
|
||||
#include "find/recipe.cpp"
|
||||
#include "find/skill.cpp"
|
||||
#include "find/spell.cpp"
|
||||
#include "find/task.cpp"
|
||||
#include "find/zone.cpp"
|
||||
|
||||
void command_find(Client *c, const Seperator *sep)
|
||||
{
|
||||
// Cmd represents a command
|
||||
// variables are short to save space horizontally
|
||||
// when adding a new sub-command, add it to the vector below
|
||||
struct Cmd {
|
||||
std::string cmd{}; // command
|
||||
std::string u{}; // usage
|
||||
void (*fn)(Client *c, const Seperator *sep) = nullptr; // function
|
||||
std::vector<std::string> a{}; // aliases
|
||||
};
|
||||
|
||||
std::vector<Cmd> commands = {
|
||||
Cmd{.cmd = "aa", .u = "aa [Search Criteria]", .fn = FindAA, .a = {"#findaa"}},
|
||||
Cmd{.cmd = "character", .u = "character [Search Criteria]", .fn = FindCharacter, .a = {"#findcharacter"}},
|
||||
Cmd{.cmd = "class", .u = "class [Search Criteria]", .fn = FindClass, .a = {"#findclass"}},
|
||||
Cmd{.cmd = "currency", .u = "currency [Search Criteria]", .fn = FindCurrency, .a = {"#findcurrency"}},
|
||||
Cmd{.cmd = "deity", .u = "deity [Search Criteria]", .fn = FindDeity, .a = {"#finddeity"}},
|
||||
Cmd{.cmd = "emote", .u = "emote [Search Criteria]", .fn = FindEmote, .a = {"#findemote"}},
|
||||
Cmd{.cmd = "faction", .u = "faction [Search Criteria]", .fn = FindFaction, .a = {"#findfaction"}},
|
||||
Cmd{.cmd = "item", .u = "item [Search Criteria]", .fn = FindItem, .a = {"#fi", "#finditem"}},
|
||||
Cmd{.cmd = "language", .u = "language [Search Criteria]", .fn = FindLanguage, .a = {"#findlanguage"}},
|
||||
Cmd{
|
||||
.cmd = "npctype", .u = "npctype [Search Criteria]", .fn = FindNPCType, .a = {
|
||||
"#fn",
|
||||
"#findnpc",
|
||||
"#findnpctype"
|
||||
}
|
||||
},
|
||||
Cmd{.cmd = "race", .u = "race [Search Criteria]", .fn = FindRace, .a = {"#findrace"}},
|
||||
Cmd{.cmd = "recipe", .u = "recipe [Search Criteria]", .fn = FindRecipe, .a = {"#findrecipe"}},
|
||||
Cmd{.cmd = "skill", .u = "skill [Search Criteria]", .fn = FindSkill, .a = {"#findskill"}},
|
||||
Cmd{.cmd = "spell", .u = "spell [Search Criteria]", .fn = FindSpell, .a = {"#fs", "#findspell"}},
|
||||
Cmd{.cmd = "task", .u = "task [Search Criteria]", .fn = FindTask, .a = {"#findtask"}},
|
||||
Cmd{.cmd = "zone", .u = "zone [Search Criteria]", .fn = FindZone, .a = {"#fz", "#findzone"}},
|
||||
};
|
||||
|
||||
// Check for arguments
|
||||
const auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
for (const auto &cmd: commands) {
|
||||
c->Message(Chat::White, fmt::format("Usage: #find {}", cmd.u).c_str());
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// look for alias or command
|
||||
for (const auto &cmd: commands) {
|
||||
// Check for alias first
|
||||
for (const auto &alias: cmd.a) {
|
||||
if (!alias.empty() && alias == Strings::ToLower(sep->arg[0])) {
|
||||
// build string from sep args
|
||||
std::vector<std::string> args = {};
|
||||
|
||||
// skip the first arg
|
||||
for (auto i = 1; i <= arguments; i++) {
|
||||
args.emplace_back(sep->arg[i]);
|
||||
}
|
||||
|
||||
// build the rewrite string
|
||||
std::string rewrite = fmt::format("#find {} {}", cmd.cmd, Strings::Join(args, " "));
|
||||
|
||||
// rewrite to #find <sub-command <args>
|
||||
c->SendGMCommand(rewrite);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for command
|
||||
if (cmd.cmd == Strings::ToLower(sep->arg[1])) {
|
||||
cmd.fn(c, sep);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Command not found
|
||||
c->Message(Chat::White, "Command not found. Usage: #find [command]");
|
||||
for (const auto &cmd: commands) {
|
||||
c->Message(Chat::White, fmt::format("Usage: #find {}", cmd.u).c_str());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void FindAA(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto aa_id = Strings::ToInt(sep->arg[2]);
|
||||
const auto& aa_name = zone->GetAAName(aa_id);
|
||||
if (!aa_name.empty()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"AA {} | {}",
|
||||
Strings::Commify(aa_id),
|
||||
aa_name
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"AA ID {} was not found.",
|
||||
Strings::Commify(aa_id)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
std::map<int, std::string> ordered_aas;
|
||||
|
||||
for (const auto &a: zone->aa_abilities) {
|
||||
ordered_aas[a.second.get()->first->id] = a.second.get()->name;
|
||||
}
|
||||
|
||||
for (const auto &a: ordered_aas) {
|
||||
const auto& aa_name = zone->GetAAName(a.first);
|
||||
if (!aa_name.empty()) {
|
||||
const auto& aa_name_lower = Strings::ToLower(aa_name);
|
||||
if (!Strings::Contains(aa_name_lower, search_criteria)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"AA {} | {}",
|
||||
Strings::Commify(a.first),
|
||||
aa_name
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 AAs were found matching '{}', max reached.",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} AA{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
#include "../../client.h"
|
||||
#include "../../common/repositories/character_data_repository.h"
|
||||
|
||||
void FindCharacter(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto character_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
|
||||
const auto& e = CharacterDataRepository::FindOne(content_db, character_id);
|
||||
if (!e.id) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Character ID {} does not exist or is invalid.",
|
||||
Strings::Commify(character_id)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Character ID {} | {}",
|
||||
Strings::Commify(character_id),
|
||||
e.name
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto search_criteria = Strings::ToLower(sep->argplus[2]);
|
||||
|
||||
const auto& l = CharacterDataRepository::GetWhere(
|
||||
content_db,
|
||||
fmt::format(
|
||||
"LOWER(`name`) LIKE '%%{}%%' ORDER BY `id` ASC LIMIT 50",
|
||||
search_criteria
|
||||
)
|
||||
);
|
||||
|
||||
if (l.empty()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"No characters found matching '{}'.",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
for (const auto& e : l) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Character ID {} | {}",
|
||||
Strings::Commify(e.id),
|
||||
e.name
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 Characters found matching '{}', max reached.",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Character{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void FindClass(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto class_id = Strings::ToInt(sep->arg[2]);
|
||||
if (EQ::ValueWithin(class_id, WARRIOR, BERSERKER)) {
|
||||
const std::string& class_name = GetClassIDName(class_id);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Class {} | {}{}",
|
||||
class_id,
|
||||
class_name,
|
||||
(
|
||||
IsPlayerClass(class_id) ?
|
||||
fmt::format(
|
||||
" ({})",
|
||||
Strings::Commify(GetPlayerClassBit(class_id))
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Class ID {} was not found.",
|
||||
class_id
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
for (uint16 class_id = WARRIOR; class_id <= MERCENARY_MASTER; class_id++) {
|
||||
const std::string& class_name = GetClassIDName(class_id);
|
||||
const auto& class_name_lower = Strings::ToLower(class_name);
|
||||
if (!Strings::Contains(class_name_lower, search_criteria)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Class {} | {}{}",
|
||||
class_id,
|
||||
class_name,
|
||||
(
|
||||
IsPlayerClass(class_id) ?
|
||||
fmt::format(
|
||||
" | ({})",
|
||||
Strings::Commify(GetPlayerClassBit(class_id))
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Class{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "es" : "",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void FindCurrency(Client *c, const Seperator *sep)
|
||||
{
|
||||
const auto can_summon_items = c->Admin() >= GetCommandStatus(c, "summonitem");
|
||||
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto item_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
const auto currency_id = zone->GetCurrencyID(item_id);
|
||||
|
||||
if (!currency_id) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"There is no currency with an item ID of {}.",
|
||||
Strings::Commify(item_id)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto item_data = database.GetItem(item_id);
|
||||
if (!item_data) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Item ID {} does not exist.",
|
||||
Strings::Commify(item_id)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Currency {} | {}{}",
|
||||
currency_id,
|
||||
database.CreateItemLink(item_id),
|
||||
(
|
||||
can_summon_items ?
|
||||
fmt::format(
|
||||
" | {}",
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#summonitem {} {}",
|
||||
item_id,
|
||||
item_data->StackSize
|
||||
),
|
||||
"Summon"
|
||||
)
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
for (const auto& e : zone->AlternateCurrencies) {
|
||||
const auto item_data = database.GetItem(e.item_id);
|
||||
if (!item_data) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto& item_name = Strings::ToLower(item_data->Name);
|
||||
|
||||
if (!Strings::Contains(item_name, search_criteria)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Currency {} | {}{}",
|
||||
e.id,
|
||||
database.CreateItemLink(e.item_id),
|
||||
(
|
||||
can_summon_items ?
|
||||
fmt::format(
|
||||
" | {}",
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#summonitem {} {}",
|
||||
e.item_id,
|
||||
item_data->StackSize
|
||||
),
|
||||
"Summon"
|
||||
)
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 Currencies found matching '{}', max reached.",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Currenc{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "ies" : "y",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void FindDeity(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto deity_id = static_cast<EQ::deity::DeityType>(Strings::ToInt(sep->arg[2]));
|
||||
const auto& deity_name = EQ::deity::GetDeityName(deity_id);
|
||||
if (!deity_name.empty()) {
|
||||
const auto deity_bit = EQ::deity::GetDeityBitmask(deity_id);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Deity {} | {} ({})",
|
||||
deity_id,
|
||||
deity_name,
|
||||
Strings::Commify(deity_bit)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Deity ID {} was not found.",
|
||||
deity_id
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
for (const auto& d : EQ::deity::GetDeityMap()) {
|
||||
const auto& deity_name_lower = Strings::ToLower(d.second);
|
||||
if (!Strings::Contains(deity_name_lower, search_criteria)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto deity_bit = EQ::deity::GetDeityBitmask(d.first);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Deity {} | {} ({})",
|
||||
d.first,
|
||||
d.second,
|
||||
Strings::Commify(deity_bit)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Deit{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "ies" : "y",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void FindEmote(Client *c, const Seperator *sep)
|
||||
{
|
||||
uint32 found_count = 0;
|
||||
|
||||
if (sep->IsNumber(2)) {
|
||||
auto emote_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
|
||||
LinkedListIterator<NPC_Emote_Struct *> iterator(zone->NPCEmoteList);
|
||||
iterator.Reset();
|
||||
while (iterator.MoreElements()) {
|
||||
auto &e = iterator.GetData();
|
||||
if (emote_id == e->emoteid) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Emote {} | Event: {} ({}) Type: {} ({})",
|
||||
e->emoteid,
|
||||
EQ::constants::GetEmoteEventTypeName(e->event_),
|
||||
e->event_,
|
||||
EQ::constants::GetEmoteTypeName(e->type),
|
||||
e->type
|
||||
).c_str()
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Emote {} | Text: {}",
|
||||
e->emoteid,
|
||||
e->text
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 Emotes shown matching ID '{}', max reached.",
|
||||
emote_id
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Emote{} found matching ID '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
emote_id
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string& search_criteria = sep->argplus[2];
|
||||
|
||||
LinkedListIterator<NPC_Emote_Struct *> iterator(zone->NPCEmoteList);
|
||||
iterator.Reset();
|
||||
while (iterator.MoreElements()) {
|
||||
auto &e = iterator.GetData();
|
||||
|
||||
const std::string& current_text = Strings::ToLower(e->text);
|
||||
|
||||
if (Strings::Contains(current_text, Strings::ToLower(search_criteria))) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Emote {} | Event: {} ({}) Type: {} ({})",
|
||||
e->emoteid,
|
||||
EQ::constants::GetEmoteEventTypeName(e->event_),
|
||||
e->event_,
|
||||
EQ::constants::GetEmoteTypeName(e->type),
|
||||
e->type
|
||||
).c_str()
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Emote {} | Text: {}",
|
||||
e->emoteid,
|
||||
e->text
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
iterator.Advance();
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 Emotes shown matching '{}', max reached.",
|
||||
search_criteria
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Emote{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
search_criteria
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void FindFaction(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto faction_id = Strings::ToInt(sep->arg[2]);
|
||||
const auto& faction_name = content_db.GetFactionName(faction_id);
|
||||
if (!faction_name.empty()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Faction {} | {}",
|
||||
Strings::Commify(faction_id),
|
||||
faction_name
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Faction ID {} was not found.",
|
||||
Strings::Commify(faction_id)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
|
||||
auto found_count = 0;
|
||||
const auto max_faction_id = content_db.GetMaxFaction();
|
||||
|
||||
for (uint32 faction_id = 0; faction_id < max_faction_id; faction_id++) {
|
||||
const auto& faction_name = content_db.GetFactionName(faction_id);
|
||||
const auto& faction_name_lower = Strings::ToLower(faction_name);
|
||||
if (faction_name.empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!Strings::Contains(faction_name_lower, search_criteria)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Faction {} | {}",
|
||||
Strings::Commify(faction_id),
|
||||
faction_name
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 Factions found matching '{}', max reached.",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Faction{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
#include "../../client.h"
|
||||
#include "../../common/repositories/items_repository.h"
|
||||
|
||||
void FindItem(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto item_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
const auto* item = database.GetItem(item_id);
|
||||
if (item) {
|
||||
std::string summon_links = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#si {}",
|
||||
item_id
|
||||
),
|
||||
"X"
|
||||
);
|
||||
|
||||
if (item->Stackable && item->StackSize > 1) {
|
||||
summon_links += fmt::format(
|
||||
" | {}",
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#si {} {}",
|
||||
item_id,
|
||||
item->StackSize
|
||||
),
|
||||
std::to_string(item->StackSize)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} | {}",
|
||||
summon_links,
|
||||
database.CreateItemLink(item_id)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Item ID {} not found",
|
||||
item_id
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
|
||||
|
||||
const auto& l = ItemsRepository::GetItemIDsBySearchCriteria(content_db, search_criteria, 50);
|
||||
|
||||
if (l.empty()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"No items were found matching '{}'.",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
for (const auto& e : l) {
|
||||
const auto* item = database.GetItem(e);
|
||||
std::string summon_links = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#si {}",
|
||||
e
|
||||
),
|
||||
"X"
|
||||
);
|
||||
|
||||
if (item->Stackable && item->StackSize > 1) {
|
||||
summon_links += fmt::format(
|
||||
" | {}",
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#si {} {}",
|
||||
e,
|
||||
item->StackSize
|
||||
),
|
||||
std::to_string(item->StackSize)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} | {}",
|
||||
summon_links,
|
||||
database.CreateItemLink(e)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 Items found matching '{}', max reached.",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Item{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" :"",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
#include "../../client.h"
|
||||
#include "../../common/languages.h"
|
||||
|
||||
void FindLanguage(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto language_id = Strings::ToInt(sep->arg[2]);
|
||||
if (EQ::ValueWithin(language_id, LANG_COMMON_TONGUE, LANG_UNKNOWN)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Language {} | {}",
|
||||
language_id,
|
||||
EQ::constants::GetLanguageName(language_id)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Language ID {} was not found.",
|
||||
language_id
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
for (const auto& l : EQ::constants::GetLanguageMap()) {
|
||||
const auto& language_name_lower = Strings::ToLower(l.second);
|
||||
if (!Strings::Contains(language_name_lower, search_criteria)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Language {} | {}",
|
||||
l.first,
|
||||
l.second
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Language{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void FindNPCType(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::string query = "SELECT `id`, `name` FROM npc_types WHERE ";
|
||||
const std::string& search_criteria = sep->argplus[2];
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto npc_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
|
||||
query += fmt::format(
|
||||
"id = {}",
|
||||
npc_id
|
||||
);
|
||||
} else {
|
||||
query += fmt::format(
|
||||
"`name` LIKE '%%{}%%'",
|
||||
Strings::Escape(search_criteria)
|
||||
);
|
||||
}
|
||||
|
||||
query += " ORDER BY `id` ASC LIMIT 50";
|
||||
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"No NPCs matching '{}' were found.",
|
||||
search_criteria
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto can_spawn_npcs = c->Admin() >= GetCommandStatus(c, "#npctypespawn");
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
for (auto row : results) {
|
||||
auto found_number = (found_count + 1);
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"NPC {} | {}{}",
|
||||
Strings::Commify(row[0]),
|
||||
row[1],
|
||||
(
|
||||
can_spawn_npcs ?
|
||||
fmt::format(
|
||||
" | {}",
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#npctypespawn {}",
|
||||
row[0]
|
||||
),
|
||||
"Spawn"
|
||||
)
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 NPCs found matching '{}', max reached.",
|
||||
search_criteria
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} NPC{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
search_criteria
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void FindRace(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto race_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[2]));
|
||||
const std::string& race_name = GetRaceIDName(race_id);
|
||||
if (EQ::ValueWithin(race_id, RACE_HUMAN_1, RACE_PEGASUS_732)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Race {} | {}{}",
|
||||
race_id,
|
||||
race_name,
|
||||
(
|
||||
IsPlayerRace(race_id) ?
|
||||
fmt::format(
|
||||
" ({})",
|
||||
Strings::Commify(GetPlayerRaceBit(race_id))
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Race ID {} was not found.",
|
||||
race_id
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
for (uint16 race_id = RACE_HUMAN_1; race_id <= RACE_PEGASUS_732; race_id++) {
|
||||
std::string race_name = GetRaceIDName(race_id);
|
||||
auto race_name_lower = Strings::ToLower(race_name);
|
||||
if (!Strings::Contains(race_name_lower, search_criteria)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Race {} | {}{}",
|
||||
race_id,
|
||||
race_name,
|
||||
(
|
||||
IsPlayerRace(race_id) ?
|
||||
fmt::format(
|
||||
" ({})",
|
||||
Strings::Commify(GetPlayerRaceBit(race_id))
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 Races found matching '{}', max reached.",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Race{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
#include "../../client.h"
|
||||
#include "../../command.h"
|
||||
#include "../../common/repositories/tradeskill_recipe_repository.h"
|
||||
|
||||
void FindRecipe(Client *c, const Seperator *sep)
|
||||
{
|
||||
const auto can_view_recipes = c->Admin() >= GetCommandStatus(c, "viewrecipe");
|
||||
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto recipe_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[2]));
|
||||
|
||||
const auto& l = TradeskillRecipeRepository::GetWhere(
|
||||
database,
|
||||
fmt::format("id = {}", recipe_id)
|
||||
);
|
||||
|
||||
if (l.empty() || !l[0].id) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Recipe ID {} could not be found.",
|
||||
Strings::Commify(recipe_id)
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Recipe {} | {}{}",
|
||||
Strings::Commify(recipe_id),
|
||||
l[0].name,
|
||||
(
|
||||
can_view_recipes ?
|
||||
fmt::format(
|
||||
" | {}",
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#viewrecipe {}",
|
||||
l[0].id
|
||||
),
|
||||
"View"
|
||||
)
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
const auto& l = TradeskillRecipeRepository::GetWhere(
|
||||
database,
|
||||
fmt::format(
|
||||
"LOWER(`name`) LIKE '%%{}%%' ORDER BY `id` ASC",
|
||||
search_criteria
|
||||
)
|
||||
);
|
||||
|
||||
if (l.empty() || !l[0].id) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"No recipes were found matching '{}'.",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
for (const auto& e : l) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Recipe {} | {}{}",
|
||||
Strings::Commify(e.id),
|
||||
e.name,
|
||||
(
|
||||
can_view_recipes ?
|
||||
fmt::format(
|
||||
" | {}",
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#viewrecipe {}",
|
||||
e.id
|
||||
),
|
||||
"View"
|
||||
)
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
found_count++;
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 Recipes found matching '{}', max reached.",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Recipe{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void FindSkill(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto skill_id = Strings::ToInt(sep->arg[2]);
|
||||
if (EQ::ValueWithin(skill_id, EQ::skills::Skill1HBlunt, EQ::skills::SkillCount)) {
|
||||
for (const auto& s : EQ::skills::GetSkillTypeMap()) {
|
||||
if (skill_id == s.first) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Skill {} | {}",
|
||||
s.first,
|
||||
s.second
|
||||
).c_str()
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Skill ID {} was not found.",
|
||||
skill_id
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
for (const auto& s : EQ::skills::GetSkillTypeMap()) {
|
||||
const auto& skill_name_lower = Strings::ToLower(s.second);
|
||||
if (!Strings::Contains(skill_name_lower, sep->argplus[2])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Skill {} | {}",
|
||||
s.first,
|
||||
s.second
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 Skills were found matching '{}', max reached.",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Skill{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void FindSpell(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (SPDAT_RECORDS <= 0) {
|
||||
c->Message(Chat::White, "Spells not loaded.");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto can_cast_spells = c->Admin() >= GetCommandStatus(c, "castspell");
|
||||
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto spell_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Spell ID {} was not found.",
|
||||
Strings::Commify(spell_id)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Spell {} | {}",
|
||||
Strings::Commify(spell_id),
|
||||
spells[spell_id].name
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
for (uint32 spell_id = 0; spell_id < SPDAT_RECORDS; spell_id++) {
|
||||
if (IsValidSpell(spell_id)) {
|
||||
const auto& current_spell = spells[spell_id];
|
||||
|
||||
const std::string& spell_name = current_spell.name;
|
||||
const auto& spell_name_lower = Strings::ToLower(spell_name);
|
||||
if (!Strings::Contains(spell_name_lower, search_criteria)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Spell {} | {}{}",
|
||||
Strings::Commify(spell_id),
|
||||
spell_name,
|
||||
(
|
||||
can_cast_spells ?
|
||||
fmt::format(
|
||||
" | {}",
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#castspell {}",
|
||||
spell_id
|
||||
),
|
||||
"Cast"
|
||||
)
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 Spells found matching '{}', max reached.",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Spell{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void FindTask(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!RuleB(TaskSystem, EnableTaskSystem)) {
|
||||
c->Message(Chat::White, "This command cannot be used while the Task system is disabled.");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto can_assign_tasks = c->Admin() >= GetCommandStatus(c, "task");
|
||||
|
||||
if (sep->IsNumber(2)) {
|
||||
const auto task_id = Strings::ToUnsignedInt(sep->arg[2]);
|
||||
const auto& task_name = task_manager->GetTaskName(task_id);
|
||||
|
||||
if (task_name.empty()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Task ID {} was not found.",
|
||||
Strings::Commify(task_id)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Task {} | {}",
|
||||
Strings::Commify(task_id),
|
||||
task_name
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto& search_criteria = Strings::ToLower(sep->argplus[2]);
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
for (const auto& t : task_manager->GetTaskData()) {
|
||||
const auto& task_name = t.second.title;
|
||||
const auto& task_name_lower = Strings::ToLower(task_name);
|
||||
if (!Strings::Contains(task_name_lower, search_criteria)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Task {} | {}{}",
|
||||
Strings::Commify(t.first),
|
||||
task_name,
|
||||
(
|
||||
can_assign_tasks ?
|
||||
fmt::format(
|
||||
" | {}{}",
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#task assign {}",
|
||||
t.first
|
||||
),
|
||||
"Assign"
|
||||
),
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#task uncomplete {}",
|
||||
t.first
|
||||
),
|
||||
"Uncomplete"
|
||||
)
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 Tasks were found matching '{}', max reached.",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Task{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
sep->argplus[2]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
#include "../../client.h"
|
||||
#include "../../common/content/world_content_service.h"
|
||||
|
||||
void FindZone(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::string query = "SELECT zoneidnumber, short_name, long_name, version FROM zone WHERE ";
|
||||
|
||||
const auto is_expansion_search = !strcasecmp(sep->arg[2], "expansion");
|
||||
const auto is_id_search = Strings::IsNumber(sep->arg[2]);
|
||||
const auto is_short_name_search = !is_expansion_search && !is_id_search;
|
||||
|
||||
std::string search_string;
|
||||
std::string search_type;
|
||||
|
||||
if (is_expansion_search) {
|
||||
query += fmt::format(
|
||||
"expansion = {}",
|
||||
Strings::ToInt(sep->arg[3])
|
||||
);
|
||||
|
||||
search_string = Expansion::ExpansionName[Strings::ToInt(sep->arg[3])];
|
||||
search_type = "Expansion";
|
||||
} else if (is_id_search) {
|
||||
query += fmt::format(
|
||||
"zoneidnumber = {}",
|
||||
Strings::ToUnsignedInt(sep->arg[2])
|
||||
);
|
||||
|
||||
search_string = sep->arg[2];
|
||||
search_type = "Expansion";
|
||||
} else if (is_short_name_search) {
|
||||
query += fmt::format(
|
||||
"LOWER(`long_name`) LIKE '%%{}%%' OR LOWER(`short_name`) LIKE '%%{}%%'",
|
||||
Strings::Escape(Strings::ToLower(sep->argplus[2])),
|
||||
Strings::Escape(Strings::ToLower(sep->argplus[2]))
|
||||
);
|
||||
|
||||
search_string = sep->argplus[2];
|
||||
search_type = "Expansion";
|
||||
}
|
||||
|
||||
query += " ORDER BY `zoneidnumber` ASC LIMIT 50";
|
||||
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
c->Message(Chat::White, "No zones were found matching your search criteria.");
|
||||
c->Message(Chat::White, query.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
auto found_count = 0;
|
||||
|
||||
for (auto row : results) {
|
||||
const auto zone_id = Strings::ToUnsignedInt(row[0]);
|
||||
const std::string& short_name = row[1];
|
||||
const std::string& long_name = row[2];
|
||||
const auto version = Strings::ToInt(row[3]);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{}{} {} ({}) (ID {}){}",
|
||||
(
|
||||
version == 0 ?
|
||||
fmt::format(
|
||||
"{} | ",
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#zone {}",
|
||||
short_name
|
||||
),
|
||||
"Zone"
|
||||
)
|
||||
) :
|
||||
""
|
||||
),
|
||||
fmt::format(
|
||||
"{} |",
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#gmzone {} {}",
|
||||
short_name,
|
||||
version
|
||||
),
|
||||
"GM Zone"
|
||||
)
|
||||
),
|
||||
long_name,
|
||||
short_name,
|
||||
zone_id,
|
||||
(
|
||||
version != 0 ?
|
||||
fmt::format(
|
||||
" (Version {})",
|
||||
version
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 Zones found matching '{}' of '{}'.",
|
||||
search_type,
|
||||
search_string
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Zone{} found matching '{}' of '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
search_type,
|
||||
search_string
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_findaa(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Command Syntax: #findaa [Search Criteria]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sep->IsNumber(1)) {
|
||||
int aa_id = Strings::ToInt(sep->arg[1]);
|
||||
auto aa_name = zone->GetAAName(aa_id);
|
||||
if (!aa_name.empty()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"AA {}: {}",
|
||||
aa_id,
|
||||
aa_name
|
||||
).c_str()
|
||||
);
|
||||
} else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"AA ID {} was not found.",
|
||||
aa_id
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
} else {
|
||||
const auto search_criteria = Strings::ToLower(sep->argplus[1]);
|
||||
if (!search_criteria.empty()) {
|
||||
std::map<int, std::string> ordered_aas;
|
||||
|
||||
for (const auto& a : zone->aa_abilities) {
|
||||
ordered_aas[a.second.get()->first->id] = a.second.get()->name;
|
||||
}
|
||||
|
||||
int found_count = 0;
|
||||
for (const auto& a : ordered_aas) {
|
||||
auto aa_name = zone->GetAAName(a.first);
|
||||
if (!aa_name.empty()) {
|
||||
auto aa_name_lower = Strings::ToLower(aa_name);
|
||||
if (aa_name_lower.find(search_criteria) == std::string::npos) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"AA {}: {}",
|
||||
a.first,
|
||||
aa_name
|
||||
).c_str()
|
||||
);
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found_count) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"No AAs were found matching '{}'.",
|
||||
search_criteria
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 AAs were found matching '{}', max reached.",
|
||||
search_criteria
|
||||
).c_str()
|
||||
);
|
||||
} else {
|
||||
auto skill_message = found_count == 1 ? "An AA was" : fmt::format("{} AAs were", found_count);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} found matching '{}'.",
|
||||
skill_message,
|
||||
search_criteria
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../../common/repositories/character_data_repository.h"
|
||||
|
||||
void command_findcharacter(Client *c, const Seperator *sep)
|
||||
{
|
||||
const auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #findcharacter [Search Criteria]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sep->IsNumber(1)) {
|
||||
const auto character_id = Strings::ToUnsignedInt(sep->arg[1]);
|
||||
|
||||
const auto& e = CharacterDataRepository::FindOne(content_db, character_id);
|
||||
if (!e.id) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Character ID {} does not exist or is invalid.",
|
||||
character_id
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Character ID {} | {}",
|
||||
character_id,
|
||||
e.name
|
||||
).c_str()
|
||||
);
|
||||
} else {
|
||||
const auto search_criteria = Strings::ToLower(sep->argplus[1]);
|
||||
const auto& l = CharacterDataRepository::GetWhere(
|
||||
content_db,
|
||||
fmt::format(
|
||||
"LOWER(`name`) LIKE '%%{}%%'",
|
||||
search_criteria
|
||||
).c_str()
|
||||
);
|
||||
if (l.empty()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"No characters found matching '{}'.",
|
||||
sep->argplus[1]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
auto found_count = 0;
|
||||
for (const auto& e : l) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Character ID {} | {}",
|
||||
e.id,
|
||||
e.name
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"50 Characters found matching '{}', max reached.",
|
||||
sep->argplus[1]
|
||||
).c_str()
|
||||
);
|
||||
} else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Character{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : "",
|
||||
sep->argplus[1]
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_findclass(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Command Syntax: #findclass [Search Criteria]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sep->IsNumber(1)) {
|
||||
int class_id = Strings::ToInt(sep->arg[1]);
|
||||
if (class_id >= WARRIOR && class_id <= MERCENARY_MASTER) {
|
||||
std::string class_name = GetClassIDName(class_id);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Class {} | {}{}",
|
||||
class_id,
|
||||
class_name,
|
||||
(
|
||||
c->IsPlayerClass(class_id) ?
|
||||
fmt::format(
|
||||
" ({})",
|
||||
GetPlayerClassBit(class_id)
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Class ID {} was not found.",
|
||||
class_id
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
} else {
|
||||
auto search_criteria = Strings::ToLower(sep->argplus[1]);
|
||||
int found_count = 0;
|
||||
for (uint16 class_id = WARRIOR; class_id <= MERCENARY_MASTER; class_id++) {
|
||||
std::string class_name = GetClassIDName(class_id);
|
||||
auto class_name_lower = Strings::ToLower(class_name);
|
||||
if (
|
||||
search_criteria.length() &&
|
||||
class_name_lower.find(search_criteria) == std::string::npos
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Class {} | {}{}",
|
||||
class_id,
|
||||
class_name,
|
||||
(
|
||||
c->IsPlayerClass(class_id) ?
|
||||
fmt::format(
|
||||
" ({})",
|
||||
GetPlayerClassBit(class_id)
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(Chat::White, "50 Classes found, max reached.");
|
||||
} else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Class{} found.",
|
||||
found_count,
|
||||
found_count != 1 ? "es" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,134 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_findcurrency(Client *c, const Seperator *sep)
|
||||
{
|
||||
const auto arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #findcurrency [Search Criteria]");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto can_summon_items = c->Admin() >= GetCommandStatus(c, "summonitem");
|
||||
|
||||
if (sep->IsNumber(1)) {
|
||||
const auto item_id = Strings::ToUnsignedInt(sep->arg[1]);
|
||||
const auto currency_id = zone->GetCurrencyID(item_id);
|
||||
|
||||
if (!currency_id) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"There is no currency with an item ID of {}.",
|
||||
item_id
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const auto item_data = database.GetItem(item_id);
|
||||
if (!item_data) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Item ID {} does not exist.",
|
||||
item_id
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Currency {} | {} ({}){}",
|
||||
currency_id,
|
||||
database.CreateItemLink(item_id),
|
||||
item_id,
|
||||
(
|
||||
can_summon_items ?
|
||||
fmt::format(
|
||||
" | {}",
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#summonitem {} {}",
|
||||
item_id,
|
||||
item_data->StackSize
|
||||
),
|
||||
"Summon"
|
||||
)
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
const std::string search_criteria = sep->argplus[1];
|
||||
|
||||
uint32 found_count = 0;
|
||||
|
||||
for (const auto& e : zone->AlternateCurrencies) {
|
||||
const auto item_data = database.GetItem(e.item_id);
|
||||
if (!item_data) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const std::string item_name = Strings::ToLower(item_data->Name);
|
||||
|
||||
if (Strings::Contains(item_name, Strings::ToLower(search_criteria))) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Currency {} | {} ({}){}",
|
||||
e.id,
|
||||
database.CreateItemLink(e.item_id),
|
||||
e.item_id,
|
||||
(
|
||||
can_summon_items ?
|
||||
fmt::format(
|
||||
" | {}",
|
||||
Saylink::Silent(
|
||||
fmt::format(
|
||||
"#summonitem {} {}",
|
||||
e.item_id,
|
||||
item_data->StackSize
|
||||
),
|
||||
"Summon"
|
||||
)
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found_count) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"No currencies were found matching '{}'.",
|
||||
search_criteria
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} currenc{} found matching '{}'.",
|
||||
found_count,
|
||||
found_count != 1 ? "ies were" : "y was",
|
||||
search_criteria
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,89 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_findfaction(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
|
||||
if (arguments == 0) {
|
||||
c->Message(Chat::White, "Command Syntax: #findfaction [search criteria]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sep->IsNumber(1)) {
|
||||
int faction_id = Strings::ToInt(sep->arg[1]);
|
||||
auto faction_name = content_db.GetFactionName(faction_id);
|
||||
if (!faction_name.empty()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Faction {}: {}",
|
||||
faction_id,
|
||||
faction_name
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Faction ID {} was not found.",
|
||||
faction_id
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
|
||||
int found_count = 0;
|
||||
int max_faction_id = content_db.GetMaxFaction();
|
||||
for (int faction_id = 0; faction_id < max_faction_id; faction_id++) {
|
||||
std::string faction_name = content_db.GetFactionName(faction_id);
|
||||
std::string faction_name_lower = Strings::ToLower(faction_name);
|
||||
if (faction_name.empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (faction_name.find(search_criteria) == std::string::npos) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Faction {}: {}",
|
||||
faction_id,
|
||||
faction_name
|
||||
).c_str()
|
||||
);
|
||||
found_count++;
|
||||
|
||||
if (found_count == 20) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 20) {
|
||||
c->Message(Chat::White, "20 Factions found... max reached.");
|
||||
}
|
||||
else {
|
||||
auto faction_message = (
|
||||
found_count > 0 ?
|
||||
(
|
||||
found_count == 1 ?
|
||||
"A Faction was" :
|
||||
fmt::format("{} Factions were", found_count)
|
||||
) :
|
||||
"No Factions were"
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} found.",
|
||||
faction_message
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,77 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_findnpctype(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Usage: #findnpctype [Search Criteria]");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string query;
|
||||
std::string search_criteria = sep->arg[1];
|
||||
if (sep->IsNumber(1)) {
|
||||
query = fmt::format(
|
||||
"SELECT id, name FROM npc_types WHERE id = {}",
|
||||
search_criteria
|
||||
);
|
||||
}
|
||||
else {
|
||||
query = fmt::format(
|
||||
"SELECT id, name FROM npc_types WHERE name LIKE '%%{}%%'",
|
||||
search_criteria
|
||||
);
|
||||
}
|
||||
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success() || !results.RowCount()) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"No matches found for '{}'.",
|
||||
search_criteria
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
int found_count = 0;
|
||||
|
||||
for (auto row : results) {
|
||||
int found_number = (found_count + 1);
|
||||
if (found_count == 20) {
|
||||
break;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"NPC {} | {} ({})",
|
||||
found_number,
|
||||
row[1],
|
||||
row[0]
|
||||
).c_str()
|
||||
);
|
||||
found_count++;
|
||||
}
|
||||
|
||||
if (found_count == 20) {
|
||||
c->Message(Chat::White, "20 NPCs were found, max reached.");
|
||||
}
|
||||
else {
|
||||
auto npc_message = (
|
||||
found_count == 1 ?
|
||||
"An NPC was" :
|
||||
fmt::format("{} NPCs were", found_count)
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} found.",
|
||||
npc_message
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_findrace(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Command Syntax: #findrace [Search Criteria]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sep->IsNumber(1)) {
|
||||
auto race_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[1]));
|
||||
std::string race_name = GetRaceIDName(race_id);
|
||||
if (
|
||||
race_id >= RACE_HUMAN_1 &&
|
||||
race_id <= RACE_PEGASUS_732
|
||||
) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Race {} | {}{}",
|
||||
race_id,
|
||||
race_name,
|
||||
(
|
||||
c->IsPlayerRace(race_id) ?
|
||||
fmt::format(
|
||||
" ({})",
|
||||
GetPlayerRaceBit(race_id)
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
} else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Race ID {} was not found.",
|
||||
race_id
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
} else {
|
||||
auto search_criteria = Strings::ToLower(sep->argplus[1]);
|
||||
int found_count = 0;
|
||||
for (uint16 race_id = RACE_HUMAN_1; race_id <= RACE_PEGASUS_732; race_id++) {
|
||||
std::string race_name = GetRaceIDName(race_id);
|
||||
auto race_name_lower = Strings::ToLower(race_name);
|
||||
if (
|
||||
search_criteria.length() &&
|
||||
race_name_lower.find(search_criteria) == std::string::npos
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Race {} | {}{}",
|
||||
race_id,
|
||||
race_name,
|
||||
(
|
||||
c->IsPlayerRace(race_id) ?
|
||||
fmt::format(
|
||||
" ({})",
|
||||
GetPlayerRaceBit(race_id)
|
||||
) :
|
||||
""
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
found_count++;
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(Chat::White, "50 Races found, max reached.");
|
||||
} else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Race{} found.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../command.h"
|
||||
#include "../../common/repositories/tradeskill_recipe_repository.h"
|
||||
|
||||
void command_findrecipe(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
if (!arguments) {
|
||||
c->Message(Chat::White, "Command Syntax: #findrecipe [Search Criteria]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sep->IsNumber(1)) {
|
||||
auto recipe_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[1]));
|
||||
auto r = TradeskillRecipeRepository::GetWhere(
|
||||
database,
|
||||
fmt::format("id = {}", recipe_id)
|
||||
);
|
||||
|
||||
if (r.empty() || !r[0].id) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Recipe ID {} could not be found.",
|
||||
Strings::Commify(std::to_string(recipe_id))
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
bool can_view_recipes = c->Admin() >= GetCommandStatus(c, "viewrecipe");
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Recipe {} | {}{}",
|
||||
Strings::Commify(std::to_string(recipe_id)),
|
||||
r[0].name,
|
||||
can_view_recipes ? fmt::format(" | {}", Saylink::Silent(fmt::format("#viewrecipe {}", r[0].id), "View")) : ""
|
||||
).c_str()
|
||||
);
|
||||
} else {
|
||||
auto search_criteria = Strings::ToLower(sep->argplus[1]);
|
||||
int found_count = 0;
|
||||
|
||||
auto rl = TradeskillRecipeRepository::GetWhere(
|
||||
database,
|
||||
fmt::format("`name` LIKE '%{}%' ORDER BY `id` ASC", search_criteria)
|
||||
);
|
||||
|
||||
if (rl.empty() || !rl[0].id) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"No recipes were found matching '{}'.",
|
||||
search_criteria
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
bool can_view_recipes = c->Admin() >= GetCommandStatus(c, "viewrecipe");
|
||||
|
||||
for (const auto& r : rl) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Recipe {} | {}{}",
|
||||
Strings::Commify(std::to_string(r.id)),
|
||||
r.name,
|
||||
can_view_recipes ? fmt::format(" | {}", Saylink::Silent(fmt::format("#viewrecipe {}", r.id), "View")) : ""
|
||||
).c_str()
|
||||
);
|
||||
|
||||
if (found_count == 50) {
|
||||
break;
|
||||
}
|
||||
|
||||
found_count++;
|
||||
}
|
||||
|
||||
if (found_count == 50) {
|
||||
c->Message(Chat::White, "50 Recipes found, max reached.");
|
||||
} else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} Recipe{} found.",
|
||||
found_count,
|
||||
found_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_findskill(Client *c, const Seperator *sep)
|
||||
{
|
||||
int arguments = sep->argnum;
|
||||
|
||||
if (arguments == 0) {
|
||||
c->Message(Chat::White, "Command Syntax: #findskill [search criteria]");
|
||||
return;
|
||||
}
|
||||
|
||||
std::map<EQ::skills::SkillType, std::string> skills = EQ::skills::GetSkillTypeMap();
|
||||
if (sep->IsNumber(1)) {
|
||||
int skill_id = Strings::ToInt(sep->arg[1]);
|
||||
if (skill_id >= EQ::skills::Skill1HBlunt && skill_id < EQ::skills::SkillCount) {
|
||||
for (auto skill : skills) {
|
||||
if (skill_id == skill.first) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Skill {}: {}",
|
||||
skill.first,
|
||||
skill.second
|
||||
).c_str()
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Skill ID {} was not found.",
|
||||
skill_id
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
|
||||
if (!search_criteria.empty()) {
|
||||
int found_count = 0;
|
||||
for (auto skill : skills) {
|
||||
std::string skill_name_lower = Strings::ToLower(skill.second);
|
||||
if (skill_name_lower.find(search_criteria) == std::string::npos) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Skill {}: {}",
|
||||
skill.first,
|
||||
skill.second
|
||||
).c_str()
|
||||
);
|
||||
found_count++;
|
||||
|
||||
if (found_count == 20) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 20) {
|
||||
c->Message(Chat::White, "20 Skills were found, max reached.");
|
||||
}
|
||||
else {
|
||||
auto skill_message = (
|
||||
found_count > 0 ?
|
||||
(
|
||||
found_count == 1 ?
|
||||
"A Skill was" :
|
||||
fmt::format("{} Skills were", found_count)
|
||||
) :
|
||||
"No Skills were"
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} found.",
|
||||
skill_message
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,90 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_findspell(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (SPDAT_RECORDS <= 0) {
|
||||
c->Message(Chat::White, "Spells not loaded");
|
||||
return;
|
||||
}
|
||||
|
||||
int arguments = sep->argnum;
|
||||
|
||||
if (arguments == 0) {
|
||||
c->Message(Chat::White, "Command Syntax: #findspell [search criteria]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sep->IsNumber(1)) {
|
||||
int spell_id = Strings::ToInt(sep->arg[1]);
|
||||
if (!IsValidSpell(spell_id)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Spell ID {} was not found.",
|
||||
spell_id
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Spell {}: {}",
|
||||
spell_id,
|
||||
spells[spell_id].name
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
|
||||
int found_count = 0;
|
||||
for (int spell_id = 0; spell_id < SPDAT_RECORDS; spell_id++) {
|
||||
auto current_spell = spells[spell_id];
|
||||
if (current_spell.name[0] != 0) {
|
||||
std::string spell_name = current_spell.name;
|
||||
std::string spell_name_lower = Strings::ToLower(spell_name);
|
||||
if (search_criteria.length() > 0 && spell_name_lower.find(search_criteria) == std::string::npos) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Spell {}: {}",
|
||||
spell_id,
|
||||
spell_name
|
||||
).c_str()
|
||||
);
|
||||
found_count++;
|
||||
|
||||
if (found_count == 20) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 20) {
|
||||
c->Message(Chat::White, "20 Spells found... max reached.");
|
||||
}
|
||||
else {
|
||||
auto spell_message = (
|
||||
found_count > 0 ?
|
||||
(
|
||||
found_count == 1 ?
|
||||
"A Spell was" :
|
||||
fmt::format("{} Spells were", found_count)
|
||||
) :
|
||||
"No Spells were"
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} found.",
|
||||
spell_message
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_findtask(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
||||
int arguments = sep->argnum;
|
||||
|
||||
if (arguments == 0) {
|
||||
c->Message(Chat::White, "Command Syntax: #findtask [search criteria]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (sep->IsNumber(1)) {
|
||||
auto task_id = Strings::ToUnsignedInt(sep->arg[1]);
|
||||
auto task_name = task_manager->GetTaskName(task_id);
|
||||
|
||||
std::string task_message = (
|
||||
!task_name.empty() ?
|
||||
fmt::format(
|
||||
"Task {}: {}",
|
||||
task_id,
|
||||
task_name
|
||||
) :
|
||||
fmt::format(
|
||||
"Task ID {} was not found.",
|
||||
task_id
|
||||
)
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
task_message.c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
std::string search_criteria = Strings::ToLower(sep->argplus[1]);
|
||||
if (!search_criteria.empty()) {
|
||||
int found_count = 0;
|
||||
for (const auto &task: task_manager->GetTaskData()) {
|
||||
auto task_name = task.second.title;
|
||||
std::string task_name_lower = Strings::ToLower(task_name);
|
||||
if (task_name_lower.find(search_criteria) == std::string::npos) {
|
||||
continue;
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Task {}: {}",
|
||||
task.first,
|
||||
task_name
|
||||
).c_str()
|
||||
);
|
||||
found_count++;
|
||||
|
||||
if (found_count == 20) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (found_count == 20) {
|
||||
c->Message(Chat::White, "20 Tasks were found, max reached.");
|
||||
}
|
||||
else {
|
||||
auto task_message = (
|
||||
found_count > 0 ?
|
||||
(
|
||||
found_count == 1 ?
|
||||
"A Task was" :
|
||||
fmt::format("{} Tasks were", found_count)
|
||||
) :
|
||||
"No Tasks were"
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} found.",
|
||||
task_message
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "This command cannot be used while the Task system is disabled.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_findzone(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->arg[1][0] == 0) {
|
||||
c->Message(Chat::White, "Usage: #findzone [search criteria]");
|
||||
c->Message(Chat::White, "Usage: #findzone expansion [expansion number]");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string query;
|
||||
int id = Strings::ToInt((const char *) sep->arg[1]);
|
||||
|
||||
std::string arg1 = sep->arg[1];
|
||||
|
||||
if (arg1 == "expansion") {
|
||||
query = fmt::format(
|
||||
"SELECT zoneidnumber, short_name, long_name, version FROM zone WHERE expansion = {}",
|
||||
sep->arg[2]
|
||||
);
|
||||
}
|
||||
else {
|
||||
|
||||
/**
|
||||
* If id evaluates to 0, then search as if user entered a string
|
||||
*/
|
||||
if (id == 0) {
|
||||
query = fmt::format(
|
||||
"SELECT zoneidnumber, short_name, long_name, version FROM zone WHERE long_name LIKE '%{}%' OR `short_name` LIKE '%{}%'",
|
||||
Strings::Escape(sep->arg[1]),
|
||||
Strings::Escape(sep->arg[1])
|
||||
);
|
||||
}
|
||||
else {
|
||||
query = fmt::format(
|
||||
"SELECT zoneidnumber, short_name, long_name, version FROM zone WHERE zoneidnumber = {}",
|
||||
id
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
auto results = content_db.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
c->Message(Chat::White, "Error querying database.");
|
||||
c->Message(Chat::White, query.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
const int maxrows = 100;
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
std::string zone_id = row[0];
|
||||
std::string short_name = row[1];
|
||||
std::string long_name = row[2];
|
||||
int version = Strings::ToInt(row[3]);
|
||||
|
||||
if (++count > maxrows) {
|
||||
c->Message(Chat::White, "%i zones shown. Too many results.", maxrows);
|
||||
break;
|
||||
}
|
||||
|
||||
std::string command_zone = Saylink::Silent("#zone " + short_name, "zone");
|
||||
std::string command_gmzone = Saylink::Silent(
|
||||
fmt::format(
|
||||
"#gmzone {} {}",
|
||||
short_name,
|
||||
version
|
||||
),
|
||||
"gmzone"
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"[{}] [{}] [{}] ID ({}) Version ({}) [{}]",
|
||||
(version == 0 ? command_zone : "zone"),
|
||||
command_gmzone,
|
||||
short_name,
|
||||
zone_id,
|
||||
version,
|
||||
long_name
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
if (count <= maxrows) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"Query complete. %i rows shown. %s",
|
||||
count,
|
||||
(arg1 == "expansion" ? "(expansion search)" : ""));
|
||||
}
|
||||
else if (count == 0) {
|
||||
c->Message(Chat::White, "No matches found for %s.", sep->arg[1]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_flags(Client *c, const Seperator *sep)
|
||||
{
|
||||
Client *target = c;
|
||||
|
||||
if (
|
||||
c->GetTarget() &&
|
||||
c->GetTarget()->IsClient() &&
|
||||
c->Admin() >= minStatusToSeeOthersZoneFlags
|
||||
) {
|
||||
target = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
target->SendZoneFlagInfo(c);
|
||||
}
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_fov(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget()) {
|
||||
c->Message(Chat::White, "You must have a target to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
auto target = c->GetTarget();
|
||||
|
||||
std::string behind_message = (
|
||||
c->BehindMob(
|
||||
target,
|
||||
c->GetX(),
|
||||
c->GetY()
|
||||
) ?
|
||||
"behind" :
|
||||
"not behind"
|
||||
);
|
||||
|
||||
std::string gender_message = (
|
||||
target->GetGender() == MALE ?
|
||||
"he" :
|
||||
(
|
||||
target->GetGender() == FEMALE ?
|
||||
"she" :
|
||||
"it"
|
||||
)
|
||||
);
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"You are {} {}, {} has a heading of {}.",
|
||||
behind_message,
|
||||
c->GetTargetDescription(target),
|
||||
gender_message,
|
||||
target->GetHeading()
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../corpse.h"
|
||||
|
||||
void command_getplayerburiedcorpsecount(Client *c, const Seperator *sep)
|
||||
{
|
||||
Client *target = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) {
|
||||
target = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
uint32 corpse_count = database.GetCharacterBuriedCorpseCount(target->CharacterID());
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} {} buried corpse{}.",
|
||||
c->GetTargetDescription(target, TargetDescriptionType::UCYou),
|
||||
c == target ? "have" : "has",
|
||||
(
|
||||
corpse_count ?
|
||||
std::to_string(corpse_count) :
|
||||
"no"
|
||||
),
|
||||
corpse_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_getvariable(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::string variable = sep->argplus[1];
|
||||
if (variable.empty()) {
|
||||
c->Message(Chat::White, "Usage: #getvariable [Variable Name]");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string message;
|
||||
std::string value;
|
||||
if (database.GetVariable(variable, value)) {
|
||||
message = fmt::format(
|
||||
"Variable {}: {}",
|
||||
variable,
|
||||
value
|
||||
);
|
||||
} else {
|
||||
message = fmt::format(
|
||||
"Variable '{}' does not exist.",
|
||||
variable
|
||||
);
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
message.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../groups.h"
|
||||
|
||||
void command_ginfo(Client *c, const Seperator *sep)
|
||||
{
|
||||
Client *target = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
target = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
auto target_group = target->GetGroup();
|
||||
if (!target_group) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} not in a group.",
|
||||
c->GetTargetDescription(target, TargetDescriptionType::UCYou),
|
||||
c == target ? "are" : "is"
|
||||
).c_str()
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
std::string popup_title = fmt::format(
|
||||
"Group Info for {}",
|
||||
c->GetTargetDescription(target, TargetDescriptionType::UCSelf)
|
||||
);
|
||||
std::string popup_text = "<table>";
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Group ID</td><td>{}</td><td>Members</td><td>{}</td>",
|
||||
target_group->GetID(),
|
||||
target_group->GroupCount()
|
||||
);
|
||||
popup_text += "<br><br>";
|
||||
popup_text += "<tr>";
|
||||
popup_text += "<td>Index</td>";
|
||||
popup_text += "<td>Name</td>";
|
||||
popup_text += "<td>In Zone</td>";
|
||||
popup_text += "<td>Assist</td>";
|
||||
popup_text += "<td>Puller</td>";
|
||||
popup_text += "<td>Tank</td>";
|
||||
popup_text += "</tr>";
|
||||
|
||||
for (int group_member = 0; group_member < MAX_GROUP_MEMBERS; group_member++) {
|
||||
if (target_group->membername[group_member][0] == '\0') {
|
||||
continue;
|
||||
}
|
||||
|
||||
bool is_assist = target_group->MemberRoles[group_member] & RoleAssist;
|
||||
bool is_puller = target_group->MemberRoles[group_member] & RolePuller;
|
||||
bool is_tank = target_group->MemberRoles[group_member] & RoleTank;
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td><td>{}</td></tr>",
|
||||
group_member,
|
||||
(
|
||||
strcmp(target_group->membername[group_member], c->GetCleanName()) ?
|
||||
target_group->membername[group_member] :
|
||||
fmt::format(
|
||||
"{} (You)",
|
||||
target_group->membername[group_member]
|
||||
)
|
||||
),
|
||||
target_group->members[group_member] ? "<c \"#00FF00\">Y</c>" : "<c \"#F62217\">N</c>",
|
||||
is_assist ? "<c \"#00FF00\">Y</c>" : "<c \"#F62217\">N</c>",
|
||||
is_puller ? "<c \"#00FF00\">Y</c>" : "<c \"#F62217\">N</c>",
|
||||
is_tank ? "<c \"#00FF00\">Y</c>" : "<c \"#F62217\">N</c>"
|
||||
);
|
||||
}
|
||||
|
||||
popup_text += "</table>";
|
||||
|
||||
c->SendPopupToClient(
|
||||
popup_title.c_str(),
|
||||
popup_text.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_globalview(Client *c, const Seperator *sep)
|
||||
{
|
||||
NPC *npcmob = nullptr;
|
||||
|
||||
if (c->GetTarget() && c->GetTarget()->IsNPC()) {
|
||||
npcmob = c->GetTarget()->CastToNPC();
|
||||
QGlobalCache *npc_c = nullptr;
|
||||
QGlobalCache *char_c = nullptr;
|
||||
QGlobalCache *zone_c = nullptr;
|
||||
|
||||
if (npcmob) {
|
||||
npc_c = npcmob->GetQGlobals();
|
||||
}
|
||||
|
||||
char_c = c->GetQGlobals();
|
||||
zone_c = zone->GetQGlobals();
|
||||
|
||||
std::list<QGlobal> globalMap;
|
||||
uint32 ntype = 0;
|
||||
|
||||
if (npcmob) {
|
||||
ntype = npcmob->GetNPCTypeID();
|
||||
}
|
||||
|
||||
if (npc_c) {
|
||||
QGlobalCache::Combine(globalMap, npc_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
|
||||
}
|
||||
|
||||
if (char_c) {
|
||||
QGlobalCache::Combine(globalMap, char_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
|
||||
}
|
||||
|
||||
if (zone_c) {
|
||||
QGlobalCache::Combine(globalMap, zone_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
|
||||
}
|
||||
|
||||
auto iter = globalMap.begin();
|
||||
uint32 gcount = 0;
|
||||
|
||||
c->Message(Chat::White, "Name, Value");
|
||||
while (iter != globalMap.end()) {
|
||||
c->Message(Chat::White, "%s %s", (*iter).name.c_str(), (*iter).value.c_str());
|
||||
++iter;
|
||||
++gcount;
|
||||
}
|
||||
c->Message(Chat::White, "%u globals loaded.", gcount);
|
||||
}
|
||||
else {
|
||||
QGlobalCache *char_c = nullptr;
|
||||
QGlobalCache *zone_c = nullptr;
|
||||
|
||||
char_c = c->GetQGlobals();
|
||||
zone_c = zone->GetQGlobals();
|
||||
|
||||
std::list<QGlobal> globalMap;
|
||||
uint32 ntype = 0;
|
||||
|
||||
if (char_c) {
|
||||
QGlobalCache::Combine(globalMap, char_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
|
||||
}
|
||||
|
||||
if (zone_c) {
|
||||
QGlobalCache::Combine(globalMap, zone_c->GetBucket(), ntype, c->CharacterID(), zone->GetZoneID());
|
||||
}
|
||||
|
||||
auto iter = globalMap.begin();
|
||||
uint32 gcount = 0;
|
||||
|
||||
c->Message(Chat::White, "Name, Value");
|
||||
while (iter != globalMap.end()) {
|
||||
c->Message(Chat::White, "%s %s", (*iter).name.c_str(), (*iter).value.c_str());
|
||||
++iter;
|
||||
++gcount;
|
||||
}
|
||||
c->Message(Chat::White, "%u globals loaded.", gcount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../worldserver.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void command_iplookup(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto pack =
|
||||
new ServerPacket(
|
||||
ServerOP_IPLookup,
|
||||
sizeof(ServerGenericWorldQuery_Struct) +
|
||||
strlen(sep->argplus[1]) + 1
|
||||
);
|
||||
ServerGenericWorldQuery_Struct *s = (ServerGenericWorldQuery_Struct *) pack->pBuffer;
|
||||
strcpy(s->from, c->GetName());
|
||||
s->admin = c->Admin();
|
||||
if (sep->argplus[1][0] != 0) {
|
||||
strcpy(s->query, sep->argplus[1]);
|
||||
}
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_itemsearch(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->arg[1][0] == 0) {
|
||||
c->Message(Chat::White, "Usage: #itemsearch [search string]");
|
||||
}
|
||||
else {
|
||||
const char *search_criteria = sep->argplus[1];
|
||||
|
||||
const EQ::ItemData *item = nullptr;
|
||||
EQ::SayLinkEngine linker;
|
||||
linker.SetLinkType(EQ::saylink::SayLinkItemData);
|
||||
|
||||
if (Seperator::IsNumber(search_criteria)) {
|
||||
item = database.GetItem(Strings::ToInt(search_criteria));
|
||||
if (item) {
|
||||
linker.SetItemData(item);
|
||||
std::string item_id = std::to_string(item->ID);
|
||||
std::string saylink_commands =
|
||||
"[" +
|
||||
Saylink::Silent(
|
||||
"#si " + item_id,
|
||||
"X"
|
||||
) +
|
||||
"] ";
|
||||
|
||||
if (item->Stackable && item->StackSize > 1) {
|
||||
std::string stack_size = std::to_string(item->StackSize);
|
||||
saylink_commands +=
|
||||
"[" +
|
||||
Saylink::Silent(
|
||||
"#si " + item_id + " " + stack_size,
|
||||
stack_size
|
||||
) +
|
||||
"]";
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
" Summon {} [{}] [{}]",
|
||||
saylink_commands,
|
||||
linker.GenerateLink(),
|
||||
item->ID
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
else {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Item {} not found",
|
||||
search_criteria
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
char sName[64];
|
||||
char sCriteria[255];
|
||||
strn0cpy(sCriteria, search_criteria, sizeof(sCriteria));
|
||||
strupr(sCriteria);
|
||||
char *pdest;
|
||||
uint32 it = 0;
|
||||
while ((item = database.IterateItems(&it))) {
|
||||
strn0cpy(sName, item->Name, sizeof(sName));
|
||||
strupr(sName);
|
||||
pdest = strstr(sName, sCriteria);
|
||||
if (pdest != nullptr) {
|
||||
linker.SetItemData(item);
|
||||
std::string item_id = std::to_string(item->ID);
|
||||
std::string saylink_commands =
|
||||
"[" +
|
||||
Saylink::Silent(
|
||||
"#si " + item_id,
|
||||
"X"
|
||||
) +
|
||||
"] ";
|
||||
if (item->Stackable && item->StackSize > 1) {
|
||||
std::string stack_size = std::to_string(item->StackSize);
|
||||
saylink_commands +=
|
||||
"[" +
|
||||
Saylink::Silent(
|
||||
"#si " + item_id + " " + stack_size,
|
||||
stack_size
|
||||
) +
|
||||
"]";
|
||||
}
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
" Summon {} [{}] [{}]",
|
||||
saylink_commands,
|
||||
linker.GenerateLink(),
|
||||
item->ID
|
||||
).c_str()
|
||||
);
|
||||
|
||||
++count;
|
||||
}
|
||||
|
||||
if (count == 50) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (count == 50) {
|
||||
c->Message(Chat::White, "50 items shown...too many results.");
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "%i items found", count);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_listpetition(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::string query = "SELECT petid, charname, accountname FROM petitions ORDER BY petid";
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return;
|
||||
}
|
||||
|
||||
LogInfo("Petition list requested by [{}]", c->GetName());
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
c->Message(Chat::Red, " ID : Character Name , Account Name");
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row)
|
||||
c->Message(Chat::Yellow, " %s: %s , %s ", row[0], row[1], row[2]);
|
||||
}
|
||||
|
||||
@@ -2,16 +2,19 @@
|
||||
|
||||
void command_mystats(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (c->GetTarget() && c->GetPet()) {
|
||||
if (c->GetTarget()->IsPet() && c->GetTarget() == c->GetPet()) {
|
||||
c->GetTarget()->ShowStats(c);
|
||||
}
|
||||
else {
|
||||
c->ShowStats(c);
|
||||
}
|
||||
Mob* t = c;
|
||||
if (c->GetTarget()) {
|
||||
t = c->GetTarget();
|
||||
}
|
||||
else {
|
||||
c->ShowStats(c);
|
||||
|
||||
if (
|
||||
(t->IsPet() && t == c->GetPet()) ||
|
||||
(t->IsBot() && t->CastToBot()->GetOwner() && t->CastToBot()->GetOwner() == c)
|
||||
) {
|
||||
t->ShowStats(c);
|
||||
return;
|
||||
}
|
||||
|
||||
c->ShowStats(c);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,169 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_netstats(Client *c, const Seperator *sep)
|
||||
{
|
||||
bool is_full = !strcasecmp(sep->arg[1], "full");
|
||||
bool is_reset = !strcasecmp(sep->arg[1], "reset");
|
||||
|
||||
if (is_reset) {
|
||||
auto connection = c->Connection();
|
||||
c->Message(Chat::White, "Resetting client stats (packet loss will not read correctly after reset).");
|
||||
connection->ResetStats();
|
||||
return;
|
||||
}
|
||||
|
||||
auto connection = c->Connection();
|
||||
auto opts = connection->GetManager()->GetOptions();
|
||||
auto eqs_stats = connection->GetStats();
|
||||
auto &stats = eqs_stats.DaybreakStats;
|
||||
auto now = EQ::Net::Clock::now();
|
||||
auto sec_since_stats_reset = std::chrono::duration_cast<std::chrono::duration<double>>(
|
||||
now - stats.created
|
||||
).count();
|
||||
|
||||
std::string popup_text = "<table>";
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Sent Bytes</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.sent_bytes,
|
||||
stats.sent_bytes / sec_since_stats_reset
|
||||
);
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Received Bytes</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.recv_bytes,
|
||||
stats.recv_bytes / sec_since_stats_reset
|
||||
);
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Bytes Before Encode (Sent)</td><td>{}</td><td>Compression Rate</td><td>{:.2f}%%</td></tr>",
|
||||
stats.bytes_before_encode,
|
||||
static_cast<double>(stats.bytes_before_encode - stats.sent_bytes) /
|
||||
static_cast<double>(stats.bytes_before_encode) * 100.0
|
||||
);
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Bytes After Decode (Received)</td><td>{}</td><td>Compression Rate</td><td>{:.2f}%%</td></tr>",
|
||||
stats.bytes_after_decode,
|
||||
static_cast<double>(stats.bytes_after_decode - stats.recv_bytes) /
|
||||
static_cast<double>(stats.bytes_after_decode) * 100.0
|
||||
);
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += fmt::format("<tr><td>Min Ping</td><td>{}</td></tr>", stats.min_ping);
|
||||
popup_text += fmt::format("<tr><td>Max Ping</td><td>{}</td></tr>", stats.max_ping);
|
||||
popup_text += fmt::format("<tr><td>Last Ping</td><td>{}</td></tr>", stats.last_ping);
|
||||
popup_text += fmt::format("<tr><td>Average Ping</td><td>{}</td></tr>", stats.avg_ping);
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>(Realtime) Received Packets</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.recv_packets,
|
||||
stats.recv_packets / sec_since_stats_reset
|
||||
);
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>(Realtime) Sent Packets</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.sent_packets,
|
||||
stats.sent_packets / sec_since_stats_reset
|
||||
);
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += fmt::format("<tr><td>(Sync) Received Packets</td><td>{}</td></tr>", stats.sync_recv_packets);
|
||||
popup_text += fmt::format("<tr><td>(Sync) Sent Packets</td><td>{}</td></tr>", stats.sync_sent_packets);
|
||||
popup_text += fmt::format("<tr><td>(Sync) Remote Received Packets</td><td>{}</td></tr>", stats.sync_remote_recv_packets);
|
||||
popup_text += fmt::format("<tr><td>(Sync) Remote Sent Packets</td><td>{}</td></tr>", stats.sync_remote_sent_packets);
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Packet Loss In</td><td>{:.2f}%%</td></tr>",
|
||||
(100.0 * (1.0 - static_cast<double>(stats.sync_recv_packets) / static_cast<double>(stats.sync_remote_sent_packets)))
|
||||
);
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Packet Loss Out</td><td>{:.2f}%%</td></tr>",
|
||||
(100.0 * (1.0 - static_cast<double>(stats.sync_remote_recv_packets) / static_cast<double>(stats.sync_sent_packets)))
|
||||
);
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Resent Packets</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.resent_packets,
|
||||
stats.resent_packets / sec_since_stats_reset
|
||||
);
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Resent Fragments</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.resent_fragments,
|
||||
stats.resent_fragments / sec_since_stats_reset
|
||||
);
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Resent Non-Fragments</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.resent_full,
|
||||
stats.resent_full / sec_since_stats_reset
|
||||
);
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Dropped Datarate Packets</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
stats.dropped_datarate_packets,
|
||||
stats.dropped_datarate_packets / sec_since_stats_reset
|
||||
);
|
||||
|
||||
if (opts.daybreak_options.outgoing_data_rate > 0.0) {
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>Outgoing Link Saturation</td><td>{:.2f}%% ({:.2f}kb Per Second)</td></tr>",
|
||||
(100.0 * (1.0 - ((opts.daybreak_options.outgoing_data_rate - stats.datarate_remaining) / opts.daybreak_options.outgoing_data_rate))),
|
||||
opts.daybreak_options.outgoing_data_rate
|
||||
);
|
||||
}
|
||||
|
||||
if (is_full) {
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += "<tr><td>Sent Packet Types</td></tr>";
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto cnt = eqs_stats.SentCount[i];
|
||||
if (cnt > 0) {
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>{}</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
OpcodeNames[i],
|
||||
cnt,
|
||||
cnt / sec_since_stats_reset
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
popup_text += "<br><br>";
|
||||
|
||||
popup_text += "<tr><td>Received Packet Types</td></tr>";
|
||||
for (auto i = 0; i < _maxEmuOpcode; ++i) {
|
||||
auto cnt = eqs_stats.RecvCount[i];
|
||||
if (cnt > 0) {
|
||||
popup_text += fmt::format(
|
||||
"<tr><td>{}</td><td>{} ({:.2f} Per Second)</td></tr>",
|
||||
OpcodeNames[i],
|
||||
cnt,
|
||||
cnt / sec_since_stats_reset
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
popup_text += "</table>";
|
||||
|
||||
c->SendPopupToClient(
|
||||
"Network Statistics",
|
||||
popup_text.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,175 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_network(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!strcasecmp(sep->arg[1], "getopt")) {
|
||||
auto eqsi = c->Connection();
|
||||
auto manager = eqsi->GetManager();
|
||||
auto opts = manager->GetOptions();
|
||||
|
||||
if (!strcasecmp(sep->arg[2], "all")) {
|
||||
c->Message(Chat::White, "max_packet_size: %llu", (uint64_t) opts.daybreak_options.max_packet_size);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"max_connection_count: %llu",
|
||||
(uint64_t) opts.daybreak_options.max_connection_count
|
||||
);
|
||||
c->Message(Chat::White, "keepalive_delay_ms: %llu", (uint64_t) opts.daybreak_options.keepalive_delay_ms);
|
||||
c->Message(Chat::White, "resend_delay_factor: %.2f", opts.daybreak_options.resend_delay_factor);
|
||||
c->Message(Chat::White, "resend_delay_ms: %llu", (uint64_t) opts.daybreak_options.resend_delay_ms);
|
||||
c->Message(Chat::White, "resend_delay_min: %llu", (uint64_t) opts.daybreak_options.resend_delay_min);
|
||||
c->Message(Chat::White, "resend_delay_max: %llu", (uint64_t) opts.daybreak_options.resend_delay_max);
|
||||
c->Message(Chat::White, "connect_delay_ms: %llu", (uint64_t) opts.daybreak_options.connect_delay_ms);
|
||||
c->Message(Chat::White, "connect_stale_ms: %llu", (uint64_t) opts.daybreak_options.connect_stale_ms);
|
||||
c->Message(Chat::White, "stale_connection_ms: %llu", (uint64_t) opts.daybreak_options.stale_connection_ms);
|
||||
c->Message(Chat::White, "crc_length: %llu", (uint64_t) opts.daybreak_options.crc_length);
|
||||
c->Message(Chat::White, "hold_size: %llu", (uint64_t) opts.daybreak_options.hold_size);
|
||||
c->Message(Chat::White, "hold_length_ms: %llu", (uint64_t) opts.daybreak_options.hold_length_ms);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"simulated_in_packet_loss: %llu",
|
||||
(uint64_t) opts.daybreak_options.simulated_in_packet_loss
|
||||
);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"simulated_out_packet_loss: %llu",
|
||||
(uint64_t) opts.daybreak_options.simulated_out_packet_loss
|
||||
);
|
||||
c->Message(Chat::White, "tic_rate_hertz: %.2f", opts.daybreak_options.tic_rate_hertz);
|
||||
c->Message(Chat::White, "resend_timeout: %llu", (uint64_t) opts.daybreak_options.resend_timeout);
|
||||
c->Message(
|
||||
Chat::White,
|
||||
"connection_close_time: %llu",
|
||||
(uint64_t) opts.daybreak_options.connection_close_time
|
||||
);
|
||||
c->Message(Chat::White, "encode_passes[0]: %llu", (uint64_t) opts.daybreak_options.encode_passes[0]);
|
||||
c->Message(Chat::White, "encode_passes[1]: %llu", (uint64_t) opts.daybreak_options.encode_passes[1]);
|
||||
c->Message(Chat::White, "port: %llu", (uint64_t) opts.daybreak_options.port);
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Unknown get option: %s", sep->arg[2]);
|
||||
c->Message(Chat::White, "Available options:");
|
||||
//Todo the rest of these when im less lazy.
|
||||
//c->Message(Chat::White, "max_packet_size");
|
||||
//c->Message(Chat::White, "max_connection_count");
|
||||
//c->Message(Chat::White, "keepalive_delay_ms");
|
||||
//c->Message(Chat::White, "resend_delay_factor");
|
||||
//c->Message(Chat::White, "resend_delay_ms");
|
||||
//c->Message(Chat::White, "resend_delay_min");
|
||||
//c->Message(Chat::White, "resend_delay_max");
|
||||
//c->Message(Chat::White, "connect_delay_ms");
|
||||
//c->Message(Chat::White, "connect_stale_ms");
|
||||
//c->Message(Chat::White, "stale_connection_ms");
|
||||
//c->Message(Chat::White, "crc_length");
|
||||
//c->Message(Chat::White, "hold_size");
|
||||
//c->Message(Chat::White, "hold_length_ms");
|
||||
//c->Message(Chat::White, "simulated_in_packet_loss");
|
||||
//c->Message(Chat::White, "simulated_out_packet_loss");
|
||||
//c->Message(Chat::White, "tic_rate_hertz");
|
||||
//c->Message(Chat::White, "resend_timeout");
|
||||
//c->Message(Chat::White, "connection_close_time");
|
||||
//c->Message(Chat::White, "encode_passes[0]");
|
||||
//c->Message(Chat::White, "encode_passes[1]");
|
||||
//c->Message(Chat::White, "port");
|
||||
c->Message(Chat::White, "all");
|
||||
}
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[1], "setopt")) {
|
||||
auto eqsi = c->Connection();
|
||||
auto manager = eqsi->GetManager();
|
||||
auto opts = manager->GetOptions();
|
||||
|
||||
if (!strcasecmp(sep->arg[3], "")) {
|
||||
c->Message(Chat::White, "Missing value for set");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string value = sep->arg[3];
|
||||
if (!strcasecmp(sep->arg[2], "max_connection_count")) {
|
||||
opts.daybreak_options.max_connection_count = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "keepalive_delay_ms")) {
|
||||
opts.daybreak_options.keepalive_delay_ms = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_delay_factor")) {
|
||||
opts.daybreak_options.resend_delay_factor = std::stod(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_delay_ms")) {
|
||||
opts.daybreak_options.resend_delay_ms = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_delay_min")) {
|
||||
opts.daybreak_options.resend_delay_min = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_delay_max")) {
|
||||
opts.daybreak_options.resend_delay_max = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "connect_delay_ms")) {
|
||||
opts.daybreak_options.connect_delay_ms = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "connect_stale_ms")) {
|
||||
opts.daybreak_options.connect_stale_ms = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "stale_connection_ms")) {
|
||||
opts.daybreak_options.stale_connection_ms = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "hold_size")) {
|
||||
opts.daybreak_options.hold_size = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "hold_length_ms")) {
|
||||
opts.daybreak_options.hold_length_ms = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "simulated_in_packet_loss")) {
|
||||
opts.daybreak_options.simulated_in_packet_loss = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "simulated_out_packet_loss")) {
|
||||
opts.daybreak_options.simulated_out_packet_loss = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "resend_timeout")) {
|
||||
opts.daybreak_options.resend_timeout = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else if (!strcasecmp(sep->arg[2], "connection_close_time")) {
|
||||
opts.daybreak_options.connection_close_time = Strings::ToUnsignedBigInt(value);
|
||||
manager->SetOptions(opts);
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Unknown set option: %s", sep->arg[2]);
|
||||
c->Message(Chat::White, "Available options:");
|
||||
c->Message(Chat::White, "max_connection_count");
|
||||
c->Message(Chat::White, "keepalive_delay_ms");
|
||||
c->Message(Chat::White, "resend_delay_factor");
|
||||
c->Message(Chat::White, "resend_delay_ms");
|
||||
c->Message(Chat::White, "resend_delay_min");
|
||||
c->Message(Chat::White, "resend_delay_max");
|
||||
c->Message(Chat::White, "connect_delay_ms");
|
||||
c->Message(Chat::White, "connect_stale_ms");
|
||||
c->Message(Chat::White, "stale_connection_ms");
|
||||
c->Message(Chat::White, "hold_size");
|
||||
c->Message(Chat::White, "hold_length_ms");
|
||||
c->Message(Chat::White, "simulated_in_packet_loss");
|
||||
c->Message(Chat::White, "simulated_out_packet_loss");
|
||||
c->Message(Chat::White, "resend_timeout");
|
||||
c->Message(Chat::White, "connection_close_time");
|
||||
}
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "Unknown command: %s", sep->arg[1]);
|
||||
c->Message(Chat::White, "Network commands avail:");
|
||||
c->Message(Chat::White, "getopt optname - Retrieve the current option value set.");
|
||||
c->Message(Chat::White, "setopt optname - Set the current option allowed.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_npcstats(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (c->GetTarget() && c->GetTarget()->IsNPC()) {
|
||||
NPC *target = c->GetTarget()->CastToNPC();
|
||||
|
||||
// Stats
|
||||
target->ShowStats(c);
|
||||
|
||||
// Loot Data
|
||||
target->QueryLoot(c);
|
||||
}
|
||||
else {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_peqzone_flags(Client *c, const Seperator *sep)
|
||||
{
|
||||
Client *target = c;
|
||||
|
||||
if (
|
||||
c->GetTarget() &&
|
||||
c->GetTarget()->IsClient() &&
|
||||
c->Admin() >= minStatusToSeeOthersZoneFlags
|
||||
) {
|
||||
target = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
target->SendPEQZoneFlagInfo(c);
|
||||
}
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_petitioninfo(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (sep->arg[1][0] == 0) {
|
||||
c->Message(Chat::White, "Usage: #petitioninfo (petition number) Type #listpetition for a list");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string query = "SELECT petid, charname, accountname, zone, charclass, charrace, charlevel FROM petitions ORDER BY petid";
|
||||
auto results = database.QueryDatabase(query);
|
||||
if (!results.Success()) {
|
||||
return;
|
||||
}
|
||||
|
||||
LogInfo("Petition information request from [{}], petition number:", c->GetName(), Strings::ToInt(sep->argplus[1]));
|
||||
|
||||
if (results.RowCount() == 0) {
|
||||
c->Message(Chat::Red, "There was an error in your request: ID not found! Please check the Id and try again.");
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row)
|
||||
if (strcasecmp(row[0], sep->argplus[1]) == 0) {
|
||||
c->Message(
|
||||
Chat::Red,
|
||||
" ID : %s Character Name: %s Account Name: %s Zone: %s Character Class: %s Character Race: %s Character Level: %s",
|
||||
row[0],
|
||||
row[1],
|
||||
row[2],
|
||||
row[3],
|
||||
row[4],
|
||||
row[5],
|
||||
row[6]
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,74 +0,0 @@
|
||||
#include "../client.h"
|
||||
|
||||
void command_proximity(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || (c->GetTarget() && !c->GetTarget()->IsNPC())) {
|
||||
c->Message(Chat::White, "You must target an NPC");
|
||||
return;
|
||||
}
|
||||
|
||||
for (auto &iter : entity_list.GetNPCList()) {
|
||||
auto npc = iter.second;
|
||||
std::string name = npc->GetName();
|
||||
|
||||
if (name.find("Proximity") != std::string::npos) {
|
||||
npc->Depop();
|
||||
}
|
||||
}
|
||||
|
||||
NPC *npc = c->GetTarget()->CastToNPC();
|
||||
|
||||
std::vector<FindPerson_Point> points;
|
||||
|
||||
FindPerson_Point p{};
|
||||
|
||||
if (npc->IsProximitySet()) {
|
||||
glm::vec4 position;
|
||||
position.w = npc->GetHeading();
|
||||
position.x = npc->GetProximityMinX();
|
||||
position.y = npc->GetProximityMinY();
|
||||
position.z = npc->GetZ();
|
||||
|
||||
position.x = npc->GetProximityMinX();
|
||||
position.y = npc->GetProximityMinY();
|
||||
NPC::SpawnNodeNPC("Proximity", "", position);
|
||||
|
||||
position.x = npc->GetProximityMinX();
|
||||
position.y = npc->GetProximityMaxY();
|
||||
NPC::SpawnNodeNPC("Proximity", "", position);
|
||||
|
||||
position.x = npc->GetProximityMaxX();
|
||||
position.y = npc->GetProximityMinY();
|
||||
NPC::SpawnNodeNPC("Proximity", "", position);
|
||||
|
||||
position.x = npc->GetProximityMaxX();
|
||||
position.y = npc->GetProximityMaxY();
|
||||
NPC::SpawnNodeNPC("Proximity", "", position);
|
||||
|
||||
p.x = npc->GetProximityMinX();
|
||||
p.y = npc->GetProximityMinY();
|
||||
p.z = npc->GetZ();
|
||||
points.push_back(p);
|
||||
|
||||
p.x = npc->GetProximityMinX();
|
||||
p.y = npc->GetProximityMaxY();
|
||||
points.push_back(p);
|
||||
|
||||
p.x = npc->GetProximityMaxX();
|
||||
p.y = npc->GetProximityMaxY();
|
||||
points.push_back(p);
|
||||
|
||||
p.x = npc->GetProximityMaxX();
|
||||
p.y = npc->GetProximityMinY();
|
||||
points.push_back(p);
|
||||
|
||||
p.x = npc->GetProximityMinX();
|
||||
p.y = npc->GetProximityMinY();
|
||||
points.push_back(p);
|
||||
}
|
||||
|
||||
if (c->ClientVersion() >= EQ::versions::ClientVersion::RoF) {
|
||||
c->SendPathPacket(points);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../quest_parser_collection.h"
|
||||
|
||||
void command_questerrors(Client *c, const Seperator *sep)
|
||||
{
|
||||
std::list<std::string> quest_errors;
|
||||
parse->GetErrors(quest_errors);
|
||||
|
||||
if (quest_errors.size()) {
|
||||
c->Message(Chat::White, "Quest errors currently are as follows:");
|
||||
|
||||
int error_index = 0;
|
||||
for (auto quest_error : quest_errors) {
|
||||
if (error_index >= RuleI(World, MaximumQuestErrors)) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"Maximum of {} error{} shown.",
|
||||
RuleI(World, MaximumQuestErrors),
|
||||
RuleI(World, MaximumQuestErrors) != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
c->Message(Chat::White, quest_error.c_str());
|
||||
error_index++;
|
||||
}
|
||||
} else {
|
||||
c->Message(Chat::White, "There are no Quest errors currently.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
#include "../client.h"
|
||||
#include "../dialogue_window.h"
|
||||
#include "../../common/serverinfo.h"
|
||||
|
||||
void command_serverinfo(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto os = EQ::GetOS();
|
||||
auto cpus = EQ::GetCPUs();
|
||||
auto process_id = EQ::GetPID();
|
||||
auto rss = EQ::GetRSS() / 1048576.0;
|
||||
auto uptime = static_cast<uint32>(EQ::GetUptime());
|
||||
|
||||
std::string popup_table;
|
||||
auto popup_text = DialogueWindow::CenterMessage(
|
||||
DialogueWindow::ColorMessage("green", "Operating System Information")
|
||||
);
|
||||
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Machine") +
|
||||
DialogueWindow::TableCell(os.machine)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("System") +
|
||||
DialogueWindow::TableCell(os.sysname)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Release") +
|
||||
DialogueWindow::TableCell(os.release)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Uptime") +
|
||||
DialogueWindow::TableCell(Strings::SecondsToTime(uptime))
|
||||
).c_str()
|
||||
);
|
||||
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Version") +
|
||||
DialogueWindow::TableCell(os.version)
|
||||
).c_str()
|
||||
);
|
||||
|
||||
popup_text.append(DialogueWindow::Table(popup_table));
|
||||
|
||||
popup_table = std::string();
|
||||
|
||||
popup_text.append(DialogueWindow::Break());
|
||||
|
||||
popup_text.append(
|
||||
DialogueWindow::CenterMessage(
|
||||
DialogueWindow::ColorMessage("green", "CPU Information")
|
||||
)
|
||||
);
|
||||
|
||||
for (size_t cpu = 0; cpu < cpus.size(); ++cpu) {
|
||||
auto ¤t_cpu = cpus[cpu];
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"CPU {}",
|
||||
cpu
|
||||
)
|
||||
) +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{} ({:.2f}GHz)",
|
||||
current_cpu.model,
|
||||
current_cpu.speed
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
popup_text.append(DialogueWindow::Table(popup_table));
|
||||
|
||||
popup_table = std::string();
|
||||
|
||||
popup_text.append(DialogueWindow::Break());
|
||||
|
||||
popup_text.append(
|
||||
DialogueWindow::CenterMessage(
|
||||
DialogueWindow::ColorMessage("green", "CPU Information")
|
||||
)
|
||||
);
|
||||
|
||||
popup_text.append("<table>");
|
||||
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Process ID") +
|
||||
DialogueWindow::TableCell(std::to_string(process_id))
|
||||
)
|
||||
);
|
||||
|
||||
popup_table.append(
|
||||
DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("RSS") +
|
||||
DialogueWindow::TableCell(
|
||||
fmt::format(
|
||||
"{:.2f} MB",
|
||||
rss
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
popup_text.append(DialogueWindow::Table(popup_table));
|
||||
|
||||
c->SendPopupToClient(
|
||||
"Server Information",
|
||||
popup_text.c_str()
|
||||
);
|
||||
}
|
||||
|
||||
Executable
+142
@@ -0,0 +1,142 @@
|
||||
#include "../client.h"
|
||||
#include "show/aggro.cpp"
|
||||
#include "show/buffs.cpp"
|
||||
#include "show/buried_corpse_count.cpp"
|
||||
#include "show/client_version_summary.cpp"
|
||||
#include "show/currencies.cpp"
|
||||
#include "show/distance.cpp"
|
||||
#include "show/emotes.cpp"
|
||||
#include "show/field_of_view.cpp"
|
||||
#include "show/flags.cpp"
|
||||
#include "show/group_info.cpp"
|
||||
#include "show/hatelist.cpp"
|
||||
#include "show/inventory.cpp"
|
||||
#include "show/ip_lookup.cpp"
|
||||
#include "show/line_of_sight.cpp"
|
||||
#include "show/network.cpp"
|
||||
#include "show/network_stats.cpp"
|
||||
#include "show/npc_global_loot.cpp"
|
||||
#include "show/npc_stats.cpp"
|
||||
#include "show/npc_type.cpp"
|
||||
#include "show/peqzone_flags.cpp"
|
||||
#include "show/petition.cpp"
|
||||
#include "show/petition_info.cpp"
|
||||
#include "show/proximity.cpp"
|
||||
#include "show/quest_errors.cpp"
|
||||
#include "show/quest_globals.cpp"
|
||||
#include "show/recipe.cpp"
|
||||
#include "show/server_info.cpp"
|
||||
#include "show/skills.cpp"
|
||||
#include "show/spawn_status.cpp"
|
||||
#include "show/spells.cpp"
|
||||
#include "show/spells_list.cpp"
|
||||
#include "show/stats.cpp"
|
||||
#include "show/timers.cpp"
|
||||
#include "show/traps.cpp"
|
||||
#include "show/uptime.cpp"
|
||||
#include "show/variable.cpp"
|
||||
#include "show/version.cpp"
|
||||
#include "show/waypoints.cpp"
|
||||
#include "show/who.cpp"
|
||||
#include "show/xtargets.cpp"
|
||||
#include "show/zone_data.cpp"
|
||||
#include "show/zone_global_loot.cpp"
|
||||
#include "show/zone_loot.cpp"
|
||||
#include "show/zone_points.cpp"
|
||||
#include "show/zone_status.cpp"
|
||||
|
||||
void command_show(Client *c, const Seperator *sep)
|
||||
{
|
||||
struct Cmd {
|
||||
std::string cmd{}; // command
|
||||
std::string u{}; // usage
|
||||
void (*fn)(Client *c, const Seperator *sep) = nullptr; // function
|
||||
std::vector<std::string> a{}; // aliases
|
||||
};
|
||||
|
||||
std::vector<Cmd> commands = {
|
||||
Cmd{.cmd = "aggro", .u = "aggro [Distance] [-v] (-v is verbose Faction Information)", .fn = ShowAggro, .a = {"#aggro"}},
|
||||
Cmd{.cmd = "buffs", .u = "buffs", .fn = ShowBuffs, .a = {"#showbuffs"}},
|
||||
Cmd{.cmd = "buried_corpse_count", .u = "buried_corpse_count", .fn = ShowBuriedCorpseCount, .a = {"#getplayerburiedcorpsecount"}},
|
||||
Cmd{.cmd = "client_version_summary", .u = "client_version_summary", .fn = ShowClientVersionSummary, .a = {"#cvs"}},
|
||||
Cmd{.cmd = "currencies", .u = "currencies", .fn = ShowCurrencies, .a = {"#viewcurrencies"}},
|
||||
Cmd{.cmd = "distance", .u = "distance", .fn = ShowDistance, .a = {"#distance"}},
|
||||
Cmd{.cmd = "emotes", .u = "emotes", .fn = ShowEmotes, .a = {"#emoteview"}},
|
||||
Cmd{.cmd = "field_of_view", .u = "field_of_view", .fn = ShowFieldOfView, .a = {"#fov"}},
|
||||
Cmd{.cmd = "flags", .u = "flags", .fn = ShowFlags, .a = {"#flags"}},
|
||||
Cmd{.cmd = "group_info", .u = "group_info", .fn = ShowGroupInfo, .a = {"#ginfo"}},
|
||||
Cmd{.cmd = "hatelist", .u = "hatelist", .fn = ShowHateList, .a = {"#hatelist"}},
|
||||
Cmd{.cmd = "inventory", .u = "inventory", .fn = ShowInventory, .a = {"#peekinv"}},
|
||||
Cmd{.cmd = "ip_lookup", .u = "ip_lookup", .fn = ShowIPLookup, .a = {"#iplookup"}},
|
||||
Cmd{.cmd = "line_of_sight", .u = "line_of_sight", .fn = ShowLineOfSight, .a = {"#checklos"}},
|
||||
Cmd{.cmd = "network", .u = "network", .fn = ShowNetwork, .a = {"#network"}},
|
||||
Cmd{.cmd = "network_stats", .u = "network_stats", .fn = ShowNetworkStats, .a = {"#netstats"}},
|
||||
Cmd{.cmd = "npc_global_loot", .u = "npc_global_loot", .fn = ShowNPCGlobalLoot, .a = {"#shownpcgloballoot"}},
|
||||
Cmd{.cmd = "npc_stats", .u = "npc_stats", .fn = ShowNPCStats, .a = {"#npcstats"}},
|
||||
Cmd{.cmd = "npc_type", .u = "npc_type [NPC ID]", .fn = ShowNPCType, .a = {"#viewnpctype"}},
|
||||
Cmd{.cmd = "peqzone_flags", .u = "peqzone_flags", .fn = ShowPEQZoneFlags, .a = {"#peqzone_flags"}},
|
||||
Cmd{.cmd = "petition", .u = "petition", .fn = ShowPetition, .a = {"#listpetition", "#viewpetition"}},
|
||||
Cmd{.cmd = "petition_info", .u = "petition_info", .fn = ShowPetitionInfo, .a = {"#petitioninfo"}},
|
||||
Cmd{.cmd = "proximity", .u = "proximity", .fn = ShowProximity, .a = {"#proximity"}},
|
||||
Cmd{.cmd = "quest_errors", .u = "quest_errors", .fn = ShowQuestErrors, .a = {"#questerrors"}},
|
||||
Cmd{.cmd = "quest_globals", .u = "quest_globals", .fn = ShowQuestGlobals, .a = {"#globalview"}},
|
||||
Cmd{.cmd = "recipe", .u = "recipe [Recipe ID]", .fn = ShowRecipe, .a = {"#viewrecipe"}},
|
||||
Cmd{.cmd = "server_info", .u = "server_info", .fn = ShowServerInfo, .a = {"#serverinfo"}},
|
||||
Cmd{.cmd = "skills", .u = "skills", .fn = ShowSkills, .a = {"#showskills"}},
|
||||
Cmd{.cmd = "spawn_status", .u = "spawn_status [all|disabled|enabled|Spawn ID]", .fn = ShowSpawnStatus, .a = {"#spawnstatus"}},
|
||||
Cmd{.cmd = "spells", .u = "spells [disciplines|spells]", .fn = ShowSpells, .a = {"#showspells"}},
|
||||
Cmd{.cmd = "spells_list", .u = "spells_list", .fn = ShowSpellsList, .a = {"#showspellslist"}},
|
||||
Cmd{.cmd = "stats", .u = "stats", .fn = ShowStats, .a = {"#showstats"}},
|
||||
Cmd{.cmd = "timers", .u = "timers", .fn = ShowTimers, .a = {"#timers"}},
|
||||
Cmd{.cmd = "traps", .u = "traps", .fn = ShowTraps, .a = {"#trapinfo"}},
|
||||
Cmd{.cmd = "uptime", .u = "uptime [Zone Server ID] (Zone Server ID is optional)", .fn = ShowUptime, .a = {"#uptime"}},
|
||||
Cmd{.cmd = "variable", .u = "variable [Variable Name]", .fn = ShowVariable, .a = {"#getvariable"}},
|
||||
Cmd{.cmd = "version", .u = "version", .fn = ShowVersion, .a = {"#version"}},
|
||||
Cmd{.cmd = "waypoints", .u = "waypoints", .fn = ShowWaypoints, .a = {"#wpinfo"}},
|
||||
Cmd{.cmd = "who", .u = "who [Search Criteria] (Search criteria is optional)", .fn = ShowWho, .a = {"#who"}},
|
||||
Cmd{.cmd = "xtargets", .u = "xtargets [Amount] (Amount is optional)", .fn = ShowXTargets, .a = {"#xtargets"}},
|
||||
Cmd{.cmd = "zone_data", .u = "zone_data", .fn = ShowZoneData, .a = {"#zstats"}},
|
||||
Cmd{.cmd = "zone_global_loot", .u = "zone_global_loot", .fn = ShowZoneGlobalLoot, .a = {"#showzonegloballoot"}},
|
||||
Cmd{.cmd = "zone_loot", .u = "zone_loot", .fn = ShowZoneLoot, .a = {"#viewzoneloot"}},
|
||||
Cmd{.cmd = "zone_points", .u = "zone_points", .fn = ShowZonePoints, .a = {"#showzonepoints"}},
|
||||
Cmd{.cmd = "zone_status", .u = "zone_status", .fn = ShowZoneStatus, .a = {"#zonestatus"}},
|
||||
};
|
||||
|
||||
// Check for arguments
|
||||
const auto arguments = sep->argnum;
|
||||
|
||||
// look for alias or command
|
||||
for (const auto &cmd: commands) {
|
||||
// Check for alias first
|
||||
for (const auto &alias: cmd.a) {
|
||||
if (!alias.empty() && Strings::EqualFold(alias, sep->arg[0])) {
|
||||
// build string from sep args
|
||||
std::vector<std::string> args = {};
|
||||
|
||||
// skip the first arg
|
||||
for (auto i = 1; i <= arguments; i++) {
|
||||
args.emplace_back(sep->arg[i]);
|
||||
}
|
||||
|
||||
// build the rewrite string
|
||||
const std::string& rewrite = fmt::format("#show {} {}", cmd.cmd, Strings::Join(args, " "));
|
||||
|
||||
// rewrite to #show <sub-command <args>
|
||||
c->SendGMCommand(rewrite);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for command
|
||||
if (cmd.cmd == Strings::ToLower(sep->arg[1])) {
|
||||
cmd.fn(c, sep);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Command not found
|
||||
c->Message(Chat::White, "Command not found. Usage: #show [command]");
|
||||
for (const auto &cmd: commands) {
|
||||
c->Message(Chat::White, fmt::format("Usage: #show {}", cmd.u).c_str());
|
||||
}
|
||||
}
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowAggro(Client *c, const Seperator *sep)
|
||||
{
|
||||
const auto arguments = sep->argnum;
|
||||
if (arguments < 2 || !sep->IsNumber(2)) {
|
||||
c->Message(Chat::White, "Usage: #show aggro [Distance] [-v] (-v is verbose Faction Information)");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!c->GetTarget() || !c->GetTarget()->IsNPC()) {
|
||||
c->Message(Chat::White, "You must target an NPC to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto t = c->GetTarget()->CastToNPC();
|
||||
|
||||
const float distance = Strings::ToFloat(sep->arg[2]);
|
||||
const bool is_verbose = Strings::EqualFold(sep->arg[3], "-v");
|
||||
|
||||
entity_list.DescribeAggro(c, t, distance, is_verbose);
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowBuffs(Client *c, const Seperator *sep)
|
||||
{
|
||||
Mob* t = c;
|
||||
if (c->GetTarget()) {
|
||||
t = c->GetTarget();
|
||||
}
|
||||
|
||||
t->ShowBuffs(c);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "../../client.h"
|
||||
#include "../../corpse.h"
|
||||
|
||||
void ShowBuriedCorpseCount(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient() && c->GetGM()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
const uint32 corpse_count = database.GetCharacterBuriedCorpseCount(t->CharacterID());
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} {} buried corpse{}.",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||
c == t ? "have" : "has",
|
||||
corpse_count,
|
||||
corpse_count != 1 ? "s" : ""
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#include "../../client.h"
|
||||
#include "../../worldserver.h"
|
||||
|
||||
extern WorldServer worldserver;
|
||||
|
||||
void ShowClientVersionSummary(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto pack = new ServerPacket(ServerOP_ClientVersionSummary, sizeof(ServerRequestClientVersionSummary_Struct));
|
||||
|
||||
auto s = (ServerRequestClientVersionSummary_Struct *) pack->pBuffer;
|
||||
strn0cpy(s->Name, c->GetName(), sizeof(s->Name));
|
||||
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
#include "../../client.h"
|
||||
#include "../../dialogue_window.h"
|
||||
|
||||
void ShowCurrencies(Client *c, const Seperator *sep)
|
||||
{
|
||||
auto t = c;
|
||||
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||
t = c->GetTarget()->CastToClient();
|
||||
}
|
||||
|
||||
const uint32 platinum = (
|
||||
t->GetMoney(3, 0) +
|
||||
t->GetMoney(3, 1) +
|
||||
t->GetMoney(3, 2) +
|
||||
t->GetMoney(3, 3)
|
||||
);
|
||||
|
||||
const uint32 gold = (
|
||||
t->GetMoney(2, 0) +
|
||||
t->GetMoney(2, 1) +
|
||||
t->GetMoney(2, 2)
|
||||
);
|
||||
|
||||
const uint32 silver = (
|
||||
t->GetMoney(1, 0) +
|
||||
t->GetMoney(1, 1) +
|
||||
t->GetMoney(1, 2)
|
||||
);
|
||||
|
||||
const uint32 copper = (
|
||||
t->GetMoney(0, 0) +
|
||||
t->GetMoney(0, 1) +
|
||||
t->GetMoney(0, 2)
|
||||
);
|
||||
|
||||
std::string currency_table;
|
||||
|
||||
bool has_currency = false;
|
||||
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Currency") +
|
||||
DialogueWindow::TableCell("Amount")
|
||||
);
|
||||
|
||||
if (
|
||||
platinum ||
|
||||
gold ||
|
||||
silver ||
|
||||
copper
|
||||
) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Money") +
|
||||
DialogueWindow::TableCell(Strings::Money(platinum, gold, silver, copper))
|
||||
);
|
||||
|
||||
has_currency = true;
|
||||
}
|
||||
|
||||
const uint32 ebon_crystals = t->GetEbonCrystals();
|
||||
if (ebon_crystals) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Ebon Crystals") +
|
||||
DialogueWindow::TableCell(Strings::Commify(ebon_crystals))
|
||||
);
|
||||
|
||||
has_currency = true;
|
||||
}
|
||||
|
||||
const uint32 radiant_crystals = t->GetRadiantCrystals();
|
||||
if (radiant_crystals) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("Radiant Crystals") +
|
||||
DialogueWindow::TableCell(Strings::Commify(radiant_crystals))
|
||||
);
|
||||
|
||||
has_currency = true;
|
||||
}
|
||||
|
||||
for (const auto& a : zone->AlternateCurrencies) {
|
||||
const uint32 currency_value = t->GetAlternateCurrencyValue(a.id);
|
||||
if (currency_value) {
|
||||
const auto* d = database.GetItem(a.item_id);
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(d->Name) +
|
||||
DialogueWindow::TableCell(Strings::Commify(currency_value))
|
||||
);
|
||||
|
||||
has_currency = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& l : EQ::constants::GetLDoNThemeMap()) {
|
||||
const uint32 ldon_currency_value = t->GetLDoNPointsTheme(l.first);
|
||||
if (ldon_currency_value) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell(l.second) +
|
||||
DialogueWindow::TableCell(Strings::Commify(ldon_currency_value))
|
||||
);
|
||||
|
||||
has_currency = true;
|
||||
}
|
||||
}
|
||||
|
||||
const uint32 pvp_points = t->GetPVPPoints();
|
||||
if (pvp_points) {
|
||||
currency_table += DialogueWindow::TableRow(
|
||||
DialogueWindow::TableCell("PVP Points") +
|
||||
DialogueWindow::TableCell(Strings::Commify(pvp_points))
|
||||
);
|
||||
|
||||
has_currency = true;
|
||||
}
|
||||
|
||||
currency_table = DialogueWindow::Table(currency_table);
|
||||
|
||||
if (!has_currency) {
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} {} not have any currencies.",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCYou),
|
||||
c == t ? "do" : "does"
|
||||
).c_str()
|
||||
);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
c->SendPopupToClient(
|
||||
fmt::format(
|
||||
"Currency for {}",
|
||||
c->GetTargetDescription(t, TargetDescriptionType::UCSelf)
|
||||
).c_str(),
|
||||
currency_table.c_str()
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "../../client.h"
|
||||
|
||||
void ShowDistance(Client *c, const Seperator *sep)
|
||||
{
|
||||
if (!c->GetTarget() || c->GetTarget() == c) {
|
||||
c->Message(Chat::White, "You must have a target to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto t = c->GetTarget();
|
||||
|
||||
c->Message(
|
||||
Chat::White,
|
||||
fmt::format(
|
||||
"{} is {:.2f} units from you.",
|
||||
c->GetTargetDescription(t),
|
||||
Distance(
|
||||
c->GetPosition(),
|
||||
t->GetPosition()
|
||||
)
|
||||
).c_str()
|
||||
);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user