Compare commits

..

2 Commits

Author SHA1 Message Date
regneq caae34ac5e fixed client lua summonitem.
export npc:CanTalk to lua.
added QuestSlot.
Added a condition for questslot in summonitem function.
2024-04-05 18:01:48 -07:00
regneq 56c7db4cbf [MultiQuest] Add functions to Loot. Import to Lua_NPC. 2024-04-05 12:08:01 -07:00
70 changed files with 1086 additions and 979 deletions
-99
View File
@@ -1,102 +1,3 @@
## [22.49.1] 4/15/2024
### Zoning
* Fix zone routing edge case ([#4255](https://github.com/EQEmu/Server/pull/4255)) @Akkadius 2024-04-15
## [22.49.0] 4/15/2024
### Code
* Avoid unnecessary copies in database functions ([#4220](https://github.com/EQEmu/Server/pull/4220)) @joligario 2024-03-29
* Reference type in `GetRaidLeaderName` ([#4218](https://github.com/EQEmu/Server/pull/4218)) @joligario 2024-03-28
* Remove unnecessary reference types ([#4212](https://github.com/EQEmu/Server/pull/4212)) @joligario 2024-03-28
### Crash
* Check mob pointer before trying to remove it ([#4230](https://github.com/EQEmu/Server/pull/4230)) @Akkadius 2024-04-01
### Feature
* Add Character Auto Login ([#4216](https://github.com/EQEmu/Server/pull/4216)) @Kinglykrab 2024-04-15
* Add LuaMod functions for CommonDamage and HealDamage ([#4227](https://github.com/EQEmu/Server/pull/4227)) @xackery 2024-03-31
* Add RegisterBug LuaMod ([#4209](https://github.com/EQEmu/Server/pull/4209)) @xackery 2024-03-30
* Additive Spell Focus from Worn slot with Limit Checks ([#4208](https://github.com/EQEmu/Server/pull/4208)) @KayenEQ 2024-03-30
* Fix ignore_default on lua mod damage ([#4228](https://github.com/EQEmu/Server/pull/4228)) @xackery 2024-04-15
### Fixes
* Client not updating HP bar when an HP Buff with a Heal is applied. ([#4237](https://github.com/EQEmu/Server/pull/4237)) @KayenEQ 2024-04-02
* Fix Account Flags Loading ([#4243](https://github.com/EQEmu/Server/pull/4243)) @Kinglykrab 2024-04-15
* Fix Auto Login Issue ([#4213](https://github.com/EQEmu/Server/pull/4213)) @Kinglykrab 2024-03-28
* Fix Bot Creation Issue ([#4235](https://github.com/EQEmu/Server/pull/4235)) @Kinglykrab 2024-04-02
* Fix Bot/Character ID Overlap in Groups ([#4093](https://github.com/EQEmu/Server/pull/4093)) @Kinglykrab 2024-03-23
* Fix Group Leadership ([#4214](https://github.com/EQEmu/Server/pull/4214)) @Kinglykrab 2024-03-28
* Fix Issue With Bot Raid Aggro ([#4222](https://github.com/EQEmu/Server/pull/4222)) @Kinglykrab 2024-03-31
* Fix Lua Crash with Spell Blocked Event ([#4236](https://github.com/EQEmu/Server/pull/4236)) @Kinglykrab 2024-04-01
* Fix Luabind Double Class Register ([#4219](https://github.com/EQEmu/Server/pull/4219)) @Kinglykrab 2024-03-29
* Fix crash in SendEnterWorld ([#4204](https://github.com/EQEmu/Server/pull/4204)) @Akkadius 2024-03-24
* Fix event_consider any_cast error ([#4210](https://github.com/EQEmu/Server/pull/4210)) @xackery 2024-03-27
* Fix fishing chances ([#4203](https://github.com/EQEmu/Server/pull/4203)) @joligario 2024-03-24
* Fix manifest for skill caps schema type ([#4231](https://github.com/EQEmu/Server/pull/4231)) @Akkadius 2024-04-02
* Hero forge armor bug on login and show helm toggle. ([#4246](https://github.com/EQEmu/Server/pull/4246)) @noudess 2024-04-15
* Radiant/Ebon Crystals should only extract to 1000 ([#4195](https://github.com/EQEmu/Server/pull/4195)) @fryguy503 2024-03-23
* SPA214 SE_MaxHPChange calculation errors corrected. ([#4238](https://github.com/EQEmu/Server/pull/4238)) @KayenEQ 2024-04-02
* Shared Tasks - charid is now character_id ([#4233](https://github.com/EQEmu/Server/pull/4233)) @fryguy503 2024-04-01
* Using %T in channel messages on fresh corpse yields mob, not corpse name. ([#4168](https://github.com/EQEmu/Server/pull/4168)) @noudess 2024-04-05
### Hot Fix
* Fix Group::AddToGroup ([#4201](https://github.com/EQEmu/Server/pull/4201)) @Kinglykrab 2024-03-23
* Hot Fix for Group::AddToGroup Hot Fix ([#4202](https://github.com/EQEmu/Server/pull/4202)) @Kinglykrab 2024-03-23
### Loot
* Add content filtering to lootdrop_entries ([#4229](https://github.com/EQEmu/Server/pull/4229)) @Akkadius 2024-04-15
### Lua
* Add Zone and Language Constants ([#4211](https://github.com/EQEmu/Server/pull/4211)) @fryguy503 2024-03-28
### Messages
* Fix bug where DoT messages stop coming out when mob dies. ([#4249](https://github.com/EQEmu/Server/pull/4249)) @noudess 2024-04-15
### Performance
* Change skill_cap from vector to map ([#4252](https://github.com/EQEmu/Server/pull/4252)) @xackery 2024-04-15
### Pets
* Fix errors in sync with client of sit/stand ([#4245](https://github.com/EQEmu/Server/pull/4245)) @noudess 2024-04-15
### Quest API
* Add Archetype Methods to Perl/Lua ([#4181](https://github.com/EQEmu/Server/pull/4181)) @Kinglykrab 2024-03-23
* Add Class/Deity/Race Methods to Perl/Lua ([#4215](https://github.com/EQEmu/Server/pull/4215)) @Kinglykrab 2024-03-28
* Add GetConsiderColor() to Perl/Lua ([#4253](https://github.com/EQEmu/Server/pull/4253)) @Kinglykrab 2024-04-15
* Add Spell Blocked Event to Perl/Lua ([#4217](https://github.com/EQEmu/Server/pull/4217)) @Kinglykrab 2024-04-01
### Quests
* Avoid Player and Bot quests in unloaded zone ([#4232](https://github.com/EQEmu/Server/pull/4232)) @hgtw 2024-04-01
### Repositories
* Convert database.cpp to Repositories ([#4054](https://github.com/EQEmu/Server/pull/4054)) @Kinglykrab 2024-03-24
### Skill Caps
* Further improvements ([#4205](https://github.com/EQEmu/Server/pull/4205)) @Akkadius 2024-03-24
* Remove from shared memory and simplify ([#4069](https://github.com/EQEmu/Server/pull/4069)) @Kinglykrab 2024-03-23
### Spells
* Implemented SPA 463 SE_SHIELD_TARGET ([#4224](https://github.com/EQEmu/Server/pull/4224)) @KayenEQ 2024-03-30
* Normal Group Spells (non-raid) landed twice on caster ([#4240](https://github.com/EQEmu/Server/pull/4240)) @noudess 2024-04-15
* SPA148 Stacking Fix ([#4206](https://github.com/EQEmu/Server/pull/4206)) @KayenEQ 2024-03-27
* SPA69 TotalHP can be used in Worn Slot, Fixes/Updates to Max HP related variables. ([#4244](https://github.com/EQEmu/Server/pull/4244)) @KayenEQ 2024-04-15
## [22.48.0] 3/23/2024
### Bots
-10
View File
@@ -357,13 +357,3 @@ WorldContentService::FindZoneResult WorldContentService::FindZone(uint32 zone_id
return WorldContentService::FindZoneResult{.zone_id = 0};
}
bool WorldContentService::IsInPublicStaticInstance(uint32 instance_id)
{
for (auto &i: m_zone_instances) {
if (i.id == instance_id) {
return true;
}
}
return false;
}
-2
View File
@@ -178,8 +178,6 @@ public:
};
FindZoneResult FindZone(uint32 zone_id, uint32 instance_id);
bool IsInPublicStaticInstance(uint32 instance_id);
private:
int current_expansion{};
std::vector<ContentFlagsRepository::ContentFlags> content_flags;
@@ -5469,31 +5469,6 @@ ADD PRIMARY KEY (`id`) USING BTREE,
ADD INDEX `level_skill_cap`(`skill_id`, `class_id`, `level`, `cap`);
)",
.content_schema_update = true,
},
ManifestEntry{
.version = 9269,
.description = "2024_03_27_account_auto_login_charname.sql",
.check = "SHOW COLUMNS FROM `account` LIKE 'auto_login_charname'",
.condition = "empty",
.match = "",
.sql = R"(
ALTER TABLE `account`
ADD COLUMN `auto_login_charname` varchar(64) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '' AFTER `charname`;
)"
},
ManifestEntry{
.version = 9270,
.description = "2024_04_31_content_flagging_lootdrop_entries.sql",
.check = "SHOW COLUMNS FROM `lootdrop_entries` LIKE 'content_flags'",
.condition = "empty",
.match = "",
.sql = R"(
ALTER TABLE `lootdrop_entries` ADD `min_expansion` tinyint(4) NOT NULL DEFAULT -1;
ALTER TABLE `lootdrop_entries` ADD `max_expansion` tinyint(4) NOT NULL DEFAULT -1;
ALTER TABLE `lootdrop_entries` ADD `content_flags` varchar(100) NULL;
ALTER TABLE `lootdrop_entries` ADD `content_flags_disabled` varchar(100) NULL;
)",
.content_schema_update = true
}
// -- template; copy/paste this when you need to create a new entry
// ManifestEntry{
-22
View File
@@ -714,25 +714,3 @@ std::string EQ::constants::GetSpecialAbilityName(uint32 ability_id)
return std::string();
}
const std::map<uint32, std::string>& EQ::constants::GetConsiderColorMap()
{
static const std::map<uint32, std::string> consider_color_map = {
{ ConsiderColor::Green, "Green" },
{ ConsiderColor::DarkBlue, "Dark Blue" },
{ ConsiderColor::Gray, "Gray" },
{ ConsiderColor::White, "White" },
{ ConsiderColor::Red, "Red" },
{ ConsiderColor::Yellow, "Yellow" },
{ ConsiderColor::LightBlue, "Light Blue" },
{ ConsiderColor::WhiteTitanium, "White" },
};
return consider_color_map;
}
std::string EQ::constants::GetConsiderColorName(uint32 consider_color)
{
const auto& c = EQ::constants::GetConsiderColorMap().find(consider_color);
return c != EQ::constants::GetConsiderColorMap().end() ? c->second : std::string();
}
+2 -14
View File
@@ -89,6 +89,8 @@ namespace EQ
using RoF2::invslot::SLOT_INVALID;
using RoF2::invslot::SLOT_BEGIN;
using RoF2::invslot::SLOT_QUEST;
using Titanium::invslot::SLOT_TRADESKILL_EXPERIMENT_COMBINE;
const int16 SLOT_AUGMENT_GENERIC_RETURN = 1001; // clients don't appear to use this method... (internal inventory return value)
@@ -404,9 +406,6 @@ namespace EQ
extern const std::map<uint32, std::string>& GetSpecialAbilityMap();
std::string GetSpecialAbilityName(uint32 ability_id);
extern const std::map<uint32, std::string>& GetConsiderColorMap();
std::string GetConsiderColorName(uint32 consider_color);
const int STANCE_TYPE_FIRST = stancePassive;
const int STANCE_TYPE_LAST = stanceBurnAE;
const int STANCE_TYPE_COUNT = stanceBurnAE;
@@ -562,17 +561,6 @@ enum ConsiderLevel : uint8 {
Scowls
};
namespace ConsiderColor {
constexpr uint32 Green = 2;
constexpr uint32 DarkBlue = 4;
constexpr uint32 Gray = 6;
constexpr uint32 White = 10;
constexpr uint32 Red = 13;
constexpr uint32 Yellow = 15;
constexpr uint32 LightBlue = 18;
constexpr uint32 WhiteTitanium = 20;
};
enum TargetDescriptionType : uint8 {
LCSelf,
UCSelf,
+5
View File
@@ -82,6 +82,10 @@ Zone extensions and features
#define QUEST_GLOBAL_DIRECTORY "global"
#endif
// Number of quest items a Quest NPC can hold
#define MAX_NPC_QUEST_INVENTORY 24
//the min ratio at which a mob's speed is reduced
#define FLEE_HP_MINSPEED 22
//number of tics to try to run straight away before looking again
@@ -111,6 +115,7 @@ Zone extensions and features
#define SKILL_MAX_LEVEL 75
/*
Zone Numerical configuration
+2
View File
@@ -25,6 +25,8 @@ struct LootItem {
uint16 trivial_max_level;
uint16 npc_min_level;
uint16 npc_max_level;
uint8 quest;
uint8 pet;
};
typedef std::list<LootItem*> LootItems;
+2
View File
@@ -165,6 +165,8 @@ namespace RoF2
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
const int16 SLOT_QUEST = 9999;
const int16 POSSESSIONS_BEGIN = slotCharm;
const int16 POSSESSIONS_END = slotCursor;
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;
+2
View File
@@ -162,6 +162,8 @@ namespace RoF
const int16 SLOT_INVALID = IINVALID;
const int16 SLOT_BEGIN = INULL;
const int16 SLOT_QUEST = 9999;
const int16 POSSESSIONS_BEGIN = slotCharm;
const int16 POSSESSIONS_END = slotCursor;
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;
+2
View File
@@ -152,6 +152,8 @@ namespace SoD
const int16 SLOT_TRADESKILL_EXPERIMENT_COMBINE = 1000;
const int16 SLOT_QUEST = 9999;
const int16 POSSESSIONS_BEGIN = slotCharm;
const int16 POSSESSIONS_END = slotCursor;
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;
+2
View File
@@ -152,6 +152,8 @@ namespace SoF
const int16 SLOT_TRADESKILL_EXPERIMENT_COMBINE = 1000;
const int16 SLOT_QUEST = 9999;
const int16 POSSESSIONS_BEGIN = slotCharm;
const int16 POSSESSIONS_END = slotCursor;
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;
+2
View File
@@ -151,6 +151,8 @@ namespace Titanium
const int16 SLOT_TRADESKILL_EXPERIMENT_COMBINE = 1000;
const int16 SLOT_QUEST = 9999;
const int16 POSSESSIONS_BEGIN = slotCharm;
const int16 POSSESSIONS_END = slotCursor;
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;
+2
View File
@@ -152,6 +152,8 @@ namespace UF
const int16 SLOT_TRADESKILL_EXPERIMENT_COMBINE = 1000;
const int16 SLOT_QUEST = 9999;
const int16 POSSESSIONS_BEGIN = slotCharm;
const int16 POSSESSIONS_END = slotCursor;
const int16 POSSESSIONS_COUNT = (POSSESSIONS_END - POSSESSIONS_BEGIN) + 1;
-18
View File
@@ -89,24 +89,6 @@ public:
return results.Success();
}
static std::string GetAutoLoginCharacterNameByAccountID(Database& db, const uint32 account_id)
{
return AccountRepository::FindOne(db, account_id).auto_login_charname;
}
static bool SetAutoLoginCharacterNameByAccountID(Database& db, const uint32 account_id, const std::string& character_name)
{
auto e = AccountRepository::FindOne(db, account_id);
if (!e.id) {
return false;
}
e.auto_login_charname = character_name;
return AccountRepository::UpdateOne(db, e);
}
};
#endif //EQEMU_ACCOUNT_REPOSITORY_H
+117 -129
View File
@@ -22,7 +22,6 @@ public:
int32_t id;
std::string name;
std::string charname;
std::string auto_login_charname;
uint32_t sharedplat;
std::string password;
int32_t status;
@@ -57,7 +56,6 @@ public:
"id",
"name",
"charname",
"auto_login_charname",
"sharedplat",
"password",
"status",
@@ -88,7 +86,6 @@ public:
"id",
"name",
"charname",
"auto_login_charname",
"sharedplat",
"password",
"status",
@@ -150,31 +147,30 @@ public:
{
Account e{};
e.id = 0;
e.name = "";
e.charname = "";
e.auto_login_charname = "";
e.sharedplat = 0;
e.password = "";
e.status = 0;
e.ls_id = "eqemu";
e.lsaccount_id = 0;
e.gmspeed = 0;
e.invulnerable = 0;
e.flymode = 0;
e.ignore_tells = 0;
e.revoked = 0;
e.karma = 0;
e.minilogin_ip = "";
e.hideme = 0;
e.rulesflag = 0;
e.suspendeduntil = 0;
e.time_creation = 0;
e.ban_reason = "";
e.suspend_reason = "";
e.crc_eqgame = "";
e.crc_skillcaps = "";
e.crc_basedata = "";
e.id = 0;
e.name = "";
e.charname = "";
e.sharedplat = 0;
e.password = "";
e.status = 0;
e.ls_id = "eqemu";
e.lsaccount_id = 0;
e.gmspeed = 0;
e.invulnerable = 0;
e.flymode = 0;
e.ignore_tells = 0;
e.revoked = 0;
e.karma = 0;
e.minilogin_ip = "";
e.hideme = 0;
e.rulesflag = 0;
e.suspendeduntil = 0;
e.time_creation = 0;
e.ban_reason = "";
e.suspend_reason = "";
e.crc_eqgame = "";
e.crc_skillcaps = "";
e.crc_basedata = "";
return e;
}
@@ -211,31 +207,30 @@ public:
if (results.RowCount() == 1) {
Account e{};
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.charname = row[2] ? row[2] : "";
e.auto_login_charname = row[3] ? row[3] : "";
e.sharedplat = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.password = row[5] ? row[5] : "";
e.status = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.ls_id = row[7] ? row[7] : "eqemu";
e.lsaccount_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.gmspeed = row[9] ? static_cast<uint8_t>(strtoul(row[9], nullptr, 10)) : 0;
e.invulnerable = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
e.flymode = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
e.ignore_tells = row[12] ? static_cast<int8_t>(atoi(row[12])) : 0;
e.revoked = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
e.karma = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.minilogin_ip = row[15] ? row[15] : "";
e.hideme = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.rulesflag = row[17] ? static_cast<uint8_t>(strtoul(row[17], nullptr, 10)) : 0;
e.suspendeduntil = strtoll(row[18] ? row[18] : "-1", nullptr, 10);
e.time_creation = row[19] ? static_cast<uint32_t>(strtoul(row[19], nullptr, 10)) : 0;
e.ban_reason = row[20] ? row[20] : "";
e.suspend_reason = row[21] ? row[21] : "";
e.crc_eqgame = row[22] ? row[22] : "";
e.crc_skillcaps = row[23] ? row[23] : "";
e.crc_basedata = row[24] ? row[24] : "";
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.charname = row[2] ? row[2] : "";
e.sharedplat = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.password = row[4] ? row[4] : "";
e.status = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.ls_id = row[6] ? row[6] : "eqemu";
e.lsaccount_id = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.gmspeed = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
e.invulnerable = row[9] ? static_cast<int8_t>(atoi(row[9])) : 0;
e.flymode = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
e.ignore_tells = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
e.revoked = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.karma = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.minilogin_ip = row[14] ? row[14] : "";
e.hideme = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
e.rulesflag = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
e.suspendeduntil = strtoll(row[17] ? row[17] : "-1", nullptr, 10);
e.time_creation = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0;
e.ban_reason = row[19] ? row[19] : "";
e.suspend_reason = row[20] ? row[20] : "";
e.crc_eqgame = row[21] ? row[21] : "";
e.crc_skillcaps = row[22] ? row[22] : "";
e.crc_basedata = row[23] ? row[23] : "";
return e;
}
@@ -271,28 +266,27 @@ public:
v.push_back(columns[1] + " = '" + Strings::Escape(e.name) + "'");
v.push_back(columns[2] + " = '" + Strings::Escape(e.charname) + "'");
v.push_back(columns[3] + " = '" + Strings::Escape(e.auto_login_charname) + "'");
v.push_back(columns[4] + " = " + std::to_string(e.sharedplat));
v.push_back(columns[5] + " = '" + Strings::Escape(e.password) + "'");
v.push_back(columns[6] + " = " + std::to_string(e.status));
v.push_back(columns[7] + " = '" + Strings::Escape(e.ls_id) + "'");
v.push_back(columns[8] + " = " + std::to_string(e.lsaccount_id));
v.push_back(columns[9] + " = " + std::to_string(e.gmspeed));
v.push_back(columns[10] + " = " + std::to_string(e.invulnerable));
v.push_back(columns[11] + " = " + std::to_string(e.flymode));
v.push_back(columns[12] + " = " + std::to_string(e.ignore_tells));
v.push_back(columns[13] + " = " + std::to_string(e.revoked));
v.push_back(columns[14] + " = " + std::to_string(e.karma));
v.push_back(columns[15] + " = '" + Strings::Escape(e.minilogin_ip) + "'");
v.push_back(columns[16] + " = " + std::to_string(e.hideme));
v.push_back(columns[17] + " = " + std::to_string(e.rulesflag));
v.push_back(columns[18] + " = FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
v.push_back(columns[19] + " = " + std::to_string(e.time_creation));
v.push_back(columns[20] + " = '" + Strings::Escape(e.ban_reason) + "'");
v.push_back(columns[21] + " = '" + Strings::Escape(e.suspend_reason) + "'");
v.push_back(columns[22] + " = '" + Strings::Escape(e.crc_eqgame) + "'");
v.push_back(columns[23] + " = '" + Strings::Escape(e.crc_skillcaps) + "'");
v.push_back(columns[24] + " = '" + Strings::Escape(e.crc_basedata) + "'");
v.push_back(columns[3] + " = " + std::to_string(e.sharedplat));
v.push_back(columns[4] + " = '" + Strings::Escape(e.password) + "'");
v.push_back(columns[5] + " = " + std::to_string(e.status));
v.push_back(columns[6] + " = '" + Strings::Escape(e.ls_id) + "'");
v.push_back(columns[7] + " = " + std::to_string(e.lsaccount_id));
v.push_back(columns[8] + " = " + std::to_string(e.gmspeed));
v.push_back(columns[9] + " = " + std::to_string(e.invulnerable));
v.push_back(columns[10] + " = " + std::to_string(e.flymode));
v.push_back(columns[11] + " = " + std::to_string(e.ignore_tells));
v.push_back(columns[12] + " = " + std::to_string(e.revoked));
v.push_back(columns[13] + " = " + std::to_string(e.karma));
v.push_back(columns[14] + " = '" + Strings::Escape(e.minilogin_ip) + "'");
v.push_back(columns[15] + " = " + std::to_string(e.hideme));
v.push_back(columns[16] + " = " + std::to_string(e.rulesflag));
v.push_back(columns[17] + " = FROM_UNIXTIME(" + (e.suspendeduntil > 0 ? std::to_string(e.suspendeduntil) : "null") + ")");
v.push_back(columns[18] + " = " + std::to_string(e.time_creation));
v.push_back(columns[19] + " = '" + Strings::Escape(e.ban_reason) + "'");
v.push_back(columns[20] + " = '" + Strings::Escape(e.suspend_reason) + "'");
v.push_back(columns[21] + " = '" + Strings::Escape(e.crc_eqgame) + "'");
v.push_back(columns[22] + " = '" + Strings::Escape(e.crc_skillcaps) + "'");
v.push_back(columns[23] + " = '" + Strings::Escape(e.crc_basedata) + "'");
auto results = db.QueryDatabase(
fmt::format(
@@ -317,7 +311,6 @@ public:
v.push_back(std::to_string(e.id));
v.push_back("'" + Strings::Escape(e.name) + "'");
v.push_back("'" + Strings::Escape(e.charname) + "'");
v.push_back("'" + Strings::Escape(e.auto_login_charname) + "'");
v.push_back(std::to_string(e.sharedplat));
v.push_back("'" + Strings::Escape(e.password) + "'");
v.push_back(std::to_string(e.status));
@@ -371,7 +364,6 @@ public:
v.push_back(std::to_string(e.id));
v.push_back("'" + Strings::Escape(e.name) + "'");
v.push_back("'" + Strings::Escape(e.charname) + "'");
v.push_back("'" + Strings::Escape(e.auto_login_charname) + "'");
v.push_back(std::to_string(e.sharedplat));
v.push_back("'" + Strings::Escape(e.password) + "'");
v.push_back(std::to_string(e.status));
@@ -426,31 +418,30 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Account e{};
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.charname = row[2] ? row[2] : "";
e.auto_login_charname = row[3] ? row[3] : "";
e.sharedplat = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.password = row[5] ? row[5] : "";
e.status = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.ls_id = row[7] ? row[7] : "eqemu";
e.lsaccount_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.gmspeed = row[9] ? static_cast<uint8_t>(strtoul(row[9], nullptr, 10)) : 0;
e.invulnerable = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
e.flymode = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
e.ignore_tells = row[12] ? static_cast<int8_t>(atoi(row[12])) : 0;
e.revoked = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
e.karma = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.minilogin_ip = row[15] ? row[15] : "";
e.hideme = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.rulesflag = row[17] ? static_cast<uint8_t>(strtoul(row[17], nullptr, 10)) : 0;
e.suspendeduntil = strtoll(row[18] ? row[18] : "-1", nullptr, 10);
e.time_creation = row[19] ? static_cast<uint32_t>(strtoul(row[19], nullptr, 10)) : 0;
e.ban_reason = row[20] ? row[20] : "";
e.suspend_reason = row[21] ? row[21] : "";
e.crc_eqgame = row[22] ? row[22] : "";
e.crc_skillcaps = row[23] ? row[23] : "";
e.crc_basedata = row[24] ? row[24] : "";
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.charname = row[2] ? row[2] : "";
e.sharedplat = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.password = row[4] ? row[4] : "";
e.status = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.ls_id = row[6] ? row[6] : "eqemu";
e.lsaccount_id = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.gmspeed = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
e.invulnerable = row[9] ? static_cast<int8_t>(atoi(row[9])) : 0;
e.flymode = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
e.ignore_tells = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
e.revoked = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.karma = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.minilogin_ip = row[14] ? row[14] : "";
e.hideme = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
e.rulesflag = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
e.suspendeduntil = strtoll(row[17] ? row[17] : "-1", nullptr, 10);
e.time_creation = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0;
e.ban_reason = row[19] ? row[19] : "";
e.suspend_reason = row[20] ? row[20] : "";
e.crc_eqgame = row[21] ? row[21] : "";
e.crc_skillcaps = row[22] ? row[22] : "";
e.crc_basedata = row[23] ? row[23] : "";
all_entries.push_back(e);
}
@@ -475,31 +466,30 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
Account e{};
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.charname = row[2] ? row[2] : "";
e.auto_login_charname = row[3] ? row[3] : "";
e.sharedplat = row[4] ? static_cast<uint32_t>(strtoul(row[4], nullptr, 10)) : 0;
e.password = row[5] ? row[5] : "";
e.status = row[6] ? static_cast<int32_t>(atoi(row[6])) : 0;
e.ls_id = row[7] ? row[7] : "eqemu";
e.lsaccount_id = row[8] ? static_cast<uint32_t>(strtoul(row[8], nullptr, 10)) : 0;
e.gmspeed = row[9] ? static_cast<uint8_t>(strtoul(row[9], nullptr, 10)) : 0;
e.invulnerable = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
e.flymode = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
e.ignore_tells = row[12] ? static_cast<int8_t>(atoi(row[12])) : 0;
e.revoked = row[13] ? static_cast<uint8_t>(strtoul(row[13], nullptr, 10)) : 0;
e.karma = row[14] ? static_cast<uint32_t>(strtoul(row[14], nullptr, 10)) : 0;
e.minilogin_ip = row[15] ? row[15] : "";
e.hideme = row[16] ? static_cast<int8_t>(atoi(row[16])) : 0;
e.rulesflag = row[17] ? static_cast<uint8_t>(strtoul(row[17], nullptr, 10)) : 0;
e.suspendeduntil = strtoll(row[18] ? row[18] : "-1", nullptr, 10);
e.time_creation = row[19] ? static_cast<uint32_t>(strtoul(row[19], nullptr, 10)) : 0;
e.ban_reason = row[20] ? row[20] : "";
e.suspend_reason = row[21] ? row[21] : "";
e.crc_eqgame = row[22] ? row[22] : "";
e.crc_skillcaps = row[23] ? row[23] : "";
e.crc_basedata = row[24] ? row[24] : "";
e.id = row[0] ? static_cast<int32_t>(atoi(row[0])) : 0;
e.name = row[1] ? row[1] : "";
e.charname = row[2] ? row[2] : "";
e.sharedplat = row[3] ? static_cast<uint32_t>(strtoul(row[3], nullptr, 10)) : 0;
e.password = row[4] ? row[4] : "";
e.status = row[5] ? static_cast<int32_t>(atoi(row[5])) : 0;
e.ls_id = row[6] ? row[6] : "eqemu";
e.lsaccount_id = row[7] ? static_cast<uint32_t>(strtoul(row[7], nullptr, 10)) : 0;
e.gmspeed = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 0;
e.invulnerable = row[9] ? static_cast<int8_t>(atoi(row[9])) : 0;
e.flymode = row[10] ? static_cast<int8_t>(atoi(row[10])) : 0;
e.ignore_tells = row[11] ? static_cast<int8_t>(atoi(row[11])) : 0;
e.revoked = row[12] ? static_cast<uint8_t>(strtoul(row[12], nullptr, 10)) : 0;
e.karma = row[13] ? static_cast<uint32_t>(strtoul(row[13], nullptr, 10)) : 0;
e.minilogin_ip = row[14] ? row[14] : "";
e.hideme = row[15] ? static_cast<int8_t>(atoi(row[15])) : 0;
e.rulesflag = row[16] ? static_cast<uint8_t>(strtoul(row[16], nullptr, 10)) : 0;
e.suspendeduntil = strtoll(row[17] ? row[17] : "-1", nullptr, 10);
e.time_creation = row[18] ? static_cast<uint32_t>(strtoul(row[18], nullptr, 10)) : 0;
e.ban_reason = row[19] ? row[19] : "";
e.suspend_reason = row[20] ? row[20] : "";
e.crc_eqgame = row[21] ? row[21] : "";
e.crc_skillcaps = row[22] ? row[22] : "";
e.crc_basedata = row[23] ? row[23] : "";
all_entries.push_back(e);
}
@@ -577,7 +567,6 @@ public:
v.push_back(std::to_string(e.id));
v.push_back("'" + Strings::Escape(e.name) + "'");
v.push_back("'" + Strings::Escape(e.charname) + "'");
v.push_back("'" + Strings::Escape(e.auto_login_charname) + "'");
v.push_back(std::to_string(e.sharedplat));
v.push_back("'" + Strings::Escape(e.password) + "'");
v.push_back(std::to_string(e.status));
@@ -624,7 +613,6 @@ public:
v.push_back(std::to_string(e.id));
v.push_back("'" + Strings::Escape(e.name) + "'");
v.push_back("'" + Strings::Escape(e.charname) + "'");
v.push_back("'" + Strings::Escape(e.auto_login_charname) + "'");
v.push_back(std::to_string(e.sharedplat));
v.push_back("'" + Strings::Escape(e.password) + "'");
v.push_back(std::to_string(e.status));
@@ -19,21 +19,17 @@
class BaseLootdropEntriesRepository {
public:
struct LootdropEntries {
uint32_t lootdrop_id;
int32_t item_id;
uint16_t item_charges;
uint8_t equip_item;
float chance;
float disabled_chance;
uint16_t trivial_min_level;
uint16_t trivial_max_level;
uint8_t multiplier;
uint16_t npc_min_level;
uint16_t npc_max_level;
int8_t min_expansion;
int8_t max_expansion;
std::string content_flags;
std::string content_flags_disabled;
uint32_t lootdrop_id;
int32_t item_id;
uint16_t item_charges;
uint8_t equip_item;
float chance;
float disabled_chance;
uint16_t trivial_min_level;
uint16_t trivial_max_level;
uint8_t multiplier;
uint16_t npc_min_level;
uint16_t npc_max_level;
};
static std::string PrimaryKey()
@@ -55,10 +51,6 @@ public:
"multiplier",
"npc_min_level",
"npc_max_level",
"min_expansion",
"max_expansion",
"content_flags",
"content_flags_disabled",
};
}
@@ -76,10 +68,6 @@ public:
"multiplier",
"npc_min_level",
"npc_max_level",
"min_expansion",
"max_expansion",
"content_flags",
"content_flags_disabled",
};
}
@@ -120,21 +108,17 @@ public:
{
LootdropEntries e{};
e.lootdrop_id = 0;
e.item_id = 0;
e.item_charges = 1;
e.equip_item = 0;
e.chance = 1;
e.disabled_chance = 0;
e.trivial_min_level = 0;
e.trivial_max_level = 0;
e.multiplier = 1;
e.npc_min_level = 0;
e.npc_max_level = 0;
e.min_expansion = -1;
e.max_expansion = -1;
e.content_flags = "";
e.content_flags_disabled = "";
e.lootdrop_id = 0;
e.item_id = 0;
e.item_charges = 1;
e.equip_item = 0;
e.chance = 1;
e.disabled_chance = 0;
e.trivial_min_level = 0;
e.trivial_max_level = 0;
e.multiplier = 1;
e.npc_min_level = 0;
e.npc_max_level = 0;
return e;
}
@@ -171,21 +155,17 @@ public:
if (results.RowCount() == 1) {
LootdropEntries e{};
e.lootdrop_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.item_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.item_charges = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 1;
e.equip_item = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.chance = row[4] ? strtof(row[4], nullptr) : 1;
e.disabled_chance = row[5] ? strtof(row[5], nullptr) : 0;
e.trivial_min_level = row[6] ? static_cast<uint16_t>(strtoul(row[6], nullptr, 10)) : 0;
e.trivial_max_level = row[7] ? static_cast<uint16_t>(strtoul(row[7], nullptr, 10)) : 0;
e.multiplier = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 1;
e.npc_min_level = row[9] ? static_cast<uint16_t>(strtoul(row[9], nullptr, 10)) : 0;
e.npc_max_level = row[10] ? static_cast<uint16_t>(strtoul(row[10], nullptr, 10)) : 0;
e.min_expansion = row[11] ? static_cast<int8_t>(atoi(row[11])) : -1;
e.max_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
e.content_flags = row[13] ? row[13] : "";
e.content_flags_disabled = row[14] ? row[14] : "";
e.lootdrop_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.item_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.item_charges = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 1;
e.equip_item = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.chance = row[4] ? strtof(row[4], nullptr) : 1;
e.disabled_chance = row[5] ? strtof(row[5], nullptr) : 0;
e.trivial_min_level = row[6] ? static_cast<uint16_t>(strtoul(row[6], nullptr, 10)) : 0;
e.trivial_max_level = row[7] ? static_cast<uint16_t>(strtoul(row[7], nullptr, 10)) : 0;
e.multiplier = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 1;
e.npc_min_level = row[9] ? static_cast<uint16_t>(strtoul(row[9], nullptr, 10)) : 0;
e.npc_max_level = row[10] ? static_cast<uint16_t>(strtoul(row[10], nullptr, 10)) : 0;
return e;
}
@@ -230,10 +210,6 @@ public:
v.push_back(columns[8] + " = " + std::to_string(e.multiplier));
v.push_back(columns[9] + " = " + std::to_string(e.npc_min_level));
v.push_back(columns[10] + " = " + std::to_string(e.npc_max_level));
v.push_back(columns[11] + " = " + std::to_string(e.min_expansion));
v.push_back(columns[12] + " = " + std::to_string(e.max_expansion));
v.push_back(columns[13] + " = '" + Strings::Escape(e.content_flags) + "'");
v.push_back(columns[14] + " = '" + Strings::Escape(e.content_flags_disabled) + "'");
auto results = db.QueryDatabase(
fmt::format(
@@ -266,10 +242,6 @@ public:
v.push_back(std::to_string(e.multiplier));
v.push_back(std::to_string(e.npc_min_level));
v.push_back(std::to_string(e.npc_max_level));
v.push_back(std::to_string(e.min_expansion));
v.push_back(std::to_string(e.max_expansion));
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
auto results = db.QueryDatabase(
fmt::format(
@@ -310,10 +282,6 @@ public:
v.push_back(std::to_string(e.multiplier));
v.push_back(std::to_string(e.npc_min_level));
v.push_back(std::to_string(e.npc_max_level));
v.push_back(std::to_string(e.min_expansion));
v.push_back(std::to_string(e.max_expansion));
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
}
@@ -347,21 +315,17 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
LootdropEntries e{};
e.lootdrop_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.item_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.item_charges = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 1;
e.equip_item = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.chance = row[4] ? strtof(row[4], nullptr) : 1;
e.disabled_chance = row[5] ? strtof(row[5], nullptr) : 0;
e.trivial_min_level = row[6] ? static_cast<uint16_t>(strtoul(row[6], nullptr, 10)) : 0;
e.trivial_max_level = row[7] ? static_cast<uint16_t>(strtoul(row[7], nullptr, 10)) : 0;
e.multiplier = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 1;
e.npc_min_level = row[9] ? static_cast<uint16_t>(strtoul(row[9], nullptr, 10)) : 0;
e.npc_max_level = row[10] ? static_cast<uint16_t>(strtoul(row[10], nullptr, 10)) : 0;
e.min_expansion = row[11] ? static_cast<int8_t>(atoi(row[11])) : -1;
e.max_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
e.content_flags = row[13] ? row[13] : "";
e.content_flags_disabled = row[14] ? row[14] : "";
e.lootdrop_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.item_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.item_charges = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 1;
e.equip_item = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.chance = row[4] ? strtof(row[4], nullptr) : 1;
e.disabled_chance = row[5] ? strtof(row[5], nullptr) : 0;
e.trivial_min_level = row[6] ? static_cast<uint16_t>(strtoul(row[6], nullptr, 10)) : 0;
e.trivial_max_level = row[7] ? static_cast<uint16_t>(strtoul(row[7], nullptr, 10)) : 0;
e.multiplier = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 1;
e.npc_min_level = row[9] ? static_cast<uint16_t>(strtoul(row[9], nullptr, 10)) : 0;
e.npc_max_level = row[10] ? static_cast<uint16_t>(strtoul(row[10], nullptr, 10)) : 0;
all_entries.push_back(e);
}
@@ -386,21 +350,17 @@ public:
for (auto row = results.begin(); row != results.end(); ++row) {
LootdropEntries e{};
e.lootdrop_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.item_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.item_charges = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 1;
e.equip_item = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.chance = row[4] ? strtof(row[4], nullptr) : 1;
e.disabled_chance = row[5] ? strtof(row[5], nullptr) : 0;
e.trivial_min_level = row[6] ? static_cast<uint16_t>(strtoul(row[6], nullptr, 10)) : 0;
e.trivial_max_level = row[7] ? static_cast<uint16_t>(strtoul(row[7], nullptr, 10)) : 0;
e.multiplier = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 1;
e.npc_min_level = row[9] ? static_cast<uint16_t>(strtoul(row[9], nullptr, 10)) : 0;
e.npc_max_level = row[10] ? static_cast<uint16_t>(strtoul(row[10], nullptr, 10)) : 0;
e.min_expansion = row[11] ? static_cast<int8_t>(atoi(row[11])) : -1;
e.max_expansion = row[12] ? static_cast<int8_t>(atoi(row[12])) : -1;
e.content_flags = row[13] ? row[13] : "";
e.content_flags_disabled = row[14] ? row[14] : "";
e.lootdrop_id = row[0] ? static_cast<uint32_t>(strtoul(row[0], nullptr, 10)) : 0;
e.item_id = row[1] ? static_cast<int32_t>(atoi(row[1])) : 0;
e.item_charges = row[2] ? static_cast<uint16_t>(strtoul(row[2], nullptr, 10)) : 1;
e.equip_item = row[3] ? static_cast<uint8_t>(strtoul(row[3], nullptr, 10)) : 0;
e.chance = row[4] ? strtof(row[4], nullptr) : 1;
e.disabled_chance = row[5] ? strtof(row[5], nullptr) : 0;
e.trivial_min_level = row[6] ? static_cast<uint16_t>(strtoul(row[6], nullptr, 10)) : 0;
e.trivial_max_level = row[7] ? static_cast<uint16_t>(strtoul(row[7], nullptr, 10)) : 0;
e.multiplier = row[8] ? static_cast<uint8_t>(strtoul(row[8], nullptr, 10)) : 1;
e.npc_min_level = row[9] ? static_cast<uint16_t>(strtoul(row[9], nullptr, 10)) : 0;
e.npc_max_level = row[10] ? static_cast<uint16_t>(strtoul(row[10], nullptr, 10)) : 0;
all_entries.push_back(e);
}
@@ -486,10 +446,6 @@ public:
v.push_back(std::to_string(e.multiplier));
v.push_back(std::to_string(e.npc_min_level));
v.push_back(std::to_string(e.npc_max_level));
v.push_back(std::to_string(e.min_expansion));
v.push_back(std::to_string(e.max_expansion));
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
auto results = db.QueryDatabase(
fmt::format(
@@ -523,10 +479,6 @@ public:
v.push_back(std::to_string(e.multiplier));
v.push_back(std::to_string(e.npc_min_level));
v.push_back(std::to_string(e.npc_max_level));
v.push_back(std::to_string(e.min_expansion));
v.push_back(std::to_string(e.max_expansion));
v.push_back("'" + Strings::Escape(e.content_flags) + "'");
v.push_back("'" + Strings::Escape(e.content_flags_disabled) + "'");
insert_chunks.push_back("(" + Strings::Implode(",", v) + ")");
}
@@ -70,7 +70,6 @@ public:
{.parent_command = "set", .sub_command = "alternate_currency", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "setaltcurrency"},
{.parent_command = "set", .sub_command = "animation", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "setanim"},
{.parent_command = "set", .sub_command = "anon", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "setanon"},
{.parent_command = "set", .sub_command = "auto_login", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "setautologin"},
{.parent_command = "set", .sub_command = "bind", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "bind"},
{.parent_command = "set", .sub_command = "checksum", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "updatechecksum"},
{.parent_command = "set", .sub_command = "class_permanent", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "permaclass"},
@@ -123,7 +122,6 @@ public:
{.parent_command = "set", .sub_command = "zone", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "zclip|zcolor|zheader|zonelock|zsafecoords|zsky|zunderworld"},
{.parent_command = "show", .sub_command = "aas", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showaas"},
{.parent_command = "show", .sub_command = "aa_points", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showaapoints|showaapts"},
{.parent_command = "show", .sub_command = "auto_login", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showautologin"},
{.parent_command = "show", .sub_command = "aggro", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "aggro"},
{.parent_command = "show", .sub_command = "buffs", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "showbuffs"},
{.parent_command = "show", .sub_command = "buried_corpse_count", .access_level = AccountStatus::QuestTroupe, .top_level_aliases = "getplayerburiedcorpsecount"},
-1
View File
@@ -330,7 +330,6 @@ RULE_BOOL(World, UseOldShadowKnightClassExport, true, "Disable to have Shadowkni
RULE_STRING(World, IPExemptionZones, "", "Comma-delimited list of zones to exclude from IP-limit checks. Empty string to disable.")
RULE_STRING(World, MOTD, "", "Server MOTD sent on login, change from empty to have this be used instead of variables table 'motd' value")
RULE_STRING(World, Rules, "", "Server Rules, change from empty to have this be used instead of variables table 'rules' value, lines are pipe (|) separated, example: A|B|C")
RULE_BOOL(World, EnableAutoLogin, false, "Enables or disables auto login of characters, allowing people to log characters in directly from loginserver to ingame")
RULE_CATEGORY_END()
RULE_CATEGORY(Zone)
+16 -10
View File
@@ -13,11 +13,16 @@ SkillCapsRepository::SkillCaps SkillCaps::GetSkillCap(uint8 class_id, EQ::skills
return SkillCapsRepository::NewEntity();
}
uint64_t key = (class_id * 1000000) + (level * 1000) + static_cast<uint32>(skill_id);
auto pos = m_skill_caps.find(key);
if (pos != m_skill_caps.end()) {
return pos->second;
for (const auto &e: m_skill_caps) {
if (
e.class_id == class_id &&
e.level == level &&
static_cast<EQ::skills::SkillType>(e.skill_id) == skill_id
) {
return e;
}
}
return SkillCapsRepository::NewEntity();
}
@@ -41,9 +46,11 @@ uint8 SkillCaps::GetTrainLevel(uint8 class_id, EQ::skills::SkillType skill_id, u
for (const auto &e: m_skill_caps) {
for (uint8 current_level = 1; current_level <= max_level; current_level++) {
uint64_t key = (class_id * 1000000) + (level * 1000) + static_cast<uint32>(skill_id);
auto pos = m_skill_caps.find(key);
if (pos != m_skill_caps.end()) {
if (
e.class_id == class_id &&
static_cast<EQ::skills::SkillType>(e.skill_id) == skill_id &&
e.level == current_level
) {
return current_level;
}
}
@@ -56,7 +63,7 @@ void SkillCaps::LoadSkillCaps()
{
const auto &l = SkillCapsRepository::All(*m_content_database);
m_skill_caps.clear();
m_skill_caps.reserve(l.size());
for (const auto &e: l) {
if (
@@ -67,8 +74,7 @@ void SkillCaps::LoadSkillCaps()
continue;
}
uint64_t key = (e.class_id * 1000000) + (e.level * 1000) + e.skill_id;
m_skill_caps[key] = e;
m_skill_caps.emplace_back(e);
}
LogInfo(
+1 -1
View File
@@ -17,7 +17,7 @@ public:
SkillCaps *SetContentDatabase(Database *db);
private:
Database *m_content_database{};
std::map<uint64, SkillCapsRepository::SkillCaps> m_skill_caps = {};
std::vector<SkillCapsRepository::SkillCaps> m_skill_caps = {};
};
extern SkillCaps skill_caps;
+2 -2
View File
@@ -25,7 +25,7 @@
// Build variables
// these get injected during the build pipeline
#define CURRENT_VERSION "22.49.1-dev" // always append -dev to the current version for custom-builds
#define CURRENT_VERSION "22.48.0-dev" // always append -dev to the current version for custom-builds
#define LOGIN_VERSION "0.8.0"
#define COMPILE_DATE __DATE__
#define COMPILE_TIME __TIME__
@@ -42,7 +42,7 @@
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/
#define CURRENT_BINARY_DATABASE_VERSION 9270
#define CURRENT_BINARY_DATABASE_VERSION 9268
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9043
#endif
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "eqemu-server",
"version": "22.49.1",
"version": "22.48.0",
"repository": {
"type": "git",
"url": "https://github.com/EQEmu/Server.git"
+3 -9
View File
@@ -194,20 +194,14 @@ bool Client::CanTradeFVNoDropItem()
void Client::SendEnterWorld(std::string name)
{
std::string live_name {};
if (is_player_zoning) {
live_name = database.GetLiveChar(GetAccountID());
if (database.GetAccountIDByChar(live_name) != GetAccountID()) {
if(database.GetAccountIDByChar(live_name) != GetAccountID()) {
eqs->Close();
return;
} else {
LogInfo("Telling client to continue session");
}
LogInfo("Zoning with live_name [{}] account_id [{}]", live_name, GetAccountID());
}
if (RuleB(World, EnableAutoLogin)) {
live_name = AccountRepository::GetAutoLoginCharacterNameByAccountID(database, GetAccountID());
LogInfo("Attempting to auto login with live_name [{}] account_id [{}]", live_name, GetAccountID());
}
auto outapp = new EQApplicationPacket(OP_EnterWorld, live_name.length() + 1);
+5 -5
View File
@@ -221,7 +221,7 @@ void NPC::DescribeAggro(Client *to_who, Mob *mob, bool verbose) {
if (RuleB(Aggro, UseLevelAggro)) {
if (
GetLevel() < RuleI(Aggro, MinAggroLevel) &&
mob->GetLevelCon(GetLevel()) == ConsiderColor::Gray &&
mob->GetLevelCon(GetLevel()) == CON_GRAY &&
GetBodyType() != BT_Undead &&
!AlwaysAggro()
) {
@@ -237,7 +237,7 @@ void NPC::DescribeAggro(Client *to_who, Mob *mob, bool verbose) {
} else {
if (
GetINT() > RuleI(Aggro, IntAggroThreshold) &&
mob->GetLevelCon(GetLevel()) == ConsiderColor::Gray &&
mob->GetLevelCon(GetLevel()) == CON_GRAY &&
!AlwaysAggro()
) {
to_who->Message(
@@ -502,7 +502,7 @@ bool Mob::CheckWillAggro(Mob *mob) {
mob->IsClient() &&
mob->CastToClient()->IsSitting()
) ||
mob->GetLevelCon(GetLevel()) != ConsiderColor::Gray
mob->GetLevelCon(GetLevel()) != CON_GRAY
) &&
(
faction_value == FACTION_SCOWLS ||
@@ -531,7 +531,7 @@ bool Mob::CheckWillAggro(Mob *mob) {
mob->IsClient() &&
mob->CastToClient()->IsSitting()
) ||
mob->GetLevelCon(GetLevel()) != ConsiderColor::Gray
mob->GetLevelCon(GetLevel()) != CON_GRAY
) &&
(
faction_value == FACTION_SCOWLS ||
@@ -586,7 +586,7 @@ int EntityList::GetHatedCount(Mob *attacker, Mob *exclude, bool inc_gray_con)
continue;
}
if (!inc_gray_con && attacker->GetLevelCon(mob->GetLevel()) == ConsiderColor::Gray) {
if (!inc_gray_con && attacker->GetLevelCon(mob->GetLevel()) == CON_GRAY) {
continue;
}
+28 -25
View File
@@ -2500,9 +2500,8 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
d->spell_id = UINT32_MAX;
d->attack_skill = SkillDamageTypes[attack_skill];
d->damage = damage;
d->corpseid = GetID();
app->priority = 1;
app->priority = 6;
entity_list.QueueClients(killer_mob, app, false);
@@ -2720,7 +2719,7 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
if (!is_ldon_treasure && !MerchantType) {
const uint32 con_level = give_exp->GetLevelCon(GetLevel());
if (con_level != ConsiderColor::Gray) {
if (con_level != CON_GRAY) {
if (!GetOwner() || (GetOwner() && !GetOwner()->IsClient())) {
give_exp_client->AddEXP(final_exp, con_level);
@@ -2817,6 +2816,9 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
entity_list.RemoveFromAutoXTargets(this);
// Here we create the corpse.
DeleteInvalidQuestLoot();
corpse = new Corpse(
this,
&m_loot_items,
@@ -2834,15 +2836,8 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
}
entity_list.LimitRemoveNPC(this);
entity_list.AddCorpse(corpse, GetID());
// The client sees NPC corpses as name's_corpse. The server uses
// name`s_corpse so that %T works on corpses (client workaround)
// Rename the new corpse on client side.
std::string old_name = Strings::Replace(corpse->GetName(), "`s_corpse", "'s_corpse");
SendRename(killer_mob, old_name.c_str(), corpse->GetName());
entity_list.UnMarkNPC(GetID());
entity_list.RemoveNPC(GetID());
@@ -3976,9 +3971,13 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
int64 lua_ret = 0;
bool ignore_default = false;
lua_ret = LuaParser::Instance()->CommonDamage(this, attacker, damage, spell_id, static_cast<int>(skill_used), avoidable, buffslot, iBuffTic, static_cast<int>(special), ignore_default);
if (ignore_default) {
if (lua_ret != 0) {
damage = lua_ret;
}
if (ignore_default) {
//return lua_ret;
}
#endif
// This method is called with skill_used=ABJURE for Damage Shield damage.
bool FromDamageShield = (skill_used == EQ::skills::SkillAbjuration);
@@ -4054,7 +4053,7 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
Mob *owner = GetOwner();
if (owner && owner->IsClient()) {
if (GetPetOrder() == SPO_Sit) {
SetPetOrder(GetPreviousPetOrder());
SetPetOrder(SPO_Follow);
}
// fix GUI sit button to be unpressed and stop sitting regen
owner->CastToClient()->SetPetCommandState(PET_BUTTON_SIT, 0);
@@ -4084,11 +4083,11 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
!pet->IsHeld()
) {
LogAggro("Sending pet [{}] into battle due to attack", pet->GetName());
if (IsClient() && !pet->IsPetStop()) {
// if pet was sitting his new mode is previous setting of
// follow or guard after the battle (live verified)
if (IsClient()) {
// if pet was sitting his new mode is follow
// following after the battle (live verified)
if (pet->GetPetOrder() == SPO_Sit) {
pet->SetPetOrder(pet->GetPreviousPetOrder());
pet->SetPetOrder(SPO_Follow);
}
// fix GUI sit button to be unpressed and stop sitting regen
@@ -4673,9 +4672,9 @@ void Mob::CommonDamage(Mob* attacker, int64 &damage, const uint16 spell_id, cons
else {
//else, it is a buff tic...
// So we can see our dot dmg like live shows it.
if (IsValidSpell(spell_id) && damage > 0 && attacker && attacker != this) {
if (IsValidSpell(spell_id) && damage > 0 && attacker && attacker != this && !attacker->IsCorpse()) {
//might filter on (attack_skill>200 && attack_skill<250), but I dont think we need it
if (!attacker->IsCorpse() && attacker->IsClient()) {
if (attacker->IsClient()) {
attacker->FilteredMessageString(attacker, Chat::DotDamage,
FilterDOT, YOUR_HIT_DOT, GetCleanName(), itoa(damage),
spells[spell_id].name);
@@ -4712,9 +4711,13 @@ void Mob::HealDamage(uint64 amount, Mob* caster, uint16 spell_id)
bool ignore_default = false;
lua_ret = LuaParser::Instance()->HealDamage(this, caster, amount, spell_id, ignore_default);
if (ignore_default) {
if (lua_ret != 0) {
amount = lua_ret;
}
if (ignore_default) {
//return lua_ret;
}
#endif
int64 maxhp = GetMaxHP();
int64 curhp = GetHP();
@@ -6314,10 +6317,10 @@ void Mob::CommonOutgoingHitSuccess(Mob* defender, DamageHitInfo &hit, ExtraAttac
bool use_shield_ability = true;
//If defender is being shielded by an ability AND has a shield spell effect buff use highest mitigation value.
if ((defender->GetShieldTargetMitigation() && defender->spellbonuses.ShieldTargetSpa[SBIndex::SHIELD_TARGET_MITIGATION_PERCENT]) &&
(defender->spellbonuses.ShieldTargetSpa[SBIndex::SHIELD_TARGET_MITIGATION_PERCENT] >= defender->GetShieldTargetMitigation())){
(defender->spellbonuses.ShieldTargetSpa[SBIndex::SHIELD_TARGET_MITIGATION_PERCENT] >= defender->GetShieldTargetMitigation())){
bool use_shield_ability = false;
}
//use targeted /shield ability values
if (defender->GetShielderID() && use_shield_ability) {
DoShieldDamageOnShielder(defender, hit.damage_done, hit.skill);
@@ -6379,14 +6382,14 @@ void Mob::DoShieldDamageOnShielderSpellEffect(Mob* shield_target, int64 hit_dama
}
/*
SPA 463 SE_SHIELD_TARGET
Live description: "Shields your target, taking a percentage of their damage".
Live description: "Shields your target, taking a percentage of their damage".
Only example spell on live is an NPC who uses it during a raid event "Laurion's Song" expansion. SPA 54492 'Guardian Stance' Described as 100% Melee Shielding
Example of mechanic. Base value = 70. Caster puts buff on target. Each melee hit Buff Target takes 70% less damage, Buff Caster receives 30% of the melee damage.
Added mechanic to cause buff to fade if target or caster are seperated by a distance greater than the casting range of the spell. This allows similiar mechanics
to the /shield ability, without a range removal mechanic it would be too easy to abuse if put on a player spell. *can not confirm live does this currently
Can not be cast on self.
*/
+11 -10
View File
@@ -938,7 +938,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
case SE_IncreaseRange:
break;
case SE_MaxHPChange:
newbon->PercentMaxHPChange += base_value;
newbon->MaxHP += base_value;
break;
case SE_Packrat:
newbon->Packrat += base_value;
@@ -997,7 +997,7 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
newbon->BuffSlotIncrease += base_value;
break;
case SE_TotalHP:
newbon->FlatMaxHPChange += base_value;
newbon->HP += base_value;
break;
case SE_StunResist:
newbon->StunResist += base_value;
@@ -2237,7 +2237,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
case SE_TotalHP:
{
new_bonus->FlatMaxHPChange += effect_value;
new_bonus->HP += effect_value;
break;
}
@@ -2919,7 +2919,7 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
}
case SE_MaxHPChange:
new_bonus->PercentMaxHPChange += effect_value;
new_bonus->MaxHPChange += effect_value;
break;
case SE_EndurancePool:
@@ -4515,9 +4515,9 @@ void Mob::NegateSpellEffectBonuses(uint16 spell_id)
break;
case SE_TotalHP:
if (negate_spellbonus) { spellbonuses.FlatMaxHPChange = effect_value; }
if (negate_aabonus) { aabonuses.FlatMaxHPChange = effect_value; }
if (negate_itembonus) { itembonuses.FlatMaxHPChange = effect_value; }
if (negate_spellbonus) { spellbonuses.HP = effect_value; }
if (negate_aabonus) { aabonuses.HP = effect_value; }
if (negate_itembonus) { itembonuses.HP = effect_value; }
break;
case SE_ManaRegen_v2:
@@ -4999,9 +4999,10 @@ void Mob::NegateSpellEffectBonuses(uint16 spell_id)
}
case SE_MaxHPChange:
if (negate_spellbonus) { spellbonuses.PercentMaxHPChange = effect_value; }
if (negate_aabonus) { aabonuses.PercentMaxHPChange = effect_value; }
if (negate_itembonus) { itembonuses.PercentMaxHPChange = effect_value; }
if (negate_spellbonus) { spellbonuses.MaxHPChange = effect_value; }
if (negate_aabonus) { aabonuses.MaxHPChange = effect_value; }
if (negate_aabonus) { aabonuses.MaxHP = effect_value; }
if (negate_itembonus) { itembonuses.MaxHPChange = effect_value; }
break;
case SE_EndurancePool:
+7 -7
View File
@@ -6235,9 +6235,9 @@ int64 Bot::CalcMaxHP() {
uint32 nd = 10000;
bot_hp += (GenerateBaseHitPoints() + itembonuses.HP);
bot_hp += itembonuses.heroic_max_hp;
nd += aabonuses.PercentMaxHPChange + spellbonuses.PercentMaxHPChange + itembonuses.PercentMaxHPChange;
nd += aabonuses.MaxHP + spellbonuses.MaxHPChange + itembonuses.MaxHPChange;
bot_hp = ((float)bot_hp * (float)nd / (float)10000);
bot_hp += (spellbonuses.FlatMaxHPChange + aabonuses.FlatMaxHPChange + itembonuses.FlatMaxHPChange);
bot_hp += (spellbonuses.HP + aabonuses.HP);
bot_hp += GroupLeadershipAAHealthEnhancement();
max_hp = bot_hp;
if (current_hp > max_hp)
@@ -7366,23 +7366,23 @@ void EntityList::ShowSpawnWindow(Client* client, int Distance, bool NamedOnly) {
LastCon = CurrentCon;
switch(CurrentCon) {
case ConsiderColor::Green: {
case CON_GREEN: {
WindowText += "<c \"#00FF00\">";
break;
}
case ConsiderColor::LightBlue: {
case CON_LIGHTBLUE: {
WindowText += "<c \"#8080FF\">";
break;
}
case ConsiderColor::DarkBlue: {
case CON_BLUE: {
WindowText += "<c \"#2020FF\">";
break;
}
case ConsiderColor::Yellow: {
case CON_YELLOW: {
WindowText += "<c \"#FFFF00\">";
break;
}
case ConsiderColor::Red: {
case CON_RED: {
WindowText += "<c \"#FF0000\">";
break;
}
+1
View File
@@ -893,6 +893,7 @@ private:
bool m_pulling_flag;
bool m_returning_flag;
bool is_using_item_click;
eStandingPetOrder m_previous_pet_order;
uint32 m_bot_caster_range;
BotCastingRoles m_CastingRoles;
+4 -1
View File
@@ -278,6 +278,8 @@ Client::Client(EQStreamInterface *ieqs) : Mob(
if (RuleI(World, PVPMinLevel) > 0 && level >= RuleI(World, PVPMinLevel) && m_pp.pvp == 0) SetPVP(true, false);
dynamiczone_removal_timer.Disable();
heroforge_wearchange_timer.Disable();
//for good measure:
memset(&m_pp, 0, sizeof(m_pp));
memset(&m_epp, 0, sizeof(m_epp));
@@ -341,6 +343,7 @@ Client::Client(EQStreamInterface *ieqs) : Mob(
XTargetAutoAddHaters = true;
m_autohatermgr.SetOwner(this, nullptr, nullptr);
m_activeautohatermgr = &m_autohatermgr;
LoadAccountFlags();
initial_respawn_selection = 0;
alternate_currency_loaded = false;
@@ -2657,7 +2660,7 @@ bool Client::CheckIncreaseSkill(EQ::skills::SkillType skillid, Mob *against_who,
against_who->GetSpecialAbility(IMMUNE_AGGRO) ||
against_who->GetSpecialAbility(IMMUNE_AGGRO_CLIENT) ||
against_who->IsClient() ||
GetLevelCon(against_who->GetLevel()) == ConsiderColor::Gray
GetLevelCon(against_who->GetLevel()) == CON_GRAY
) {
return false;
}
+2 -3
View File
@@ -1130,9 +1130,6 @@ public:
const bool GetGMInvul() const { return gminvul; }
bool CanUseReport;
const std::string GetAutoLoginCharacterName();
bool SetAutoLoginCharacterName(const std::string& character_name);
//This is used to later set the buff duration of the spell, in slot to duration.
//Doesn't appear to work directly after the client recieves an action packet.
void SendBuffDurationPacket(Buffs_Struct &buff, int slot);
@@ -1956,6 +1953,8 @@ private:
Timer task_request_timer;
Timer pick_lock_timer;
Timer heroforge_wearchange_timer;
glm::vec3 m_Proximity;
glm::vec4 last_position_before_bulk_update;
+2 -2
View File
@@ -323,9 +323,9 @@ int64 Client::CalcMaxHP()
//to apply it to (basehp + itemhp).. I will oblige to the client's whims over
//the aa description
nd += aabonuses.PercentMaxHPChange + spellbonuses.PercentMaxHPChange + itembonuses.PercentMaxHPChange; //Natural Durability, Physical Enhancement, Planar Durability
nd += aabonuses.MaxHP + spellbonuses.MaxHPChange + itembonuses.MaxHPChange; //Natural Durability, Physical Enhancement, Planar Durability (MaxHP and MaxHPChange are SPA214)
max_hp = (float)max_hp * (float)nd / (float)10000; //this is to fix the HP-above-495k issue
max_hp += spellbonuses.FlatMaxHPChange + aabonuses.FlatMaxHPChange + itembonuses.FlatMaxHPChange;
max_hp += spellbonuses.HP + aabonuses.HP;
max_hp += GroupLeadershipAAHealthEnhancement();
if (current_hp > max_hp) {
+30 -37
View File
@@ -538,7 +538,6 @@ void Client::CompleteConnect()
EnteringMessages(this);
LoadPEQZoneFlags();
LoadZoneFlags();
LoadAccountFlags();
/* Sets GM Flag if needed & Sends Petition Queue */
UpdateAdmin(false);
@@ -758,10 +757,8 @@ void Client::CompleteConnect()
entity_list.SendTraders(this);
SendWearChangeAndLighting(EQ::textures::LastTexture);
Mob* pet = GetPet();
Mob *pet = GetPet();
if (pet) {
pet->SendWearChangeAndLighting(EQ::textures::LastTexture);
pet->SendPetBuffsToClient();
}
@@ -954,6 +951,8 @@ void Client::CompleteConnect()
safe_delete(p);
}
heroforge_wearchange_timer.Start(250);
RecordStats();
AutoGrantAAPoints();
@@ -5190,10 +5189,10 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app)
con->level = GetLevelCon(t->GetLevel());
if (ClientVersion() <= EQ::versions::ClientVersion::Titanium) {
if (con->level == ConsiderColor::Gray) {
con->level = ConsiderColor::Green;
} else if (con->level == ConsiderColor::White) {
con->level = ConsiderColor::WhiteTitanium;
if (con->level == CON_GRAY) {
con->level = CON_GREEN;
} else if (con->level == CON_WHITE) {
con->level = CON_WHITE_TITANIUM;
}
}
@@ -5234,26 +5233,26 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app)
if (t->IsRaidTarget()) {
uint32 color = 0;
switch (con->level) {
case ConsiderColor::Green:
case CON_GREEN:
color = 2;
break;
case ConsiderColor::LightBlue:
case CON_LIGHTBLUE:
color = 10;
break;
case ConsiderColor::DarkBlue:
case CON_BLUE:
color = 4;
break;
case ConsiderColor::WhiteTitanium:
case ConsiderColor::White:
case CON_WHITE_TITANIUM:
case CON_WHITE:
color = 10;
break;
case ConsiderColor::Yellow:
case CON_YELLOW:
color = 15;
break;
case ConsiderColor::Red:
case CON_RED:
color = 13;
break;
case ConsiderColor::Gray:
case CON_GRAY:
color = 6;
break;
}
@@ -11035,10 +11034,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
// fix GUI sit button to be unpressed and stop sitting regen
SetPetCommandState(PET_BUTTON_SIT, 0);
if (mypet->GetPetOrder() == SPO_Sit || mypet->GetPetOrder() == SPO_FeignDeath) {
mypet->SetPetOrder(mypet->GetPreviousPetOrder());
mypet->SetAppearance(eaStanding);
}
mypet->SetAppearance(eaStanding);
zone->AddAggroMob();
// classic acts like qattack
@@ -11085,10 +11081,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
// fix GUI sit button to be unpressed and stop sitting regen
SetPetCommandState(PET_BUTTON_SIT, 0);
if (mypet->GetPetOrder() == SPO_Sit || mypet->GetPetOrder() == SPO_FeignDeath) {
mypet->SetPetOrder(mypet->GetPreviousPetOrder());
mypet->SetAppearance(eaStanding);
}
mypet->SetAppearance(eaStanding);
zone->AddAggroMob();
mypet->AddToHateList(GetTarget(), 1, 0, true, false, false, SPELL_UNKNOWN, true);
@@ -11154,7 +11147,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
// Set Sit button to unpressed - send stand anim/end hpregen
mypet->SetFeigned(false);
SetPetCommandState(PET_BUTTON_SIT, 0);
mypet->SetAppearance(eaStanding);
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Standing);
mypet->SayString(this, Chat::PetResponse, PET_GUARDINGLIFE);
mypet->SetPetOrder(SPO_Guard);
@@ -11179,7 +11172,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
// fix GUI sit button to be unpressed - send stand anim/end hpregen
SetPetCommandState(PET_BUTTON_SIT, 0);
mypet->SetAppearance(eaStanding);
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Standing);
if (mypet->IsPetStop()) {
mypet->SetPetStop(false);
@@ -11227,7 +11220,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
// Set Sit button to unpressed - send stand anim/end hpregen
SetPetCommandState(PET_BUTTON_SIT, 0);
mypet->SetAppearance(eaStanding);
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Standing);
if (mypet->IsPetStop()) {
mypet->SetPetStop(false);
@@ -11244,8 +11237,8 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
{
mypet->SetFeigned(false);
mypet->SayString(this, Chat::PetResponse, PET_SIT_STRING);
mypet->SetPetOrder(mypet->GetPreviousPetOrder());
mypet->SetAppearance(eaStanding);
mypet->SetPetOrder(SPO_Follow);
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Standing);
}
else
{
@@ -11255,7 +11248,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
mypet->SetRunAnimSpeed(0);
if (!mypet->UseBardSpellLogic()) //maybe we can have a bard pet
mypet->InterruptSpell(); //No cast 4 u. //i guess the pet should start casting
mypet->SetAppearance(eaSitting);
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Sitting);
}
}
break;
@@ -11267,8 +11260,8 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
mypet->SetFeigned(false);
mypet->SayString(this, Chat::PetResponse, PET_SIT_STRING);
SetPetCommandState(PET_BUTTON_SIT, 0);
mypet->SetPetOrder(mypet->GetPreviousPetOrder());
mypet->SetAppearance(eaStanding);
mypet->SetPetOrder(SPO_Follow);
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Standing);
}
break;
}
@@ -11283,7 +11276,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
mypet->SetRunAnimSpeed(0);
if (!mypet->UseBardSpellLogic()) //maybe we can have a bard pet
mypet->InterruptSpell(); //No cast 4 u. //i guess the pet should start casting
mypet->SetAppearance(eaSitting);
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Sitting);
}
break;
}
@@ -11488,7 +11481,7 @@ void Client::Handle_OP_PetCommands(const EQApplicationPacket *app)
mypet->SetPetOrder(SPO_FeignDeath);
mypet->SetRunAnimSpeed(0);
mypet->StopNavigation();
mypet->SetAppearance(eaDead);
mypet->SendAppearancePacket(AppearanceType::Animation, Animation::Lying);
mypet->SetFeigned(true);
mypet->SetTarget(nullptr);
if (!mypet->UseBardSpellLogic()) {
@@ -16018,11 +16011,11 @@ void Client::Handle_OP_WearChange(const EQApplicationPacket *app)
return;
// Hero Forge ID needs to be fixed here as RoF2 appears to send an incorrect value.
if (wc->wear_slot_id >= 0 && wc->wear_slot_id < EQ::textures::weaponPrimary)
if (wc->hero_forge_model != 0 && wc->wear_slot_id >= 0 && wc->wear_slot_id < EQ::textures::weaponPrimary)
wc->hero_forge_model = GetHerosForgeModel(wc->wear_slot_id);
// we could maybe ignore this and just send our own from moveitem
entity_list.QueueClients(this, app, false);
entity_list.QueueClients(this, app, true);
}
void Client::Handle_OP_WhoAllRequest(const EQApplicationPacket *app)
@@ -16780,7 +16773,7 @@ void Client::RecordStats()
r.level = GetLevel();
r.class_ = GetBaseClass();
r.race = GetBaseRace();
r.hp = GetMaxHP() - GetSpellBonuses().FlatMaxHPChange;
r.hp = GetMaxHP() - GetSpellBonuses().HP;
r.mana = GetMaxMana() - GetSpellBonuses().Mana;
r.endurance = GetMaxEndurance() - GetSpellBonuses().Endurance;
r.ac = GetDisplayAC() - GetSpellBonuses().AC;
+19
View File
@@ -213,6 +213,25 @@ bool Client::Process() {
instalog = true;
}
if (heroforge_wearchange_timer.Check()) {
/*
This addresses bug where on zone in heroforge models would not be sent to other clients when this was
in Client::CompleteConnect(). Sending after a small 250 ms delay after that function resolves the issue.
Unclear the underlying reason for this, if a better solution can be found then can move this back.
*/
if (queue_wearchange_slot >= 0) { //Resend slot from Client::SwapItem if heroforge item is swapped.
SendWearChange(static_cast<uint8>(queue_wearchange_slot));
}
else { //Send from Client::CompleteConnect()
SendWearChangeAndLighting(EQ::textures::LastTexture);
Mob *pet = GetPet();
if (pet) {
pet->SendWearChangeAndLighting(EQ::textures::LastTexture);
}
}
heroforge_wearchange_timer.Disable();
}
if (IsStunned() && stunned_timer.Check())
Mob::UnStun();
+11 -2
View File
@@ -25,6 +25,15 @@ namespace Archetype {
constexpr uint8 Melee = 3;
};
#define CON_GREEN 2
#define CON_LIGHTBLUE 18
#define CON_BLUE 4
#define CON_WHITE 10
#define CON_WHITE_TITANIUM 20
#define CON_YELLOW 15
#define CON_RED 13
#define CON_GRAY 6
#define DMG_BLOCKED -1
#define DMG_PARRIED -2
#define DMG_RIPOSTED -3
@@ -278,6 +287,7 @@ struct StatBonuses {
int32 AC;
int64 HP;
int64 HPRegen;
int64 MaxHP; //same bonus as MaxHPChange when applied to spells and item bonuses
int64 ManaRegen;
int64 EnduranceRegen;
int64 Mana;
@@ -403,7 +413,7 @@ struct StatBonuses {
int32 MeleeLifetap; //i
int32 Vampirism; //i
int32 HealRate; // Spell effect that influences effectiveness of heals
int64 PercentMaxHPChange; // base: Max HP change by percentage value from spell effect/item worn effect/aa
int32 MaxHPChange; // percent change in hit points (aabonuses use variable MaxHP)
int16 SkillDmgTaken[EQ::skills::HIGHEST_SKILL + 2]; // All Skills + -1
int32 HealAmt; // Item Effect
int32 SpellDmg; // Item Effect
@@ -503,7 +513,6 @@ struct StatBonuses {
uint8 invisibility_verse_undead; // IVU level
uint8 invisibility_verse_animal; // IVA level
int32 ShieldTargetSpa[2]; // [0] base = % mitigation amount, [1] buff slot
int64 FlatMaxHPChange; // base: Max HP change by a flat amount value from spell effect/item worn effect/aa
// AAs
int32 TrapCircumvention; // reduce chance to trigger a trap.
-12
View File
@@ -5855,16 +5855,6 @@ uint16 Perl__get_race_bitmask(uint16 race_id)
return GetPlayerRaceBit(race_id);
}
std::string Perl__GetAutoLoginCharacterNameByAccountID(uint32 account_id)
{
return quest_manager.GetAutoLoginCharacterNameByAccountID(account_id);
}
bool Perl__SetAutoLoginCharacterNameByAccountID(uint32 account_id, std::string character_name)
{
return quest_manager.SetAutoLoginCharacterNameByAccountID(account_id, character_name);
}
void perl_register_quest()
{
perl::interpreter perl(PERL_GET_THX);
@@ -5895,7 +5885,6 @@ void perl_register_quest()
package.add("FlagInstanceByGroupLeader", &Perl__FlagInstanceByGroupLeader);
package.add("FlagInstanceByRaidLeader", &Perl__FlagInstanceByRaidLeader);
package.add("FlyMode", &Perl__FlyMode);
package.add("GetAutoLoginCharacterNameByAccountID", &Perl__GetAutoLoginCharacterNameByAccountID);
package.add("GetBotClassByID", &Perl__GetBotClassByID);
package.add("GetBotGenderByID", &Perl__GetBotGenderByID);
package.add("GetBotIDsByCharacterID", (perl::array(*)(uint32))&Perl__GetBotIDsByCharacterID);
@@ -6170,7 +6159,6 @@ void perl_register_quest()
package.add("RemoveFromInstanceByCharID", &Perl__RemoveFromInstanceByCharID);
package.add("CheckInstanceByCharID", &Perl__CheckInstanceByCharID);
package.add("SendMail", &Perl__SendMail);
package.add("SetAutoLoginCharacterNameByAccountID", &Perl__SetAutoLoginCharacterNameByAccountID);
package.add("SetRunning", &Perl__SetRunning);
package.add("activespeakactivity", &Perl__activespeakactivity);
package.add("activespeaktask", &Perl__activespeaktask);
+20 -20
View File
@@ -146,25 +146,25 @@ uint64 Client::CalcEXP(uint8 consider_level, bool ignore_modifiers) {
if (RuleB(Character,UseXPConScaling)) {
if (consider_level != 0xFF) {
switch (consider_level) {
case ConsiderColor::Gray:
case CON_GRAY:
in_add_exp = 0;
return 0;
case ConsiderColor::Green:
case CON_GREEN:
in_add_exp = in_add_exp * RuleI(Character, GreenModifier) / 100;
break;
case ConsiderColor::LightBlue:
case CON_LIGHTBLUE:
in_add_exp = in_add_exp * RuleI(Character, LightBlueModifier) / 100;
break;
case ConsiderColor::DarkBlue:
case CON_BLUE:
in_add_exp = in_add_exp * RuleI(Character, BlueModifier) / 100;
break;
case ConsiderColor::White:
case CON_WHITE:
in_add_exp = in_add_exp * RuleI(Character, WhiteModifier) / 100;
break;
case ConsiderColor::Yellow:
case CON_YELLOW:
in_add_exp = in_add_exp * RuleI(Character, YellowModifier) / 100;
break;
case ConsiderColor::Red:
case CON_RED:
in_add_exp = in_add_exp * RuleI(Character, RedModifier) / 100;
break;
}
@@ -222,22 +222,22 @@ float static GetConLevelModifierPercent(uint8 conlevel)
{
switch (conlevel)
{
case ConsiderColor::Green:
case CON_GREEN:
return (float)RuleI(Character, GreenModifier) / 100;
break;
case ConsiderColor::LightBlue:
case CON_LIGHTBLUE:
return (float)RuleI(Character, LightBlueModifier) / 100;
break;
case ConsiderColor::DarkBlue:
case CON_BLUE:
return (float)RuleI(Character, BlueModifier) / 100;
break;
case ConsiderColor::White:
case CON_WHITE:
return (float)RuleI(Character, WhiteModifier) / 100;
break;
case ConsiderColor::Yellow:
case CON_YELLOW:
return (float)RuleI(Character, YellowModifier) / 100;
break;
case ConsiderColor::Red:
case CON_RED:
return (float)RuleI(Character, RedModifier) / 100;
break;
default:
@@ -249,7 +249,7 @@ void Client::CalculateNormalizedAAExp(uint64 &add_aaxp, uint8 conlevel, bool res
{
// Functionally this is the same as having the case in the switch, but this is
// cleaner to read.
if (ConsiderColor::Gray == conlevel || resexp)
if (CON_GRAY == conlevel || resexp)
{
add_aaxp = 0;
return;
@@ -325,7 +325,7 @@ void Client::CalculateStandardAAExp(uint64 &add_aaxp, uint8 conlevel, bool resex
void Client::CalculateLeadershipExp(uint64 &add_exp, uint8 conlevel)
{
if (IsLeadershipEXPOn() && (conlevel == ConsiderColor::DarkBlue || conlevel == ConsiderColor::White || conlevel == ConsiderColor::Yellow || conlevel == ConsiderColor::Red))
if (IsLeadershipEXPOn() && (conlevel == CON_BLUE || conlevel == CON_WHITE || conlevel == CON_YELLOW || conlevel == CON_RED))
{
add_exp = static_cast<uint64>(static_cast<float>(add_exp) * 0.8f);
@@ -627,7 +627,7 @@ void Client::SetEXP(uint64 set_exp, uint64 set_aaxp, bool isrezzexp) {
if (membercount > 1) {
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());
} else if (zone->IsHotzone()) {
} else if (zone->IsHotzone()) {
Message(Chat::Experience, "You gain party experience (with a bonus)!");
} else {
MessageString(Chat::Experience, GAIN_GROUPXP);
@@ -635,7 +635,7 @@ void Client::SetEXP(uint64 set_exp, uint64 set_aaxp, bool isrezzexp) {
} else if (IsRaidGrouped()) {
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());
} else if (zone->IsHotzone()) {
} else if (zone->IsHotzone()) {
Message(Chat::Experience, "You gained raid experience (with a bonus)!");
} else {
MessageString(Chat::Experience, GAIN_RAIDEXP);
@@ -643,7 +643,7 @@ void Client::SetEXP(uint64 set_exp, uint64 set_aaxp, bool isrezzexp) {
} else {
if (RuleI(Character, ShowExpValues) > 0) {
Message(Chat::Experience, "You have gained %s experience! %s", exp_amount_message.c_str(), exp_percent_message.c_str());
} else if (zone->IsHotzone()) {
} else if (zone->IsHotzone()) {
Message(Chat::Experience, "You gain experience (with a bonus)!");
} else {
MessageString(Chat::Experience, GAIN_XP);
@@ -1158,7 +1158,7 @@ void Group::SplitExp(const uint64 exp, Mob* other) {
}
const uint8 consider_level = Mob::GetLevelCon(highest_level, other->GetLevel());
if (consider_level == ConsiderColor::Gray) {
if (consider_level == CON_GRAY) {
return;
}
@@ -1204,7 +1204,7 @@ void Raid::SplitExp(const uint64 exp, Mob* other) {
raid_experience = static_cast<uint64>(static_cast<float>(raid_experience) * RuleR(Character, FinalRaidExpMultiplier));
const auto consider_level = Mob::GetLevelCon(highest_level, other->GetLevel());
if (consider_level == ConsiderColor::Gray) {
if (consider_level == CON_GRAY) {
return;
}
+6 -6
View File
@@ -71,7 +71,7 @@ void Mob::CheckFlee()
}
// If no special flee_percent check for Gray or Other con rates
if (GetLevelCon(hate_top->GetLevel(), GetLevel()) == ConsiderColor::Gray && flee_ratio == 0 && RuleB(Combat, FleeGray) &&
if (GetLevelCon(hate_top->GetLevel(), GetLevel()) == CON_GRAY && flee_ratio == 0 && RuleB(Combat, FleeGray) &&
GetLevel() <= RuleI(Combat, FleeGrayMaxLevel)) {
flee_ratio = RuleI(Combat, FleeGrayHPRatio);
LogFlee("Mob [{}] using combat flee gray hp_ratio [{}] flee_ratio [{}]", GetCleanName(), hp_ratio, flee_ratio);
@@ -110,16 +110,16 @@ void Mob::CheckFlee()
int flee_chance;
switch (con) {
//these values are not 100% researched
case ConsiderColor::Gray:
case CON_GRAY:
flee_chance = 100;
break;
case ConsiderColor::Green:
case CON_GREEN:
flee_chance = 90;
break;
case ConsiderColor::LightBlue:
case CON_LIGHTBLUE:
flee_chance = 90;
break;
case ConsiderColor::DarkBlue:
case CON_BLUE:
flee_chance = 80;
break;
default:
@@ -175,7 +175,7 @@ void Mob::ProcessFlee()
Mob *hate_top = GetHateTop();
// If no special flee_percent check for Gray or Other con rates
if(hate_top != nullptr && GetLevelCon(hate_top->GetLevel(), GetLevel()) == ConsiderColor::Gray && fleeratio == 0 && RuleB(Combat, FleeGray)) {
if(hate_top != nullptr && GetLevelCon(hate_top->GetLevel(), GetLevel()) == CON_GRAY && fleeratio == 0 && RuleB(Combat, FleeGray)) {
fleeratio = RuleI(Combat, FleeGrayHPRatio);
} else if(fleeratio == 0) {
fleeratio = RuleI(Combat, FleeHPRatio );
-2
View File
@@ -5,7 +5,6 @@
#include "set/alternate_currency.cpp"
#include "set/animation.cpp"
#include "set/anon.cpp"
#include "set/auto_login.cpp"
#include "set/bind_point.cpp"
#include "set/checksum.cpp"
#include "set/class_permanent.cpp"
@@ -72,7 +71,6 @@ void command_set(Client *c, const Seperator *sep)
Cmd{.cmd = "alternate_currency", .u = "alternate_currency [Currency ID] [Amount]", .fn = SetAlternateCurrency, .a = {"#setaltcurrency"}},
Cmd{.cmd = "animation", .u = "animation [Animation ID]", .fn = SetAnimation, .a = {"#setanim"}},
Cmd{.cmd = "anon", .u = "anon [Character ID] [Anonymous Flag] or #set anon [Anonymous Flag]", .fn = SetAnon, .a = {"#setanon"}},
Cmd{.cmd = "auto_login", .u = "auto_login [0|1]", .fn = SetAutoLogin, .a = {"#setautologin"}},
Cmd{.cmd = "bind_point", .u = "bind_point", .fn = SetBindPoint, .a = {"#setbind"}},
Cmd{.cmd = "checksum", .u = "checksum", .fn = SetChecksum, .a = {"#updatechecksum"}},
Cmd{.cmd = "class_permanent", .u = "class_permanent [Class ID]", .fn = SetClassPermanent, .a = {"#permaclass"}},
-54
View File
@@ -1,54 +0,0 @@
#include "../../client.h"
#include "../../groups.h"
#include "../../raids.h"
#include "../../raids.h"
#include "../../common/repositories/account_repository.h"
void SetAutoLogin(Client* c, const Seperator* sep)
{
if (!RuleB(World, EnableAutoLogin)) {
c->Message(Chat::White, "Auto login is disabled.");
return;
}
const uint16 arguments = sep->argnum;
if (arguments < 2 || !sep->IsNumber(2)) {
c->Message(Chat::White, "Usage: #set auto_login [0|1]");
c->Message(Chat::White, "0 = Disable auto login for your account");
c->Message(Chat::White, "1 = Set auto login character to your current character");
return;
}
Client* t = c;
if (c->GetGM() && c->GetTarget() && c->GetTarget()->IsClient()) {
t = c->GetTarget()->CastToClient();
}
auto e = AccountRepository::FindOne(database, t->AccountID());
if (!e.id) {
c->Message(
Chat::White,
fmt::format(
"Failed to find an account entry for {}.",
c->GetTargetDescription(t)
).c_str()
);
return;
}
const bool set_login = Strings::ToBool(sep->arg[2]);
e.auto_login_charname = set_login ? t->GetCleanName() : std::string();
AccountRepository::UpdateOne(database, e);
c->Message(
Chat::White,
fmt::format(
"Auto login character has been set to '{}' for {}.",
e.auto_login_charname,
c->GetTargetDescription(t)
).c_str()
);
}
-2
View File
@@ -2,7 +2,6 @@
#include "show/aas.cpp"
#include "show/aa_points.cpp"
#include "show/aggro.cpp"
#include "show/auto_login.cpp"
#include "show/buffs.cpp"
#include "show/buried_corpse_count.cpp"
#include "show/client_version_summary.cpp"
@@ -63,7 +62,6 @@ void command_show(Client *c, const Seperator *sep)
Cmd{.cmd = "aas", .u = "aas", .fn = ShowAAs, .a = {"#showaas"}},
Cmd{.cmd = "aa_points", .u = "aa_points", .fn = ShowAAPoints, .a = {"#showaapoints", "#showaapts"}},
Cmd{.cmd = "aggro", .u = "aggro [Distance] [-v] (-v is verbose Faction Information)", .fn = ShowAggro, .a = {"#aggro"}},
Cmd{.cmd = "auto_login", .u = "auto_login", .fn = ShowAutoLogin, .a = {"#showautologin"}},
Cmd{.cmd = "buffs", .u = "buffs", .fn = ShowBuffs, .a = {"#showbuffs"}},
Cmd{.cmd = "buried_corpse_count", .u = "buried_corpse_count", .fn = ShowBuriedCorpseCount, .a = {"#getplayerburiedcorpsecount"}},
Cmd{.cmd = "client_version_summary", .u = "client_version_summary", .fn = ShowClientVersionSummary, .a = {"#cvs"}},
-37
View File
@@ -1,37 +0,0 @@
#include "../../client.h"
#include "../../common/repositories/account_repository.h"
void ShowAutoLogin(Client* c, const Seperator* sep)
{
if (!RuleB(World, EnableAutoLogin)) {
c->Message(Chat::White, "Auto login is disabled.");
return;
}
Client* t = c;
if (c->GetGM() && c->GetTarget() && c->GetTarget()->IsClient()) {
t = c->GetTarget()->CastToClient();
}
const auto& e = AccountRepository::FindOne(database, t->AccountID());
if (!e.id) {
c->Message(
Chat::White,
fmt::format(
"Failed to find an account entry for {}.",
c->GetTargetDescription(t)
).c_str()
);
return;
}
c->Message(
Chat::White,
fmt::format(
"Auto login character for {} is set to '{}'.",
c->GetTargetDescription(t),
e.auto_login_charname
).c_str()
);
}
+3
View File
@@ -793,6 +793,7 @@ bool Group::DelMember(Mob* oldmember, bool ignoresender)
return true;
}
// does the caster + group
void Group::CastGroupSpell(Mob* caster, uint16 spell_id) {
uint32 z;
float range, distance;
@@ -806,6 +807,8 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) {
float range2 = range*range;
float min_range2 = spells[spell_id].min_range * spells[spell_id].min_range;
// caster->SpellOnTarget(spell_id, caster);
for(z=0; z < MAX_GROUP_MEMBERS; z++)
{
if(members[z] == caster) {
+33 -1
View File
@@ -601,7 +601,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
inst->SetOrnamentHeroModel(ornament_hero_model);
// check to see if item is usable in requested slot
if (enforce_usable && (to_slot >= EQ::invslot::EQUIPMENT_BEGIN && to_slot <= EQ::invslot::EQUIPMENT_END)) {
if (enforce_usable && to_slot != EQ::invslot::SLOT_QUEST && (to_slot >= EQ::invslot::EQUIPMENT_BEGIN && to_slot <= EQ::invslot::EQUIPMENT_END)) {
uint32 slottest = to_slot;
if(!(slots & ((uint32)1 << slottest))) {
Message(
@@ -648,6 +648,34 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2,
RecordPlayerEventLog(PlayerEvent::ITEM_CREATION, e);
}
//We're coming from a quest method.
if (to_slot == EQ::invslot::SLOT_QUEST) {
bool stacking = TryStacking(inst);
if (stacking) {
safe_delete(inst);
return true;
}
else {
bool bag = false;
if (inst->IsClassBag()) {
bag = true;
}
to_slot = m_inv.FindFreeSlot(bag, true, item->Size);
//make sure we are not completely full...
if (to_slot == EQ::invslot::slotCursor || to_slot == INVALID_INDEX) {
if (inst->GetItem()->NoDrop == 0) {
//If it's no drop, force it to the cursor. This carries the risk of deletion if the player already has this item on their cursor
// or if the cursor queue is full. But in this situation, we have little other recourse.
PushItemOnCursor(*inst);
LogInventory("{} has a full inventory and {} is a no drop item. Forcing to cursor", GetName(), inst->GetItem()->Name);
safe_delete(inst);
}
}
}
}
// put item into inventory
if (to_slot == EQ::invslot::slotCursor) {
@@ -2258,6 +2286,10 @@ bool Client::SwapItem(MoveItem_Struct* move_in) {
if (dst_slot_id <= EQ::invslot::EQUIPMENT_END) {// on Titanium and ROF2 /showhelm works even if sending helm slot
SendWearChange(matslot);
}
// This is part of a bug fix to ensure heroforge graphics display to other clients in zone.
if (queue_wearchange_slot >= 0) {
heroforge_wearchange_timer.Start(100);
}
// Step 7: Save change to the database
if (src_slot_id == EQ::invslot::slotCursor) {
+380 -42
View File
@@ -22,7 +22,7 @@ void NPC::AddLootTable(uint32 loottable_id, bool is_global)
if (!npctype_id) {
return;
}
if (!is_global) {
m_loot_copper = 0;
m_loot_silver = 0;
@@ -145,30 +145,11 @@ void NPC::AddLootDropTable(uint32 lootdrop_id, uint8 drop_limit, uint8 min_drop)
"-- NPC [{}] Lootdrop [{}] Item [{}] ({}_ Chance [{}] Multiplier [{}]",
GetCleanName(),
lootdrop_id,
database.GetItem(e.item_id) ? database.GetItem(e.item_id)->Name : "Unknown",
database.GetItem(e.item_id)->Name,
e.item_id,
e.chance,
e.multiplier
);
if (!content_service.DoesPassContentFiltering(
ContentFlags{
.min_expansion = e.min_expansion,
.max_expansion = e.max_expansion,
.content_flags = e.content_flags,
.content_flags_disabled = e.content_flags_disabled
}
)) {
LogLoot(
"-- NPC [{}] Lootdrop [{}] Item [{}] ({}) does not pass content filtering",
GetCleanName(),
lootdrop_id,
e.item_id,
database.GetItem(e.item_id) ? database.GetItem(e.item_id)->Name : "Unknown"
);
continue;
}
for (int j = 0; j < e.multiplier; ++j) {
if (zone->random.Real(0.0, 100.0) <= e.chance && MeetsLootDropLevelRequirements(e, true)) {
const EQ::ItemData *database_item = database.GetItem(e.item_id);
@@ -234,24 +215,6 @@ void NPC::AddLootDropTable(uint32 lootdrop_id, uint8 drop_limit, uint8 min_drop)
if (drops < min_drop || roll_table_chance_bypass || (float) zone->random.Real(0.0, 1.0) >= no_loot_prob) {
float roll = (float) zone->random.Real(0.0, roll_t);
for (const auto &e: le) {
if (!content_service.DoesPassContentFiltering(
ContentFlags{
.min_expansion = e.min_expansion,
.max_expansion = e.max_expansion,
.content_flags = e.content_flags,
.content_flags_disabled = e.content_flags_disabled
}
)) {
LogLoot(
"-- NPC [{}] Lootdrop [{}] Item [{}] ({}) does not pass content filtering",
GetCleanName(),
lootdrop_id,
e.item_id,
database.GetItem(e.item_id) ? database.GetItem(e.item_id)->Name : "Unknown"
);
continue;
}
const auto *db_item = database.GetItem(e.item_id);
if (db_item) {
// if it doesn't meet the requirements do nothing
@@ -322,6 +285,8 @@ void NPC::AddLootDrop(
const EQ::ItemData *item2,
LootdropEntriesRepository::LootdropEntries loot_drop,
bool wear_change,
bool quest,
bool pet,
uint32 augment_one,
uint32 augment_two,
uint32 augment_three,
@@ -334,6 +299,10 @@ void NPC::AddLootDrop(
return;
}
if (CountQuestItems() >= MAX_NPC_QUEST_INVENTORY) {
return;
}
auto item = new LootItem;
if (LogSys.log_settings[Logs::Loot].is_category_enabled == 1) {
@@ -355,6 +324,10 @@ void NPC::AddLootDrop(
);
}
if (quest || pet) {
LogLoot("Adding {} to npc: {}. Wearchange: {} Multiquest: {} Pet: {}", item2->Name, GetName(), wear_change, quest, pet);
}
EQApplicationPacket *outapp = nullptr;
WearChange_Struct *p_wear_change_struct = nullptr;
if (wear_change) {
@@ -376,6 +349,8 @@ void NPC::AddLootDrop(
item->trivial_min_level = loot_drop.trivial_min_level;
item->trivial_max_level = loot_drop.trivial_max_level;
item->equip_slot = EQ::invslot::SLOT_INVALID;
item->quest = quest;
item->pet = pet;
// unsure if required to equip, YOLO for now
if (item2->ItemType == EQ::item::ItemTypeBow) {
@@ -386,6 +361,11 @@ void NPC::AddLootDrop(
SetArrowEquipped(true);
}
if (pet && quest) {
LogLoot("Error: Item {} is being added to {} as both a pet and a quest.", item2->Name, GetName());
item->pet = 0;
}
bool found = false; // track if we found an empty slot we fit into
int found_slot = INVALID_INDEX; // for multi-slot items
@@ -578,20 +558,21 @@ void NPC::AddLootDrop(
safe_delete(inst);
}
void NPC::AddItem(const EQ::ItemData *item, uint16 charges, bool equip_item)
void NPC::AddItem(const EQ::ItemData *item, uint16 charges, bool equip_item, bool quest)
{
auto l = LootdropEntriesRepository::NewNpcEntity();
l.equip_item = static_cast<uint8>(equip_item ? 1 : 0);
l.item_charges = charges;
AddLootDrop(item, l, true);
AddLootDrop(item, l, equip_item, quest);
}
void NPC::AddItem(
uint32 item_id,
uint16 charges,
bool equip_item,
bool quest,
uint32 augment_one,
uint32 augment_two,
uint32 augment_three,
@@ -613,7 +594,8 @@ void NPC::AddItem(
AddLootDrop(
item,
l,
true,
equip_item,
quest,
augment_one,
augment_two,
augment_three,
@@ -732,6 +714,50 @@ LootItem *NPC::GetItem(int slot_id)
return (nullptr);
}
LootItem *NPC::GetItemByItemID(int16 item_id)
{
LootItems::iterator cur, end;
cur = m_loot_items.begin();
end = m_loot_items.end();
for (; cur != end; ++cur) {
LootItem *item = *cur;
if (item->item_id == item_id) {
return item;
}
}
return(nullptr);
}
void NPC::RemoveItem(LootItem *item_data, uint8 quantity) {
if (!item_data) {
return;
}
LootItems::iterator cur, end;
cur = m_loot_items.begin();
end = m_loot_items.end();
for (; cur != end; ++cur) {
LootItem *item = *cur;
if (item != item_data) { continue; }
if (!item) {
return;
}
if (item->charges <= quantity) {
m_loot_items.erase(cur);
UpdateEquipmentLight();
if (UpdateActiveLight()) { SendAppearancePacket(AppearanceType::Light, GetActiveLightType()); }
}
else {
item->charges -= quantity;
}
return;
}
}
void NPC::RemoveItem(uint32 item_id, uint16 quantity, uint16 slot)
{
LootItems::iterator cur, end;
@@ -978,3 +1004,315 @@ void NPC::RemoveLootCash()
m_loot_gold = 0;
m_loot_platinum = 0;
}
bool NPC::HasQuestLootItem(int16 itemid)
{
LootItems::iterator cur, end;
cur = m_loot_items.begin();
end = m_loot_items.end();
for (; cur != end; ++cur) {
LootItem *quest_item = *cur;
if (quest_item && quest_item->quest == 1 && quest_item->item_id == itemid) {
return true;
}
}
return false;
}
bool NPC::HasQuestLoot()
{
LootItems::iterator cur, end;
cur = m_loot_items.begin();
end = m_loot_items.end();
for (; cur != end; ++cur) {
LootItem *quest_loot = *cur;
if (quest_loot && quest_loot->quest == 1) {
return true;
}
}
return false;
}
bool NPC::RemoveQuestLootItems(int16 itemid)
{
LootItems::iterator cur, end;
cur = m_loot_items.begin();
end = m_loot_items.end();
for (; cur != end; ++cur) {
LootItem *quest_item = *cur;
if (quest_item && quest_item->quest == 1) {
if (itemid == 0 || itemid == quest_item->item_id) {
RemoveItem(quest_item);
return true;
}
}
}
return false;
}
bool NPC::HasRequiredQuestLoot(int16 itemid1, int16 itemid2, int16 itemid3, int16 itemid4)
{
if (itemid2 == 0 && itemid3 == 0 && itemid4 == 0) {
return true;
}
uint8 item2count = 0, item3count = 0, item4count = 0, item1npc = 0, item2npc = 0, item3npc = 0, item4npc = 0;
uint8 item1count = 1;
if (itemid2 > 0) {
item2count = 1;
}
if (itemid3 > 0) {
item3count = 1;
}
if (itemid4 > 0) {
item4count = 1;
}
if (itemid1 == itemid2 && itemid2 > 0) {
item2count = item1count;
++item1count;
++item2count;
}
if (itemid1 == itemid3 && itemid3 > 0) {
item3count = item1count;
++item1count;
++item3count;
}
if (itemid1 == itemid4 && itemid4 > 0) {
item4count = item1count;
++item1count;
++item4count;
}
if (itemid2 == itemid3 && itemid2 > 0 && itemid3 > 0) {
item3count = item2count;
++item2count;
++item3count;
}
if (itemid2 == itemid4 && itemid2 > 0 && itemid4 > 0) {
item4count = item2count;
++item2count;
++item4count;
}
if (itemid3 == itemid4 && itemid3 > 0 && itemid4 > 0) {
item4count = item3count;
++item3count;
++item4count;
}
LootItems::iterator cur, end;
cur = m_loot_items.begin();
end = m_loot_items.end();
for (; cur != end; ++cur) {
LootItem *sitem = *cur;
if (sitem && sitem->quest == 1) {
if (sitem->item_id == itemid1) {
++item1npc;
}
if (sitem->item_id == itemid2 && itemid2 > 0) {
++item2npc;
}
if (sitem->item_id == itemid3 && itemid3 > 0) {
++item3npc;
}
if (sitem->item_id == itemid4 && itemid4 > 0) {
++item4npc;
}
}
}
if (item1npc < item1count) {
return false;
}
if (itemid2 > 0 && item2npc < item2count) {
return false;
}
if (itemid3 > 0 && item3npc < item3count) {
return false;
}
if (itemid4 > 0 && item4npc < item4count) {
return false;
}
return true;
}
void NPC::CleanQuestLootItems()
{
//Removes nodrop or multiple quest loot items from a NPC before sending the corpse items to the client.
LootItems::iterator cur, end;
cur = m_loot_items.begin();
end = m_loot_items.end();
uint8 count = 0;
for (; cur != end; ++cur) {
LootItem *quest_item = *cur;
if (quest_item && (quest_item->quest == 1 || quest_item->pet == 1)) {
uint8 count = CountQuestItem(quest_item->item_id);
if (count > 1 && quest_item->pet != 1) {
RemoveItem(quest_item);
return;
}
else {
const EQ::ItemData *item = database.GetItem(quest_item->item_id);
if (item && item->NoDrop == 0) {
RemoveItem(quest_item);
return;
}
}
}
}
}
uint8 NPC::CountQuestItem(uint16 itemid)
{
LootItems::iterator cur, end;
cur = m_loot_items.begin();
end = m_loot_items.end();
uint8 count = 0;
for (; cur != end; ++cur) {
LootItem *quest_item = *cur;
if (quest_item && quest_item->item_id == itemid) {
++count;
}
}
return count;
}
uint8 NPC::CountQuestItems()
{
LootItems::iterator cur, end;
cur = m_loot_items.begin();
end = m_loot_items.end();
uint8 count = 0;
for (; cur != end; ++cur) {
LootItem *quest_item = *cur;
if (quest_item && quest_item->quest == 1) {
++count;
}
}
return count;
}
bool NPC::AddQuestLoot(int16 itemid, int8 charges) {
auto l = LootdropEntriesRepository::NewNpcEntity();
const EQ::ItemData *item = database.GetItem(itemid);
if (item) {
l.item_charges = charges;
l.equip_item = 0;
AddLootDrop(item, l, false, false, true);
LogLoot("Adding item {} to the NPC's loot marked as quest.", itemid);
if (itemid > 0 && HasPetLootItem(itemid)) {
LogLoot("Deleting quest item {} from NPC's pet loot.", itemid);
RemovePetLootItems(itemid);
}
}
else
return false;
return true;
}
void NPC::DeleteQuestLoot(int16 itemid1, int16 itemid2, int16 itemid3, int16 itemid4)
{
int16 items = m_loot_items.size();
for (int i = 0; i < items; ++i) {
if (itemid1 == 0) {
if (!RemoveQuestLootItems(itemid1))
break;
}
else {
if (itemid1 != 0) {
RemoveQuestLootItems(itemid1);
}
if (itemid2 != 0) {
RemoveQuestLootItems(itemid2);
}
if (itemid3 != 0) {
RemoveQuestLootItems(itemid3);
}
if (itemid4 != 0) {
RemoveQuestLootItems(itemid4);
}
}
}
}
void NPC::DeleteInvalidQuestLoot()
{
int16 items = m_loot_items.size();
for (int i = 0; i < items; ++i) {
CleanQuestLootItems();
}
}
bool NPC::AddPetLoot(int16 itemid, int8 charges, bool fromquest) {
auto l = LootdropEntriesRepository::NewNpcEntity();
const EQ::ItemData *item = database.GetItem(itemid);
bool IsCharmedPet = IsPet() && IsCharmed();
if (!item) {
return false;
}
bool valid = (item->NoDrop != 0 && ( !IsCharmedPet || (IsCharmedPet && CountQuestItem(item->ID) == 0)));
if (!fromquest || valid) {
if (item) {
l.item_charges = charges;
AddLootDrop(item, l, true, true, false, true);
LogLoot("Adding item {} to the NPC's loot marked as pet.", itemid);
return true;
}
}
else {
LogLoot("Item {} is a duplicate or no drop. Deleting...", itemid);
return false;
}
return false;
}
bool NPC::HasPetLootItem(int16 itemid)
{
LootItems::iterator cur, end;
cur = m_loot_items.begin();
end = m_loot_items.end();
for (; cur != end; ++cur) {
LootItem *quest_item = *cur;
if (quest_item && quest_item->pet == 1 && quest_item->item_id == itemid) {
return true;
}
}
return false;
}
bool NPC::RemovePetLootItems(int16 itemid)
{
LootItems::iterator cur, end;
cur = m_loot_items.begin();
end = m_loot_items.end();
for (; cur != end; ++cur) {
LootItem *quest_item = *cur;
if (quest_item && quest_item->pet == 1) {
if (itemid == 0 || itemid == quest_item->item_id) {
RemoveItem(quest_item);
return true;
}
}
}
return false;
}
+12 -27
View File
@@ -955,14 +955,19 @@ void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug
self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5);
}
void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned) {
void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6) {
Lua_Safe_Call_Void();
self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attuned);
self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, aug6);
}
void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, bool attuned, int to_slot) {
void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, bool attuned) {
Lua_Safe_Call_Void();
self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, 0, attuned, to_slot);
self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, aug6, 0, attuned);
}
void Lua_Client::SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6, bool attuned, int to_slot) {
Lua_Safe_Call_Void();
self->SummonItem(item_id, charges, aug1, aug2, aug3, aug4, aug5, aug6, 0, attuned, to_slot);
}
void Lua_Client::SetStats(int type, int value) {
@@ -3345,24 +3350,6 @@ luabind::object Lua_Client::GetRaidOrGroupOrSelf(lua_State* L, bool clients_only
return t;
}
std::string Lua_Client::GetAutoLoginCharacterName()
{
Lua_Safe_Call_String();
return quest_manager.GetAutoLoginCharacterNameByAccountID(self->AccountID());
}
bool Lua_Client::SetAutoLoginCharacterName()
{
Lua_Safe_Call_Bool();
return quest_manager.SetAutoLoginCharacterNameByAccountID(self->AccountID(), self->GetCleanName());
}
bool Lua_Client::SetAutoLoginCharacterName(std::string character_name)
{
Lua_Safe_Call_Bool();
return quest_manager.SetAutoLoginCharacterNameByAccountID(self->AccountID(), character_name);
}
luabind::scope lua_register_client() {
return luabind::class_<Lua_Client, Lua_Mob>("Client")
.def(luabind::constructor<>())
@@ -3499,7 +3486,6 @@ luabind::scope lua_register_client() {
.def("GetAnon", (int(Lua_Client::*)(void))&Lua_Client::GetAnon)
.def("GetAugmentIDAt", (int(Lua_Client::*)(int,int))&Lua_Client::GetAugmentIDAt)
.def("GetAugmentIDsBySlotID", (luabind::object(Lua_Client::*)(lua_State* L,int16))&Lua_Client::GetAugmentIDsBySlotID)
.def("GetAutoLoginCharacterName", (std::string(Lua_Client::*)(void))&Lua_Client::GetAutoLoginCharacterName)
.def("GetBaseAGI", (int(Lua_Client::*)(void))&Lua_Client::GetBaseAGI)
.def("GetBaseCHA", (int(Lua_Client::*)(void))&Lua_Client::GetBaseCHA)
.def("GetBaseDEX", (int(Lua_Client::*)(void))&Lua_Client::GetBaseDEX)
@@ -3793,8 +3779,6 @@ luabind::scope lua_register_client() {
.def("SetAccountFlag", (void(Lua_Client::*)(const std::string&,const std::string&))&Lua_Client::SetAccountFlag)
.def("SetAlternateCurrencyValue", (void(Lua_Client::*)(uint32,uint32))&Lua_Client::SetAlternateCurrencyValue)
.def("SetAnon", (void(Lua_Client::*)(uint8))&Lua_Client::SetAnon)
.def("SetAutoLoginCharacterName", (bool(Lua_Client::*)(void))&Lua_Client::SetAutoLoginCharacterName)
.def("SetAutoLoginCharacterName", (bool(Lua_Client::*)(std::string))&Lua_Client::SetAutoLoginCharacterName)
.def("SetBaseClass", (void(Lua_Client::*)(int))&Lua_Client::SetBaseClass)
.def("SetBaseGender", (void(Lua_Client::*)(int))&Lua_Client::SetBaseGender)
.def("SetBaseRace", (void(Lua_Client::*)(int))&Lua_Client::SetBaseRace)
@@ -3884,8 +3868,9 @@ luabind::scope lua_register_client() {
.def("SummonItem", (void(Lua_Client::*)(uint32,int,uint32,uint32,uint32))&Lua_Client::SummonItem)
.def("SummonItem", (void(Lua_Client::*)(uint32,int,uint32,uint32,uint32,uint32))&Lua_Client::SummonItem)
.def("SummonItem", (void(Lua_Client::*)(uint32,int,uint32,uint32,uint32,uint32,uint32))&Lua_Client::SummonItem)
.def("SummonItem", (void(Lua_Client::*)(uint32,int,uint32,uint32,uint32,uint32,uint32,bool))&Lua_Client::SummonItem)
.def("SummonItem", (void(Lua_Client::*)(uint32,int,uint32,uint32,uint32,uint32,uint32,bool,int))&Lua_Client::SummonItem)
.def("SummonItem", (void(Lua_Client::*)(uint32,int,uint32,uint32,uint32,uint32,uint32,uint32))&Lua_Client::SummonItem)
.def("SummonItem", (void(Lua_Client::*)(uint32,int,uint32,uint32,uint32,uint32,uint32,uint32,bool))&Lua_Client::SummonItem)
.def("SummonItem", (void(Lua_Client::*)(uint32,int,uint32,uint32,uint32,uint32,uint32,uint32,bool,int))&Lua_Client::SummonItem)
.def("SummonItemIntoInventory", (void(Lua_Client::*)(luabind::adl::object))&Lua_Client::SummonItemIntoInventory)
.def("TGB", (bool(Lua_Client::*)(void))&Lua_Client::TGB)
.def("TakeMoneyFromPP", (bool(Lua_Client::*)(uint64))&Lua_Client::TakeMoneyFromPP)
+3 -5
View File
@@ -251,9 +251,10 @@ public:
void SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3);
void SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4);
void SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5);
void SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5,
void SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6);
void SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6,
bool attuned);
void SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5,
void SummonItem(uint32 item_id, int charges, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5, uint32 aug6,
bool attuned, int to_slot);
void SummonBaggedItems(uint32 bag_item_id, luabind::adl::object bag_items_table);
void SetStats(int type, int value);
@@ -499,9 +500,6 @@ public:
bool IsInAGuild();
luabind::object GetRaidOrGroupOrSelf(lua_State* L);
luabind::object GetRaidOrGroupOrSelf(lua_State* L, bool clients_only);
std::string GetAutoLoginCharacterName();
bool SetAutoLoginCharacterName();
bool SetAutoLoginCharacterName(std::string character_name);
void ApplySpell(int spell_id);
void ApplySpell(int spell_id, int duration);
-10
View File
@@ -5488,14 +5488,6 @@ uint16 lua_get_race_bitmask(uint16 race_id) {
return GetPlayerRaceBit(race_id);
}
std::string lua_get_auto_login_character_name_by_account_id(uint32 account_id) {
return quest_manager.GetAutoLoginCharacterNameByAccountID(account_id);
}
bool lua_set_auto_login_character_name_by_account_id(uint32 account_id, std::string character_name) {
return quest_manager.SetAutoLoginCharacterNameByAccountID(account_id, character_name);
}
#define LuaCreateNPCParse(name, c_type, default_value) do { \
cur = table[#name]; \
if(luabind::type(cur) != LUA_TNIL) { \
@@ -6295,8 +6287,6 @@ luabind::scope lua_register_general() {
luabind::def("get_class_bitmask", &lua_get_class_bitmask),
luabind::def("get_deity_bitmask", &lua_get_deity_bitmask),
luabind::def("get_race_bitmask", &lua_get_race_bitmask),
luabind::def("get_auto_login_character_name_by_account_id", &lua_get_auto_login_character_name_by_account_id),
luabind::def("set_auto_login_character_name_by_account_id", &lua_set_auto_login_character_name_by_account_id),
/*
Cross Zone
*/
-14
View File
@@ -3357,18 +3357,6 @@ bool Lua_Mob::IsWisdomCasterClass()
return self->IsWisdomCasterClass();
}
std::string Lua_Mob::GetConsiderColor(Lua_Mob other)
{
Lua_Safe_Call_String();
return EQ::constants::GetConsiderColorName(self->GetLevelCon(other.GetLevel()));
}
std::string Lua_Mob::GetConsiderColor(uint8 other_level)
{
Lua_Safe_Call_String();
return EQ::constants::GetConsiderColorName(self->GetLevelCon(other_level));
}
luabind::scope lua_register_mob() {
return luabind::class_<Lua_Mob, Lua_Entity>("Mob")
.def(luabind::constructor<>())
@@ -3588,8 +3576,6 @@ luabind::scope lua_register_mob() {
.def("GetCloseMobList", (Lua_Mob_List(Lua_Mob::*)(void))&Lua_Mob::GetCloseMobList)
.def("GetCloseMobList", (Lua_Mob_List(Lua_Mob::*)(float))&Lua_Mob::GetCloseMobList)
.def("GetCloseMobList", (Lua_Mob_List(Lua_Mob::*)(float,bool))&Lua_Mob::GetCloseMobList)
.def("GetConsiderColor", (std::string(Lua_Mob::*)(Lua_Mob))&Lua_Mob::GetConsiderColor)
.def("GetConsiderColor", (std::string(Lua_Mob::*)(uint8))&Lua_Mob::GetConsiderColor)
.def("GetCorruption", &Lua_Mob::GetCorruption)
.def("GetDEX", &Lua_Mob::GetDEX)
.def("GetDR", &Lua_Mob::GetDR)
-2
View File
@@ -590,8 +590,6 @@ public:
bool IsIntelligenceCasterClass();
bool IsPureMeleeClass();
bool IsWisdomCasterClass();
std::string GetConsiderColor(Lua_Mob other);
std::string GetConsiderColor(uint8 other_level);
};
#endif
-2
View File
@@ -38,8 +38,6 @@ void LuaMod::Init()
m_has_common_outgoing_hit_success = parser_->HasFunction("CommonOutgoingHitSuccess", package_name_);
m_has_calc_spell_effect_value_formula = parser_->HasFunction("CalcSpellEffectValue_formula", package_name_);
m_has_register_bug = parser_->HasFunction("RegisterBug", package_name_);
m_has_common_damage = parser_->HasFunction("CommonDamage", package_name_);
m_has_heal_damage = parser_->HasFunction("HealDamage", package_name_);
}
void PutDamageHitInfo(lua_State *L, luabind::adl::object &e, DamageHitInfo &hit) {
+129 -18
View File
@@ -32,34 +32,39 @@ void Lua_NPC::AddItem(int item_id, int charges, bool equip) {
self->AddItem(item_id, charges, equip);
}
void Lua_NPC::AddItem(int item_id, int charges, bool equip, int aug1) {
void Lua_NPC::AddItem(int item_id, int charges, bool equip, bool quest) {
Lua_Safe_Call_Void();
self->AddItem(item_id, charges, equip, aug1);
self->AddItem(item_id, charges, equip, quest);
}
void Lua_NPC::AddItem(int item_id, int charges, bool equip, int aug1, int aug2) {
void Lua_NPC::AddItem(int item_id, int charges, bool equip, bool quest, int aug1) {
Lua_Safe_Call_Void();
self->AddItem(item_id, charges, equip, aug1, aug2);
self->AddItem(item_id, charges, equip, quest, aug1);
}
void Lua_NPC::AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3) {
void Lua_NPC::AddItem(int item_id, int charges, bool equip, bool quest, int aug1, int aug2) {
Lua_Safe_Call_Void();
self->AddItem(item_id, charges, equip, aug1, aug2, aug3);
self->AddItem(item_id, charges, equip, quest, aug1, aug2);
}
void Lua_NPC::AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3, int aug4) {
void Lua_NPC::AddItem(int item_id, int charges, bool equip, bool quest, int aug1, int aug2, int aug3) {
Lua_Safe_Call_Void();
self->AddItem(item_id, charges, equip, aug1, aug2, aug3, aug4);
self->AddItem(item_id, charges, equip, quest, aug1, aug2, aug3);
}
void Lua_NPC::AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3, int aug4, int aug5) {
void Lua_NPC::AddItem(int item_id, int charges, bool equip, bool quest, int aug1, int aug2, int aug3, int aug4) {
Lua_Safe_Call_Void();
self->AddItem(item_id, charges, equip, aug1, aug2, aug3, aug4, aug5);
self->AddItem(item_id, charges, equip, quest, aug1, aug2, aug3, aug4);
}
void Lua_NPC::AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3, int aug4, int aug5, int aug6) {
void Lua_NPC::AddItem(int item_id, int charges, bool equip, bool quest, int aug1, int aug2, int aug3, int aug4, int aug5) {
Lua_Safe_Call_Void();
self->AddItem(item_id, charges, equip, aug1, aug2, aug3, aug4, aug5, aug6);
self->AddItem(item_id, charges, equip, quest, aug1, aug2, aug3, aug4, aug5);
}
void Lua_NPC::AddItem(int item_id, int charges, bool equip, bool quest, int aug1, int aug2, int aug3, int aug4, int aug5, int aug6) {
Lua_Safe_Call_Void();
self->AddItem(item_id, charges, equip, quest, aug1, aug2, aug3, aug4, aug5, aug6);
}
void Lua_NPC::AddLootTable() {
@@ -831,6 +836,96 @@ uint32 Lua_NPC::GetNPCSpellsEffectsID()
return self->GetNPCSpellsEffectsID();
}
void Lua_NPC::AddQuestLoot(int itemid)
{
Lua_Safe_Call_Void();
self->AddQuestLoot(itemid);
}
void Lua_NPC::AddQuestLoot(int itemid, int charges)
{
Lua_Safe_Call_Void();
self->AddQuestLoot(itemid, charges);
}
bool Lua_NPC::GetQuestLoot(int itemid)
{
Lua_Safe_Call_Bool();
return self->HasQuestLootItem(itemid);
}
bool Lua_NPC::HasQuestLoot()
{
Lua_Safe_Call_Bool();
return self->HasQuestLoot();
}
void Lua_NPC::AddPetLoot(int itemid)
{
Lua_Safe_Call_Void();
self->AddPetLoot(itemid, 1, true);
}
void Lua_NPC::AddPetLoot(int itemid, int charges)
{
Lua_Safe_Call_Void();
self->AddPetLoot(itemid, charges, true);
}
bool Lua_NPC::GetPetLoot(int itemid)
{
Lua_Safe_Call_Bool();
return self->HasPetLootItem(itemid);
}
void Lua_NPC::DeleteQuestLoot()
{
Lua_Safe_Call_Void();
self->DeleteQuestLoot(0);
}
void Lua_NPC::DeleteQuestLoot(int itemid1)
{
Lua_Safe_Call_Void();
self->DeleteQuestLoot(itemid1);
}
void Lua_NPC::DeleteQuestLoot(int itemid1, int itemid2)
{
Lua_Safe_Call_Void();
self->DeleteQuestLoot(itemid1, itemid2);
}
void Lua_NPC::DeleteQuestLoot(int itemid1, int itemid2, int itemid3)
{
Lua_Safe_Call_Void();
self->DeleteQuestLoot(itemid1, itemid2, itemid3);
}
void Lua_NPC::DeleteQuestLoot(int itemid1, int itemid2, int itemid3, int itemid4)
{
Lua_Safe_Call_Void();
self->DeleteQuestLoot(itemid1, itemid2, itemid3, itemid4);
}
bool Lua_NPC::HasRequiredQuestLoot(int itemid1, int itemid2, int itemid3, int itemid4)
{
Lua_Safe_Call_Bool();
return self->HasRequiredQuestLoot(itemid1, itemid2, itemid3, itemid4);
}
int Lua_NPC::QuestLootCount(int itemid)
{
Lua_Safe_Call_Int();
return self->CountQuestItem(itemid);
}
bool Lua_NPC::CanTalk()
{
Lua_Safe_Call_Bool();
return self->CanTalk();
}
luabind::scope lua_register_npc() {
return luabind::class_<Lua_NPC, Lua_Mob>("NPC")
.def(luabind::constructor<>())
@@ -842,16 +937,22 @@ luabind::scope lua_register_npc() {
.def("AddCash", (void(Lua_NPC::*)(uint32,uint32,uint32,uint32))&Lua_NPC::AddLootCash)
.def("AddItem", (void(Lua_NPC::*)(int,int))&Lua_NPC::AddItem)
.def("AddItem", (void(Lua_NPC::*)(int,int,bool))&Lua_NPC::AddItem)
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,int))&Lua_NPC::AddItem)
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,int,int))&Lua_NPC::AddItem)
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,int,int,int))&Lua_NPC::AddItem)
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,int,int,int,int))&Lua_NPC::AddItem)
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,int,int,int,int,int))&Lua_NPC::AddItem)
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,int,int,int,int,int,int))&Lua_NPC::AddItem)
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,bool)) & Lua_NPC::AddItem)
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,bool,int))&Lua_NPC::AddItem)
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,bool,int,int))&Lua_NPC::AddItem)
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,bool,int,int,int))&Lua_NPC::AddItem)
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,bool,int,int,int,int))&Lua_NPC::AddItem)
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,bool,int,int,int,int,int))&Lua_NPC::AddItem)
.def("AddItem", (void(Lua_NPC::*)(int,int,bool,bool,int,int,int,int,int,int))&Lua_NPC::AddItem)
.def("AddLootTable", (void(Lua_NPC::*)(int))&Lua_NPC::AddLootTable)
.def("AddLootTable", (void(Lua_NPC::*)(void))&Lua_NPC::AddLootTable)
.def("AddQuestLoot", (void(Lua_NPC::*)(int)) & Lua_NPC::AddQuestLoot)
.def("AddQuestLoot", (void(Lua_NPC::*)(int,int)) & Lua_NPC::AddQuestLoot)
.def("AddPetLoot", (void(Lua_NPC:: *)(int)) & Lua_NPC::AddPetLoot)
.def("AddPetLoot", (void(Lua_NPC:: *)(int, int)) & Lua_NPC::AddPetLoot)
.def("AssignWaypoints", (void(Lua_NPC::*)(int))&Lua_NPC::AssignWaypoints)
.def("CalculateNewWaypoint", (void(Lua_NPC::*)(void))&Lua_NPC::CalculateNewWaypoint)
.def("CanTalk", (bool(Lua_NPC:: *)(void)) & Lua_NPC::CanTalk)
.def("ChangeLastName", (void(Lua_NPC::*)(std::string))&Lua_NPC::ChangeLastName)
.def("CheckNPCFactionAlly", (int(Lua_NPC::*)(int))&Lua_NPC::CheckNPCFactionAlly)
.def("ClearItemList", (void(Lua_NPC::*)(void))&Lua_NPC::ClearLootItems)
@@ -859,6 +960,11 @@ luabind::scope lua_register_npc() {
.def("CountItem", (uint16(Lua_NPC::*)(uint32))&Lua_NPC::CountItem)
.def("CountLoot", (int(Lua_NPC::*)(void))&Lua_NPC::CountLoot)
.def("DeleteBucket", (void(Lua_NPC::*)(std::string))&Lua_NPC::DeleteBucket)
.def("DeleteQuestLoot", (void(Lua_NPC:: *)(void)) & Lua_NPC::DeleteQuestLoot)
.def("DeleteQuestLoot", (void(Lua_NPC:: *)(int)) & Lua_NPC::DeleteQuestLoot)
.def("DeleteQuestLoot", (void(Lua_NPC:: *)(int, int)) & Lua_NPC::DeleteQuestLoot)
.def("DeleteQuestLoot", (void(Lua_NPC:: *)(int, int, int)) & Lua_NPC::DeleteQuestLoot)
.def("DeleteQuestLoot", (void(Lua_NPC:: *)(int, int, int, int)) & Lua_NPC::DeleteQuestLoot)
.def("DisplayWaypointInfo", (void(Lua_NPC::*)(Lua_Client))&Lua_NPC::DisplayWaypointInfo)
.def("DoClassAttacks", (void(Lua_NPC::*)(Lua_Mob))&Lua_NPC::DoClassAttacks)
.def("GetAccuracyRating", (int(Lua_NPC::*)(void))&Lua_NPC::GetAccuracyRating)
@@ -896,10 +1002,12 @@ luabind::scope lua_register_npc() {
.def("GetNPCSpellsEffectsID", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsEffectsID)
.def("GetNPCSpellsID", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetNPCSpellsID)
.def("GetNPCStat", (float(Lua_NPC::*)(std::string))&Lua_NPC::GetNPCStat)
.def("GetPetLoot", (bool(Lua_NPC:: *)(int)) & Lua_NPC::GetPetLoot)
.def("GetPetSpellID", (int(Lua_NPC::*)(void))&Lua_NPC::GetPetSpellID)
.def("GetPlatinum", (uint32(Lua_NPC::*)(void))&Lua_NPC::GetPlatinum)
.def("GetPrimSkill", (int(Lua_NPC::*)(void))&Lua_NPC::GetPrimSkill)
.def("GetPrimaryFaction", (int(Lua_NPC::*)(void))&Lua_NPC::GetPrimaryFaction)
.def("GetQuestLoot", (bool(Lua_NPC:: *)(int)) & Lua_NPC::GetQuestLoot)
.def("GetRawAC", (int(Lua_NPC::*)(void))&Lua_NPC::GetRawAC)
.def("GetScore", (int(Lua_NPC::*)(void))&Lua_NPC::GetScore)
.def("GetSecSkill", (int(Lua_NPC::*)(void))&Lua_NPC::GetSecSkill)
@@ -920,6 +1028,8 @@ luabind::scope lua_register_npc() {
.def("GetWaypointMax", (int(Lua_NPC::*)(void))&Lua_NPC::GetWaypointMax)
.def("HasAISpellEffect", (bool(Lua_NPC::*)(int))&Lua_NPC::HasAISpellEffect)
.def("HasItem", (bool(Lua_NPC::*)(uint32))&Lua_NPC::HasItem)
.def("HasQuestLoot", (bool(Lua_NPC::*)(void)) & Lua_NPC::HasQuestLoot)
.def("HasRequiredQuestLoot", (bool(Lua_NPC::*)(int,int,int,int)) &Lua_NPC::HasRequiredQuestLoot)
.def("IsAnimal", (bool(Lua_NPC::*)(void))&Lua_NPC::IsAnimal)
.def("IsGuarding", (bool(Lua_NPC::*)(void))&Lua_NPC::IsGuarding)
.def("IsLDoNLocked", (bool(Lua_NPC::*)(void))&Lua_NPC::IsLDoNLocked)
@@ -937,6 +1047,7 @@ luabind::scope lua_register_npc() {
.def("NextGuardPosition", (void(Lua_NPC::*)(void))&Lua_NPC::NextGuardPosition)
.def("PauseWandering", (void(Lua_NPC::*)(int))&Lua_NPC::PauseWandering)
.def("PickPocket", (void(Lua_NPC::*)(Lua_Client))&Lua_NPC::PickPocket)
.def("QuestLootCount", (int(Lua_NPC::*)(int)) &Lua_NPC::QuestLootCount)
.def("RecalculateSkills", (void(Lua_NPC::*)(void))&Lua_NPC::RecalculateSkills)
.def("ReloadSpells", (void(Lua_NPC::*)(void))&Lua_NPC::ReloadSpells)
.def("RemoveAISpell", (void(Lua_NPC::*)(int))&Lua_NPC::RemoveAISpell)
+22 -6
View File
@@ -33,12 +33,13 @@ public:
int CheckNPCFactionAlly(int faction);
void AddItem(int item_id, int charges);
void AddItem(int item_id, int charges, bool equip);
void AddItem(int item_id, int charges, bool equip, int aug1);
void AddItem(int item_id, int charges, bool equip, int aug1, int aug2);
void AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3);
void AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3, int aug4);
void AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3, int aug4, int aug5);
void AddItem(int item_id, int charges, bool equip, int aug1, int aug2, int aug3, int aug4, int aug5, int aug6);
void AddItem(int item_id, int charges, bool equip, bool quest);
void AddItem(int item_id, int charges, bool equip, bool quest, int aug1);
void AddItem(int item_id, int charges, bool equip, bool quest, int aug1, int aug2);
void AddItem(int item_id, int charges, bool equip, bool quest, int aug1, int aug2, int aug3);
void AddItem(int item_id, int charges, bool equip, bool quest, int aug1, int aug2, int aug3, int aug4);
void AddItem(int item_id, int charges, bool equip, bool quest, int aug1, int aug2, int aug3, int aug4, int aug5);
void AddItem(int item_id, int charges, bool equip, bool quest, int aug1, int aug2, int aug3, int aug4, int aug5, int aug6);
void AddLootTable();
void AddLootTable(int id);
void RemoveItem(int item_id);
@@ -185,6 +186,21 @@ public:
bool GetNPCAggro();
void SetNPCAggro(bool in_npc_aggro);
uint32 GetNPCSpellsEffectsID();
void AddQuestLoot(int itemid); //
void AddQuestLoot(int itemid, int charges); //
void AddPetLoot(int itemid); //
void AddPetLoot(int itemid, int charges); //
bool GetQuestLoot(int itemid); //
bool GetPetLoot(int itemid); //
bool HasQuestLoot(); //
void DeleteQuestLoot();
void DeleteQuestLoot(int itemid1);
void DeleteQuestLoot(int itemid1, int itemid2);
void DeleteQuestLoot(int itemid1, int itemid2, int itemid3);
void DeleteQuestLoot(int itemid1, int itemid2, int itemid3, int itemid4);
bool HasRequiredQuestLoot(int itemid1, int itemid2, int itemid3, int itemid4);
int QuestLootCount(int itemid);
bool CanTalk();
};
#endif
+2 -8
View File
@@ -16,11 +16,6 @@ int64 Lua_StatBonuses::GetHP() const {
return self->HP;
}
int64 Lua_StatBonuses::GetFlatMaxHPChange() const {
Lua_Safe_Call_Int();
return self->FlatMaxHPChange;
}
int64 Lua_StatBonuses::GetHPRegen() const {
Lua_Safe_Call_Int();
return self->HPRegen;
@@ -28,7 +23,7 @@ int64 Lua_StatBonuses::GetHPRegen() const {
int64 Lua_StatBonuses::GetMaxHP() const {
Lua_Safe_Call_Int();
return self->PercentMaxHPChange;
return self->MaxHP;
}
int64 Lua_StatBonuses::GetManaRegen() const {
@@ -613,7 +608,7 @@ int32 Lua_StatBonuses::GetHealRate() const {
int32 Lua_StatBonuses::GetMaxHPChange() const {
Lua_Safe_Call_Int();
return self->PercentMaxHPChange;
return self->MaxHPChange;
}
int32 Lua_StatBonuses::GetHealAmt() const {
@@ -1386,7 +1381,6 @@ luabind::scope lua_register_stat_bonuses() {
.def("FeignedCastOnChance", &Lua_StatBonuses::GetFeignedCastOnChance)
.def("FinishingBlow", &Lua_StatBonuses::GetFinishingBlow)
.def("FinishingBlowLvl", &Lua_StatBonuses::GetFinishingBlowLvl)
.def("FlatMaxHPChange", &Lua_StatBonuses::GetFlatMaxHPChange)
.def("FlurryChance", &Lua_StatBonuses::GetFlurryChance)
.def("FocusEffects", &Lua_StatBonuses::GetFocusEffects)
.def("FocusEffectsWorn", &Lua_StatBonuses::GetFocusEffectsWorn)
-1
View File
@@ -27,7 +27,6 @@ public:
int32 GetAC() const;
int64 GetHP() const;
int64 GetFlatMaxHPChange() const;
int64 GetHPRegen() const;
int64 GetMaxHP() const;
int64 GetManaRegen() const;
+9 -9
View File
@@ -461,10 +461,10 @@ int64 Merc::CalcMaxHP() {
//but the actual effect sent on live causes the client
//to apply it to (basehp + itemhp).. I will oblige to the client's whims over
//the aa description
nd += aabonuses.PercentMaxHPChange + spellbonuses.PercentMaxHPChange + itembonuses.PercentMaxHPChange; //Natural Durability, Physical Enhancement, Planar Durability
nd += aabonuses.MaxHP + spellbonuses.MaxHPChange + itembonuses.MaxHPChange; //Natural Durability, Physical Enhancement, Planar Durability
max_hp = (float)max_hp * (float)nd / (float)10000; //this is to fix the HP-above-495k issue
max_hp += spellbonuses.FlatMaxHPChange + aabonuses.FlatMaxHPChange + itembonuses.FlatMaxHPChange;
max_hp += spellbonuses.HP + aabonuses.HP;
max_hp += GroupLeadershipAAHealthEnhancement();
@@ -3794,37 +3794,37 @@ bool Merc::CheckConfidence() {
switch(CurrentCon) {
case ConsiderColor::Gray: {
case CON_GRAY: {
ConRating = 0;
break;
}
case ConsiderColor::Green: {
case CON_GREEN: {
ConRating = 0.1;
break;
}
case ConsiderColor::LightBlue: {
case CON_LIGHTBLUE: {
ConRating = 0.2;
break;
}
case ConsiderColor::DarkBlue: {
case CON_BLUE: {
ConRating = 0.6;
break;
}
case ConsiderColor::White: {
case CON_WHITE: {
ConRating = 1.0;
break;
}
case ConsiderColor::Yellow: {
case CON_YELLOW: {
ConRating = 1.2;
break;
}
case ConsiderColor::Red: {
case CON_RED: {
ConRating = 1.5;
break;
}
+16 -33
View File
@@ -442,7 +442,6 @@ Mob::Mob(
weaponstance.aabonus_buff_spell_id = 0;
pStandingPetOrder = SPO_Follow;
m_previous_pet_order = SPO_Follow;
pseudo_rooted = false;
nobuff_invisible = 0;
@@ -507,6 +506,8 @@ Mob::Mob(
use_double_melee_round_dmg_bonus = false;
dw_same_delay = 0;
queue_wearchange_slot = -1;
m_manual_follow = false;
mob_close_scan_timer.Trigger();
@@ -636,16 +637,6 @@ void Mob::CalcInvisibleLevel()
BreakCharmPetIfConditionsMet();
}
void Mob::SetPetOrder(eStandingPetOrder i) {
if (i == SPO_Sit || i == SPO_FeignDeath) {
if (pStandingPetOrder == SPO_Follow || pStandingPetOrder == SPO_Guard) {
m_previous_pet_order = pStandingPetOrder;
}
}
pStandingPetOrder = i;
}
void Mob::SetInvisible(uint8 state, bool set_on_bonus_calc) {
if (state == Invisibility::Visible) {
SendAppearancePacket(AppearanceType::Invisibility, Invisibility::Visible);
@@ -967,9 +958,8 @@ int64 Mob::CalcMaxMana()
}
int64 Mob::CalcMaxHP() {
max_hp = (base_hp + itembonuses.HP);
max_hp += max_hp * ((aabonuses.PercentMaxHPChange + spellbonuses.PercentMaxHPChange + itembonuses.PercentMaxHPChange) / 10000.0f);
max_hp += spellbonuses.FlatMaxHPChange + itembonuses.FlatMaxHPChange + aabonuses.FlatMaxHPChange;
max_hp = (base_hp + itembonuses.HP + spellbonuses.HP);
max_hp += max_hp * ((aabonuses.MaxHPChange + spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000.0f);
return max_hp;
}
@@ -977,13 +967,14 @@ int64 Mob::CalcMaxHP() {
int64 Mob::GetItemHPBonuses() {
int64 item_hp = 0;
item_hp = itembonuses.HP;
item_hp += item_hp * ((itembonuses.PercentMaxHPChange + spellbonuses.FlatMaxHPChange + aabonuses.FlatMaxHPChange) / 10000.0f);
item_hp += item_hp * itembonuses.MaxHPChange / 10000;
return item_hp;
}
int64 Mob::GetSpellHPBonuses() {
int64 spell_hp = 0;
spell_hp += spellbonuses.FlatMaxHPChange;
spell_hp = spellbonuses.HP;
spell_hp += spell_hp * spellbonuses.MaxHPChange / 10000;
return spell_hp;
}
@@ -1656,22 +1647,6 @@ void Mob::SendHPUpdate(bool force_update_all)
}
}
void Mob::SendRename(Mob *sender, const char* old_name, const char* new_name)
{
auto out2 = new EQApplicationPacket(OP_MobRename, sizeof(MobRename_Struct));
auto data = (MobRename_Struct *)out2->pBuffer;
out2->priority = 6;
strn0cpy(data->old_name, old_name, sizeof(data->old_name));
strn0cpy(data->old_name_again, old_name, sizeof(data->old_name_again));
strn0cpy(data->new_name, new_name, sizeof(data->new_name));
data->unknown192 = 0;
data->unknown196 = 1;
entity_list.QueueClients(sender, out2);
safe_delete(out2);
}
void Mob::StopMoving()
{
StopNavigation();
@@ -4399,7 +4374,15 @@ void Mob::TempName(const char *newname)
entity_list.MakeNameUnique(temp_name);
// Send the new name to all clients
SendRename(this, old_name, temp_name);
auto outapp = new EQApplicationPacket(OP_MobRename, sizeof(MobRename_Struct));
MobRename_Struct* mr = (MobRename_Struct*) outapp->pBuffer;
strn0cpy(mr->old_name, old_name, 64);
strn0cpy(mr->old_name_again, old_name, 64);
strn0cpy(mr->new_name, temp_name, 64);
mr->unknown192 = 0;
mr->unknown196 = 1;
entity_list.QueueClients(this, outapp);
safe_delete(outapp);
SetName(temp_name);
}
+3 -4
View File
@@ -589,7 +589,6 @@ public:
inline const char* GetName() const { return name; }
inline const char* GetOrigName() const { return orig_name; }
inline const char* GetLastName() const { return lastname; }
inline const eStandingPetOrder GetPreviousPetOrder() const { return m_previous_pet_order; }
const char *GetCleanName();
virtual void SetName(const char *new_name = nullptr) { new_name ? strn0cpy(name, new_name, 64) :
strn0cpy(name, GetName(), 64); return; };
@@ -830,7 +829,6 @@ public:
void SendHPUpdate(bool force_update_all = false);
virtual void ResetHPUpdateTimer() {}; // does nothing
static void SetSpawnLastNameByClass(NewSpawn_Struct* ns);
void SendRename(Mob* sender, const char* old_name, const char* new_name);
//Util
static uint32 RandomTimer(int min, int max);
@@ -1180,7 +1178,7 @@ public:
inline const float GetAssistRange() const { return (spellbonuses.AssistRange == -1) ? pAssistRange : spellbonuses.AssistRange; }
void SetPetOrder(eStandingPetOrder i);
inline void SetPetOrder(eStandingPetOrder i) { pStandingPetOrder = i; }
inline const eStandingPetOrder GetPetOrder() const { return pStandingPetOrder; }
inline void SetHeld(bool nState) { held = nState; }
inline const bool IsHeld() const { return held; }
@@ -1669,6 +1667,8 @@ protected:
int32 appearance_effects_id[MAX_APPEARANCE_EFFECTS];
int32 appearance_effects_slot[MAX_APPEARANCE_EFFECTS];
int queue_wearchange_slot;
Timer shield_timer;
uint32 m_shield_target_id;
uint32 m_shielder_id;
@@ -1774,7 +1774,6 @@ protected:
// MobAI stuff
eStandingPetOrder pStandingPetOrder;
eStandingPetOrder m_previous_pet_order;
uint32 minLastFightingDelayMoving;
uint32 maxLastFightingDelayMoving;
float pAggroRange = 0;
+65 -65
View File
@@ -2187,162 +2187,162 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
int16 diff = iOtherLevel - mylevel;
if (diff == 0)
return ConsiderColor::White;
return CON_WHITE;
else if (diff >= 1 && diff <= 2)
return ConsiderColor::Yellow;
return CON_YELLOW;
else if (diff >= 3)
return ConsiderColor::Red;
return CON_RED;
if (mylevel <= 8)
{
if (diff <= -4)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 9)
{
if (diff <= -6)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -4)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 13)
{
if (diff <= -7)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -5)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 15)
{
if (diff <= -7)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -5)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 17)
{
if (diff <= -8)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -6)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 21)
{
if (diff <= -9)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -7)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 25)
{
if (diff <= -10)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -8)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 29)
{
if (diff <= -11)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -9)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 31)
{
if (diff <= -12)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -9)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 33)
{
if (diff <= -13)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -10)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 37)
{
if (diff <= -14)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -11)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 41)
{
if (diff <= -16)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -12)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 45)
{
if (diff <= -17)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -13)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 49)
{
if (diff <= -18)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -14)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 53)
{
if (diff <= -19)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -15)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else if (mylevel <= 55)
{
if (diff <= -20)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -15)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else
{
if (diff <= -21)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else if (diff <= -16)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
}
else
@@ -2352,42 +2352,42 @@ uint32 Mob::GetLevelCon(uint8 mylevel, uint8 iOtherLevel) {
uint32 conGreenLvl = mylevel - (int32)((mylevel + 7) / 4);
if (diff == 0)
return ConsiderColor::White;
return CON_WHITE;
else if (diff >= 1 && diff <= 3)
return ConsiderColor::Yellow;
return CON_YELLOW;
else if (diff >= 4)
return ConsiderColor::Red;
return CON_RED;
if (mylevel <= 15)
{
if (diff <= -6)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else
if (mylevel <= 20)
{
if (iOtherLevel <= conGrayLvl)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else
if (iOtherLevel <= conGreenLvl)
conlevel = ConsiderColor::Green;
conlevel = CON_GREEN;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
else
{
if (iOtherLevel <= conGrayLvl)
conlevel = ConsiderColor::Gray;
conlevel = CON_GRAY;
else
if (iOtherLevel <= conGreenLvl)
conlevel = ConsiderColor::Green;
conlevel = CON_GREEN;
else
if (diff <= -6)
conlevel = ConsiderColor::LightBlue;
conlevel = CON_LIGHTBLUE;
else
conlevel = ConsiderColor::DarkBlue;
conlevel = CON_BLUE;
}
}
return conlevel;
+3
View File
@@ -399,6 +399,9 @@ void Mob::SendWearChange(uint8 material_slot, Client *one_client)
w->wear_slot_id = material_slot;
// Part of a bug fix to ensure heroforge models send to other clients in zone.
queue_wearchange_slot = w->hero_forge_model ? material_slot : -1;
if (!one_client) {
entity_list.QueueClients(this, packet);
} else {
+1 -1
View File
@@ -3403,7 +3403,7 @@ void NPC::AIYellForHelp(Mob *sender, Mob *attacker)
* if they are in range, make sure we are not green...
* then jump in if they are our friend
*/
if (mob->GetLevel() >= 50 || mob->AlwaysAggro() || attacker->GetLevelCon(mob->GetLevel()) != ConsiderColor::Gray) {
if (mob->GetLevel() >= 50 || mob->AlwaysAggro() || attacker->GetLevelCon(mob->GetLevel()) != CON_GRAY) {
if (mob->GetPrimaryFaction() == sender->CastToNPC()->GetPrimaryFaction()) {
const auto f = zone->GetNPCFaction(mob->CastToNPC()->GetNPCFactionID());
if (f) {
+22 -1
View File
@@ -197,11 +197,12 @@ public:
virtual void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho);
// loot
void AddItem(const EQ::ItemData *item, uint16 charges, bool equip_item = true);
void AddItem(const EQ::ItemData *item, uint16 charges, bool equip_item = true, bool quest = false);
void AddItem(
uint32 item_id,
uint16 charges,
bool equip_item = true,
bool quest = false,
uint32 augment_one = 0,
uint32 augment_two = 0,
uint32 augment_three = 0,
@@ -214,10 +215,12 @@ public:
void AddLootDropTable(uint32 lootdrop_id, uint8 drop_limit, uint8 min_drop);
void CheckGlobalLootTables();
void RemoveItem(uint32 item_id, uint16 quantity = 0, uint16 slot = 0);
void RemoveItem(LootItem *item_data, uint8 quantity = 0);
void CheckTrivialMinMaxLevelDrop(Mob *killer);
void ClearLootItems();
inline const LootItems &GetLootItems() { return m_loot_items; }
LootItem *GetItem(int slot_id);
LootItem *GetItemByItemID(int16 itemid);
void AddLootCash(uint32 in_copper, uint32 in_silver, uint32 in_gold, uint32 in_platinum);
void RemoveLootCash();
void QueryLoot(Client *to, bool is_pet_query = false);
@@ -238,6 +241,22 @@ public:
inline void SetGold(uint32 amt) { m_loot_gold = amt; }
inline void SetPlatinum(uint32 amt) { m_loot_platinum = amt; }
// MultiQuest
bool HasQuestLootItem(int16 itemid);
bool HasQuestLoot();
bool RemoveQuestLootItems(int16 itemid);
bool HasRequiredQuestLoot(int16 itemid1, int16 itemid2, int16 itemid3, int16 itemid4);
void CleanQuestLootItems();
uint8 CountQuestItem(uint16 itemid);
uint8 CountQuestItems();
bool AddQuestLoot(int16 itemid, int8 charges = 1);
void DeleteQuestLoot(int16 itemid1, int16 itemid2 = 0, int16 itemid3 = 0, int16 itemid4 = 0);
void DeleteInvalidQuestLoot();
bool AddPetLoot(int16 itemid, int8 charges = 1, bool fromquest = false);
bool HasPetLootItem(int16 itemid);
bool RemovePetLootItems(int16 itemid);
void DescribeAggro(Client *to_who, Mob *mob, bool verbose);
virtual void UpdateEquipmentLight();
virtual int64 CalcMaxMana();
@@ -326,6 +345,8 @@ public:
const EQ::ItemData *item2,
LootdropEntriesRepository::LootdropEntries loot_drop,
bool wear_change = false,
bool quest = false,
bool pet = false,
uint32 augment_one = 0,
uint32 augment_two = 0,
uint32 augment_three = 0,
-18
View File
@@ -3148,21 +3148,6 @@ perl::array Perl_Client_GetRaidOrGroupOrSelf(Client* self, bool clients_only)
return result;
}
std::string Perl_Client_GetAutoLoginCharacterName(Client* self)
{
return quest_manager.GetAutoLoginCharacterNameByAccountID(self->AccountID());
}
bool Perl_Client_SetAutoLoginCharacterName(Client* self)
{
return quest_manager.SetAutoLoginCharacterNameByAccountID(self->AccountID(), self->GetCleanName());
}
bool Perl_Client_SetAutoLoginCharacterName(Client* self, std::string character_name)
{
return quest_manager.SetAutoLoginCharacterNameByAccountID(self->AccountID(), character_name);
}
void perl_register_client()
{
perl::interpreter perl(PERL_GET_THX);
@@ -3295,7 +3280,6 @@ void perl_register_client()
package.add("GetAugmentAt", &Perl_Client_GetAugmentAt);
package.add("GetAugmentIDAt", &Perl_Client_GetAugmentIDAt);
package.add("GetAugmentIDsBySlotID", &Perl_Client_GetAugmentIDsBySlotID);
package.add("GetAutoLoginCharacterName", &Perl_Client_GetAutoLoginCharacterName);
package.add("GetBaseAGI", &Perl_Client_GetBaseAGI);
package.add("GetBaseCHA", &Perl_Client_GetBaseCHA);
package.add("GetBaseDEX", &Perl_Client_GetBaseDEX);
@@ -3588,8 +3572,6 @@ void perl_register_client()
package.add("SetAccountFlag", &Perl_Client_SetAccountFlag);
package.add("SetAlternateCurrencyValue", &Perl_Client_SetAlternateCurrencyValue);
package.add("SetAnon", &Perl_Client_SetAnon);
package.add("SetAutoLoginCharacterName", (bool(*)(Client*))&Perl_Client_SetAutoLoginCharacterName);
package.add("SetAutoLoginCharacterName", (bool(*)(Client*, std::string))&Perl_Client_SetAutoLoginCharacterName);
package.add("SetBaseClass", &Perl_Client_SetBaseClass);
package.add("SetBaseGender", &Perl_Client_SetBaseGender);
package.add("SetBaseRace", &Perl_Client_SetBaseRace);
-12
View File
@@ -3468,16 +3468,6 @@ bool Perl_Mob_IsWisdomCasterClass(Mob* self)
return self->IsWisdomCasterClass();
}
std::string Perl_Mob_GetConsiderColor(Mob* self, Mob* other)
{
return EQ::constants::GetConsiderColorName(self->GetLevelCon(other->GetLevel()));
}
std::string Perl_Mob_GetConsiderColor(Mob* self, uint8 other_level)
{
return EQ::constants::GetConsiderColorName(self->GetLevelCon(other_level));
}
void perl_register_mob()
{
perl::interpreter perl(PERL_GET_THX);
@@ -3680,8 +3670,6 @@ void perl_register_mob()
package.add("GetCloseMobList", (perl::array(*)(Mob*))&Perl_Mob_GetCloseMobList);
package.add("GetCloseMobList", (perl::array(*)(Mob*, float))&Perl_Mob_GetCloseMobList);
package.add("GetCloseMobList", (perl::array(*)(Mob*, float, bool))&Perl_Mob_GetCloseMobList);
package.add("GetConsiderColor", (std::string(*)(Mob*, Mob*))&Perl_Mob_GetConsiderColor);
package.add("GetConsiderColor", (std::string(*)(Mob*, uint8))&Perl_Mob_GetConsiderColor);
package.add("GetCorruption", &Perl_Mob_GetCorruption);
package.add("GetDefaultRaceSize", (float(*)(Mob*))&Perl_Mob_GetDefaultRaceSize);
package.add("GetDefaultRaceSize", (float(*)(Mob*, int))&Perl_Mob_GetDefaultRaceSize);
+2 -8
View File
@@ -16,11 +16,6 @@ int64 Perl_StatBonuses_GetHP(StatBonuses* self)
return self->HP;
}
int64 Perl_StatBonuses_GetFlatMaxHPChange(StatBonuses* self)
{
return self->FlatMaxHPChange;
}
int64 Perl_StatBonuses_GetHPRegen(StatBonuses* self)
{
return self->HPRegen;
@@ -28,7 +23,7 @@ int64 Perl_StatBonuses_GetHPRegen(StatBonuses* self)
int64 Perl_StatBonuses_GetMaxHP(StatBonuses* self)
{
return self->PercentMaxHPChange;
return self->MaxHP;
}
int64 Perl_StatBonuses_GetManaRegen(StatBonuses* self)
@@ -613,7 +608,7 @@ int32 Perl_StatBonuses_GetHealRate(StatBonuses* self)
int32 Perl_StatBonuses_GetMaxHPChange(StatBonuses* self)
{
return self->PercentMaxHPChange;
return self->MaxHPChange;
}
int32 Perl_StatBonuses_GetHealAmt(StatBonuses* self)
@@ -1537,7 +1532,6 @@ void perl_register_stat_bonuses()
package.add("GetStringedModifier", &Perl_StatBonuses_GetStringedModifier);
package.add("GetStunBashChance", &Perl_StatBonuses_GetStunBashChance);
package.add("GetStunResist", &Perl_StatBonuses_GetStunResist);
package.add("GetFlatMaxHPChange", &Perl_StatBonuses_GetFlatMaxHPChange);
package.add("GetTradeSkillMastery", &Perl_StatBonuses_GetTradeSkillMastery);
package.add("GetTriggerMeleeThreshold", &Perl_StatBonuses_GetTriggerMeleeThreshold);
package.add("GetTriggerOnValueAmount", &Perl_StatBonuses_GetTriggerOnValueAmount);
-11
View File
@@ -39,7 +39,6 @@
#include "zonedb.h"
#include "dialogue_window.h"
#include "../common/repositories/account_repository.h"
#include "../common/repositories/tradeskill_recipe_repository.h"
#include "../common/repositories/instance_list_repository.h"
#include "../common/repositories/grid_entries_repository.h"
@@ -4894,13 +4893,3 @@ void QuestManager::SendPlayerHandinEvent() {
RecordPlayerEventLogWithClient(initiator, PlayerEvent::NPC_HANDIN, e);
}
}
std::string QuestManager::GetAutoLoginCharacterNameByAccountID(uint32 account_id)
{
return AccountRepository::GetAutoLoginCharacterNameByAccountID(database, account_id);
}
bool QuestManager::SetAutoLoginCharacterNameByAccountID(uint32 account_id, const std::string& character_name)
{
return AccountRepository::SetAutoLoginCharacterNameByAccountID(database, account_id, character_name);
}
-2
View File
@@ -353,8 +353,6 @@ public:
void SendChannelMessage(uint8 channel_number, uint32 guild_id, uint8 language_id, uint8 language_skill, const char* message);
void SendChannelMessage(Client* from, uint8 channel_number, uint32 guild_id, uint8 language_id, uint8 language_skill, const char* message);
void SendChannelMessage(Client* from, const char* to, uint8 channel_number, uint32 guild_id, uint8 language_id, uint8 language_skill, const char* message);
std::string GetAutoLoginCharacterNameByAccountID(uint32 account_id);
bool SetAutoLoginCharacterNameByAccountID(uint32 account_id, const std::string& character_name);
Bot *GetBot() const;
Client *GetInitiator() const;
+1 -1
View File
@@ -2669,7 +2669,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, in
Group *target_group = entity_list.GetGroupByMob(spell_target);
if (target_group) {
target_group->CastGroupSpell(this, spell_id);
if (target_group != GetGroup() && GetClass() != Class::Bard) {
if (GetClass() != Class::Bard) {
SpellOnTarget(spell_id, this);
}
}
+13
View File
@@ -837,6 +837,15 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
tradingWith->SayString(TRADE_BACK, GetCleanName());
PushItemOnCursor(*baginst, true);
}
else if (bagitem->NoDrop != 0 && tradingWith->CastToNPC()->CountQuestItem(bagitem->ID) == 0) {
tradingWith->CastToNPC()->AddQuestLoot(bagitem->ID, baginst->GetCharges());
LogTrading("Adding loot item {} (bag) to non-Quest NPC {}", bagitem->Name, tradingWith->CastToNPC()->GetName());
}
// Destroy duplicate and nodrop items on charmed pets.
else if (bagitem->NoDrop != 0 && ((tradingWith->CastToNPC()->IsPet() && tradingWith->CastToNPC()->IsCharmed()) || (tradingWith->CastToNPC()->IsPet() && tradingWith->CastToNPC()->IsCharmed() && tradingWith->CastToNPC()->CountQuestItem(bagitem->ID) == 0))) {
tradingWith->CastToNPC()->AddPetLoot(bagitem->ID, baginst->GetCharges());
}
}
}
}
@@ -868,6 +877,10 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st
tradingWith->SayString(TRADE_BACK, GetCleanName());
PushItemOnCursor(*inst, true);
}
// Add items to loottable without equipping and mark as quest.
else if (GetGM() || (item->NoDrop != 0 && tradingWith->CastToNPC()->CountQuestItem(item->ID) == 0)) {
tradingWith->CastToNPC()->AddQuestLoot(item->ID, inst->GetCharges());
}
}
}
+5 -5
View File
@@ -755,6 +755,11 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
pZoneName = strcpy(new char[zd->long_name.length() + 1], zd->long_name.c_str());
}
// If we are zoning to the same zone, we need to use the current instance ID if it is not specified.
if (zoneID == zone->GetZoneID() && instance_id == 0) {
instance_id = zone->GetInstanceID();
}
auto r = content_service.FindZone(zoneID, instance_id);
if (r.zone_id) {
zoneID = r.zone_id;
@@ -771,11 +776,6 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z
ignorerestrictions,
static_cast<int>(zm)
);
// If we are zoning to the same zone, we need to use the current instance ID if it is not specified.
if (content_service.IsInPublicStaticInstance(instance_id) && zoneID == zone->GetZoneID() && instance_id == 0) {
instance_id = zone->GetInstanceID();
}
}
LogInfo(