mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-13 02:38:45 +00:00
Compare commits
59 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2434bab697 | |||
| 7a5a755033 | |||
| 35fe38cd09 | |||
| eb3664a444 | |||
| a244509d63 | |||
| 873c128f46 | |||
| 8314f2348c | |||
| 29720f95ed | |||
| a478fd2600 | |||
| f57c37e9c5 | |||
| b9fb4babba | |||
| c2e4082045 | |||
| e1dee55ecd | |||
| 1632ff04b0 | |||
| 873209dbc0 | |||
| a00b2eb382 | |||
| 67d8250b1c | |||
| f505c2cfd2 | |||
| a221e50cc2 | |||
| 32c5d4d9f6 | |||
| ce4716e9a5 | |||
| a99ce4fbdb | |||
| dcfc54d408 | |||
| c13ec5a06d | |||
| d182fc3613 | |||
| 5a89fcfb78 | |||
| db3601c25c | |||
| 137a9f835a | |||
| 4ad46b54df | |||
| 3f46210639 | |||
| 6ec63969bb | |||
| 767846f7e5 | |||
| 04bb9bf39c | |||
| e6df5be1ed | |||
| 6bb2f97b74 | |||
| 86f39743fc | |||
| 447fc026a8 | |||
| 7408df933c | |||
| 2f59e70c6b | |||
| eb8514eea8 | |||
| f498bac574 | |||
| 9a0b3a4c36 | |||
| 34ea870717 | |||
| d68c1a7a6c | |||
| c50100fcdb | |||
| 20cdc1e63d | |||
| 43c7523ee1 | |||
| e060d97798 | |||
| 435b6142b8 | |||
| 508b37dc93 | |||
| 0adca46a73 | |||
| e920e35a5c | |||
| 20c01ef343 | |||
| 1567141c19 | |||
| 6bc9bcf15a | |||
| 86a2a86ba8 | |||
| 3e6924d10e | |||
| a27a8adf1e | |||
| 13994fb3e4 |
+133
@@ -1,3 +1,136 @@
|
|||||||
|
## [22.45.0] 2/24/2024
|
||||||
|
|
||||||
|
### Beacon
|
||||||
|
|
||||||
|
* Revert a few lines of PR #4024 that broke beacons ([#4118](https://github.com/EQEmu/Server/pull/4118)) @noudess 2024-02-24
|
||||||
|
|
||||||
|
### Bots
|
||||||
|
|
||||||
|
* Cleanup empty `bot_commands` files ([#4095](https://github.com/EQEmu/Server/pull/4095)) @Kinglykrab 2024-02-19
|
||||||
|
* Remove Alt Combat Functionality ([#4067](https://github.com/EQEmu/Server/pull/4067)) @Kinglykrab 2024-02-12
|
||||||
|
|
||||||
|
### Code
|
||||||
|
|
||||||
|
* Update fmt to 10.2.1 ([#4071](https://github.com/EQEmu/Server/pull/4071)) @hgtw 2024-02-16
|
||||||
|
* Use explicit conversions for enum formatting ([#4064](https://github.com/EQEmu/Server/pull/4064)) @hgtw 2024-02-12
|
||||||
|
|
||||||
|
### Database
|
||||||
|
|
||||||
|
* Add content_database flag for zone changes ([#4104](https://github.com/EQEmu/Server/pull/4104)) @joligario 2024-02-20
|
||||||
|
* Remove "item_tick" from database schema per https://github.com/EQEmu/Server/pull/3985 ([#4083](https://github.com/EQEmu/Server/pull/4083)) @Akkadius 2024-02-16
|
||||||
|
|
||||||
|
### Expansions
|
||||||
|
|
||||||
|
* Zone Expansion Version Routing ([#4084](https://github.com/EQEmu/Server/pull/4084)) @Akkadius 2024-02-20
|
||||||
|
|
||||||
|
### Factions
|
||||||
|
|
||||||
|
* Fix issue with npcedit and cached factions ([#4103](https://github.com/EQEmu/Server/pull/4103)) @noudess 2024-02-20
|
||||||
|
|
||||||
|
### Feature
|
||||||
|
|
||||||
|
* Add Augments to Starting Items for Bots/Players ([#4100](https://github.com/EQEmu/Server/pull/4100)) @Kinglykrab 2024-02-21
|
||||||
|
* Hot Zone Bonus XP Notice ([#4091](https://github.com/EQEmu/Server/pull/4091)) @fryguy503 2024-02-18
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Add safety check to SummonAllCharacterCorpses. ([#4107](https://github.com/EQEmu/Server/pull/4107)) @fryguy503 2024-02-21
|
||||||
|
* Added additional Guild-related crash checks ([#4105](https://github.com/EQEmu/Server/pull/4105)) @neckkola 2024-02-22
|
||||||
|
* Aura effect spell id from #3964 ([#4094](https://github.com/EQEmu/Server/pull/4094)) @joligario 2024-02-18
|
||||||
|
* Crash on Ubuntu 22.04 ([#4119](https://github.com/EQEmu/Server/pull/4119)) @neckkola 2024-02-25
|
||||||
|
* Fix #wpadd Query ([#4078](https://github.com/EQEmu/Server/pull/4078)) @Kinglykrab 2024-02-14
|
||||||
|
* Fix Bot Weapons with No Races ([#4110](https://github.com/EQEmu/Server/pull/4110)) @Kinglykrab 2024-02-25
|
||||||
|
* Fix ClearSpawnTimers() ([#4073](https://github.com/EQEmu/Server/pull/4073)) @Kinglykrab 2024-02-13
|
||||||
|
* Fix Issue with ClearSpawnTimers() ([#4070](https://github.com/EQEmu/Server/pull/4070)) @Kinglykrab 2024-02-13
|
||||||
|
* Fix ObjectContentsRepository using content_db ([#4076](https://github.com/EQEmu/Server/pull/4076)) @Kinglykrab 2024-02-14
|
||||||
|
* Fix Sympathetic Procs for Bots/Mercenariess ([#4086](https://github.com/EQEmu/Server/pull/4086)) @Kinglykrab 2024-02-19
|
||||||
|
* Fix fix_z Query ([#4080](https://github.com/EQEmu/Server/pull/4080)) @Kinglykrab 2024-02-15
|
||||||
|
* Fix hotzone string error ([#4109](https://github.com/EQEmu/Server/pull/4109)) @fryguy503 2024-02-22
|
||||||
|
* Fix issue with IsEntOnHateList ([#4097](https://github.com/EQEmu/Server/pull/4097)) @Kinglykrab 2024-02-19
|
||||||
|
* Fix manifest check on `base_data` change ([#4082](https://github.com/EQEmu/Server/pull/4082)) @joligario 2024-02-16
|
||||||
|
* Revert 2df7d19 ([#4101](https://github.com/EQEmu/Server/pull/4101)) @joligario 2024-02-20
|
||||||
|
* Update database_schema to add guild_permissions ([#4085](https://github.com/EQEmu/Server/pull/4085)) @neckkola 2024-02-16
|
||||||
|
|
||||||
|
### Guilds
|
||||||
|
|
||||||
|
* Fixes for Guild Bank ([#4120](https://github.com/EQEmu/Server/pull/4120)) @neckkola 2024-02-25
|
||||||
|
|
||||||
|
### Logs
|
||||||
|
|
||||||
|
* Fix log in BaseGuildManager::IsGuildLeader() ([#4102](https://github.com/EQEmu/Server/pull/4102)) @joligario 2024-02-20
|
||||||
|
|
||||||
|
### Opcodes
|
||||||
|
|
||||||
|
* Fix opcode reloading ([#4075](https://github.com/EQEmu/Server/pull/4075)) @Akkadius 2024-02-14
|
||||||
|
|
||||||
|
### Quest API
|
||||||
|
|
||||||
|
* Add Bot Methods to Perl/Lua ([#4113](https://github.com/EQEmu/Server/pull/4113)) @Kinglykrab 2024-02-25
|
||||||
|
* Add Entity Variable Events to Perl/Lua ([#4092](https://github.com/EQEmu/Server/pull/4092)) @Kinglykrab 2024-02-20
|
||||||
|
* Add GetAugmentIDs() to Perl/Lua ([#4114](https://github.com/EQEmu/Server/pull/4114)) @Kinglykrab 2024-02-25
|
||||||
|
* Add GetNPCSpellsEffectsID() to Perl/Lua ([#4117](https://github.com/EQEmu/Server/pull/4117)) @Kinglykrab 2024-02-25
|
||||||
|
* Add Hatelist Count Methods to Perl/Lua ([#4106](https://github.com/EQEmu/Server/pull/4106)) @Kinglykrab 2024-02-21
|
||||||
|
* Add IsInAGuild() to Perl/Lua ([#4066](https://github.com/EQEmu/Server/pull/4066)) @Kinglykrab 2024-02-14
|
||||||
|
* Add Pet Methods to Perl/Lua ([#4116](https://github.com/EQEmu/Server/pull/4116)) @Kinglykrab 2024-02-25
|
||||||
|
* Add Timer Events to Perl/Lua ([#4099](https://github.com/EQEmu/Server/pull/4099)) @Kinglykrab 2024-02-19
|
||||||
|
* Add spell cast methods to Lua ([#4096](https://github.com/EQEmu/Server/pull/4096)) @Kinglykrab 2024-02-19
|
||||||
|
* Add tracebacks to Lua error messages ([#4079](https://github.com/EQEmu/Server/pull/4079)) @hgtw 2024-02-16
|
||||||
|
* Export Combat Record to Death Events ([#4112](https://github.com/EQEmu/Server/pull/4112)) @Kinglykrab 2024-02-25
|
||||||
|
|
||||||
|
### Repositories
|
||||||
|
|
||||||
|
* Cleanup and Convert Character Creation to Repositories ([#4053](https://github.com/EQEmu/Server/pull/4053)) @Kinglykrab 2024-02-20
|
||||||
|
* Convert Zone Flags to Repositories ([#4077](https://github.com/EQEmu/Server/pull/4077)) @Kinglykrab 2024-02-16
|
||||||
|
* Update `zone` base repository from #4084 ([#4111](https://github.com/EQEmu/Server/pull/4111)) @joligario 2024-02-23
|
||||||
|
|
||||||
|
## [22.44.5] - 2/12/2024
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* [Hotfix] Fix issues where we're using the wrong database pointers @Akkadius
|
||||||
|
|
||||||
|
## [22.44.4] - 2/12/2024
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix ClearSpawnTimers() ([#4073](https://github.com/EQEmu/Server/pull/4073)) @Kinglykrab 2024-02-13
|
||||||
|
|
||||||
|
## [22.44.3] - 2/12/2024
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix Issue with ClearSpawnTimers() ([#4070](https://github.com/EQEmu/Server/pull/4070)) @Kinglykrab 2024-02-13
|
||||||
|
|
||||||
|
## [22.44.2] - 2/12/2024
|
||||||
|
|
||||||
|
### Bots
|
||||||
|
|
||||||
|
* Remove Alt Combat Functionality ([#4067](https://github.com/EQEmu/Server/pull/4067)) @Kinglykrab 2024-02-12
|
||||||
|
|
||||||
|
### Code
|
||||||
|
|
||||||
|
* Use explicit conversions for enum formatting ([#4064](https://github.com/EQEmu/Server/pull/4064)) @hgtw 2024-02-12
|
||||||
|
|
||||||
|
### Database
|
||||||
|
|
||||||
|
* Fix default value for `time_of_death` in `character_corpses` ([#4060](https://github.com/EQEmu/Server/pull/4060)) @joligario 2024-02-11
|
||||||
|
* Fix table name in manifest ([#4063](https://github.com/EQEmu/Server/pull/4063)) @joligario 2024-02-11
|
||||||
|
* Proper default for `droptime` from `object_contents` ([#4061](https://github.com/EQEmu/Server/pull/4061)) @joligario 2024-02-11
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Guard against crash condition ([#4062](https://github.com/EQEmu/Server/pull/4062)) @neckkola 2024-02-11
|
||||||
|
|
||||||
|
### Guilds
|
||||||
|
|
||||||
|
* Clean up `GUILD_RANK_NONE` references ([#4059](https://github.com/EQEmu/Server/pull/4059)) @joligario 2024-02-11
|
||||||
|
|
||||||
|
## [22.44.1] - 2/11/2024
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix File::Exists(file_name) to be resilient to Chinese characters ([#4058](https://github.com/EQEmu/Server/pull/4058)) @Akkadius 2024-02-11
|
||||||
|
|
||||||
## [22.44.0] - 2/10/2024
|
## [22.44.0] - 2/10/2024
|
||||||
|
|
||||||
### Base Data
|
### Base Data
|
||||||
|
|||||||
@@ -64,4 +64,6 @@ typedef enum {
|
|||||||
} bodyType;
|
} bodyType;
|
||||||
/* bodytypes above 64 make the mob not show up */
|
/* bodytypes above 64 make the mob not show up */
|
||||||
|
|
||||||
|
constexpr int format_as(bodyType type) { return static_cast<int>(type); }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1,28 +1,11 @@
|
|||||||
/**
|
|
||||||
* EQEmulator: Everquest Server Emulator
|
|
||||||
* Copyright (C) 2001-2019 EQEmulator Development Team (https://github.com/EQEmu/Server)
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; version 2 of the License.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY except by those people which sell it, which
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "world_content_service.h"
|
#include "world_content_service.h"
|
||||||
|
|
||||||
|
#include <utility>
|
||||||
|
#include <glm/vec3.hpp>
|
||||||
#include "../database.h"
|
#include "../database.h"
|
||||||
#include "../rulesys.h"
|
#include "../rulesys.h"
|
||||||
#include "../eqemu_logsys.h"
|
#include "../eqemu_logsys.h"
|
||||||
#include "../repositories/content_flags_repository.h"
|
#include "../repositories/instance_list_repository.h"
|
||||||
|
|
||||||
|
|
||||||
WorldContentService::WorldContentService()
|
WorldContentService::WorldContentService()
|
||||||
@@ -200,6 +183,7 @@ void WorldContentService::ReloadContentFlags()
|
|||||||
}
|
}
|
||||||
|
|
||||||
SetContentFlags(set_content_flags);
|
SetContentFlags(set_content_flags);
|
||||||
|
SetContentZones(ZoneRepository::All(*m_content_database));
|
||||||
}
|
}
|
||||||
|
|
||||||
Database *WorldContentService::GetDatabase() const
|
Database *WorldContentService::GetDatabase() const
|
||||||
@@ -214,6 +198,18 @@ WorldContentService *WorldContentService::SetDatabase(Database *database)
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Database *WorldContentService::GetContentDatabase() const
|
||||||
|
{
|
||||||
|
return m_content_database;
|
||||||
|
}
|
||||||
|
|
||||||
|
WorldContentService *WorldContentService::SetContentDatabase(Database *database)
|
||||||
|
{
|
||||||
|
WorldContentService::m_content_database = database;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
void WorldContentService::SetContentFlag(const std::string &content_flag_name, bool enabled)
|
void WorldContentService::SetContentFlag(const std::string &content_flag_name, bool enabled)
|
||||||
{
|
{
|
||||||
auto flags = ContentFlagsRepository::GetWhere(
|
auto flags = ContentFlagsRepository::GetWhere(
|
||||||
@@ -238,3 +234,85 @@ void WorldContentService::SetContentFlag(const std::string &content_flag_name, b
|
|||||||
|
|
||||||
ReloadContentFlags();
|
ReloadContentFlags();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetZones sets the zones for the world content service
|
||||||
|
// this is used for zone routing middleware
|
||||||
|
// we pull the zone list from the zone repository and feed from the zone store for now
|
||||||
|
// we're holding a copy in the content service - but we're talking 250kb of data in memory to handle routing of zoning
|
||||||
|
WorldContentService *WorldContentService::SetContentZones(const std::vector<BaseZoneRepository::Zone>& zones)
|
||||||
|
{
|
||||||
|
m_zones = zones;
|
||||||
|
|
||||||
|
LogInfo("Loaded [{}] zones", m_zones.size());
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
// HandleZoneRoutingMiddleware is meant to handle content and context aware zone routing
|
||||||
|
//
|
||||||
|
// example # 1
|
||||||
|
// lavastorm (pre-don) version 0 (classic)
|
||||||
|
// lavastorm (don) version 1
|
||||||
|
// we want to route players to the correct version of lavastorm based on the current server side expansion
|
||||||
|
// in order to do that the simplest and cleanest way we intercept the zoning process and route players to an "instance" of the zone
|
||||||
|
// the reason why we're doing this is because all of the zoning logic already is handled by two keys "zone_id" and "instance_id"
|
||||||
|
// we can leverage static, never expires instances to handle this but to the client they don't see it any other way than a public normal zone
|
||||||
|
// scripts handle all the same way, you don't have to think about instances, the middleware will handle the magic
|
||||||
|
// the versions of zones are represented by two zone entries that have potentially different min/max expansion and/or different content flags
|
||||||
|
// we decide to route the client to the correct version of the zone based on the current server side expansion
|
||||||
|
// example # 2
|
||||||
|
void WorldContentService::HandleZoneRoutingMiddleware(ZoneChange_Struct *zc)
|
||||||
|
{
|
||||||
|
// if we're already in an instance, we don't want to route the player to another instance
|
||||||
|
if (zc->instanceID > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto &z: m_zones) {
|
||||||
|
if (z.zoneidnumber == zc->zoneID) {
|
||||||
|
auto f = ContentFlags{
|
||||||
|
.min_expansion = z.min_expansion,
|
||||||
|
.max_expansion = z.max_expansion,
|
||||||
|
.content_flags = z.content_flags,
|
||||||
|
.content_flags_disabled = z.content_flags_disabled
|
||||||
|
};
|
||||||
|
|
||||||
|
if (DoesPassContentFiltering(f)) {
|
||||||
|
LogInfo(
|
||||||
|
"Attempting to route player to zone [{}] ({}) version [{}] long_name [{}]",
|
||||||
|
z.short_name,
|
||||||
|
z.zoneidnumber,
|
||||||
|
z.version,
|
||||||
|
z.long_name
|
||||||
|
);
|
||||||
|
|
||||||
|
auto instances = InstanceListRepository::GetWhere(
|
||||||
|
*GetDatabase(),
|
||||||
|
fmt::format(
|
||||||
|
"zone = {} AND version = {} AND never_expires = 1 AND is_global = 1",
|
||||||
|
z.zoneidnumber,
|
||||||
|
z.version
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!instances.empty()) {
|
||||||
|
auto instance = instances.front();
|
||||||
|
zc->instanceID = instance.id;
|
||||||
|
|
||||||
|
LogInfo(
|
||||||
|
"Routed player to instance [{}] of zone [{}] ({}) version [{}] long_name [{}] notes [{}]",
|
||||||
|
instance.id,
|
||||||
|
z.short_name,
|
||||||
|
z.zoneidnumber,
|
||||||
|
z.version,
|
||||||
|
z.long_name,
|
||||||
|
instance.notes
|
||||||
|
);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,29 +1,10 @@
|
|||||||
/**
|
|
||||||
* EQEmulator: Everquest Server Emulator
|
|
||||||
* Copyright (C) 2001-2019 EQEmulator Development Team (https://github.com/EQEmu/Server)
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; version 2 of the License.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY except by those people which sell it, which
|
|
||||||
* 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
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef EQEMU_WORLD_CONTENT_SERVICE_H
|
#ifndef EQEMU_WORLD_CONTENT_SERVICE_H
|
||||||
#define EQEMU_WORLD_CONTENT_SERVICE_H
|
#define EQEMU_WORLD_CONTENT_SERVICE_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "../repositories/content_flags_repository.h"
|
#include "../repositories/content_flags_repository.h"
|
||||||
|
#include "../repositories/zone_repository.h"
|
||||||
|
|
||||||
class Database;
|
class Database;
|
||||||
|
|
||||||
@@ -182,14 +163,23 @@ public:
|
|||||||
WorldContentService * SetDatabase(Database *database);
|
WorldContentService * SetDatabase(Database *database);
|
||||||
Database *GetDatabase() const;
|
Database *GetDatabase() const;
|
||||||
|
|
||||||
|
WorldContentService * SetContentDatabase(Database *database);
|
||||||
|
Database *GetContentDatabase() const;
|
||||||
|
|
||||||
void SetContentFlag(const std::string &content_flag_name, bool enabled);
|
void SetContentFlag(const std::string &content_flag_name, bool enabled);
|
||||||
|
|
||||||
|
void HandleZoneRoutingMiddleware(ZoneChange_Struct *zc);
|
||||||
|
WorldContentService * SetContentZones(const std::vector<ZoneRepository::Zone>& zones);
|
||||||
private:
|
private:
|
||||||
int current_expansion{};
|
int current_expansion{};
|
||||||
std::vector<ContentFlagsRepository::ContentFlags> content_flags;
|
std::vector<ContentFlagsRepository::ContentFlags> content_flags;
|
||||||
|
|
||||||
// reference to database
|
// reference to database
|
||||||
Database *m_database;
|
Database *m_database;
|
||||||
|
Database *m_content_database;
|
||||||
|
|
||||||
|
// holds a record of the zone table from the database
|
||||||
|
std::vector<ZoneRepository::Zone> m_zones = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
extern WorldContentService content_service;
|
extern WorldContentService content_service;
|
||||||
|
|||||||
+164
-337
@@ -30,6 +30,11 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "../common/repositories/account_repository.h"
|
#include "../common/repositories/account_repository.h"
|
||||||
|
#include "../common/repositories/character_bind_repository.h"
|
||||||
|
#include "../common/repositories/character_data_repository.h"
|
||||||
|
#include "../common/repositories/character_languages_repository.h"
|
||||||
|
#include "../common/repositories/character_leadership_abilities_repository.h"
|
||||||
|
#include "../common/repositories/character_skills_repository.h"
|
||||||
|
|
||||||
// Disgrace: for windows compile
|
// Disgrace: for windows compile
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
@@ -454,363 +459,185 @@ bool Database::DeleteCharacter(char *character_name)
|
|||||||
|
|
||||||
bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct *pp)
|
bool Database::SaveCharacterCreate(uint32 character_id, uint32 account_id, PlayerProfile_Struct *pp)
|
||||||
{
|
{
|
||||||
std::string query = StringFormat(
|
auto c = CharacterDataRepository::NewEntity();
|
||||||
"REPLACE INTO `character_data` ("
|
|
||||||
"id,"
|
|
||||||
"account_id,"
|
|
||||||
"`name`,"
|
|
||||||
"last_name,"
|
|
||||||
"gender,"
|
|
||||||
"race,"
|
|
||||||
"class,"
|
|
||||||
"`level`,"
|
|
||||||
"deity,"
|
|
||||||
"birthday,"
|
|
||||||
"last_login,"
|
|
||||||
"time_played,"
|
|
||||||
"pvp_status,"
|
|
||||||
"level2,"
|
|
||||||
"anon,"
|
|
||||||
"gm,"
|
|
||||||
"intoxication,"
|
|
||||||
"hair_color,"
|
|
||||||
"beard_color,"
|
|
||||||
"eye_color_1,"
|
|
||||||
"eye_color_2,"
|
|
||||||
"hair_style,"
|
|
||||||
"beard,"
|
|
||||||
"ability_time_seconds,"
|
|
||||||
"ability_number,"
|
|
||||||
"ability_time_minutes,"
|
|
||||||
"ability_time_hours,"
|
|
||||||
"title,"
|
|
||||||
"suffix,"
|
|
||||||
"exp,"
|
|
||||||
"points,"
|
|
||||||
"mana,"
|
|
||||||
"cur_hp,"
|
|
||||||
"str,"
|
|
||||||
"sta,"
|
|
||||||
"cha,"
|
|
||||||
"dex,"
|
|
||||||
"`int`,"
|
|
||||||
"agi,"
|
|
||||||
"wis,"
|
|
||||||
"face,"
|
|
||||||
"y,"
|
|
||||||
"x,"
|
|
||||||
"z,"
|
|
||||||
"heading,"
|
|
||||||
"pvp2,"
|
|
||||||
"pvp_type,"
|
|
||||||
"autosplit_enabled,"
|
|
||||||
"zone_change_count,"
|
|
||||||
"drakkin_heritage,"
|
|
||||||
"drakkin_tattoo,"
|
|
||||||
"drakkin_details,"
|
|
||||||
"toxicity,"
|
|
||||||
"hunger_level,"
|
|
||||||
"thirst_level,"
|
|
||||||
"ability_up,"
|
|
||||||
"zone_id,"
|
|
||||||
"zone_instance,"
|
|
||||||
"leadership_exp_on,"
|
|
||||||
"ldon_points_guk,"
|
|
||||||
"ldon_points_mir,"
|
|
||||||
"ldon_points_mmc,"
|
|
||||||
"ldon_points_ruj,"
|
|
||||||
"ldon_points_tak,"
|
|
||||||
"ldon_points_available,"
|
|
||||||
"tribute_time_remaining,"
|
|
||||||
"show_helm,"
|
|
||||||
"career_tribute_points,"
|
|
||||||
"tribute_points,"
|
|
||||||
"tribute_active,"
|
|
||||||
"endurance,"
|
|
||||||
"group_leadership_exp,"
|
|
||||||
"raid_leadership_exp,"
|
|
||||||
"group_leadership_points,"
|
|
||||||
"raid_leadership_points,"
|
|
||||||
"air_remaining,"
|
|
||||||
"pvp_kills,"
|
|
||||||
"pvp_deaths,"
|
|
||||||
"pvp_current_points,"
|
|
||||||
"pvp_career_points,"
|
|
||||||
"pvp_best_kill_streak,"
|
|
||||||
"pvp_worst_death_streak,"
|
|
||||||
"pvp_current_kill_streak,"
|
|
||||||
"aa_points_spent,"
|
|
||||||
"aa_exp,"
|
|
||||||
"aa_points,"
|
|
||||||
"group_auto_consent,"
|
|
||||||
"raid_auto_consent,"
|
|
||||||
"guild_auto_consent,"
|
|
||||||
"RestTimer) "
|
|
||||||
"VALUES ("
|
|
||||||
"%u," // id
|
|
||||||
"%u," // account_id
|
|
||||||
"'%s'," // `name`
|
|
||||||
"'%s'," // last_name
|
|
||||||
"%u," // gender
|
|
||||||
"%u," // race
|
|
||||||
"%u," // class
|
|
||||||
"%u," // `level`
|
|
||||||
"%u," // deity
|
|
||||||
"%u," // birthday
|
|
||||||
"%u," // last_login
|
|
||||||
"%u," // time_played
|
|
||||||
"%u," // pvp_status
|
|
||||||
"%u," // level2
|
|
||||||
"%u," // anon
|
|
||||||
"%u," // gm
|
|
||||||
"%u," // intoxication
|
|
||||||
"%u," // hair_color
|
|
||||||
"%u," // beard_color
|
|
||||||
"%u," // eye_color_1
|
|
||||||
"%u," // eye_color_2
|
|
||||||
"%u," // hair_style
|
|
||||||
"%u," // beard
|
|
||||||
"%u," // ability_time_seconds
|
|
||||||
"%u," // ability_number
|
|
||||||
"%u," // ability_time_minutes
|
|
||||||
"%u," // ability_time_hours
|
|
||||||
"'%s'," // title
|
|
||||||
"'%s'," // suffix
|
|
||||||
"%u," // exp
|
|
||||||
"%u," // points
|
|
||||||
"%u," // mana
|
|
||||||
"%u," // cur_hp
|
|
||||||
"%u," // str
|
|
||||||
"%u," // sta
|
|
||||||
"%u," // cha
|
|
||||||
"%u," // dex
|
|
||||||
"%u," // `int`
|
|
||||||
"%u," // agi
|
|
||||||
"%u," // wis
|
|
||||||
"%u," // face
|
|
||||||
"%f," // y
|
|
||||||
"%f," // x
|
|
||||||
"%f," // z
|
|
||||||
"%f," // heading
|
|
||||||
"%u," // pvp2
|
|
||||||
"%u," // pvp_type
|
|
||||||
"%u," // autosplit_enabled
|
|
||||||
"%u," // zone_change_count
|
|
||||||
"%u," // drakkin_heritage
|
|
||||||
"%u," // drakkin_tattoo
|
|
||||||
"%u," // drakkin_details
|
|
||||||
"%i," // toxicity
|
|
||||||
"%i," // hunger_level
|
|
||||||
"%i," // thirst_level
|
|
||||||
"%u," // ability_up
|
|
||||||
"%u," // zone_id
|
|
||||||
"%u," // zone_instance
|
|
||||||
"%u," // leadership_exp_on
|
|
||||||
"%u," // ldon_points_guk
|
|
||||||
"%u," // ldon_points_mir
|
|
||||||
"%u," // ldon_points_mmc
|
|
||||||
"%u," // ldon_points_ruj
|
|
||||||
"%u," // ldon_points_tak
|
|
||||||
"%u," // ldon_points_available
|
|
||||||
"%u," // tribute_time_remaining
|
|
||||||
"%u," // show_helm
|
|
||||||
"%u," // career_tribute_points
|
|
||||||
"%u," // tribute_points
|
|
||||||
"%u," // tribute_active
|
|
||||||
"%u," // endurance
|
|
||||||
"%u," // group_leadership_exp
|
|
||||||
"%u," // raid_leadership_exp
|
|
||||||
"%u," // group_leadership_point
|
|
||||||
"%u," // raid_leadership_points
|
|
||||||
"%u," // air_remaining
|
|
||||||
"%u," // pvp_kills
|
|
||||||
"%u," // pvp_deaths
|
|
||||||
"%u," // pvp_current_points
|
|
||||||
"%u," // pvp_career_points
|
|
||||||
"%u," // pvp_best_kill_streak
|
|
||||||
"%u," // pvp_worst_death_streak
|
|
||||||
"%u," // pvp_current_kill_strea
|
|
||||||
"%u," // aa_points_spent
|
|
||||||
"%u," // aa_exp
|
|
||||||
"%u," // aa_points
|
|
||||||
"%u," // group_auto_consent
|
|
||||||
"%u," // raid_auto_consent
|
|
||||||
"%u," // guild_auto_consent
|
|
||||||
"%u" // RestTimer
|
|
||||||
")",
|
|
||||||
character_id, // " id, "
|
|
||||||
account_id, // " account_id, "
|
|
||||||
Strings::Escape(pp->name).c_str(), // " `name`, "
|
|
||||||
Strings::Escape(pp->last_name).c_str(), // " last_name, "
|
|
||||||
pp->gender, // " gender, "
|
|
||||||
pp->race, // " race, "
|
|
||||||
pp->class_, // " class, "
|
|
||||||
pp->level, // " `level`, "
|
|
||||||
pp->deity, // " deity, "
|
|
||||||
pp->birthday, // " birthday, "
|
|
||||||
pp->lastlogin, // " last_login, "
|
|
||||||
pp->timePlayedMin, // " time_played, "
|
|
||||||
pp->pvp, // " pvp_status, "
|
|
||||||
pp->level2, // " level2, "
|
|
||||||
pp->anon, // " anon, "
|
|
||||||
pp->gm, // " gm, "
|
|
||||||
pp->intoxication, // " intoxication, "
|
|
||||||
pp->haircolor, // " hair_color, "
|
|
||||||
pp->beardcolor, // " beard_color, "
|
|
||||||
pp->eyecolor1, // " eye_color_1, "
|
|
||||||
pp->eyecolor2, // " eye_color_2, "
|
|
||||||
pp->hairstyle, // " hair_style, "
|
|
||||||
pp->beard, // " beard, "
|
|
||||||
pp->ability_time_seconds, // " ability_time_seconds, "
|
|
||||||
pp->ability_number, // " ability_number, "
|
|
||||||
pp->ability_time_minutes, // " ability_time_minutes, "
|
|
||||||
pp->ability_time_hours, // " ability_time_hours, "
|
|
||||||
Strings::Escape(pp->title).c_str(), // " title, "
|
|
||||||
Strings::Escape(pp->suffix).c_str(), // " suffix, "
|
|
||||||
pp->exp, // " exp, "
|
|
||||||
pp->points, // " points, "
|
|
||||||
pp->mana, // " mana, "
|
|
||||||
pp->cur_hp, // " cur_hp, "
|
|
||||||
pp->STR, // " str, "
|
|
||||||
pp->STA, // " sta, "
|
|
||||||
pp->CHA, // " cha, "
|
|
||||||
pp->DEX, // " dex, "
|
|
||||||
pp->INT, // " `int`, "
|
|
||||||
pp->AGI, // " agi, "
|
|
||||||
pp->WIS, // " wis, "
|
|
||||||
pp->face, // " face, "
|
|
||||||
pp->y, // " y, "
|
|
||||||
pp->x, // " x, "
|
|
||||||
pp->z, // " z, "
|
|
||||||
pp->heading, // " heading, "
|
|
||||||
pp->pvp2, // " pvp2, "
|
|
||||||
pp->pvptype, // " pvp_type, "
|
|
||||||
pp->autosplit, // " autosplit_enabled, "
|
|
||||||
pp->zone_change_count, // " zone_change_count, "
|
|
||||||
pp->drakkin_heritage, // " drakkin_heritage, "
|
|
||||||
pp->drakkin_tattoo, // " drakkin_tattoo, "
|
|
||||||
pp->drakkin_details, // " drakkin_details, "
|
|
||||||
pp->toxicity, // " toxicity, "
|
|
||||||
pp->hunger_level, // " hunger_level, "
|
|
||||||
pp->thirst_level, // " thirst_level, "
|
|
||||||
pp->ability_up, // " ability_up, "
|
|
||||||
pp->zone_id, // " zone_id, "
|
|
||||||
pp->zoneInstance, // " zone_instance, "
|
|
||||||
pp->leadAAActive, // " leadership_exp_on, "
|
|
||||||
pp->ldon_points_guk, // " ldon_points_guk, "
|
|
||||||
pp->ldon_points_mir, // " ldon_points_mir, "
|
|
||||||
pp->ldon_points_mmc, // " ldon_points_mmc, "
|
|
||||||
pp->ldon_points_ruj, // " ldon_points_ruj, "
|
|
||||||
pp->ldon_points_tak, // " ldon_points_tak, "
|
|
||||||
pp->ldon_points_available, // " ldon_points_available, "
|
|
||||||
pp->tribute_time_remaining, // " tribute_time_remaining, "
|
|
||||||
pp->showhelm, // " show_helm, "
|
|
||||||
pp->career_tribute_points, // " career_tribute_points, "
|
|
||||||
pp->tribute_points, // " tribute_points, "
|
|
||||||
pp->tribute_active, // " tribute_active, "
|
|
||||||
pp->endurance, // " endurance, "
|
|
||||||
pp->group_leadership_exp, // " group_leadership_exp, "
|
|
||||||
pp->raid_leadership_exp, // " raid_leadership_exp, "
|
|
||||||
pp->group_leadership_points, // " group_leadership_points, "
|
|
||||||
pp->raid_leadership_points, // " raid_leadership_points, "
|
|
||||||
pp->air_remaining, // " air_remaining, "
|
|
||||||
pp->PVPKills, // " pvp_kills, "
|
|
||||||
pp->PVPDeaths, // " pvp_deaths, "
|
|
||||||
pp->PVPCurrentPoints, // " pvp_current_points, "
|
|
||||||
pp->PVPCareerPoints, // " pvp_career_points, "
|
|
||||||
pp->PVPBestKillStreak, // " pvp_best_kill_streak, "
|
|
||||||
pp->PVPWorstDeathStreak, // " pvp_worst_death_streak, "
|
|
||||||
pp->PVPCurrentKillStreak, // " pvp_current_kill_streak, "
|
|
||||||
pp->aapoints_spent, // " aa_points_spent, "
|
|
||||||
pp->expAA, // " aa_exp, "
|
|
||||||
pp->aapoints, // " aa_points, "
|
|
||||||
pp->groupAutoconsent, // " group_auto_consent, "
|
|
||||||
pp->raidAutoconsent, // " raid_auto_consent, "
|
|
||||||
pp->guildAutoconsent, // " guild_auto_consent, "
|
|
||||||
pp->RestTimer // " RestTimer) "
|
|
||||||
);
|
|
||||||
QueryDatabase(query);
|
|
||||||
|
|
||||||
/* Save Bind Points */
|
c.id = character_id;
|
||||||
query = StringFormat(
|
c.account_id = account_id;
|
||||||
"REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, slot)"
|
c.name = pp->name;
|
||||||
" VALUES (%u, %u, %u, %f, %f, %f, %f, %i), "
|
c.last_name = pp->last_name;
|
||||||
"(%u, %u, %u, %f, %f, %f, %f, %i), "
|
c.gender = pp->gender;
|
||||||
"(%u, %u, %u, %f, %f, %f, %f, %i), "
|
c.race = pp->race;
|
||||||
"(%u, %u, %u, %f, %f, %f, %f, %i), "
|
c.class_ = pp->class_;
|
||||||
"(%u, %u, %u, %f, %f, %f, %f, %i)",
|
c.level = pp->level;
|
||||||
character_id, pp->binds[0].zone_id, 0, pp->binds[0].x, pp->binds[0].y, pp->binds[0].z, pp->binds[0].heading, 0,
|
c.deity = pp->deity;
|
||||||
character_id, pp->binds[1].zone_id, 0, pp->binds[1].x, pp->binds[1].y, pp->binds[1].z, pp->binds[1].heading, 1,
|
c.birthday = pp->birthday;
|
||||||
character_id, pp->binds[2].zone_id, 0, pp->binds[2].x, pp->binds[2].y, pp->binds[2].z, pp->binds[2].heading, 2,
|
c.last_login = pp->lastlogin;
|
||||||
character_id, pp->binds[3].zone_id, 0, pp->binds[3].x, pp->binds[3].y, pp->binds[3].z, pp->binds[3].heading, 3,
|
c.time_played = pp->timePlayedMin;
|
||||||
character_id, pp->binds[4].zone_id, 0, pp->binds[4].x, pp->binds[4].y, pp->binds[4].z, pp->binds[4].heading, 4
|
c.pvp_status = pp->pvp;
|
||||||
);
|
c.level2 = pp->level2;
|
||||||
QueryDatabase(query);
|
c.anon = pp->anon;
|
||||||
|
c.gm = pp->gm;
|
||||||
|
c.intoxication = pp->intoxication;
|
||||||
|
c.hair_color = pp->haircolor;
|
||||||
|
c.beard_color = pp->beardcolor;
|
||||||
|
c.eye_color_1 = pp->eyecolor1;
|
||||||
|
c.eye_color_2 = pp->eyecolor2;
|
||||||
|
c.hair_style = pp->hairstyle;
|
||||||
|
c.beard = pp->beard;
|
||||||
|
c.ability_time_seconds = pp->ability_time_seconds;
|
||||||
|
c.ability_number = pp->ability_number;
|
||||||
|
c.ability_time_minutes = pp->ability_time_minutes;
|
||||||
|
c.ability_time_hours = pp->ability_time_hours;
|
||||||
|
c.title = pp->title;
|
||||||
|
c.suffix = pp->suffix;
|
||||||
|
c.exp = pp->exp;
|
||||||
|
c.points = pp->points;
|
||||||
|
c.mana = pp->mana;
|
||||||
|
c.cur_hp = pp->cur_hp;
|
||||||
|
c.str = pp->STR;
|
||||||
|
c.sta = pp->STA;
|
||||||
|
c.cha = pp->CHA;
|
||||||
|
c.dex = pp->DEX;
|
||||||
|
c.int_ = pp->INT;
|
||||||
|
c.agi = pp->AGI;
|
||||||
|
c.wis = pp->WIS;
|
||||||
|
c.face = pp->face;
|
||||||
|
c.y = pp->y;
|
||||||
|
c.x = pp->x;
|
||||||
|
c.z = pp->z;
|
||||||
|
c.heading = pp->heading;
|
||||||
|
c.pvp2 = pp->pvp2;
|
||||||
|
c.pvp_type = pp->pvptype;
|
||||||
|
c.autosplit_enabled = pp->autosplit;
|
||||||
|
c.zone_change_count = pp->zone_change_count;
|
||||||
|
c.drakkin_heritage = pp->drakkin_heritage;
|
||||||
|
c.drakkin_tattoo = pp->drakkin_tattoo;
|
||||||
|
c.drakkin_details = pp->drakkin_details;
|
||||||
|
c.toxicity = pp->toxicity;
|
||||||
|
c.hunger_level = pp->hunger_level;
|
||||||
|
c.thirst_level = pp->thirst_level;
|
||||||
|
c.ability_up = pp->ability_up;
|
||||||
|
c.zone_id = pp->zone_id;
|
||||||
|
c.zone_instance = pp->zoneInstance;
|
||||||
|
c.leadership_exp_on = pp->leadAAActive;
|
||||||
|
c.ldon_points_guk = pp->ldon_points_guk;
|
||||||
|
c.ldon_points_mir = pp->ldon_points_mir;
|
||||||
|
c.ldon_points_mmc = pp->ldon_points_mmc;
|
||||||
|
c.ldon_points_ruj = pp->ldon_points_ruj;
|
||||||
|
c.ldon_points_tak = pp->ldon_points_tak;
|
||||||
|
c.ldon_points_available = pp->ldon_points_available;
|
||||||
|
c.tribute_time_remaining = pp->tribute_time_remaining;
|
||||||
|
c.show_helm = pp->showhelm;
|
||||||
|
c.career_tribute_points = pp->career_tribute_points;
|
||||||
|
c.tribute_points = pp->tribute_points;
|
||||||
|
c.tribute_active = pp->tribute_active;
|
||||||
|
c.endurance = pp->endurance;
|
||||||
|
c.group_leadership_exp = pp->group_leadership_exp;
|
||||||
|
c.raid_leadership_exp = pp->raid_leadership_exp;
|
||||||
|
c.group_leadership_points = pp->group_leadership_points;
|
||||||
|
c.raid_leadership_points = pp->raid_leadership_points;
|
||||||
|
c.air_remaining = pp->air_remaining;
|
||||||
|
c.pvp_kills = pp->PVPKills;
|
||||||
|
c.pvp_deaths = pp->PVPDeaths;
|
||||||
|
c.pvp_current_points = pp->PVPCurrentPoints;
|
||||||
|
c.pvp_career_points = pp->PVPCareerPoints;
|
||||||
|
c.pvp_best_kill_streak = pp->PVPBestKillStreak;
|
||||||
|
c.pvp_worst_death_streak = pp->PVPWorstDeathStreak;
|
||||||
|
c.pvp_current_kill_streak = pp->PVPCurrentKillStreak;
|
||||||
|
c.aa_points_spent = pp->aapoints_spent;
|
||||||
|
c.aa_exp = pp->expAA;
|
||||||
|
c.aa_points = pp->aapoints;
|
||||||
|
c.group_auto_consent = pp->groupAutoconsent;
|
||||||
|
c.raid_auto_consent = pp->raidAutoconsent;
|
||||||
|
c.guild_auto_consent = pp->guildAutoconsent;
|
||||||
|
c.RestTimer = pp->RestTimer;
|
||||||
|
|
||||||
|
CharacterDataRepository::ReplaceOne(*this, c);
|
||||||
|
|
||||||
|
std::vector<CharacterBindRepository::CharacterBind> character_binds;
|
||||||
|
|
||||||
|
character_binds.reserve(5);
|
||||||
|
|
||||||
|
auto b = CharacterBindRepository::NewEntity();
|
||||||
|
|
||||||
|
b.id = character_id;
|
||||||
|
|
||||||
|
for (uint8 slot_id = 0; slot_id < 5; slot_id++) {
|
||||||
|
b.zone_id = pp->binds[slot_id].zone_id;
|
||||||
|
b.x = pp->binds[slot_id].x;
|
||||||
|
b.y = pp->binds[slot_id].y;
|
||||||
|
b.z = pp->binds[slot_id].z;
|
||||||
|
b.heading = pp->binds[slot_id].heading;
|
||||||
|
b.slot = slot_id;
|
||||||
|
|
||||||
|
character_binds.emplace_back(b);
|
||||||
|
}
|
||||||
|
|
||||||
|
CharacterBindRepository::ReplaceMany(*this, character_binds);
|
||||||
|
|
||||||
/* HoTT Ability */
|
|
||||||
if (RuleB(Character, GrantHoTTOnCreate)) {
|
if (RuleB(Character, GrantHoTTOnCreate)) {
|
||||||
query = StringFormat(
|
CharacterLeadershipAbilitiesRepository::InsertOne(
|
||||||
"INSERT INTO `character_leadership_abilities` (id, slot, `rank`) VALUES (%u, %i, %i)",
|
*this,
|
||||||
character_id,
|
CharacterLeadershipAbilitiesRepository::CharacterLeadershipAbilities{
|
||||||
14,
|
.id = character_id,
|
||||||
1
|
.slot = LeadershipAbilitySlot::HealthOfTargetsTarget,
|
||||||
|
.rank_ = 1
|
||||||
|
}
|
||||||
);
|
);
|
||||||
QueryDatabase(query);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save Skills */
|
std::vector<CharacterSkillsRepository::CharacterSkills> character_skills;
|
||||||
int firstquery = 0;
|
|
||||||
for (int i = 0; i < MAX_PP_SKILL; i++) {
|
|
||||||
if (pp->skills[i] > 0) {
|
|
||||||
if (firstquery != 1) {
|
|
||||||
firstquery = 1;
|
|
||||||
query = StringFormat(
|
|
||||||
"REPLACE INTO `character_skills` (id, skill_id, value) VALUES (%u, %u, %u)",
|
|
||||||
character_id,
|
|
||||||
i,
|
|
||||||
pp->skills[i]
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
query = query + StringFormat(", (%u, %u, %u)", character_id, i, pp->skills[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QueryDatabase(query);
|
|
||||||
|
|
||||||
/* Save Language */
|
character_skills.reserve(MAX_PP_SKILL);
|
||||||
firstquery = 0;
|
|
||||||
for (int i = 0; i < MAX_PP_LANGUAGE; i++) {
|
for (uint16 slot_id = 0; slot_id < MAX_PP_SKILL; slot_id++) {
|
||||||
if (pp->languages[i] > 0) {
|
character_skills.emplace_back(
|
||||||
if (firstquery != 1) {
|
CharacterSkillsRepository::CharacterSkills{
|
||||||
firstquery = 1;
|
.id = character_id,
|
||||||
query = StringFormat(
|
.skill_id = slot_id,
|
||||||
"REPLACE INTO `character_languages` (id, lang_id, value) VALUES (%u, %u, %u)",
|
.value = static_cast<uint16_t>(pp->skills[slot_id])
|
||||||
character_id,
|
}
|
||||||
i,
|
|
||||||
pp->languages[i]
|
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
query = query + StringFormat(", (%u, %u, %u)", character_id, i, pp->languages[i]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CharacterSkillsRepository::ReplaceMany(*this, character_skills);
|
||||||
|
|
||||||
|
std::vector<CharacterLanguagesRepository::CharacterLanguages> character_languages;
|
||||||
|
|
||||||
|
character_languages.reserve(MAX_PP_LANGUAGE);
|
||||||
|
|
||||||
|
for (uint16 slot_id = 0; slot_id < MAX_PP_LANGUAGE; slot_id++) {
|
||||||
|
character_languages.emplace_back(
|
||||||
|
CharacterLanguagesRepository::CharacterLanguages{
|
||||||
|
.id = character_id,
|
||||||
|
.lang_id = slot_id,
|
||||||
|
.value = static_cast<uint16_t>(pp->languages[slot_id])
|
||||||
}
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
QueryDatabase(query);
|
|
||||||
|
CharacterLanguagesRepository::ReplaceMany(*this, character_languages);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 Database::GetCharacterID(const char *name) {
|
uint32 Database::GetCharacterID(const std::string& name)
|
||||||
const auto query = fmt::format(
|
{
|
||||||
"SELECT `id` FROM `character_data` WHERE `name` = '{}'",
|
const auto& l = CharacterDataRepository::GetWhere(
|
||||||
|
*this,
|
||||||
|
fmt::format(
|
||||||
|
"`name` = '{}'",
|
||||||
Strings::Escape(name)
|
Strings::Escape(name)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
auto results = QueryDatabase(query);
|
|
||||||
if (!results.Success() || !results.RowCount()) {
|
if (l.empty()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto row = results.begin();
|
auto e = l.front();
|
||||||
return Strings::ToUnsignedInt(row[0]);
|
|
||||||
|
return e.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
+1
-1
@@ -125,7 +125,7 @@ public:
|
|||||||
uint32 GetAccountIDByChar(const char* charname, uint32* oCharID = 0);
|
uint32 GetAccountIDByChar(const char* charname, uint32* oCharID = 0);
|
||||||
uint32 GetAccountIDByChar(uint32 char_id);
|
uint32 GetAccountIDByChar(uint32 char_id);
|
||||||
uint32 GetAccountIDByName(std::string account_name, std::string loginserver, int16* status = 0, uint32* lsid = 0);
|
uint32 GetAccountIDByName(std::string account_name, std::string loginserver, int16* status = 0, uint32* lsid = 0);
|
||||||
uint32 GetCharacterID(const char *name);
|
uint32 GetCharacterID(const std::string& name);
|
||||||
uint32 GetCharacterInfo(std::string character_name, uint32 *account_id, uint32 *zone_id, uint32 *instance_id);
|
uint32 GetCharacterInfo(std::string character_name, uint32 *account_id, uint32 *zone_id, uint32 *instance_id);
|
||||||
uint32 GetGuildIDByCharID(uint32 char_id);
|
uint32 GetGuildIDByCharID(uint32 char_id);
|
||||||
uint32 GetGroupIDByCharID(uint32 char_id);
|
uint32 GetGroupIDByCharID(uint32 char_id);
|
||||||
|
|||||||
@@ -5247,7 +5247,7 @@ MODIFY COLUMN `name` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci
|
|||||||
ManifestEntry{
|
ManifestEntry{
|
||||||
.version = 9257,
|
.version = 9257,
|
||||||
.description = "2024_01_16_ground_spawns_fix_z.sql",
|
.description = "2024_01_16_ground_spawns_fix_z.sql",
|
||||||
.check = "SHOW COLUMNS FROM `ground_spawns` LIKE `fix_z`",
|
.check = "SHOW COLUMNS FROM `ground_spawns` LIKE 'fix_z'",
|
||||||
.condition = "empty",
|
.condition = "empty",
|
||||||
.match = "",
|
.match = "",
|
||||||
.sql = R"(
|
.sql = R"(
|
||||||
@@ -5259,7 +5259,7 @@ ADD COLUMN `fix_z` tinyint(1) UNSIGNED NOT NULL DEFAULT 1 AFTER `respawn_timer`;
|
|||||||
ManifestEntry{
|
ManifestEntry{
|
||||||
.version = 9258,
|
.version = 9258,
|
||||||
.description = "2024_02_04_base_data.sql",
|
.description = "2024_02_04_base_data.sql",
|
||||||
.check = "SHOW COLUMNS FROM `base_data` LIKE `hp_regen`",
|
.check = "SHOW COLUMNS FROM `base_data` LIKE 'hp_regen'",
|
||||||
.condition = "empty",
|
.condition = "empty",
|
||||||
.match = "",
|
.match = "",
|
||||||
.sql = R"(
|
.sql = R"(
|
||||||
@@ -5346,6 +5346,71 @@ CREATE TABLE guild_tributes (
|
|||||||
) ENGINE=InnoDB;
|
) ENGINE=InnoDB;
|
||||||
)"
|
)"
|
||||||
},
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9261,
|
||||||
|
.description = "2024_02_11_character_corpses.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `character_corpses` LIKE 'time_of_death'",
|
||||||
|
.condition = "contains",
|
||||||
|
.match = "0000-00-00 00:00:00",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `character_corpses` MODIFY COLUMN `time_of_death` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9262,
|
||||||
|
.description = "2024_02_11_object_contents.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `object_contents` LIKE 'droptime'",
|
||||||
|
.condition = "contains",
|
||||||
|
.match = "0000-00-00 00:00:00",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `object_contents` MODIFY COLUMN `droptime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9263,
|
||||||
|
.description = "2024_02_16_rearrange_zone_columns.sql",
|
||||||
|
.check = "show columns from zone like 'note'",
|
||||||
|
.condition = "missing",
|
||||||
|
.match = "varchar(200)",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `zone`
|
||||||
|
MODIFY COLUMN `id` int(10) NOT NULL AUTO_INCREMENT FIRST,
|
||||||
|
MODIFY COLUMN `zoneidnumber` int(4) NOT NULL DEFAULT 0 AFTER `id`,
|
||||||
|
MODIFY COLUMN `version` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 AFTER `zoneidnumber`,
|
||||||
|
MODIFY COLUMN `short_name` varchar(32) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL AFTER `version`,
|
||||||
|
MODIFY COLUMN `long_name` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER `short_name`,
|
||||||
|
MODIFY COLUMN `min_status` tinyint(3) UNSIGNED NOT NULL DEFAULT 0 AFTER `long_name`,
|
||||||
|
MODIFY COLUMN `note` varchar(200) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL AFTER `map_file_name`,
|
||||||
|
MODIFY COLUMN `min_expansion` tinyint(4) NOT NULL DEFAULT -1 AFTER `note`,
|
||||||
|
MODIFY COLUMN `max_expansion` tinyint(4) NOT NULL DEFAULT -1 AFTER `min_expansion`,
|
||||||
|
MODIFY COLUMN `content_flags` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL AFTER `max_expansion`,
|
||||||
|
MODIFY COLUMN `content_flags_disabled` varchar(100) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL AFTER `content_flags`,
|
||||||
|
MODIFY COLUMN `expansion` tinyint(3) NOT NULL DEFAULT 0 AFTER `content_flags_disabled`,
|
||||||
|
MODIFY COLUMN `file_name` varchar(16) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL AFTER `expansion`,
|
||||||
|
MODIFY COLUMN `safe_x` float NOT NULL DEFAULT 0 AFTER `file_name`,
|
||||||
|
MODIFY COLUMN `safe_y` float NOT NULL DEFAULT 0 AFTER `safe_x`,
|
||||||
|
MODIFY COLUMN `safe_z` float NOT NULL DEFAULT 0 AFTER `safe_y`,
|
||||||
|
MODIFY COLUMN `safe_heading` float NOT NULL DEFAULT 0 AFTER `safe_z`;
|
||||||
|
)",
|
||||||
|
.content_schema_update = true
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9264,
|
||||||
|
.description = "2024_02_18_starting_items_augments.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `starting_items` LIKE 'augment_one'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `starting_items`
|
||||||
|
ADD COLUMN `augment_one` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `item_charges`,
|
||||||
|
ADD COLUMN `augment_two` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_one`,
|
||||||
|
ADD COLUMN `augment_three` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_two`,
|
||||||
|
ADD COLUMN `augment_four` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_three`,
|
||||||
|
ADD COLUMN `augment_five` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_four`,
|
||||||
|
ADD COLUMN `augment_six` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_five`;
|
||||||
|
)",
|
||||||
|
.content_schema_update = true
|
||||||
|
}
|
||||||
// -- template; copy/paste this when you need to create a new entry
|
// -- template; copy/paste this when you need to create a new entry
|
||||||
// ManifestEntry{
|
// ManifestEntry{
|
||||||
// .version = 9228,
|
// .version = 9228,
|
||||||
|
|||||||
@@ -123,6 +123,22 @@ ALTER TABLE `bot_pets` DROP FOREIGN KEY `FK_bot_pets_1`;
|
|||||||
ALTER TABLE `bot_pet_buffs` DROP FOREIGN KEY `FK_bot_pet_buffs_1`;
|
ALTER TABLE `bot_pet_buffs` DROP FOREIGN KEY `FK_bot_pet_buffs_1`;
|
||||||
ALTER TABLE `bot_pet_inventories` DROP FOREIGN KEY `FK_bot_pet_inventories_1`;
|
ALTER TABLE `bot_pet_inventories` DROP FOREIGN KEY `FK_bot_pet_inventories_1`;
|
||||||
ALTER TABLE `bot_stances` DROP FOREIGN KEY `FK_bot_stances_1`;
|
ALTER TABLE `bot_stances` DROP FOREIGN KEY `FK_bot_stances_1`;
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9043,
|
||||||
|
.description = "2024_02_18_bot_starting_items_augments.sql",
|
||||||
|
.check = "SHOW COLUMNS FROM `bot_starting_items` LIKE 'augment_one'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
ALTER TABLE `bot_starting_items`
|
||||||
|
ADD COLUMN `augment_one` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `item_charges`,
|
||||||
|
ADD COLUMN `augment_two` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_one`,
|
||||||
|
ADD COLUMN `augment_three` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_two`,
|
||||||
|
ADD COLUMN `augment_four` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_three`,
|
||||||
|
ADD COLUMN `augment_five` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_four`,
|
||||||
|
ADD COLUMN `augment_six` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `augment_five`;
|
||||||
)"
|
)"
|
||||||
}
|
}
|
||||||
// -- template; copy/paste this when you need to create a new entry
|
// -- template; copy/paste this when you need to create a new entry
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ namespace DatabaseSchema {
|
|||||||
"friends",
|
"friends",
|
||||||
"guild_bank",
|
"guild_bank",
|
||||||
"guild_members",
|
"guild_members",
|
||||||
|
"guild_permissions",
|
||||||
"guild_ranks",
|
"guild_ranks",
|
||||||
"guild_relations",
|
"guild_relations",
|
||||||
"guild_tributes",
|
"guild_tributes",
|
||||||
@@ -333,7 +334,6 @@ namespace DatabaseSchema {
|
|||||||
"group_leaders",
|
"group_leaders",
|
||||||
"instance_list",
|
"instance_list",
|
||||||
"ip_exemptions",
|
"ip_exemptions",
|
||||||
"item_tick",
|
|
||||||
"lfguild",
|
"lfguild",
|
||||||
"merc_buffs",
|
"merc_buffs",
|
||||||
"merchantlist_temp",
|
"merchantlist_temp",
|
||||||
|
|||||||
@@ -71,6 +71,8 @@ namespace EQ
|
|||||||
bit_DeityAll = UINT32_MAX
|
bit_DeityAll = UINT32_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constexpr int format_as(DeityType type) { return static_cast<int>(type); }
|
||||||
|
|
||||||
extern DeityTypeBit GetDeityBitmask(DeityType deity_type);
|
extern DeityTypeBit GetDeityBitmask(DeityType deity_type);
|
||||||
extern std::string GetDeityName(DeityType deity_type);
|
extern std::string GetDeityName(DeityType deity_type);
|
||||||
extern const std::map<DeityType, std::string>& GetDeityMap();
|
extern const std::map<DeityType, std::string>& GetDeityMap();
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ typedef enum { //EQEmu internal opcodes list
|
|||||||
_maxEmuOpcode
|
_maxEmuOpcode
|
||||||
} EmuOpcode;
|
} EmuOpcode;
|
||||||
|
|
||||||
|
constexpr int format_as(EmuOpcode opcode) { return static_cast<int>(opcode); }
|
||||||
extern const char *OpcodeNames[_maxEmuOpcode+1];
|
extern const char *OpcodeNames[_maxEmuOpcode+1];
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1127,4 +1127,8 @@ namespace RaidLootType {
|
|||||||
constexpr uint32 EntireRaid = 4;
|
constexpr uint32 EntireRaid = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace LeadershipAbilitySlot {
|
||||||
|
constexpr uint16 HealthOfTargetsTarget = 14;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /*COMMON_EQ_CONSTANTS_H*/
|
#endif /*COMMON_EQ_CONSTANTS_H*/
|
||||||
|
|||||||
+8
-8
@@ -38,21 +38,21 @@
|
|||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
namespace fs = std::filesystem;
|
namespace fs = std::filesystem;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param name
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
bool File::Exists(const std::string &name)
|
bool File::Exists(const std::string &name)
|
||||||
{
|
{
|
||||||
return fs::exists(fs::path{name});
|
struct stat sb{};
|
||||||
|
if (stat(name.c_str(), &sb) == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param directory_name
|
|
||||||
*/
|
|
||||||
void File::Makedir(const std::string &directory_name)
|
void File::Makedir(const std::string &directory_name)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -881,7 +881,7 @@ static void ProcessGuildMember(MySQLRequestRow row, CharGuildInfo &into)
|
|||||||
if (into.guild_id == 0) {
|
if (into.guild_id == 0) {
|
||||||
into.guild_id = GUILD_NONE;
|
into.guild_id = GUILD_NONE;
|
||||||
}
|
}
|
||||||
if (into.rank > GUILD_MAX_RANK) {
|
if (into.rank > GUILD_MAX_RANK + 1) {
|
||||||
into.rank = GUILD_RANK_NONE;
|
into.rank = GUILD_RANK_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1090,7 +1090,7 @@ bool BaseGuildManager::IsGuildLeader(uint32 guild_id, uint32 char_id) const
|
|||||||
LogGuilds("Check leader for char [{}]: invalid guild", char_id);
|
LogGuilds("Check leader for char [{}]: invalid guild", char_id);
|
||||||
return (false); //invalid guild
|
return (false); //invalid guild
|
||||||
}
|
}
|
||||||
LogGuilds("Check leader for guild [{}]\, char [{}]\: leader id=[{}]", guild_id, char_id, res->second->leader);
|
LogGuilds("Check leader for guild [{}], char [{}]: leader id=[{}]", guild_id, char_id, res->second->leader);
|
||||||
return (char_id == res->second->leader);
|
return (char_id == res->second->leader);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+12
-2
@@ -75,9 +75,18 @@ class BaseGuildManager
|
|||||||
virtual ~BaseGuildManager();
|
virtual ~BaseGuildManager();
|
||||||
|
|
||||||
//this must be called before doing anything else with this object
|
//this must be called before doing anything else with this object
|
||||||
void SetDatabase(Database *db)
|
BaseGuildManager * SetDatabase(Database *db)
|
||||||
{
|
{
|
||||||
m_db = db;
|
m_db = db;
|
||||||
|
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
BaseGuildManager * SetContentDatabase(Database *db)
|
||||||
|
{
|
||||||
|
m_content_db = db;
|
||||||
|
|
||||||
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LoadGuilds();
|
bool LoadGuilds();
|
||||||
@@ -194,7 +203,8 @@ class BaseGuildManager
|
|||||||
std::map<uint32, GuildInfo *> m_guilds; //we own the pointers in this map
|
std::map<uint32, GuildInfo *> m_guilds; //we own the pointers in this map
|
||||||
void ClearGuilds(); //clears internal structure
|
void ClearGuilds(); //clears internal structure
|
||||||
|
|
||||||
Database *m_db; //we do not own this
|
Database *m_db;
|
||||||
|
Database *m_content_db;
|
||||||
|
|
||||||
bool _StoreGuildDB(uint32 guild_id);
|
bool _StoreGuildDB(uint32 guild_id);
|
||||||
GuildInfo* _CreateGuild(uint32 guild_id, std::string guild_name, uint32 leader_char_id, uint8 minstatus, std::string guild_motd, std::string motd_setter, std::string Channel, std::string URL, uint32 favour);
|
GuildInfo* _CreateGuild(uint32 guild_id, std::string guild_name, uint32 leader_char_id, uint8 minstatus, std::string guild_motd, std::string motd_setter, std::string Channel, std::string URL, uint32 favour);
|
||||||
|
|||||||
+2
-1
@@ -35,7 +35,7 @@
|
|||||||
#define GUILD_MEMBER_TI 0
|
#define GUILD_MEMBER_TI 0
|
||||||
#define GUILD_OFFICER_TI 1
|
#define GUILD_OFFICER_TI 1
|
||||||
#define GUILD_LEADER_TI 2
|
#define GUILD_LEADER_TI 2
|
||||||
#define GUILD_RANK_NONE (GUILD_MAX_RANK+1)
|
#define GUILD_RANK_NONE_TI (GUILD_MAX_RANK + 1)
|
||||||
|
|
||||||
//defines for standard ranks base on RoF2 definitions
|
//defines for standard ranks base on RoF2 definitions
|
||||||
#define GUILD_RANK_NONE 0
|
#define GUILD_RANK_NONE 0
|
||||||
@@ -81,5 +81,6 @@ typedef enum {
|
|||||||
GUILD_ACTION_MEMBERS_DEMOTE_SELF = 30,
|
GUILD_ACTION_MEMBERS_DEMOTE_SELF = 30,
|
||||||
} GuildAction;
|
} GuildAction;
|
||||||
|
|
||||||
|
constexpr int format_as(GuildAction action) { return static_cast<int>(action); }
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -1801,6 +1801,17 @@ uint32 EQ::ItemInstance::GetItemGuildFavor() const
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::vector<uint32> EQ::ItemInstance::GetAugmentIDs() const
|
||||||
|
{
|
||||||
|
std::vector<uint32> augments;
|
||||||
|
|
||||||
|
for (uint8 slot_id = invaug::SOCKET_BEGIN; slot_id <= invaug::SOCKET_END; slot_id++) {
|
||||||
|
augments.push_back(GetAugment(slot_id) ? GetAugmentItemID(slot_id) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return augments;
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// class EvolveInfo
|
// class EvolveInfo
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -300,6 +300,7 @@ namespace EQ
|
|||||||
int GetItemHeroicCorrup(bool augments = false) const;
|
int GetItemHeroicCorrup(bool augments = false) const;
|
||||||
int GetItemHaste(bool augments = false) const;
|
int GetItemHaste(bool augments = false) const;
|
||||||
uint32 GetItemGuildFavor() const;
|
uint32 GetItemGuildFavor() const;
|
||||||
|
std::vector<uint32> GetAugmentIDs() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//////////////////////////
|
//////////////////////////
|
||||||
|
|||||||
@@ -158,6 +158,7 @@ namespace RoF2
|
|||||||
slotCursor
|
slotCursor
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constexpr int16 format_as(InventorySlots slot) { return static_cast<int16>(slot); }
|
||||||
} // namespace enum_
|
} // namespace enum_
|
||||||
using namespace enum_;
|
using namespace enum_;
|
||||||
|
|
||||||
|
|||||||
@@ -692,6 +692,10 @@ namespace Titanium
|
|||||||
eq->rank = GUILD_LEADER_TI;
|
eq->rank = GUILD_LEADER_TI;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
|
eq->rank = GUILD_RANK_NONE_TI;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(eq->member_name, emu->member_name, sizeof(eq->member_name));
|
memcpy(eq->member_name, emu->member_name, sizeof(eq->member_name));
|
||||||
@@ -1417,6 +1421,7 @@ namespace Titanium
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
eq->guildrank = GUILD_RANK_NONE_TI;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1155,6 +1155,7 @@ namespace UF
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
emu_e->rank = GUILD_RANK_NONE_TI;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1256,6 +1257,10 @@ namespace UF
|
|||||||
eq->rank_ = GUILD_LEADER_TI;
|
eq->rank_ = GUILD_LEADER_TI;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
|
eq->rank_ = GUILD_RANK_NONE_TI;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
OUT(zone_id)
|
OUT(zone_id)
|
||||||
OUT(last_on)
|
OUT(last_on)
|
||||||
@@ -1291,6 +1296,10 @@ namespace UF
|
|||||||
eq->rank_ = GUILD_LEADER_TI;
|
eq->rank_ = GUILD_LEADER_TI;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
|
eq->rank_ = GUILD_RANK_NONE_TI;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
FINISH_ENCODE()
|
FINISH_ENCODE()
|
||||||
}
|
}
|
||||||
@@ -1970,6 +1979,7 @@ namespace UF
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
emu->guildrank = GUILD_RANK_NONE_TI;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2503,6 +2513,10 @@ namespace UF
|
|||||||
eq->parameter = GUILD_LEADER_TI;
|
eq->parameter = GUILD_LEADER_TI;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
|
eq->parameter = GUILD_RANK_NONE_TI;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -2545,6 +2559,7 @@ namespace UF
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
emu->rank = GUILD_RANK_NONE_TI;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3163,6 +3178,7 @@ namespace UF
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
emu->guildrank = GUILD_RANK_NONE_TI;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,12 @@ public:
|
|||||||
uint32_t classes;
|
uint32_t classes;
|
||||||
uint32_t item_id;
|
uint32_t item_id;
|
||||||
uint8_t item_charges;
|
uint8_t item_charges;
|
||||||
|
uint32_t augment_one;
|
||||||
|
uint32_t augment_two;
|
||||||
|
uint32_t augment_three;
|
||||||
|
uint32_t augment_four;
|
||||||
|
uint32_t augment_five;
|
||||||
|
uint32_t augment_six;
|
||||||
uint8_t min_status;
|
uint8_t min_status;
|
||||||
int32_t slot_id;
|
int32_t slot_id;
|
||||||
int8_t min_expansion;
|
int8_t min_expansion;
|
||||||
@@ -45,6 +51,12 @@ public:
|
|||||||
"classes",
|
"classes",
|
||||||
"item_id",
|
"item_id",
|
||||||
"item_charges",
|
"item_charges",
|
||||||
|
"augment_one",
|
||||||
|
"augment_two",
|
||||||
|
"augment_three",
|
||||||
|
"augment_four",
|
||||||
|
"augment_five",
|
||||||
|
"augment_six",
|
||||||
"min_status",
|
"min_status",
|
||||||
"slot_id",
|
"slot_id",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
@@ -62,6 +74,12 @@ public:
|
|||||||
"classes",
|
"classes",
|
||||||
"item_id",
|
"item_id",
|
||||||
"item_charges",
|
"item_charges",
|
||||||
|
"augment_one",
|
||||||
|
"augment_two",
|
||||||
|
"augment_three",
|
||||||
|
"augment_four",
|
||||||
|
"augment_five",
|
||||||
|
"augment_six",
|
||||||
"min_status",
|
"min_status",
|
||||||
"slot_id",
|
"slot_id",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
@@ -113,6 +131,12 @@ public:
|
|||||||
e.classes = 0;
|
e.classes = 0;
|
||||||
e.item_id = 0;
|
e.item_id = 0;
|
||||||
e.item_charges = 1;
|
e.item_charges = 1;
|
||||||
|
e.augment_one = 0;
|
||||||
|
e.augment_two = 0;
|
||||||
|
e.augment_three = 0;
|
||||||
|
e.augment_four = 0;
|
||||||
|
e.augment_five = 0;
|
||||||
|
e.augment_six = 0;
|
||||||
e.min_status = 0;
|
e.min_status = 0;
|
||||||
e.slot_id = -1;
|
e.slot_id = -1;
|
||||||
e.min_expansion = -1;
|
e.min_expansion = -1;
|
||||||
@@ -160,12 +184,18 @@ public:
|
|||||||
e.classes = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
e.classes = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.item_charges = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 1;
|
e.item_charges = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 1;
|
||||||
e.min_status = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
e.augment_one = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
e.slot_id = row[6] ? static_cast<int32_t>(atoi(row[6])) : -1;
|
e.augment_two = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
e.min_expansion = row[7] ? static_cast<int8_t>(atoi(row[7])) : -1;
|
e.augment_three = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
e.max_expansion = row[8] ? static_cast<int8_t>(atoi(row[8])) : -1;
|
e.augment_four = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
e.content_flags = row[9] ? row[9] : "";
|
e.augment_five = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.content_flags_disabled = row[10] ? row[10] : "";
|
e.augment_six = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
|
e.min_status = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||||
|
e.slot_id = row[12] ? static_cast<int32_t>(atoi(row[12])) : -1;
|
||||||
|
e.min_expansion = row[13] ? static_cast<int8_t>(atoi(row[13])) : -1;
|
||||||
|
e.max_expansion = row[14] ? static_cast<int8_t>(atoi(row[14])) : -1;
|
||||||
|
e.content_flags = row[15] ? row[15] : "";
|
||||||
|
e.content_flags_disabled = row[16] ? row[16] : "";
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -203,12 +233,18 @@ public:
|
|||||||
v.push_back(columns[2] + " = " + std::to_string(e.classes));
|
v.push_back(columns[2] + " = " + std::to_string(e.classes));
|
||||||
v.push_back(columns[3] + " = " + std::to_string(e.item_id));
|
v.push_back(columns[3] + " = " + std::to_string(e.item_id));
|
||||||
v.push_back(columns[4] + " = " + std::to_string(e.item_charges));
|
v.push_back(columns[4] + " = " + std::to_string(e.item_charges));
|
||||||
v.push_back(columns[5] + " = " + std::to_string(e.min_status));
|
v.push_back(columns[5] + " = " + std::to_string(e.augment_one));
|
||||||
v.push_back(columns[6] + " = " + std::to_string(e.slot_id));
|
v.push_back(columns[6] + " = " + std::to_string(e.augment_two));
|
||||||
v.push_back(columns[7] + " = " + std::to_string(e.min_expansion));
|
v.push_back(columns[7] + " = " + std::to_string(e.augment_three));
|
||||||
v.push_back(columns[8] + " = " + std::to_string(e.max_expansion));
|
v.push_back(columns[8] + " = " + std::to_string(e.augment_four));
|
||||||
v.push_back(columns[9] + " = '" + Strings::Escape(e.content_flags) + "'");
|
v.push_back(columns[9] + " = " + std::to_string(e.augment_five));
|
||||||
v.push_back(columns[10] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
v.push_back(columns[10] + " = " + std::to_string(e.augment_six));
|
||||||
|
v.push_back(columns[11] + " = " + std::to_string(e.min_status));
|
||||||
|
v.push_back(columns[12] + " = " + std::to_string(e.slot_id));
|
||||||
|
v.push_back(columns[13] + " = " + std::to_string(e.min_expansion));
|
||||||
|
v.push_back(columns[14] + " = " + std::to_string(e.max_expansion));
|
||||||
|
v.push_back(columns[15] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||||
|
v.push_back(columns[16] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -235,6 +271,12 @@ public:
|
|||||||
v.push_back(std::to_string(e.classes));
|
v.push_back(std::to_string(e.classes));
|
||||||
v.push_back(std::to_string(e.item_id));
|
v.push_back(std::to_string(e.item_id));
|
||||||
v.push_back(std::to_string(e.item_charges));
|
v.push_back(std::to_string(e.item_charges));
|
||||||
|
v.push_back(std::to_string(e.augment_one));
|
||||||
|
v.push_back(std::to_string(e.augment_two));
|
||||||
|
v.push_back(std::to_string(e.augment_three));
|
||||||
|
v.push_back(std::to_string(e.augment_four));
|
||||||
|
v.push_back(std::to_string(e.augment_five));
|
||||||
|
v.push_back(std::to_string(e.augment_six));
|
||||||
v.push_back(std::to_string(e.min_status));
|
v.push_back(std::to_string(e.min_status));
|
||||||
v.push_back(std::to_string(e.slot_id));
|
v.push_back(std::to_string(e.slot_id));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
@@ -275,6 +317,12 @@ public:
|
|||||||
v.push_back(std::to_string(e.classes));
|
v.push_back(std::to_string(e.classes));
|
||||||
v.push_back(std::to_string(e.item_id));
|
v.push_back(std::to_string(e.item_id));
|
||||||
v.push_back(std::to_string(e.item_charges));
|
v.push_back(std::to_string(e.item_charges));
|
||||||
|
v.push_back(std::to_string(e.augment_one));
|
||||||
|
v.push_back(std::to_string(e.augment_two));
|
||||||
|
v.push_back(std::to_string(e.augment_three));
|
||||||
|
v.push_back(std::to_string(e.augment_four));
|
||||||
|
v.push_back(std::to_string(e.augment_five));
|
||||||
|
v.push_back(std::to_string(e.augment_six));
|
||||||
v.push_back(std::to_string(e.min_status));
|
v.push_back(std::to_string(e.min_status));
|
||||||
v.push_back(std::to_string(e.slot_id));
|
v.push_back(std::to_string(e.slot_id));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
@@ -319,12 +367,18 @@ public:
|
|||||||
e.classes = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
e.classes = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.item_charges = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 1;
|
e.item_charges = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 1;
|
||||||
e.min_status = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
e.augment_one = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
e.slot_id = row[6] ? static_cast<int32_t>(atoi(row[6])) : -1;
|
e.augment_two = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
e.min_expansion = row[7] ? static_cast<int8_t>(atoi(row[7])) : -1;
|
e.augment_three = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
e.max_expansion = row[8] ? static_cast<int8_t>(atoi(row[8])) : -1;
|
e.augment_four = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
e.content_flags = row[9] ? row[9] : "";
|
e.augment_five = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.content_flags_disabled = row[10] ? row[10] : "";
|
e.augment_six = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
|
e.min_status = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||||
|
e.slot_id = row[12] ? static_cast<int32_t>(atoi(row[12])) : -1;
|
||||||
|
e.min_expansion = row[13] ? static_cast<int8_t>(atoi(row[13])) : -1;
|
||||||
|
e.max_expansion = row[14] ? static_cast<int8_t>(atoi(row[14])) : -1;
|
||||||
|
e.content_flags = row[15] ? row[15] : "";
|
||||||
|
e.content_flags_disabled = row[16] ? row[16] : "";
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -354,12 +408,18 @@ public:
|
|||||||
e.classes = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
e.classes = row[2] ? static_cast<uint32_t>(strtoul(row[2], nullptr, 10)) : 0;
|
||||||
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
e.item_id = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
|
||||||
e.item_charges = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 1;
|
e.item_charges = row[4] ? static_cast<uint8_t>(strtoul(row[4], nullptr, 10)) : 1;
|
||||||
e.min_status = row[5] ? static_cast<uint8_t>(strtoul(row[5], nullptr, 10)) : 0;
|
e.augment_one = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
e.slot_id = row[6] ? static_cast<int32_t>(atoi(row[6])) : -1;
|
e.augment_two = row[6] ? static_cast<uint32_t>(strtoul(row[6], nullptr, 10)) : 0;
|
||||||
e.min_expansion = row[7] ? static_cast<int8_t>(atoi(row[7])) : -1;
|
e.augment_three = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
e.max_expansion = row[8] ? static_cast<int8_t>(atoi(row[8])) : -1;
|
e.augment_four = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
e.content_flags = row[9] ? row[9] : "";
|
e.augment_five = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.content_flags_disabled = row[10] ? row[10] : "";
|
e.augment_six = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
|
e.min_status = row[11] ? static_cast<uint8_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||||
|
e.slot_id = row[12] ? static_cast<int32_t>(atoi(row[12])) : -1;
|
||||||
|
e.min_expansion = row[13] ? static_cast<int8_t>(atoi(row[13])) : -1;
|
||||||
|
e.max_expansion = row[14] ? static_cast<int8_t>(atoi(row[14])) : -1;
|
||||||
|
e.content_flags = row[15] ? row[15] : "";
|
||||||
|
e.content_flags_disabled = row[16] ? row[16] : "";
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -439,6 +499,12 @@ public:
|
|||||||
v.push_back(std::to_string(e.classes));
|
v.push_back(std::to_string(e.classes));
|
||||||
v.push_back(std::to_string(e.item_id));
|
v.push_back(std::to_string(e.item_id));
|
||||||
v.push_back(std::to_string(e.item_charges));
|
v.push_back(std::to_string(e.item_charges));
|
||||||
|
v.push_back(std::to_string(e.augment_one));
|
||||||
|
v.push_back(std::to_string(e.augment_two));
|
||||||
|
v.push_back(std::to_string(e.augment_three));
|
||||||
|
v.push_back(std::to_string(e.augment_four));
|
||||||
|
v.push_back(std::to_string(e.augment_five));
|
||||||
|
v.push_back(std::to_string(e.augment_six));
|
||||||
v.push_back(std::to_string(e.min_status));
|
v.push_back(std::to_string(e.min_status));
|
||||||
v.push_back(std::to_string(e.slot_id));
|
v.push_back(std::to_string(e.slot_id));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
@@ -472,6 +538,12 @@ public:
|
|||||||
v.push_back(std::to_string(e.classes));
|
v.push_back(std::to_string(e.classes));
|
||||||
v.push_back(std::to_string(e.item_id));
|
v.push_back(std::to_string(e.item_id));
|
||||||
v.push_back(std::to_string(e.item_charges));
|
v.push_back(std::to_string(e.item_charges));
|
||||||
|
v.push_back(std::to_string(e.augment_one));
|
||||||
|
v.push_back(std::to_string(e.augment_two));
|
||||||
|
v.push_back(std::to_string(e.augment_three));
|
||||||
|
v.push_back(std::to_string(e.augment_four));
|
||||||
|
v.push_back(std::to_string(e.augment_five));
|
||||||
|
v.push_back(std::to_string(e.augment_six));
|
||||||
v.push_back(std::to_string(e.min_status));
|
v.push_back(std::to_string(e.min_status));
|
||||||
v.push_back(std::to_string(e.slot_id));
|
v.push_back(std::to_string(e.slot_id));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ public:
|
|||||||
e.y = 0;
|
e.y = 0;
|
||||||
e.z = 0;
|
e.z = 0;
|
||||||
e.heading = 0;
|
e.heading = 0;
|
||||||
e.time_of_death = 0;
|
e.time_of_death = std::time(nullptr);
|
||||||
e.guild_consent_id = 0;
|
e.guild_consent_id = 0;
|
||||||
e.is_rezzed = 0;
|
e.is_rezzed = 0;
|
||||||
e.is_buried = 0;
|
e.is_buried = 0;
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ public:
|
|||||||
e.bagidx = 0;
|
e.bagidx = 0;
|
||||||
e.itemid = 0;
|
e.itemid = 0;
|
||||||
e.charges = 0;
|
e.charges = 0;
|
||||||
e.droptime = 0;
|
e.droptime = std::time(nullptr);
|
||||||
e.augslot1 = 0;
|
e.augslot1 = 0;
|
||||||
e.augslot2 = 0;
|
e.augslot2 = 0;
|
||||||
e.augslot3 = 0;
|
e.augslot3 = 0;
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ public:
|
|||||||
std::string zone_id_list;
|
std::string zone_id_list;
|
||||||
uint32_t item_id;
|
uint32_t item_id;
|
||||||
uint8_t item_charges;
|
uint8_t item_charges;
|
||||||
|
uint32_t augment_one;
|
||||||
|
uint32_t augment_two;
|
||||||
|
uint32_t augment_three;
|
||||||
|
uint32_t augment_four;
|
||||||
|
uint32_t augment_five;
|
||||||
|
uint32_t augment_six;
|
||||||
int32_t status;
|
int32_t status;
|
||||||
int32_t inventory_slot;
|
int32_t inventory_slot;
|
||||||
int8_t min_expansion;
|
int8_t min_expansion;
|
||||||
@@ -49,6 +55,12 @@ public:
|
|||||||
"zone_id_list",
|
"zone_id_list",
|
||||||
"item_id",
|
"item_id",
|
||||||
"item_charges",
|
"item_charges",
|
||||||
|
"augment_one",
|
||||||
|
"augment_two",
|
||||||
|
"augment_three",
|
||||||
|
"augment_four",
|
||||||
|
"augment_five",
|
||||||
|
"augment_six",
|
||||||
"status",
|
"status",
|
||||||
"inventory_slot",
|
"inventory_slot",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
@@ -68,6 +80,12 @@ public:
|
|||||||
"zone_id_list",
|
"zone_id_list",
|
||||||
"item_id",
|
"item_id",
|
||||||
"item_charges",
|
"item_charges",
|
||||||
|
"augment_one",
|
||||||
|
"augment_two",
|
||||||
|
"augment_three",
|
||||||
|
"augment_four",
|
||||||
|
"augment_five",
|
||||||
|
"augment_six",
|
||||||
"status",
|
"status",
|
||||||
"inventory_slot",
|
"inventory_slot",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
@@ -121,6 +139,12 @@ public:
|
|||||||
e.zone_id_list = "";
|
e.zone_id_list = "";
|
||||||
e.item_id = 0;
|
e.item_id = 0;
|
||||||
e.item_charges = 1;
|
e.item_charges = 1;
|
||||||
|
e.augment_one = 0;
|
||||||
|
e.augment_two = 0;
|
||||||
|
e.augment_three = 0;
|
||||||
|
e.augment_four = 0;
|
||||||
|
e.augment_five = 0;
|
||||||
|
e.augment_six = 0;
|
||||||
e.status = 0;
|
e.status = 0;
|
||||||
e.inventory_slot = -1;
|
e.inventory_slot = -1;
|
||||||
e.min_expansion = -1;
|
e.min_expansion = -1;
|
||||||
@@ -170,12 +194,18 @@ public:
|
|||||||
e.zone_id_list = row[4] ? row[4] : "";
|
e.zone_id_list = row[4] ? row[4] : "";
|
||||||
e.item_id = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
e.item_id = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
e.item_charges = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 1;
|
e.item_charges = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 1;
|
||||||
e.status = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
|
e.augment_one = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
e.inventory_slot = row[8] ? static_cast<int32_t>(atoi(row[8])) : -1;
|
e.augment_two = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
e.min_expansion = row[9] ? static_cast<int8_t>(atoi(row[9])) : -1;
|
e.augment_three = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.max_expansion = row[10] ? static_cast<int8_t>(atoi(row[10])) : -1;
|
e.augment_four = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
e.content_flags = row[11] ? row[11] : "";
|
e.augment_five = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||||
e.content_flags_disabled = row[12] ? row[12] : "";
|
e.augment_six = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||||
|
e.status = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
|
||||||
|
e.inventory_slot = row[14] ? static_cast<int32_t>(atoi(row[14])) : -1;
|
||||||
|
e.min_expansion = row[15] ? static_cast<int8_t>(atoi(row[15])) : -1;
|
||||||
|
e.max_expansion = row[16] ? static_cast<int8_t>(atoi(row[16])) : -1;
|
||||||
|
e.content_flags = row[17] ? row[17] : "";
|
||||||
|
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -215,12 +245,18 @@ public:
|
|||||||
v.push_back(columns[4] + " = '" + Strings::Escape(e.zone_id_list) + "'");
|
v.push_back(columns[4] + " = '" + Strings::Escape(e.zone_id_list) + "'");
|
||||||
v.push_back(columns[5] + " = " + std::to_string(e.item_id));
|
v.push_back(columns[5] + " = " + std::to_string(e.item_id));
|
||||||
v.push_back(columns[6] + " = " + std::to_string(e.item_charges));
|
v.push_back(columns[6] + " = " + std::to_string(e.item_charges));
|
||||||
v.push_back(columns[7] + " = " + std::to_string(e.status));
|
v.push_back(columns[7] + " = " + std::to_string(e.augment_one));
|
||||||
v.push_back(columns[8] + " = " + std::to_string(e.inventory_slot));
|
v.push_back(columns[8] + " = " + std::to_string(e.augment_two));
|
||||||
v.push_back(columns[9] + " = " + std::to_string(e.min_expansion));
|
v.push_back(columns[9] + " = " + std::to_string(e.augment_three));
|
||||||
v.push_back(columns[10] + " = " + std::to_string(e.max_expansion));
|
v.push_back(columns[10] + " = " + std::to_string(e.augment_four));
|
||||||
v.push_back(columns[11] + " = '" + Strings::Escape(e.content_flags) + "'");
|
v.push_back(columns[11] + " = " + std::to_string(e.augment_five));
|
||||||
v.push_back(columns[12] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
v.push_back(columns[12] + " = " + std::to_string(e.augment_six));
|
||||||
|
v.push_back(columns[13] + " = " + std::to_string(e.status));
|
||||||
|
v.push_back(columns[14] + " = " + std::to_string(e.inventory_slot));
|
||||||
|
v.push_back(columns[15] + " = " + std::to_string(e.min_expansion));
|
||||||
|
v.push_back(columns[16] + " = " + std::to_string(e.max_expansion));
|
||||||
|
v.push_back(columns[17] + " = '" + Strings::Escape(e.content_flags) + "'");
|
||||||
|
v.push_back(columns[18] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -249,6 +285,12 @@ public:
|
|||||||
v.push_back("'" + Strings::Escape(e.zone_id_list) + "'");
|
v.push_back("'" + Strings::Escape(e.zone_id_list) + "'");
|
||||||
v.push_back(std::to_string(e.item_id));
|
v.push_back(std::to_string(e.item_id));
|
||||||
v.push_back(std::to_string(e.item_charges));
|
v.push_back(std::to_string(e.item_charges));
|
||||||
|
v.push_back(std::to_string(e.augment_one));
|
||||||
|
v.push_back(std::to_string(e.augment_two));
|
||||||
|
v.push_back(std::to_string(e.augment_three));
|
||||||
|
v.push_back(std::to_string(e.augment_four));
|
||||||
|
v.push_back(std::to_string(e.augment_five));
|
||||||
|
v.push_back(std::to_string(e.augment_six));
|
||||||
v.push_back(std::to_string(e.status));
|
v.push_back(std::to_string(e.status));
|
||||||
v.push_back(std::to_string(e.inventory_slot));
|
v.push_back(std::to_string(e.inventory_slot));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
@@ -291,6 +333,12 @@ public:
|
|||||||
v.push_back("'" + Strings::Escape(e.zone_id_list) + "'");
|
v.push_back("'" + Strings::Escape(e.zone_id_list) + "'");
|
||||||
v.push_back(std::to_string(e.item_id));
|
v.push_back(std::to_string(e.item_id));
|
||||||
v.push_back(std::to_string(e.item_charges));
|
v.push_back(std::to_string(e.item_charges));
|
||||||
|
v.push_back(std::to_string(e.augment_one));
|
||||||
|
v.push_back(std::to_string(e.augment_two));
|
||||||
|
v.push_back(std::to_string(e.augment_three));
|
||||||
|
v.push_back(std::to_string(e.augment_four));
|
||||||
|
v.push_back(std::to_string(e.augment_five));
|
||||||
|
v.push_back(std::to_string(e.augment_six));
|
||||||
v.push_back(std::to_string(e.status));
|
v.push_back(std::to_string(e.status));
|
||||||
v.push_back(std::to_string(e.inventory_slot));
|
v.push_back(std::to_string(e.inventory_slot));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
@@ -337,12 +385,18 @@ public:
|
|||||||
e.zone_id_list = row[4] ? row[4] : "";
|
e.zone_id_list = row[4] ? row[4] : "";
|
||||||
e.item_id = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
e.item_id = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
e.item_charges = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 1;
|
e.item_charges = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 1;
|
||||||
e.status = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
|
e.augment_one = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
e.inventory_slot = row[8] ? static_cast<int32_t>(atoi(row[8])) : -1;
|
e.augment_two = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
e.min_expansion = row[9] ? static_cast<int8_t>(atoi(row[9])) : -1;
|
e.augment_three = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.max_expansion = row[10] ? static_cast<int8_t>(atoi(row[10])) : -1;
|
e.augment_four = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
e.content_flags = row[11] ? row[11] : "";
|
e.augment_five = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||||
e.content_flags_disabled = row[12] ? row[12] : "";
|
e.augment_six = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||||
|
e.status = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
|
||||||
|
e.inventory_slot = row[14] ? static_cast<int32_t>(atoi(row[14])) : -1;
|
||||||
|
e.min_expansion = row[15] ? static_cast<int8_t>(atoi(row[15])) : -1;
|
||||||
|
e.max_expansion = row[16] ? static_cast<int8_t>(atoi(row[16])) : -1;
|
||||||
|
e.content_flags = row[17] ? row[17] : "";
|
||||||
|
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -374,12 +428,18 @@ public:
|
|||||||
e.zone_id_list = row[4] ? row[4] : "";
|
e.zone_id_list = row[4] ? row[4] : "";
|
||||||
e.item_id = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
e.item_id = row[5] ? static_cast<uint32_t>(strtoul(row[5], nullptr, 10)) : 0;
|
||||||
e.item_charges = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 1;
|
e.item_charges = row[6] ? static_cast<uint8_t>(strtoul(row[6], nullptr, 10)) : 1;
|
||||||
e.status = row[7] ? static_cast<int32_t>(atoi(row[7])) : 0;
|
e.augment_one = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
|
||||||
e.inventory_slot = row[8] ? static_cast<int32_t>(atoi(row[8])) : -1;
|
e.augment_two = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
|
||||||
e.min_expansion = row[9] ? static_cast<int8_t>(atoi(row[9])) : -1;
|
e.augment_three = row[9] ? static_cast<uint32_t>(strtoul(row[9], nullptr, 10)) : 0;
|
||||||
e.max_expansion = row[10] ? static_cast<int8_t>(atoi(row[10])) : -1;
|
e.augment_four = row[10] ? static_cast<uint32_t>(strtoul(row[10], nullptr, 10)) : 0;
|
||||||
e.content_flags = row[11] ? row[11] : "";
|
e.augment_five = row[11] ? static_cast<uint32_t>(strtoul(row[11], nullptr, 10)) : 0;
|
||||||
e.content_flags_disabled = row[12] ? row[12] : "";
|
e.augment_six = row[12] ? static_cast<uint32_t>(strtoul(row[12], nullptr, 10)) : 0;
|
||||||
|
e.status = row[13] ? static_cast<int32_t>(atoi(row[13])) : 0;
|
||||||
|
e.inventory_slot = row[14] ? static_cast<int32_t>(atoi(row[14])) : -1;
|
||||||
|
e.min_expansion = row[15] ? static_cast<int8_t>(atoi(row[15])) : -1;
|
||||||
|
e.max_expansion = row[16] ? static_cast<int8_t>(atoi(row[16])) : -1;
|
||||||
|
e.content_flags = row[17] ? row[17] : "";
|
||||||
|
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -461,6 +521,12 @@ public:
|
|||||||
v.push_back("'" + Strings::Escape(e.zone_id_list) + "'");
|
v.push_back("'" + Strings::Escape(e.zone_id_list) + "'");
|
||||||
v.push_back(std::to_string(e.item_id));
|
v.push_back(std::to_string(e.item_id));
|
||||||
v.push_back(std::to_string(e.item_charges));
|
v.push_back(std::to_string(e.item_charges));
|
||||||
|
v.push_back(std::to_string(e.augment_one));
|
||||||
|
v.push_back(std::to_string(e.augment_two));
|
||||||
|
v.push_back(std::to_string(e.augment_three));
|
||||||
|
v.push_back(std::to_string(e.augment_four));
|
||||||
|
v.push_back(std::to_string(e.augment_five));
|
||||||
|
v.push_back(std::to_string(e.augment_six));
|
||||||
v.push_back(std::to_string(e.status));
|
v.push_back(std::to_string(e.status));
|
||||||
v.push_back(std::to_string(e.inventory_slot));
|
v.push_back(std::to_string(e.inventory_slot));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
@@ -496,6 +562,12 @@ public:
|
|||||||
v.push_back("'" + Strings::Escape(e.zone_id_list) + "'");
|
v.push_back("'" + Strings::Escape(e.zone_id_list) + "'");
|
||||||
v.push_back(std::to_string(e.item_id));
|
v.push_back(std::to_string(e.item_id));
|
||||||
v.push_back(std::to_string(e.item_charges));
|
v.push_back(std::to_string(e.item_charges));
|
||||||
|
v.push_back(std::to_string(e.augment_one));
|
||||||
|
v.push_back(std::to_string(e.augment_two));
|
||||||
|
v.push_back(std::to_string(e.augment_three));
|
||||||
|
v.push_back(std::to_string(e.augment_four));
|
||||||
|
v.push_back(std::to_string(e.augment_five));
|
||||||
|
v.push_back(std::to_string(e.augment_six));
|
||||||
v.push_back(std::to_string(e.status));
|
v.push_back(std::to_string(e.status));
|
||||||
v.push_back(std::to_string(e.inventory_slot));
|
v.push_back(std::to_string(e.inventory_slot));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
|
|||||||
@@ -0,0 +1,392 @@
|
|||||||
|
/**
|
||||||
|
* DO NOT MODIFY THIS FILE
|
||||||
|
*
|
||||||
|
* This repository was automatically generated and is NOT to be modified directly.
|
||||||
|
* Any repository modifications are meant to be made to the repository extending the base.
|
||||||
|
* Any modifications to base repositories are to be made by the generator only
|
||||||
|
*
|
||||||
|
* @generator ./utils/scripts/generators/repository-generator.pl
|
||||||
|
* @docs https://docs.eqemu.io/developer/repositories
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef EQEMU_BASE_ZONE_FLAGS_REPOSITORY_H
|
||||||
|
#define EQEMU_BASE_ZONE_FLAGS_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../../database.h"
|
||||||
|
#include "../../strings.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
|
class BaseZoneFlagsRepository {
|
||||||
|
public:
|
||||||
|
struct ZoneFlags {
|
||||||
|
int32_t charID;
|
||||||
|
int32_t zoneID;
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::string PrimaryKey()
|
||||||
|
{
|
||||||
|
return std::string("charID");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> Columns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"charID",
|
||||||
|
"zoneID",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"charID",
|
||||||
|
"zoneID",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string ColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(Strings::Implode(", ", Columns()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string SelectColumnsRaw()
|
||||||
|
{
|
||||||
|
return std::string(Strings::Implode(", ", SelectColumns()));
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string TableName()
|
||||||
|
{
|
||||||
|
return std::string("zone_flags");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseSelect()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"SELECT {} FROM {}",
|
||||||
|
SelectColumnsRaw(),
|
||||||
|
TableName()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseInsert()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"INSERT INTO {} ({}) ",
|
||||||
|
TableName(),
|
||||||
|
ColumnsRaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ZoneFlags NewEntity()
|
||||||
|
{
|
||||||
|
ZoneFlags e{};
|
||||||
|
|
||||||
|
e.charID = 0;
|
||||||
|
e.zoneID = 0;
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static ZoneFlags GetZoneFlags(
|
||||||
|
const std::vector<ZoneFlags> &zone_flagss,
|
||||||
|
int zone_flags_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
for (auto &zone_flags : zone_flagss) {
|
||||||
|
if (zone_flags.charID == zone_flags_id) {
|
||||||
|
return zone_flags;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static ZoneFlags FindOne(
|
||||||
|
Database& db,
|
||||||
|
int zone_flags_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {} = {} LIMIT 1",
|
||||||
|
BaseSelect(),
|
||||||
|
PrimaryKey(),
|
||||||
|
zone_flags_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
auto row = results.begin();
|
||||||
|
if (results.RowCount() == 1) {
|
||||||
|
ZoneFlags e{};
|
||||||
|
|
||||||
|
e.charID = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||||
|
e.zoneID = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteOne(
|
||||||
|
Database& db,
|
||||||
|
int zone_flags_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
PrimaryKey(),
|
||||||
|
zone_flags_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int UpdateOne(
|
||||||
|
Database& db,
|
||||||
|
const ZoneFlags &e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto columns = Columns();
|
||||||
|
|
||||||
|
v.push_back(columns[0] + " = " + std::to_string(e.charID));
|
||||||
|
v.push_back(columns[1] + " = " + std::to_string(e.zoneID));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"UPDATE {} SET {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
Strings::Implode(", ", v),
|
||||||
|
PrimaryKey(),
|
||||||
|
e.charID
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ZoneFlags InsertOne(
|
||||||
|
Database& db,
|
||||||
|
ZoneFlags e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.charID));
|
||||||
|
v.push_back(std::to_string(e.zoneID));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES ({})",
|
||||||
|
BaseInsert(),
|
||||||
|
Strings::Implode(",", v)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (results.Success()) {
|
||||||
|
e.charID = results.LastInsertedID();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
e = NewEntity();
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int InsertMany(
|
||||||
|
Database& db,
|
||||||
|
const std::vector<ZoneFlags> &entries
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> insert_chunks;
|
||||||
|
|
||||||
|
for (auto &e: entries) {
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.charID));
|
||||||
|
v.push_back(std::to_string(e.zoneID));
|
||||||
|
|
||||||
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES {}",
|
||||||
|
BaseInsert(),
|
||||||
|
Strings::Implode(",", insert_chunks)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<ZoneFlags> All(Database& db)
|
||||||
|
{
|
||||||
|
std::vector<ZoneFlags> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{}",
|
||||||
|
BaseSelect()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
ZoneFlags e{};
|
||||||
|
|
||||||
|
e.charID = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||||
|
e.zoneID = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
||||||
|
|
||||||
|
all_entries.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<ZoneFlags> GetWhere(Database& db, const std::string &where_filter)
|
||||||
|
{
|
||||||
|
std::vector<ZoneFlags> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {}",
|
||||||
|
BaseSelect(),
|
||||||
|
where_filter
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
ZoneFlags e{};
|
||||||
|
|
||||||
|
e.charID = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
|
||||||
|
e.zoneID = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
|
||||||
|
|
||||||
|
all_entries.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteWhere(Database& db, const std::string &where_filter)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {}",
|
||||||
|
TableName(),
|
||||||
|
where_filter
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int Truncate(Database& db)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"TRUNCATE TABLE {}",
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int64 GetMaxId(Database& db)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"SELECT COALESCE(MAX({}), 0) FROM {}",
|
||||||
|
PrimaryKey(),
|
||||||
|
TableName()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int64 Count(Database& db, const std::string &where_filter = "")
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"SELECT COUNT(*) FROM {} {}",
|
||||||
|
TableName(),
|
||||||
|
(where_filter.empty() ? "" : "WHERE " + where_filter)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() && results.begin()[0] ? strtoll(results.begin()[0], nullptr, 10) : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseReplace()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"REPLACE INTO {} ({}) ",
|
||||||
|
TableName(),
|
||||||
|
ColumnsRaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ReplaceOne(
|
||||||
|
Database& db,
|
||||||
|
const ZoneFlags &e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.charID));
|
||||||
|
v.push_back(std::to_string(e.zoneID));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES ({})",
|
||||||
|
BaseReplace(),
|
||||||
|
Strings::Implode(",", v)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int ReplaceMany(
|
||||||
|
Database& db,
|
||||||
|
const std::vector<ZoneFlags> &entries
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> insert_chunks;
|
||||||
|
|
||||||
|
for (auto &e: entries) {
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.charID));
|
||||||
|
v.push_back(std::to_string(e.zoneID));
|
||||||
|
|
||||||
|
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES {}",
|
||||||
|
BaseReplace(),
|
||||||
|
Strings::Implode(",", insert_chunks)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //EQEMU_BASE_ZONE_FLAGS_REPOSITORY_H
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -103,7 +103,7 @@ public:
|
|||||||
{
|
{
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"SELECT MAX(`number`) FROM `{}` WHERE `zoneid` = {} AND `gridid` = {}",
|
"SELECT COALESCE(MAX(`number`), 0) FROM `{}` WHERE `zoneid` = {} AND `gridid` = {}",
|
||||||
TableName(),
|
TableName(),
|
||||||
zone_id,
|
zone_id,
|
||||||
grid_id
|
grid_id
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
#ifndef EQEMU_ZONE_FLAGS_REPOSITORY_H
|
||||||
|
#define EQEMU_ZONE_FLAGS_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../database.h"
|
||||||
|
#include "../strings.h"
|
||||||
|
#include "base/base_zone_flags_repository.h"
|
||||||
|
|
||||||
|
class ZoneFlagsRepository: public BaseZoneFlagsRepository {
|
||||||
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This file was auto generated and can be modified and extended upon
|
||||||
|
*
|
||||||
|
* Base repository methods are automatically
|
||||||
|
* generated in the "base" version of this repository. The base repository
|
||||||
|
* is immutable and to be left untouched, while methods in this class
|
||||||
|
* are used as extension methods for more specific persistence-layer
|
||||||
|
* accessors or mutators.
|
||||||
|
*
|
||||||
|
* Base Methods (Subject to be expanded upon in time)
|
||||||
|
*
|
||||||
|
* Note: Not all tables are designed appropriately to fit functionality with all base methods
|
||||||
|
*
|
||||||
|
* InsertOne
|
||||||
|
* UpdateOne
|
||||||
|
* DeleteOne
|
||||||
|
* FindOne
|
||||||
|
* GetWhere(std::string where_filter)
|
||||||
|
* DeleteWhere(std::string where_filter)
|
||||||
|
* InsertMany
|
||||||
|
* All
|
||||||
|
*
|
||||||
|
* Example custom methods in a repository
|
||||||
|
*
|
||||||
|
* ZoneFlagsRepository::GetByZoneAndVersion(int zone_id, int zone_version)
|
||||||
|
* ZoneFlagsRepository::GetWhereNeverExpires()
|
||||||
|
* ZoneFlagsRepository::GetWhereXAndY()
|
||||||
|
* ZoneFlagsRepository::DeleteWhereXAndY()
|
||||||
|
*
|
||||||
|
* Most of the above could be covered by base methods, but if you as a developer
|
||||||
|
* find yourself re-using logic for other parts of the code, its best to just make a
|
||||||
|
* method that can be re-used easily elsewhere especially if it can use a base repository
|
||||||
|
* method and encapsulate filters there
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Custom extended repository methods here
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //EQEMU_ZONE_FLAGS_REPOSITORY_H
|
||||||
+2
-2
@@ -495,6 +495,7 @@ RULE_BOOL(Spells, EvacClearCharmPet, false, "Enable to have evac in zone clear c
|
|||||||
RULE_BOOL(Spells, ManaTapsRequireNPCMana, false, "Enabling will require target to have mana to tap. Default off as many npc's are caster class with 0 mana and need fixed.")
|
RULE_BOOL(Spells, ManaTapsRequireNPCMana, false, "Enabling will require target to have mana to tap. Default off as many npc's are caster class with 0 mana and need fixed.")
|
||||||
RULE_INT(Spells, HarmTouchCritRatio, 200, "Harmtouch crit bonus, on top of BaseCritRatio")
|
RULE_INT(Spells, HarmTouchCritRatio, 200, "Harmtouch crit bonus, on top of BaseCritRatio")
|
||||||
RULE_BOOL(Spells, UseClassicSpellFocus, false, "Enabling will tell the server to handle random focus damage as classic spell imports lack the limit values.")
|
RULE_BOOL(Spells, UseClassicSpellFocus, false, "Enabling will tell the server to handle random focus damage as classic spell imports lack the limit values.")
|
||||||
|
RULE_BOOL(Spells, ManaTapsOnAnyClass, false, "Enabling this will allow you to cast mana taps on any class, this will bypass ManaTapsRequireNPCMana rule.")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Combat)
|
RULE_CATEGORY(Combat)
|
||||||
@@ -694,7 +695,6 @@ RULE_BOOL(Bots, BotGroupXP, false, "Determines whether client gets experience fo
|
|||||||
RULE_BOOL(Bots, BotLevelsWithOwner, false, "Auto-updates spawned bots as owner levels/de-levels (false is original behavior)")
|
RULE_BOOL(Bots, BotLevelsWithOwner, false, "Auto-updates spawned bots as owner levels/de-levels (false is original behavior)")
|
||||||
RULE_INT(Bots, BotCharacterLevel, 0, "If level is greater that value player can spawn bots if BotCharacterLevelEnabled is true")
|
RULE_INT(Bots, BotCharacterLevel, 0, "If level is greater that value player can spawn bots if BotCharacterLevelEnabled is true")
|
||||||
RULE_INT(Bots, CasterStopMeleeLevel, 13, "Level at which caster bots stop melee attacks")
|
RULE_INT(Bots, CasterStopMeleeLevel, 13, "Level at which caster bots stop melee attacks")
|
||||||
RULE_BOOL(Bots, AllowOwnerOptionAltCombat, true, "When option is enabled, bots will use an auto-/shared-aggro combat model")
|
|
||||||
RULE_BOOL(Bots, AllowOwnerOptionAutoDefend, true, "When option is enabled, bots will defend their owner on enemy aggro")
|
RULE_BOOL(Bots, AllowOwnerOptionAutoDefend, true, "When option is enabled, bots will defend their owner on enemy aggro")
|
||||||
RULE_REAL(Bots, LeashDistance, 562500.0f, "Distance a bot is allowed to travel from leash owner before being pulled back (squared value)")
|
RULE_REAL(Bots, LeashDistance, 562500.0f, "Distance a bot is allowed to travel from leash owner before being pulled back (squared value)")
|
||||||
RULE_BOOL(Bots, AllowApplyPoisonCommand, true, "Allows the use of the bot command 'applypoison'")
|
RULE_BOOL(Bots, AllowApplyPoisonCommand, true, "Allows the use of the bot command 'applypoison'")
|
||||||
@@ -891,7 +891,7 @@ RULE_INT(Expansion, AutoGrantAAExpansion, -1, "Expansion to auto grant AAs up to
|
|||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|
||||||
RULE_CATEGORY(Instances)
|
RULE_CATEGORY(Instances)
|
||||||
RULE_INT(Instances, ReservedInstances, 30, "Number of instance IDs which are reserved for globals. This value should not be changed while a server is running")
|
RULE_INT(Instances, ReservedInstances, 100, "Number of instance IDs which are reserved for globals. This value should not be changed while a server is running")
|
||||||
RULE_BOOL(Instances, RecycleInstanceIds, true, "Setting whether free instance IDs should be recycled to prevent them from gradually running out at 32k")
|
RULE_BOOL(Instances, RecycleInstanceIds, true, "Setting whether free instance IDs should be recycled to prevent them from gradually running out at 32k")
|
||||||
RULE_INT(Instances, GuildHallExpirationDays, 90, "Amount of days before a Guild Hall instance expires")
|
RULE_INT(Instances, GuildHallExpirationDays, 90, "Amount of days before a Guild Hall instance expires")
|
||||||
RULE_CATEGORY_END()
|
RULE_CATEGORY_END()
|
||||||
|
|||||||
+17
-2
@@ -461,7 +461,13 @@ bool SharedDatabase::SetStartingItems(
|
|||||||
{
|
{
|
||||||
const EQ::ItemData *item_data;
|
const EQ::ItemData *item_data;
|
||||||
|
|
||||||
const auto &l = StartingItemsRepository::All(*this);
|
const auto& l = StartingItemsRepository::GetWhere(
|
||||||
|
*this,
|
||||||
|
fmt::format(
|
||||||
|
"TRUE {}",
|
||||||
|
ContentFilterCriteria::apply()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
if (l.empty()) {
|
if (l.empty()) {
|
||||||
return false;
|
return false;
|
||||||
@@ -515,7 +521,16 @@ bool SharedDatabase::SetStartingItems(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto *inst = CreateBaseItem(item_data, item_charges);
|
const auto* inst = CreateItem(
|
||||||
|
item_data,
|
||||||
|
item_charges,
|
||||||
|
e.augment_one,
|
||||||
|
e.augment_two,
|
||||||
|
e.augment_three,
|
||||||
|
e.augment_four,
|
||||||
|
e.augment_five,
|
||||||
|
e.augment_six
|
||||||
|
);
|
||||||
|
|
||||||
if (slot < EQ::invslot::slotCharm) {
|
if (slot < EQ::invslot::slotCharm) {
|
||||||
slot = inv->FindFreeSlot(false, false);
|
slot = inv->FindFreeSlot(false, false);
|
||||||
|
|||||||
@@ -162,6 +162,8 @@ namespace EQ
|
|||||||
// server profile does not reflect this yet..so, prefixed with 'PACKET_'
|
// server profile does not reflect this yet..so, prefixed with 'PACKET_'
|
||||||
#define PACKET_SKILL_ARRAY_SIZE 100
|
#define PACKET_SKILL_ARRAY_SIZE 100
|
||||||
|
|
||||||
|
constexpr int format_as(SkillType skill) { return static_cast<int>(skill); }
|
||||||
|
|
||||||
bool IsTradeskill(SkillType skill);
|
bool IsTradeskill(SkillType skill);
|
||||||
bool IsSpecializedSkill(SkillType skill);
|
bool IsSpecializedSkill(SkillType skill);
|
||||||
float GetSkillMeleePushForce(SkillType skill);
|
float GetSkillMeleePushForce(SkillType skill);
|
||||||
|
|||||||
@@ -252,6 +252,8 @@ typedef enum {
|
|||||||
ActivityCompleted = 2
|
ActivityCompleted = 2
|
||||||
} ActivityState;
|
} ActivityState;
|
||||||
|
|
||||||
|
constexpr int format_as(ActivityState state) { return static_cast<int>(state); }
|
||||||
|
|
||||||
struct ClientActivityInformation {
|
struct ClientActivityInformation {
|
||||||
int activity_id;
|
int activity_id;
|
||||||
int done_count;
|
int done_count;
|
||||||
|
|||||||
@@ -54,6 +54,8 @@ namespace EQ
|
|||||||
tintInvalid = textureInvalid
|
tintInvalid = textureInvalid
|
||||||
};
|
};
|
||||||
|
|
||||||
|
constexpr int format_as(TextureSlot slot) { return static_cast<int>(slot); }
|
||||||
|
|
||||||
const int8 LastTexture = weaponSecondary;
|
const int8 LastTexture = weaponSecondary;
|
||||||
const int8 LastTintableTexture = tintFeet;
|
const int8 LastTintableTexture = tintFeet;
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
// Build variables
|
// Build variables
|
||||||
// these get injected during the build pipeline
|
// these get injected during the build pipeline
|
||||||
#define CURRENT_VERSION "22.44.0-dev" // always append -dev to the current version for custom-builds
|
#define CURRENT_VERSION "22.45.0-dev" // always append -dev to the current version for custom-builds
|
||||||
#define LOGIN_VERSION "0.8.0"
|
#define LOGIN_VERSION "0.8.0"
|
||||||
#define COMPILE_DATE __DATE__
|
#define COMPILE_DATE __DATE__
|
||||||
#define COMPILE_TIME __TIME__
|
#define COMPILE_TIME __TIME__
|
||||||
@@ -42,8 +42,8 @@
|
|||||||
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CURRENT_BINARY_DATABASE_VERSION 9260
|
#define CURRENT_BINARY_DATABASE_VERSION 9264
|
||||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9042
|
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9043
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "eqemu-server",
|
"name": "eqemu-server",
|
||||||
"version": "22.44.0",
|
"version": "22.45.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/EQEmu/Server.git"
|
"url": "https://github.com/EQEmu/Server.git"
|
||||||
|
|||||||
@@ -168,6 +168,7 @@ int main(int argc, char **argv)
|
|||||||
|
|
||||||
content_service.SetCurrentExpansion(RuleI(Expansion, CurrentExpansion));
|
content_service.SetCurrentExpansion(RuleI(Expansion, CurrentExpansion));
|
||||||
content_service.SetDatabase(&database)
|
content_service.SetDatabase(&database)
|
||||||
|
->SetContentDatabase(&content_db)
|
||||||
->SetExpansionContext()
|
->SetExpansionContext()
|
||||||
->ReloadContentFlags();
|
->ReloadContentFlags();
|
||||||
|
|
||||||
|
|||||||
+1
-1
Submodule submodules/fmt updated: a33701196a...e69e5f977d
+5
-5
@@ -56,7 +56,7 @@ void Adventure::AddPlayer(std::string character_name, bool add_client_to_instanc
|
|||||||
{
|
{
|
||||||
if(!PlayerExists(character_name))
|
if(!PlayerExists(character_name))
|
||||||
{
|
{
|
||||||
int32 character_id = database.GetCharacterID(character_name.c_str());
|
int32 character_id = database.GetCharacterID(character_name);
|
||||||
if(character_id && add_client_to_instance)
|
if(character_id && add_client_to_instance)
|
||||||
{
|
{
|
||||||
database.AddClientToInstance(instance_id, character_id);
|
database.AddClientToInstance(instance_id, character_id);
|
||||||
@@ -72,7 +72,7 @@ void Adventure::RemovePlayer(std::string character_name)
|
|||||||
{
|
{
|
||||||
if((*iter).compare(character_name) == 0)
|
if((*iter).compare(character_name) == 0)
|
||||||
{
|
{
|
||||||
int32 character_id = database.GetCharacterID(character_name.c_str());
|
int32 character_id = database.GetCharacterID(character_name);
|
||||||
if (character_id)
|
if (character_id)
|
||||||
{
|
{
|
||||||
database.RemoveClientFromInstance(instance_id, character_id);
|
database.RemoveClientFromInstance(instance_id, character_id);
|
||||||
@@ -312,7 +312,7 @@ void Adventure::Finished(AdventureWinStatus ws)
|
|||||||
}
|
}
|
||||||
|
|
||||||
zoneserver_list.SendPacket(current->zone(), current->instance(), pack);
|
zoneserver_list.SendPacket(current->zone(), current->instance(), pack);
|
||||||
database.UpdateAdventureStatsEntry(database.GetCharacterID((*iter).c_str()), GetTemplate()->theme, (ws != AWS_Lose) ? true : false);
|
database.UpdateAdventureStatsEntry(database.GetCharacterID((*iter)), GetTemplate()->theme, (ws != AWS_Lose) ? true : false);
|
||||||
delete pack;
|
delete pack;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -337,7 +337,7 @@ void Adventure::Finished(AdventureWinStatus ws)
|
|||||||
afe.points = 0;
|
afe.points = 0;
|
||||||
}
|
}
|
||||||
adventure_manager.AddFinishedEvent(afe);
|
adventure_manager.AddFinishedEvent(afe);
|
||||||
database.UpdateAdventureStatsEntry(database.GetCharacterID((*iter).c_str()), GetTemplate()->theme, (ws != AWS_Lose) ? true : false);
|
database.UpdateAdventureStatsEntry(database.GetCharacterID((*iter)), GetTemplate()->theme, (ws != AWS_Lose) ? true : false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -363,7 +363,7 @@ void Adventure::Finished(AdventureWinStatus ws)
|
|||||||
}
|
}
|
||||||
adventure_manager.AddFinishedEvent(afe);
|
adventure_manager.AddFinishedEvent(afe);
|
||||||
|
|
||||||
database.UpdateAdventureStatsEntry(database.GetCharacterID((*iter).c_str()), GetTemplate()->theme, (ws != AWS_Lose) ? true : false);
|
database.UpdateAdventureStatsEntry(database.GetCharacterID((*iter)), GetTemplate()->theme, (ws != AWS_Lose) ? true : false);
|
||||||
}
|
}
|
||||||
++iter;
|
++iter;
|
||||||
}
|
}
|
||||||
|
|||||||
+89
-102
@@ -50,6 +50,7 @@
|
|||||||
#include "../common/zone_store.h"
|
#include "../common/zone_store.h"
|
||||||
#include "../common/repositories/account_repository.h"
|
#include "../common/repositories/account_repository.h"
|
||||||
#include "../common/repositories/player_event_logs_repository.h"
|
#include "../common/repositories/player_event_logs_repository.h"
|
||||||
|
#include "../common/repositories/inventory_repository.h"
|
||||||
#include "../common/events/player_event_logs.h"
|
#include "../common/events/player_event_logs.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -1616,7 +1617,15 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
|||||||
time_t bday = time(nullptr);
|
time_t bday = time(nullptr);
|
||||||
in_addr in;
|
in_addr in;
|
||||||
|
|
||||||
int stats_sum = cc->STR + cc->STA + cc->AGI + cc->DEX + cc->WIS + cc->INT + cc->CHA;
|
const uint32 stats_sum = (
|
||||||
|
cc->AGI +
|
||||||
|
cc->CHA +
|
||||||
|
cc->DEX +
|
||||||
|
cc->INT +
|
||||||
|
cc->STA +
|
||||||
|
cc->STR +
|
||||||
|
cc->WIS
|
||||||
|
);
|
||||||
|
|
||||||
in.s_addr = GetIP();
|
in.s_addr = GetIP();
|
||||||
|
|
||||||
@@ -1629,7 +1638,7 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
|||||||
);
|
);
|
||||||
LogInfo("Name [{}]", name);
|
LogInfo("Name [{}]", name);
|
||||||
LogInfo(
|
LogInfo(
|
||||||
"Race [{}] Class [{}] Gender [{}] Deity [{}] Start zone [{}] Tutorial [{}]",
|
"race [{}] class [{}] gender [{}] deity [{}] start_zone [{}] tutorial [{}]",
|
||||||
cc->race,
|
cc->race,
|
||||||
cc->class_,
|
cc->class_,
|
||||||
cc->gender,
|
cc->gender,
|
||||||
@@ -1637,21 +1646,20 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
|||||||
cc->start_zone,
|
cc->start_zone,
|
||||||
cc->tutorial ? "true" : "false"
|
cc->tutorial ? "true" : "false"
|
||||||
);
|
);
|
||||||
LogInfo("STR STA AGI DEX WIS INT CHA Total");
|
|
||||||
LogInfo(
|
LogInfo(
|
||||||
" [{}] [{}] [{}] [{}] [{}] [{}] [{}] [{}]",
|
"AGI [{}] CHA [{}] DEX [{}] INT [{}] STA [{}] STR [{}] WIS [{}] Total [{}]",
|
||||||
cc->STR,
|
|
||||||
cc->STA,
|
|
||||||
cc->AGI,
|
cc->AGI,
|
||||||
cc->DEX,
|
|
||||||
cc->WIS,
|
|
||||||
cc->INT,
|
|
||||||
cc->CHA,
|
cc->CHA,
|
||||||
|
cc->DEX,
|
||||||
|
cc->INT,
|
||||||
|
cc->STA,
|
||||||
|
cc->STR,
|
||||||
|
cc->WIS,
|
||||||
stats_sum
|
stats_sum
|
||||||
);
|
);
|
||||||
LogInfo("Face [{}] Eye colors [{}] [{}]", cc->face, cc->eyecolor1, cc->eyecolor2);
|
LogInfo("Face [{}] Eye Colors [{}] [{}]", cc->face, cc->eyecolor1, cc->eyecolor2);
|
||||||
LogInfo("Hairstyle [{}] Haircolor [{}]", cc->hairstyle, cc->haircolor);
|
LogInfo("Hair [{}] Hair Color [{}]", cc->hairstyle, cc->haircolor);
|
||||||
LogInfo("Beard [{}] Beardcolor [{}]", cc->beard, cc->beardcolor);
|
LogInfo("Beard [{}] Beard Color [{}]", cc->beard, cc->beardcolor);
|
||||||
|
|
||||||
/* Validate the char creation struct */
|
/* Validate the char creation struct */
|
||||||
if (m_ClientVersionBit & EQ::versions::maskSoFAndLater) {
|
if (m_ClientVersionBit & EQ::versions::maskSoFAndLater) {
|
||||||
@@ -1669,7 +1677,7 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
|||||||
/* Convert incoming cc_s to the new PlayerProfile_Struct */
|
/* Convert incoming cc_s to the new PlayerProfile_Struct */
|
||||||
memset(&pp, 0, sizeof(PlayerProfile_Struct)); // start building the profile
|
memset(&pp, 0, sizeof(PlayerProfile_Struct)); // start building the profile
|
||||||
|
|
||||||
strn0cpy(pp.name, name, 63);
|
strn0cpy(pp.name, name, sizeof(pp.name));
|
||||||
|
|
||||||
pp.race = cc->race;
|
pp.race = cc->race;
|
||||||
pp.class_ = cc->class_;
|
pp.class_ = cc->class_;
|
||||||
@@ -1696,7 +1704,7 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
|||||||
pp.lastlogin = bday;
|
pp.lastlogin = bday;
|
||||||
pp.level = 1;
|
pp.level = 1;
|
||||||
pp.points = 5;
|
pp.points = 5;
|
||||||
pp.cur_hp = 1000; // 1k hp during dev only
|
pp.cur_hp = 1000;
|
||||||
pp.hunger_level = 6000;
|
pp.hunger_level = 6000;
|
||||||
pp.thirst_level = 6000;
|
pp.thirst_level = 6000;
|
||||||
|
|
||||||
@@ -1710,13 +1718,12 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
|||||||
SetClassStartingSkills(&pp);
|
SetClassStartingSkills(&pp);
|
||||||
SetClassLanguages(&pp);
|
SetClassLanguages(&pp);
|
||||||
|
|
||||||
// strcpy(pp.servername, WorldConfig::get()->ShortName.c_str());
|
memset(pp.spell_book, std::numeric_limits<uint8>::max(), (sizeof(uint32) * EQ::spells::SPELLBOOK_SIZE));
|
||||||
|
memset(pp.mem_spells, std::numeric_limits<uint8>::max(), (sizeof(uint32) * EQ::spells::SPELL_GEM_COUNT));
|
||||||
|
|
||||||
memset(pp.spell_book, 0xFF, (sizeof(uint32) * EQ::spells::SPELLBOOK_SIZE));
|
for (auto& b : pp.buffs) {
|
||||||
memset(pp.mem_spells, 0xFF, (sizeof(uint32) * EQ::spells::SPELL_GEM_COUNT));
|
b.spellid = std::numeric_limits<uint16>::max();
|
||||||
|
}
|
||||||
for (auto& buff : pp.buffs)
|
|
||||||
buff.spellid = 0xFFFF;
|
|
||||||
|
|
||||||
/* If server is PVP by default, make all character set to it. */
|
/* If server is PVP by default, make all character set to it. */
|
||||||
pp.pvp = database.GetServerType() == 1 ? 1 : 0;
|
pp.pvp = database.GetServerType() == 1 ? 1 : 0;
|
||||||
@@ -1728,56 +1735,38 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
|||||||
pp.zone_id = RuleI(World, SoFStartZoneID);
|
pp.zone_id = RuleI(World, SoFStartZoneID);
|
||||||
cc->start_zone = pp.zone_id;
|
cc->start_zone = pp.zone_id;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
LogInfo("Found [TitaniumStartZoneID] rule setting [{}]", RuleI(World, TitaniumStartZoneID));
|
LogInfo("Found [TitaniumStartZoneID] rule setting [{}]", RuleI(World, TitaniumStartZoneID));
|
||||||
if (RuleI(World, TitaniumStartZoneID) > 0) { /* if there's a startzone variable put them in there */
|
if (RuleI(World, TitaniumStartZoneID) > 0) { /* if there's a startzone variable put them in there */
|
||||||
|
|
||||||
pp.zone_id = RuleI(World, TitaniumStartZoneID);
|
pp.zone_id = RuleI(World, TitaniumStartZoneID);
|
||||||
cc->start_zone = pp.zone_id;
|
cc->start_zone = pp.zone_id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* use normal starting zone logic to either get defaults, or if startzone was set, load that from the db table.*/
|
|
||||||
bool ValidStartZone = content_db.GetStartZone(&pp, cc, m_ClientVersionBit & EQ::versions::maskTitaniumAndEarlier);
|
|
||||||
|
|
||||||
if (!ValidStartZone){
|
/* use normal starting zone logic to either get defaults, or if startzone was set, load that from the db table.*/
|
||||||
|
const bool is_valid_start_zone = content_db.GetStartZone(&pp, cc, m_ClientVersionBit & EQ::versions::maskTitaniumAndEarlier);
|
||||||
|
if (!is_valid_start_zone){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* just in case */
|
|
||||||
if (!pp.zone_id) {
|
if (!pp.zone_id) {
|
||||||
pp.zone_id = 1; // qeynos
|
pp.zone_id = Zones::QEYNOS;
|
||||||
|
|
||||||
pp.x = pp.y = pp.z = -1;
|
pp.x = pp.y = pp.z = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set Home Binds -- yep, all of them */
|
for (uint8 slot_id = 1; slot_id < 5; slot_id++) {
|
||||||
pp.binds[1].zone_id = pp.zone_id;
|
pp.binds[slot_id].zone_id = pp.zone_id;
|
||||||
pp.binds[1].x = pp.x;
|
pp.binds[slot_id].x = pp.x;
|
||||||
pp.binds[1].y = pp.y;
|
pp.binds[slot_id].y = pp.y;
|
||||||
pp.binds[1].z = pp.z;
|
pp.binds[slot_id].z = pp.z;
|
||||||
pp.binds[1].heading = pp.heading;
|
pp.binds[slot_id].heading = pp.heading;
|
||||||
|
}
|
||||||
pp.binds[2].zone_id = pp.zone_id;
|
|
||||||
pp.binds[2].x = pp.x;
|
|
||||||
pp.binds[2].y = pp.y;
|
|
||||||
pp.binds[2].z = pp.z;
|
|
||||||
pp.binds[2].heading = pp.heading;
|
|
||||||
|
|
||||||
pp.binds[3].zone_id = pp.zone_id;
|
|
||||||
pp.binds[3].x = pp.x;
|
|
||||||
pp.binds[3].y = pp.y;
|
|
||||||
pp.binds[3].z = pp.z;
|
|
||||||
pp.binds[3].heading = pp.heading;
|
|
||||||
|
|
||||||
pp.binds[4].zone_id = pp.zone_id;
|
|
||||||
pp.binds[4].x = pp.x;
|
|
||||||
pp.binds[4].y = pp.y;
|
|
||||||
pp.binds[4].z = pp.z;
|
|
||||||
pp.binds[4].heading = pp.heading;
|
|
||||||
|
|
||||||
/* Overrides if we have the tutorial flag set! */
|
/* Overrides if we have the tutorial flag set! */
|
||||||
if (cc->tutorial && RuleB(World, EnableTutorialButton)) {
|
if (cc->tutorial && RuleB(World, EnableTutorialButton)) {
|
||||||
pp.zone_id = RuleI(World, TutorialZoneID);
|
pp.zone_id = RuleI(World, TutorialZoneID);
|
||||||
|
|
||||||
auto z = GetZone(pp.zone_id);
|
auto z = GetZone(pp.zone_id);
|
||||||
if (z) {
|
if (z) {
|
||||||
pp.x = z->safe_x;
|
pp.x = z->safe_x;
|
||||||
@@ -1797,7 +1786,7 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
|||||||
|
|
||||||
if (GetZone(pp.zone_id)) {
|
if (GetZone(pp.zone_id)) {
|
||||||
LogInfo(
|
LogInfo(
|
||||||
"Current location [{}] [{}] [{:.2f}] [{:.2f}] [{:.2f}] [{:.2f}]",
|
"Current location zone_short_name [{}] zone_id [{}] x [{:.2f}] y [{:.2f}] z [{:.2f}] heading [{:.2f}]",
|
||||||
ZoneName(pp.zone_id),
|
ZoneName(pp.zone_id),
|
||||||
pp.zone_id,
|
pp.zone_id,
|
||||||
pp.x,
|
pp.x,
|
||||||
@@ -1809,37 +1798,34 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc)
|
|||||||
|
|
||||||
if (GetZone(pp.binds[0].zone_id)) {
|
if (GetZone(pp.binds[0].zone_id)) {
|
||||||
LogInfo(
|
LogInfo(
|
||||||
"Bind location [{}] [{}] [{:.2f}] [{:.2f}] [{:.2f}]",
|
"Bind location zone_short_name [{}] zone_id [{}] x [{:.2f}] y [{:.2f}] z [{:.2f}] heading [{:.2f}]",
|
||||||
ZoneName(pp.binds[0].zone_id),
|
ZoneName(pp.binds[0].zone_id),
|
||||||
pp.binds[0].zone_id,
|
pp.binds[0].zone_id,
|
||||||
pp.binds[0].x,
|
pp.binds[0].x,
|
||||||
pp.binds[0].y,
|
pp.binds[0].y,
|
||||||
pp.binds[0].z
|
pp.binds[0].z,
|
||||||
|
pp.binds[4].heading
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetZone(pp.binds[4].zone_id)) {
|
if (GetZone(pp.binds[4].zone_id)) {
|
||||||
LogInfo(
|
LogInfo(
|
||||||
"Home location [{}] [{}] [{:.2f}] [{:.2f}] [{:.2f}]",
|
"Home location zone_short_name [{}] zone_id [{}] x [{:.2f}] y [{:.2f}] z [{:.2f}] heading [{:.2f}]",
|
||||||
ZoneName(pp.binds[4].zone_id),
|
ZoneName(pp.binds[4].zone_id),
|
||||||
pp.binds[4].zone_id,
|
pp.binds[4].zone_id,
|
||||||
pp.binds[4].x,
|
pp.binds[4].x,
|
||||||
pp.binds[4].y,
|
pp.binds[4].y,
|
||||||
pp.binds[4].z
|
pp.binds[4].z,
|
||||||
|
pp.binds[4].heading
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Starting Items inventory */
|
|
||||||
content_db.SetStartingItems(&pp, &inv, pp.race, pp.class_, pp.deity, pp.zone_id, pp.name, GetAdmin());
|
content_db.SetStartingItems(&pp, &inv, pp.race, pp.class_, pp.deity, pp.zone_id, pp.name, GetAdmin());
|
||||||
|
|
||||||
// now we give the pp and the inv we made to StoreCharacter
|
const bool success = StoreCharacter(GetAccountID(), &pp, &inv);
|
||||||
// to see if we can store it
|
|
||||||
if (!StoreCharacter(GetAccountID(), &pp, &inv)) {
|
LogInfo("Character creation {} for [{}]", success ? "succeeded" : "failed", pp.name);
|
||||||
LogInfo("Character creation failed: [{}]", pp.name);
|
return success;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
LogInfo("Character creation successful: [{}]", pp.name);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns true if the request is ok, false if there's an error
|
// returns true if the request is ok, false if there's an error
|
||||||
@@ -2312,56 +2298,57 @@ bool Client::StoreCharacter(
|
|||||||
EQ::InventoryProfile *p_inventory_profile
|
EQ::InventoryProfile *p_inventory_profile
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
uint32 character_id = 0;
|
const uint32 character_id = database.GetCharacterID(p_player_profile_struct->name);
|
||||||
char zone[50];
|
|
||||||
character_id = database.GetCharacterID(p_player_profile_struct->name);
|
|
||||||
|
|
||||||
if (!character_id) {
|
if (!character_id) {
|
||||||
LogError("StoreCharacter: no character id");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *zone_name = ZoneName(p_player_profile_struct->zone_id);
|
const std::string& zone_name = zone_store.GetZoneName(p_player_profile_struct->zone_id, true);
|
||||||
if (zone_name == nullptr) {
|
if (Strings::EqualFold(zone_name, "UNKNOWN")) {
|
||||||
/* Zone not in the DB, something to prevent crash... */
|
p_player_profile_struct->zone_id = Zones::QEYNOS;
|
||||||
strn0cpy(zone, "qeynos", 49);
|
|
||||||
p_player_profile_struct->zone_id = 1;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
strn0cpy(zone, zone_name, 49);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
database.SaveCharacterCreate(character_id, account_id, p_player_profile_struct);
|
database.SaveCharacterCreate(character_id, account_id, p_player_profile_struct);
|
||||||
|
|
||||||
std::string invquery;
|
std::vector<InventoryRepository::Inventory> v;
|
||||||
for (int16 i = EQ::invslot::EQUIPMENT_BEGIN; i <= EQ::invbag::BANK_BAGS_END;) {
|
|
||||||
const EQ::ItemInstance *new_inventory_item = p_inventory_profile->GetItem(i);
|
|
||||||
if (new_inventory_item) {
|
|
||||||
invquery = StringFormat(
|
|
||||||
"INSERT INTO `inventory` (charid, slotid, itemid, charges, color) VALUES (%u, %i, %u, %i, %u)",
|
|
||||||
character_id,
|
|
||||||
i,
|
|
||||||
new_inventory_item->GetItem()->ID,
|
|
||||||
new_inventory_item->GetCharges(),
|
|
||||||
new_inventory_item->GetColor()
|
|
||||||
);
|
|
||||||
|
|
||||||
auto results = database.QueryDatabase(invquery);
|
auto e = InventoryRepository::NewEntity();
|
||||||
|
|
||||||
|
e.charid = character_id;
|
||||||
|
|
||||||
|
for (int16 slot_id = EQ::invslot::EQUIPMENT_BEGIN; slot_id <= EQ::invbag::BANK_BAGS_END;) {
|
||||||
|
const auto inst = p_inventory_profile->GetItem(slot_id);
|
||||||
|
if (inst) {
|
||||||
|
e.slotid = slot_id;
|
||||||
|
e.itemid = inst->GetItem()->ID;
|
||||||
|
e.charges = inst->GetCharges();
|
||||||
|
e.color = inst->GetColor();
|
||||||
|
e.augslot1 = inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN);
|
||||||
|
e.augslot2 = inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 1);
|
||||||
|
e.augslot3 = inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 2);
|
||||||
|
e.augslot4 = inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 3);
|
||||||
|
e.augslot5 = inst->GetAugmentItemID(EQ::invaug::SOCKET_BEGIN + 4);
|
||||||
|
e.augslot6 = inst->GetAugmentItemID(EQ::invaug::SOCKET_END);
|
||||||
|
|
||||||
|
v.emplace_back(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == EQ::invslot::slotCursor) {
|
if (slot_id == EQ::invslot::slotCursor) {
|
||||||
i = EQ::invbag::GENERAL_BAGS_BEGIN;
|
slot_id = EQ::invbag::GENERAL_BAGS_BEGIN;
|
||||||
|
continue;
|
||||||
|
} else if (slot_id == EQ::invbag::CURSOR_BAG_END) {
|
||||||
|
slot_id = EQ::invslot::BANK_BEGIN;
|
||||||
|
continue;
|
||||||
|
} else if (slot_id == EQ::invslot::BANK_END) {
|
||||||
|
slot_id = EQ::invbag::BANK_BAGS_BEGIN;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (i == EQ::invbag::CURSOR_BAG_END) {
|
|
||||||
i = EQ::invslot::BANK_BEGIN;
|
slot_id++;
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
else if (i == EQ::invslot::BANK_END) {
|
|
||||||
i = EQ::invbag::BANK_BAGS_BEGIN;
|
if (!v.empty()) {
|
||||||
continue;
|
InventoryRepository::InsertMany(database, v);
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ void ClientListEntry::SetOnline(CLE_Status iOnline)
|
|||||||
AccountName(),
|
AccountName(),
|
||||||
AccountID(),
|
AccountID(),
|
||||||
CLEStatusString[CLE_Status::Online],
|
CLEStatusString[CLE_Status::Online],
|
||||||
iOnline
|
static_cast<int>(iOnline)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (iOnline >= CLE_Status::Online && pOnline < CLE_Status::Online) {
|
if (iOnline >= CLE_Status::Online && pOnline < CLE_Status::Online) {
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ void ClientList::SendCLEList(const int16& admin, const char* to, WorldTCPConnect
|
|||||||
fmt::format_to(std::back_inserter(out), fmt::runtime(newline));
|
fmt::format_to(std::back_inserter(out), fmt::runtime(newline));
|
||||||
}
|
}
|
||||||
fmt::format_to(std::back_inserter(out), "ID: {} Acc# {} AccName: {} IP: {}", cle->GetID(), cle->AccountID(), cle->AccountName(), inet_ntoa(in));
|
fmt::format_to(std::back_inserter(out), "ID: {} Acc# {} AccName: {} IP: {}", cle->GetID(), cle->AccountID(), cle->AccountName(), inet_ntoa(in));
|
||||||
fmt::format_to(std::back_inserter(out), "{} Stale: {} Online: {} Admin: {}", newline, cle->GetStaleCounter(), cle->Online(), cle->Admin());
|
fmt::format_to(std::back_inserter(out), "{} Stale: {} Online: {} Admin: {}", newline, cle->GetStaleCounter(), static_cast<int>(cle->Online()), cle->Admin());
|
||||||
if (cle->LSID())
|
if (cle->LSID())
|
||||||
fmt::format_to(std::back_inserter(out), "{} LSID: {} LSName: {} WorldAdmin: {}", newline, cle->LSID(), cle->LSName(), cle->WorldAdmin());
|
fmt::format_to(std::back_inserter(out), "{} LSID: {} LSName: {} WorldAdmin: {}", newline, cle->LSID(), cle->LSName(), cle->WorldAdmin());
|
||||||
if (cle->CharID())
|
if (cle->CharID())
|
||||||
|
|||||||
+11
-2
@@ -325,7 +325,7 @@ bool WorldGuildManager::LoadTributes()
|
|||||||
|
|
||||||
tribute_list.clear();
|
tribute_list.clear();
|
||||||
|
|
||||||
auto tributes = TributesRepository::All(*m_db);
|
auto tributes = TributesRepository::All(*m_content_db);
|
||||||
for (auto const& t : tributes) {
|
for (auto const& t : tributes) {
|
||||||
td.name = t.name;
|
td.name = t.name;
|
||||||
td.description = t.descr;
|
td.description = t.descr;
|
||||||
@@ -336,7 +336,7 @@ bool WorldGuildManager::LoadTributes()
|
|||||||
|
|
||||||
LogInfo("Loaded [{}] tributes", Strings::Commify(tributes.size()));
|
LogInfo("Loaded [{}] tributes", Strings::Commify(tributes.size()));
|
||||||
|
|
||||||
auto tribute_levels = TributeLevelsRepository::GetWhere(*m_db, "TRUE ORDER BY tribute_id, level");
|
auto tribute_levels = TributeLevelsRepository::GetWhere(*m_content_db, "TRUE ORDER BY tribute_id, level");
|
||||||
|
|
||||||
for (auto const& t : tribute_levels) {
|
for (auto const& t : tribute_levels) {
|
||||||
uint32 id = t.tribute_id;
|
uint32 id = t.tribute_id;
|
||||||
@@ -369,6 +369,10 @@ bool WorldGuildManager::LoadTributes()
|
|||||||
bool WorldGuildManager::RefreshGuild(uint32 guild_id)
|
bool WorldGuildManager::RefreshGuild(uint32 guild_id)
|
||||||
{
|
{
|
||||||
auto temp_guild = GetGuildByGuildID(guild_id);
|
auto temp_guild = GetGuildByGuildID(guild_id);
|
||||||
|
if (!temp_guild) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
BaseGuildManager::GuildInfo temp_guild_detail;
|
BaseGuildManager::GuildInfo temp_guild_detail;
|
||||||
|
|
||||||
if (temp_guild) {
|
if (temp_guild) {
|
||||||
@@ -389,6 +393,11 @@ bool WorldGuildManager::RefreshGuild(uint32 guild_id)
|
|||||||
LogGuilds("Found guild id [{}]. Loading details.....", db_guild.id);
|
LogGuilds("Found guild id [{}]. Loading details.....", db_guild.id);
|
||||||
_CreateGuild(db_guild.id, db_guild.name, db_guild.leader, db_guild.minstatus, db_guild.motd, db_guild.motd_setter, db_guild.channel, db_guild.url, db_guild.favor);
|
_CreateGuild(db_guild.id, db_guild.name, db_guild.leader, db_guild.minstatus, db_guild.motd, db_guild.motd_setter, db_guild.channel, db_guild.url, db_guild.favor);
|
||||||
auto guild = GetGuildByGuildID(guild_id);
|
auto guild = GetGuildByGuildID(guild_id);
|
||||||
|
if (!guild) {
|
||||||
|
LogError("Error refreshing guild id {}", guild_id);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
auto where_filter = fmt::format("guild_id = '{}'", guild_id);
|
auto where_filter = fmt::format("guild_id = '{}'", guild_id);
|
||||||
auto guild_ranks = GuildRanksRepository::GetWhere(*m_db, where_filter);
|
auto guild_ranks = GuildRanksRepository::GetWhere(*m_db, where_filter);
|
||||||
for (auto const& r : guild_ranks) {
|
for (auto const& r : guild_ranks) {
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ bool WorldBoot::DatabaseLoadRoutines(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
guild_mgr.SetDatabase(&database);
|
guild_mgr.SetDatabase(&database)->SetContentDatabase(&content_db);
|
||||||
|
|
||||||
LogInfo("Purging expired data buckets");
|
LogInfo("Purging expired data buckets");
|
||||||
database.PurgeAllDeletedDataBuckets();
|
database.PurgeAllDeletedDataBuckets();
|
||||||
@@ -381,6 +381,7 @@ bool WorldBoot::DatabaseLoadRoutines(int argc, char **argv)
|
|||||||
|
|
||||||
LogInfo("Initializing [WorldContentService]");
|
LogInfo("Initializing [WorldContentService]");
|
||||||
content_service.SetDatabase(&database)
|
content_service.SetDatabase(&database)
|
||||||
|
->SetContentDatabase(&content_db)
|
||||||
->SetExpansionContext()
|
->SetExpansionContext()
|
||||||
->ReloadContentFlags();
|
->ReloadContentFlags();
|
||||||
|
|
||||||
|
|||||||
@@ -1367,6 +1367,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
|||||||
}
|
}
|
||||||
case ServerOP_ReloadOpcodes: {
|
case ServerOP_ReloadOpcodes: {
|
||||||
ReloadAllPatches();
|
ReloadAllPatches();
|
||||||
|
zoneserver_list.SendPacket(pack);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_CZDialogueWindow:
|
case ServerOP_CZDialogueWindow:
|
||||||
|
|||||||
+2
-2
@@ -343,7 +343,7 @@ void NPC::DescribeAggro(Client *to_who, Mob *mob, bool verbose) {
|
|||||||
"{} does not have low enough faction, their Faction Level is {} ({}).",
|
"{} does not have low enough faction, their Faction Level is {} ({}).",
|
||||||
to_who->GetTargetDescription(mob),
|
to_who->GetTargetDescription(mob),
|
||||||
FactionValueToString(faction_value),
|
FactionValueToString(faction_value),
|
||||||
faction_value
|
static_cast<int>(faction_value)
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@@ -556,7 +556,7 @@ bool Mob::CheckWillAggro(Mob *mob) {
|
|||||||
LogAggro("Is In zone?:[{}]\n", mob->InZone());
|
LogAggro("Is In zone?:[{}]\n", mob->InZone());
|
||||||
LogAggro("Dist^2: [{}]\n", distance_squared);
|
LogAggro("Dist^2: [{}]\n", distance_squared);
|
||||||
LogAggro("Range^2: [{}]\n", aggro_range_squared);
|
LogAggro("Range^2: [{}]\n", aggro_range_squared);
|
||||||
LogAggro("Faction: [{}]\n", faction_value);
|
LogAggro("Faction: [{}]\n", static_cast<int>(faction_value));
|
||||||
LogAggro("AlwaysAggroFlag: [{}]\n", AlwaysAggro());
|
LogAggro("AlwaysAggroFlag: [{}]\n", AlwaysAggro());
|
||||||
LogAggro("Int: [{}]\n", GetINT());
|
LogAggro("Int: [{}]\n", GetINT());
|
||||||
LogAggro("Con: [{}]\n", GetLevelCon(mob->GetLevel()));
|
LogAggro("Con: [{}]\n", GetLevelCon(mob->GetLevel()));
|
||||||
|
|||||||
+35
-9
@@ -1164,16 +1164,29 @@ int64 Mob::GetWeaponDamage(Mob *against, const EQ::ItemInstance *weapon_item, in
|
|||||||
|
|
||||||
// check for items being illegally attained
|
// check for items being illegally attained
|
||||||
if (weapon_item) {
|
if (weapon_item) {
|
||||||
if (!weapon_item->GetItem())
|
if (!weapon_item->GetItem()) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (weapon_item->GetItemRequiredLevel(true) > GetLevel())
|
if (weapon_item->GetItemRequiredLevel(true) > GetLevel()) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!weapon_item->IsEquipable(GetBaseRace(), GetClass()))
|
if (!weapon_item->IsClassEquipable(GetClass())) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!weapon_item->IsRaceEquipable(GetBaseRace()) &&
|
||||||
|
(
|
||||||
|
!IsBot() ||
|
||||||
|
(IsBot() && !RuleB(Bots, AllowBotEquipAnyRaceGear))
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (against->GetSpecialAbility(IMMUNE_MELEE_NONMAGICAL)) {
|
if (against->GetSpecialAbility(IMMUNE_MELEE_NONMAGICAL)) {
|
||||||
if (weapon_item) {
|
if (weapon_item) {
|
||||||
// check to see if the weapon is magic
|
// check to see if the weapon is magic
|
||||||
@@ -2980,12 +2993,16 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
|
|
||||||
if (parse->HasQuestSub(GetNPCTypeID(), EVENT_DEATH_COMPLETE)) {
|
if (parse->HasQuestSub(GetNPCTypeID(), EVENT_DEATH_COMPLETE)) {
|
||||||
const auto& export_string = fmt::format(
|
const auto& export_string = fmt::format(
|
||||||
"{} {} {} {} {}",
|
"{} {} {} {} {} {} {} {} {}",
|
||||||
killer_mob ? killer_mob->GetID() : 0,
|
killer_mob ? killer_mob->GetID() : 0,
|
||||||
damage,
|
damage,
|
||||||
spell,
|
spell,
|
||||||
static_cast<int>(attack_skill),
|
static_cast<int>(attack_skill),
|
||||||
entity_id
|
entity_id,
|
||||||
|
m_combat_record.GetStartTime(),
|
||||||
|
m_combat_record.GetEndTime(),
|
||||||
|
m_combat_record.GetDamageReceived(),
|
||||||
|
m_combat_record.GetHealingReceived()
|
||||||
);
|
);
|
||||||
|
|
||||||
std::vector<std::any> args = { corpse };
|
std::vector<std::any> args = { corpse };
|
||||||
@@ -2996,12 +3013,16 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
// Zone controller process EVENT_DEATH_ZONE (Death events)
|
// Zone controller process EVENT_DEATH_ZONE (Death events)
|
||||||
if (parse->HasQuestSub(ZONE_CONTROLLER_NPC_ID, EVENT_DEATH_ZONE)) {
|
if (parse->HasQuestSub(ZONE_CONTROLLER_NPC_ID, EVENT_DEATH_ZONE)) {
|
||||||
const auto& export_string = fmt::format(
|
const auto& export_string = fmt::format(
|
||||||
"{} {} {} {} {}",
|
"{} {} {} {} {} {} {} {} {}",
|
||||||
killer_mob ? killer_mob->GetID() : 0,
|
killer_mob ? killer_mob->GetID() : 0,
|
||||||
damage,
|
damage,
|
||||||
spell,
|
spell,
|
||||||
static_cast<int>(attack_skill),
|
static_cast<int>(attack_skill),
|
||||||
entity_id
|
entity_id,
|
||||||
|
m_combat_record.GetStartTime(),
|
||||||
|
m_combat_record.GetEndTime(),
|
||||||
|
m_combat_record.GetDamageReceived(),
|
||||||
|
m_combat_record.GetHealingReceived()
|
||||||
);
|
);
|
||||||
|
|
||||||
std::vector<std::any> args = { corpse, this };
|
std::vector<std::any> args = { corpse, this };
|
||||||
@@ -4071,6 +4092,10 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
|
|||||||
|
|
||||||
//see if any runes want to reduce this damage
|
//see if any runes want to reduce this damage
|
||||||
if (!IsValidSpell(spell_id)) {
|
if (!IsValidSpell(spell_id)) {
|
||||||
|
if (IsClient()) {
|
||||||
|
CommonBreakInvisible();
|
||||||
|
}
|
||||||
|
|
||||||
damage = ReduceDamage(damage);
|
damage = ReduceDamage(damage);
|
||||||
LogCombat("Melee Damage reduced to [{}]", damage);
|
LogCombat("Melee Damage reduced to [{}]", damage);
|
||||||
damage = ReduceAllDamage(damage);
|
damage = ReduceAllDamage(damage);
|
||||||
@@ -4102,8 +4127,9 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
|
|||||||
TryTriggerThreshHold(damage, SE_TriggerSpellThreshold, attacker);
|
TryTriggerThreshHold(damage, SE_TriggerSpellThreshold, attacker);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsClient()) {
|
if (IsClient() && CastToClient()->sneaking) {
|
||||||
CommonBreakInvisible();
|
CastToClient()->sneaking = false;
|
||||||
|
SendAppearancePacket(AppearanceType::Sneak, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attacker && attacker->IsClient() && attacker->CastToClient()->sneaking) {
|
if (attacker && attacker->IsClient() && attacker->CastToClient()->sneaking) {
|
||||||
|
|||||||
+2
-2
@@ -942,12 +942,12 @@ bool ZoneDatabase::GetAuraEntry(uint16 spell_id, AuraRecord& r)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto e = l.front();
|
auto& e = l.front();
|
||||||
|
|
||||||
strn0cpy(r.name, e.name.c_str(), sizeof(r.name));
|
strn0cpy(r.name, e.name.c_str(), sizeof(r.name));
|
||||||
|
|
||||||
r.npc_type = e.npc_type;
|
r.npc_type = e.npc_type;
|
||||||
r.spell_id = spell_id;
|
r.spell_id = e.spell_id;
|
||||||
r.distance = e.distance * e.distance;
|
r.distance = e.distance * e.distance;
|
||||||
r.aura_type = e.aura_type;
|
r.aura_type = e.aura_type;
|
||||||
r.spawn_type = e.spawn_type;
|
r.spawn_type = e.spawn_type;
|
||||||
|
|||||||
+4
-6
@@ -140,11 +140,8 @@ bool Beacon::Process()
|
|||||||
if (caster && spell_iterations-- && max_targets) {
|
if (caster && spell_iterations-- && max_targets) {
|
||||||
// NPCs should never be affected by an AE they cast. PB AEs shouldn't affect caster either
|
// NPCs should never be affected by an AE they cast. PB AEs shouldn't affect caster either
|
||||||
// I don't think any other cases that get here matter
|
// I don't think any other cases that get here matter
|
||||||
const bool affect_caster = (
|
const bool affect_caster = (!caster->IsNPC() && !caster->IsAIControlled()) &&
|
||||||
!caster->IsNPC() &&
|
spells[spell_id].target_type != ST_AECaster;
|
||||||
!caster->IsAIControlled() &&
|
|
||||||
spells[spell_id].target_type != ST_AECaster
|
|
||||||
);
|
|
||||||
entity_list.AESpell(caster, this, spell_id, affect_caster, resist_adjust, &max_targets);
|
entity_list.AESpell(caster, this, spell_id, affect_caster, resist_adjust, &max_targets);
|
||||||
} else {
|
} else {
|
||||||
// spell is done casting, or caster disappeared
|
// spell is done casting, or caster disappeared
|
||||||
@@ -172,7 +169,8 @@ void Beacon::AELocationSpell(Mob *caster, uint16 cast_spell_id, int16 in_resist_
|
|||||||
caster_id = caster->GetID();
|
caster_id = caster->GetID();
|
||||||
spell_id = cast_spell_id;
|
spell_id = cast_spell_id;
|
||||||
resist_adjust = in_resist_adjust;
|
resist_adjust = in_resist_adjust;
|
||||||
spell_iterations = ((spells[spell_id].aoe_duration / 2500) < 1) ? 1 : spell_iterations;
|
spell_iterations = spells[spell_id].aoe_duration / 2500;
|
||||||
|
spell_iterations = spell_iterations < 1 ? 1 : spell_iterations; // at least 1
|
||||||
|
|
||||||
if (spells[spell_id].aoe_max_targets) {
|
if (spells[spell_id].aoe_max_targets) {
|
||||||
max_targets = spells[spell_id].aoe_max_targets;
|
max_targets = spells[spell_id].aoe_max_targets;
|
||||||
|
|||||||
+35
-172
@@ -85,7 +85,6 @@ Bot::Bot(NPCType *npcTypeData, Client* botOwner) : NPC(npcTypeData, nullptr, glm
|
|||||||
SetShowHelm(true);
|
SetShowHelm(true);
|
||||||
SetPauseAI(false);
|
SetPauseAI(false);
|
||||||
|
|
||||||
m_alt_combat_hate_timer.Start(250);
|
|
||||||
m_auto_defend_timer.Disable();
|
m_auto_defend_timer.Disable();
|
||||||
SetGuardFlag(false);
|
SetGuardFlag(false);
|
||||||
SetHoldFlag(false);
|
SetHoldFlag(false);
|
||||||
@@ -205,7 +204,6 @@ Bot::Bot(
|
|||||||
SetTaunting((GetClass() == Class::Warrior || GetClass() == Class::Paladin || GetClass() == Class::ShadowKnight) && (GetBotStance() == EQ::constants::stanceAggressive));
|
SetTaunting((GetClass() == Class::Warrior || GetClass() == Class::Paladin || GetClass() == Class::ShadowKnight) && (GetBotStance() == EQ::constants::stanceAggressive));
|
||||||
SetPauseAI(false);
|
SetPauseAI(false);
|
||||||
|
|
||||||
m_alt_combat_hate_timer.Start(250);
|
|
||||||
m_auto_defend_timer.Disable();
|
m_auto_defend_timer.Disable();
|
||||||
SetGuardFlag(false);
|
SetGuardFlag(false);
|
||||||
SetHoldFlag(false);
|
SetHoldFlag(false);
|
||||||
@@ -1958,8 +1956,6 @@ void Bot::AI_Process()
|
|||||||
|
|
||||||
HealRotationChecks();
|
HealRotationChecks();
|
||||||
|
|
||||||
bool bo_alt_combat = (RuleB(Bots, AllowOwnerOptionAltCombat) && bot_owner->GetBotOption(Client::booAltCombat));
|
|
||||||
|
|
||||||
if (GetAttackFlag()) { // Push owner's target onto our hate list
|
if (GetAttackFlag()) { // Push owner's target onto our hate list
|
||||||
SetOwnerTarget(bot_owner);
|
SetOwnerTarget(bot_owner);
|
||||||
}
|
}
|
||||||
@@ -1969,8 +1965,6 @@ void Bot::AI_Process()
|
|||||||
|
|
||||||
//ALT COMBAT (ACQUIRE HATE)
|
//ALT COMBAT (ACQUIRE HATE)
|
||||||
|
|
||||||
SetBotTarget(bot_owner, raid, bot_group, leash_owner, lo_distance, leash_distance, bo_alt_combat);
|
|
||||||
|
|
||||||
glm::vec3 Goal(0, 0, 0);
|
glm::vec3 Goal(0, 0, 0);
|
||||||
|
|
||||||
// We have aggro to choose from
|
// We have aggro to choose from
|
||||||
@@ -1996,12 +1990,6 @@ void Bot::AI_Process()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ALT COMBAT (ACQUIRE TARGET)
|
|
||||||
|
|
||||||
else if (bo_alt_combat && m_alt_combat_hate_timer.Check()) { // Find a mob from hate list to target
|
|
||||||
AcquireBotTarget(bot_group, nullptr, leash_owner, leash_distance);
|
|
||||||
}
|
|
||||||
|
|
||||||
// DEFAULT (ACQUIRE TARGET)
|
// DEFAULT (ACQUIRE TARGET)
|
||||||
|
|
||||||
// VERIFY TARGET AND STANCE
|
// VERIFY TARGET AND STANCE
|
||||||
@@ -2021,7 +2009,7 @@ void Bot::AI_Process()
|
|||||||
|
|
||||||
// TARGET VALIDATION
|
// TARGET VALIDATION
|
||||||
|
|
||||||
if (!IsValidTarget(bot_owner, leash_owner, lo_distance, leash_distance, bo_alt_combat, tar, tar_distance)) {
|
if (!IsValidTarget(bot_owner, leash_owner, lo_distance, leash_distance, tar, tar_distance)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2683,17 +2671,29 @@ void Bot::CalcMeleeDistances(const Mob* tar, const EQ::ItemInstance* const& p_it
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Bot::IsValidTarget(Client* bot_owner, Client* leash_owner, float lo_distance, float leash_distance, bool bo_alt_combat, Mob* tar, float tar_distance) {
|
bool Bot::IsValidTarget(
|
||||||
|
Client* bot_owner,
|
||||||
|
Client* leash_owner,
|
||||||
|
float lo_distance,
|
||||||
|
float leash_distance,
|
||||||
|
Mob* tar,
|
||||||
|
float tar_distance
|
||||||
|
)
|
||||||
|
{
|
||||||
if (!tar || !bot_owner || !leash_owner) {
|
if (!tar || !bot_owner || !leash_owner) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool valid_target_state = HOLDING || !tar->IsNPC() || tar->IsMezzed() || lo_distance > leash_distance || tar_distance > leash_distance;
|
const bool valid_target_state = (
|
||||||
bool valid_target = !GetAttackingFlag() && !CheckLosFN(tar) && !leash_owner->CheckLosFN(tar);
|
HOLDING ||
|
||||||
bool valid_bo_target = !GetAttackingFlag() && NOT_PULLING_BOT && !leash_owner->AutoAttackEnabled() && !tar->GetHateAmount(this) && !tar->GetHateAmount(leash_owner);
|
!tar->IsNPC() ||
|
||||||
|
tar->IsMezzed() ||
|
||||||
|
lo_distance > leash_distance ||
|
||||||
|
tar_distance > leash_distance
|
||||||
|
);
|
||||||
|
const bool valid_target = !GetAttackingFlag() && !CheckLosFN(tar) && !leash_owner->CheckLosFN(tar);
|
||||||
|
|
||||||
if (valid_target_state || valid_target || !IsAttackAllowed(tar) || (bo_alt_combat && valid_bo_target)) {
|
if (valid_target_state || valid_target || !IsAttackAllowed(tar)) {
|
||||||
// Normally, we wouldn't want to do this without class checks..but, too many issues can arise if we let enchanter animation pets run rampant
|
// Normally, we wouldn't want to do this without class checks..but, too many issues can arise if we let enchanter animation pets run rampant
|
||||||
if (HasPet()) {
|
if (HasPet()) {
|
||||||
GetPet()->RemoveFromHateList(tar);
|
GetPet()->RemoveFromHateList(tar);
|
||||||
@@ -2712,6 +2712,7 @@ bool Bot::IsValidTarget(Client* bot_owner, Client* leash_owner, float lo_distanc
|
|||||||
SetPullingFlag(false);
|
SetPullingFlag(false);
|
||||||
SetReturningFlag(false);
|
SetReturningFlag(false);
|
||||||
bot_owner->SetBotPulling(false);
|
bot_owner->SetBotPulling(false);
|
||||||
|
|
||||||
if (GetPet()) {
|
if (GetPet()) {
|
||||||
GetPet()->SetPetOrder(m_previous_pet_order);
|
GetPet()->SetPetOrder(m_previous_pet_order);
|
||||||
}
|
}
|
||||||
@@ -2723,13 +2724,15 @@ bool Bot::IsValidTarget(Client* bot_owner, Client* leash_owner, float lo_distanc
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Mob* Bot::GetBotTarget(Client* bot_owner) {
|
Mob* Bot::GetBotTarget(Client* bot_owner)
|
||||||
|
{
|
||||||
|
Mob* t = GetTarget();
|
||||||
|
|
||||||
Mob* tar = GetTarget();
|
if (!t || PASSIVE) {
|
||||||
if (!tar || PASSIVE) {
|
|
||||||
if (GetTarget()) {
|
if (GetTarget()) {
|
||||||
SetTarget(nullptr);
|
SetTarget(nullptr);
|
||||||
}
|
}
|
||||||
@@ -2737,12 +2740,13 @@ Mob* Bot::GetBotTarget(Client* bot_owner) {
|
|||||||
WipeHateList();
|
WipeHateList();
|
||||||
SetAttackFlag(false);
|
SetAttackFlag(false);
|
||||||
SetAttackingFlag(false);
|
SetAttackingFlag(false);
|
||||||
if (PULLING_BOT) {
|
|
||||||
|
|
||||||
|
if (PULLING_BOT) {
|
||||||
// 'Flags' should only be set on the bot that is pulling
|
// 'Flags' should only be set on the bot that is pulling
|
||||||
SetPullingFlag(false);
|
SetPullingFlag(false);
|
||||||
SetReturningFlag(false);
|
SetReturningFlag(false);
|
||||||
bot_owner->SetBotPulling(false);
|
bot_owner->SetBotPulling(false);
|
||||||
|
|
||||||
if (GetPet()) {
|
if (GetPet()) {
|
||||||
GetPet()->SetPetOrder(m_previous_pet_order);
|
GetPet()->SetPetOrder(m_previous_pet_order);
|
||||||
}
|
}
|
||||||
@@ -2752,84 +2756,8 @@ Mob* Bot::GetBotTarget(Client* bot_owner) {
|
|||||||
BotMeditate(true);
|
BotMeditate(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tar;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Bot::AcquireBotTarget(Group* bot_group, Raid* raid, Client* leash_owner, float leash_distance) {// Group roles can be expounded upon in the future
|
return t;
|
||||||
Mob* assist_mob = nullptr;
|
|
||||||
bool find_target = true;
|
|
||||||
|
|
||||||
if (raid) {
|
|
||||||
assist_mob = raid->GetRaidMainAssistOne();
|
|
||||||
}
|
|
||||||
else if (bot_group) {
|
|
||||||
assist_mob = entity_list.GetMob(bot_group->GetMainAssistName());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (assist_mob) {
|
|
||||||
if (assist_mob->GetTarget()) {
|
|
||||||
if (assist_mob != this) {
|
|
||||||
if (GetTarget() != assist_mob->GetTarget()) {
|
|
||||||
SetTarget(assist_mob->GetTarget());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
HasPet() &&
|
|
||||||
(
|
|
||||||
GetClass() != Class::Enchanter ||
|
|
||||||
GetPet()->GetPetType() != petAnimation ||
|
|
||||||
GetAA(aaAnimationEmpathy) >= 2
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
// This artificially inflates pet's target aggro..but, less expensive than checking hate each AI process
|
|
||||||
GetPet()->AddToHateList(assist_mob->GetTarget(), 1);
|
|
||||||
GetPet()->SetTarget(assist_mob->GetTarget());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
find_target = false;
|
|
||||||
} else if (assist_mob != this) {
|
|
||||||
if (GetTarget()) {
|
|
||||||
SetTarget(nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
HasPet() &&
|
|
||||||
(
|
|
||||||
GetClass() != Class::Enchanter ||
|
|
||||||
GetPet()->GetPetType() != petAnimation ||
|
|
||||||
GetAA(aaAnimationEmpathy) >= 1
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
GetPet()->WipeHateList();
|
|
||||||
GetPet()->SetTarget(nullptr);
|
|
||||||
}
|
|
||||||
|
|
||||||
find_target = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (find_target) {
|
|
||||||
if (IsRooted()) {
|
|
||||||
auto closest = hate_list.GetClosestEntOnHateList(this, true);
|
|
||||||
if (closest) {
|
|
||||||
SetTarget(closest);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// This will keep bots on target for now..but, future updates will allow for rooting/stunning
|
|
||||||
if (auto escaping = hate_list.GetEscapingMobOnHateList(leash_owner, leash_distance)) {
|
|
||||||
SetTarget(escaping);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!GetTarget()) {
|
|
||||||
auto most_hate = hate_list.GetMobWithMostHateOnList(this, nullptr, true);
|
|
||||||
if (most_hate) {
|
|
||||||
SetTarget(most_hate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Bot::ReturningFlagChecks(Client* bot_owner, float fm_distance) {// Need to make it back to group before clearing return flag
|
bool Bot::ReturningFlagChecks(Client* bot_owner, float fm_distance) {// Need to make it back to group before clearing return flag
|
||||||
@@ -2893,42 +2821,6 @@ bool Bot::PullingFlagChecks(Client* bot_owner) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::SetBotTarget(Client* bot_owner, Raid* raid, Group* bot_group, Client* leash_owner, float lo_distance, float leash_distance, bool bo_alt_combat) {
|
|
||||||
|
|
||||||
if (bo_alt_combat && m_alt_combat_hate_timer.Check(false)) {
|
|
||||||
// Empty hate list - let's find some aggro
|
|
||||||
if (bot_owner->IsEngaged() && !IsEngaged() && NOT_HOLDING && NOT_PASSIVE && (!bot_owner->GetBotPulling() || NOT_PULLING_BOT)) {
|
|
||||||
SetLeashOwnerTarget(leash_owner, bot_owner, lo_distance, leash_distance);
|
|
||||||
}
|
|
||||||
else if (!IsEngaged() && raid) {
|
|
||||||
for (const auto& raid_member : raid->members) {
|
|
||||||
if (!raid_member.member) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto rm_target = raid_member.member->GetTarget();
|
|
||||||
if (!rm_target || !rm_target->IsNPC()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
SetBotGroupTarget(bot_owner, leash_owner, lo_distance, leash_distance, raid_member.member, rm_target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (!IsEngaged() && bot_group) {
|
|
||||||
for (const auto& bg_member: bot_group->members) {
|
|
||||||
if (!bg_member) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto bgm_target = bg_member->GetTarget();
|
|
||||||
if (!bgm_target || !bgm_target->IsNPC()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
SetBotGroupTarget(bot_owner, leash_owner, lo_distance, leash_distance, bg_member, bgm_target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Bot::HealRotationChecks() {
|
void Bot::HealRotationChecks() {
|
||||||
|
|
||||||
if (IsMyHealRotationSet()) {
|
if (IsMyHealRotationSet()) {
|
||||||
@@ -3063,26 +2955,6 @@ Client* Bot::SetLeashOwner(Client* bot_owner, Group* bot_group, Raid* raid, uint
|
|||||||
return leash_owner;
|
return leash_owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::SetLeashOwnerTarget(Client* leash_owner, Client* bot_owner, float lo_distance, float leash_distance) {
|
|
||||||
|
|
||||||
Mob* lo_target = leash_owner->GetTarget();
|
|
||||||
if (lo_target &&
|
|
||||||
lo_target->IsNPC() &&
|
|
||||||
!lo_target->IsMezzed() &&
|
|
||||||
((bot_owner->GetBotOption(Client::booAutoDefend) && lo_target->GetHateAmount(leash_owner)) || leash_owner->AutoAttackEnabled()) &&
|
|
||||||
lo_distance <= leash_distance &&
|
|
||||||
DistanceSquared(m_Position, lo_target->GetPosition()) <= leash_distance &&
|
|
||||||
(CheckLosFN(lo_target) || leash_owner->CheckLosFN(lo_target)) &&
|
|
||||||
IsAttackAllowed(lo_target))
|
|
||||||
{
|
|
||||||
AddToHateList(lo_target, 1);
|
|
||||||
if (HasPet() && (GetClass() != Class::Enchanter || GetPet()->GetPetType() != petAnimation || GetAA(aaAnimationEmpathy) >= 2)) {
|
|
||||||
GetPet()->AddToHateList(lo_target, 1);
|
|
||||||
GetPet()->SetTarget(lo_target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Bot::SetOwnerTarget(Client* bot_owner) {
|
void Bot::SetOwnerTarget(Client* bot_owner) {
|
||||||
if (GetPet() && PULLING_BOT) {
|
if (GetPet() && PULLING_BOT) {
|
||||||
GetPet()->SetPetOrder(m_previous_pet_order);
|
GetPet()->SetPetOrder(m_previous_pet_order);
|
||||||
@@ -3155,22 +3027,6 @@ void Bot::BotPullerProcess(Client* bot_owner, Raid* raid) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bot::SetBotGroupTarget(const Client* bot_owner, Client* leash_owner, float lo_distance, float leash_distance, Mob* const& bg_member, Mob* bgm_target) {
|
|
||||||
if (!bgm_target->IsMezzed() &&
|
|
||||||
((bot_owner->GetBotOption(Client::booAutoDefend) && bgm_target->GetHateAmount(bg_member)) || leash_owner->AutoAttackEnabled()) &&
|
|
||||||
lo_distance <= leash_distance &&
|
|
||||||
DistanceSquared(m_Position, bgm_target->GetPosition()) <= leash_distance &&
|
|
||||||
(CheckLosFN(bgm_target) || leash_owner->CheckLosFN(bgm_target)) &&
|
|
||||||
IsAttackAllowed(bgm_target))
|
|
||||||
{
|
|
||||||
AddToHateList(bgm_target, 1);
|
|
||||||
if (HasPet() && (GetClass() != Class::Enchanter || GetPet()->GetPetType() != petAnimation || GetAA(aaAnimationEmpathy) >= 2)) {
|
|
||||||
GetPet()->AddToHateList(bgm_target, 1);
|
|
||||||
GetPet()->SetTarget(bgm_target);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Bot::Depop() {
|
void Bot::Depop() {
|
||||||
WipeHateList();
|
WipeHateList();
|
||||||
entity_list.RemoveFromHateLists(this);
|
entity_list.RemoveFromHateLists(this);
|
||||||
@@ -8671,10 +8527,17 @@ void Bot::AddBotStartingItems(uint16 race_id, uint8 class_id)
|
|||||||
(CanRaceEquipItem(e.item_id) || RuleB(Bots, AllowBotEquipAnyRaceGear))
|
(CanRaceEquipItem(e.item_id) || RuleB(Bots, AllowBotEquipAnyRaceGear))
|
||||||
) {
|
) {
|
||||||
auto i = BotInventoriesRepository::NewEntity();
|
auto i = BotInventoriesRepository::NewEntity();
|
||||||
|
|
||||||
i.bot_id = GetBotID();
|
i.bot_id = GetBotID();
|
||||||
i.slot_id = e.slot_id;
|
i.slot_id = e.slot_id;
|
||||||
i.item_id = e.item_id;
|
i.item_id = e.item_id;
|
||||||
i.inst_charges = e.item_charges;
|
i.inst_charges = e.item_charges;
|
||||||
|
i.augment_1 = e.augment_one;
|
||||||
|
i.augment_2 = e.augment_two;
|
||||||
|
i.augment_3 = e.augment_three;
|
||||||
|
i.augment_4 = e.augment_four;
|
||||||
|
i.augment_5 = e.augment_five;
|
||||||
|
i.augment_6 = e.augment_six;
|
||||||
|
|
||||||
v.emplace_back(i);
|
v.emplace_back(i);
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-6
@@ -781,12 +781,15 @@ public:
|
|||||||
Mob* SetFollowMob(Client* leash_owner);
|
Mob* SetFollowMob(Client* leash_owner);
|
||||||
|
|
||||||
Mob* GetBotTarget(Client* bot_owner);
|
Mob* GetBotTarget(Client* bot_owner);
|
||||||
void AcquireBotTarget(Group* bot_group, Raid* raid, Client* leash_owner, float leash_distance);
|
|
||||||
void SetBotTarget(Client* bot_owner, Raid* raid, Group* bot_group, Client* leash_owner, float lo_distance, float leash_distance, bool bo_alt_combat);
|
|
||||||
void SetLeashOwnerTarget(Client* leash_owner, Client* bot_owner, float lo_distance, float leash_distance);
|
|
||||||
void SetOwnerTarget(Client* bot_owner);
|
void SetOwnerTarget(Client* bot_owner);
|
||||||
void SetBotGroupTarget(const Client* bot_owner, Client* leash_owner, float lo_distance, float leash_distance, Mob* const& bg_member, Mob* bgm_target);
|
bool IsValidTarget(
|
||||||
bool IsValidTarget(Client* bot_owner, Client* leash_owner, float lo_distance, float leash_distance, bool bo_alt_combat, Mob* tar, float tar_distance);
|
Client* bot_owner,
|
||||||
|
Client* leash_owner,
|
||||||
|
float lo_distance,
|
||||||
|
float leash_distance,
|
||||||
|
Mob* tar,
|
||||||
|
float tar_distance
|
||||||
|
);
|
||||||
|
|
||||||
bool PullingFlagChecks(Client* bot_owner);
|
bool PullingFlagChecks(Client* bot_owner);
|
||||||
bool ReturningFlagChecks(Client* bot_owner, float fm_distance);
|
bool ReturningFlagChecks(Client* bot_owner, float fm_distance);
|
||||||
@@ -879,7 +882,6 @@ private:
|
|||||||
int32 end_regen;
|
int32 end_regen;
|
||||||
|
|
||||||
Timer m_evade_timer; // can be moved to pTimers at some point
|
Timer m_evade_timer; // can be moved to pTimers at some point
|
||||||
Timer m_alt_combat_hate_timer;
|
|
||||||
Timer m_auto_defend_timer;
|
Timer m_auto_defend_timer;
|
||||||
Timer auto_save_timer;
|
Timer auto_save_timer;
|
||||||
bool m_dirtyautohaters;
|
bool m_dirtyautohaters;
|
||||||
|
|||||||
@@ -2143,23 +2143,19 @@ bool helper_spell_list_fail(Client *bot_owner, bcst_list* spell_list, BCEnum::Sp
|
|||||||
#include "bot_commands/escape.cpp"
|
#include "bot_commands/escape.cpp"
|
||||||
#include "bot_commands/find_aliases.cpp"
|
#include "bot_commands/find_aliases.cpp"
|
||||||
#include "bot_commands/follow.cpp"
|
#include "bot_commands/follow.cpp"
|
||||||
#include "bot_commands/follow_distance.cpp"
|
|
||||||
#include "bot_commands/guard.cpp"
|
#include "bot_commands/guard.cpp"
|
||||||
#include "bot_commands/heal_rotation.cpp"
|
#include "bot_commands/heal_rotation.cpp"
|
||||||
#include "bot_commands/help.cpp"
|
#include "bot_commands/help.cpp"
|
||||||
#include "bot_commands/hold.cpp"
|
#include "bot_commands/hold.cpp"
|
||||||
#include "bot_commands/identify.cpp"
|
#include "bot_commands/identify.cpp"
|
||||||
#include "bot_commands/inspect_message.cpp"
|
|
||||||
#include "bot_commands/inventory.cpp"
|
#include "bot_commands/inventory.cpp"
|
||||||
#include "bot_commands/invisibility.cpp"
|
#include "bot_commands/invisibility.cpp"
|
||||||
#include "bot_commands/item_use.cpp"
|
#include "bot_commands/item_use.cpp"
|
||||||
#include "bot_commands/levitation.cpp"
|
#include "bot_commands/levitation.cpp"
|
||||||
#include "bot_commands/list.cpp"
|
|
||||||
#include "bot_commands/lull.cpp"
|
#include "bot_commands/lull.cpp"
|
||||||
#include "bot_commands/mesmerize.cpp"
|
#include "bot_commands/mesmerize.cpp"
|
||||||
#include "bot_commands/movement_speed.cpp"
|
#include "bot_commands/movement_speed.cpp"
|
||||||
#include "bot_commands/name.cpp"
|
#include "bot_commands/name.cpp"
|
||||||
#include "bot_commands/out_of_combat.cpp"
|
|
||||||
#include "bot_commands/owner_option.cpp"
|
#include "bot_commands/owner_option.cpp"
|
||||||
#include "bot_commands/pet.cpp"
|
#include "bot_commands/pet.cpp"
|
||||||
#include "bot_commands/pick_lock.cpp"
|
#include "bot_commands/pick_lock.cpp"
|
||||||
@@ -2167,26 +2163,18 @@ bool helper_spell_list_fail(Client *bot_owner, bcst_list* spell_list, BCEnum::Sp
|
|||||||
#include "bot_commands/precombat.cpp"
|
#include "bot_commands/precombat.cpp"
|
||||||
#include "bot_commands/pull.cpp"
|
#include "bot_commands/pull.cpp"
|
||||||
#include "bot_commands/release.cpp"
|
#include "bot_commands/release.cpp"
|
||||||
#include "bot_commands/report.cpp"
|
|
||||||
#include "bot_commands/resistance.cpp"
|
#include "bot_commands/resistance.cpp"
|
||||||
#include "bot_commands/resurrect.cpp"
|
#include "bot_commands/resurrect.cpp"
|
||||||
#include "bot_commands/rune.cpp"
|
#include "bot_commands/rune.cpp"
|
||||||
#include "bot_commands/send_home.cpp"
|
#include "bot_commands/send_home.cpp"
|
||||||
#include "bot_commands/size.cpp"
|
#include "bot_commands/size.cpp"
|
||||||
#include "bot_commands/spell.cpp"
|
#include "bot_commands/spell.cpp"
|
||||||
#include "bot_commands/stance.cpp"
|
|
||||||
#include "bot_commands/stop_melee_level.cpp"
|
|
||||||
#include "bot_commands/suffix.cpp"
|
|
||||||
#include "bot_commands/summon.cpp"
|
#include "bot_commands/summon.cpp"
|
||||||
#include "bot_commands/summon_corpse.cpp"
|
#include "bot_commands/summon_corpse.cpp"
|
||||||
#include "bot_commands/surname.cpp"
|
|
||||||
#include "bot_commands/suspend.cpp"
|
#include "bot_commands/suspend.cpp"
|
||||||
#include "bot_commands/taunt.cpp"
|
#include "bot_commands/taunt.cpp"
|
||||||
#include "bot_commands/teleport.cpp"
|
#include "bot_commands/teleport.cpp"
|
||||||
#include "bot_commands/timer.cpp"
|
#include "bot_commands/timer.cpp"
|
||||||
#include "bot_commands/toggle_archer.cpp"
|
|
||||||
#include "bot_commands/toggle_helm.cpp"
|
|
||||||
#include "bot_commands/track.cpp"
|
#include "bot_commands/track.cpp"
|
||||||
#include "bot_commands/update.cpp"
|
|
||||||
#include "bot_commands/view_combos.cpp"
|
#include "bot_commands/view_combos.cpp"
|
||||||
#include "bot_commands/water_breathing.cpp"
|
#include "bot_commands/water_breathing.cpp"
|
||||||
|
|||||||
@@ -1107,7 +1107,7 @@ void bot_command_stance(Client *c, const Seperator *sep)
|
|||||||
fmt::format(
|
fmt::format(
|
||||||
"My current stance is {} ({}).",
|
"My current stance is {} ({}).",
|
||||||
EQ::constants::GetStanceName(bot_iter->GetBotStance()),
|
EQ::constants::GetStanceName(bot_iter->GetBotStance()),
|
||||||
bot_iter->GetBotStance()
|
static_cast<int>(bot_iter->GetBotStance())
|
||||||
).c_str()
|
).c_str()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
#include "../bot_command.h"
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include "../bot_command.h"
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include "../bot_command.h"
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include "../bot_command.h"
|
|
||||||
@@ -45,11 +45,6 @@ void bot_command_owner_option(Client *c, const Seperator *sep)
|
|||||||
"<td><c \"#888888\">spawn with class-based message</td>"
|
"<td><c \"#888888\">spawn with class-based message</td>"
|
||||||
"</tr>"
|
"</tr>"
|
||||||
"<tr>"
|
"<tr>"
|
||||||
"<td><c \"#CCCCCC\">altcombat</td>"
|
|
||||||
"<td><c \"#00CC00\">enable <c \"#CCCCCC\">| <c \"#00CC00\">disable</td>"
|
|
||||||
"<td><c \"#888888\">use alternate ai combat behavior</td>"
|
|
||||||
"</tr>"
|
|
||||||
"<tr>"
|
|
||||||
"<td></td>"
|
"<td></td>"
|
||||||
"<td><c \"#00CCCC\">null</td>"
|
"<td><c \"#00CCCC\">null</td>"
|
||||||
"<td><c \"#888888\">(toggles)</td>"
|
"<td><c \"#888888\">(toggles)</td>"
|
||||||
@@ -199,28 +194,6 @@ void bot_command_owner_option(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
c->Message(Chat::White, "Bot 'spawn message' is now %s.", argument.c_str());
|
c->Message(Chat::White, "Bot 'spawn message' is now %s.", argument.c_str());
|
||||||
}
|
}
|
||||||
else if (!owner_option.compare("altcombat")) {
|
|
||||||
|
|
||||||
if (RuleB(Bots, AllowOwnerOptionAltCombat)) {
|
|
||||||
|
|
||||||
if (!argument.compare("enable")) {
|
|
||||||
c->SetBotOption(Client::booAltCombat, true);
|
|
||||||
}
|
|
||||||
else if (!argument.compare("disable")) {
|
|
||||||
c->SetBotOption(Client::booAltCombat, false);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
c->SetBotOption(Client::booAltCombat, !c->GetBotOption(Client::booAltCombat));
|
|
||||||
}
|
|
||||||
|
|
||||||
database.botdb.SaveOwnerOption(c->CharacterID(), Client::booAltCombat, c->GetBotOption(Client::booAltCombat));
|
|
||||||
|
|
||||||
c->Message(Chat::White, "Bot 'alt combat' is now %s.", (c->GetBotOption(Client::booAltCombat) ? "enabled" : "disabled"));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
c->Message(Chat::White, "Bot owner option 'altcombat' is not allowed on this server.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (!owner_option.compare("autodefend")) {
|
else if (!owner_option.compare("autodefend")) {
|
||||||
|
|
||||||
if (RuleB(Bots, AllowOwnerOptionAutoDefend)) {
|
if (RuleB(Bots, AllowOwnerOptionAutoDefend)) {
|
||||||
@@ -292,7 +265,6 @@ void bot_command_owner_option(Client *c, const Seperator *sep)
|
|||||||
"<tr>" "<td><c \"#CCCCCC\">statsupdate</td>" "<td><c \"#00CC00\">{}</td>" "</tr>"
|
"<tr>" "<td><c \"#CCCCCC\">statsupdate</td>" "<td><c \"#00CC00\">{}</td>" "</tr>"
|
||||||
"<tr>" "<td><c \"#CCCCCC\">spawnmessage</td>" "<td><c \"#00CC00\">{}</td>" "</tr>"
|
"<tr>" "<td><c \"#CCCCCC\">spawnmessage</td>" "<td><c \"#00CC00\">{}</td>" "</tr>"
|
||||||
"<tr>" "<td><c \"#CCCCCC\">spawnmessage</td>" "<td><c \"#00CC00\">{}</td>" "</tr>"
|
"<tr>" "<td><c \"#CCCCCC\">spawnmessage</td>" "<td><c \"#00CC00\">{}</td>" "</tr>"
|
||||||
"<tr>" "<td><c \"#CCCCCC\">altcombat</td>" "<td><c \"#00CC00\">{}</td>" "</tr>"
|
|
||||||
"<tr>" "<td><c \"#CCCCCC\">autodefend</td>" "<td><c \"#00CC00\">{}</td>" "</tr>"
|
"<tr>" "<td><c \"#CCCCCC\">autodefend</td>" "<td><c \"#00CC00\">{}</td>" "</tr>"
|
||||||
"<tr>" "<td><c \"#CCCCCC\">buffcounter</td>" "<td><c \"#00CC00\">{}</td>" "</tr>"
|
"<tr>" "<td><c \"#CCCCCC\">buffcounter</td>" "<td><c \"#00CC00\">{}</td>" "</tr>"
|
||||||
"<tr>" "<td><c \"#CCCCCC\">monkwumessage</td>" "<td><c \"#00CC00\">{}</td>" "</tr>"
|
"<tr>" "<td><c \"#CCCCCC\">monkwumessage</td>" "<td><c \"#00CC00\">{}</td>" "</tr>"
|
||||||
@@ -301,7 +273,6 @@ void bot_command_owner_option(Client *c, const Seperator *sep)
|
|||||||
(c->GetBotOption(Client::booStatsUpdate) ? "enabled" : "disabled"),
|
(c->GetBotOption(Client::booStatsUpdate) ? "enabled" : "disabled"),
|
||||||
(c->GetBotOption(Client::booSpawnMessageSay) ? "say" : (c->GetBotOption(Client::booSpawnMessageTell) ? "tell" : "silent")),
|
(c->GetBotOption(Client::booSpawnMessageSay) ? "say" : (c->GetBotOption(Client::booSpawnMessageTell) ? "tell" : "silent")),
|
||||||
(c->GetBotOption(Client::booSpawnMessageClassSpecific) ? "class" : "default"),
|
(c->GetBotOption(Client::booSpawnMessageClassSpecific) ? "class" : "default"),
|
||||||
(RuleB(Bots, AllowOwnerOptionAltCombat) ? (c->GetBotOption(Client::booAltCombat) ? "enabled" : "disabled") : "restricted"),
|
|
||||||
(RuleB(Bots, AllowOwnerOptionAutoDefend) ? (c->GetBotOption(Client::booAutoDefend) ? "enabled" : "disabled") : "restricted"),
|
(RuleB(Bots, AllowOwnerOptionAutoDefend) ? (c->GetBotOption(Client::booAutoDefend) ? "enabled" : "disabled") : "restricted"),
|
||||||
(c->GetBotOption(Client::booBuffCounter) ? "enabled" : "disabled"),
|
(c->GetBotOption(Client::booBuffCounter) ? "enabled" : "disabled"),
|
||||||
(c->GetBotOption(Client::booMonkWuMessage) ? "enabled" : "disabled")
|
(c->GetBotOption(Client::booMonkWuMessage) ? "enabled" : "disabled")
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
#include "../bot_command.h"
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include "../bot_command.h"
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include "../bot_command.h"
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include "../bot_command.h"
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include "../bot_command.h"
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include "../bot_command.h"
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include "../bot_command.h"
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
#include "../bot_command.h"
|
|
||||||
+63
-1
@@ -1842,7 +1842,7 @@ bool BotDatabase::SaveOwnerOption(const uint32 owner_id, size_t type, const bool
|
|||||||
Client::booDeathMarquee,
|
Client::booDeathMarquee,
|
||||||
Client::booStatsUpdate,
|
Client::booStatsUpdate,
|
||||||
Client::booSpawnMessageClassSpecific,
|
Client::booSpawnMessageClassSpecific,
|
||||||
Client::booAltCombat,
|
Client::booUnused,
|
||||||
Client::booAutoDefend,
|
Client::booAutoDefend,
|
||||||
Client::booBuffCounter,
|
Client::booBuffCounter,
|
||||||
Client::booMonkWuMessage
|
Client::booMonkWuMessage
|
||||||
@@ -2318,3 +2318,65 @@ bool BotDatabase::SaveBotCasterRange(const uint32 bot_id, const uint32 bot_caste
|
|||||||
|
|
||||||
return BotDataRepository::UpdateOne(database, e);
|
return BotDataRepository::UpdateOne(database, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const uint8 BotDatabase::GetBotClassByID(const uint32 bot_id)
|
||||||
|
{
|
||||||
|
const auto& e = BotDataRepository::FindOne(database, bot_id);
|
||||||
|
|
||||||
|
return e.bot_id ? e.class_ : Class::None;
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint8 BotDatabase::GetBotGenderByID(const uint32 bot_id)
|
||||||
|
{
|
||||||
|
const auto& e = BotDataRepository::FindOne(database, bot_id);
|
||||||
|
|
||||||
|
return e.bot_id ? e.gender : Gender::Neuter;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<uint32> BotDatabase::GetBotIDsByCharacterID(const uint32 character_id, uint8 class_id)
|
||||||
|
{
|
||||||
|
std::vector<uint32> v;
|
||||||
|
|
||||||
|
const auto& l = BotDataRepository::GetWhere(
|
||||||
|
database,
|
||||||
|
fmt::format(
|
||||||
|
"`owner_id` = {}{}",
|
||||||
|
character_id,
|
||||||
|
(
|
||||||
|
class_id ?
|
||||||
|
fmt::format(
|
||||||
|
" AND `class` = {}",
|
||||||
|
class_id
|
||||||
|
) :
|
||||||
|
""
|
||||||
|
)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
for (const auto& e : l) {
|
||||||
|
v.push_back(e.bot_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint8 BotDatabase::GetBotLevelByID(const uint32 bot_id)
|
||||||
|
{
|
||||||
|
const auto& e = BotDataRepository::FindOne(database, bot_id);
|
||||||
|
|
||||||
|
return e.bot_id ? e.level : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const std::string& BotDatabase::GetBotNameByID(const uint32 bot_id)
|
||||||
|
{
|
||||||
|
const auto& e = BotDataRepository::FindOne(database, bot_id);
|
||||||
|
|
||||||
|
return e.bot_id ? e.name : std::string();
|
||||||
|
}
|
||||||
|
|
||||||
|
const uint16 BotDatabase::GetBotRaceByID(const uint32 bot_id)
|
||||||
|
{
|
||||||
|
const auto& e = BotDataRepository::FindOne(database, bot_id);
|
||||||
|
|
||||||
|
return e.bot_id ? e.race : Race::Doug;
|
||||||
|
}
|
||||||
|
|||||||
@@ -160,6 +160,13 @@ public:
|
|||||||
|
|
||||||
uint32 GetRaceClassBitmask(uint32 bot_race);
|
uint32 GetRaceClassBitmask(uint32 bot_race);
|
||||||
|
|
||||||
|
const uint8 GetBotClassByID(const uint32 bot_id);
|
||||||
|
const uint8 GetBotGenderByID(const uint32 bot_id);
|
||||||
|
std::vector<uint32> GetBotIDsByCharacterID(const uint32 character_id, uint8 class_id = Class::None);
|
||||||
|
const uint8 GetBotLevelByID(const uint32 bot_id);
|
||||||
|
const std::string& GetBotNameByID(const uint32 bot_id);
|
||||||
|
const uint16 GetBotRaceByID(const uint32 bot_id);
|
||||||
|
|
||||||
class fail {
|
class fail {
|
||||||
public:
|
public:
|
||||||
/* fail::Bot functions */
|
/* fail::Bot functions */
|
||||||
|
|||||||
+33
-10
@@ -71,6 +71,7 @@ extern volatile bool RunLoops;
|
|||||||
#include "../common/events/player_events.h"
|
#include "../common/events/player_events.h"
|
||||||
#include "../common/events/player_event_logs.h"
|
#include "../common/events/player_event_logs.h"
|
||||||
#include "dialogue_window.h"
|
#include "dialogue_window.h"
|
||||||
|
#include "../common/zone_store.h"
|
||||||
|
|
||||||
|
|
||||||
extern QueryServ* QServ;
|
extern QueryServ* QServ;
|
||||||
@@ -370,7 +371,6 @@ Client::Client(EQStreamInterface *ieqs) : Mob(
|
|||||||
bot_owner_options[booSpawnMessageSay] = false;
|
bot_owner_options[booSpawnMessageSay] = false;
|
||||||
bot_owner_options[booSpawnMessageTell] = true;
|
bot_owner_options[booSpawnMessageTell] = true;
|
||||||
bot_owner_options[booSpawnMessageClassSpecific] = true;
|
bot_owner_options[booSpawnMessageClassSpecific] = true;
|
||||||
bot_owner_options[booAltCombat] = RuleB(Bots, AllowOwnerOptionAltCombat);
|
|
||||||
bot_owner_options[booAutoDefend] = RuleB(Bots, AllowOwnerOptionAutoDefend);
|
bot_owner_options[booAutoDefend] = RuleB(Bots, AllowOwnerOptionAutoDefend);
|
||||||
bot_owner_options[booBuffCounter] = false;
|
bot_owner_options[booBuffCounter] = false;
|
||||||
bot_owner_options[booMonkWuMessage] = false;
|
bot_owner_options[booMonkWuMessage] = false;
|
||||||
@@ -6955,7 +6955,7 @@ void Client::ShowXTargets(Client *c)
|
|||||||
fmt::format(
|
fmt::format(
|
||||||
"xtarget slot [{}] type [{}] ID [{}] name [{}]",
|
"xtarget slot [{}] type [{}] ID [{}] name [{}]",
|
||||||
i,
|
i,
|
||||||
XTargets[i].Type,
|
static_cast<int>(XTargets[i].Type),
|
||||||
XTargets[i].ID,
|
XTargets[i].ID,
|
||||||
strlen(XTargets[i].Name) ? XTargets[i].Name : "No Name"
|
strlen(XTargets[i].Name) ? XTargets[i].Name : "No Name"
|
||||||
).c_str()
|
).c_str()
|
||||||
@@ -9109,6 +9109,7 @@ void Client::ShowDevToolsMenu()
|
|||||||
*/
|
*/
|
||||||
menu_show += Saylink::Silent("#showzonepoints", "Zone Points");
|
menu_show += Saylink::Silent("#showzonepoints", "Zone Points");
|
||||||
menu_show += " | " + Saylink::Silent("#showzonegloballoot", "Zone Global Loot");
|
menu_show += " | " + Saylink::Silent("#showzonegloballoot", "Zone Global Loot");
|
||||||
|
menu_show += " | " + Saylink::Silent("#show content_flags", "Content Flags");
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reload
|
* Reload
|
||||||
@@ -9166,14 +9167,6 @@ void Client::ShowDevToolsMenu()
|
|||||||
|
|
||||||
Message(Chat::White, "Developer Tools Menu");
|
Message(Chat::White, "Developer Tools Menu");
|
||||||
|
|
||||||
Message(
|
|
||||||
Chat::White,
|
|
||||||
fmt::format(
|
|
||||||
"Current Expansion | {}",
|
|
||||||
content_service.GetCurrentExpansionName()
|
|
||||||
).c_str()
|
|
||||||
);
|
|
||||||
|
|
||||||
Message(
|
Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -9289,6 +9282,36 @@ void Client::ShowDevToolsMenu()
|
|||||||
);
|
);
|
||||||
|
|
||||||
SendChatLineBreak();
|
SendChatLineBreak();
|
||||||
|
|
||||||
|
Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Current Expansion | {} ({})",
|
||||||
|
content_service.GetCurrentExpansionName(),
|
||||||
|
content_service.GetCurrentExpansion()
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
auto z = GetZoneVersionWithFallback(zone->GetZoneID(), zone->GetInstanceVersion());
|
||||||
|
|
||||||
|
if (z) {
|
||||||
|
Message(
|
||||||
|
Chat::White,
|
||||||
|
fmt::format(
|
||||||
|
"Current Zone | [{}] ({}) version [{}] instance_id [{}] min/max expansion ({}/{}) content_flags [{}]",
|
||||||
|
z->short_name,
|
||||||
|
z->long_name,
|
||||||
|
z->version,
|
||||||
|
zone->GetInstanceID(),
|
||||||
|
z->min_expansion,
|
||||||
|
z->max_expansion,
|
||||||
|
z->content_flags
|
||||||
|
).c_str()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
SendChatLineBreak();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::SendChatLineBreak(uint16 color) {
|
void Client::SendChatLineBreak(uint16 color) {
|
||||||
|
|||||||
+1
-1
@@ -2076,7 +2076,7 @@ public:
|
|||||||
booSpawnMessageSay,
|
booSpawnMessageSay,
|
||||||
booSpawnMessageTell,
|
booSpawnMessageTell,
|
||||||
booSpawnMessageClassSpecific,
|
booSpawnMessageClassSpecific,
|
||||||
booAltCombat,
|
booUnused,
|
||||||
booAutoDefend,
|
booAutoDefend,
|
||||||
booBuffCounter,
|
booBuffCounter,
|
||||||
booMonkWuMessage,
|
booMonkWuMessage,
|
||||||
|
|||||||
+24
-12
@@ -516,7 +516,7 @@ int Client::HandlePacket(const EQApplicationPacket *app)
|
|||||||
case CLIENT_LINKDEAD:
|
case CLIENT_LINKDEAD:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LogDebug("Unknown client_state: [{}]\n", client_state);
|
LogDebug("Unknown client_state: [{}]\n", static_cast<int>(client_state));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -954,7 +954,6 @@ void Client::CompleteConnect()
|
|||||||
heroforge_wearchange_timer.Start(250);
|
heroforge_wearchange_timer.Start(250);
|
||||||
|
|
||||||
RecordStats();
|
RecordStats();
|
||||||
|
|
||||||
AutoGrantAAPoints();
|
AutoGrantAAPoints();
|
||||||
|
|
||||||
// enforce some rules..
|
// enforce some rules..
|
||||||
@@ -7760,15 +7759,6 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
case GuildBankDeposit: // Deposit Item
|
case GuildBankDeposit: // Deposit Item
|
||||||
{
|
{
|
||||||
if (GuildBanks->IsAreaFull(GuildID(), GuildBankDepositArea))
|
|
||||||
{
|
|
||||||
MessageString(Chat::Red, GUILD_BANK_FULL);
|
|
||||||
|
|
||||||
GuildBankDepositAck(true, sentAction);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
EQ::ItemInstance *CursorItemInst = GetInv().GetItem(EQ::invslot::slotCursor);
|
EQ::ItemInstance *CursorItemInst = GetInv().GetItem(EQ::invslot::slotCursor);
|
||||||
|
|
||||||
bool Allowed = true;
|
bool Allowed = true;
|
||||||
@@ -7784,6 +7774,18 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
|||||||
|
|
||||||
const EQ::ItemData* CursorItem = CursorItemInst->GetItem();
|
const EQ::ItemData* CursorItem = CursorItemInst->GetItem();
|
||||||
|
|
||||||
|
if (GuildBanks->IsAreaFull(GuildID(), GuildBankDepositArea))
|
||||||
|
{
|
||||||
|
MessageString(Chat::Red, GUILD_BANK_FULL);
|
||||||
|
GuildBankDepositAck(true, sentAction);
|
||||||
|
if (ClientVersion() >= EQ::versions::ClientVersion::RoF) {
|
||||||
|
GetInv().PopItem(EQ::invslot::slotCursor);
|
||||||
|
PushItemOnCursor(CursorItem, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!CursorItem->NoDrop || CursorItemInst->IsAttuned())
|
if (!CursorItem->NoDrop || CursorItemInst->IsAttuned())
|
||||||
{
|
{
|
||||||
Allowed = false;
|
Allowed = false;
|
||||||
@@ -7811,6 +7813,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app)
|
|||||||
GuildBankDepositAck(true, sentAction);
|
GuildBankDepositAck(true, sentAction);
|
||||||
|
|
||||||
if (ClientVersion() >= EQ::versions::ClientVersion::RoF) {
|
if (ClientVersion() >= EQ::versions::ClientVersion::RoF) {
|
||||||
|
GetInv().PopItem(EQ::invslot::slotCursor);
|
||||||
PushItemOnCursor(CursorItem, true);
|
PushItemOnCursor(CursorItem, true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -8163,6 +8166,10 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app)
|
|||||||
rank = GUILD_LEADER;
|
rank = GUILD_LEADER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
|
rank = GUILD_RANK_NONE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8564,6 +8571,10 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app)
|
|||||||
rank = GUILD_LEADER;
|
rank = GUILD_LEADER;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
|
rank = GUILD_RANK_NONE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -16334,7 +16345,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app)
|
|||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
LogDebug("Unhandled XTarget Type [{}]", Type);
|
LogDebug("Unhandled XTarget Type [{}]", static_cast<int>(Type));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -17130,3 +17141,4 @@ void Client::Handle_OP_GuildTributeDonatePlat(const EQApplicationPacket *app)
|
|||||||
RequestGuildFavorAndTimer(GuildID());
|
RequestGuildFavorAndTimer(GuildID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,3 +71,23 @@ float CombatRecord::GetHealedReceivedPerSecond() const
|
|||||||
double time_in_combat = TimeInCombat();
|
double time_in_combat = TimeInCombat();
|
||||||
return time_in_combat > 0 ? (m_heal_received / time_in_combat) : m_heal_received;
|
return time_in_combat > 0 ? (m_heal_received / time_in_combat) : m_heal_received;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time_t CombatRecord::GetStartTime() const
|
||||||
|
{
|
||||||
|
return m_start_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
time_t CombatRecord::GetEndTime() const
|
||||||
|
{
|
||||||
|
return m_end_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
int64 CombatRecord::GetDamageReceived() const
|
||||||
|
{
|
||||||
|
return m_damage_received;
|
||||||
|
}
|
||||||
|
|
||||||
|
int64 CombatRecord::GetHealingReceived() const
|
||||||
|
{
|
||||||
|
return m_heal_received;
|
||||||
|
}
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ public:
|
|||||||
double TimeInCombat() const;
|
double TimeInCombat() const;
|
||||||
float GetDamageReceivedPerSecond() const;
|
float GetDamageReceivedPerSecond() const;
|
||||||
float GetHealedReceivedPerSecond() const;
|
float GetHealedReceivedPerSecond() const;
|
||||||
|
time_t GetStartTime() const;
|
||||||
|
time_t GetEndTime() const;
|
||||||
|
int64 GetDamageReceived() const;
|
||||||
|
int64 GetHealingReceived() const;
|
||||||
private:
|
private:
|
||||||
std::string m_mob_name;
|
std::string m_mob_name;
|
||||||
time_t m_start_time = 0;
|
time_t m_start_time = 0;
|
||||||
|
|||||||
@@ -410,7 +410,7 @@ void DataBucket::BulkLoadEntities(DataBucketLoadType::Type t, std::vector<uint32
|
|||||||
column = "npc_id";
|
column = "npc_id";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LogError("Incorrect LoadType [{}]", t);
|
LogError("Incorrect LoadType [{}]", static_cast<int>(t));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -546,7 +546,7 @@ void DataBucket::HandleWorldMessage(ServerPacket *p)
|
|||||||
n.e.id,
|
n.e.id,
|
||||||
n.e.key_,
|
n.e.key_,
|
||||||
n.e.value,
|
n.e.value,
|
||||||
n.update_action
|
static_cast<int>(n.update_action)
|
||||||
);
|
);
|
||||||
|
|
||||||
// delete
|
// delete
|
||||||
|
|||||||
+45
-1
@@ -193,6 +193,13 @@ const char* QuestEventSubroutines[_LargestEventID] = {
|
|||||||
"EVENT_ALT_CURRENCY_LOSS",
|
"EVENT_ALT_CURRENCY_LOSS",
|
||||||
"EVENT_CRYSTAL_GAIN",
|
"EVENT_CRYSTAL_GAIN",
|
||||||
"EVENT_CRYSTAL_LOSS",
|
"EVENT_CRYSTAL_LOSS",
|
||||||
|
"EVENT_TIMER_PAUSE",
|
||||||
|
"EVENT_TIMER_RESUME",
|
||||||
|
"EVENT_TIMER_START",
|
||||||
|
"EVENT_TIMER_STOP",
|
||||||
|
"EVENT_ENTITY_VARIABLE_DELETE",
|
||||||
|
"EVENT_ENTITY_VARIABLE_SET",
|
||||||
|
"EVENT_ENTITY_VARIABLE_UPDATE",
|
||||||
|
|
||||||
// Add new events before these or Lua crashes
|
// Add new events before these or Lua crashes
|
||||||
"EVENT_SPELL_EFFECT_BOT",
|
"EVENT_SPELL_EFFECT_BOT",
|
||||||
@@ -1668,11 +1675,21 @@ void PerlembParser::ExportEventVariables(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EVENT_TIMER: {
|
case EVENT_TIMER:
|
||||||
|
case EVENT_TIMER_STOP: {
|
||||||
ExportVar(package_name.c_str(), "timer", data);
|
ExportVar(package_name.c_str(), "timer", data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case EVENT_TIMER_PAUSE:
|
||||||
|
case EVENT_TIMER_RESUME:
|
||||||
|
case EVENT_TIMER_START: {
|
||||||
|
Seperator sep(data);
|
||||||
|
ExportVar(package_name.c_str(), "timer", sep.arg[0]);
|
||||||
|
ExportVar(package_name.c_str(), "duration", sep.arg[1]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case EVENT_SIGNAL: {
|
case EVENT_SIGNAL: {
|
||||||
ExportVar(package_name.c_str(), "signal", data);
|
ExportVar(package_name.c_str(), "signal", data);
|
||||||
break;
|
break;
|
||||||
@@ -2007,6 +2024,13 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]);
|
ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]);
|
||||||
ExportVar(package_name.c_str(), "killed_entity_id", sep.arg[4]);
|
ExportVar(package_name.c_str(), "killed_entity_id", sep.arg[4]);
|
||||||
|
|
||||||
|
if (sep.arg[5]) {
|
||||||
|
ExportVar(package_name.c_str(), "combat_start_time", sep.arg[5]);
|
||||||
|
ExportVar(package_name.c_str(), "combat_end_time", sep.arg[6]);
|
||||||
|
ExportVar(package_name.c_str(), "damage_received", sep.arg[7]);
|
||||||
|
ExportVar(package_name.c_str(), "healing_received", sep.arg[8]);
|
||||||
|
}
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() >= 1) {
|
if (extra_pointers && extra_pointers->size() >= 1) {
|
||||||
Corpse* corpse = std::any_cast<Corpse*>(extra_pointers->at(0));
|
Corpse* corpse = std::any_cast<Corpse*>(extra_pointers->at(0));
|
||||||
if (corpse) {
|
if (corpse) {
|
||||||
@@ -2409,6 +2433,26 @@ void PerlembParser::ExportEventVariables(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case EVENT_ENTITY_VARIABLE_DELETE:
|
||||||
|
case EVENT_ENTITY_VARIABLE_SET: {
|
||||||
|
if (extra_pointers && extra_pointers->size() == 2) {
|
||||||
|
ExportVar(package_name.c_str(), "variable_name", std::any_cast<std::string>(extra_pointers->at(0)).c_str());
|
||||||
|
ExportVar(package_name.c_str(), "variable_value", std::any_cast<std::string>(extra_pointers->at(1)).c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case EVENT_ENTITY_VARIABLE_UPDATE: {
|
||||||
|
if (extra_pointers && extra_pointers->size() == 3) {
|
||||||
|
ExportVar(package_name.c_str(), "variable_name", std::any_cast<std::string>(extra_pointers->at(0)).c_str());
|
||||||
|
ExportVar(package_name.c_str(), "old_value", std::any_cast<std::string>(extra_pointers->at(1)).c_str());
|
||||||
|
ExportVar(package_name.c_str(), "new_value", std::any_cast<std::string>(extra_pointers->at(2)).c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+95
-13
@@ -313,12 +313,12 @@ int Perl__getinventoryslotid(std::string identifier)
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__castspell(int spell_id, int target_id)
|
void Perl__castspell(uint16 spell_id, uint16 target_id)
|
||||||
{
|
{
|
||||||
quest_manager.castspell(spell_id, target_id);
|
quest_manager.castspell(spell_id, target_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__selfcast(int spell_id)
|
void Perl__selfcast(uint16 spell_id)
|
||||||
{
|
{
|
||||||
quest_manager.selfcast(spell_id);
|
quest_manager.selfcast(spell_id);
|
||||||
}
|
}
|
||||||
@@ -353,47 +353,67 @@ void Perl__zoneraid(const char* zone_name)
|
|||||||
quest_manager.ZoneRaid(zone_name);
|
quest_manager.ZoneRaid(zone_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Perl__hastimer(const char* timer_name)
|
bool Perl__hastimer(std::string timer_name)
|
||||||
{
|
{
|
||||||
return quest_manager.hastimer(timer_name);
|
return quest_manager.hastimer(timer_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Perl__ispausedtimer(const char* timer_name)
|
bool Perl__ispausedtimer(std::string timer_name)
|
||||||
{
|
{
|
||||||
return quest_manager.ispausedtimer(timer_name);
|
return quest_manager.ispausedtimer(timer_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Perl__getremainingtimeMS(const char* timer_name)
|
uint32_t Perl__getremainingtimeMS(std::string timer_name)
|
||||||
{
|
{
|
||||||
return quest_manager.getremainingtimeMS(timer_name);
|
return quest_manager.getremainingtimeMS(timer_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Perl__gettimerdurationMS(const char* timer_name)
|
uint32_t Perl__gettimerdurationMS(std::string timer_name)
|
||||||
{
|
{
|
||||||
return quest_manager.gettimerdurationMS(timer_name);
|
return quest_manager.gettimerdurationMS(timer_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__settimer(const char* timer_name, int seconds)
|
void Perl__settimer(std::string timer_name, uint32 seconds)
|
||||||
{
|
{
|
||||||
quest_manager.settimer(timer_name, seconds);
|
quest_manager.settimer(timer_name, seconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__settimerMS(const char* timer_name, int milliseconds)
|
void Perl__settimer(std::string timer_name, uint32 seconds, Mob* m)
|
||||||
|
{
|
||||||
|
quest_manager.settimer(timer_name, seconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Perl__settimer(std::string timer_name, uint32 seconds, EQ::ItemInstance* inst)
|
||||||
|
{
|
||||||
|
quest_manager.settimer(timer_name, seconds);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Perl__settimerMS(std::string timer_name, uint32 milliseconds)
|
||||||
{
|
{
|
||||||
quest_manager.settimerMS(timer_name, milliseconds);
|
quest_manager.settimerMS(timer_name, milliseconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__pausetimer(const char* timer_name)
|
void Perl__settimerMS(std::string timer_name, uint32 milliseconds, Mob* m)
|
||||||
|
{
|
||||||
|
quest_manager.settimerMS(timer_name, milliseconds, m);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Perl__settimerMS(std::string timer_name, uint32 milliseconds, EQ::ItemInstance* inst)
|
||||||
|
{
|
||||||
|
quest_manager.settimerMS(timer_name, milliseconds, inst);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Perl__pausetimer(std::string timer_name)
|
||||||
{
|
{
|
||||||
quest_manager.pausetimer(timer_name);
|
quest_manager.pausetimer(timer_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__resumetimer(const char* timer_name)
|
void Perl__resumetimer(std::string timer_name)
|
||||||
{
|
{
|
||||||
quest_manager.resumetimer(timer_name);
|
quest_manager.resumetimer(timer_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__stoptimer(const char* timer_name)
|
void Perl__stoptimer(std::string timer_name)
|
||||||
{
|
{
|
||||||
quest_manager.stoptimer(timer_name);
|
quest_manager.stoptimer(timer_name);
|
||||||
}
|
}
|
||||||
@@ -5762,6 +5782,57 @@ std::string Perl__convert_money_to_string(perl::hash table)
|
|||||||
return Strings::Money(platinum, gold, silver, copper);
|
return Strings::Money(platinum, gold, silver, copper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8 Perl__GetBotClassByID(uint32 bot_id)
|
||||||
|
{
|
||||||
|
return database.botdb.GetBotClassByID(bot_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8 Perl__GetBotGenderByID(uint32 bot_id)
|
||||||
|
{
|
||||||
|
return database.botdb.GetBotGenderByID(bot_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
perl::array Perl__GetBotIDsByCharacterID(uint32 character_id)
|
||||||
|
{
|
||||||
|
perl::array result;
|
||||||
|
|
||||||
|
const auto bot_ids = database.botdb.GetBotIDsByCharacterID(character_id);
|
||||||
|
|
||||||
|
for (int i = 0; i < bot_ids.size(); i++) {
|
||||||
|
result.push_back(bot_ids[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
perl::array Perl__GetBotIDsByCharacterID(uint32 character_id, uint8 class_id)
|
||||||
|
{
|
||||||
|
perl::array result;
|
||||||
|
|
||||||
|
const auto bot_ids = database.botdb.GetBotIDsByCharacterID(character_id, class_id);
|
||||||
|
|
||||||
|
for (int i = 0; i < bot_ids.size(); i++) {
|
||||||
|
result.push_back(bot_ids[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8 Perl__GetBotLevelByID(uint32 bot_id)
|
||||||
|
{
|
||||||
|
return database.botdb.GetBotLevelByID(bot_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Perl__GetBotNameByID(uint32 bot_id)
|
||||||
|
{
|
||||||
|
return database.botdb.GetBotNameByID(bot_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16 Perl__GetBotRaceByID(uint32 bot_id)
|
||||||
|
{
|
||||||
|
return database.botdb.GetBotRaceByID(bot_id);
|
||||||
|
}
|
||||||
|
|
||||||
void perl_register_quest()
|
void perl_register_quest()
|
||||||
{
|
{
|
||||||
perl::interpreter perl(PERL_GET_THX);
|
perl::interpreter perl(PERL_GET_THX);
|
||||||
@@ -5792,6 +5863,13 @@ void perl_register_quest()
|
|||||||
package.add("FlagInstanceByGroupLeader", &Perl__FlagInstanceByGroupLeader);
|
package.add("FlagInstanceByGroupLeader", &Perl__FlagInstanceByGroupLeader);
|
||||||
package.add("FlagInstanceByRaidLeader", &Perl__FlagInstanceByRaidLeader);
|
package.add("FlagInstanceByRaidLeader", &Perl__FlagInstanceByRaidLeader);
|
||||||
package.add("FlyMode", &Perl__FlyMode);
|
package.add("FlyMode", &Perl__FlyMode);
|
||||||
|
package.add("GetBotClassByID", &Perl__GetBotClassByID);
|
||||||
|
package.add("GetBotGenderByID", &Perl__GetBotGenderByID);
|
||||||
|
package.add("GetBotIDsByCharacterID", (perl::array(*)(uint32))&Perl__GetBotIDsByCharacterID);
|
||||||
|
package.add("GetBotIDsByCharacterID", (perl::array(*)(uint32, uint8))&Perl__GetBotIDsByCharacterID);
|
||||||
|
package.add("GetBotLevelByID", &Perl__GetBotLevelByID);
|
||||||
|
package.add("GetBotNameByID", &Perl__GetBotNameByID);
|
||||||
|
package.add("GetBotRaceByID", &Perl__GetBotRaceByID);
|
||||||
package.add("GetCharactersInInstance", &Perl__GetCharactersInInstance);
|
package.add("GetCharactersInInstance", &Perl__GetCharactersInInstance);
|
||||||
package.add("GetInstanceID", &Perl__GetInstanceID);
|
package.add("GetInstanceID", &Perl__GetInstanceID);
|
||||||
package.add("GetInstanceIDByCharID", &Perl__GetInstanceIDByCharID);
|
package.add("GetInstanceIDByCharID", &Perl__GetInstanceIDByCharID);
|
||||||
@@ -6606,8 +6684,12 @@ void perl_register_quest()
|
|||||||
package.add("settarget", &Perl__settarget);
|
package.add("settarget", &Perl__settarget);
|
||||||
package.add("settime", (void(*)(int, int))&Perl__settime);
|
package.add("settime", (void(*)(int, int))&Perl__settime);
|
||||||
package.add("settime", (void(*)(int, int, bool))&Perl__settime);
|
package.add("settime", (void(*)(int, int, bool))&Perl__settime);
|
||||||
package.add("settimer", &Perl__settimer);
|
package.add("settimer", (void(*)(std::string, uint32))&Perl__settimer),
|
||||||
package.add("settimerMS", &Perl__settimerMS);
|
package.add("settimer", (void(*)(std::string, uint32, EQ::ItemInstance*))&Perl__settimer),
|
||||||
|
package.add("settimer", (void(*)(std::string, uint32, Mob*))&Perl__settimer),
|
||||||
|
package.add("settimerMS", (void(*)(std::string, uint32))&Perl__settimerMS);
|
||||||
|
package.add("settimerMS", (void(*)(std::string, uint32, EQ::ItemInstance*))&Perl__settimerMS);
|
||||||
|
package.add("settimerMS", (void(*)(std::string, uint32, Mob*))&Perl__settimerMS);
|
||||||
package.add("sfollow", &Perl__sfollow);
|
package.add("sfollow", &Perl__sfollow);
|
||||||
package.add("shout", &Perl__shout);
|
package.add("shout", &Perl__shout);
|
||||||
package.add("shout2", &Perl__shout2);
|
package.add("shout2", &Perl__shout2);
|
||||||
|
|||||||
@@ -135,6 +135,13 @@ typedef enum {
|
|||||||
EVENT_ALT_CURRENCY_LOSS,
|
EVENT_ALT_CURRENCY_LOSS,
|
||||||
EVENT_CRYSTAL_GAIN,
|
EVENT_CRYSTAL_GAIN,
|
||||||
EVENT_CRYSTAL_LOSS,
|
EVENT_CRYSTAL_LOSS,
|
||||||
|
EVENT_TIMER_PAUSE,
|
||||||
|
EVENT_TIMER_RESUME,
|
||||||
|
EVENT_TIMER_START,
|
||||||
|
EVENT_TIMER_STOP,
|
||||||
|
EVENT_ENTITY_VARIABLE_DELETE,
|
||||||
|
EVENT_ENTITY_VARIABLE_SET,
|
||||||
|
EVENT_ENTITY_VARIABLE_UPDATE,
|
||||||
|
|
||||||
// Add new events before these or Lua crashes
|
// Add new events before these or Lua crashes
|
||||||
EVENT_SPELL_EFFECT_BOT,
|
EVENT_SPELL_EFFECT_BOT,
|
||||||
|
|||||||
+18
-8
@@ -625,19 +625,29 @@ void Client::SetEXP(uint64 set_exp, uint64 set_aaxp, bool isrezzexp) {
|
|||||||
else MessageString(Chat::Experience, REZ_REGAIN);
|
else MessageString(Chat::Experience, REZ_REGAIN);
|
||||||
} else {
|
} else {
|
||||||
if (membercount > 1) {
|
if (membercount > 1) {
|
||||||
if (RuleI(Character, ShowExpValues) > 0)
|
if (RuleI(Character, ShowExpValues) > 0) {
|
||||||
Message(Chat::Experience, "You have gained %s party experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str());
|
Message(Chat::Experience, "You have gained %s party experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str());
|
||||||
else MessageString(Chat::Experience, GAIN_GROUPXP);
|
} else if (zone->IsHotzone()) {
|
||||||
|
Message(Chat::Experience, "You gain party experience (with a bonus)!");
|
||||||
|
} else {
|
||||||
|
MessageString(Chat::Experience, GAIN_GROUPXP);
|
||||||
}
|
}
|
||||||
else if (IsRaidGrouped()) {
|
} else if (IsRaidGrouped()) {
|
||||||
if (RuleI(Character, ShowExpValues) > 0)
|
if (RuleI(Character, ShowExpValues) > 0) {
|
||||||
Message(Chat::Experience, "You have gained %s raid experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str());
|
Message(Chat::Experience, "You have gained %s raid experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str());
|
||||||
else MessageString(Chat::Experience, GAIN_RAIDEXP);
|
} else if (zone->IsHotzone()) {
|
||||||
|
Message(Chat::Experience, "You gained raid experience (with a bonus)!");
|
||||||
|
} else {
|
||||||
|
MessageString(Chat::Experience, GAIN_RAIDEXP);
|
||||||
}
|
}
|
||||||
else {
|
} else {
|
||||||
if (RuleI(Character, ShowExpValues) > 0)
|
if (RuleI(Character, ShowExpValues) > 0) {
|
||||||
Message(Chat::Experience, "You have gained %s experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str());
|
Message(Chat::Experience, "You have gained %s experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str());
|
||||||
else MessageString(Chat::Experience, GAIN_XP);
|
} else if (zone->IsHotzone()) {
|
||||||
|
Message(Chat::Experience, "You gain experience (with a bonus)!");
|
||||||
|
} else {
|
||||||
|
MessageString(Chat::Experience, GAIN_XP);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -1161,7 +1161,7 @@ void Expedition::AddLockoutByCharacterName(
|
|||||||
{
|
{
|
||||||
if (!character_name.empty())
|
if (!character_name.empty())
|
||||||
{
|
{
|
||||||
uint32_t character_id = database.GetCharacterID(character_name.c_str());
|
uint32_t character_id = database.GetCharacterID(character_name);
|
||||||
AddLockoutByCharacterID(character_id, expedition_name, event_name, seconds, uuid);
|
AddLockoutByCharacterID(character_id, expedition_name, event_name, seconds, uuid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1180,7 +1180,7 @@ bool Expedition::HasLockoutByCharacterName(
|
|||||||
{
|
{
|
||||||
if (!character_name.empty())
|
if (!character_name.empty())
|
||||||
{
|
{
|
||||||
uint32_t character_id = database.GetCharacterID(character_name.c_str());
|
uint32_t character_id = database.GetCharacterID(character_name);
|
||||||
return HasLockoutByCharacterID(character_id, expedition_name, event_name);
|
return HasLockoutByCharacterID(character_id, expedition_name, event_name);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -1214,7 +1214,7 @@ void Expedition::RemoveLockoutsByCharacterName(
|
|||||||
{
|
{
|
||||||
if (!character_name.empty())
|
if (!character_name.empty())
|
||||||
{
|
{
|
||||||
uint32_t character_id = database.GetCharacterID(character_name.c_str());
|
uint32_t character_id = database.GetCharacterID(character_name);
|
||||||
RemoveLockoutsByCharacterID(character_id, expedition_name, event_name);
|
RemoveLockoutsByCharacterID(character_id, expedition_name, event_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,7 +126,7 @@ bool ExpeditionRequest::CanGroupRequest(Group* group)
|
|||||||
|
|
||||||
// Group::GetLeaderName() is broken if group formed across zones, ask database instead
|
// Group::GetLeaderName() is broken if group formed across zones, ask database instead
|
||||||
m_leader_name = m_leader ? m_leader->GetName() : GetGroupLeaderName(group->GetID()); // group->GetLeaderName();
|
m_leader_name = m_leader ? m_leader->GetName() : GetGroupLeaderName(group->GetID()); // group->GetLeaderName();
|
||||||
m_leader_id = m_leader ? m_leader->CharacterID() : database.GetCharacterID(m_leader_name.c_str());
|
m_leader_id = m_leader ? m_leader->CharacterID() : database.GetCharacterID(m_leader_name);
|
||||||
|
|
||||||
std::vector<std::string> member_names;
|
std::vector<std::string> member_names;
|
||||||
member_names.emplace_back(m_leader_name); // leader always added first
|
member_names.emplace_back(m_leader_name); // leader always added first
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ void command_instance(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
std::string character_name = sep->arg[3];
|
std::string character_name = sep->arg[3];
|
||||||
uint16 instance_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[2]));
|
uint16 instance_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[2]));
|
||||||
uint32 character_id = database.GetCharacterID(character_name.c_str());
|
uint32 character_id = database.GetCharacterID(character_name);
|
||||||
if (instance_id <= 0 || character_id <= 0) {
|
if (instance_id <= 0 || character_id <= 0) {
|
||||||
c->Message(Chat::White, "You must enter a valid Instance ID and player name.");
|
c->Message(Chat::White, "You must enter a valid Instance ID and player name.");
|
||||||
return;
|
return;
|
||||||
@@ -270,7 +270,7 @@ void command_instance(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
std::string character_name = sep->arg[3];
|
std::string character_name = sep->arg[3];
|
||||||
uint16 instance_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[2]));
|
uint16 instance_id = static_cast<uint16>(Strings::ToUnsignedInt(sep->arg[2]));
|
||||||
uint32 character_id = database.GetCharacterID(character_name.c_str());
|
uint32 character_id = database.GetCharacterID(character_name);
|
||||||
if (instance_id <= 0 || character_id <= 0) {
|
if (instance_id <= 0 || character_id <= 0) {
|
||||||
c->Message(Chat::White, "You must enter a valid Instance ID and player name.");
|
c->Message(Chat::White, "You must enter a valid Instance ID and player name.");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ void command_movechar(Client *c, const Seperator *sep)
|
|||||||
database.GetCharNameByID(Strings::ToUnsignedInt(sep->arg[1])) :
|
database.GetCharNameByID(Strings::ToUnsignedInt(sep->arg[1])) :
|
||||||
sep->arg[1]
|
sep->arg[1]
|
||||||
);
|
);
|
||||||
const uint32 character_id = database.GetCharacterID(character_name.c_str());
|
const uint32 character_id = database.GetCharacterID(character_name);
|
||||||
if (!character_id) {
|
if (!character_id) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
#include "show/buffs.cpp"
|
#include "show/buffs.cpp"
|
||||||
#include "show/buried_corpse_count.cpp"
|
#include "show/buried_corpse_count.cpp"
|
||||||
#include "show/client_version_summary.cpp"
|
#include "show/client_version_summary.cpp"
|
||||||
|
#include "show/content_flags.cpp"
|
||||||
#include "show/currencies.cpp"
|
#include "show/currencies.cpp"
|
||||||
#include "show/distance.cpp"
|
#include "show/distance.cpp"
|
||||||
#include "show/emotes.cpp"
|
#include "show/emotes.cpp"
|
||||||
@@ -64,6 +65,7 @@ void command_show(Client *c, const Seperator *sep)
|
|||||||
Cmd{.cmd = "buffs", .u = "buffs", .fn = ShowBuffs, .a = {"#showbuffs"}},
|
Cmd{.cmd = "buffs", .u = "buffs", .fn = ShowBuffs, .a = {"#showbuffs"}},
|
||||||
Cmd{.cmd = "buried_corpse_count", .u = "buried_corpse_count", .fn = ShowBuriedCorpseCount, .a = {"#getplayerburiedcorpsecount"}},
|
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 = "client_version_summary", .u = "client_version_summary", .fn = ShowClientVersionSummary, .a = {"#cvs"}},
|
||||||
|
Cmd{.cmd = "content_flags", .u = "content_flags", .fn = ShowContentFlags, .a = {"#showcontentflags"}},
|
||||||
Cmd{.cmd = "currencies", .u = "currencies", .fn = ShowCurrencies, .a = {"#viewcurrencies"}},
|
Cmd{.cmd = "currencies", .u = "currencies", .fn = ShowCurrencies, .a = {"#viewcurrencies"}},
|
||||||
Cmd{.cmd = "distance", .u = "distance", .fn = ShowDistance, .a = {"#distance"}},
|
Cmd{.cmd = "distance", .u = "distance", .fn = ShowDistance, .a = {"#distance"}},
|
||||||
Cmd{.cmd = "emotes", .u = "emotes", .fn = ShowEmotes, .a = {"#emoteview"}},
|
Cmd{.cmd = "emotes", .u = "emotes", .fn = ShowEmotes, .a = {"#emoteview"}},
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
#include "../../client.h"
|
||||||
|
#include "../../dialogue_window.h"
|
||||||
|
|
||||||
|
void ShowContentFlags(Client *c, const Seperator *sep)
|
||||||
|
{
|
||||||
|
Client *t = c;
|
||||||
|
if (c->GetTarget() && c->GetTarget()->IsClient()) {
|
||||||
|
t = c->GetTarget()->CastToClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string flags = DialogueWindow::TableRow(
|
||||||
|
DialogueWindow::TableCell("id") +
|
||||||
|
DialogueWindow::TableCell("flag_name") +
|
||||||
|
DialogueWindow::TableCell("enabled")
|
||||||
|
);
|
||||||
|
|
||||||
|
for (auto &f: ContentFlagsRepository::All(database)) {
|
||||||
|
flags += DialogueWindow::TableRow(
|
||||||
|
DialogueWindow::TableCell(std::to_string(f.id)) +
|
||||||
|
DialogueWindow::TableCell(f.flag_name) +
|
||||||
|
DialogueWindow::TableCell(
|
||||||
|
f.enabled ?
|
||||||
|
DialogueWindow::ColorMessage("forest_green", "yes") :
|
||||||
|
DialogueWindow::ColorMessage("red", "no")
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
c->SendPopupToClient("Server Content Flag Settings", DialogueWindow::Table(flags).c_str());
|
||||||
|
}
|
||||||
@@ -16,7 +16,7 @@ void command_summon(Client *c, const Seperator *sep)
|
|||||||
|
|
||||||
if (arguments == 1) {
|
if (arguments == 1) {
|
||||||
std::string character_name = sep->arg[1];
|
std::string character_name = sep->arg[1];
|
||||||
auto character_id = database.GetCharacterID(character_name.c_str());
|
auto character_id = database.GetCharacterID(character_name);
|
||||||
if (!character_id) {
|
if (!character_id) {
|
||||||
c->Message(
|
c->Message(
|
||||||
Chat::White,
|
Chat::White,
|
||||||
|
|||||||
@@ -146,6 +146,9 @@ void Client::SendGuildRankNames()
|
|||||||
{
|
{
|
||||||
if (IsInAGuild() && (ClientVersion() >= EQ::versions::ClientVersion::RoF)) {
|
if (IsInAGuild() && (ClientVersion() >= EQ::versions::ClientVersion::RoF)) {
|
||||||
auto guild = guild_mgr.GetGuildByGuildID(GuildID());
|
auto guild = guild_mgr.GetGuildByGuildID(GuildID());
|
||||||
|
if (!guild) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (int i = 1; i <= GUILD_MAX_RANK; i++) {
|
for (int i = 1; i <= GUILD_MAX_RANK; i++) {
|
||||||
|
|
||||||
@@ -153,6 +156,10 @@ void Client::SendGuildRankNames()
|
|||||||
GuildUpdateUCPStruct* gucp = (GuildUpdateUCPStruct*)outapp->pBuffer;
|
GuildUpdateUCPStruct* gucp = (GuildUpdateUCPStruct*)outapp->pBuffer;
|
||||||
|
|
||||||
gucp->payload.rank_name.rank = i;
|
gucp->payload.rank_name.rank = i;
|
||||||
|
if (guild->rank_names[i].empty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
strn0cpy(
|
strn0cpy(
|
||||||
gucp->payload.rank_name.rank_name,
|
gucp->payload.rank_name.rank_name,
|
||||||
guild->rank_names[i].c_str(),
|
guild->rank_names[i].c_str(),
|
||||||
|
|||||||
+30
-22
@@ -515,12 +515,16 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack)
|
|||||||
case ServerOP_GuildPermissionUpdate: {
|
case ServerOP_GuildPermissionUpdate: {
|
||||||
if (is_zone_loaded) {
|
if (is_zone_loaded) {
|
||||||
auto *sgpus = (ServerGuildPermissionUpdate_Struct *)pack->pBuffer;
|
auto *sgpus = (ServerGuildPermissionUpdate_Struct *)pack->pBuffer;
|
||||||
auto res = m_guilds.find(sgpus->guild_id);
|
auto guild = GetGuildByGuildID(sgpus->guild_id);
|
||||||
|
if (!guild) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (sgpus->function_value) {
|
if (sgpus->function_value) {
|
||||||
res->second->functions[sgpus->function_id].perm_value |= (1UL << (8 - sgpus->rank));
|
guild->functions[sgpus->function_id].perm_value |= (1UL << (8 - sgpus->rank));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
res->second->functions[sgpus->function_id].perm_value &= ~(1UL << (8 - sgpus->rank));
|
guild->functions[sgpus->function_id].perm_value &= ~(1UL << (8 - sgpus->rank));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto outapp = new EQApplicationPacket(OP_GuildUpdate, sizeof(GuildPermission_Struct));
|
auto outapp = new EQApplicationPacket(OP_GuildUpdate, sizeof(GuildPermission_Struct));
|
||||||
@@ -797,7 +801,7 @@ void GuildBankManager::SendGuildBank(Client *c)
|
|||||||
outapp->WriteUInt32(Item->Icon);
|
outapp->WriteUInt32(Item->Icon);
|
||||||
if (Item->Stackable) {
|
if (Item->Stackable) {
|
||||||
outapp->WriteUInt32(guild_bank->Items.DepositArea[i].Quantity);
|
outapp->WriteUInt32(guild_bank->Items.DepositArea[i].Quantity);
|
||||||
outapp->WriteUInt8(Item->StackSize == guild_bank->Items.DepositArea[i].Quantity ? 0 : 1);
|
outapp->WriteUInt8(Item->StackSize == guild_bank->Items.DepositArea[i].Quantity ? 1 : 1);
|
||||||
} else {
|
} else {
|
||||||
outapp->WriteUInt32(1);
|
outapp->WriteUInt32(1);
|
||||||
outapp->WriteUInt8(0);
|
outapp->WriteUInt8(0);
|
||||||
@@ -821,7 +825,7 @@ void GuildBankManager::SendGuildBank(Client *c)
|
|||||||
outapp->WriteUInt32(Item->Icon);
|
outapp->WriteUInt32(Item->Icon);
|
||||||
if (Item->Stackable) {
|
if (Item->Stackable) {
|
||||||
outapp->WriteUInt32(guild_bank->Items.MainArea[i].Quantity);
|
outapp->WriteUInt32(guild_bank->Items.MainArea[i].Quantity);
|
||||||
outapp->WriteUInt8(Item->StackSize == guild_bank->Items.MainArea[i].Quantity ? 0 : 1);
|
outapp->WriteUInt8(Item->StackSize == guild_bank->Items.MainArea[i].Quantity ? 1 : 1);
|
||||||
} else {
|
} else {
|
||||||
outapp->WriteUInt32(1);
|
outapp->WriteUInt32(1);
|
||||||
outapp->WriteUInt8(0);
|
outapp->WriteUInt8(0);
|
||||||
@@ -858,7 +862,7 @@ void GuildBankManager::SendGuildBank(Client *c)
|
|||||||
{
|
{
|
||||||
if(guild_bank->Items.DepositArea[i].Quantity == Item->StackSize)
|
if(guild_bank->Items.DepositArea[i].Quantity == Item->StackSize)
|
||||||
gbius->Init(GuildBankItemUpdate, 1, i, GuildBankDepositArea, 1, Item->ID, Item->Icon,
|
gbius->Init(GuildBankItemUpdate, 1, i, GuildBankDepositArea, 1, Item->ID, Item->Icon,
|
||||||
guild_bank->Items.DepositArea[i].Quantity, guild_bank->Items.DepositArea[i].Permissions, 0, 0);
|
guild_bank->Items.DepositArea[i].Quantity, guild_bank->Items.DepositArea[i].Permissions, 1, 0);
|
||||||
else
|
else
|
||||||
gbius->Init(GuildBankItemUpdate, 1, i, GuildBankDepositArea, 1, Item->ID, Item->Icon,
|
gbius->Init(GuildBankItemUpdate, 1, i, GuildBankDepositArea, 1, Item->ID, Item->Icon,
|
||||||
guild_bank->Items.DepositArea[i].Quantity, guild_bank->Items.DepositArea[i].Permissions, 1, 0);
|
guild_bank->Items.DepositArea[i].Quantity, guild_bank->Items.DepositArea[i].Permissions, 1, 0);
|
||||||
@@ -896,7 +900,7 @@ void GuildBankManager::SendGuildBank(Client *c)
|
|||||||
{
|
{
|
||||||
if(guild_bank->Items.MainArea[i].Quantity == Item->StackSize)
|
if(guild_bank->Items.MainArea[i].Quantity == Item->StackSize)
|
||||||
gbius->Init(GuildBankItemUpdate, 1, i, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
gbius->Init(GuildBankItemUpdate, 1, i, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
||||||
guild_bank->Items.MainArea[i].Quantity, guild_bank->Items.MainArea[i].Permissions, 0, Useable);
|
guild_bank->Items.MainArea[i].Quantity, guild_bank->Items.MainArea[i].Permissions, 1, Useable);
|
||||||
else
|
else
|
||||||
gbius->Init(GuildBankItemUpdate, 1, i, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
gbius->Init(GuildBankItemUpdate, 1, i, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
||||||
guild_bank->Items.MainArea[i].Quantity, guild_bank->Items.MainArea[i].Permissions, 1, Useable);
|
guild_bank->Items.MainArea[i].Quantity, guild_bank->Items.MainArea[i].Permissions, 1, Useable);
|
||||||
@@ -1018,7 +1022,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(QtyOrCharges == Item->StackSize)
|
if(QtyOrCharges == Item->StackSize)
|
||||||
gbius.Init(GuildBankItemUpdate, 1, Slot, Area, 1, ItemID, Item->Icon, Item->Stackable ? QtyOrCharges : 1, Permissions, 0, 0);
|
gbius.Init(GuildBankItemUpdate, 1, Slot, Area, 1, ItemID, Item->Icon, Item->Stackable ? QtyOrCharges : 1, Permissions, 1, 0);
|
||||||
else
|
else
|
||||||
gbius.Init(GuildBankItemUpdate, 1, Slot, Area, 1, ItemID, Item->Icon, Item->Stackable ? QtyOrCharges : 1, Permissions, 1, 0);
|
gbius.Init(GuildBankItemUpdate, 1, Slot, Area, 1, ItemID, Item->Icon, Item->Stackable ? QtyOrCharges : 1, Permissions, 1, 0);
|
||||||
}
|
}
|
||||||
@@ -1085,7 +1089,7 @@ int GuildBankManager::Promote(uint32 guildID, int slotID)
|
|||||||
{
|
{
|
||||||
if((*iter)->Items.MainArea[mainSlot].Quantity == Item->StackSize)
|
if((*iter)->Items.MainArea[mainSlot].Quantity == Item->StackSize)
|
||||||
gbius.Init(GuildBankItemUpdate, 1, mainSlot, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
gbius.Init(GuildBankItemUpdate, 1, mainSlot, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
||||||
(*iter)->Items.MainArea[mainSlot].Quantity, 0, 0, 0);
|
(*iter)->Items.MainArea[mainSlot].Quantity, 0, 1, 0);
|
||||||
else
|
else
|
||||||
gbius.Init(GuildBankItemUpdate, 1, mainSlot, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
gbius.Init(GuildBankItemUpdate, 1, mainSlot, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
||||||
(*iter)->Items.MainArea[mainSlot].Quantity, 0, 1, 0);
|
(*iter)->Items.MainArea[mainSlot].Quantity, 0, 1, 0);
|
||||||
@@ -1141,7 +1145,7 @@ void GuildBankManager::SetPermissions(uint32 guildID, uint16 slotID, uint32 perm
|
|||||||
{
|
{
|
||||||
if((*iter)->Items.MainArea[slotID].Quantity == Item->StackSize)
|
if((*iter)->Items.MainArea[slotID].Quantity == Item->StackSize)
|
||||||
gbius.Init(GuildBankItemUpdate, 1, slotID, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
gbius.Init(GuildBankItemUpdate, 1, slotID, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
||||||
(*iter)->Items.MainArea[slotID].Quantity, (*iter)->Items.MainArea[slotID].Permissions, 0, 0);
|
(*iter)->Items.MainArea[slotID].Quantity, (*iter)->Items.MainArea[slotID].Permissions, 1, 0);
|
||||||
else
|
else
|
||||||
gbius.Init(GuildBankItemUpdate, 1, slotID, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
gbius.Init(GuildBankItemUpdate, 1, slotID, GuildBankMainArea, 1, Item->ID, Item->Icon,
|
||||||
(*iter)->Items.MainArea[slotID].Quantity, (*iter)->Items.MainArea[slotID].Permissions, 1, 0);
|
(*iter)->Items.MainArea[slotID].Quantity, (*iter)->Items.MainArea[slotID].Permissions, 1, 0);
|
||||||
@@ -1384,7 +1388,7 @@ bool GuildBankManager::MergeStacks(uint32 GuildID, uint16 SlotID)
|
|||||||
GuildBankItemUpdate_Struct gbius;
|
GuildBankItemUpdate_Struct gbius;
|
||||||
|
|
||||||
if(BankArea[i].Quantity == Item->StackSize)
|
if(BankArea[i].Quantity == Item->StackSize)
|
||||||
gbius.Init(GuildBankItemUpdate, 1, i, GuildBankMainArea, 1, ItemID, Item->Icon, BankArea[i].Quantity, BankArea[i].Permissions, 0, 0);
|
gbius.Init(GuildBankItemUpdate, 1, i, GuildBankMainArea, 1, ItemID, Item->Icon, BankArea[i].Quantity, BankArea[i].Permissions, 1, 0);
|
||||||
else
|
else
|
||||||
gbius.Init(GuildBankItemUpdate, 1, i, GuildBankMainArea, 1, ItemID, Item->Icon, BankArea[i].Quantity, BankArea[i].Permissions, 1, 0);
|
gbius.Init(GuildBankItemUpdate, 1, i, GuildBankMainArea, 1, ItemID, Item->Icon, BankArea[i].Quantity, BankArea[i].Permissions, 1, 0);
|
||||||
|
|
||||||
@@ -1489,16 +1493,20 @@ bool GuildBankManager::AllowedToWithdraw(uint32 GuildID, uint16 Area, uint16 Slo
|
|||||||
|
|
||||||
void ZoneGuildManager::UpdateRankPermission(uint32 gid, uint32 charid, uint32 fid, uint32 rank, uint32 value)
|
void ZoneGuildManager::UpdateRankPermission(uint32 gid, uint32 charid, uint32 fid, uint32 rank, uint32 value)
|
||||||
{
|
{
|
||||||
auto res = m_guilds.find(gid);
|
auto guild = GetGuildByGuildID(gid);
|
||||||
|
if (!guild) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
res->second->functions[fid].perm_value |= (1UL << (8 - rank));
|
guild->functions[fid].perm_value |= (1UL << (8 - rank));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
res->second->functions[fid].perm_value &= ~(1UL << (8 - rank));
|
guild->functions[fid].perm_value &= ~(1UL << (8 - rank));
|
||||||
}
|
}
|
||||||
auto query = fmt::format("UPDATE guild_permissions SET permission = {} WHERE perm_id = {} AND guild_id = {};", res->second->functions[fid].perm_value, fid, gid);
|
auto query = fmt::format("UPDATE guild_permissions SET permission = {} WHERE perm_id = {} AND guild_id = {};",
|
||||||
|
guild->functions[fid].perm_value, fid, gid);
|
||||||
auto results = m_db->QueryDatabase(query);
|
auto results = m_db->QueryDatabase(query);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneGuildManager::SendPermissionUpdate(uint32 guild_id, uint32 rank, uint32 function_id, uint32 value)
|
void ZoneGuildManager::SendPermissionUpdate(uint32 guild_id, uint32 rank, uint32 function_id, uint32 value)
|
||||||
@@ -1534,16 +1542,15 @@ void ZoneGuildManager::SendRankName(uint32 guild_id, uint32 rank, std::string ra
|
|||||||
|
|
||||||
void ZoneGuildManager::SendAllRankNames(uint32 guild_id, uint32 char_id)
|
void ZoneGuildManager::SendAllRankNames(uint32 guild_id, uint32 char_id)
|
||||||
{
|
{
|
||||||
auto guild = m_guilds.find(guild_id);
|
auto guild = GetGuildByGuildID(guild_id);
|
||||||
auto c = entity_list.GetClientByCharID(char_id);
|
auto c = entity_list.GetClientByCharID(char_id);
|
||||||
if (c)
|
if (guild && c) {
|
||||||
{
|
|
||||||
auto outapp = new EQApplicationPacket(OP_GuildUpdate, sizeof(GuildUpdateUCPStruct));
|
auto outapp = new EQApplicationPacket(OP_GuildUpdate, sizeof(GuildUpdateUCPStruct));
|
||||||
GuildUpdateUCPStruct *gucp = (GuildUpdateUCPStruct *)outapp->pBuffer;
|
GuildUpdateUCPStruct *gucp = (GuildUpdateUCPStruct *)outapp->pBuffer;
|
||||||
for (int i = GUILD_LEADER; i <= GUILD_RECRUIT; i++)
|
for (int i = GUILD_LEADER; i <= GUILD_RECRUIT; i++) {
|
||||||
{
|
|
||||||
gucp->payload.rank_name.rank = i;
|
gucp->payload.rank_name.rank = i;
|
||||||
strn0cpy(gucp->payload.rank_name.rank_name, guild->second->rank_names[i].c_str(), sizeof(gucp->payload.rank_name.rank_name));
|
strn0cpy(gucp->payload.rank_name.rank_name, guild->rank_names[i].c_str(),
|
||||||
|
sizeof(gucp->payload.rank_name.rank_name));
|
||||||
gucp->action = GuildUpdateRanks;
|
gucp->action = GuildUpdateRanks;
|
||||||
c->QueuePacket(outapp);
|
c->QueuePacket(outapp);
|
||||||
}
|
}
|
||||||
@@ -1640,6 +1647,7 @@ uint8* ZoneGuildManager::MakeGuildMembers(uint32 guild_id, const char* prefix_na
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
ci->rank = GUILD_RANK_NONE_TI;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+31
-7
@@ -73,20 +73,18 @@ void HateList::WipeHateList(bool npc_only) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool HateList::IsEntOnHateList(Mob *mob)
|
bool HateList::IsEntOnHateList(Mob* m)
|
||||||
{
|
{
|
||||||
if (Find(mob))
|
return m ? Find(m) != nullptr : false;
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct_HateList* HateList::Find(Mob* m)
|
struct_HateList* HateList::Find(Mob* m)
|
||||||
{
|
{
|
||||||
if (!m) {
|
if (!m || list.empty()) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto* e : list) {
|
for (auto e : list) {
|
||||||
if (e->entity_on_hatelist && e->entity_on_hatelist == m) {
|
if (e->entity_on_hatelist && e->entity_on_hatelist == m) {
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -685,7 +683,33 @@ int64 HateList::GetEntHateAmount(Mob *in_entity, bool damage)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool HateList::IsHateListEmpty() {
|
bool HateList::IsHateListEmpty() {
|
||||||
return(list.size() == 0);
|
return list.empty();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 HateList::GetHateListCount(HateListCountType count_type)
|
||||||
|
{
|
||||||
|
if (count_type == HateListCountType::All) {
|
||||||
|
return list.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 count = 0;
|
||||||
|
|
||||||
|
for (const auto& e : list) {
|
||||||
|
Mob* m = e->entity_on_hatelist;
|
||||||
|
|
||||||
|
if (
|
||||||
|
m &&
|
||||||
|
(
|
||||||
|
(count_type == HateListCountType::Bot && m->IsBot()) ||
|
||||||
|
(count_type == HateListCountType::Client && m->IsClient()) ||
|
||||||
|
(count_type == HateListCountType::NPC && m->IsNPC())
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HateList::PrintHateListToClient(Client *c)
|
void HateList::PrintHateListToClient(Client *c)
|
||||||
|
|||||||
+9
-1
@@ -36,6 +36,13 @@ struct struct_HateList {
|
|||||||
uint32 last_modified; // we need to remove this if it gets higher than 10 mins
|
uint32 last_modified; // we need to remove this if it gets higher than 10 mins
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum class HateListCountType {
|
||||||
|
Bot = 0,
|
||||||
|
Client = 1,
|
||||||
|
NPC = 2,
|
||||||
|
All = 3,
|
||||||
|
};
|
||||||
|
|
||||||
class HateList {
|
class HateList {
|
||||||
public:
|
public:
|
||||||
HateList();
|
HateList();
|
||||||
@@ -48,9 +55,10 @@ public:
|
|||||||
Mob *GetMobWithMostHateOnList(bool skip_mezzed = false);
|
Mob *GetMobWithMostHateOnList(bool skip_mezzed = false);
|
||||||
Mob *GetEscapingMobOnHateList(Mob *center, float range = 0.0f, bool first = false);
|
Mob *GetEscapingMobOnHateList(Mob *center, float range = 0.0f, bool first = false);
|
||||||
|
|
||||||
bool IsEntOnHateList(Mob *mob);
|
bool IsEntOnHateList(Mob* m);
|
||||||
bool IsHateListEmpty();
|
bool IsHateListEmpty();
|
||||||
bool RemoveEntFromHateList(Mob *ent);
|
bool RemoveEntFromHateList(Mob *ent);
|
||||||
|
uint32 GetHateListCount(HateListCountType count_type = HateListCountType::All);
|
||||||
|
|
||||||
int AreaRampage(Mob *caster, Mob *target, int count, ExtraAttackOptions *opts);
|
int AreaRampage(Mob *caster, Mob *target, int count, ExtraAttackOptions *opts);
|
||||||
int GetSummonedPetCountOnHateList();
|
int GetSummonedPetCountOnHateList();
|
||||||
|
|||||||
@@ -3290,6 +3290,12 @@ int Lua_Client::GetEXPPercentage()
|
|||||||
return self->GetEXPPercentage();
|
return self->GetEXPPercentage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Lua_Client::IsInAGuild()
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->IsInAGuild();
|
||||||
|
}
|
||||||
|
|
||||||
luabind::scope lua_register_client() {
|
luabind::scope lua_register_client() {
|
||||||
return luabind::class_<Lua_Client, Lua_Mob>("Client")
|
return luabind::class_<Lua_Client, Lua_Mob>("Client")
|
||||||
.def(luabind::constructor<>())
|
.def(luabind::constructor<>())
|
||||||
@@ -3578,6 +3584,7 @@ luabind::scope lua_register_client() {
|
|||||||
.def("IsDueling", (bool(Lua_Client::*)(void))&Lua_Client::IsDueling)
|
.def("IsDueling", (bool(Lua_Client::*)(void))&Lua_Client::IsDueling)
|
||||||
.def("IsEXPEnabled", (bool(Lua_Client::*)(void))&Lua_Client::IsEXPEnabled)
|
.def("IsEXPEnabled", (bool(Lua_Client::*)(void))&Lua_Client::IsEXPEnabled)
|
||||||
.def("IsGrouped", (bool(Lua_Client::*)(void))&Lua_Client::IsGrouped)
|
.def("IsGrouped", (bool(Lua_Client::*)(void))&Lua_Client::IsGrouped)
|
||||||
|
.def("IsInAGuild", (bool(Lua_Client::*)(void))&Lua_Client::IsInAGuild)
|
||||||
.def("IsLD", (bool(Lua_Client::*)(void))&Lua_Client::IsLD)
|
.def("IsLD", (bool(Lua_Client::*)(void))&Lua_Client::IsLD)
|
||||||
.def("IsMedding", (bool(Lua_Client::*)(void))&Lua_Client::IsMedding)
|
.def("IsMedding", (bool(Lua_Client::*)(void))&Lua_Client::IsMedding)
|
||||||
.def("IsRaidGrouped", (bool(Lua_Client::*)(void))&Lua_Client::IsRaidGrouped)
|
.def("IsRaidGrouped", (bool(Lua_Client::*)(void))&Lua_Client::IsRaidGrouped)
|
||||||
|
|||||||
@@ -495,6 +495,7 @@ public:
|
|||||||
void ClearXTargets();
|
void ClearXTargets();
|
||||||
int GetAAEXPPercentage();
|
int GetAAEXPPercentage();
|
||||||
int GetEXPPercentage();
|
int GetEXPPercentage();
|
||||||
|
bool IsInAGuild();
|
||||||
|
|
||||||
void ApplySpell(int spell_id);
|
void ApplySpell(int spell_id);
|
||||||
void ApplySpell(int spell_id, int duration);
|
void ApplySpell(int spell_id, int duration);
|
||||||
|
|||||||
+114
-29
@@ -299,35 +299,35 @@ void lua_disable_spawn2(int spawn2_id) {
|
|||||||
quest_manager.disable_spawn2(spawn2_id);
|
quest_manager.disable_spawn2(spawn2_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_set_timer(const char *timer, int time_ms) {
|
void lua_set_timer(std::string timer, uint32 time_ms) {
|
||||||
quest_manager.settimerMS(timer, time_ms);
|
quest_manager.settimerMS(timer, time_ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_set_timer(const char *timer, int time_ms, Lua_ItemInst inst) {
|
void lua_set_timer(std::string timer, uint32 time_ms, Lua_ItemInst inst) {
|
||||||
quest_manager.settimerMS(timer, time_ms, inst);
|
quest_manager.settimerMS(timer, time_ms, inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_set_timer(const char *timer, int time_ms, Lua_Mob mob) {
|
void lua_set_timer(std::string timer, uint32 time_ms, Lua_Mob mob) {
|
||||||
quest_manager.settimerMS(timer, time_ms, mob);
|
quest_manager.settimerMS(timer, time_ms, mob);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_set_timer(const char *timer, int time_ms, Lua_Encounter enc) {
|
void lua_set_timer(std::string timer, uint32 time_ms, Lua_Encounter enc) {
|
||||||
quest_manager.settimerMS(timer, time_ms, enc);
|
quest_manager.settimerMS(timer, time_ms, enc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_stop_timer(const char *timer) {
|
void lua_stop_timer(std::string timer) {
|
||||||
quest_manager.stoptimer(timer);
|
quest_manager.stoptimer(timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_stop_timer(const char *timer, Lua_ItemInst inst) {
|
void lua_stop_timer(std::string timer, Lua_ItemInst inst) {
|
||||||
quest_manager.stoptimer(timer, inst);
|
quest_manager.stoptimer(timer, inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_stop_timer(const char *timer, Lua_Mob mob) {
|
void lua_stop_timer(std::string timer, Lua_Mob mob) {
|
||||||
quest_manager.stoptimer(timer, mob);
|
quest_manager.stoptimer(timer, mob);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_stop_timer(const char *timer, Lua_Encounter enc) {
|
void lua_stop_timer(std::string timer, Lua_Encounter enc) {
|
||||||
quest_manager.stoptimer(timer, enc);
|
quest_manager.stoptimer(timer, enc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -347,27 +347,27 @@ void lua_stop_all_timers(Lua_Encounter enc) {
|
|||||||
quest_manager.stopalltimers(enc);
|
quest_manager.stopalltimers(enc);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_pause_timer(const char *timer) {
|
void lua_pause_timer(std::string timer) {
|
||||||
quest_manager.pausetimer(timer);
|
quest_manager.pausetimer(timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_resume_timer(const char *timer) {
|
void lua_resume_timer(std::string timer) {
|
||||||
quest_manager.resumetimer(timer);
|
quest_manager.resumetimer(timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lua_is_paused_timer(const char *timer) {
|
bool lua_is_paused_timer(std::string timer) {
|
||||||
return quest_manager.ispausedtimer(timer);
|
return quest_manager.ispausedtimer(timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lua_has_timer(const char *timer) {
|
bool lua_has_timer(std::string timer) {
|
||||||
return quest_manager.hastimer(timer);
|
return quest_manager.hastimer(timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 lua_get_remaining_time(const char *timer) {
|
uint32 lua_get_remaining_time(std::string timer) {
|
||||||
return quest_manager.getremainingtimeMS(timer);
|
return quest_manager.getremainingtimeMS(timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 lua_get_timer_duration(const char *timer) {
|
uint32 lua_get_timer_duration(std::string timer) {
|
||||||
return quest_manager.gettimerdurationMS(timer);
|
return quest_manager.gettimerdurationMS(timer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5406,6 +5406,75 @@ std::string lua_convert_money_to_string(luabind::adl::object table)
|
|||||||
return Strings::Money(platinum, gold, silver, copper);
|
return Strings::Money(platinum, gold, silver, copper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lua_cast_spell(uint16 spell_id, uint16 target_id)
|
||||||
|
{
|
||||||
|
quest_manager.castspell(spell_id, target_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
void lua_self_cast(uint16 spell_id)
|
||||||
|
{
|
||||||
|
quest_manager.selfcast(spell_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8 lua_get_bot_class_by_id(uint32 bot_id)
|
||||||
|
{
|
||||||
|
return database.botdb.GetBotClassByID(bot_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8 lua_get_bot_gender_by_id(uint32 bot_id)
|
||||||
|
{
|
||||||
|
return database.botdb.GetBotGenderByID(bot_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
luabind::object lua_get_bot_ids_by_character_id(lua_State* L, uint32 character_id)
|
||||||
|
{
|
||||||
|
auto lua_table = luabind::newtable(L);
|
||||||
|
|
||||||
|
const auto& l = database.botdb.GetBotIDsByCharacterID(character_id);
|
||||||
|
|
||||||
|
if (!l.empty()) {
|
||||||
|
int index = 1;
|
||||||
|
for (const auto& i : l) {
|
||||||
|
lua_table[index] = i;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return lua_table;
|
||||||
|
}
|
||||||
|
|
||||||
|
luabind::object lua_get_bot_ids_by_character_id(lua_State* L, uint32 character_id, uint8 class_id)
|
||||||
|
{
|
||||||
|
auto lua_table = luabind::newtable(L);
|
||||||
|
|
||||||
|
const auto& l = database.botdb.GetBotIDsByCharacterID(character_id, class_id);
|
||||||
|
|
||||||
|
if (!l.empty()) {
|
||||||
|
int index = 1;
|
||||||
|
for (const auto& i : l) {
|
||||||
|
lua_table[index] = i;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return lua_table;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8 lua_get_bot_level_by_id(uint32 bot_id)
|
||||||
|
{
|
||||||
|
return database.botdb.GetBotLevelByID(bot_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string lua_get_bot_name_by_id(uint32 bot_id)
|
||||||
|
{
|
||||||
|
return database.botdb.GetBotNameByID(bot_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint16 lua_get_bot_race_by_id(uint32 bot_id)
|
||||||
|
{
|
||||||
|
return database.botdb.GetBotRaceByID(bot_id);
|
||||||
|
}
|
||||||
|
|
||||||
#define LuaCreateNPCParse(name, c_type, default_value) do { \
|
#define LuaCreateNPCParse(name, c_type, default_value) do { \
|
||||||
cur = table[#name]; \
|
cur = table[#name]; \
|
||||||
if(luabind::type(cur) != LUA_TNIL) { \
|
if(luabind::type(cur) != LUA_TNIL) { \
|
||||||
@@ -5613,20 +5682,20 @@ luabind::scope lua_register_general() {
|
|||||||
luabind::def("spawn_from_spawn2", (Lua_Mob(*)(uint32))&lua_spawn_from_spawn2),
|
luabind::def("spawn_from_spawn2", (Lua_Mob(*)(uint32))&lua_spawn_from_spawn2),
|
||||||
luabind::def("enable_spawn2", &lua_enable_spawn2),
|
luabind::def("enable_spawn2", &lua_enable_spawn2),
|
||||||
luabind::def("disable_spawn2", &lua_disable_spawn2),
|
luabind::def("disable_spawn2", &lua_disable_spawn2),
|
||||||
luabind::def("has_timer", (bool(*)(const char*))&lua_has_timer),
|
luabind::def("has_timer", (bool(*)(std::string))&lua_has_timer),
|
||||||
luabind::def("get_remaining_time", (uint32(*)(const char*))&lua_get_remaining_time),
|
luabind::def("get_remaining_time", (uint32(*)(std::string))&lua_get_remaining_time),
|
||||||
luabind::def("get_timer_duration", (uint32(*)(const char*))&lua_get_timer_duration),
|
luabind::def("get_timer_duration", (uint32(*)(std::string))&lua_get_timer_duration),
|
||||||
luabind::def("set_timer", (void(*)(const char*, int))&lua_set_timer),
|
luabind::def("set_timer", (void(*)(std::string, uint32))&lua_set_timer),
|
||||||
luabind::def("set_timer", (void(*)(const char*, int, Lua_ItemInst))&lua_set_timer),
|
luabind::def("set_timer", (void(*)(std::string, uint32, Lua_ItemInst))&lua_set_timer),
|
||||||
luabind::def("set_timer", (void(*)(const char*, int, Lua_Mob))&lua_set_timer),
|
luabind::def("set_timer", (void(*)(std::string, uint32, Lua_Mob))&lua_set_timer),
|
||||||
luabind::def("set_timer", (void(*)(const char*, int, Lua_Encounter))&lua_set_timer),
|
luabind::def("set_timer", (void(*)(std::string, uint32, Lua_Encounter))&lua_set_timer),
|
||||||
luabind::def("stop_timer", (void(*)(const char*))&lua_stop_timer),
|
luabind::def("stop_timer", (void(*)(std::string))&lua_stop_timer),
|
||||||
luabind::def("stop_timer", (void(*)(const char*, Lua_ItemInst))&lua_stop_timer),
|
luabind::def("stop_timer", (void(*)(std::string, Lua_ItemInst))&lua_stop_timer),
|
||||||
luabind::def("stop_timer", (void(*)(const char*, Lua_Mob))&lua_stop_timer),
|
luabind::def("stop_timer", (void(*)(std::string, Lua_Mob))&lua_stop_timer),
|
||||||
luabind::def("stop_timer", (void(*)(const char*, Lua_Encounter))&lua_stop_timer),
|
luabind::def("stop_timer", (void(*)(std::string, Lua_Encounter))&lua_stop_timer),
|
||||||
luabind::def("pause_timer", (void(*)(const char*))&lua_pause_timer),
|
luabind::def("pause_timer", (void(*)(std::string))&lua_pause_timer),
|
||||||
luabind::def("resume_timer", (void(*)(const char*))&lua_resume_timer),
|
luabind::def("resume_timer", (void(*)(std::string))&lua_resume_timer),
|
||||||
luabind::def("is_paused_timer", (bool(*)(const char*))&lua_is_paused_timer),
|
luabind::def("is_paused_timer", (bool(*)(std::string))&lua_is_paused_timer),
|
||||||
luabind::def("stop_all_timers", (void(*)(void))&lua_stop_all_timers),
|
luabind::def("stop_all_timers", (void(*)(void))&lua_stop_all_timers),
|
||||||
luabind::def("stop_all_timers", (void(*)(Lua_ItemInst))&lua_stop_all_timers),
|
luabind::def("stop_all_timers", (void(*)(Lua_ItemInst))&lua_stop_all_timers),
|
||||||
luabind::def("stop_all_timers", (void(*)(Lua_Mob))&lua_stop_all_timers),
|
luabind::def("stop_all_timers", (void(*)(Lua_Mob))&lua_stop_all_timers),
|
||||||
@@ -6187,6 +6256,15 @@ luabind::scope lua_register_general() {
|
|||||||
luabind::def("get_spell_resurrection_sickness_check", &lua_get_spell_resurrection_sickness_check),
|
luabind::def("get_spell_resurrection_sickness_check", &lua_get_spell_resurrection_sickness_check),
|
||||||
luabind::def("get_spell_nimbus_effect", &lua_get_spell_nimbus_effect),
|
luabind::def("get_spell_nimbus_effect", &lua_get_spell_nimbus_effect),
|
||||||
luabind::def("convert_money_to_string", &lua_convert_money_to_string),
|
luabind::def("convert_money_to_string", &lua_convert_money_to_string),
|
||||||
|
luabind::def("cast_spell", &lua_cast_spell),
|
||||||
|
luabind::def("self_cast", &lua_self_cast),
|
||||||
|
luabind::def("get_bot_class_by_id", &lua_get_bot_class_by_id),
|
||||||
|
luabind::def("get_bot_gender_by_id", &lua_get_bot_gender_by_id),
|
||||||
|
luabind::def("get_bot_ids_by_character_id", (luabind::object(*)(lua_State*, uint32))&lua_get_bot_ids_by_character_id),
|
||||||
|
luabind::def("get_bot_ids_by_character_id", (luabind::object(*)(lua_State*, uint32,uint8))&lua_get_bot_ids_by_character_id),
|
||||||
|
luabind::def("get_bot_level_by_id", &lua_get_bot_level_by_id),
|
||||||
|
luabind::def("get_bot_name_by_id", &lua_get_bot_name_by_id),
|
||||||
|
luabind::def("get_bot_race_by_id", &lua_get_bot_race_by_id),
|
||||||
/*
|
/*
|
||||||
Cross Zone
|
Cross Zone
|
||||||
*/
|
*/
|
||||||
@@ -6644,7 +6722,14 @@ luabind::scope lua_register_events() {
|
|||||||
luabind::value("alt_currency_gain", static_cast<int>(EVENT_ALT_CURRENCY_GAIN)),
|
luabind::value("alt_currency_gain", static_cast<int>(EVENT_ALT_CURRENCY_GAIN)),
|
||||||
luabind::value("alt_currency_loss", static_cast<int>(EVENT_ALT_CURRENCY_LOSS)),
|
luabind::value("alt_currency_loss", static_cast<int>(EVENT_ALT_CURRENCY_LOSS)),
|
||||||
luabind::value("crystal_gain", static_cast<int>(EVENT_CRYSTAL_GAIN)),
|
luabind::value("crystal_gain", static_cast<int>(EVENT_CRYSTAL_GAIN)),
|
||||||
luabind::value("crystal_loss", static_cast<int>(EVENT_CRYSTAL_LOSS))
|
luabind::value("crystal_loss", static_cast<int>(EVENT_CRYSTAL_LOSS)),
|
||||||
|
luabind::value("timer_pause", static_cast<int>(EVENT_TIMER_PAUSE)),
|
||||||
|
luabind::value("timer_resume", static_cast<int>(EVENT_TIMER_RESUME)),
|
||||||
|
luabind::value("timer_start", static_cast<int>(EVENT_TIMER_START)),
|
||||||
|
luabind::value("timer_stop", static_cast<int>(EVENT_TIMER_STOP)),
|
||||||
|
luabind::value("entity_variable_delete", static_cast<int>(EVENT_ENTITY_VARIABLE_DELETE)),
|
||||||
|
luabind::value("entity_variable_set", static_cast<int>(EVENT_ENTITY_VARIABLE_SET)),
|
||||||
|
luabind::value("entity_variable_update", static_cast<int>(EVENT_ENTITY_VARIABLE_UPDATE))
|
||||||
)];
|
)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -317,6 +317,26 @@ void Lua_ItemInst::ItemSay(const char* text, uint8 language_id) // @categories I
|
|||||||
quest_manager.GetInitiator()->ChannelMessageSend(self->GetItem()->Name, 0, ChatChannel_Say, language_id, Language::MaxValue, text);
|
quest_manager.GetInitiator()->ChannelMessageSend(self->GetItem()->Name, 0, ChatChannel_Say, language_id, Language::MaxValue, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
luabind::object Lua_ItemInst::GetAugmentIDs(lua_State* L)
|
||||||
|
{
|
||||||
|
auto lua_table = luabind::newtable(L);
|
||||||
|
|
||||||
|
if (d_) {
|
||||||
|
auto self = reinterpret_cast<NativeType*>(d_);
|
||||||
|
|
||||||
|
const auto& augment_ids = self->GetAugmentIDs();
|
||||||
|
|
||||||
|
int index = 1;
|
||||||
|
|
||||||
|
for (auto augment_id : augment_ids) {
|
||||||
|
lua_table[index] = augment_id;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return lua_table;
|
||||||
|
}
|
||||||
|
|
||||||
luabind::scope lua_register_iteminst() {
|
luabind::scope lua_register_iteminst() {
|
||||||
return luabind::class_<Lua_ItemInst>("ItemInst")
|
return luabind::class_<Lua_ItemInst>("ItemInst")
|
||||||
.def(luabind::constructor<>())
|
.def(luabind::constructor<>())
|
||||||
@@ -331,6 +351,7 @@ luabind::scope lua_register_iteminst() {
|
|||||||
.def("CountAugmentByID", (int(Lua_ItemInst::*)(uint32))&Lua_ItemInst::CountAugmentByID)
|
.def("CountAugmentByID", (int(Lua_ItemInst::*)(uint32))&Lua_ItemInst::CountAugmentByID)
|
||||||
.def("DeleteCustomData", (void(Lua_ItemInst::*)(const std::string &))&Lua_ItemInst::DeleteCustomData)
|
.def("DeleteCustomData", (void(Lua_ItemInst::*)(const std::string &))&Lua_ItemInst::DeleteCustomData)
|
||||||
.def("GetAugment", (Lua_ItemInst(Lua_ItemInst::*)(int))&Lua_ItemInst::GetAugment)
|
.def("GetAugment", (Lua_ItemInst(Lua_ItemInst::*)(int))&Lua_ItemInst::GetAugment)
|
||||||
|
.def("GetAugmentIDs", (luabind::object(Lua_ItemInst::*)(lua_State*))&Lua_ItemInst::GetAugmentIDs)
|
||||||
.def("GetAugmentItemID", (uint32(Lua_ItemInst::*)(int))&Lua_ItemInst::GetAugmentItemID)
|
.def("GetAugmentItemID", (uint32(Lua_ItemInst::*)(int))&Lua_ItemInst::GetAugmentItemID)
|
||||||
.def("GetAugmentType", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetAugmentType)
|
.def("GetAugmentType", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetAugmentType)
|
||||||
.def("GetCharges", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetCharges)
|
.def("GetCharges", (int(Lua_ItemInst::*)(void))&Lua_ItemInst::GetCharges)
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ public:
|
|||||||
std::string GetName();
|
std::string GetName();
|
||||||
void ItemSay(const char* text);
|
void ItemSay(const char* text);
|
||||||
void ItemSay(const char* text, uint8 language_id);
|
void ItemSay(const char* text, uint8 language_id);
|
||||||
|
luabind::object GetAugmentIDs(lua_State* L);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool cloned_;
|
bool cloned_;
|
||||||
|
|||||||
@@ -3201,6 +3201,72 @@ uint32 Lua_Mob::GetMobTypeIdentifier()
|
|||||||
return self->GetMobTypeIdentifier();
|
return self->GetMobTypeIdentifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 Lua_Mob::GetHateListCount()
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetHateListCount();
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 Lua_Mob::GetHateListBotCount()
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetHateListCount(HateListCountType::Bot);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 Lua_Mob::GetHateListClientCount()
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetHateListCount(HateListCountType::Client);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 Lua_Mob::GetHateListNPCCount()
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetHateListCount(HateListCountType::NPC);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Mob::IsAnimation()
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->IsAnimation();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Mob::IsCharmed()
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->IsCharmed();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Mob::IsFamiliar()
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->IsFamiliar();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Mob::IsTargetLockPet()
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->IsTargetLockPet();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Mob::IsPetOwnerBot()
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->IsPetOwnerBot();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Mob::IsPetOwnerClient()
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->IsPetOwnerClient();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Lua_Mob::IsPetOwnerNPC()
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Bool();
|
||||||
|
return self->IsPetOwnerNPC();
|
||||||
|
}
|
||||||
|
|
||||||
luabind::scope lua_register_mob() {
|
luabind::scope lua_register_mob() {
|
||||||
return luabind::class_<Lua_Mob, Lua_Entity>("Mob")
|
return luabind::class_<Lua_Mob, Lua_Entity>("Mob")
|
||||||
.def(luabind::constructor<>())
|
.def(luabind::constructor<>())
|
||||||
@@ -3460,12 +3526,16 @@ luabind::scope lua_register_mob() {
|
|||||||
.def("GetHateList", &Lua_Mob::GetHateList)
|
.def("GetHateList", &Lua_Mob::GetHateList)
|
||||||
.def("GetHateListBots", (Lua_HateList(Lua_Mob::*)(void))&Lua_Mob::GetHateListBots)
|
.def("GetHateListBots", (Lua_HateList(Lua_Mob::*)(void))&Lua_Mob::GetHateListBots)
|
||||||
.def("GetHateListBots", (Lua_HateList(Lua_Mob::*)(uint32))&Lua_Mob::GetHateListBots)
|
.def("GetHateListBots", (Lua_HateList(Lua_Mob::*)(uint32))&Lua_Mob::GetHateListBots)
|
||||||
|
.def("GetHateListBotCount", &Lua_Mob::GetHateListBotCount)
|
||||||
.def("GetHateListClients", (Lua_HateList(Lua_Mob::*)(void))&Lua_Mob::GetHateListClients)
|
.def("GetHateListClients", (Lua_HateList(Lua_Mob::*)(void))&Lua_Mob::GetHateListClients)
|
||||||
.def("GetHateListClients", (Lua_HateList(Lua_Mob::*)(uint32))&Lua_Mob::GetHateListClients)
|
.def("GetHateListClients", (Lua_HateList(Lua_Mob::*)(uint32))&Lua_Mob::GetHateListClients)
|
||||||
|
.def("GetHateListClientCount", &Lua_Mob::GetHateListClientCount)
|
||||||
.def("GetHateListNPCs", (Lua_HateList(Lua_Mob::*)(void))&Lua_Mob::GetHateListNPCs)
|
.def("GetHateListNPCs", (Lua_HateList(Lua_Mob::*)(void))&Lua_Mob::GetHateListNPCs)
|
||||||
.def("GetHateListNPCs", (Lua_HateList(Lua_Mob::*)(uint32))&Lua_Mob::GetHateListNPCs)
|
.def("GetHateListNPCs", (Lua_HateList(Lua_Mob::*)(uint32))&Lua_Mob::GetHateListNPCs)
|
||||||
|
.def("GetHateListNPCCount", &Lua_Mob::GetHateListNPCCount)
|
||||||
.def("GetHateListByDistance", (Lua_HateList(Lua_Mob::*)(void))&Lua_Mob::GetHateListByDistance)
|
.def("GetHateListByDistance", (Lua_HateList(Lua_Mob::*)(void))&Lua_Mob::GetHateListByDistance)
|
||||||
.def("GetHateListByDistance", (Lua_HateList(Lua_Mob::*)(uint32))&Lua_Mob::GetHateListByDistance)
|
.def("GetHateListByDistance", (Lua_HateList(Lua_Mob::*)(uint32))&Lua_Mob::GetHateListByDistance)
|
||||||
|
.def("GetHateListCount", &Lua_Mob::GetHateListCount)
|
||||||
.def("GetHateRandom", (Lua_Mob(Lua_Mob::*)(void))&Lua_Mob::GetHateRandom)
|
.def("GetHateRandom", (Lua_Mob(Lua_Mob::*)(void))&Lua_Mob::GetHateRandom)
|
||||||
.def("GetHateRandomBot", (Lua_Bot(Lua_Mob::*)(void))&Lua_Mob::GetHateRandomBot)
|
.def("GetHateRandomBot", (Lua_Bot(Lua_Mob::*)(void))&Lua_Mob::GetHateRandomBot)
|
||||||
.def("GetHateRandomClient", (Lua_Client(Lua_Mob::*)(void))&Lua_Mob::GetHateRandomClient)
|
.def("GetHateRandomClient", (Lua_Client(Lua_Mob::*)(void))&Lua_Mob::GetHateRandomClient)
|
||||||
@@ -3573,15 +3643,18 @@ luabind::scope lua_register_mob() {
|
|||||||
.def("InterruptSpell", (void(Lua_Mob::*)(void))&Lua_Mob::InterruptSpell)
|
.def("InterruptSpell", (void(Lua_Mob::*)(void))&Lua_Mob::InterruptSpell)
|
||||||
.def("IsAIControlled", (bool(Lua_Mob::*)(void))&Lua_Mob::IsAIControlled)
|
.def("IsAIControlled", (bool(Lua_Mob::*)(void))&Lua_Mob::IsAIControlled)
|
||||||
.def("IsAmnesiad", (bool(Lua_Mob::*)(void))&Lua_Mob::IsAmnesiad)
|
.def("IsAmnesiad", (bool(Lua_Mob::*)(void))&Lua_Mob::IsAmnesiad)
|
||||||
|
.def("IsAnimation", &Lua_Mob::IsAnimation)
|
||||||
.def("IsAttackAllowed", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::IsAttackAllowed)
|
.def("IsAttackAllowed", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::IsAttackAllowed)
|
||||||
.def("IsAttackAllowed", (bool(Lua_Mob::*)(Lua_Mob,bool))&Lua_Mob::IsAttackAllowed)
|
.def("IsAttackAllowed", (bool(Lua_Mob::*)(Lua_Mob,bool))&Lua_Mob::IsAttackAllowed)
|
||||||
.def("IsBeneficialAllowed", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::IsBeneficialAllowed)
|
.def("IsBeneficialAllowed", (bool(Lua_Mob::*)(Lua_Mob))&Lua_Mob::IsBeneficialAllowed)
|
||||||
.def("IsBerserk", &Lua_Mob::IsBerserk)
|
.def("IsBerserk", &Lua_Mob::IsBerserk)
|
||||||
.def("IsBlind", (bool(Lua_Mob::*)(void))&Lua_Mob::IsBlind)
|
.def("IsBlind", (bool(Lua_Mob::*)(void))&Lua_Mob::IsBlind)
|
||||||
.def("IsCasting", &Lua_Mob::IsCasting)
|
.def("IsCasting", &Lua_Mob::IsCasting)
|
||||||
|
.def("IsCharmed", &Lua_Mob::IsCharmed)
|
||||||
.def("IsEliteMaterialItem", (uint32(Lua_Mob::*)(uint8))&Lua_Mob::IsEliteMaterialItem)
|
.def("IsEliteMaterialItem", (uint32(Lua_Mob::*)(uint8))&Lua_Mob::IsEliteMaterialItem)
|
||||||
.def("IsEngaged", (bool(Lua_Mob::*)(void))&Lua_Mob::IsEngaged)
|
.def("IsEngaged", (bool(Lua_Mob::*)(void))&Lua_Mob::IsEngaged)
|
||||||
.def("IsEnraged", (bool(Lua_Mob::*)(void))&Lua_Mob::IsEnraged)
|
.def("IsEnraged", (bool(Lua_Mob::*)(void))&Lua_Mob::IsEnraged)
|
||||||
|
.def("IsFamiliar", &Lua_Mob::IsFamiliar)
|
||||||
.def("IsFeared", (bool(Lua_Mob::*)(void))&Lua_Mob::IsFeared)
|
.def("IsFeared", (bool(Lua_Mob::*)(void))&Lua_Mob::IsFeared)
|
||||||
.def("IsFindable", (bool(Lua_Mob::*)(void))&Lua_Mob::IsFindable)
|
.def("IsFindable", (bool(Lua_Mob::*)(void))&Lua_Mob::IsFindable)
|
||||||
.def("IsHorse", &Lua_Mob::IsHorse)
|
.def("IsHorse", &Lua_Mob::IsHorse)
|
||||||
@@ -3593,6 +3666,9 @@ luabind::scope lua_register_mob() {
|
|||||||
.def("IsMoving", &Lua_Mob::IsMoving)
|
.def("IsMoving", &Lua_Mob::IsMoving)
|
||||||
.def("IsPausedTimer", &Lua_Mob::IsPausedTimer)
|
.def("IsPausedTimer", &Lua_Mob::IsPausedTimer)
|
||||||
.def("IsPet", (bool(Lua_Mob::*)(void))&Lua_Mob::IsPet)
|
.def("IsPet", (bool(Lua_Mob::*)(void))&Lua_Mob::IsPet)
|
||||||
|
.def("IsPetOwnerBot", &Lua_Mob::IsPetOwnerBot)
|
||||||
|
.def("IsPetOwnerClient", &Lua_Mob::IsPetOwnerClient)
|
||||||
|
.def("IsPetOwnerNPC", &Lua_Mob::IsPetOwnerNPC)
|
||||||
.def("IsRoamer", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRoamer)
|
.def("IsRoamer", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRoamer)
|
||||||
.def("IsRooted", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRooted)
|
.def("IsRooted", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRooted)
|
||||||
.def("IsRunning", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRunning)
|
.def("IsRunning", (bool(Lua_Mob::*)(void))&Lua_Mob::IsRunning)
|
||||||
@@ -3600,6 +3676,7 @@ luabind::scope lua_register_mob() {
|
|||||||
.def("IsStunned", (bool(Lua_Mob::*)(void))&Lua_Mob::IsStunned)
|
.def("IsStunned", (bool(Lua_Mob::*)(void))&Lua_Mob::IsStunned)
|
||||||
.def("IsTargetable", (bool(Lua_Mob::*)(void))&Lua_Mob::IsTargetable)
|
.def("IsTargetable", (bool(Lua_Mob::*)(void))&Lua_Mob::IsTargetable)
|
||||||
.def("IsTargeted", &Lua_Mob::IsTargeted)
|
.def("IsTargeted", &Lua_Mob::IsTargeted)
|
||||||
|
.def("IsTargetLockPet", &Lua_Mob::IsTargetLockPet)
|
||||||
.def("IsTemporaryPet", &Lua_Mob::IsTemporaryPet)
|
.def("IsTemporaryPet", &Lua_Mob::IsTemporaryPet)
|
||||||
.def("IsTrackable", (bool(Lua_Mob::*)(void))&Lua_Mob::IsTrackable)
|
.def("IsTrackable", (bool(Lua_Mob::*)(void))&Lua_Mob::IsTrackable)
|
||||||
.def("IsWarriorClass", &Lua_Mob::IsWarriorClass)
|
.def("IsWarriorClass", &Lua_Mob::IsWarriorClass)
|
||||||
|
|||||||
@@ -566,6 +566,17 @@ public:
|
|||||||
std::string GetRacePlural();
|
std::string GetRacePlural();
|
||||||
bool IsTemporaryPet();
|
bool IsTemporaryPet();
|
||||||
uint32 GetMobTypeIdentifier();
|
uint32 GetMobTypeIdentifier();
|
||||||
|
uint32 GetHateListCount();
|
||||||
|
uint32 GetHateListBotCount();
|
||||||
|
uint32 GetHateListClientCount();
|
||||||
|
uint32 GetHateListNPCCount();
|
||||||
|
bool IsAnimation();
|
||||||
|
bool IsCharmed();
|
||||||
|
bool IsFamiliar();
|
||||||
|
bool IsTargetLockPet();
|
||||||
|
bool IsPetOwnerBot();
|
||||||
|
bool IsPetOwnerClient();
|
||||||
|
bool IsPetOwnerNPC();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+9
-3
@@ -378,7 +378,7 @@ bool Lua_NPC::GetFollowCanRun() {
|
|||||||
return self->GetFollowCanRun();
|
return self->GetFollowCanRun();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Lua_NPC::GetNPCSpellsID() {
|
uint32 Lua_NPC::GetNPCSpellsID() {
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return self->GetNPCSpellsID();
|
return self->GetNPCSpellsID();
|
||||||
}
|
}
|
||||||
@@ -825,6 +825,12 @@ void Lua_NPC::SetNPCAggro(bool in_npc_aggro)
|
|||||||
self->SetNPCAggro(in_npc_aggro);
|
self->SetNPCAggro(in_npc_aggro);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 Lua_NPC::GetNPCSpellsEffectsID()
|
||||||
|
{
|
||||||
|
Lua_Safe_Call_Int();
|
||||||
|
return self->GetNPCSpellsEffectsID();
|
||||||
|
}
|
||||||
|
|
||||||
luabind::scope lua_register_npc() {
|
luabind::scope lua_register_npc() {
|
||||||
return luabind::class_<Lua_NPC, Lua_Mob>("NPC")
|
return luabind::class_<Lua_NPC, Lua_Mob>("NPC")
|
||||||
.def(luabind::constructor<>())
|
.def(luabind::constructor<>())
|
||||||
@@ -887,8 +893,8 @@ luabind::scope lua_register_npc() {
|
|||||||
.def("GetNPCAggro", (bool(Lua_NPC::*)(void))&Lua_NPC::GetNPCAggro)
|
.def("GetNPCAggro", (bool(Lua_NPC::*)(void))&Lua_NPC::GetNPCAggro)
|
||||||
.def("GetNPCFactionID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCFactionID)
|
.def("GetNPCFactionID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCFactionID)
|
||||||
.def("GetNPCHate", (int64(Lua_NPC::*)(Lua_Mob))&Lua_NPC::GetNPCHate)
|
.def("GetNPCHate", (int64(Lua_NPC::*)(Lua_Mob))&Lua_NPC::GetNPCHate)
|
||||||
.def("GetNPCSpellsID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsID)
|
.def("GetNPCSpellsEffectsID", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsEffectsID)
|
||||||
.def("GetNPCSpellsID", (int(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsID)
|
.def("GetNPCSpellsID", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsID)
|
||||||
.def("GetNPCStat", (float(Lua_NPC::*)(std::string))&Lua_NPC::GetNPCStat)
|
.def("GetNPCStat", (float(Lua_NPC::*)(std::string))&Lua_NPC::GetNPCStat)
|
||||||
.def("GetPetSpellID", (int(Lua_NPC::*)(void))&Lua_NPC::GetPetSpellID)
|
.def("GetPetSpellID", (int(Lua_NPC::*)(void))&Lua_NPC::GetPetSpellID)
|
||||||
.def("GetPlatinum", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetPlatinum)
|
.def("GetPlatinum", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetPlatinum)
|
||||||
|
|||||||
+2
-1
@@ -102,7 +102,7 @@ public:
|
|||||||
int GetFollowID();
|
int GetFollowID();
|
||||||
int GetFollowDistance();
|
int GetFollowDistance();
|
||||||
bool GetFollowCanRun();
|
bool GetFollowCanRun();
|
||||||
int GetNPCSpellsID();
|
uint32 GetNPCSpellsID();
|
||||||
int GetSpawnPointID();
|
int GetSpawnPointID();
|
||||||
float GetSpawnPointX();
|
float GetSpawnPointX();
|
||||||
float GetSpawnPointY();
|
float GetSpawnPointY();
|
||||||
@@ -184,6 +184,7 @@ public:
|
|||||||
void SetBucket(std::string bucket_name, std::string bucket_value, std::string expiration);
|
void SetBucket(std::string bucket_name, std::string bucket_value, std::string expiration);
|
||||||
bool GetNPCAggro();
|
bool GetNPCAggro();
|
||||||
void SetNPCAggro(bool in_npc_aggro);
|
void SetNPCAggro(bool in_npc_aggro);
|
||||||
|
uint32 GetNPCSpellsEffectsID();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+70
-23
@@ -175,7 +175,14 @@ const char *LuaEvents[_LargestEventID] = {
|
|||||||
"event_alt_currency_gain",
|
"event_alt_currency_gain",
|
||||||
"event_alt_currency_loss",
|
"event_alt_currency_loss",
|
||||||
"event_crystal_gain",
|
"event_crystal_gain",
|
||||||
"event_crystal_loss"
|
"event_crystal_loss",
|
||||||
|
"event_timer_pause",
|
||||||
|
"event_timer_resume",
|
||||||
|
"event_timer_start",
|
||||||
|
"event_timer_stop",
|
||||||
|
"event_entity_variable_delete",
|
||||||
|
"event_entity_variable_set",
|
||||||
|
"event_entity_variable_update"
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Zone *zone;
|
extern Zone *zone;
|
||||||
@@ -190,6 +197,14 @@ std::map<std::string, std::list<lua_registered_event>> lua_encounter_events_regi
|
|||||||
std::map<std::string, bool> lua_encounters_loaded;
|
std::map<std::string, bool> lua_encounters_loaded;
|
||||||
std::map<std::string, Encounter *> lua_encounters;
|
std::map<std::string, Encounter *> lua_encounters;
|
||||||
|
|
||||||
|
// use debug.traceback() for errors (luaL_traceback is only in luajit and lua 5.2+)
|
||||||
|
static void PushErrorHandler(lua_State* L)
|
||||||
|
{
|
||||||
|
lua_getglobal(L, "debug");
|
||||||
|
lua_getfield(L, -1, "traceback");
|
||||||
|
lua_remove(L, -2);
|
||||||
|
}
|
||||||
|
|
||||||
LuaParser::LuaParser() {
|
LuaParser::LuaParser() {
|
||||||
for (int i = 0; i < _LargestEventID; ++i) {
|
for (int i = 0; i < _LargestEventID; ++i) {
|
||||||
NPCArgumentDispatch[i] = handle_npc_null;
|
NPCArgumentDispatch[i] = handle_npc_null;
|
||||||
@@ -234,6 +249,13 @@ LuaParser::LuaParser() {
|
|||||||
NPCArgumentDispatch[EVENT_DAMAGE_GIVEN] = handle_npc_damage;
|
NPCArgumentDispatch[EVENT_DAMAGE_GIVEN] = handle_npc_damage;
|
||||||
NPCArgumentDispatch[EVENT_DAMAGE_TAKEN] = handle_npc_damage;
|
NPCArgumentDispatch[EVENT_DAMAGE_TAKEN] = handle_npc_damage;
|
||||||
NPCArgumentDispatch[EVENT_LOOT_ADDED] = handle_npc_loot_added;
|
NPCArgumentDispatch[EVENT_LOOT_ADDED] = handle_npc_loot_added;
|
||||||
|
NPCArgumentDispatch[EVENT_TIMER_PAUSE] = handle_npc_timer_pause_resume_start;
|
||||||
|
NPCArgumentDispatch[EVENT_TIMER_RESUME] = handle_npc_timer_pause_resume_start;
|
||||||
|
NPCArgumentDispatch[EVENT_TIMER_START] = handle_npc_timer_pause_resume_start;
|
||||||
|
NPCArgumentDispatch[EVENT_TIMER_STOP] = handle_npc_timer_stop;
|
||||||
|
NPCArgumentDispatch[EVENT_ENTITY_VARIABLE_DELETE] = handle_npc_entity_variable;
|
||||||
|
NPCArgumentDispatch[EVENT_ENTITY_VARIABLE_SET] = handle_npc_entity_variable;
|
||||||
|
NPCArgumentDispatch[EVENT_ENTITY_VARIABLE_UPDATE] = handle_npc_entity_variable;
|
||||||
|
|
||||||
PlayerArgumentDispatch[EVENT_SAY] = handle_player_say;
|
PlayerArgumentDispatch[EVENT_SAY] = handle_player_say;
|
||||||
PlayerArgumentDispatch[EVENT_ENVIRONMENTAL_DAMAGE] = handle_player_environmental_damage;
|
PlayerArgumentDispatch[EVENT_ENVIRONMENTAL_DAMAGE] = handle_player_environmental_damage;
|
||||||
@@ -314,6 +336,13 @@ LuaParser::LuaParser() {
|
|||||||
PlayerArgumentDispatch[EVENT_ALT_CURRENCY_LOSS] = handle_player_alt_currency_gain_loss;
|
PlayerArgumentDispatch[EVENT_ALT_CURRENCY_LOSS] = handle_player_alt_currency_gain_loss;
|
||||||
PlayerArgumentDispatch[EVENT_CRYSTAL_GAIN] = handle_player_crystal_gain_loss;
|
PlayerArgumentDispatch[EVENT_CRYSTAL_GAIN] = handle_player_crystal_gain_loss;
|
||||||
PlayerArgumentDispatch[EVENT_CRYSTAL_LOSS] = handle_player_crystal_gain_loss;
|
PlayerArgumentDispatch[EVENT_CRYSTAL_LOSS] = handle_player_crystal_gain_loss;
|
||||||
|
PlayerArgumentDispatch[EVENT_TIMER_PAUSE] = handle_player_timer_pause_resume_start;
|
||||||
|
PlayerArgumentDispatch[EVENT_TIMER_RESUME] = handle_player_timer_pause_resume_start;
|
||||||
|
PlayerArgumentDispatch[EVENT_TIMER_START] = handle_player_timer_pause_resume_start;
|
||||||
|
PlayerArgumentDispatch[EVENT_TIMER_STOP] = handle_player_timer_stop;
|
||||||
|
PlayerArgumentDispatch[EVENT_ENTITY_VARIABLE_DELETE] = handle_player_entity_variable;
|
||||||
|
PlayerArgumentDispatch[EVENT_ENTITY_VARIABLE_SET] = handle_player_entity_variable;
|
||||||
|
PlayerArgumentDispatch[EVENT_ENTITY_VARIABLE_UPDATE] = handle_player_entity_variable;
|
||||||
|
|
||||||
ItemArgumentDispatch[EVENT_ITEM_CLICK] = handle_item_click;
|
ItemArgumentDispatch[EVENT_ITEM_CLICK] = handle_item_click;
|
||||||
ItemArgumentDispatch[EVENT_ITEM_CLICK_CAST] = handle_item_click;
|
ItemArgumentDispatch[EVENT_ITEM_CLICK_CAST] = handle_item_click;
|
||||||
@@ -326,6 +355,10 @@ LuaParser::LuaParser() {
|
|||||||
ItemArgumentDispatch[EVENT_UNAUGMENT_ITEM] = handle_item_augment;
|
ItemArgumentDispatch[EVENT_UNAUGMENT_ITEM] = handle_item_augment;
|
||||||
ItemArgumentDispatch[EVENT_AUGMENT_INSERT] = handle_item_augment_insert;
|
ItemArgumentDispatch[EVENT_AUGMENT_INSERT] = handle_item_augment_insert;
|
||||||
ItemArgumentDispatch[EVENT_AUGMENT_REMOVE] = handle_item_augment_remove;
|
ItemArgumentDispatch[EVENT_AUGMENT_REMOVE] = handle_item_augment_remove;
|
||||||
|
ItemArgumentDispatch[EVENT_TIMER_PAUSE] = handle_item_timer_pause_resume_start;
|
||||||
|
ItemArgumentDispatch[EVENT_TIMER_RESUME] = handle_item_timer_pause_resume_start;
|
||||||
|
ItemArgumentDispatch[EVENT_TIMER_START] = handle_item_timer_pause_resume_start;
|
||||||
|
ItemArgumentDispatch[EVENT_TIMER_STOP] = handle_item_timer_stop;
|
||||||
|
|
||||||
SpellArgumentDispatch[EVENT_SPELL_EFFECT_CLIENT] = handle_spell_event;
|
SpellArgumentDispatch[EVENT_SPELL_EFFECT_CLIENT] = handle_spell_event;
|
||||||
SpellArgumentDispatch[EVENT_SPELL_EFFECT_BUFF_TIC_CLIENT] = handle_spell_event;
|
SpellArgumentDispatch[EVENT_SPELL_EFFECT_BUFF_TIC_CLIENT] = handle_spell_event;
|
||||||
@@ -357,6 +390,13 @@ LuaParser::LuaParser() {
|
|||||||
BotArgumentDispatch[EVENT_DAMAGE_TAKEN] = handle_bot_damage;
|
BotArgumentDispatch[EVENT_DAMAGE_TAKEN] = handle_bot_damage;
|
||||||
BotArgumentDispatch[EVENT_LEVEL_UP] = handle_bot_level_up;
|
BotArgumentDispatch[EVENT_LEVEL_UP] = handle_bot_level_up;
|
||||||
BotArgumentDispatch[EVENT_LEVEL_DOWN] = handle_bot_level_down;
|
BotArgumentDispatch[EVENT_LEVEL_DOWN] = handle_bot_level_down;
|
||||||
|
BotArgumentDispatch[EVENT_TIMER_PAUSE] = handle_bot_timer_pause_resume_start;
|
||||||
|
BotArgumentDispatch[EVENT_TIMER_RESUME] = handle_bot_timer_pause_resume_start;
|
||||||
|
BotArgumentDispatch[EVENT_TIMER_START] = handle_bot_timer_pause_resume_start;
|
||||||
|
BotArgumentDispatch[EVENT_TIMER_STOP] = handle_bot_timer_stop;
|
||||||
|
BotArgumentDispatch[EVENT_ENTITY_VARIABLE_DELETE] = handle_bot_entity_variable;
|
||||||
|
BotArgumentDispatch[EVENT_ENTITY_VARIABLE_SET] = handle_bot_entity_variable;
|
||||||
|
BotArgumentDispatch[EVENT_ENTITY_VARIABLE_UPDATE] = handle_bot_entity_variable;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
L = nullptr;
|
L = nullptr;
|
||||||
@@ -416,13 +456,14 @@ int LuaParser::_EventNPC(std::string package_name, QuestEventID evt, NPC* npc, M
|
|||||||
int start = lua_gettop(L);
|
int start = lua_gettop(L);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int npop = 1;
|
int npop = 2;
|
||||||
|
PushErrorHandler(L);
|
||||||
if(l_func != nullptr) {
|
if(l_func != nullptr) {
|
||||||
l_func->push(L);
|
l_func->push(L);
|
||||||
} else {
|
} else {
|
||||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||||
lua_getfield(L, -1, sub_name);
|
lua_getfield(L, -1, sub_name);
|
||||||
npop = 2;
|
npop = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
lua_createtable(L, 0, 0);
|
lua_createtable(L, 0, 0);
|
||||||
@@ -437,7 +478,7 @@ int LuaParser::_EventNPC(std::string package_name, QuestEventID evt, NPC* npc, M
|
|||||||
Client *c = (init && init->IsClient()) ? init->CastToClient() : nullptr;
|
Client *c = (init && init->IsClient()) ? init->CastToClient() : nullptr;
|
||||||
|
|
||||||
quest_manager.StartQuest(npc, c);
|
quest_manager.StartQuest(npc, c);
|
||||||
if(lua_pcall(L, 1, 1, 0)) {
|
if(lua_pcall(L, 1, 1, start + 1)) {
|
||||||
std::string error = lua_tostring(L, -1);
|
std::string error = lua_tostring(L, -1);
|
||||||
AddError(error);
|
AddError(error);
|
||||||
quest_manager.EndQuest();
|
quest_manager.EndQuest();
|
||||||
@@ -509,13 +550,14 @@ int LuaParser::_EventPlayer(std::string package_name, QuestEventID evt, Client *
|
|||||||
int start = lua_gettop(L);
|
int start = lua_gettop(L);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int npop = 1;
|
int npop = 2;
|
||||||
|
PushErrorHandler(L);
|
||||||
if(l_func != nullptr) {
|
if(l_func != nullptr) {
|
||||||
l_func->push(L);
|
l_func->push(L);
|
||||||
} else {
|
} else {
|
||||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||||
lua_getfield(L, -1, sub_name);
|
lua_getfield(L, -1, sub_name);
|
||||||
npop = 2;
|
npop = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
lua_createtable(L, 0, 0);
|
lua_createtable(L, 0, 0);
|
||||||
@@ -529,7 +571,7 @@ int LuaParser::_EventPlayer(std::string package_name, QuestEventID evt, Client *
|
|||||||
arg_function(this, L, client, data, extra_data, extra_pointers);
|
arg_function(this, L, client, data, extra_data, extra_pointers);
|
||||||
|
|
||||||
quest_manager.StartQuest(client, client);
|
quest_manager.StartQuest(client, client);
|
||||||
if(lua_pcall(L, 1, 1, 0)) {
|
if(lua_pcall(L, 1, 1, start + 1)) {
|
||||||
std::string error = lua_tostring(L, -1);
|
std::string error = lua_tostring(L, -1);
|
||||||
AddError(error);
|
AddError(error);
|
||||||
quest_manager.EndQuest();
|
quest_manager.EndQuest();
|
||||||
@@ -586,13 +628,14 @@ int LuaParser::_EventItem(std::string package_name, QuestEventID evt, Client *cl
|
|||||||
int start = lua_gettop(L);
|
int start = lua_gettop(L);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int npop = 1;
|
int npop = 2;
|
||||||
|
PushErrorHandler(L);
|
||||||
if(l_func != nullptr) {
|
if(l_func != nullptr) {
|
||||||
l_func->push(L);
|
l_func->push(L);
|
||||||
} else {
|
} else {
|
||||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||||
lua_getfield(L, -1, sub_name);
|
lua_getfield(L, -1, sub_name);
|
||||||
npop = 2;
|
npop = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
lua_createtable(L, 0, 0);
|
lua_createtable(L, 0, 0);
|
||||||
@@ -612,7 +655,7 @@ int LuaParser::_EventItem(std::string package_name, QuestEventID evt, Client *cl
|
|||||||
arg_function(this, L, client, item, mob, data, extra_data, extra_pointers);
|
arg_function(this, L, client, item, mob, data, extra_data, extra_pointers);
|
||||||
|
|
||||||
quest_manager.StartQuest(client, client, item);
|
quest_manager.StartQuest(client, client, item);
|
||||||
if(lua_pcall(L, 1, 1, 0)) {
|
if(lua_pcall(L, 1, 1, start + 1)) {
|
||||||
std::string error = lua_tostring(L, -1);
|
std::string error = lua_tostring(L, -1);
|
||||||
AddError(error);
|
AddError(error);
|
||||||
quest_manager.EndQuest();
|
quest_manager.EndQuest();
|
||||||
@@ -666,13 +709,14 @@ int LuaParser::_EventSpell(std::string package_name, QuestEventID evt, Mob* mob,
|
|||||||
int start = lua_gettop(L);
|
int start = lua_gettop(L);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int npop = 1;
|
int npop = 2;
|
||||||
|
PushErrorHandler(L);
|
||||||
if(l_func != nullptr) {
|
if(l_func != nullptr) {
|
||||||
l_func->push(L);
|
l_func->push(L);
|
||||||
} else {
|
} else {
|
||||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||||
lua_getfield(L, -1, sub_name);
|
lua_getfield(L, -1, sub_name);
|
||||||
npop = 2;
|
npop = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
lua_createtable(L, 0, 0);
|
lua_createtable(L, 0, 0);
|
||||||
@@ -693,7 +737,7 @@ int LuaParser::_EventSpell(std::string package_name, QuestEventID evt, Mob* mob,
|
|||||||
arg_function(this, L, mob, client, spell_id, data, extra_data, extra_pointers);
|
arg_function(this, L, mob, client, spell_id, data, extra_data, extra_pointers);
|
||||||
|
|
||||||
quest_manager.StartQuest(mob, client, nullptr, const_cast<SPDat_Spell_Struct*>(&spells[spell_id]));
|
quest_manager.StartQuest(mob, client, nullptr, const_cast<SPDat_Spell_Struct*>(&spells[spell_id]));
|
||||||
if(lua_pcall(L, 1, 1, 0)) {
|
if(lua_pcall(L, 1, 1, start + 1)) {
|
||||||
std::string error = lua_tostring(L, -1);
|
std::string error = lua_tostring(L, -1);
|
||||||
AddError(error);
|
AddError(error);
|
||||||
quest_manager.EndQuest();
|
quest_manager.EndQuest();
|
||||||
@@ -745,6 +789,7 @@ int LuaParser::_EventEncounter(std::string package_name, QuestEventID evt, std::
|
|||||||
int start = lua_gettop(L);
|
int start = lua_gettop(L);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
PushErrorHandler(L);
|
||||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||||
lua_getfield(L, -1, sub_name);
|
lua_getfield(L, -1, sub_name);
|
||||||
|
|
||||||
@@ -758,22 +803,22 @@ int LuaParser::_EventEncounter(std::string package_name, QuestEventID evt, std::
|
|||||||
arg_function(this, L, enc, data, extra_data, extra_pointers);
|
arg_function(this, L, enc, data, extra_data, extra_pointers);
|
||||||
|
|
||||||
quest_manager.StartQuest(enc, nullptr, nullptr, nullptr, encounter_name);
|
quest_manager.StartQuest(enc, nullptr, nullptr, nullptr, encounter_name);
|
||||||
if(lua_pcall(L, 1, 1, 0)) {
|
if(lua_pcall(L, 1, 1, start + 1)) {
|
||||||
std::string error = lua_tostring(L, -1);
|
std::string error = lua_tostring(L, -1);
|
||||||
AddError(error);
|
AddError(error);
|
||||||
quest_manager.EndQuest();
|
quest_manager.EndQuest();
|
||||||
lua_pop(L, 2);
|
lua_pop(L, 3);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
quest_manager.EndQuest();
|
quest_manager.EndQuest();
|
||||||
|
|
||||||
if(lua_isnumber(L, -1)) {
|
if(lua_isnumber(L, -1)) {
|
||||||
int ret = static_cast<int>(lua_tointeger(L, -1));
|
int ret = static_cast<int>(lua_tointeger(L, -1));
|
||||||
lua_pop(L, 2);
|
lua_pop(L, 3);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
lua_pop(L, 2);
|
lua_pop(L, 3);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
AddError(fmt::format("Lua Exception | [{}] for Encounter [{}]: {}", sub_name, encounter_name, ex.what()));
|
AddError(fmt::format("Lua Exception | [{}] for Encounter [{}]: {}", sub_name, encounter_name, ex.what()));
|
||||||
|
|
||||||
@@ -1124,10 +1169,11 @@ void LuaParser::LoadScript(std::string filename, std::string package_name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
auto top = lua_gettop(L);
|
auto top = lua_gettop(L);
|
||||||
|
PushErrorHandler(L);
|
||||||
if(luaL_loadfile(L, filename.c_str())) {
|
if(luaL_loadfile(L, filename.c_str())) {
|
||||||
std::string error = lua_tostring(L, -1);
|
std::string error = lua_tostring(L, -1);
|
||||||
AddError(error);
|
AddError(error);
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1147,10 +1193,10 @@ void LuaParser::LoadScript(std::string filename, std::string package_name) {
|
|||||||
|
|
||||||
lua_setfenv(L, -2); //set the env to the table we made
|
lua_setfenv(L, -2); //set the env to the table we made
|
||||||
|
|
||||||
if(lua_pcall(L, 0, 0, 0)) {
|
if(lua_pcall(L, 0, 0, top + 1)) {
|
||||||
std::string error = lua_tostring(L, -1);
|
std::string error = lua_tostring(L, -1);
|
||||||
AddError(error);
|
AddError(error);
|
||||||
lua_pop(L, 1);
|
lua_pop(L, 2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
loaded_[package_name] = true;
|
loaded_[package_name] = true;
|
||||||
@@ -1599,13 +1645,14 @@ int LuaParser::_EventBot(
|
|||||||
int start = lua_gettop(L);
|
int start = lua_gettop(L);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
int npop = 1;
|
int npop = 2;
|
||||||
|
PushErrorHandler(L);
|
||||||
if(l_func != nullptr) {
|
if(l_func != nullptr) {
|
||||||
l_func->push(L);
|
l_func->push(L);
|
||||||
} else {
|
} else {
|
||||||
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
lua_getfield(L, LUA_REGISTRYINDEX, package_name.c_str());
|
||||||
lua_getfield(L, -1, sub_name);
|
lua_getfield(L, -1, sub_name);
|
||||||
npop = 2;
|
npop = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
lua_createtable(L, 0, 0);
|
lua_createtable(L, 0, 0);
|
||||||
@@ -1620,7 +1667,7 @@ int LuaParser::_EventBot(
|
|||||||
auto* c = (init && init->IsClient()) ? init->CastToClient() : nullptr;
|
auto* c = (init && init->IsClient()) ? init->CastToClient() : nullptr;
|
||||||
|
|
||||||
quest_manager.StartQuest(bot, c);
|
quest_manager.StartQuest(bot, c);
|
||||||
if(lua_pcall(L, 1, 1, 0)) {
|
if(lua_pcall(L, 1, 1, start + 1)) {
|
||||||
std::string error = lua_tostring(L, -1);
|
std::string error = lua_tostring(L, -1);
|
||||||
AddError(error);
|
AddError(error);
|
||||||
quest_manager.EndQuest();
|
quest_manager.EndQuest();
|
||||||
|
|||||||
@@ -321,6 +321,18 @@ void handle_npc_death(
|
|||||||
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[4]));
|
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[4]));
|
||||||
lua_setfield(L, -2, "killed_entity_id");
|
lua_setfield(L, -2, "killed_entity_id");
|
||||||
|
|
||||||
|
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[5]));
|
||||||
|
lua_setfield(L, -2, "combat_start_time");
|
||||||
|
|
||||||
|
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[6]));
|
||||||
|
lua_setfield(L, -2, "combat_end_time");
|
||||||
|
|
||||||
|
lua_pushinteger(L, Strings::ToBigInt(sep.arg[7]));
|
||||||
|
lua_setfield(L, -2, "damage_received");
|
||||||
|
|
||||||
|
lua_pushinteger(L, Strings::ToBigInt(sep.arg[8]));
|
||||||
|
lua_setfield(L, -2, "healing_received");
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() >= 1) {
|
if (extra_pointers && extra_pointers->size() >= 1) {
|
||||||
Lua_Corpse l_corpse(std::any_cast<Corpse*>(extra_pointers->at(0)));
|
Lua_Corpse l_corpse(std::any_cast<Corpse*>(extra_pointers->at(0)));
|
||||||
luabind::adl::object l_corpse_o = luabind::adl::object(L, l_corpse);
|
luabind::adl::object l_corpse_o = luabind::adl::object(L, l_corpse);
|
||||||
@@ -553,6 +565,67 @@ void handle_npc_loot_added(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handle_npc_timer_pause_resume_start(
|
||||||
|
QuestInterface *parse,
|
||||||
|
lua_State* L,
|
||||||
|
NPC* npc,
|
||||||
|
Mob *init,
|
||||||
|
std::string data,
|
||||||
|
uint32 extra_data,
|
||||||
|
std::vector<std::any> *extra_pointers
|
||||||
|
) {
|
||||||
|
Seperator sep(data.c_str());
|
||||||
|
|
||||||
|
lua_pushstring(L, sep.arg[0]);
|
||||||
|
lua_setfield(L, -2, "timer");
|
||||||
|
|
||||||
|
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[1]));
|
||||||
|
lua_setfield(L, -2, "duration");
|
||||||
|
}
|
||||||
|
|
||||||
|
void handle_npc_timer_stop(
|
||||||
|
QuestInterface *parse,
|
||||||
|
lua_State* L,
|
||||||
|
NPC* npc,
|
||||||
|
Mob *init,
|
||||||
|
std::string data,
|
||||||
|
uint32 extra_data,
|
||||||
|
std::vector<std::any> *extra_pointers
|
||||||
|
) {
|
||||||
|
lua_pushstring(L, data.c_str());
|
||||||
|
lua_setfield(L, -2, "timer");
|
||||||
|
}
|
||||||
|
|
||||||
|
void handle_npc_entity_variable(
|
||||||
|
QuestInterface *parse,
|
||||||
|
lua_State* L,
|
||||||
|
NPC* npc,
|
||||||
|
Mob *init,
|
||||||
|
std::string data,
|
||||||
|
uint32 extra_data,
|
||||||
|
std::vector<std::any> *extra_pointers
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (extra_pointers) {
|
||||||
|
if (extra_pointers->size() == 2) {
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(0)).c_str());
|
||||||
|
lua_setfield(L, -2, "variable_name");
|
||||||
|
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(1)).c_str());
|
||||||
|
lua_setfield(L, -2, "variable_value");
|
||||||
|
} else if (extra_pointers->size() == 3) {
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(0)).c_str());
|
||||||
|
lua_setfield(L, -2, "variable_name");
|
||||||
|
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(1)).c_str());
|
||||||
|
lua_setfield(L, -2, "old_value");
|
||||||
|
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(2)).c_str());
|
||||||
|
lua_setfield(L, -2, "new_value");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Player
|
// Player
|
||||||
void handle_player_say(
|
void handle_player_say(
|
||||||
QuestInterface *parse,
|
QuestInterface *parse,
|
||||||
@@ -1565,6 +1638,35 @@ void handle_player_alt_currency_gain_loss(
|
|||||||
lua_setfield(L, -2, "total");
|
lua_setfield(L, -2, "total");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handle_player_entity_variable(
|
||||||
|
QuestInterface *parse,
|
||||||
|
lua_State* L,
|
||||||
|
Client* client,
|
||||||
|
std::string data,
|
||||||
|
uint32 extra_data,
|
||||||
|
std::vector<std::any> *extra_pointers
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (extra_pointers) {
|
||||||
|
if (extra_pointers->size() == 2) {
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(0)).c_str());
|
||||||
|
lua_setfield(L, -2, "variable_name");
|
||||||
|
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(1)).c_str());
|
||||||
|
lua_setfield(L, -2, "variable_value");
|
||||||
|
} else if (extra_pointers->size() == 3) {
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(0)).c_str());
|
||||||
|
lua_setfield(L, -2, "variable_name");
|
||||||
|
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(1)).c_str());
|
||||||
|
lua_setfield(L, -2, "old_value");
|
||||||
|
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(2)).c_str());
|
||||||
|
lua_setfield(L, -2, "new_value");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Item
|
// Item
|
||||||
void handle_item_click(
|
void handle_item_click(
|
||||||
QuestInterface *parse,
|
QuestInterface *parse,
|
||||||
@@ -1731,6 +1833,39 @@ void handle_item_null(
|
|||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handle_item_timer_pause_resume_start(
|
||||||
|
QuestInterface *parse,
|
||||||
|
lua_State* L,
|
||||||
|
Client* client,
|
||||||
|
EQ::ItemInstance* item,
|
||||||
|
Mob *mob,
|
||||||
|
std::string data,
|
||||||
|
uint32 extra_data,
|
||||||
|
std::vector<std::any> *extra_pointers
|
||||||
|
) {
|
||||||
|
Seperator sep(data.c_str());
|
||||||
|
|
||||||
|
lua_pushstring(L, sep.arg[0]);
|
||||||
|
lua_setfield(L, -2, "timer");
|
||||||
|
|
||||||
|
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[1]));
|
||||||
|
lua_setfield(L, -2, "duration");
|
||||||
|
}
|
||||||
|
|
||||||
|
void handle_item_timer_stop(
|
||||||
|
QuestInterface *parse,
|
||||||
|
lua_State* L,
|
||||||
|
Client* client,
|
||||||
|
EQ::ItemInstance* item,
|
||||||
|
Mob *mob,
|
||||||
|
std::string data,
|
||||||
|
uint32 extra_data,
|
||||||
|
std::vector<std::any> *extra_pointers
|
||||||
|
) {
|
||||||
|
lua_pushstring(L, data.c_str());
|
||||||
|
lua_setfield(L, -2, "timer");
|
||||||
|
}
|
||||||
|
|
||||||
// Spell
|
// Spell
|
||||||
void handle_spell_event(
|
void handle_spell_event(
|
||||||
QuestInterface *parse,
|
QuestInterface *parse,
|
||||||
@@ -2061,6 +2196,35 @@ void handle_player_augment_remove(
|
|||||||
lua_setfield(L, -2, "destroyed");
|
lua_setfield(L, -2, "destroyed");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handle_player_timer_pause_resume_start(
|
||||||
|
QuestInterface *parse,
|
||||||
|
lua_State* L,
|
||||||
|
Client* client,
|
||||||
|
std::string data,
|
||||||
|
uint32 extra_data,
|
||||||
|
std::vector<std::any> *extra_pointers
|
||||||
|
) {
|
||||||
|
Seperator sep(data.c_str());
|
||||||
|
|
||||||
|
lua_pushstring(L, sep.arg[0]);
|
||||||
|
lua_setfield(L, -2, "timer");
|
||||||
|
|
||||||
|
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[1]));
|
||||||
|
lua_setfield(L, -2, "duration");
|
||||||
|
}
|
||||||
|
|
||||||
|
void handle_player_timer_stop(
|
||||||
|
QuestInterface *parse,
|
||||||
|
lua_State* L,
|
||||||
|
Client* client,
|
||||||
|
std::string data,
|
||||||
|
uint32 extra_data,
|
||||||
|
std::vector<std::any> *extra_pointers
|
||||||
|
) {
|
||||||
|
lua_pushstring(L, data.c_str());
|
||||||
|
lua_setfield(L, -2, "timer");
|
||||||
|
}
|
||||||
|
|
||||||
// Bot
|
// Bot
|
||||||
|
|
||||||
void handle_bot_null(
|
void handle_bot_null(
|
||||||
@@ -2453,4 +2617,65 @@ void handle_bot_level_down(
|
|||||||
lua_setfield(L, -2, "levels_lost");
|
lua_setfield(L, -2, "levels_lost");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void handle_bot_timer_pause_resume_start(
|
||||||
|
QuestInterface *parse,
|
||||||
|
lua_State* L,
|
||||||
|
Bot* bot,
|
||||||
|
Mob *init,
|
||||||
|
std::string data,
|
||||||
|
uint32 extra_data,
|
||||||
|
std::vector<std::any> *extra_pointers
|
||||||
|
) {
|
||||||
|
Seperator sep(data.c_str());
|
||||||
|
|
||||||
|
lua_pushstring(L, sep.arg[0]);
|
||||||
|
lua_setfield(L, -2, "timer");
|
||||||
|
|
||||||
|
lua_pushinteger(L, Strings::ToUnsignedInt(sep.arg[1]));
|
||||||
|
lua_setfield(L, -2, "duration");
|
||||||
|
}
|
||||||
|
|
||||||
|
void handle_bot_timer_stop(
|
||||||
|
QuestInterface *parse,
|
||||||
|
lua_State* L,
|
||||||
|
Bot* bot,
|
||||||
|
Mob *init,
|
||||||
|
std::string data,
|
||||||
|
uint32 extra_data,
|
||||||
|
std::vector<std::any> *extra_pointers
|
||||||
|
) {
|
||||||
|
lua_pushstring(L, data.c_str());
|
||||||
|
lua_setfield(L, -2, "timer");
|
||||||
|
}
|
||||||
|
|
||||||
|
void handle_bot_entity_variable(
|
||||||
|
QuestInterface *parse,
|
||||||
|
lua_State* L,
|
||||||
|
Bot* bot,
|
||||||
|
Mob *init,
|
||||||
|
std::string data,
|
||||||
|
uint32 extra_data,
|
||||||
|
std::vector<std::any> *extra_pointers
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (extra_pointers) {
|
||||||
|
if (extra_pointers->size() == 2) {
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(0)).c_str());
|
||||||
|
lua_setfield(L, -2, "variable_name");
|
||||||
|
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(1)).c_str());
|
||||||
|
lua_setfield(L, -2, "variable_value");
|
||||||
|
} else if (extra_pointers->size() == 3) {
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(0)).c_str());
|
||||||
|
lua_setfield(L, -2, "variable_name");
|
||||||
|
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(1)).c_str());
|
||||||
|
lua_setfield(L, -2, "old_value");
|
||||||
|
|
||||||
|
lua_pushstring(L, std::any_cast<std::string>(extra_pointers->at(2)).c_str());
|
||||||
|
lua_setfield(L, -2, "new_value");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user