mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 17:26:30 +00:00
Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fa5a3155fe | |||
| a20d333f9d | |||
| 853739b538 | |||
| 6094ec9c7b | |||
| 9da1d6b397 | |||
| 8ea7299a57 | |||
| 0811a899d1 | |||
| fad9599642 | |||
| 62711b13d8 | |||
| 2702485206 | |||
| 0aadb891a1 | |||
| d812310c5b | |||
| 1420983700 | |||
| d25cc35f1b | |||
| ed7f395612 | |||
| 8dceb20dd8 | |||
| 6929d180ca | |||
| 011a66a75e | |||
| 07120563a2 | |||
| cc985cbcd5 | |||
| 97caa79472 | |||
| cfa575c756 | |||
| 85063249b4 |
@@ -1,3 +1,78 @@
|
|||||||
|
## [22.33.0] - 11/11/2023
|
||||||
|
|
||||||
|
### Feature
|
||||||
|
|
||||||
|
* Add Comment to Item Data/Quest API ([#3669](https://github.com/EQEmu/Server/pull/3669)) @Kinglykrab 2023-11-07
|
||||||
|
|
||||||
|
### Spawn2
|
||||||
|
|
||||||
|
* Fix edge case with instances not copying disabled spawn state ([#3688](https://github.com/EQEmu/Server/pull/3688)) @Akkadius 2023-11-12
|
||||||
|
|
||||||
|
## [22.32.1] - 11/6/2023
|
||||||
|
|
||||||
|
### Hotfix
|
||||||
|
|
||||||
|
* Adjust spawn2_disabled migration to copy data over
|
||||||
|
|
||||||
|
## [22.32.0] - 11/6/2023
|
||||||
|
|
||||||
|
### Bots
|
||||||
|
|
||||||
|
* Fix invalid races from being created ([#3681](https://github.com/EQEmu/Server/pull/3681)) @nytmyr 2023-11-06
|
||||||
|
|
||||||
|
### Crash
|
||||||
|
|
||||||
|
* Fix crash on CentOS when forming a raid with PCs or BOTs ([#3676](https://github.com/EQEmu/Server/pull/3676)) @neckkola 2023-11-06
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Add IsTGBCompatibleSpell() to package.add ([#3675](https://github.com/EQEmu/Server/pull/3675)) @Kinglykrab 2023-11-04
|
||||||
|
* Fix Perl__worldwideremovetask package ([#3670](https://github.com/EQEmu/Server/pull/3670)) @Kinglykrab 2023-11-04
|
||||||
|
* Revert " Fix Killed XYZH support in EVENT_DEATH in Perl. " (#3682) ([#3591](https://github.com/EQEmu/Server/pull/3591)) @fryguy503 2023-11-06
|
||||||
|
CRASH
|
||||||
|
|
||||||
|
### GCC
|
||||||
|
|
||||||
|
* Compatibility fix for GCC 13 ([#3677](https://github.com/EQEmu/Server/pull/3677)) @joligario 2023-11-05
|
||||||
|
|
||||||
|
### Parser
|
||||||
|
|
||||||
|
* Cleanup Spire Parsing for crosszonemoveplayerbycharid ([#3674](https://github.com/EQEmu/Server/pull/3674)) @Kinglykrab 2023-11-04
|
||||||
|
* Cleanup Spire Parsing for crosszonemoveplayerbyexpeditionid ([#3671](https://github.com/EQEmu/Server/pull/3671)) @Kinglykrab 2023-11-04
|
||||||
|
* Cleanup Spire Parsing for crosszonemoveplayerbygroupid ([#3673](https://github.com/EQEmu/Server/pull/3673)) @Kinglykrab 2023-11-04
|
||||||
|
* Cleanup Spire Parsing for crosszonemoveplayerbyguildid ([#3672](https://github.com/EQEmu/Server/pull/3672)) @Kinglykrab 2023-11-04
|
||||||
|
|
||||||
|
### Quest API
|
||||||
|
|
||||||
|
* Add GetBaseRaceName() to Perl and Lua ([#3668](https://github.com/EQEmu/Server/pull/3668)) @joligario 2023-11-01
|
||||||
|
* Add details to Lua event dispatch errors ([#3679](https://github.com/EQEmu/Server/pull/3679)) @hgtw 2023-11-06
|
||||||
|
|
||||||
|
### Spawn
|
||||||
|
|
||||||
|
* Split spawn2 enabled into its own state table ([#3664](https://github.com/EQEmu/Server/pull/3664)) @Akkadius 2023-11-06
|
||||||
|
|
||||||
|
### Spells
|
||||||
|
|
||||||
|
* Added IsNightTime() for Dance of the Fireflies ([#3667](https://github.com/EQEmu/Server/pull/3667)) @regneq 2023-11-04
|
||||||
|
|
||||||
|
## [22.31.3] - 10/31/2023
|
||||||
|
|
||||||
|
### Bug
|
||||||
|
|
||||||
|
* Force raids off content database ([#3665](https://github.com/EQEmu/Server/pull/3665)) @joligario 2023-10-31
|
||||||
|
|
||||||
|
### Crash
|
||||||
|
|
||||||
|
* Revert " Fix spell in AESpell related to beacons " ([#3659](https://github.com/EQEmu/Server/pull/3659)) @Akkadius 2023-10-31
|
||||||
|
|
||||||
|
### Fixes
|
||||||
|
|
||||||
|
* Fix issue with blocked spells not loading properly @Akkadius 2023-10-31
|
||||||
|
|
||||||
|
### Logs
|
||||||
|
|
||||||
|
* Convert Loot Messages to Error Logs ([#3663](https://github.com/EQEmu/Server/pull/3663)) @Kinglykrab 2023-10-31
|
||||||
|
|
||||||
## [22.31.2] - 10/31/2023
|
## [22.31.2] - 10/31/2023
|
||||||
|
|
||||||
### Fixes
|
### Fixes
|
||||||
|
|||||||
@@ -4995,6 +4995,27 @@ ADD COLUMN `id` int(11) NOT NULL AUTO_INCREMENT FIRST,
|
|||||||
DROP PRIMARY KEY,
|
DROP PRIMARY KEY,
|
||||||
ADD PRIMARY KEY (`id`) USING BTREE,
|
ADD PRIMARY KEY (`id`) USING BTREE,
|
||||||
ADD UNIQUE INDEX(`varname`);
|
ADD UNIQUE INDEX(`varname`);
|
||||||
|
)"
|
||||||
|
},
|
||||||
|
ManifestEntry{
|
||||||
|
.version = 9241,
|
||||||
|
.description = "2023_10_29_split_spawn2_enabled.sql",
|
||||||
|
.check = "SHOW TABLES LIKE 'spawn2_disabled'",
|
||||||
|
.condition = "empty",
|
||||||
|
.match = "",
|
||||||
|
.sql = R"(
|
||||||
|
CREATE TABLE `spawn2_backup_2023_10_29` LIKE `spawn2`;
|
||||||
|
INSERT INTO `spawn2_backup_2023_10_29` SELECT * FROM `spawn2`;
|
||||||
|
CREATE TABLE `spawn2_disabled` (
|
||||||
|
`id` bigint(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`spawn2_id` int(11) DEFAULT NULL,
|
||||||
|
`instance_id` int(11) DEFAULT 0,
|
||||||
|
`disabled` smallint(11) DEFAULT 0,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `spawn2_id` (`spawn2_id`,`instance_id`) USING BTREE
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
|
||||||
|
INSERT INTO spawn2_disabled (spawn2_id, disabled) SELECT id, 1 FROM spawn2 WHERE enabled = 0;
|
||||||
|
ALTER TABLE `spawn2` DROP COLUMN `enabled`;
|
||||||
)"
|
)"
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "../common/repositories/raid_members_repository.h"
|
#include "../common/repositories/raid_members_repository.h"
|
||||||
#include "../common/repositories/respawn_times_repository.h"
|
#include "../common/repositories/respawn_times_repository.h"
|
||||||
#include "../common/repositories/spawn_condition_values_repository.h"
|
#include "../common/repositories/spawn_condition_values_repository.h"
|
||||||
|
#include "repositories/spawn2_disabled_repository.h"
|
||||||
|
|
||||||
|
|
||||||
#include "database.h"
|
#include "database.h"
|
||||||
@@ -49,6 +50,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
bool Database::AddClientToInstance(uint16 instance_id, uint32 character_id)
|
bool Database::AddClientToInstance(uint16 instance_id, uint32 character_id)
|
||||||
{
|
{
|
||||||
auto e = InstanceListPlayerRepository::NewEntity();
|
auto e = InstanceListPlayerRepository::NewEntity();
|
||||||
@@ -553,6 +555,7 @@ void Database::PurgeExpiredInstances()
|
|||||||
CharacterCorpsesRepository::BuryInstances(*this, imploded_instance_ids);
|
CharacterCorpsesRepository::BuryInstances(*this, imploded_instance_ids);
|
||||||
DynamicZoneMembersRepository::DeleteByManyInstances(*this, imploded_instance_ids);
|
DynamicZoneMembersRepository::DeleteByManyInstances(*this, imploded_instance_ids);
|
||||||
DynamicZonesRepository::DeleteWhere(*this, fmt::format("instance_id IN ({})", imploded_instance_ids));
|
DynamicZonesRepository::DeleteWhere(*this, fmt::format("instance_id IN ({})", imploded_instance_ids));
|
||||||
|
Spawn2DisabledRepository::DeleteWhere(*this, fmt::format("instance_id IN ({})", imploded_instance_ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
|
void Database::SetInstanceDuration(uint16 instance_id, uint32 new_duration)
|
||||||
|
|||||||
@@ -345,6 +345,7 @@ namespace DatabaseSchema {
|
|||||||
"respawn_times",
|
"respawn_times",
|
||||||
"saylink",
|
"saylink",
|
||||||
"server_scheduled_events",
|
"server_scheduled_events",
|
||||||
|
"spawn2_disabled",
|
||||||
"player_event_log_settings",
|
"player_event_log_settings",
|
||||||
"player_event_logs",
|
"player_event_logs",
|
||||||
"shared_task_activity_state",
|
"shared_task_activity_state",
|
||||||
|
|||||||
@@ -1052,4 +1052,11 @@ enum ScribeSpellActions
|
|||||||
Unmemorize
|
Unmemorize
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum SpellTimeRestrictions
|
||||||
|
{
|
||||||
|
NoRestriction,
|
||||||
|
Day,
|
||||||
|
Night
|
||||||
|
};
|
||||||
|
|
||||||
#endif /*COMMON_EQ_CONSTANTS_H*/
|
#endif /*COMMON_EQ_CONSTANTS_H*/
|
||||||
|
|||||||
@@ -200,3 +200,25 @@ void EQTime::ToString(TimeOfDay_Struct *t, std::string &str) {
|
|||||||
buf[127] = '\0';
|
buf[127] = '\0';
|
||||||
str = buf;
|
str = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EQTime::IsDayTime() {
|
||||||
|
TimeOfDay_Struct tod; //Day time is 5am to 6:59pm (14 hours in-game)
|
||||||
|
GetCurrentEQTimeOfDay(&tod); //TODO: what if it fails and returns zero?
|
||||||
|
|
||||||
|
if (tod.hour >= 5 || tod.hour < 19) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool EQTime::IsNightTime() {
|
||||||
|
TimeOfDay_Struct tod; //Night time is 7pm to 4:59am (10 hours in-game)
|
||||||
|
GetCurrentEQTimeOfDay(&tod); //TODO: what if it fails and returns zero?
|
||||||
|
|
||||||
|
if (tod.hour >= 19 || tod.hour < 5) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|||||||
@@ -28,6 +28,8 @@ public:
|
|||||||
uint32 getEQTimeZone() { return timezone; }
|
uint32 getEQTimeZone() { return timezone; }
|
||||||
uint32 getEQTimeZoneHr() { return timezone/60; }
|
uint32 getEQTimeZoneHr() { return timezone/60; }
|
||||||
uint32 getEQTimeZoneMin() { return timezone%60; }
|
uint32 getEQTimeZoneMin() { return timezone%60; }
|
||||||
|
bool IsDayTime();
|
||||||
|
bool IsNightTime();
|
||||||
|
|
||||||
//Set functions
|
//Set functions
|
||||||
int SetCurrentEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real);
|
int SetCurrentEQTimeOfDay(TimeOfDay_Struct start_eq, time_t start_real);
|
||||||
|
|||||||
@@ -356,6 +356,7 @@ namespace EQ
|
|||||||
struct ItemData {
|
struct ItemData {
|
||||||
// Non packet based fields
|
// Non packet based fields
|
||||||
uint8 MinStatus {};
|
uint8 MinStatus {};
|
||||||
|
char Comment[255] {};
|
||||||
|
|
||||||
// Packet based fields
|
// Packet based fields
|
||||||
uint8 ItemClass {}; // Item Type: 0=common, 1=container, 2=book
|
uint8 ItemClass {}; // Item Type: 0=common, 1=container, 2=book
|
||||||
|
|||||||
@@ -0,0 +1,354 @@
|
|||||||
|
/**
|
||||||
|
* 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://eqemu.gitbook.io/server/in-development/developer-area/repositories
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef EQEMU_BASE_SPAWN2_DISABLED_REPOSITORY_H
|
||||||
|
#define EQEMU_BASE_SPAWN2_DISABLED_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../../database.h"
|
||||||
|
#include "../../strings.h"
|
||||||
|
#include <ctime>
|
||||||
|
|
||||||
|
|
||||||
|
class BaseSpawn2DisabledRepository {
|
||||||
|
public:
|
||||||
|
struct Spawn2Disabled {
|
||||||
|
int64_t id;
|
||||||
|
int32_t spawn2_id;
|
||||||
|
int32_t instance_id;
|
||||||
|
int16_t disabled;
|
||||||
|
};
|
||||||
|
|
||||||
|
static std::string PrimaryKey()
|
||||||
|
{
|
||||||
|
return std::string("id");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> Columns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"spawn2_id",
|
||||||
|
"instance_id",
|
||||||
|
"disabled",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<std::string> SelectColumns()
|
||||||
|
{
|
||||||
|
return {
|
||||||
|
"id",
|
||||||
|
"spawn2_id",
|
||||||
|
"instance_id",
|
||||||
|
"disabled",
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
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("spawn2_disabled");
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseSelect()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"SELECT {} FROM {}",
|
||||||
|
SelectColumnsRaw(),
|
||||||
|
TableName()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::string BaseInsert()
|
||||||
|
{
|
||||||
|
return fmt::format(
|
||||||
|
"INSERT INTO {} ({}) ",
|
||||||
|
TableName(),
|
||||||
|
ColumnsRaw()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Spawn2Disabled NewEntity()
|
||||||
|
{
|
||||||
|
Spawn2Disabled e{};
|
||||||
|
|
||||||
|
e.id = 0;
|
||||||
|
e.spawn2_id = 0;
|
||||||
|
e.instance_id = 0;
|
||||||
|
e.disabled = 0;
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Spawn2Disabled GetSpawn2Disabled(
|
||||||
|
const std::vector<Spawn2Disabled> &spawn2_disableds,
|
||||||
|
int spawn2_disabled_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
for (auto &spawn2_disabled : spawn2_disableds) {
|
||||||
|
if (spawn2_disabled.id == spawn2_disabled_id) {
|
||||||
|
return spawn2_disabled;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static Spawn2Disabled FindOne(
|
||||||
|
Database& db,
|
||||||
|
int spawn2_disabled_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} WHERE {} = {} LIMIT 1",
|
||||||
|
BaseSelect(),
|
||||||
|
PrimaryKey(),
|
||||||
|
spawn2_disabled_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
auto row = results.begin();
|
||||||
|
if (results.RowCount() == 1) {
|
||||||
|
Spawn2Disabled e{};
|
||||||
|
|
||||||
|
e.id = strtoll(row[0], nullptr, 10);
|
||||||
|
e.spawn2_id = static_cast<int32_t>(atoi(row[1]));
|
||||||
|
e.instance_id = static_cast<int32_t>(atoi(row[2]));
|
||||||
|
e.disabled = static_cast<int16_t>(atoi(row[3]));
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NewEntity();
|
||||||
|
}
|
||||||
|
|
||||||
|
static int DeleteOne(
|
||||||
|
Database& db,
|
||||||
|
int spawn2_disabled_id
|
||||||
|
)
|
||||||
|
{
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"DELETE FROM {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
PrimaryKey(),
|
||||||
|
spawn2_disabled_id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int UpdateOne(
|
||||||
|
Database& db,
|
||||||
|
const Spawn2Disabled &e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
auto columns = Columns();
|
||||||
|
|
||||||
|
v.push_back(columns[1] + " = " + std::to_string(e.spawn2_id));
|
||||||
|
v.push_back(columns[2] + " = " + std::to_string(e.instance_id));
|
||||||
|
v.push_back(columns[3] + " = " + std::to_string(e.disabled));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"UPDATE {} SET {} WHERE {} = {}",
|
||||||
|
TableName(),
|
||||||
|
Strings::Implode(", ", v),
|
||||||
|
PrimaryKey(),
|
||||||
|
e.id
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return (results.Success() ? results.RowsAffected() : 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Spawn2Disabled InsertOne(
|
||||||
|
Database& db,
|
||||||
|
Spawn2Disabled e
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.spawn2_id));
|
||||||
|
v.push_back(std::to_string(e.instance_id));
|
||||||
|
v.push_back(std::to_string(e.disabled));
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{} VALUES ({})",
|
||||||
|
BaseInsert(),
|
||||||
|
Strings::Implode(",", v)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (results.Success()) {
|
||||||
|
e.id = results.LastInsertedID();
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
e = NewEntity();
|
||||||
|
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int InsertMany(
|
||||||
|
Database& db,
|
||||||
|
const std::vector<Spawn2Disabled> &entries
|
||||||
|
)
|
||||||
|
{
|
||||||
|
std::vector<std::string> insert_chunks;
|
||||||
|
|
||||||
|
for (auto &e: entries) {
|
||||||
|
std::vector<std::string> v;
|
||||||
|
|
||||||
|
v.push_back(std::to_string(e.id));
|
||||||
|
v.push_back(std::to_string(e.spawn2_id));
|
||||||
|
v.push_back(std::to_string(e.instance_id));
|
||||||
|
v.push_back(std::to_string(e.disabled));
|
||||||
|
|
||||||
|
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<Spawn2Disabled> All(Database& db)
|
||||||
|
{
|
||||||
|
std::vector<Spawn2Disabled> all_entries;
|
||||||
|
|
||||||
|
auto results = db.QueryDatabase(
|
||||||
|
fmt::format(
|
||||||
|
"{}",
|
||||||
|
BaseSelect()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
all_entries.reserve(results.RowCount());
|
||||||
|
|
||||||
|
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||||
|
Spawn2Disabled e{};
|
||||||
|
|
||||||
|
e.id = strtoll(row[0], nullptr, 10);
|
||||||
|
e.spawn2_id = static_cast<int32_t>(atoi(row[1]));
|
||||||
|
e.instance_id = static_cast<int32_t>(atoi(row[2]));
|
||||||
|
e.disabled = static_cast<int16_t>(atoi(row[3]));
|
||||||
|
|
||||||
|
all_entries.push_back(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return all_entries;
|
||||||
|
}
|
||||||
|
|
||||||
|
static std::vector<Spawn2Disabled> GetWhere(Database& db, const std::string &where_filter)
|
||||||
|
{
|
||||||
|
std::vector<Spawn2Disabled> 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) {
|
||||||
|
Spawn2Disabled e{};
|
||||||
|
|
||||||
|
e.id = strtoll(row[0], nullptr, 10);
|
||||||
|
e.spawn2_id = static_cast<int32_t>(atoi(row[1]));
|
||||||
|
e.instance_id = static_cast<int32_t>(atoi(row[2]));
|
||||||
|
e.disabled = static_cast<int16_t>(atoi(row[3]));
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //EQEMU_BASE_SPAWN2_DISABLED_REPOSITORY_H
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "../../strings.h"
|
#include "../../strings.h"
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
|
|
||||||
|
|
||||||
class BaseSpawn2Repository {
|
class BaseSpawn2Repository {
|
||||||
public:
|
public:
|
||||||
struct Spawn2 {
|
struct Spawn2 {
|
||||||
@@ -33,7 +34,6 @@ public:
|
|||||||
int8_t path_when_zone_idle;
|
int8_t path_when_zone_idle;
|
||||||
uint32_t _condition;
|
uint32_t _condition;
|
||||||
int32_t cond_value;
|
int32_t cond_value;
|
||||||
uint8_t enabled;
|
|
||||||
uint8_t animation;
|
uint8_t animation;
|
||||||
int8_t min_expansion;
|
int8_t min_expansion;
|
||||||
int8_t max_expansion;
|
int8_t max_expansion;
|
||||||
@@ -63,7 +63,6 @@ public:
|
|||||||
"path_when_zone_idle",
|
"path_when_zone_idle",
|
||||||
"_condition",
|
"_condition",
|
||||||
"cond_value",
|
"cond_value",
|
||||||
"enabled",
|
|
||||||
"animation",
|
"animation",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
"max_expansion",
|
"max_expansion",
|
||||||
@@ -89,7 +88,6 @@ public:
|
|||||||
"path_when_zone_idle",
|
"path_when_zone_idle",
|
||||||
"_condition",
|
"_condition",
|
||||||
"cond_value",
|
"cond_value",
|
||||||
"enabled",
|
|
||||||
"animation",
|
"animation",
|
||||||
"min_expansion",
|
"min_expansion",
|
||||||
"max_expansion",
|
"max_expansion",
|
||||||
@@ -149,7 +147,6 @@ public:
|
|||||||
e.path_when_zone_idle = 0;
|
e.path_when_zone_idle = 0;
|
||||||
e._condition = 0;
|
e._condition = 0;
|
||||||
e.cond_value = 1;
|
e.cond_value = 1;
|
||||||
e.enabled = 1;
|
|
||||||
e.animation = 0;
|
e.animation = 0;
|
||||||
e.min_expansion = -1;
|
e.min_expansion = -1;
|
||||||
e.max_expansion = -1;
|
e.max_expansion = -1;
|
||||||
@@ -180,8 +177,9 @@ public:
|
|||||||
{
|
{
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"{} WHERE id = {} LIMIT 1",
|
"{} WHERE {} = {} LIMIT 1",
|
||||||
BaseSelect(),
|
BaseSelect(),
|
||||||
|
PrimaryKey(),
|
||||||
spawn2_id
|
spawn2_id
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -204,12 +202,11 @@ public:
|
|||||||
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
||||||
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||||
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
||||||
e.enabled = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
e.animation = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||||
e.animation = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
e.min_expansion = static_cast<int8_t>(atoi(row[15]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[16]));
|
e.max_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[17]));
|
e.content_flags = row[17] ? row[17] : "";
|
||||||
e.content_flags = row[18] ? row[18] : "";
|
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||||
e.content_flags_disabled = row[19] ? row[19] : "";
|
|
||||||
|
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
@@ -256,12 +253,11 @@ public:
|
|||||||
v.push_back(columns[11] + " = " + std::to_string(e.path_when_zone_idle));
|
v.push_back(columns[11] + " = " + std::to_string(e.path_when_zone_idle));
|
||||||
v.push_back(columns[12] + " = " + std::to_string(e._condition));
|
v.push_back(columns[12] + " = " + std::to_string(e._condition));
|
||||||
v.push_back(columns[13] + " = " + std::to_string(e.cond_value));
|
v.push_back(columns[13] + " = " + std::to_string(e.cond_value));
|
||||||
v.push_back(columns[14] + " = " + std::to_string(e.enabled));
|
v.push_back(columns[14] + " = " + std::to_string(e.animation));
|
||||||
v.push_back(columns[15] + " = " + std::to_string(e.animation));
|
v.push_back(columns[15] + " = " + std::to_string(e.min_expansion));
|
||||||
v.push_back(columns[16] + " = " + std::to_string(e.min_expansion));
|
v.push_back(columns[16] + " = " + std::to_string(e.max_expansion));
|
||||||
v.push_back(columns[17] + " = " + 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) + "'");
|
v.push_back(columns[18] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
||||||
v.push_back(columns[19] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
|
|
||||||
|
|
||||||
auto results = db.QueryDatabase(
|
auto results = db.QueryDatabase(
|
||||||
fmt::format(
|
fmt::format(
|
||||||
@@ -297,7 +293,6 @@ public:
|
|||||||
v.push_back(std::to_string(e.path_when_zone_idle));
|
v.push_back(std::to_string(e.path_when_zone_idle));
|
||||||
v.push_back(std::to_string(e._condition));
|
v.push_back(std::to_string(e._condition));
|
||||||
v.push_back(std::to_string(e.cond_value));
|
v.push_back(std::to_string(e.cond_value));
|
||||||
v.push_back(std::to_string(e.enabled));
|
|
||||||
v.push_back(std::to_string(e.animation));
|
v.push_back(std::to_string(e.animation));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
v.push_back(std::to_string(e.max_expansion));
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
@@ -346,7 +341,6 @@ public:
|
|||||||
v.push_back(std::to_string(e.path_when_zone_idle));
|
v.push_back(std::to_string(e.path_when_zone_idle));
|
||||||
v.push_back(std::to_string(e._condition));
|
v.push_back(std::to_string(e._condition));
|
||||||
v.push_back(std::to_string(e.cond_value));
|
v.push_back(std::to_string(e.cond_value));
|
||||||
v.push_back(std::to_string(e.enabled));
|
|
||||||
v.push_back(std::to_string(e.animation));
|
v.push_back(std::to_string(e.animation));
|
||||||
v.push_back(std::to_string(e.min_expansion));
|
v.push_back(std::to_string(e.min_expansion));
|
||||||
v.push_back(std::to_string(e.max_expansion));
|
v.push_back(std::to_string(e.max_expansion));
|
||||||
@@ -399,12 +393,11 @@ public:
|
|||||||
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
||||||
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||||
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
||||||
e.enabled = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
e.animation = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||||
e.animation = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
e.min_expansion = static_cast<int8_t>(atoi(row[15]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[16]));
|
e.max_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[17]));
|
e.content_flags = row[17] ? row[17] : "";
|
||||||
e.content_flags = row[18] ? row[18] : "";
|
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||||
e.content_flags_disabled = row[19] ? row[19] : "";
|
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
@@ -443,12 +436,11 @@ public:
|
|||||||
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
e.path_when_zone_idle = static_cast<int8_t>(atoi(row[11]));
|
||||||
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
e._condition = static_cast<uint32_t>(strtoul(row[12], nullptr, 10));
|
||||||
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
e.cond_value = static_cast<int32_t>(atoi(row[13]));
|
||||||
e.enabled = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
e.animation = static_cast<uint8_t>(strtoul(row[14], nullptr, 10));
|
||||||
e.animation = static_cast<uint8_t>(strtoul(row[15], nullptr, 10));
|
e.min_expansion = static_cast<int8_t>(atoi(row[15]));
|
||||||
e.min_expansion = static_cast<int8_t>(atoi(row[16]));
|
e.max_expansion = static_cast<int8_t>(atoi(row[16]));
|
||||||
e.max_expansion = static_cast<int8_t>(atoi(row[17]));
|
e.content_flags = row[17] ? row[17] : "";
|
||||||
e.content_flags = row[18] ? row[18] : "";
|
e.content_flags_disabled = row[18] ? row[18] : "";
|
||||||
e.content_flags_disabled = row[19] ? row[19] : "";
|
|
||||||
|
|
||||||
all_entries.push_back(e);
|
all_entries.push_back(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
#ifndef EQEMU_SPAWN2_DISABLED_REPOSITORY_H
|
||||||
|
#define EQEMU_SPAWN2_DISABLED_REPOSITORY_H
|
||||||
|
|
||||||
|
#include "../database.h"
|
||||||
|
#include "../strings.h"
|
||||||
|
#include "base/base_spawn2_disabled_repository.h"
|
||||||
|
|
||||||
|
class Spawn2DisabledRepository: public BaseSpawn2DisabledRepository {
|
||||||
|
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
|
||||||
|
*
|
||||||
|
* Spawn2DisabledRepository::GetByZoneAndVersion(int zone_id, int zone_version)
|
||||||
|
* Spawn2DisabledRepository::GetWhereNeverExpires()
|
||||||
|
* Spawn2DisabledRepository::GetWhereXAndY()
|
||||||
|
* Spawn2DisabledRepository::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_SPAWN2_DISABLED_REPOSITORY_H
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
typedef struct eq_cpu_info_s {
|
typedef struct eq_cpu_info_s {
|
||||||
std::string model;
|
std::string model;
|
||||||
|
|||||||
+2
-2
@@ -1142,10 +1142,10 @@ struct ServerInstanceUpdateTime_Struct
|
|||||||
uint32 new_duration;
|
uint32 new_duration;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ServerSpawnStatusChange_Struct
|
struct ServerSpawnStatusChange_Struct {
|
||||||
{
|
|
||||||
uint32 id;
|
uint32 id;
|
||||||
bool new_status;
|
bool new_status;
|
||||||
|
uint32 instance_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ServerQGlobalUpdate_Struct
|
struct ServerQGlobalUpdate_Struct
|
||||||
|
|||||||
+9
-3
@@ -51,7 +51,9 @@ namespace ItemField
|
|||||||
#define F(x) x,
|
#define F(x) x,
|
||||||
#include "item_fieldlist.h"
|
#include "item_fieldlist.h"
|
||||||
#undef F
|
#undef F
|
||||||
updated
|
updated,
|
||||||
|
minstatus,
|
||||||
|
comment,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -965,7 +967,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
|||||||
#define F(x) "`"#x"`,"
|
#define F(x) "`"#x"`,"
|
||||||
#include "item_fieldlist.h"
|
#include "item_fieldlist.h"
|
||||||
#undef F
|
#undef F
|
||||||
"updated FROM items ORDER BY id";
|
"updated, minstatus, comment FROM items ORDER BY id";
|
||||||
auto results = QueryDatabase(query);
|
auto results = QueryDatabase(query);
|
||||||
if (!results.Success()) {
|
if (!results.Success()) {
|
||||||
return;
|
return;
|
||||||
@@ -977,9 +979,13 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
|||||||
// Unique Identifier
|
// Unique Identifier
|
||||||
item.ID = Strings::ToUnsignedInt(row[ItemField::id]);
|
item.ID = Strings::ToUnsignedInt(row[ItemField::id]);
|
||||||
|
|
||||||
// Name and Lore
|
// Minimum Status
|
||||||
|
item.MinStatus = static_cast<uint8>(Strings::ToUnsignedInt(row[ItemField::minstatus]));
|
||||||
|
|
||||||
|
// Name, Lore, and Comment
|
||||||
strn0cpy(item.Name, row[ItemField::name], sizeof(item.Name));
|
strn0cpy(item.Name, row[ItemField::name], sizeof(item.Name));
|
||||||
strn0cpy(item.Lore, row[ItemField::lore], sizeof(item.Lore));
|
strn0cpy(item.Lore, row[ItemField::lore], sizeof(item.Lore));
|
||||||
|
strn0cpy(item.Comment, row[ItemField::comment], sizeof(item.Comment));
|
||||||
|
|
||||||
// Flags
|
// Flags
|
||||||
item.ArtifactFlag = Strings::ToBool(row[ItemField::artifactflag]);
|
item.ArtifactFlag = Strings::ToBool(row[ItemField::artifactflag]);
|
||||||
|
|||||||
+2
-2
@@ -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.31.2-dev" // always append -dev to the current version for custom-builds
|
#define CURRENT_VERSION "22.33.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,7 +42,7 @@
|
|||||||
* 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 9240
|
#define CURRENT_BINARY_DATABASE_VERSION 9241
|
||||||
|
|
||||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9040
|
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9040
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "eqemu-server",
|
"name": "eqemu-server",
|
||||||
"version": "22.31.2",
|
"version": "22.33.0",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/EQEmu/Server.git"
|
"url": "https://github.com/EQEmu/Server.git"
|
||||||
|
|||||||
+3
-7
@@ -1741,8 +1741,7 @@ bool Client::Death(Mob* killerMob, int64 damage, uint16 spell, EQ::skills::Skill
|
|||||||
static_cast<int>(attack_skill)
|
static_cast<int>(attack_skill)
|
||||||
);
|
);
|
||||||
|
|
||||||
std::vector<std::any> args = { CastToMob() };
|
if (parse->EventPlayer(EVENT_DEATH, this, export_string, 0) != 0) {
|
||||||
if (parse->EventPlayer(EVENT_DEATH, this, export_string, 0, &args) != 0) {
|
|
||||||
if (GetHP() < 0) {
|
if (GetHP() < 0) {
|
||||||
SetHP(0);
|
SetHP(0);
|
||||||
}
|
}
|
||||||
@@ -2389,8 +2388,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
static_cast<int>(attack_skill)
|
static_cast<int>(attack_skill)
|
||||||
);
|
);
|
||||||
|
|
||||||
std::vector<std::any> args = { CastToMob() };
|
if (parse->EventNPC(EVENT_DEATH, this, oos, export_string, 0) != 0) {
|
||||||
if (parse->EventNPC(EVENT_DEATH, this, oos, export_string, 0, &args) != 0) {
|
|
||||||
if (GetHP() < 0) {
|
if (GetHP() < 0) {
|
||||||
SetHP(0);
|
SetHP(0);
|
||||||
}
|
}
|
||||||
@@ -2407,9 +2405,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
|||||||
spell,
|
spell,
|
||||||
static_cast<int>(attack_skill)
|
static_cast<int>(attack_skill)
|
||||||
);
|
);
|
||||||
|
if (parse->EventBot(EVENT_DEATH, CastToBot(), oos, export_string, 0) != 0) {
|
||||||
std::vector<std::any> args = { CastToMob() };
|
|
||||||
if (parse->EventBot(EVENT_DEATH, CastToBot(), oos, export_string, 0, &args) != 0) {
|
|
||||||
if (GetHP() < 0) {
|
if (GetHP() < 0) {
|
||||||
SetHP(0);
|
SetHP(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8884,7 +8884,7 @@ uint32 helper_bot_create(Client *bot_owner, std::string bot_name, uint8 bot_clas
|
|||||||
return bot_id;
|
return bot_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Bot::IsValidRaceClassCombo(bot_race, bot_class) && IsPlayerRace(bot_race)) {
|
if (!Bot::IsValidRaceClassCombo(bot_race, bot_class)) {
|
||||||
const std::string bot_race_name = GetRaceIDName(bot_race);
|
const std::string bot_race_name = GetRaceIDName(bot_race);
|
||||||
const std::string bot_class_name = GetClassIDName(bot_class);
|
const std::string bot_class_name = GetClassIDName(bot_class);
|
||||||
const auto view_saylink = Saylink::Silent(
|
const auto view_saylink = Saylink::Silent(
|
||||||
|
|||||||
+9
-38
@@ -1875,55 +1875,27 @@ void PerlembParser::ExportEventVariables(
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EVENT_DEATH: {
|
|
||||||
Seperator sep(data);
|
|
||||||
ExportVar(package_name.c_str(), "killer_id", sep.arg[0]);
|
|
||||||
ExportVar(package_name.c_str(), "killer_damage", sep.arg[1]);
|
|
||||||
ExportVar(package_name.c_str(), "killer_spell", sep.arg[2]);
|
|
||||||
ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]);
|
|
||||||
|
|
||||||
if (IsValidSpell(Strings::ToUnsignedInt(sep.arg[2]))) {
|
|
||||||
ExportVar(package_name.c_str(), "spell", "Spell", (void*)&spells[Strings::ToUnsignedInt(sep.arg[2])]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (extra_pointers && extra_pointers->size() == 1) {
|
|
||||||
Mob* killed = std::any_cast<Mob*>(extra_pointers->at(0));
|
|
||||||
if (killed) {
|
|
||||||
ExportVar(package_name.c_str(), "killed_entity_id", killed->GetID());
|
|
||||||
ExportVar(package_name.c_str(), "killed_bot_id", killed->IsBot() ? killed->CastToBot()->GetBotID() : 0);
|
|
||||||
ExportVar(package_name.c_str(), "killed_npc_id", killed->IsNPC() ? killed->GetNPCTypeID() : 0);
|
|
||||||
ExportVar(package_name.c_str(), "killed_x", killed->GetX());
|
|
||||||
ExportVar(package_name.c_str(), "killed_y", killed->GetY());
|
|
||||||
ExportVar(package_name.c_str(), "killed_z", killed->GetZ());
|
|
||||||
ExportVar(package_name.c_str(), "killed_h", killed->GetHeading());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case EVENT_DEATH_ZONE:
|
case EVENT_DEATH_ZONE:
|
||||||
|
case EVENT_DEATH:
|
||||||
case EVENT_DEATH_COMPLETE: {
|
case EVENT_DEATH_COMPLETE: {
|
||||||
Seperator sep(data);
|
Seperator sep(data);
|
||||||
ExportVar(package_name.c_str(), "killer_id", sep.arg[0]);
|
ExportVar(package_name.c_str(), "killer_id", sep.arg[0]);
|
||||||
ExportVar(package_name.c_str(), "killer_damage", sep.arg[1]);
|
ExportVar(package_name.c_str(), "killer_damage", sep.arg[1]);
|
||||||
ExportVar(package_name.c_str(), "killer_spell", sep.arg[2]);
|
ExportVar(package_name.c_str(), "killer_spell", sep.arg[2]);
|
||||||
ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]);
|
ExportVar(package_name.c_str(), "killer_skill", sep.arg[3]);
|
||||||
|
if (extra_pointers && extra_pointers->size() >= 1)
|
||||||
if (IsValidSpell(Strings::ToUnsignedInt(sep.arg[2]))) {
|
{
|
||||||
ExportVar(package_name.c_str(), "spell", "Spell", (void*)&spells[Strings::ToUnsignedInt(sep.arg[2])]);
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
||||||
|
{
|
||||||
ExportVar(package_name.c_str(), "killed_corpse_id", corpse->GetID());
|
ExportVar(package_name.c_str(), "killed_corpse_id", corpse->GetID());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (extra_pointers && extra_pointers->size() >= 2)
|
||||||
if (extra_pointers && extra_pointers->size() >= 2) {
|
{
|
||||||
NPC* killed = std::any_cast<NPC*>(extra_pointers->at(1));
|
NPC* killed = std::any_cast<NPC*>(extra_pointers->at(1));
|
||||||
if (killed) {
|
if (killed)
|
||||||
|
{
|
||||||
ExportVar(package_name.c_str(), "killed_entity_id", killed->GetID());
|
ExportVar(package_name.c_str(), "killed_entity_id", killed->GetID());
|
||||||
ExportVar(package_name.c_str(), "killed_bot_id", killed->IsBot() ? killed->CastToBot()->GetBotID() : 0);
|
ExportVar(package_name.c_str(), "killed_bot_id", killed->IsBot() ? killed->CastToBot()->GetBotID() : 0);
|
||||||
ExportVar(package_name.c_str(), "killed_npc_id", killed->IsNPC() ? killed->GetNPCTypeID() : 0);
|
ExportVar(package_name.c_str(), "killed_npc_id", killed->IsNPC() ? killed->GetNPCTypeID() : 0);
|
||||||
@@ -1933,7 +1905,6 @@ void PerlembParser::ExportEventVariables(
|
|||||||
ExportVar(package_name.c_str(), "killed_h", killed->GetHeading());
|
ExportVar(package_name.c_str(), "killed_h", killed->GetHeading());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+20
-35
@@ -1433,6 +1433,16 @@ void Perl__removeitem(uint32_t item_id, int quantity)
|
|||||||
quest_manager.removeitem(item_id, quantity);
|
quest_manager.removeitem(item_id, quantity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Perl__getitemcomment(uint32 item_id)
|
||||||
|
{
|
||||||
|
return quest_manager.getitemcomment(item_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string Perl__getitemlore(uint32 item_id)
|
||||||
|
{
|
||||||
|
return quest_manager.getitemlore(item_id);
|
||||||
|
}
|
||||||
|
|
||||||
std::string Perl__getitemname(uint32 item_id)
|
std::string Perl__getitemname(uint32 item_id)
|
||||||
{
|
{
|
||||||
return quest_manager.getitemname(item_id);
|
return quest_manager.getitemname(item_id);
|
||||||
@@ -3506,14 +3516,7 @@ void Perl__crosszonemoveplayerbycharid(uint32 character_id, std::string zone_sho
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__crosszonemoveplayerbycharid(
|
void Perl__crosszonemoveplayerbycharid(uint32 character_id, std::string zone_short_name, float x, float y, float z, float heading)
|
||||||
uint32 character_id,
|
|
||||||
std::string zone_short_name,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
float z,
|
|
||||||
float heading
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
quest_manager.CrossZoneMove(
|
quest_manager.CrossZoneMove(
|
||||||
CZMove_Struct{
|
CZMove_Struct{
|
||||||
@@ -3551,14 +3554,7 @@ void Perl__crosszonemoveplayerbygroupid(uint32 group_id, std::string zone_short_
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__crosszonemoveplayerbygroupid(
|
void Perl__crosszonemoveplayerbygroupid(uint32 group_id, std::string zone_short_name, float x, float y, float z, float heading)
|
||||||
uint32 group_id,
|
|
||||||
std::string zone_short_name,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
float z,
|
|
||||||
float heading
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
quest_manager.CrossZoneMove(
|
quest_manager.CrossZoneMove(
|
||||||
CZMove_Struct{
|
CZMove_Struct{
|
||||||
@@ -3634,14 +3630,7 @@ void Perl__crosszonemoveplayerbyguildid(uint32 guild_id, std::string zone_short_
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__crosszonemoveplayerbyguildid(
|
void Perl__crosszonemoveplayerbyguildid(uint32 guild_id, std::string zone_short_name, float x, float y, float z, float heading)
|
||||||
uint32 guild_id,
|
|
||||||
std::string zone_short_name,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
float z,
|
|
||||||
float heading
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
quest_manager.CrossZoneMove(
|
quest_manager.CrossZoneMove(
|
||||||
CZMove_Struct{
|
CZMove_Struct{
|
||||||
@@ -3679,14 +3668,7 @@ void Perl__crosszonemoveplayerbyexpeditionid(uint32 expedition_id, std::string z
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Perl__crosszonemoveplayerbyexpeditionid(
|
void Perl__crosszonemoveplayerbyexpeditionid(uint32 expedition_id, std::string zone_short_name, float x, float y, float z, float heading)
|
||||||
uint32 expedition_id,
|
|
||||||
std::string zone_short_name,
|
|
||||||
float x,
|
|
||||||
float y,
|
|
||||||
float z,
|
|
||||||
float heading
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
quest_manager.CrossZoneMove(
|
quest_manager.CrossZoneMove(
|
||||||
CZMove_Struct{
|
CZMove_Struct{
|
||||||
@@ -5860,8 +5842,8 @@ void perl_register_quest()
|
|||||||
package.add("GetZoneFogRed", (uint8(*)(uint32))&Perl__GetZoneFogRed);
|
package.add("GetZoneFogRed", (uint8(*)(uint32))&Perl__GetZoneFogRed);
|
||||||
package.add("GetZoneFogRed", (uint8(*)(uint32, uint8))&Perl__GetZoneFogRed);
|
package.add("GetZoneFogRed", (uint8(*)(uint32, uint8))&Perl__GetZoneFogRed);
|
||||||
package.add("GetZoneFogRed", (uint8(*)(uint32, uint8, int))&Perl__GetZoneFogRed);
|
package.add("GetZoneFogRed", (uint8(*)(uint32, uint8, int))&Perl__GetZoneFogRed);
|
||||||
package.add("GetZoneGravity", (float(*)(uint32))&Perl__GetZoneMaximumClip);
|
package.add("GetZoneGravity", (float(*)(uint32))&Perl__GetZoneGravity);
|
||||||
package.add("GetZoneGravity", (float(*)(uint32, int))&Perl__GetZoneMaximumClip);
|
package.add("GetZoneGravity", (float(*)(uint32, int))&Perl__GetZoneGravity);
|
||||||
package.add("GetZoneMaximumClip", (float(*)(uint32))&Perl__GetZoneMaximumClip);
|
package.add("GetZoneMaximumClip", (float(*)(uint32))&Perl__GetZoneMaximumClip);
|
||||||
package.add("GetZoneMaximumClip", (float(*)(uint32, int))&Perl__GetZoneMaximumClip);
|
package.add("GetZoneMaximumClip", (float(*)(uint32, int))&Perl__GetZoneMaximumClip);
|
||||||
package.add("GetZoneMaximumExpansion", (int8(*)(uint32))&Perl__GetZoneMaximumExpansion);
|
package.add("GetZoneMaximumExpansion", (int8(*)(uint32))&Perl__GetZoneMaximumExpansion);
|
||||||
@@ -6033,6 +6015,7 @@ void perl_register_quest()
|
|||||||
package.add("IsTargetRequiredForSpell", &Perl__IsTargetRequiredForSpell);
|
package.add("IsTargetRequiredForSpell", &Perl__IsTargetRequiredForSpell);
|
||||||
package.add("IsTeleportSpell", &Perl__IsTeleportSpell);
|
package.add("IsTeleportSpell", &Perl__IsTeleportSpell);
|
||||||
package.add("IsTranslocateSpell", &Perl__IsTranslocateSpell);
|
package.add("IsTranslocateSpell", &Perl__IsTranslocateSpell);
|
||||||
|
package.add("IsTGBCompatibleSpell", &Perl__IsTGBCompatibleSpell);
|
||||||
package.add("IsVeryFastHealSpell", &Perl__IsVeryFastHealSpell);
|
package.add("IsVeryFastHealSpell", &Perl__IsVeryFastHealSpell);
|
||||||
package.add("IsVirusSpell", &Perl__IsVirusSpell);
|
package.add("IsVirusSpell", &Perl__IsVirusSpell);
|
||||||
package.add("IsValidSpell", &Perl__IsValidSpell);
|
package.add("IsValidSpell", &Perl__IsValidSpell);
|
||||||
@@ -6315,7 +6298,7 @@ void perl_register_quest()
|
|||||||
package.add("worldwideremovespell", (void(*)(uint32, uint8))&Perl__worldwideremovespell);
|
package.add("worldwideremovespell", (void(*)(uint32, uint8))&Perl__worldwideremovespell);
|
||||||
package.add("worldwideremovespell", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovespell);
|
package.add("worldwideremovespell", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovespell);
|
||||||
package.add("worldwideremovetask", (void(*)(uint32))&Perl__worldwideremovetask);
|
package.add("worldwideremovetask", (void(*)(uint32))&Perl__worldwideremovetask);
|
||||||
package.add("worldwideremovetask", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovetask);
|
package.add("worldwideremovetask", (void(*)(uint32, uint8))&Perl__worldwideremovetask);
|
||||||
package.add("worldwideremovetask", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovetask);
|
package.add("worldwideremovetask", (void(*)(uint32, uint8, uint8))&Perl__worldwideremovetask);
|
||||||
package.add("worldwideresetactivity", (void(*)(uint32, int))&Perl__worldwideresetactivity);
|
package.add("worldwideresetactivity", (void(*)(uint32, int))&Perl__worldwideresetactivity);
|
||||||
package.add("worldwideresetactivity", (void(*)(uint32, int, uint8))&Perl__worldwideresetactivity);
|
package.add("worldwideresetactivity", (void(*)(uint32, int, uint8))&Perl__worldwideresetactivity);
|
||||||
@@ -6404,6 +6387,8 @@ void perl_register_quest()
|
|||||||
package.add("get_expedition_lockouts_by_char_id", (perl::reference(*)(uint32, std::string))&Perl__get_expedition_lockouts_by_char_id);
|
package.add("get_expedition_lockouts_by_char_id", (perl::reference(*)(uint32, std::string))&Perl__get_expedition_lockouts_by_char_id);
|
||||||
package.add("getfactionname", &Perl__getfactionname);
|
package.add("getfactionname", &Perl__getfactionname);
|
||||||
package.add("getinventoryslotid", &Perl__getinventoryslotid);
|
package.add("getinventoryslotid", &Perl__getinventoryslotid);
|
||||||
|
package.add("getitemcomment", &Perl__getitemcomment);
|
||||||
|
package.add("getitemlore", &Perl__getitemlore);
|
||||||
package.add("getitemname", &Perl__getitemname);
|
package.add("getitemname", &Perl__getitemname);
|
||||||
package.add("getitemstat", &Perl__getitemstat);
|
package.add("getitemstat", &Perl__getitemstat);
|
||||||
package.add("getlanguagename", &Perl__getlanguagename);
|
package.add("getlanguagename", &Perl__getlanguagename);
|
||||||
|
|||||||
+10
-1
@@ -349,7 +349,6 @@ void lua_stop_all_timers(Lua_Encounter enc) {
|
|||||||
|
|
||||||
void lua_pause_timer(const char *timer) {
|
void lua_pause_timer(const char *timer) {
|
||||||
quest_manager.pausetimer(timer);
|
quest_manager.pausetimer(timer);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void lua_resume_timer(const char *timer) {
|
void lua_resume_timer(const char *timer) {
|
||||||
@@ -879,6 +878,14 @@ int lua_merchant_count_item(uint32 npc_id, uint32 item_id) {
|
|||||||
return quest_manager.MerchantCountItem(npc_id, item_id);
|
return quest_manager.MerchantCountItem(npc_id, item_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string lua_get_item_comment(uint32 item_id) {
|
||||||
|
return quest_manager.getitemcomment(item_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string lua_get_item_lore(uint32 item_id) {
|
||||||
|
return quest_manager.getitemlore(item_id);
|
||||||
|
}
|
||||||
|
|
||||||
std::string lua_get_item_name(uint32 item_id) {
|
std::string lua_get_item_name(uint32 item_id) {
|
||||||
return quest_manager.getitemname(item_id);
|
return quest_manager.getitemname(item_id);
|
||||||
}
|
}
|
||||||
@@ -5720,6 +5727,8 @@ luabind::scope lua_register_general() {
|
|||||||
luabind::def("item_link", (std::string(*)(uint32,int16,uint32,uint32,uint32,uint32,uint32))&lua_item_link),
|
luabind::def("item_link", (std::string(*)(uint32,int16,uint32,uint32,uint32,uint32,uint32))&lua_item_link),
|
||||||
luabind::def("item_link", (std::string(*)(uint32,int16,uint32,uint32,uint32,uint32,uint32,uint32))&lua_item_link),
|
luabind::def("item_link", (std::string(*)(uint32,int16,uint32,uint32,uint32,uint32,uint32,uint32))&lua_item_link),
|
||||||
luabind::def("item_link", (std::string(*)(uint32,int16,uint32,uint32,uint32,uint32,uint32,uint32,bool))&lua_item_link),
|
luabind::def("item_link", (std::string(*)(uint32,int16,uint32,uint32,uint32,uint32,uint32,uint32,bool))&lua_item_link),
|
||||||
|
luabind::def("get_item_comment", (std::string(*)(uint32))&lua_get_item_comment),
|
||||||
|
luabind::def("get_item_lore", (std::string(*)(uint32))&lua_get_item_lore),
|
||||||
luabind::def("get_item_name", (std::string(*)(uint32))&lua_get_item_name),
|
luabind::def("get_item_name", (std::string(*)(uint32))&lua_get_item_name),
|
||||||
luabind::def("say_link", (std::string(*)(const char*,bool,const char*))&lua_say_link),
|
luabind::def("say_link", (std::string(*)(const char*,bool,const char*))&lua_say_link),
|
||||||
luabind::def("say_link", (std::string(*)(const char*,bool))&lua_say_link),
|
luabind::def("say_link", (std::string(*)(const char*,bool))&lua_say_link),
|
||||||
|
|||||||
@@ -30,6 +30,11 @@ const char *Lua_Item::GetLore() {
|
|||||||
return self->Lore;
|
return self->Lore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char *Lua_Item::GetComment() {
|
||||||
|
Lua_Safe_Call_String();
|
||||||
|
return self->Comment;
|
||||||
|
}
|
||||||
|
|
||||||
const char *Lua_Item::GetIDFile() {
|
const char *Lua_Item::GetIDFile() {
|
||||||
Lua_Safe_Call_String();
|
Lua_Safe_Call_String();
|
||||||
return self->IDFile;
|
return self->IDFile;
|
||||||
@@ -957,6 +962,7 @@ luabind::scope lua_register_item() {
|
|||||||
.def("Click_Type", &Lua_Item::GetClick_Type)
|
.def("Click_Type", &Lua_Item::GetClick_Type)
|
||||||
.def("Color", &Lua_Item::GetColor)
|
.def("Color", &Lua_Item::GetColor)
|
||||||
.def("CombatEffects", &Lua_Item::GetCombatEffects)
|
.def("CombatEffects", &Lua_Item::GetCombatEffects)
|
||||||
|
.def("Comment", &Lua_Item::GetComment)
|
||||||
.def("DR", &Lua_Item::GetDR)
|
.def("DR", &Lua_Item::GetDR)
|
||||||
.def("DSMitigation", &Lua_Item::GetDSMitigation)
|
.def("DSMitigation", &Lua_Item::GetDSMitigation)
|
||||||
.def("Damage", &Lua_Item::GetDamage)
|
.def("Damage", &Lua_Item::GetDamage)
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ public:
|
|||||||
int GetItemClass();
|
int GetItemClass();
|
||||||
const char *GetName();
|
const char *GetName();
|
||||||
const char *GetLore();
|
const char *GetLore();
|
||||||
|
const char *GetComment();
|
||||||
const char *GetIDFile();
|
const char *GetIDFile();
|
||||||
uint32 GetID();
|
uint32 GetID();
|
||||||
int GetWeight();
|
int GetWeight();
|
||||||
|
|||||||
@@ -375,6 +375,11 @@ const char *Lua_Mob::GetRaceName() {
|
|||||||
return GetRaceIDName(self->GetRace());
|
return GetRaceIDName(self->GetRace());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* Lua_Mob::GetBaseRaceName() {
|
||||||
|
Lua_Safe_Call_String();
|
||||||
|
return GetRaceIDName(self->GetBaseRace());
|
||||||
|
}
|
||||||
|
|
||||||
int Lua_Mob::GetGender() {
|
int Lua_Mob::GetGender() {
|
||||||
Lua_Safe_Call_Int();
|
Lua_Safe_Call_Int();
|
||||||
return self->GetGender();
|
return self->GetGender();
|
||||||
@@ -3386,6 +3391,7 @@ luabind::scope lua_register_mob() {
|
|||||||
.def("GetCasterLevel", &Lua_Mob::GetCasterLevel)
|
.def("GetCasterLevel", &Lua_Mob::GetCasterLevel)
|
||||||
.def("GetClass", &Lua_Mob::GetClass)
|
.def("GetClass", &Lua_Mob::GetClass)
|
||||||
.def("GetClassName", &Lua_Mob::GetClassName)
|
.def("GetClassName", &Lua_Mob::GetClassName)
|
||||||
|
.def("GetBaseRaceName", &Lua_Mob::GetBaseRaceName)
|
||||||
.def("GetClassPlural", &Lua_Mob::GetClassPlural)
|
.def("GetClassPlural", &Lua_Mob::GetClassPlural)
|
||||||
.def("GetCleanName", &Lua_Mob::GetCleanName)
|
.def("GetCleanName", &Lua_Mob::GetCleanName)
|
||||||
.def("GetCloseMobList", (Lua_Mob_List(Lua_Mob::*)(void))&Lua_Mob::GetCloseMobList)
|
.def("GetCloseMobList", (Lua_Mob_List(Lua_Mob::*)(void))&Lua_Mob::GetCloseMobList)
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ public:
|
|||||||
int GetRace();
|
int GetRace();
|
||||||
const char *GetClassName();
|
const char *GetClassName();
|
||||||
const char *GetRaceName();
|
const char *GetRaceName();
|
||||||
|
const char* GetBaseRaceName();
|
||||||
int GetGender();
|
int GetGender();
|
||||||
int GetTexture();
|
int GetTexture();
|
||||||
int GetHelmTexture();
|
int GetHelmTexture();
|
||||||
|
|||||||
+7
-18
@@ -438,9 +438,7 @@ int LuaParser::_EventNPC(std::string package_name, QuestEventID evt, NPC* npc, M
|
|||||||
|
|
||||||
lua_pop(L, npop);
|
lua_pop(L, npop);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
std::string error = "Lua Exception: ";
|
AddError(fmt::format("Lua Exception | [{}] for NPC [{}] in [{}]: {}", sub_name, npc->GetNPCTypeID(), package_name, ex.what()));
|
||||||
error += std::string(ex.what());
|
|
||||||
AddError(error);
|
|
||||||
|
|
||||||
//Restore our stack to the best of our ability
|
//Restore our stack to the best of our ability
|
||||||
int end = lua_gettop(L);
|
int end = lua_gettop(L);
|
||||||
@@ -532,9 +530,7 @@ int LuaParser::_EventPlayer(std::string package_name, QuestEventID evt, Client *
|
|||||||
|
|
||||||
lua_pop(L, npop);
|
lua_pop(L, npop);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
std::string error = "Lua Exception: ";
|
AddError(fmt::format("Lua Exception | [{}] for Player in [{}]: {}", sub_name, package_name, ex.what()));
|
||||||
error += std::string(ex.what());
|
|
||||||
AddError(error);
|
|
||||||
|
|
||||||
//Restore our stack to the best of our ability
|
//Restore our stack to the best of our ability
|
||||||
int end = lua_gettop(L);
|
int end = lua_gettop(L);
|
||||||
@@ -617,9 +613,8 @@ int LuaParser::_EventItem(std::string package_name, QuestEventID evt, Client *cl
|
|||||||
|
|
||||||
lua_pop(L, npop);
|
lua_pop(L, npop);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
std::string error = "Lua Exception: ";
|
uint32_t item_id = item->GetItem() ? item->GetItem()->ID : 0;
|
||||||
error += std::string(ex.what());
|
AddError(fmt::format("Lua Exception | [{}] for Item [{}] in [{}]: {}", sub_name, item_id, package_name, ex.what()));
|
||||||
AddError(error);
|
|
||||||
|
|
||||||
//Restore our stack to the best of our ability
|
//Restore our stack to the best of our ability
|
||||||
int end = lua_gettop(L);
|
int end = lua_gettop(L);
|
||||||
@@ -699,9 +694,7 @@ int LuaParser::_EventSpell(std::string package_name, QuestEventID evt, Mob* mob,
|
|||||||
|
|
||||||
lua_pop(L, npop);
|
lua_pop(L, npop);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
std::string error = "Lua Exception: ";
|
AddError(fmt::format("Lua Exception | [{}] for Spell [{}] in [{}]: {}", sub_name, spell_id, package_name, ex.what()));
|
||||||
error += std::string(ex.what());
|
|
||||||
AddError(error);
|
|
||||||
|
|
||||||
//Restore our stack to the best of our ability
|
//Restore our stack to the best of our ability
|
||||||
int end = lua_gettop(L);
|
int end = lua_gettop(L);
|
||||||
@@ -766,9 +759,7 @@ int LuaParser::_EventEncounter(std::string package_name, QuestEventID evt, std::
|
|||||||
|
|
||||||
lua_pop(L, 2);
|
lua_pop(L, 2);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
std::string error = "Lua Exception: ";
|
AddError(fmt::format("Lua Exception | [{}] for Encounter [{}]: {}", sub_name, encounter_name, ex.what()));
|
||||||
error += std::string(ex.what());
|
|
||||||
AddError(error);
|
|
||||||
|
|
||||||
//Restore our stack to the best of our ability
|
//Restore our stack to the best of our ability
|
||||||
int end = lua_gettop(L);
|
int end = lua_gettop(L);
|
||||||
@@ -1630,9 +1621,7 @@ int LuaParser::_EventBot(
|
|||||||
|
|
||||||
lua_pop(L, npop);
|
lua_pop(L, npop);
|
||||||
} catch(std::exception &ex) {
|
} catch(std::exception &ex) {
|
||||||
std::string error = "Lua Exception: ";
|
AddError(fmt::format("Lua Exception | [{}] for Bot [{}] in [{}]: {}", sub_name, bot->GetBotID(), package_name, ex.what()));
|
||||||
error += std::string(ex.what());
|
|
||||||
AddError(error);
|
|
||||||
|
|
||||||
//Restore our stack to the best of our ability
|
//Restore our stack to the best of our ability
|
||||||
int end = lua_gettop(L);
|
int end = lua_gettop(L);
|
||||||
|
|||||||
@@ -462,6 +462,11 @@ int Perl_Mob_GetBaseRace(Mob* self) // @categories Stats and Attributes
|
|||||||
return self->GetBaseRace();
|
return self->GetBaseRace();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Perl_Mob_GetBaseRaceName(Mob* self) // @categories Stats and Attributes
|
||||||
|
{
|
||||||
|
return GetRaceIDName(self->GetBaseRace());
|
||||||
|
}
|
||||||
|
|
||||||
int Perl_Mob_GetBaseGender(Mob* self) // @categories Stats and Attributes
|
int Perl_Mob_GetBaseGender(Mob* self) // @categories Stats and Attributes
|
||||||
{
|
{
|
||||||
return self->GetBaseGender();
|
return self->GetBaseGender();
|
||||||
@@ -3490,6 +3495,7 @@ void perl_register_mob()
|
|||||||
package.add("GetAssistRange", &Perl_Mob_GetAssistRange);
|
package.add("GetAssistRange", &Perl_Mob_GetAssistRange);
|
||||||
package.add("GetBaseGender", &Perl_Mob_GetBaseGender);
|
package.add("GetBaseGender", &Perl_Mob_GetBaseGender);
|
||||||
package.add("GetBaseRace", &Perl_Mob_GetBaseRace);
|
package.add("GetBaseRace", &Perl_Mob_GetBaseRace);
|
||||||
|
package.add("GetBaseRaceName", &Perl_Mob_GetBaseRaceName);
|
||||||
package.add("GetBaseSize", &Perl_Mob_GetBaseSize);
|
package.add("GetBaseSize", &Perl_Mob_GetBaseSize);
|
||||||
package.add("GetBeard", &Perl_Mob_GetBeard);
|
package.add("GetBeard", &Perl_Mob_GetBeard);
|
||||||
package.add("GetBeardColor", &Perl_Mob_GetBeardColor);
|
package.add("GetBeardColor", &Perl_Mob_GetBeardColor);
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ const char* Perl_QuestItemData_GetLore(EQ::ItemData* self)
|
|||||||
return self->Lore;
|
return self->Lore;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* Perl_QuestItem_GetComment(EQ::ItemData* self)
|
||||||
|
{
|
||||||
|
return self->Comment;
|
||||||
|
}
|
||||||
|
|
||||||
const char* Perl_QuestItemData_GetIDFile(EQ::ItemData* self)
|
const char* Perl_QuestItemData_GetIDFile(EQ::ItemData* self)
|
||||||
{
|
{
|
||||||
return self->IDFile;
|
return self->IDFile;
|
||||||
@@ -949,6 +954,7 @@ void perl_register_questitem_data()
|
|||||||
package.add("GetClickType", &Perl_QuestItemData_GetClickType);
|
package.add("GetClickType", &Perl_QuestItemData_GetClickType);
|
||||||
package.add("GetColor", &Perl_QuestItemData_GetColor);
|
package.add("GetColor", &Perl_QuestItemData_GetColor);
|
||||||
package.add("GetCombatEffects", &Perl_QuestItemData_GetCombatEffects);
|
package.add("GetCombatEffects", &Perl_QuestItemData_GetCombatEffects);
|
||||||
|
package.add("GetComment", &Perl_QuestItem_GetComment);
|
||||||
package.add("GetCorruption", &Perl_QuestItemData_GetCorruption);
|
package.add("GetCorruption", &Perl_QuestItemData_GetCorruption);
|
||||||
package.add("GetDR", &Perl_QuestItemData_GetDR);
|
package.add("GetDR", &Perl_QuestItemData_GetDR);
|
||||||
package.add("GetDSMitigation", &Perl_QuestItemData_GetDSMitigation);
|
package.add("GetDSMitigation", &Perl_QuestItemData_GetDSMitigation);
|
||||||
|
|||||||
+31
-7
@@ -359,22 +359,25 @@ Mob *QuestManager::spawn_from_spawn2(uint32 spawn2_id)
|
|||||||
|
|
||||||
void QuestManager::enable_spawn2(uint32 spawn2_id)
|
void QuestManager::enable_spawn2(uint32 spawn2_id)
|
||||||
{
|
{
|
||||||
database.UpdateSpawn2Status(spawn2_id, 1);
|
database.UpdateSpawn2Status(spawn2_id, 1, zone->GetInstanceID());
|
||||||
auto pack = new ServerPacket(ServerOP_SpawnStatusChange, sizeof(ServerSpawnStatusChange_Struct));
|
auto pack = new ServerPacket(ServerOP_SpawnStatusChange, sizeof(ServerSpawnStatusChange_Struct));
|
||||||
ServerSpawnStatusChange_Struct* ssc = (ServerSpawnStatusChange_Struct*) pack->pBuffer;
|
auto *ssc = (ServerSpawnStatusChange_Struct *) pack->pBuffer;
|
||||||
ssc->id = spawn2_id;
|
ssc->id = spawn2_id;
|
||||||
ssc->new_status = 1;
|
ssc->new_status = true;
|
||||||
|
ssc->instance_id = zone->GetInstanceID();
|
||||||
worldserver.SendPacket(pack);
|
worldserver.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuestManager::disable_spawn2(uint32 spawn2_id)
|
void QuestManager::disable_spawn2(uint32 spawn2_id)
|
||||||
{
|
{
|
||||||
database.UpdateSpawn2Status(spawn2_id, 0);
|
database.UpdateSpawn2Status(spawn2_id, 0, zone->GetInstanceID());
|
||||||
auto pack = new ServerPacket(ServerOP_SpawnStatusChange, sizeof(ServerSpawnStatusChange_Struct));
|
auto pack = new ServerPacket(ServerOP_SpawnStatusChange, sizeof(ServerSpawnStatusChange_Struct));
|
||||||
ServerSpawnStatusChange_Struct* ssc = (ServerSpawnStatusChange_Struct*) pack->pBuffer;
|
auto *ssc = (ServerSpawnStatusChange_Struct *) pack->pBuffer;
|
||||||
ssc->id = spawn2_id;
|
ssc->id = spawn2_id;
|
||||||
ssc->new_status = 0;
|
ssc->new_status = false;
|
||||||
|
ssc->instance_id = zone->GetInstanceID();
|
||||||
|
|
||||||
worldserver.SendPacket(pack);
|
worldserver.SendPacket(pack);
|
||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
@@ -3195,8 +3198,29 @@ std::string QuestManager::varlink(
|
|||||||
|
|
||||||
return linker.GenerateLink();
|
return linker.GenerateLink();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string QuestManager::getitemcomment(uint32 item_id) {
|
||||||
|
const auto* item_data = database.GetItem(item_id);
|
||||||
|
if (!item_data) {
|
||||||
|
return "INVALID ITEM ID IN GETITEMCOMMENT";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string item_comment = item_data->Comment;
|
||||||
|
return item_comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string QuestManager::getitemlore(uint32 item_id) {
|
||||||
|
const auto* item_data = database.GetItem(item_id);
|
||||||
|
if (!item_data) {
|
||||||
|
return "INVALID ITEM ID IN GETITEMLORE";
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string item_lore = item_data->Lore;
|
||||||
|
return item_lore;
|
||||||
|
}
|
||||||
|
|
||||||
std::string QuestManager::getitemname(uint32 item_id) {
|
std::string QuestManager::getitemname(uint32 item_id) {
|
||||||
const EQ::ItemData* item_data = database.GetItem(item_id);
|
const auto* item_data = database.GetItem(item_id);
|
||||||
if (!item_data) {
|
if (!item_data) {
|
||||||
return "INVALID ITEM ID IN GETITEMNAME";
|
return "INVALID ITEM ID IN GETITEMNAME";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,6 +250,8 @@ public:
|
|||||||
int collectitems_processSlot(int16 slot_id, uint32 item_id, bool remove);
|
int collectitems_processSlot(int16 slot_id, uint32 item_id, bool remove);
|
||||||
int countitem(uint32 item_id);
|
int countitem(uint32 item_id);
|
||||||
void removeitem(uint32 item_id, uint32 quantity = 1);
|
void removeitem(uint32 item_id, uint32 quantity = 1);
|
||||||
|
std::string getitemcomment(uint32 item_id);
|
||||||
|
std::string getitemlore(uint32 item_id);
|
||||||
std::string getitemname(uint32 item_id);
|
std::string getitemname(uint32 item_id);
|
||||||
void enabletitle(int titleset);
|
void enabletitle(int titleset);
|
||||||
bool checktitle(int titlecheck);
|
bool checktitle(int titlecheck);
|
||||||
|
|||||||
+21
-4
@@ -40,7 +40,6 @@ extern WorldServer worldserver;
|
|||||||
Raid::Raid(uint32 raidID)
|
Raid::Raid(uint32 raidID)
|
||||||
: GroupIDConsumer(raidID)
|
: GroupIDConsumer(raidID)
|
||||||
{
|
{
|
||||||
memset(members ,0, (sizeof(RaidMember)*MAX_RAID_MEMBERS));
|
|
||||||
memset(&raid_aa, 0, sizeof(RaidLeadershipAA_Struct));
|
memset(&raid_aa, 0, sizeof(RaidLeadershipAA_Struct));
|
||||||
memset(group_aa, 0, sizeof(GroupLeadershipAA_Struct) * MAX_RAID_GROUPS);
|
memset(group_aa, 0, sizeof(GroupLeadershipAA_Struct) * MAX_RAID_GROUPS);
|
||||||
for (auto& gm : group_mentor) {
|
for (auto& gm : group_mentor) {
|
||||||
@@ -66,7 +65,6 @@ Raid::Raid(uint32 raidID)
|
|||||||
Raid::Raid(Client* nLeader)
|
Raid::Raid(Client* nLeader)
|
||||||
: GroupIDConsumer()
|
: GroupIDConsumer()
|
||||||
{
|
{
|
||||||
memset(members ,0, (sizeof(RaidMember)*MAX_RAID_MEMBERS));
|
|
||||||
memset(&raid_aa, 0, sizeof(RaidLeadershipAA_Struct));
|
memset(&raid_aa, 0, sizeof(RaidLeadershipAA_Struct));
|
||||||
memset(group_aa, 0, sizeof(GroupLeadershipAA_Struct) * MAX_RAID_GROUPS);
|
memset(group_aa, 0, sizeof(GroupLeadershipAA_Struct) * MAX_RAID_GROUPS);
|
||||||
for (auto& gm : group_mentor) {
|
for (auto& gm : group_mentor) {
|
||||||
@@ -1705,10 +1703,10 @@ void Raid::SaveRaidMOTD()
|
|||||||
|
|
||||||
bool Raid::LearnMembers()
|
bool Raid::LearnMembers()
|
||||||
{
|
{
|
||||||
memset(members, 0, (sizeof(RaidMember) * MAX_RAID_MEMBERS));
|
EmptyRaidMembers();
|
||||||
|
|
||||||
auto raid_members = RaidMembersRepository::GetWhere(
|
auto raid_members = RaidMembersRepository::GetWhere(
|
||||||
content_db,
|
database,
|
||||||
fmt::format(
|
fmt::format(
|
||||||
"raidid = {}",
|
"raidid = {}",
|
||||||
GetID()
|
GetID()
|
||||||
@@ -2975,3 +2973,22 @@ void Raid::SendMarkTargets(Client* c)
|
|||||||
}
|
}
|
||||||
UpdateXtargetMarkedNPC();
|
UpdateXtargetMarkedNPC();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Raid::EmptyRaidMembers()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < MAX_RAID_MEMBERS; i++) {
|
||||||
|
members[i].group_number = RAID_GROUPLESS;
|
||||||
|
members[i].is_group_leader = 0;
|
||||||
|
members[i].level = 0;
|
||||||
|
members[i].main_assister = 0;
|
||||||
|
members[i].main_marker = 0;
|
||||||
|
members[i]._class = 0;
|
||||||
|
members[i].is_bot = false;
|
||||||
|
members[i].is_looter = false;
|
||||||
|
members[i].is_raid_leader = false;
|
||||||
|
members[i].is_raid_main_assist_one = false;
|
||||||
|
members[i].member = nullptr;
|
||||||
|
members[i].note.clear();
|
||||||
|
members[i].member_name[0] = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+14
-13
@@ -75,19 +75,19 @@ const uint32 RAID_GROUPLESS = 0xFFFFFFFF;
|
|||||||
#define MAX_NO_RAID_MAIN_MARKERS 3
|
#define MAX_NO_RAID_MAIN_MARKERS 3
|
||||||
|
|
||||||
struct RaidMember{
|
struct RaidMember{
|
||||||
char member_name[64];
|
char member_name[64]{ 0 };
|
||||||
Client *member;
|
Client* member{ nullptr };
|
||||||
uint32 group_number;
|
uint32 group_number{ RAID_GROUPLESS };
|
||||||
uint8 _class;
|
uint8 _class{ 0 };
|
||||||
uint8 level;
|
uint8 level{ 0 };
|
||||||
std::string note;
|
std::string note{};
|
||||||
bool is_group_leader;
|
bool is_group_leader{ false };
|
||||||
bool is_raid_leader;
|
bool is_raid_leader{ false };
|
||||||
bool is_looter;
|
bool is_looter{ false };
|
||||||
uint8 main_marker;
|
uint8 main_marker{ 0 };
|
||||||
uint8 main_assister;
|
uint8 main_assister{ 0 };
|
||||||
bool is_bot = false;
|
bool is_bot{ false };
|
||||||
bool is_raid_main_assist_one = false;
|
bool is_raid_main_assist_one{false};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GroupMentor {
|
struct GroupMentor {
|
||||||
@@ -131,6 +131,7 @@ public:
|
|||||||
void SetNewRaidLeader(uint32 i);
|
void SetNewRaidLeader(uint32 i);
|
||||||
bool IsAssister(const char* who);
|
bool IsAssister(const char* who);
|
||||||
bool IsMarker(const char* who);
|
bool IsMarker(const char* who);
|
||||||
|
void EmptyRaidMembers();
|
||||||
|
|
||||||
uint32 GetFreeGroup();
|
uint32 GetFreeGroup();
|
||||||
uint8 GroupCount(uint32 gid);
|
uint8 GroupCount(uint32 gid);
|
||||||
|
|||||||
+53
-43
@@ -27,6 +27,8 @@
|
|||||||
#include "zone.h"
|
#include "zone.h"
|
||||||
#include "zonedb.h"
|
#include "zonedb.h"
|
||||||
#include "../common/repositories/criteria/content_filter_criteria.h"
|
#include "../common/repositories/criteria/content_filter_criteria.h"
|
||||||
|
#include "../common/repositories/spawn2_repository.h"
|
||||||
|
#include "../common/repositories/spawn2_disabled_repository.h"
|
||||||
|
|
||||||
extern EntityList entity_list;
|
extern EntityList entity_list;
|
||||||
extern Zone* zone;
|
extern Zone* zone;
|
||||||
@@ -468,60 +470,68 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList<Spawn2*> &spa
|
|||||||
LogInfo("Loaded [{}] respawn timer(s)", Strings::Commify(results.RowCount()));
|
LogInfo("Loaded [{}] respawn timer(s)", Strings::Commify(results.RowCount()));
|
||||||
|
|
||||||
const char *zone_name = ZoneName(zoneid);
|
const char *zone_name = ZoneName(zoneid);
|
||||||
std::string query = fmt::format(
|
|
||||||
"SELECT "
|
auto spawns = Spawn2Repository::GetWhere(
|
||||||
"id, "
|
content_db, fmt::format(
|
||||||
"spawngroupID, "
|
"TRUE {} AND zone = '{}' AND (version = {} OR version = -1) ",
|
||||||
"x, "
|
|
||||||
"y, "
|
|
||||||
"z, "
|
|
||||||
"heading, "
|
|
||||||
"respawntime, "
|
|
||||||
"variance, "
|
|
||||||
"pathgrid, "
|
|
||||||
"path_when_zone_idle, "
|
|
||||||
"_condition, "
|
|
||||||
"cond_value, "
|
|
||||||
"enabled, "
|
|
||||||
"animation "
|
|
||||||
"FROM "
|
|
||||||
"spawn2 "
|
|
||||||
"WHERE TRUE {} AND zone = '{}' AND (version = {} OR version = -1) ",
|
|
||||||
ContentFilterCriteria::apply(),
|
ContentFilterCriteria::apply(),
|
||||||
zone_name,
|
zone_name,
|
||||||
version
|
version
|
||||||
|
)
|
||||||
);
|
);
|
||||||
results = QueryDatabase(query);
|
|
||||||
|
|
||||||
if (!results.Success()) {
|
std::vector<uint32> spawn2_ids;
|
||||||
return false;
|
for (auto &s: spawns) {
|
||||||
|
spawn2_ids.push_back(s.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
// we load spawn2_disabled entries for this zone
|
||||||
|
// if there are more specific entries for an instance of this zone, we load those instead
|
||||||
|
// if there are no entries for this zone, we load the default entries
|
||||||
|
std::vector<Spawn2DisabledRepository::Spawn2Disabled> disabled_spawns = {};
|
||||||
|
if (!spawn2_ids.empty()) {
|
||||||
|
disabled_spawns = Spawn2DisabledRepository::GetWhere(
|
||||||
|
database,
|
||||||
|
fmt::format(
|
||||||
|
"spawn2_id IN ({}) and (instance_id = {} OR instance_id = 0) ORDER BY instance_id",
|
||||||
|
Strings::Join(spawn2_ids, ","),
|
||||||
|
zone->GetInstanceID()
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto &s: spawns) {
|
||||||
uint32 spawn_time_left = 0;
|
uint32 spawn_time_left = 0;
|
||||||
Spawn2* new_spawn = 0;
|
if (spawn_times.count(s.id) != 0) {
|
||||||
bool perl_enabled = Strings::ToInt(row[12]) == 1 ? true : false;
|
spawn_time_left = spawn_times[s.id];
|
||||||
|
}
|
||||||
|
|
||||||
if (spawn_times.count(Strings::ToInt(row[0])) != 0)
|
// load from spawn2_disabled
|
||||||
spawn_time_left = spawn_times[Strings::ToInt(row[0])];
|
bool spawn_enabled = true;
|
||||||
|
|
||||||
new_spawn = new Spawn2(
|
// check if spawn is disabled
|
||||||
Strings::ToInt(row[0]), // uint32 in_spawn2_id
|
for (auto &ds: disabled_spawns) {
|
||||||
Strings::ToInt(row[1]), // uint32 spawngroup_id
|
if (ds.spawn2_id == s.id) {
|
||||||
Strings::ToFloat(row[2]), // float in_x
|
spawn_enabled = !ds.disabled;
|
||||||
Strings::ToFloat(row[3]), // float in_y
|
}
|
||||||
Strings::ToFloat(row[4]), // float in_z
|
}
|
||||||
Strings::ToFloat(row[5]), // float in_heading
|
|
||||||
Strings::ToInt(row[6]), // uint32 respawn
|
auto new_spawn = new Spawn2(
|
||||||
Strings::ToInt(row[7]), // uint32 variance
|
s.id,
|
||||||
spawn_time_left, // uint32 timeleft
|
s.spawngroupID,
|
||||||
Strings::ToInt(row[8]), // uint32 grid
|
s.x,
|
||||||
(bool)Strings::ToInt(row[9]), // bool path_when_zone_idle
|
s.y,
|
||||||
Strings::ToInt(row[10]), // uint16 in_cond_id
|
s.z,
|
||||||
Strings::ToInt(row[11]), // int16 in_min_value
|
s.heading,
|
||||||
perl_enabled, // bool in_enabled
|
s.respawntime,
|
||||||
(EmuAppearance)Strings::ToInt(row[13]) // EmuAppearance anim
|
s.variance,
|
||||||
|
spawn_time_left,
|
||||||
|
s.pathgrid,
|
||||||
|
(bool) s.path_when_zone_idle,
|
||||||
|
s._condition,
|
||||||
|
(int16) s.cond_value,
|
||||||
|
spawn_enabled,
|
||||||
|
(EmuAppearance) s.animation
|
||||||
);
|
);
|
||||||
|
|
||||||
spawn2_list.Insert(new_spawn);
|
spawn2_list.Insert(new_spawn);
|
||||||
|
|||||||
@@ -711,6 +711,18 @@ bool Mob::DoCastingChecksZoneRestrictions(bool check_on_casting, int32 spell_id)
|
|||||||
Message(Chat::Red, "You cannot cast detrimental spells here.");
|
Message(Chat::Red, "You cannot cast detrimental spells here.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
Zones where you can not cast a spell that is for daytime or nighttime only
|
||||||
|
*/
|
||||||
|
if (spells[spell_id].time_of_day == SpellTimeRestrictions::Day && !zone->zone_time.IsDayTime()) {
|
||||||
|
MessageString(Chat::Red, CAST_DAYTIME);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (spells[spell_id].time_of_day == SpellTimeRestrictions::Night && !zone->zone_time.IsNightTime()) {
|
||||||
|
MessageString(Chat::Red, CAST_NIGHTTIME);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (check_on_casting) {
|
if (check_on_casting) {
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -63,6 +63,8 @@
|
|||||||
#define SAC_TOO_HIGH 204 //This being is too powerful to be a sacrifice.
|
#define SAC_TOO_HIGH 204 //This being is too powerful to be a sacrifice.
|
||||||
#define CANNOT_SAC_SELF 205 //You cannot sacrifice yourself.
|
#define CANNOT_SAC_SELF 205 //You cannot sacrifice yourself.
|
||||||
#define SILENCED_STRING 207 //You *CANNOT* cast spells, you have been silenced!
|
#define SILENCED_STRING 207 //You *CANNOT* cast spells, you have been silenced!
|
||||||
|
#define CAST_DAYTIME 208 //Spell can only be cast during the day.
|
||||||
|
#define CAST_NIGHTTIME 209 //Spell can only be cast during the night.
|
||||||
#define CANNOT_AFFECT_PC 210 //That spell can not affect this target PC.
|
#define CANNOT_AFFECT_PC 210 //That spell can not affect this target PC.
|
||||||
#define SPELL_NEED_TAR 214 //You must first select a target for this spell!
|
#define SPELL_NEED_TAR 214 //You must first select a target for this spell!
|
||||||
#define SUMMON_ONLY_GROUP_CORPSE 215 //You must first target a living group member whose corpse you wish to summon.
|
#define SUMMON_ONLY_GROUP_CORPSE 215 //You must first target a living group member whose corpse you wish to summon.
|
||||||
|
|||||||
+9
-10
@@ -1729,28 +1729,27 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
if (zone)
|
if (zone)
|
||||||
{
|
{
|
||||||
ServerSpawnStatusChange_Struct *ssc = (ServerSpawnStatusChange_Struct*)pack->pBuffer;
|
ServerSpawnStatusChange_Struct *ssc = (ServerSpawnStatusChange_Struct*)pack->pBuffer;
|
||||||
|
if (ssc->instance_id != zone->GetInstanceID()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
LinkedListIterator<Spawn2 *> iterator(zone->spawn2_list);
|
LinkedListIterator<Spawn2 *> iterator(zone->spawn2_list);
|
||||||
iterator.Reset();
|
iterator.Reset();
|
||||||
Spawn2 *found_spawn = nullptr;
|
Spawn2 *found_spawn = nullptr;
|
||||||
while (iterator.MoreElements())
|
while (iterator.MoreElements()) {
|
||||||
{
|
|
||||||
Spawn2 *cur = iterator.GetData();
|
Spawn2 *cur = iterator.GetData();
|
||||||
if (cur->GetID() == ssc->id)
|
if (cur->GetID() == ssc->id) {
|
||||||
{
|
|
||||||
found_spawn = cur;
|
found_spawn = cur;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
iterator.Advance();
|
iterator.Advance();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (found_spawn)
|
if (found_spawn) {
|
||||||
{
|
if (ssc->new_status == 0) {
|
||||||
if (ssc->new_status == 0)
|
|
||||||
{
|
|
||||||
found_spawn->Disable();
|
found_spawn->Disable();
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
|
||||||
found_spawn->Enable();
|
found_spawn->Enable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+20
-3
@@ -21,6 +21,7 @@
|
|||||||
#include "../common/repositories/character_pet_info_repository.h"
|
#include "../common/repositories/character_pet_info_repository.h"
|
||||||
#include "../common/repositories/character_buffs_repository.h"
|
#include "../common/repositories/character_buffs_repository.h"
|
||||||
#include "../common/repositories/criteria/content_filter_criteria.h"
|
#include "../common/repositories/criteria/content_filter_criteria.h"
|
||||||
|
#include "../common/repositories/spawn2_disabled_repository.h"
|
||||||
|
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@@ -171,10 +172,26 @@ uint32 ZoneDatabase::GetSpawnTimeLeft(uint32 id, uint16 instance_id)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ZoneDatabase::UpdateSpawn2Status(uint32 id, uint8 new_status)
|
void ZoneDatabase::UpdateSpawn2Status(uint32 id, uint8 new_status, uint32 instance_id)
|
||||||
{
|
{
|
||||||
std::string query = StringFormat("UPDATE spawn2 SET enabled = %i WHERE id = %lu", new_status, (unsigned long)id);
|
auto spawns = Spawn2DisabledRepository::GetWhere(
|
||||||
QueryDatabase(query);
|
*this,
|
||||||
|
fmt::format("spawn2_id = {} and instance_id = {}", id, instance_id)
|
||||||
|
);
|
||||||
|
if (!spawns.empty()) {
|
||||||
|
auto spawn = spawns[0];
|
||||||
|
// 1 = enabled 0 = disabled
|
||||||
|
spawn.disabled = new_status ? 0 : 1;
|
||||||
|
spawn.instance_id = instance_id;
|
||||||
|
Spawn2DisabledRepository::UpdateOne(*this, spawn);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto spawn = Spawn2DisabledRepository::NewEntity();
|
||||||
|
spawn.spawn2_id = id;
|
||||||
|
spawn.instance_id = instance_id;
|
||||||
|
spawn.disabled = new_status ? 0 : 1;
|
||||||
|
Spawn2DisabledRepository::InsertOne(*this, spawn);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZoneDatabase::SetSpecialAttkFlag(uint8 id, const char* flag) {
|
bool ZoneDatabase::SetSpecialAttkFlag(uint8 id, const char* flag) {
|
||||||
|
|||||||
+1
-1
@@ -529,7 +529,7 @@ public:
|
|||||||
bool CreateSpawn2(Client *c, uint32 spawngroup, const char* zone, const glm::vec4& position, uint32 respawn, uint32 variance, uint16 condition, int16 cond_value);
|
bool CreateSpawn2(Client *c, uint32 spawngroup, const char* zone, const glm::vec4& position, uint32 respawn, uint32 variance, uint16 condition, int16 cond_value);
|
||||||
void UpdateRespawnTime(uint32 id, uint16 instance_id,uint32 timeleft);
|
void UpdateRespawnTime(uint32 id, uint16 instance_id,uint32 timeleft);
|
||||||
uint32 GetSpawnTimeLeft(uint32 id, uint16 instance_id);
|
uint32 GetSpawnTimeLeft(uint32 id, uint16 instance_id);
|
||||||
void UpdateSpawn2Status(uint32 id, uint8 new_status);
|
void UpdateSpawn2Status(uint32 id, uint8 new_status, uint32 instance_id);
|
||||||
|
|
||||||
/* Grids/Paths */
|
/* Grids/Paths */
|
||||||
uint32 GetFreeGrid(uint16 zoneid);
|
uint32 GetFreeGrid(uint16 zoneid);
|
||||||
|
|||||||
+2
-2
@@ -811,7 +811,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
|
|||||||
Entity* entity = entity_list.GetID(entity_id_being_looted);
|
Entity* entity = entity_list.GetID(entity_id_being_looted);
|
||||||
if (entity == 0)
|
if (entity == 0)
|
||||||
{
|
{
|
||||||
Message(Chat::Red, "Error: OP_EndLootRequest: Corpse not found (ent = 0)");
|
LogError("OP_EndLootRequest: Corpse with id of {} not found for {}.", entity_id_being_looted, GetCleanName());
|
||||||
if (ClientVersion() >= EQ::versions::ClientVersion::SoD)
|
if (ClientVersion() >= EQ::versions::ClientVersion::SoD)
|
||||||
Corpse::SendEndLootErrorPacket(this);
|
Corpse::SendEndLootErrorPacket(this);
|
||||||
else
|
else
|
||||||
@@ -819,7 +819,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
|
|||||||
}
|
}
|
||||||
else if (!entity->IsCorpse())
|
else if (!entity->IsCorpse())
|
||||||
{
|
{
|
||||||
Message(Chat::Red, "Error: OP_EndLootRequest: Corpse not found (!entity->IsCorpse())");
|
LogError("OP_EndLootRequest: Entity with id of {} was not corpse for {}.", entity_id_being_looted, GetCleanName());
|
||||||
Corpse::SendLootReqErrorPacket(this);
|
Corpse::SendLootReqErrorPacket(this);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user