mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-27 04:42:27 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b6917ec782 | |||
| eb51550109 | |||
| 9d1ace627c | |||
| ec3ef411a1 | |||
| 1394b6a4d2 | |||
| 7f41547963 | |||
| 2e4071cdcf |
@@ -1,3 +1,23 @@
|
||||
## [22.8.0] - 03/25/2023
|
||||
|
||||
### Code
|
||||
|
||||
* Cleanup Strings::ToInt uses. ([#3142](https://github.com/EQEmu/Server/pull/3142)) @Aeadoin 2023-03-26
|
||||
* Remove extern bool Critical ([#3146](https://github.com/EQEmu/Server/pull/3146)) @Kinglykrab 2023-03-25
|
||||
|
||||
### Crash
|
||||
|
||||
* Fix for crash in Raid::QueuePacket ([#3145](https://github.com/EQEmu/Server/pull/3145)) @Aeadoin 2023-03-25
|
||||
|
||||
### Feature
|
||||
|
||||
* Add support for -1 extradmgskill to allow all skills to be scaled. ([#3136](https://github.com/EQEmu/Server/pull/3136)) @Kinglykrab 2023-03-26
|
||||
|
||||
### Fixes
|
||||
|
||||
* Fix for Items looted from corpses. ([#3147](https://github.com/EQEmu/Server/pull/3147)) @Aeadoin 2023-03-26
|
||||
* Fix for SQL Query in npc_scale_global_base ([#3144](https://github.com/EQEmu/Server/pull/3144)) @Aeadoin 2023-03-26
|
||||
|
||||
## [22.7.0] - 03/24/2023
|
||||
|
||||
### Bots
|
||||
|
||||
+1
-1
@@ -812,7 +812,7 @@ uint32 Database::GetAccountIDByChar(const char* charname, uint32* oCharID) {
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
uint32 accountId = Strings::ToInt(row[0]);
|
||||
uint32 accountId = Strings::ToUnsignedInt(row[0]);
|
||||
|
||||
if (oCharID)
|
||||
*oCharID = Strings::ToUnsignedInt(row[1]);
|
||||
|
||||
@@ -499,7 +499,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
|
||||
ExtendedProfile_Struct* e_pp;
|
||||
uint32 pplen = 0;
|
||||
uint32 i;
|
||||
int character_id = 0;
|
||||
uint32 character_id = 0;
|
||||
int account_id = 0;
|
||||
int number_of_characters = 0;
|
||||
int printppdebug = 0; /* Prints Player Profile */
|
||||
@@ -929,12 +929,12 @@ bool Database::CheckDatabaseConvertPPDeblob(){
|
||||
|
||||
for (auto row = results.begin(); row != results.end(); ++row) {
|
||||
char_iter_count++;
|
||||
squery = StringFormat("SELECT `id`, `profile`, `name`, `level`, `account_id`, `firstlogon`, `lfg`, `lfp`, `mailkey`, `xtargets`, `inspectmessage`, `extprofile` FROM `character_` WHERE `id` = %i", Strings::ToInt(row[0]));
|
||||
squery = StringFormat("SELECT `id`, `profile`, `name`, `level`, `account_id`, `firstlogon`, `lfg`, `lfp`, `mailkey`, `xtargets`, `inspectmessage`, `extprofile` FROM `character_` WHERE `id` = %i", Strings::ToUnsignedInt(row[0]));
|
||||
auto results2 = QueryDatabase(squery);
|
||||
auto row2 = results2.begin();
|
||||
pp = (Convert::PlayerProfile_Struct*)row2[1];
|
||||
e_pp = (ExtendedProfile_Struct*)row2[11];
|
||||
character_id = Strings::ToInt(row[0]);
|
||||
character_id = Strings::ToUnsignedInt(row[0]);
|
||||
account_id = Strings::ToInt(row2[4]);
|
||||
/* Convert some data from the character_ table that is still relevant */
|
||||
firstlogon = Strings::ToUnsignedInt(row2[5]);
|
||||
|
||||
@@ -5524,9 +5524,9 @@ struct ServerLootItem_Struct {
|
||||
uint32 aug_6; // uint32 aug_5;
|
||||
bool attuned;
|
||||
std::string custom_data;
|
||||
uint32 ornamenticon;
|
||||
uint32 ornamentidfile;
|
||||
uint32 ornament_hero_model;
|
||||
uint32 ornamenticon {};
|
||||
uint32 ornamentidfile {};
|
||||
uint32 ornament_hero_model {};
|
||||
uint16 trivial_min_level;
|
||||
uint16 trivial_max_level;
|
||||
uint16 npc_min_level;
|
||||
|
||||
@@ -384,7 +384,7 @@ namespace PlayerEvent {
|
||||
};
|
||||
|
||||
struct AAPurchasedEvent {
|
||||
int32 aa_id;
|
||||
uint32 aa_id;
|
||||
int32 aa_cost;
|
||||
int32 aa_previous_id;
|
||||
int32 aa_next_id;
|
||||
|
||||
+3
-3
@@ -131,7 +131,7 @@ namespace EQ
|
||||
Mounts?
|
||||
Ornamentations?
|
||||
GuildBanners?
|
||||
Collectible?
|
||||
Collectible?
|
||||
Placeable?
|
||||
(others?)
|
||||
*/
|
||||
@@ -449,8 +449,8 @@ namespace EQ
|
||||
int8 Shielding; // PoP: Shielding %
|
||||
int8 StunResist; // PoP: Stun Resist %
|
||||
int8 StrikeThrough; // PoP: Strike Through %
|
||||
uint32 ExtraDmgSkill;
|
||||
uint32 ExtraDmgAmt;
|
||||
int32 ExtraDmgSkill;
|
||||
int32 ExtraDmgAmt;
|
||||
int8 SpellShield; // PoP: Spell Shield %
|
||||
int8 Avoidance; // PoP: Avoidance +
|
||||
int8 Accuracy; // PoP: Accuracy +
|
||||
|
||||
+6
-6
@@ -964,10 +964,10 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
|
||||
// Flags
|
||||
item.ArtifactFlag = Strings::ToBool(row[ItemField::artifactflag]);
|
||||
item.Attuneable = !disable_attuneable && Strings::ToInt(row[ItemField::attuneable]) != 0;
|
||||
item.BenefitFlag = Strings::ToBool(row[ItemField::benefitflag]) != 0;
|
||||
item.FVNoDrop = Strings::ToInt(row[ItemField::fvnodrop]) != 0;
|
||||
item.Magic = Strings::ToBool(row[ItemField::magic]) != 0;
|
||||
item.Attuneable = !disable_attuneable && Strings::ToBool(row[ItemField::attuneable]);
|
||||
item.BenefitFlag = Strings::ToBool(row[ItemField::benefitflag]);
|
||||
item.FVNoDrop = Strings::ToBool(row[ItemField::fvnodrop]);
|
||||
item.Magic = Strings::ToBool(row[ItemField::magic]);
|
||||
item.NoDrop = disable_no_drop ? static_cast<uint8>(255) : static_cast<uint8>(Strings::ToUnsignedInt(row[ItemField::nodrop]));
|
||||
item.NoPet = !disable_no_pet && Strings::ToBool(row[ItemField::nopet]);
|
||||
item.NoRent = disable_no_rent ? static_cast<uint8>(255) : static_cast<uint8>(Strings::ToUnsignedInt(row[ItemField::norent]));
|
||||
@@ -1107,8 +1107,8 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
|
||||
item.SkillModType = Strings::ToUnsignedInt(row[ItemField::skillmodtype]);
|
||||
|
||||
// Extra Damage Skill
|
||||
item.ExtraDmgSkill = Strings::ToUnsignedInt(row[ItemField::extradmgskill]);
|
||||
item.ExtraDmgAmt = Strings::ToUnsignedInt(row[ItemField::extradmgamt]);
|
||||
item.ExtraDmgSkill = Strings::ToInt(row[ItemField::extradmgskill]);
|
||||
item.ExtraDmgAmt = Strings::ToInt(row[ItemField::extradmgamt]);
|
||||
|
||||
// Bard
|
||||
item.BardType = Strings::ToUnsignedInt(row[ItemField::bardtype]);
|
||||
|
||||
+20
-2
@@ -1,5 +1,5 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
|
||||
|
||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -260,13 +260,31 @@ const std::map<EQ::skills::SkillType, std::string>& EQ::skills::GetSkillTypeMap(
|
||||
return skill_type_map;
|
||||
}
|
||||
|
||||
const std::vector<EQ::skills::SkillType>& EQ::skills::GetExtraDamageSkills()
|
||||
{
|
||||
static const std::vector<EQ::skills::SkillType> v = {
|
||||
EQ::skills::SkillBackstab,
|
||||
EQ::skills::SkillBash,
|
||||
EQ::skills::SkillDragonPunch, // Same ID as Tail Rake
|
||||
EQ::skills::SkillEagleStrike,
|
||||
EQ::skills::SkillFlyingKick,
|
||||
EQ::skills::SkillKick,
|
||||
EQ::skills::SkillRoundKick,
|
||||
EQ::skills::SkillRoundKick,
|
||||
EQ::skills::SkillTigerClaw,
|
||||
EQ::skills::SkillFrenzy
|
||||
};
|
||||
|
||||
return v;
|
||||
}
|
||||
|
||||
std::string EQ::skills::GetSkillName(SkillType skill)
|
||||
{
|
||||
if (skill >= Skill1HBlunt && skill <= Skill2HPiercing) {
|
||||
auto skills = GetSkillTypeMap();
|
||||
return skills[skill];
|
||||
}
|
||||
return std::string();
|
||||
return {};
|
||||
}
|
||||
|
||||
EQ::SkillProfile::SkillProfile()
|
||||
|
||||
+4
-2
@@ -1,5 +1,5 @@
|
||||
/* EQEMu: Everquest Server Emulator
|
||||
|
||||
|
||||
Copyright (C) 2001-2016 EQEMu Development Team (http://eqemulator.net)
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace EQ
|
||||
@@ -170,6 +171,7 @@ namespace EQ
|
||||
bool IsMeleeDmg(SkillType skill);
|
||||
|
||||
extern const std::map<SkillType, std::string>& GetSkillTypeMap();
|
||||
extern const std::vector<SkillType>& GetExtraDamageSkills();
|
||||
|
||||
std::string GetSkillName(SkillType skill);
|
||||
} /*skills*/
|
||||
@@ -305,7 +307,7 @@ namespace EQ
|
||||
|
||||
uint32 operator[](int skill_id) const { return const_cast<SkillProfile*>(this)->GetSkill(skill_id); }
|
||||
};
|
||||
|
||||
|
||||
} /*EQEmu*/
|
||||
|
||||
#endif /*COMMON_SKILLS_H*/
|
||||
|
||||
+2
-2
@@ -25,7 +25,7 @@
|
||||
|
||||
// Build variables
|
||||
// these get injected during the build pipeline
|
||||
#define CURRENT_VERSION "22.7.0-dev" // always append -dev to the current version for custom-builds
|
||||
#define CURRENT_VERSION "22.8.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 9226
|
||||
#define CURRENT_BINARY_DATABASE_VERSION 9227
|
||||
|
||||
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9038
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ Database::Database(
|
||||
user.c_str(),
|
||||
pass.c_str(),
|
||||
name.c_str(),
|
||||
Strings::ToInt(port),
|
||||
Strings::ToUnsignedInt(port),
|
||||
&errnum,
|
||||
errbuf
|
||||
)
|
||||
@@ -93,7 +93,7 @@ bool Database::GetLoginDataFromAccountInfo(
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
id = Strings::ToInt(row[0]);
|
||||
id = Strings::ToUnsignedInt(row[0]);
|
||||
password = row[1];
|
||||
|
||||
LogDebug(
|
||||
@@ -145,7 +145,7 @@ bool Database::GetLoginTokenDataFromToken(
|
||||
}
|
||||
|
||||
if (strcmp(row[2], "login_server_id") == 0) {
|
||||
db_account_id = Strings::ToInt(row[3]);
|
||||
db_account_id = Strings::ToUnsignedInt(row[3]);
|
||||
found_login_id = true;
|
||||
continue;
|
||||
}
|
||||
@@ -373,7 +373,7 @@ Database::DbWorldRegistration Database::GetWorldRegistration(
|
||||
r.server_list_type = Strings::ToInt(row[3]);
|
||||
r.is_server_trusted = Strings::ToInt(row[2]) > 0;
|
||||
r.server_list_description = row[4];
|
||||
r.server_admin_id = Strings::ToInt(row[5]);
|
||||
r.server_admin_id = Strings::ToUnsignedInt(row[5]);
|
||||
|
||||
if (r.server_admin_id <= 0) {
|
||||
return r;
|
||||
@@ -513,7 +513,7 @@ bool Database::CreateWorldRegistration(
|
||||
|
||||
auto row = results.begin();
|
||||
|
||||
id = Strings::ToInt(row[0]);
|
||||
id = Strings::ToUnsignedInt(row[0]);
|
||||
auto insert_query = fmt::format(
|
||||
"INSERT INTO login_world_servers SET id = {0}, long_name = '{1}', short_name = '{2}', last_ip_address = '{3}', \n"
|
||||
"login_server_list_type_id = 3, login_server_admin_id = {4}, is_server_trusted = 0, tag_description = ''",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "eqemu-server",
|
||||
"version": "22.7.0",
|
||||
"version": "22.8.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/EQEmu/Server.git"
|
||||
|
||||
@@ -480,6 +480,7 @@
|
||||
9224|2023_03_08_npc_scale_global_base_avoidance.sql|SHOW COLUMNS FROM `npc_scale_global_base` LIKE 'hp_regen_per_second'|empty|
|
||||
9225|2023_01_21_bots_raid_members.sql|SHOW COLUMNS FROM `raid_members` LIKE 'bot_id'|empty|
|
||||
9226|2023_03_17_corpse_fields.sql|SHOW COLUMNS FROM `character_corpse_items` LIKE 'custom_data'|empty|
|
||||
9227|2023_03_24_npc_scale_global_base_verify.sql|SHOW COLUMNS FROM `npc_scale_global_base` LIKE 'heroic_strikethrough'|not_empty|
|
||||
|
||||
# Upgrade conditions:
|
||||
# This won't be needed after this system is implemented, but it is used database that are not
|
||||
|
||||
@@ -51,5 +51,5 @@ ALTER TABLE `npc_scale_global_base`
|
||||
MODIFY COLUMN `attack_delay` int(11) NOT NULL DEFAULT 0 AFTER `hp_regen_rate`,
|
||||
MODIFY COLUMN `spell_scale` int(11) NOT NULL DEFAULT 100 AFTER `attack_delay`,
|
||||
MODIFY COLUMN `heal_scale` int(11) NOT NULL DEFAULT 100 AFTER `spell_scale`,
|
||||
MODIFY COLUMN `special_abilities` text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '' AFTER `heal_scale`,
|
||||
MODIFY COLUMN special_abilities text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER heal_scale,
|
||||
ADD COLUMN `heroic_strikethrough` int(11) NOT NULL DEFAULT 0 AFTER `heal_scale`;
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
UPDATE `npc_scale_global_base` SET ac = 0 WHERE ac IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET hp = 0 WHERE hp IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET accuracy = 0 WHERE accuracy IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET slow_mitigation = 0 WHERE slow_mitigation IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET attack = 0 WHERE attack IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET strength = 0 WHERE strength IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET stamina = 0 WHERE stamina IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET dexterity = 0 WHERE dexterity IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET agility = 0 WHERE agility IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET intelligence = 0 WHERE intelligence IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET wisdom = 0 WHERE wisdom IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET charisma = 0 WHERE charisma IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET magic_resist = 0 WHERE magic_resist IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET cold_resist = 0 WHERE cold_resist IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET fire_resist = 0 WHERE fire_resist IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET poison_resist = 0 WHERE poison_resist IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET disease_resist = 0 WHERE disease_resist IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET corruption_resist = 0 WHERE corruption_resist IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET physical_resist = 0 WHERE physical_resist IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET min_dmg = 0 WHERE min_dmg IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET max_dmg = 0 WHERE max_dmg IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET hp_regen_rate = 0 WHERE hp_regen_rate IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET attack_delay = 0 WHERE attack_delay IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET physical_resist = 0 WHERE physical_resist IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET spell_scale = 100 WHERE spell_scale IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET heal_scale = 100 WHERE heal_scale IS NULL;
|
||||
UPDATE `npc_scale_global_base` SET special_abilities = '' WHERE special_abilities IS NULL;
|
||||
ALTER TABLE `npc_scale_global_base`
|
||||
MODIFY COLUMN `ac` int(11) NOT NULL DEFAULT 0 AFTER `instance_version_list`,
|
||||
MODIFY COLUMN `hp` bigint(20) NOT NULL DEFAULT 0 AFTER `ac`,
|
||||
MODIFY COLUMN `accuracy` int(11) NOT NULL DEFAULT 0 AFTER `hp`,
|
||||
MODIFY COLUMN `slow_mitigation` int(11) NOT NULL DEFAULT 0 AFTER `accuracy`,
|
||||
MODIFY COLUMN `attack` int(11) NOT NULL DEFAULT 0 AFTER `slow_mitigation`,
|
||||
MODIFY COLUMN `strength` int(11) NOT NULL DEFAULT 0 AFTER `attack`,
|
||||
MODIFY COLUMN `stamina` int(11) NOT NULL DEFAULT 0 AFTER `strength`,
|
||||
MODIFY COLUMN `dexterity` int(11) NOT NULL DEFAULT 0 AFTER `stamina`,
|
||||
MODIFY COLUMN `agility` int(11) NOT NULL DEFAULT 0 AFTER `dexterity`,
|
||||
MODIFY COLUMN `intelligence` int(11) NOT NULL DEFAULT 0 AFTER `agility`,
|
||||
MODIFY COLUMN `wisdom` int(11) NOT NULL DEFAULT 0 AFTER `intelligence`,
|
||||
MODIFY COLUMN `charisma` int(11) NOT NULL DEFAULT 0 AFTER `wisdom`,
|
||||
MODIFY COLUMN `magic_resist` int(11) NOT NULL DEFAULT 0 AFTER `charisma`,
|
||||
MODIFY COLUMN `cold_resist` int(11) NOT NULL DEFAULT 0 AFTER `magic_resist`,
|
||||
MODIFY COLUMN `fire_resist` int(11) NOT NULL DEFAULT 0 AFTER `cold_resist`,
|
||||
MODIFY COLUMN `poison_resist` int(11) NOT NULL DEFAULT 0 AFTER `fire_resist`,
|
||||
MODIFY COLUMN `disease_resist` int(11) NOT NULL DEFAULT 0 AFTER `poison_resist`,
|
||||
MODIFY COLUMN `corruption_resist` int(11) NOT NULL DEFAULT 0 AFTER `disease_resist`,
|
||||
MODIFY COLUMN `physical_resist` int(11) NOT NULL DEFAULT 0 AFTER `corruption_resist`,
|
||||
MODIFY COLUMN `min_dmg` int(11) NOT NULL DEFAULT 0 AFTER `physical_resist`,
|
||||
MODIFY COLUMN `max_dmg` int(11) NOT NULL DEFAULT 0 AFTER `min_dmg`,
|
||||
MODIFY COLUMN `hp_regen_rate` bigint(20) NOT NULL DEFAULT 0 AFTER `max_dmg`,
|
||||
MODIFY COLUMN `attack_delay` int(11) NOT NULL DEFAULT 0 AFTER `hp_regen_rate`,
|
||||
MODIFY COLUMN `hp_regen_per_second` bigint(20) NOT NULL DEFAULT 0 AFTER `hp_regen_rate`,
|
||||
MODIFY COLUMN `spell_scale` int(11) NOT NULL DEFAULT 100 AFTER `attack_delay`,
|
||||
MODIFY COLUMN `heal_scale` int(11) NOT NULL DEFAULT 100 AFTER `spell_scale`,
|
||||
MODIFY COLUMN `heroic_strikethrough` int(11) NOT NULL DEFAULT 0 AFTER `avoidance`,
|
||||
MODIFY COLUMN `avoidance` int(11) unsigned NOT NULL DEFAULT 0 AFTER `heal_scale`,
|
||||
MODIFY COLUMN special_abilities text CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL AFTER heroic_strikethrough;
|
||||
+10
-10
@@ -1448,9 +1448,9 @@ bool ZoneDatabase::LoadAlternateAdvancement(Client *c) {
|
||||
|
||||
int i = 0;
|
||||
for(auto row = results.begin(); row != results.end(); ++row) {
|
||||
uint32 aa = Strings::ToInt(row[0]);
|
||||
uint32 value = Strings::ToInt(row[1]);
|
||||
uint32 charges = Strings::ToInt(row[2]);
|
||||
uint32 aa = Strings::ToUnsignedInt(row[0]);
|
||||
uint32 value = Strings::ToUnsignedInt(row[1]);
|
||||
uint32 charges = Strings::ToUnsignedInt(row[2]);
|
||||
|
||||
auto rank = zone->GetAlternateAdvancementRank(aa);
|
||||
if(!rank) {
|
||||
@@ -1775,7 +1775,7 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
||||
if(results.Success()) {
|
||||
for(auto row = results.begin(); row != results.end(); ++row) {
|
||||
auto ability = new AA::Ability;
|
||||
ability->id = Strings::ToInt(row[0]);
|
||||
ability->id = Strings::ToUnsignedInt(row[0]);
|
||||
ability->name = row[1];
|
||||
ability->category = Strings::ToInt(row[2]);
|
||||
//EQ client has classes left shifted by one bit for some odd reason
|
||||
@@ -1786,8 +1786,8 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
||||
ability->status = Strings::ToInt(row[7]);
|
||||
ability->type = Strings::ToInt(row[8]);
|
||||
ability->charges = Strings::ToInt(row[9]);
|
||||
ability->grant_only = Strings::ToInt(row[10]) != 0 ? true : false;
|
||||
ability->reset_on_death = Strings::ToInt(row[11]) != 0 ? true : false;
|
||||
ability->grant_only = Strings::ToBool(row[10]);
|
||||
ability->reset_on_death = Strings::ToBool(row[11]);
|
||||
ability->first_rank_id = Strings::ToInt(row[12]);
|
||||
ability->first = nullptr;
|
||||
|
||||
@@ -1814,7 +1814,7 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
||||
if(results.Success()) {
|
||||
for(auto row = results.begin(); row != results.end(); ++row) {
|
||||
auto rank = new AA::Rank;
|
||||
rank->id = Strings::ToInt(row[0]);
|
||||
rank->id = Strings::ToUnsignedInt(row[0]);
|
||||
rank->upper_hotkey_sid = Strings::ToInt(row[1]);
|
||||
rank->lower_hotkey_sid = Strings::ToInt(row[2]);
|
||||
rank->title_sid = Strings::ToInt(row[3]);
|
||||
@@ -1846,8 +1846,8 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
||||
if(results.Success()) {
|
||||
for(auto row = results.begin(); row != results.end(); ++row) {
|
||||
AA::RankEffect effect;
|
||||
int rank_id = Strings::ToInt(row[0]);
|
||||
effect.slot = Strings::ToInt(row[1]);
|
||||
uint32 rank_id = Strings::ToUnsignedInt(row[0]);
|
||||
effect.slot = Strings::ToUnsignedInt(row[1]);
|
||||
effect.effect_id = Strings::ToInt(row[2]);
|
||||
effect.base_value = Strings::ToInt(row[3]);
|
||||
effect.limit_value = Strings::ToInt(row[4]);
|
||||
@@ -1871,7 +1871,7 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
|
||||
results = QueryDatabase(query);
|
||||
if(results.Success()) {
|
||||
for(auto row = results.begin(); row != results.end(); ++row) {
|
||||
int rank_id = Strings::ToInt(row[0]);
|
||||
uint32 rank_id = Strings::ToUnsignedInt(row[0]);
|
||||
int aa_id = Strings::ToInt(row[1]);
|
||||
int points = Strings::ToInt(row[2]);
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public:
|
||||
Rank *GetRankByPointsSpent(int current_level);
|
||||
int GetMaxLevel(Mob *who);
|
||||
|
||||
int id;
|
||||
uint32 id;
|
||||
std::string name;
|
||||
int category;
|
||||
int classes;
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public:
|
||||
Rank() { }
|
||||
~Rank() { }
|
||||
|
||||
int id;
|
||||
uint32 id;
|
||||
int upper_hotkey_sid;
|
||||
int lower_hotkey_sid;
|
||||
int title_sid;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace AA
|
||||
|
||||
struct RankEffect
|
||||
{
|
||||
int slot;
|
||||
uint32 slot;
|
||||
int effect_id;
|
||||
int base_value;
|
||||
int limit_value;
|
||||
|
||||
+38
-24
@@ -2505,8 +2505,10 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
bool ownerInGroup = false;
|
||||
if ((give_exp->HasGroup() && give_exp->GetGroup()->IsGroupMember(give_exp->GetUltimateOwner()))
|
||||
|| (give_exp->IsPet() && (give_exp->GetOwner()->IsClient()
|
||||
|| (give_exp->GetOwner()->HasGroup() && give_exp->GetOwner()->GetGroup()->IsGroupMember(give_exp->GetOwner()->GetUltimateOwner())))))
|
||||
|| (give_exp->GetOwner()->HasGroup() && give_exp->GetOwner()->GetGroup()->IsGroupMember(give_exp->GetOwner()->GetUltimateOwner()))))
|
||||
) {
|
||||
ownerInGroup = true;
|
||||
}
|
||||
|
||||
give_exp = give_exp->GetUltimateOwner();
|
||||
|
||||
@@ -2518,20 +2520,23 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
if (give_exp && give_exp->IsTempPet() && give_exp->IsPetOwnerClient()) {
|
||||
if (give_exp->IsNPC() && give_exp->CastToNPC()->GetSwarmOwner()) {
|
||||
Mob* temp_owner = entity_list.GetMobID(give_exp->CastToNPC()->GetSwarmOwner());
|
||||
if (temp_owner)
|
||||
if (temp_owner) {
|
||||
give_exp = temp_owner;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int PlayerCount = 0; // QueryServ Player Counting
|
||||
|
||||
Client *give_exp_client = nullptr;
|
||||
if (give_exp && give_exp->IsClient())
|
||||
if (give_exp && give_exp->IsClient()) {
|
||||
give_exp_client = give_exp->CastToClient();
|
||||
}
|
||||
|
||||
//do faction hits even if we are a merchant, so long as a player killed us
|
||||
if (!IsCharmed() && give_exp_client && !RuleB(NPC, EnableMeritBasedFaction))
|
||||
if (!IsCharmed() && give_exp_client && !RuleB(NPC, EnableMeritBasedFaction)) {
|
||||
hate_list.DoFactionHits(GetNPCFactionID(), GetPrimaryFaction(), GetFactionAmount());
|
||||
}
|
||||
|
||||
bool IsLdonTreasure = (GetClass() == LDON_TREASURE);
|
||||
|
||||
@@ -2559,17 +2564,22 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
}
|
||||
|
||||
/* Send the EVENT_KILLED_MERIT event for all raid members */
|
||||
for (int i = 0; i < MAX_RAID_MEMBERS; i++) {
|
||||
if (kr->members[i].member != nullptr && kr->members[i].member->IsClient()) { // If Group Member is Client
|
||||
Client *c = kr->members[i].member;
|
||||
for (const auto& m : kr->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) { // If Group Member is Client
|
||||
Client *c = m.member;
|
||||
|
||||
c->RecordKilledNPCEvent(this);
|
||||
if (parse->HasQuestSub(GetNPCTypeID(), EVENT_KILLED_MERIT)) {
|
||||
parse->EventNPC(EVENT_KILLED_MERIT, this, c, "killed", 0);
|
||||
}
|
||||
|
||||
if (RuleB(NPC, EnableMeritBasedFaction))
|
||||
if (RuleB(NPC, EnableMeritBasedFaction)) {
|
||||
c->SetFactionLevel(c->CharacterID(), GetNPCFactionID(), c->GetBaseClass(), c->GetBaseRace(), c->GetDeity());
|
||||
}
|
||||
|
||||
PlayerCount++;
|
||||
}
|
||||
@@ -2586,9 +2596,13 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
QS->s1.NPCID = GetNPCTypeID();
|
||||
QS->s1.ZoneID = GetZoneID();
|
||||
QS->s1.Type = 2; // Raid Fight
|
||||
for (int i = 0; i < MAX_RAID_MEMBERS; i++) {
|
||||
if (kr->members[i].member != nullptr && kr->members[i].member->IsClient()) { // If Group Member is Client
|
||||
Client *c = kr->members[i].member;
|
||||
for (const auto& m : kr->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) { // If Group Member is Client
|
||||
Client *c = m.member;
|
||||
QS->Chars[PlayerCount].char_id = c->CharacterID();
|
||||
PlayerCount++;
|
||||
}
|
||||
@@ -2742,34 +2756,34 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
|
||||
Raid* r = entity_list.GetRaidByClient(killer->CastToClient());
|
||||
if (r) {
|
||||
int i = 0;
|
||||
for (int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
||||
for (const auto& m : r->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (r->GetLootType()) {
|
||||
case 0:
|
||||
case 1:
|
||||
if (r->members[x].member && r->members[x].is_raid_leader) {
|
||||
corpse->AllowPlayerLoot(r->members[x].member, i);
|
||||
if (m.member && m.is_raid_leader) {
|
||||
corpse->AllowPlayerLoot(m.member, i);
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (r->members[x].member && r->members[x].is_raid_leader) {
|
||||
corpse->AllowPlayerLoot(r->members[x].member, i);
|
||||
i++;
|
||||
}
|
||||
else if (r->members[x].member && r->members[x].is_group_leader) {
|
||||
corpse->AllowPlayerLoot(r->members[x].member, i);
|
||||
if (m.member && (m.is_raid_leader || m.is_group_leader)) {
|
||||
corpse->AllowPlayerLoot(m.member, i);
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (r->members[x].member && r->members[x].is_looter) {
|
||||
corpse->AllowPlayerLoot(r->members[x].member, i);
|
||||
if (m.member && m.is_looter) {
|
||||
corpse->AllowPlayerLoot(m.member, i);
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (r->members[x].member) {
|
||||
corpse->AllowPlayerLoot(r->members[x].member, i);
|
||||
if (m.member) {
|
||||
corpse->AllowPlayerLoot(m.member, i);
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
|
||||
+489
-399
File diff suppressed because it is too large
Load Diff
+11
-357
@@ -3462,7 +3462,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
|
||||
if(item) {
|
||||
if(strlen(item->IDFile) > 2)
|
||||
ns->spawn.equipment.Primary.Material = Strings::ToInt(&item->IDFile[2]);
|
||||
ns->spawn.equipment.Primary.Material = Strings::ToUnsignedInt(&item->IDFile[2]);
|
||||
|
||||
|
||||
ns->spawn.equipment_tint.Primary.Color = GetEquipmentColor(EQ::textures::weaponPrimary);
|
||||
@@ -3475,7 +3475,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
|
||||
|
||||
if(item) {
|
||||
if(strlen(item->IDFile) > 2)
|
||||
ns->spawn.equipment.Secondary.Material = Strings::ToInt(&item->IDFile[2]);
|
||||
ns->spawn.equipment.Secondary.Material = Strings::ToUnsignedInt(&item->IDFile[2]);
|
||||
|
||||
ns->spawn.equipment_tint.Secondary.Color = GetEquipmentColor(EQ::textures::weaponSecondary);
|
||||
}
|
||||
@@ -7009,354 +7009,6 @@ void Bot::ProcessBotInspectionRequest(Bot* inspectedBot, Client* client) {
|
||||
}
|
||||
}
|
||||
|
||||
void Bot::CalcItemBonuses(StatBonuses* newbon)
|
||||
{
|
||||
const EQ::ItemData* itemtmp = nullptr;
|
||||
|
||||
for (int i = EQ::invslot::BONUS_BEGIN; i <= EQ::invslot::BONUS_STAT_END; ++i) {
|
||||
const EQ::ItemInstance* item = GetBotItem(i);
|
||||
if (item) {
|
||||
AddItemBonuses(item, newbon);
|
||||
}
|
||||
}
|
||||
|
||||
// Caps
|
||||
if (newbon->HPRegen > CalcHPRegenCap())
|
||||
newbon->HPRegen = CalcHPRegenCap();
|
||||
|
||||
if (newbon->ManaRegen > CalcManaRegenCap())
|
||||
newbon->ManaRegen = CalcManaRegenCap();
|
||||
|
||||
if (newbon->EnduranceRegen > CalcEnduranceRegenCap())
|
||||
newbon->EnduranceRegen = CalcEnduranceRegenCap();
|
||||
}
|
||||
|
||||
void Bot::AddItemBonuses(const EQ::ItemInstance *inst, StatBonuses* newbon, bool isAug, bool isTribute, int rec_override) {
|
||||
if (!inst || !inst->IsClassCommon())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (inst->GetAugmentType()==0 && isAug)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const EQ::ItemData *item = inst->GetItem();
|
||||
|
||||
if (!isTribute && !inst->IsEquipable(GetBaseRace(),GetClass()))
|
||||
{
|
||||
if (item->ItemType != EQ::item::ItemTypeFood && item->ItemType != EQ::item::ItemTypeDrink)
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetLevel() < inst->GetItemRequiredLevel(true))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto rec_level = isAug ? rec_override : inst->GetItemRecommendedLevel(true);
|
||||
if (GetLevel() >= rec_level)
|
||||
{
|
||||
newbon->AC += item->AC;
|
||||
newbon->HP += item->HP;
|
||||
newbon->Mana += item->Mana;
|
||||
newbon->Endurance += item->Endur;
|
||||
newbon->ATK += item->Attack;
|
||||
newbon->STR += (item->AStr + item->HeroicStr);
|
||||
newbon->STA += (item->ASta + item->HeroicSta);
|
||||
newbon->DEX += (item->ADex + item->HeroicDex);
|
||||
newbon->AGI += (item->AAgi + item->HeroicAgi);
|
||||
newbon->INT += (item->AInt + item->HeroicInt);
|
||||
newbon->WIS += (item->AWis + item->HeroicWis);
|
||||
newbon->CHA += (item->ACha + item->HeroicCha);
|
||||
|
||||
newbon->MR += (item->MR + item->HeroicMR);
|
||||
newbon->FR += (item->FR + item->HeroicFR);
|
||||
newbon->CR += (item->CR + item->HeroicCR);
|
||||
newbon->PR += (item->PR + item->HeroicPR);
|
||||
newbon->DR += (item->DR + item->HeroicDR);
|
||||
newbon->Corrup += (item->SVCorruption + item->HeroicSVCorrup);
|
||||
|
||||
newbon->STRCapMod += item->HeroicStr;
|
||||
newbon->STACapMod += item->HeroicSta;
|
||||
newbon->DEXCapMod += item->HeroicDex;
|
||||
newbon->AGICapMod += item->HeroicAgi;
|
||||
newbon->INTCapMod += item->HeroicInt;
|
||||
newbon->WISCapMod += item->HeroicWis;
|
||||
newbon->CHACapMod += item->HeroicCha;
|
||||
newbon->MRCapMod += item->HeroicMR;
|
||||
newbon->CRCapMod += item->HeroicFR;
|
||||
newbon->FRCapMod += item->HeroicCR;
|
||||
newbon->PRCapMod += item->HeroicPR;
|
||||
newbon->DRCapMod += item->HeroicDR;
|
||||
newbon->CorrupCapMod += item->HeroicSVCorrup;
|
||||
|
||||
newbon->HeroicSTR += item->HeroicStr;
|
||||
newbon->HeroicSTA += item->HeroicSta;
|
||||
newbon->HeroicDEX += item->HeroicDex;
|
||||
newbon->HeroicAGI += item->HeroicAgi;
|
||||
newbon->HeroicINT += item->HeroicInt;
|
||||
newbon->HeroicWIS += item->HeroicWis;
|
||||
newbon->HeroicCHA += item->HeroicCha;
|
||||
newbon->HeroicMR += item->HeroicMR;
|
||||
newbon->HeroicFR += item->HeroicFR;
|
||||
newbon->HeroicCR += item->HeroicCR;
|
||||
newbon->HeroicPR += item->HeroicPR;
|
||||
newbon->HeroicDR += item->HeroicDR;
|
||||
newbon->HeroicCorrup += item->HeroicSVCorrup;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
int lvl = GetLevel();
|
||||
|
||||
newbon->AC += CalcRecommendedLevelBonus( lvl, rec_level, item->AC );
|
||||
newbon->HP += CalcRecommendedLevelBonus( lvl, rec_level, item->HP );
|
||||
newbon->Mana += CalcRecommendedLevelBonus( lvl, rec_level, item->Mana );
|
||||
newbon->Endurance += CalcRecommendedLevelBonus( lvl, rec_level, item->Endur );
|
||||
newbon->ATK += CalcRecommendedLevelBonus( lvl, rec_level, item->Attack );
|
||||
newbon->STR += CalcRecommendedLevelBonus( lvl, rec_level, (item->AStr + item->HeroicStr) );
|
||||
newbon->STA += CalcRecommendedLevelBonus( lvl, rec_level, (item->ASta + item->HeroicSta) );
|
||||
newbon->DEX += CalcRecommendedLevelBonus( lvl, rec_level, (item->ADex + item->HeroicDex) );
|
||||
newbon->AGI += CalcRecommendedLevelBonus( lvl, rec_level, (item->AAgi + item->HeroicAgi) );
|
||||
newbon->INT += CalcRecommendedLevelBonus( lvl, rec_level, (item->AInt + item->HeroicInt) );
|
||||
newbon->WIS += CalcRecommendedLevelBonus( lvl, rec_level, (item->AWis + item->HeroicWis) );
|
||||
newbon->CHA += CalcRecommendedLevelBonus( lvl, rec_level, (item->ACha + item->HeroicCha) );
|
||||
|
||||
newbon->MR += CalcRecommendedLevelBonus( lvl, rec_level, (item->MR + item->HeroicMR) );
|
||||
newbon->FR += CalcRecommendedLevelBonus( lvl, rec_level, (item->FR + item->HeroicFR) );
|
||||
newbon->CR += CalcRecommendedLevelBonus( lvl, rec_level, (item->CR + item->HeroicCR) );
|
||||
newbon->PR += CalcRecommendedLevelBonus( lvl, rec_level, (item->PR + item->HeroicPR) );
|
||||
newbon->DR += CalcRecommendedLevelBonus( lvl, rec_level, (item->DR + item->HeroicDR) );
|
||||
newbon->Corrup += CalcRecommendedLevelBonus( lvl, rec_level, (item->SVCorruption + item->HeroicSVCorrup) );
|
||||
|
||||
newbon->STRCapMod += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicStr );
|
||||
newbon->STACapMod += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicSta );
|
||||
newbon->DEXCapMod += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicDex );
|
||||
newbon->AGICapMod += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicAgi );
|
||||
newbon->INTCapMod += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicInt );
|
||||
newbon->WISCapMod += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicWis );
|
||||
newbon->CHACapMod += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicCha );
|
||||
newbon->MRCapMod += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicMR );
|
||||
newbon->CRCapMod += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicFR );
|
||||
newbon->FRCapMod += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicCR );
|
||||
newbon->PRCapMod += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicPR );
|
||||
newbon->DRCapMod += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicDR );
|
||||
newbon->CorrupCapMod += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicSVCorrup );
|
||||
|
||||
newbon->HeroicSTR += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicStr );
|
||||
newbon->HeroicSTA += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicSta );
|
||||
newbon->HeroicDEX += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicDex );
|
||||
newbon->HeroicAGI += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicAgi );
|
||||
newbon->HeroicINT += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicInt );
|
||||
newbon->HeroicWIS += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicWis );
|
||||
newbon->HeroicCHA += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicCha );
|
||||
newbon->HeroicMR += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicMR );
|
||||
newbon->HeroicFR += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicFR );
|
||||
newbon->HeroicCR += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicCR );
|
||||
newbon->HeroicPR += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicPR );
|
||||
newbon->HeroicDR += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicDR );
|
||||
newbon->HeroicCorrup += CalcRecommendedLevelBonus( lvl, rec_level, item->HeroicSVCorrup );
|
||||
}
|
||||
|
||||
//FatherNitwit: New style haste, shields, and regens
|
||||
if (newbon->haste < (int32)item->Haste) {
|
||||
newbon->haste = item->Haste;
|
||||
}
|
||||
if (item->Regen > 0)
|
||||
newbon->HPRegen += item->Regen;
|
||||
|
||||
if (item->ManaRegen > 0)
|
||||
newbon->ManaRegen += item->ManaRegen;
|
||||
|
||||
if (item->EnduranceRegen > 0)
|
||||
newbon->EnduranceRegen += item->EnduranceRegen;
|
||||
|
||||
if (item->DamageShield > 0) {
|
||||
if ((newbon->DamageShield + item->DamageShield) > RuleI(Character, ItemDamageShieldCap))
|
||||
newbon->DamageShield = RuleI(Character, ItemDamageShieldCap);
|
||||
else
|
||||
newbon->DamageShield += item->DamageShield;
|
||||
}
|
||||
if (item->SpellShield > 0) {
|
||||
if ((newbon->SpellShield + item->SpellShield) > RuleI(Character, ItemSpellShieldingCap))
|
||||
newbon->SpellShield = RuleI(Character, ItemSpellShieldingCap);
|
||||
else
|
||||
newbon->SpellShield += item->SpellShield;
|
||||
}
|
||||
if (item->Shielding > 0) {
|
||||
if ((newbon->MeleeMitigation + item->Shielding) > RuleI(Character, ItemShieldingCap))
|
||||
newbon->MeleeMitigation = RuleI(Character, ItemShieldingCap);
|
||||
else
|
||||
newbon->MeleeMitigation += item->Shielding;
|
||||
}
|
||||
if (item->StunResist > 0) {
|
||||
if ((newbon->StunResist + item->StunResist) > RuleI(Character, ItemStunResistCap))
|
||||
newbon->StunResist = RuleI(Character, ItemStunResistCap);
|
||||
else
|
||||
newbon->StunResist += item->StunResist;
|
||||
}
|
||||
if (item->StrikeThrough > 0) {
|
||||
if ((newbon->StrikeThrough + item->StrikeThrough) > RuleI(Character, ItemStrikethroughCap))
|
||||
newbon->StrikeThrough = RuleI(Character, ItemStrikethroughCap);
|
||||
else
|
||||
newbon->StrikeThrough += item->StrikeThrough;
|
||||
}
|
||||
if (item->Avoidance > 0) {
|
||||
if ((newbon->AvoidMeleeChance + item->Avoidance) > RuleI(Character, ItemAvoidanceCap))
|
||||
newbon->AvoidMeleeChance = RuleI(Character, ItemAvoidanceCap);
|
||||
else
|
||||
newbon->AvoidMeleeChance += item->Avoidance;
|
||||
}
|
||||
if (item->Accuracy > 0) {
|
||||
if ((newbon->HitChance + item->Accuracy) > RuleI(Character, ItemAccuracyCap))
|
||||
newbon->HitChance = RuleI(Character, ItemAccuracyCap);
|
||||
else
|
||||
newbon->HitChance += item->Accuracy;
|
||||
}
|
||||
if (item->CombatEffects > 0) {
|
||||
if ((newbon->ProcChance + item->CombatEffects) > RuleI(Character, ItemCombatEffectsCap))
|
||||
newbon->ProcChance = RuleI(Character, ItemCombatEffectsCap);
|
||||
else
|
||||
newbon->ProcChance += item->CombatEffects;
|
||||
}
|
||||
if (item->DotShielding > 0) {
|
||||
if ((newbon->DoTShielding + item->DotShielding) > RuleI(Character, ItemDoTShieldingCap))
|
||||
newbon->DoTShielding = RuleI(Character, ItemDoTShieldingCap);
|
||||
else
|
||||
newbon->DoTShielding += item->DotShielding;
|
||||
}
|
||||
|
||||
if (item->HealAmt > 0) {
|
||||
if ((newbon->HealAmt + item->HealAmt) > RuleI(Character, ItemHealAmtCap))
|
||||
newbon->HealAmt = RuleI(Character, ItemHealAmtCap);
|
||||
else
|
||||
newbon->HealAmt += item->HealAmt;
|
||||
}
|
||||
if (item->SpellDmg > 0) {
|
||||
if ((newbon->SpellDmg + item->SpellDmg) > RuleI(Character, ItemSpellDmgCap))
|
||||
newbon->SpellDmg = RuleI(Character, ItemSpellDmgCap);
|
||||
else
|
||||
newbon->SpellDmg += item->SpellDmg;
|
||||
}
|
||||
if (item->Clairvoyance > 0) {
|
||||
if ((newbon->Clairvoyance + item->Clairvoyance) > RuleI(Character, ItemClairvoyanceCap))
|
||||
newbon->Clairvoyance = RuleI(Character, ItemClairvoyanceCap);
|
||||
else
|
||||
newbon->Clairvoyance += item->Clairvoyance;
|
||||
}
|
||||
|
||||
if (item->DSMitigation > 0) {
|
||||
if ((newbon->DSMitigation + item->DSMitigation) > RuleI(Character, ItemDSMitigationCap))
|
||||
newbon->DSMitigation = RuleI(Character, ItemDSMitigationCap);
|
||||
else
|
||||
newbon->DSMitigation += item->DSMitigation;
|
||||
}
|
||||
if (item->Worn.Effect > 0 && item->Worn.Type == EQ::item::ItemEffectWorn) {// latent effects
|
||||
ApplySpellsBonuses(item->Worn.Effect, item->Worn.Level, newbon, 0, item->Worn.Type);
|
||||
}
|
||||
|
||||
if (item->Focus.Effect>0 && (item->Focus.Type == EQ::item::ItemEffectFocus)) { // focus effects
|
||||
ApplySpellsBonuses(item->Focus.Effect, item->Focus.Level, newbon, 0);
|
||||
}
|
||||
|
||||
switch(item->BardType)
|
||||
{
|
||||
case EQ::item::ItemTypeAllInstrumentTypes: // (e.g. Singing Short Sword)
|
||||
{
|
||||
if (item->BardValue > newbon->singingMod)
|
||||
newbon->singingMod = item->BardValue;
|
||||
if (item->BardValue > newbon->brassMod)
|
||||
newbon->brassMod = item->BardValue;
|
||||
if (item->BardValue > newbon->stringedMod)
|
||||
newbon->stringedMod = item->BardValue;
|
||||
if (item->BardValue > newbon->percussionMod)
|
||||
newbon->percussionMod = item->BardValue;
|
||||
if (item->BardValue > newbon->windMod)
|
||||
newbon->windMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case EQ::item::ItemTypeSinging:
|
||||
{
|
||||
if (item->BardValue > newbon->singingMod)
|
||||
newbon->singingMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case EQ::item::ItemTypeWindInstrument:
|
||||
{
|
||||
if (item->BardValue > newbon->windMod)
|
||||
newbon->windMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case EQ::item::ItemTypeStringedInstrument:
|
||||
{
|
||||
if (item->BardValue > newbon->stringedMod)
|
||||
newbon->stringedMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case EQ::item::ItemTypeBrassInstrument:
|
||||
{
|
||||
if (item->BardValue > newbon->brassMod)
|
||||
newbon->brassMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case EQ::item::ItemTypePercussionInstrument:
|
||||
{
|
||||
if (item->BardValue > newbon->percussionMod)
|
||||
newbon->percussionMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (item->SkillModValue != 0 && item->SkillModType <= EQ::skills::HIGHEST_SKILL) {
|
||||
if ((item->SkillModValue > 0 && newbon->skillmod[item->SkillModType] < item->SkillModValue) ||
|
||||
(item->SkillModValue < 0 && newbon->skillmod[item->SkillModType] > item->SkillModValue))
|
||||
{
|
||||
newbon->skillmod[item->SkillModType] = item->SkillModValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (item->ExtraDmgAmt != 0 && item->ExtraDmgSkill <= EQ::skills::HIGHEST_SKILL) {
|
||||
if (
|
||||
RuleI(Character, ItemExtraDmgCap) >= 0 &&
|
||||
(newbon->SkillDamageAmount[item->ExtraDmgSkill] + item->ExtraDmgAmt) > RuleI(Character, ItemExtraDmgCap)
|
||||
) {
|
||||
newbon->SkillDamageAmount[item->ExtraDmgSkill] = RuleI(Character, ItemExtraDmgCap);
|
||||
} else {
|
||||
newbon->SkillDamageAmount[item->ExtraDmgSkill] += item->ExtraDmgAmt;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isAug)
|
||||
{
|
||||
for (int i = EQ::invaug::SOCKET_BEGIN; i <= EQ::invaug::SOCKET_END; i++)
|
||||
AddItemBonuses(inst->GetAugment(i),newbon,true, false, rec_level);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int Bot::CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat)
|
||||
{
|
||||
if ( (reclevel > 0) && (level < reclevel) )
|
||||
{
|
||||
int32 statmod = (level * 10000 / reclevel) * basestat;
|
||||
|
||||
if ( statmod < 0 )
|
||||
{
|
||||
statmod -= 5000;
|
||||
return (statmod/10000);
|
||||
}
|
||||
else
|
||||
{
|
||||
statmod += 5000;
|
||||
return (statmod/10000);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// This method is intended to call all necessary methods to do all bot stat calculations, including spell buffs, equipment, AA bonsues, etc.
|
||||
void Bot::CalcBotStats(bool showtext) {
|
||||
if (!GetBotOwner())
|
||||
@@ -9105,16 +8757,18 @@ std::vector<Mob*> Bot::GetApplySpellList(
|
||||
auto* r = GetRaid();
|
||||
auto group_id = r->GetGroup(GetCleanName());
|
||||
if (r && EQ::ValueWithin(group_id, 0, (MAX_RAID_GROUPS - 1))) {
|
||||
for (auto i = 0; i < MAX_RAID_MEMBERS; i++) {
|
||||
auto* m = r->members[i].member;
|
||||
if (m && m->IsClient() && (!is_raid_group_only || r->GetGroup(m) == group_id)) {
|
||||
l.push_back(m);
|
||||
for (const auto& m : r->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
if (m.member && m.member->IsClient() && (!is_raid_group_only || r->GetGroup(m.member) == group_id)) {
|
||||
l.push_back(m.member);
|
||||
|
||||
if (allow_pets && m->HasPet()) {
|
||||
l.push_back(m->GetPet());
|
||||
if (allow_pets && m.member->HasPet()) {
|
||||
l.push_back(m.member->GetPet());
|
||||
}
|
||||
|
||||
const auto& sbl = entity_list.GetBotListByCharacterID(m->CharacterID());
|
||||
const auto& sbl = entity_list.GetBotListByCharacterID(m.member->CharacterID());
|
||||
for (const auto& b : sbl) {
|
||||
l.push_back(b);
|
||||
}
|
||||
|
||||
+1
-3
@@ -184,9 +184,7 @@ public:
|
||||
void RogueAssassinate(Mob* other) override;
|
||||
void DoClassAttacks(Mob *target, bool IsRiposte=false);
|
||||
void CalcBonuses() override;
|
||||
void CalcItemBonuses(StatBonuses* newbon);
|
||||
void AddItemBonuses(const EQ::ItemInstance *inst, StatBonuses* newbon, bool isAug = false, bool isTribute = false, int rec_override = 0);
|
||||
int CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat);
|
||||
|
||||
void MakePet(uint16 spell_id, const char* pettype, const char *petname = nullptr) override;
|
||||
FACTION_VALUE GetReverseFactionCon(Mob* iOther) override;
|
||||
inline bool IsPet() override { return false; }
|
||||
|
||||
+35
-47
@@ -798,24 +798,21 @@ bool Client::SendAllPackets() {
|
||||
}
|
||||
|
||||
void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req, CLIENT_CONN_STATUS required_state, eqFilterType filter) {
|
||||
if(filter!=FilterNone){
|
||||
//this is incomplete... no support for FilterShowGroupOnly or FilterShowSelfOnly
|
||||
if(GetFilter(filter) == FilterHide)
|
||||
return; //Client has this filter on, no need to send packet
|
||||
if (filter != FilterNone && GetFilter(filter) == FilterHide) {
|
||||
return;
|
||||
}
|
||||
if(client_state != CLIENT_CONNECTED && required_state == CLIENT_CONNECTED){
|
||||
|
||||
if (client_state != CLIENT_CONNECTED && required_state == CLIENT_CONNECTED) {
|
||||
AddPacket(app, ack_req);
|
||||
return;
|
||||
}
|
||||
|
||||
// if the program doesnt care about the status or if the status isnt what we requested
|
||||
if (required_state != CLIENT_CONNECTINGALL && client_state != required_state)
|
||||
{
|
||||
if (required_state != CLIENT_CONNECTINGALL && client_state != required_state) {
|
||||
// todo: save packets for later use
|
||||
AddPacket(app, ack_req);
|
||||
}
|
||||
else if (eqs)
|
||||
{
|
||||
else if (eqs) {
|
||||
eqs->QueuePacket(app, ack_req);
|
||||
}
|
||||
}
|
||||
@@ -4143,42 +4140,32 @@ void Client::UpdateLFP() {
|
||||
|
||||
bool Client::GroupFollow(Client* inviter) {
|
||||
|
||||
if (inviter)
|
||||
{
|
||||
if (inviter) {
|
||||
isgrouped = true;
|
||||
Raid* raid = entity_list.GetRaidByClient(inviter);
|
||||
Raid* iraid = entity_list.GetRaidByClient(this);
|
||||
|
||||
//inviter has a raid don't do group stuff instead do raid stuff!
|
||||
if (raid)
|
||||
{
|
||||
if (raid) {
|
||||
// Suspend the merc while in a raid (maybe a rule could be added for this)
|
||||
if (GetMerc())
|
||||
if (GetMerc()) {
|
||||
GetMerc()->Suspend();
|
||||
}
|
||||
|
||||
uint32 groupToUse = 0xFFFFFFFF;
|
||||
for (int x = 0; x < MAX_RAID_MEMBERS; x++)
|
||||
{
|
||||
if (raid->members[x].member)
|
||||
{
|
||||
//this assumes the inviter is in the zone
|
||||
if (raid->members[x].member == inviter){
|
||||
groupToUse = raid->members[x].group_number;
|
||||
break;
|
||||
}
|
||||
for (const auto& m : raid->members) {
|
||||
if (m.member && m.member == inviter) {
|
||||
groupToUse = m.group_number;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (iraid == raid)
|
||||
{
|
||||
if (iraid == raid) {
|
||||
//both in same raid
|
||||
uint32 ngid = raid->GetGroup(inviter->GetName());
|
||||
if (raid->GroupCount(ngid) < 6)
|
||||
{
|
||||
if (raid->GroupCount(ngid) < 6) {
|
||||
raid->MoveMember(GetName(), ngid);
|
||||
raid->SendGroupDisband(this);
|
||||
//raid->SendRaidGroupAdd(GetName(), ngid);
|
||||
//raid->SendGroupUpdate(this);
|
||||
raid->GroupUpdate(ngid); //break
|
||||
raid->GroupUpdate(ngid);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -8866,16 +8853,15 @@ void Client::ProcessAggroMeter()
|
||||
if (m_aggrometer.set_pct(AggroMeter::AT_Secondary, has_aggro ? cur_tar->GetHateRatio(this, secondary) : secondary ? 100 : 0))
|
||||
add_entry(AggroMeter::AT_Secondary);
|
||||
|
||||
// fuuuuuuuuuuuuuuuuuuuuuuuucckkkkkkkkkkkkkkk raids
|
||||
if (IsRaidGrouped()) {
|
||||
auto raid = GetRaid();
|
||||
if (raid) {
|
||||
auto gid = raid->GetGroup(this);
|
||||
if (gid < 12) {
|
||||
if (gid < MAX_RAID_GROUPS) {
|
||||
int at_id = AggroMeter::AT_Group1;
|
||||
for (int i = 0; i < MAX_RAID_MEMBERS; ++i) {
|
||||
if (raid->members[i].member && raid->members[i].member != this && raid->members[i].group_number == gid) {
|
||||
if (m_aggrometer.set_pct(static_cast<AggroMeter::AggroTypes>(at_id), cur_tar->GetHateRatio(cur_tar->GetTarget(), raid->members[i].member)))
|
||||
for (const auto& m : raid->members) {
|
||||
if (m.member && m.member != this && m.group_number == gid) {
|
||||
if (m_aggrometer.set_pct(static_cast<AggroMeter::AggroTypes>(at_id), cur_tar->GetHateRatio(cur_tar->GetTarget(), m.member)))
|
||||
add_entry(static_cast<AggroMeter::AggroTypes>(at_id));
|
||||
at_id++;
|
||||
if (at_id > AggroMeter::AT_Group5)
|
||||
@@ -10956,11 +10942,14 @@ std::vector<Client *> Client::GetPartyMembers()
|
||||
std::vector<Client *> clients_to_update = {};
|
||||
|
||||
// raid
|
||||
Raid *raid = entity_list.GetRaidByClient(this);
|
||||
if (raid) {
|
||||
for (auto &e : raid->members) {
|
||||
if (e.member && e.member->IsClient()) {
|
||||
clients_to_update.push_back(e.member->CastToClient());
|
||||
if (const auto raid = entity_list.GetRaidByClient(this)) {
|
||||
for (auto &m : raid->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) {
|
||||
clients_to_update.push_back(m.member->CastToClient());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11747,17 +11736,16 @@ std::vector<Mob*> Client::GetApplySpellList(
|
||||
auto* r = GetRaid();
|
||||
auto group_id = r->GetGroup(this);
|
||||
if (r && EQ::ValueWithin(group_id, 0, (MAX_RAID_GROUPS - 1))) {
|
||||
for (auto i = 0; i < MAX_RAID_MEMBERS; i++) {
|
||||
auto* m = r->members[i].member;
|
||||
if (m && m->IsClient() && (!is_raid_group_only || r->GetGroup(m) == group_id)) {
|
||||
l.push_back(m);
|
||||
for (const auto& m : r->members) {
|
||||
if (m.member && m.member->IsClient() && (!is_raid_group_only || r->GetGroup(m.member) == group_id)) {
|
||||
l.push_back(m.member);
|
||||
|
||||
if (allow_pets && m->HasPet()) {
|
||||
l.push_back(m->GetPet());
|
||||
if (allow_pets && m.member->HasPet()) {
|
||||
l.push_back(m.member->GetPet());
|
||||
}
|
||||
|
||||
if (allow_bots) {
|
||||
const auto& sbl = entity_list.GetBotListByCharacterID(m->CharacterID());
|
||||
const auto& sbl = entity_list.GetBotListByCharacterID(m.member->CharacterID());
|
||||
for (const auto& b : sbl) {
|
||||
l.push_back(b);
|
||||
}
|
||||
|
||||
@@ -1645,9 +1645,6 @@ public:
|
||||
|
||||
protected:
|
||||
friend class Mob;
|
||||
void CalcItemBonuses(StatBonuses* newbon);
|
||||
void AddItemBonuses(const EQ::ItemInstance *inst, StatBonuses* newbon, bool isAug = false, bool isTribute = false, int rec_override = 0, bool ammo_slot_item = false);
|
||||
void AdditiveWornBonuses(const EQ::ItemInstance *inst, StatBonuses* newbon, bool isAug = false);
|
||||
void CalcEdibleBonuses(StatBonuses* newbon);
|
||||
void MakeBuffFadePacket(uint16 spell_id, int slot_id, bool send_message = true);
|
||||
bool client_data_loaded;
|
||||
|
||||
@@ -12183,7 +12183,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket* app)
|
||||
uint32 i = raid->GetPlayerIndex(raid_command_packet->leader_name);
|
||||
raid->SetNewRaidLeader(i);
|
||||
raid->HandleBotGroupDisband(c_to_disband->CharacterID());
|
||||
raid->HandleOfflineBots(c_to_disband->CharacterID());
|
||||
raid->HandleOfflineBots(c_to_disband->CharacterID());
|
||||
raid->RemoveMember(raid_command_packet->leader_name);
|
||||
raid->SendGroupDisband(c_to_disband);
|
||||
raid->GroupUpdate(group);
|
||||
|
||||
+2
-2
@@ -1964,10 +1964,10 @@ int Lua_Mob::GetFcDamageAmtIncoming(Lua_Mob caster, int32 spell_id)
|
||||
return self->GetFcDamageAmtIncoming(caster, spell_id);
|
||||
}
|
||||
|
||||
int Lua_Mob::GetSkillDmgAmt(uint16 skill)
|
||||
int Lua_Mob::GetSkillDmgAmt(int skill_id)
|
||||
{
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetSkillDmgAmt(skill);
|
||||
return self->GetSkillDmgAmt(skill_id);
|
||||
}
|
||||
|
||||
void Lua_Mob::SetAllowBeneficial(bool value) {
|
||||
|
||||
+1
-1
@@ -392,7 +392,7 @@ public:
|
||||
int GetModSkillDmgTaken(int skill);
|
||||
int GetSkillDmgTaken(int skill);
|
||||
int GetFcDamageAmtIncoming(Lua_Mob caster, int32 spell_id);
|
||||
int GetSkillDmgAmt(uint16 skill);
|
||||
int GetSkillDmgAmt(int skill_id);
|
||||
void SetAllowBeneficial(bool value);
|
||||
bool GetAllowBeneficial();
|
||||
bool IsBeneficialAllowed(Lua_Mob target);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#ifdef LUA_EQEMU
|
||||
|
||||
#include "../common/data_verification.h"
|
||||
|
||||
#include "lua.hpp"
|
||||
#include <luabind/luabind.hpp>
|
||||
|
||||
@@ -1097,7 +1099,11 @@ int32 Lua_StatBonuses::GetSkillReuseTime(int idx) const {
|
||||
|
||||
int32 Lua_StatBonuses::GetSkillDamageAmount(int idx) const {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->SkillDamageAmount[idx];
|
||||
if (!EQ::ValueWithin(idx, ALL_SKILLS, EQ::skills::HIGHEST_SKILL)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return idx == ALL_SKILLS ? self->SkillDamageAmount[EQ::skills::HIGHEST_SKILL + 1] : self->SkillDamageAmount[idx];
|
||||
}
|
||||
|
||||
int Lua_StatBonuses::GetHPPercCap(int idx) const {
|
||||
|
||||
@@ -85,7 +85,6 @@ volatile bool RunLoops = true;
|
||||
#endif
|
||||
|
||||
extern volatile bool is_zone_loaded;
|
||||
extern bool Critical = false;
|
||||
|
||||
#include "zone_event_scheduler.h"
|
||||
#include "../common/file.h"
|
||||
|
||||
-385
@@ -190,391 +190,6 @@ float Merc::GetDefaultSize() {
|
||||
return MercSize;
|
||||
}
|
||||
|
||||
int Merc::CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat)
|
||||
{
|
||||
if( (reclevel > 0) && (level < reclevel) )
|
||||
{
|
||||
int32 statmod = (level * 10000 / reclevel) * basestat;
|
||||
|
||||
if( statmod < 0 )
|
||||
{
|
||||
statmod -= 5000;
|
||||
return (statmod/10000);
|
||||
}
|
||||
else
|
||||
{
|
||||
statmod += 5000;
|
||||
return (statmod/10000);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Merc::CalcItemBonuses(StatBonuses* newbon) {
|
||||
//memset assumed to be done by caller.
|
||||
|
||||
|
||||
unsigned int i;
|
||||
//should not include 21 (SLOT_AMMO)
|
||||
for (i = EQ::invslot::BONUS_BEGIN; i <= EQ::invslot::BONUS_STAT_END; i++) {
|
||||
if (i == EQ::invslot::slotAmmo)
|
||||
continue;
|
||||
if (equipment[i] == 0)
|
||||
continue;
|
||||
const EQ::ItemData * itm = database.GetItem(equipment[i]);
|
||||
if (itm)
|
||||
AddItemBonuses(itm, newbon);
|
||||
}
|
||||
|
||||
// Caps
|
||||
if(newbon->HPRegen > CalcHPRegenCap())
|
||||
newbon->HPRegen = CalcHPRegenCap();
|
||||
|
||||
if(newbon->ManaRegen > CalcManaRegenCap())
|
||||
newbon->ManaRegen = CalcManaRegenCap();
|
||||
|
||||
if(newbon->EnduranceRegen > CalcEnduranceRegenCap())
|
||||
newbon->EnduranceRegen = CalcEnduranceRegenCap();
|
||||
|
||||
SetAttackTimer();
|
||||
}
|
||||
|
||||
void Merc::AddItemBonuses(const EQ::ItemData *item, StatBonuses* newbon) {
|
||||
|
||||
if(GetLevel() < item->ReqLevel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(GetLevel() >= item->RecLevel)
|
||||
{
|
||||
newbon->AC += item->AC;
|
||||
newbon->HP += item->HP;
|
||||
newbon->Mana += item->Mana;
|
||||
newbon->Endurance += item->Endur;
|
||||
newbon->STR += (item->AStr + item->HeroicStr);
|
||||
newbon->STA += (item->ASta + item->HeroicSta);
|
||||
newbon->DEX += (item->ADex + item->HeroicDex);
|
||||
newbon->AGI += (item->AAgi + item->HeroicAgi);
|
||||
newbon->INT += (item->AInt + item->HeroicInt);
|
||||
newbon->WIS += (item->AWis + item->HeroicWis);
|
||||
newbon->CHA += (item->ACha + item->HeroicCha);
|
||||
|
||||
newbon->MR += (item->MR + item->HeroicMR);
|
||||
newbon->FR += (item->FR + item->HeroicFR);
|
||||
newbon->CR += (item->CR + item->HeroicCR);
|
||||
newbon->PR += (item->PR + item->HeroicPR);
|
||||
newbon->DR += (item->DR + item->HeroicDR);
|
||||
newbon->Corrup += (item->SVCorruption + item->HeroicSVCorrup);
|
||||
|
||||
newbon->STRCapMod += item->HeroicStr;
|
||||
newbon->STACapMod += item->HeroicSta;
|
||||
newbon->DEXCapMod += item->HeroicDex;
|
||||
newbon->AGICapMod += item->HeroicAgi;
|
||||
newbon->INTCapMod += item->HeroicInt;
|
||||
newbon->WISCapMod += item->HeroicWis;
|
||||
newbon->CHACapMod += item->HeroicCha;
|
||||
newbon->MRCapMod += item->HeroicMR;
|
||||
newbon->CRCapMod += item->HeroicFR;
|
||||
newbon->FRCapMod += item->HeroicCR;
|
||||
newbon->PRCapMod += item->HeroicPR;
|
||||
newbon->DRCapMod += item->HeroicDR;
|
||||
newbon->CorrupCapMod += item->HeroicSVCorrup;
|
||||
|
||||
newbon->HeroicSTR += item->HeroicStr;
|
||||
newbon->HeroicSTA += item->HeroicSta;
|
||||
newbon->HeroicDEX += item->HeroicDex;
|
||||
newbon->HeroicAGI += item->HeroicAgi;
|
||||
newbon->HeroicINT += item->HeroicInt;
|
||||
newbon->HeroicWIS += item->HeroicWis;
|
||||
newbon->HeroicCHA += item->HeroicCha;
|
||||
newbon->HeroicMR += item->HeroicMR;
|
||||
newbon->HeroicFR += item->HeroicFR;
|
||||
newbon->HeroicCR += item->HeroicCR;
|
||||
newbon->HeroicPR += item->HeroicPR;
|
||||
newbon->HeroicDR += item->HeroicDR;
|
||||
newbon->HeroicCorrup += item->HeroicSVCorrup;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
int lvl = GetLevel();
|
||||
int reclvl = item->RecLevel;
|
||||
|
||||
newbon->AC += CalcRecommendedLevelBonus( lvl, reclvl, item->AC );
|
||||
newbon->HP += CalcRecommendedLevelBonus( lvl, reclvl, item->HP );
|
||||
newbon->Mana += CalcRecommendedLevelBonus( lvl, reclvl, item->Mana );
|
||||
newbon->Endurance += CalcRecommendedLevelBonus( lvl, reclvl, item->Endur );
|
||||
newbon->STR += CalcRecommendedLevelBonus( lvl, reclvl, (item->AStr + item->HeroicStr) );
|
||||
newbon->STA += CalcRecommendedLevelBonus( lvl, reclvl, (item->ASta + item->HeroicSta) );
|
||||
newbon->DEX += CalcRecommendedLevelBonus( lvl, reclvl, (item->ADex + item->HeroicDex) );
|
||||
newbon->AGI += CalcRecommendedLevelBonus( lvl, reclvl, (item->AAgi + item->HeroicAgi) );
|
||||
newbon->INT += CalcRecommendedLevelBonus( lvl, reclvl, (item->AInt + item->HeroicInt) );
|
||||
newbon->WIS += CalcRecommendedLevelBonus( lvl, reclvl, (item->AWis + item->HeroicWis) );
|
||||
newbon->CHA += CalcRecommendedLevelBonus( lvl, reclvl, (item->ACha + item->HeroicCha) );
|
||||
|
||||
newbon->MR += CalcRecommendedLevelBonus( lvl, reclvl, (item->MR + item->HeroicMR) );
|
||||
newbon->FR += CalcRecommendedLevelBonus( lvl, reclvl, (item->FR + item->HeroicFR) );
|
||||
newbon->CR += CalcRecommendedLevelBonus( lvl, reclvl, (item->CR + item->HeroicCR) );
|
||||
newbon->PR += CalcRecommendedLevelBonus( lvl, reclvl, (item->PR + item->HeroicPR) );
|
||||
newbon->DR += CalcRecommendedLevelBonus( lvl, reclvl, (item->DR + item->HeroicDR) );
|
||||
newbon->Corrup += CalcRecommendedLevelBonus( lvl, reclvl, (item->SVCorruption + item->HeroicSVCorrup) );
|
||||
|
||||
newbon->STRCapMod += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicStr );
|
||||
newbon->STACapMod += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicSta );
|
||||
newbon->DEXCapMod += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicDex );
|
||||
newbon->AGICapMod += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicAgi );
|
||||
newbon->INTCapMod += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicInt );
|
||||
newbon->WISCapMod += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicWis );
|
||||
newbon->CHACapMod += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicCha );
|
||||
newbon->MRCapMod += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicMR );
|
||||
newbon->CRCapMod += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicFR );
|
||||
newbon->FRCapMod += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicCR );
|
||||
newbon->PRCapMod += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicPR );
|
||||
newbon->DRCapMod += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicDR );
|
||||
newbon->CorrupCapMod += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicSVCorrup );
|
||||
|
||||
newbon->HeroicSTR += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicStr );
|
||||
newbon->HeroicSTA += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicSta );
|
||||
newbon->HeroicDEX += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicDex );
|
||||
newbon->HeroicAGI += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicAgi );
|
||||
newbon->HeroicINT += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicInt );
|
||||
newbon->HeroicWIS += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicWis );
|
||||
newbon->HeroicCHA += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicCha );
|
||||
newbon->HeroicMR += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicMR );
|
||||
newbon->HeroicFR += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicFR );
|
||||
newbon->HeroicCR += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicCR );
|
||||
newbon->HeroicPR += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicPR );
|
||||
newbon->HeroicDR += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicDR );
|
||||
newbon->HeroicCorrup += CalcRecommendedLevelBonus( lvl, reclvl, item->HeroicSVCorrup );
|
||||
}
|
||||
|
||||
//FatherNitwit: New style haste, shields, and regens
|
||||
if(newbon->haste < item->Haste) {
|
||||
newbon->haste = item->Haste;
|
||||
}
|
||||
if(item->Regen > 0)
|
||||
newbon->HPRegen += item->Regen;
|
||||
|
||||
if(item->ManaRegen > 0)
|
||||
newbon->ManaRegen += item->ManaRegen;
|
||||
|
||||
if(item->EnduranceRegen > 0)
|
||||
newbon->EnduranceRegen += item->EnduranceRegen;
|
||||
|
||||
if(item->Attack > 0) {
|
||||
|
||||
unsigned int cap = RuleI(Character, ItemATKCap);
|
||||
cap += itembonuses.ItemATKCap + spellbonuses.ItemATKCap + aabonuses.ItemATKCap;
|
||||
|
||||
if((newbon->ATK + item->Attack) > cap)
|
||||
newbon->ATK = RuleI(Character, ItemATKCap);
|
||||
else
|
||||
newbon->ATK += item->Attack;
|
||||
}
|
||||
if(item->DamageShield > 0) {
|
||||
if((newbon->DamageShield + item->DamageShield) > RuleI(Character, ItemDamageShieldCap))
|
||||
newbon->DamageShield = RuleI(Character, ItemDamageShieldCap);
|
||||
else
|
||||
newbon->DamageShield += item->DamageShield;
|
||||
}
|
||||
if(item->SpellShield > 0) {
|
||||
if((newbon->SpellShield + item->SpellShield) > RuleI(Character, ItemSpellShieldingCap))
|
||||
newbon->SpellShield = RuleI(Character, ItemSpellShieldingCap);
|
||||
else
|
||||
newbon->SpellShield += item->SpellShield;
|
||||
}
|
||||
if(item->Shielding > 0) {
|
||||
if((newbon->MeleeMitigation + item->Shielding) > RuleI(Character, ItemShieldingCap))
|
||||
newbon->MeleeMitigation = RuleI(Character, ItemShieldingCap);
|
||||
else
|
||||
newbon->MeleeMitigation += item->Shielding;
|
||||
}
|
||||
if(item->StunResist > 0) {
|
||||
if((newbon->StunResist + item->StunResist) > RuleI(Character, ItemStunResistCap))
|
||||
newbon->StunResist = RuleI(Character, ItemStunResistCap);
|
||||
else
|
||||
newbon->StunResist += item->StunResist;
|
||||
}
|
||||
if(item->StrikeThrough > 0) {
|
||||
if((newbon->StrikeThrough + item->StrikeThrough) > RuleI(Character, ItemStrikethroughCap))
|
||||
newbon->StrikeThrough = RuleI(Character, ItemStrikethroughCap);
|
||||
else
|
||||
newbon->StrikeThrough += item->StrikeThrough;
|
||||
}
|
||||
if(item->Avoidance > 0) {
|
||||
if((newbon->AvoidMeleeChance + item->Avoidance) > RuleI(Character, ItemAvoidanceCap))
|
||||
newbon->AvoidMeleeChance = RuleI(Character, ItemAvoidanceCap);
|
||||
else
|
||||
newbon->AvoidMeleeChance += item->Avoidance;
|
||||
}
|
||||
if(item->Accuracy > 0) {
|
||||
if((newbon->HitChance + item->Accuracy) > RuleI(Character, ItemAccuracyCap))
|
||||
newbon->HitChance = RuleI(Character, ItemAccuracyCap);
|
||||
else
|
||||
newbon->HitChance += item->Accuracy;
|
||||
}
|
||||
if(item->CombatEffects > 0) {
|
||||
if((newbon->ProcChance + item->CombatEffects) > RuleI(Character, ItemCombatEffectsCap))
|
||||
newbon->ProcChance = RuleI(Character, ItemCombatEffectsCap);
|
||||
else
|
||||
newbon->ProcChance += item->CombatEffects;
|
||||
}
|
||||
if(item->DotShielding > 0) {
|
||||
if((newbon->DoTShielding + item->DotShielding) > RuleI(Character, ItemDoTShieldingCap))
|
||||
newbon->DoTShielding = RuleI(Character, ItemDoTShieldingCap);
|
||||
else
|
||||
newbon->DoTShielding += item->DotShielding;
|
||||
}
|
||||
|
||||
if(item->HealAmt > 0) {
|
||||
if((newbon->HealAmt + item->HealAmt) > RuleI(Character, ItemHealAmtCap))
|
||||
newbon->HealAmt = RuleI(Character, ItemHealAmtCap);
|
||||
else
|
||||
newbon->HealAmt += item->HealAmt;
|
||||
}
|
||||
if(item->SpellDmg > 0) {
|
||||
if((newbon->SpellDmg + item->SpellDmg) > RuleI(Character, ItemSpellDmgCap))
|
||||
newbon->SpellDmg = RuleI(Character, ItemSpellDmgCap);
|
||||
else
|
||||
newbon->SpellDmg += item->SpellDmg;
|
||||
}
|
||||
if(item->Clairvoyance > 0) {
|
||||
if((newbon->Clairvoyance + item->Clairvoyance) > RuleI(Character, ItemClairvoyanceCap))
|
||||
newbon->Clairvoyance = RuleI(Character, ItemClairvoyanceCap);
|
||||
else
|
||||
newbon->Clairvoyance += item->Clairvoyance;
|
||||
}
|
||||
|
||||
if(item->DSMitigation > 0) {
|
||||
if((newbon->DSMitigation + item->DSMitigation) > RuleI(Character, ItemDSMitigationCap))
|
||||
newbon->DSMitigation = RuleI(Character, ItemDSMitigationCap);
|
||||
else
|
||||
newbon->DSMitigation += item->DSMitigation;
|
||||
}
|
||||
if (item->Worn.Effect>0 && (item->Worn.Type == EQ::item::ItemEffectWorn)) { // latent effects
|
||||
ApplySpellsBonuses(item->Worn.Effect, item->Worn.Level, newbon, 0, item->Worn.Type);
|
||||
}
|
||||
|
||||
if (item->Focus.Effect>0 && (item->Focus.Type == EQ::item::ItemEffectFocus)) { // focus effects
|
||||
ApplySpellsBonuses(item->Focus.Effect, item->Focus.Level, newbon, 0);
|
||||
}
|
||||
|
||||
switch(item->BardType)
|
||||
{
|
||||
case 51: /* All (e.g. Singing Short Sword) */
|
||||
{
|
||||
if(item->BardValue > newbon->singingMod)
|
||||
newbon->singingMod = item->BardValue;
|
||||
if(item->BardValue > newbon->brassMod)
|
||||
newbon->brassMod = item->BardValue;
|
||||
if(item->BardValue > newbon->stringedMod)
|
||||
newbon->stringedMod = item->BardValue;
|
||||
if(item->BardValue > newbon->percussionMod)
|
||||
newbon->percussionMod = item->BardValue;
|
||||
if(item->BardValue > newbon->windMod)
|
||||
newbon->windMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case 50: /* Singing */
|
||||
{
|
||||
if(item->BardValue > newbon->singingMod)
|
||||
newbon->singingMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case 23: /* Wind */
|
||||
{
|
||||
if(item->BardValue > newbon->windMod)
|
||||
newbon->windMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case 24: /* stringed */
|
||||
{
|
||||
if(item->BardValue > newbon->stringedMod)
|
||||
newbon->stringedMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case 25: /* brass */
|
||||
{
|
||||
if(item->BardValue > newbon->brassMod)
|
||||
newbon->brassMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
case 26: /* Percussion */
|
||||
{
|
||||
if(item->BardValue > newbon->percussionMod)
|
||||
newbon->percussionMod = item->BardValue;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (item->SkillModValue != 0 && item->SkillModType <= EQ::skills::HIGHEST_SKILL){
|
||||
if ((item->SkillModValue > 0 && newbon->skillmod[item->SkillModType] < item->SkillModValue) ||
|
||||
(item->SkillModValue < 0 && newbon->skillmod[item->SkillModType] > item->SkillModValue))
|
||||
{
|
||||
newbon->skillmod[item->SkillModType] = item->SkillModValue;
|
||||
}
|
||||
}
|
||||
|
||||
// Add Item Faction Mods
|
||||
if (item->FactionMod1)
|
||||
{
|
||||
if (item->FactionAmt1 > 0 && item->FactionAmt1 > GetItemFactionBonus(item->FactionMod1))
|
||||
{
|
||||
AddItemFactionBonus(item->FactionMod1, item->FactionAmt1);
|
||||
}
|
||||
else if (item->FactionAmt1 < 0 && item->FactionAmt1 < GetItemFactionBonus(item->FactionMod1))
|
||||
{
|
||||
AddItemFactionBonus(item->FactionMod1, item->FactionAmt1);
|
||||
}
|
||||
}
|
||||
if (item->FactionMod2)
|
||||
{
|
||||
if (item->FactionAmt2 > 0 && item->FactionAmt2 > GetItemFactionBonus(item->FactionMod2))
|
||||
{
|
||||
AddItemFactionBonus(item->FactionMod2, item->FactionAmt2);
|
||||
}
|
||||
else if (item->FactionAmt2 < 0 && item->FactionAmt2 < GetItemFactionBonus(item->FactionMod2))
|
||||
{
|
||||
AddItemFactionBonus(item->FactionMod2, item->FactionAmt2);
|
||||
}
|
||||
}
|
||||
if (item->FactionMod3)
|
||||
{
|
||||
if (item->FactionAmt3 > 0 && item->FactionAmt3 > GetItemFactionBonus(item->FactionMod3))
|
||||
{
|
||||
AddItemFactionBonus(item->FactionMod3, item->FactionAmt3);
|
||||
}
|
||||
else if (item->FactionAmt3 < 0 && item->FactionAmt3 < GetItemFactionBonus(item->FactionMod3))
|
||||
{
|
||||
AddItemFactionBonus(item->FactionMod3, item->FactionAmt3);
|
||||
}
|
||||
}
|
||||
if (item->FactionMod4)
|
||||
{
|
||||
if (item->FactionAmt4 > 0 && item->FactionAmt4 > GetItemFactionBonus(item->FactionMod4))
|
||||
{
|
||||
AddItemFactionBonus(item->FactionMod4, item->FactionAmt4);
|
||||
}
|
||||
else if (item->FactionAmt4 < 0 && item->FactionAmt4 < GetItemFactionBonus(item->FactionMod4))
|
||||
{
|
||||
AddItemFactionBonus(item->FactionMod4, item->FactionAmt4);
|
||||
}
|
||||
}
|
||||
|
||||
if (item->ExtraDmgAmt != 0 && item->ExtraDmgSkill <= EQ::skills::HIGHEST_SKILL) {
|
||||
if (
|
||||
RuleI(Character, ItemExtraDmgCap) >= 0 &&
|
||||
(newbon->SkillDamageAmount[item->ExtraDmgSkill] + item->ExtraDmgAmt) > RuleI(Character, ItemExtraDmgCap)
|
||||
) {
|
||||
newbon->SkillDamageAmount[item->ExtraDmgSkill] = RuleI(Character, ItemExtraDmgCap);
|
||||
} else {
|
||||
newbon->SkillDamageAmount[item->ExtraDmgSkill] += item->ExtraDmgAmt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int Merc::GroupLeadershipAAHealthEnhancement()
|
||||
{
|
||||
Group *g = GetGroup();
|
||||
|
||||
@@ -268,10 +268,6 @@ public:
|
||||
bool FindTarget();
|
||||
|
||||
protected:
|
||||
void CalcItemBonuses(StatBonuses* newbon);
|
||||
void AddItemBonuses(const EQ::ItemData *item, StatBonuses* newbon);
|
||||
int CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat);
|
||||
|
||||
int64 GetFocusEffect(focusType type, uint16 spell_id, bool from_buff_tic = false);
|
||||
|
||||
std::vector<MercSpell> merc_spells;
|
||||
|
||||
+33
-7
@@ -16,6 +16,7 @@
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "../common/data_verification.h"
|
||||
#include "../common/spdat.h"
|
||||
#include "../common/strings.h"
|
||||
#include "../common/misc_functions.h"
|
||||
@@ -3999,7 +4000,7 @@ void Mob::QuestJournalledSay(Client *QuestInitiator, const char *str, Journal::O
|
||||
|
||||
const char *Mob::GetCleanName()
|
||||
{
|
||||
if (!strlen(clean_name)) {
|
||||
if (!strlen(clean_name)) {
|
||||
CleanMobName(GetName(), clean_name);
|
||||
}
|
||||
|
||||
@@ -5549,16 +5550,41 @@ int16 Mob::GetSkillReuseTime(uint16 skill)
|
||||
return skill_reduction;
|
||||
}
|
||||
|
||||
int Mob::GetSkillDmgAmt(uint16 skill)
|
||||
int Mob::GetSkillDmgAmt(int skill_id)
|
||||
{
|
||||
int skill_dmg = 0;
|
||||
|
||||
// All skill dmg(only spells do this) + Skill specific
|
||||
skill_dmg += spellbonuses.SkillDamageAmount[EQ::skills::HIGHEST_SKILL + 1] + itembonuses.SkillDamageAmount[EQ::skills::HIGHEST_SKILL + 1] + aabonuses.SkillDamageAmount[EQ::skills::HIGHEST_SKILL + 1]
|
||||
+ itembonuses.SkillDamageAmount[skill] + spellbonuses.SkillDamageAmount[skill] + aabonuses.SkillDamageAmount[skill];
|
||||
if (!EQ::ValueWithin(skill_id, ALL_SKILLS, EQ::skills::HIGHEST_SKILL)) {
|
||||
return skill_dmg;
|
||||
}
|
||||
|
||||
skill_dmg += spellbonuses.SkillDamageAmount2[EQ::skills::HIGHEST_SKILL + 1] + itembonuses.SkillDamageAmount2[EQ::skills::HIGHEST_SKILL + 1]
|
||||
+ itembonuses.SkillDamageAmount2[skill] + spellbonuses.SkillDamageAmount2[skill];
|
||||
skill_dmg += (
|
||||
spellbonuses.SkillDamageAmount[EQ::skills::HIGHEST_SKILL + 1] +
|
||||
itembonuses.SkillDamageAmount[EQ::skills::HIGHEST_SKILL + 1] +
|
||||
aabonuses.SkillDamageAmount[EQ::skills::HIGHEST_SKILL + 1]
|
||||
);
|
||||
|
||||
if (skill_id != ALL_SKILLS) {
|
||||
skill_dmg += (
|
||||
itembonuses.SkillDamageAmount[skill_id] +
|
||||
spellbonuses.SkillDamageAmount[skill_id] +
|
||||
aabonuses.SkillDamageAmount[skill_id]
|
||||
);
|
||||
}
|
||||
|
||||
skill_dmg += (
|
||||
spellbonuses.SkillDamageAmount2[EQ::skills::HIGHEST_SKILL + 1] +
|
||||
itembonuses.SkillDamageAmount2[EQ::skills::HIGHEST_SKILL + 1] +
|
||||
aabonuses.SkillDamageAmount2[EQ::skills::HIGHEST_SKILL + 1]
|
||||
);
|
||||
|
||||
if (skill_id != ALL_SKILLS) {
|
||||
skill_dmg += (
|
||||
itembonuses.SkillDamageAmount2[skill_id] +
|
||||
spellbonuses.SkillDamageAmount2[skill_id] +
|
||||
aabonuses.SkillDamageAmount2[skill_id]
|
||||
);
|
||||
}
|
||||
|
||||
return skill_dmg;
|
||||
}
|
||||
|
||||
+6
-3
@@ -664,8 +664,6 @@ public:
|
||||
virtual int32 CalcItemATKCap() { return 0; }
|
||||
virtual bool IsSitting() const { return false; }
|
||||
|
||||
int CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat);
|
||||
|
||||
void CopyHateList(Mob* to);
|
||||
|
||||
//Group
|
||||
@@ -953,7 +951,7 @@ public:
|
||||
int16 GetMeleeDmgPositionMod(Mob* defender);
|
||||
int16 GetSkillReuseTime(uint16 skill);
|
||||
int GetCriticalChanceBonus(uint16 skill);
|
||||
int GetSkillDmgAmt(uint16 skill);
|
||||
int GetSkillDmgAmt(int skill_id);
|
||||
int16 GetPositionalDmgAmt(Mob* defender);
|
||||
inline bool CanBlockSpell() const { return(spellbonuses.FocusEffects[focusBlockNextSpell]); }
|
||||
bool DoHPToManaCovert(int32 mana_cost = 0);
|
||||
@@ -1378,6 +1376,11 @@ public:
|
||||
void ApplyAABonuses(const AA::Rank &rank, StatBonuses* newbon);
|
||||
bool CheckAATimer(int timer);
|
||||
|
||||
void CalcItemBonuses(StatBonuses* b);
|
||||
void AddItemBonuses(const EQ::ItemInstance* inst, StatBonuses* b, bool is_augment = false, bool is_tribute = false, int recommended_level_override = 0, bool is_ammo_item = false);
|
||||
void AdditiveWornBonuses(const EQ::ItemInstance* inst, StatBonuses* b, bool is_augment = false);
|
||||
int CalcRecommendedLevelBonus(uint8 current_level, uint8 recommended_level, int base_stat);
|
||||
|
||||
int NPCAssistCap() { return npc_assist_cap; }
|
||||
void AddAssistCap() { ++npc_assist_cap; }
|
||||
void DelAssistCap() { --npc_assist_cap; }
|
||||
|
||||
@@ -162,7 +162,6 @@ public:
|
||||
virtual void SetTarget(Mob* mob);
|
||||
virtual uint16 GetSkill(EQ::skills::SkillType skill_num) const { if (skill_num <= EQ::skills::HIGHEST_SKILL) { return skills[skill_num]; } return 0; }
|
||||
|
||||
void CalcItemBonuses(StatBonuses *newbon);
|
||||
virtual void CalcBonuses();
|
||||
virtual int GetCurrentBuffSlots() const { return RuleI(Spells, MaxBuffSlotsNPC); }
|
||||
virtual int GetCurrentSongSlots() const { return RuleI(Spells, MaxSongSlotsNPC); }
|
||||
|
||||
+1
-1
@@ -2517,7 +2517,7 @@ void Perl_Mob_ApplySpellBuff(Mob* self, int spell_id, int duration) // @categori
|
||||
self->ApplySpellBuff(spell_id, duration);
|
||||
}
|
||||
|
||||
int Perl_Mob_GetSkillDmgAmt(Mob* self, uint16 skill_id)
|
||||
int Perl_Mob_GetSkillDmgAmt(Mob* self, int skill_id)
|
||||
{
|
||||
return self->GetSkillDmgAmt(skill_id);
|
||||
}
|
||||
|
||||
+7
-3
@@ -448,9 +448,13 @@ void QuestManager::ZoneRaid(const char *zone_name) {
|
||||
initiator->MoveZone(zone_name);
|
||||
} else {
|
||||
auto client_raid = initiator->GetRaid();
|
||||
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) {
|
||||
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) {
|
||||
auto raid_member = client_raid->members[member_index].member->CastToClient();
|
||||
for (const auto& m : client_raid->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) {
|
||||
auto raid_member = m.member->CastToClient();
|
||||
raid_member->MoveZone(zone_name);
|
||||
}
|
||||
}
|
||||
|
||||
+43
-4
@@ -611,9 +611,8 @@ void Raid::RaidGroupSay(const char *msg, Client *c, uint8 language, uint8 lang_s
|
||||
|
||||
uint32 Raid::GetPlayerIndex(const char *name)
|
||||
{
|
||||
for(int x = 0; x < MAX_RAID_MEMBERS; x++)
|
||||
{
|
||||
if(strcmp(name, members[x].member_name) == 0) {
|
||||
for (int x = 0; x < MAX_RAID_MEMBERS; x++) {
|
||||
if (strcmp(name, members[x].member_name) == 0) {
|
||||
return x;
|
||||
}
|
||||
}
|
||||
@@ -832,6 +831,10 @@ void Raid::BalanceMana(int32 penalty, uint32 gid, float range, Mob* caster, int3
|
||||
manataken /= numMem;
|
||||
|
||||
for (const auto& m : members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.group_number == gid) {
|
||||
distance = DistanceSquared(caster->GetPosition(), m.member->GetPosition());
|
||||
|
||||
@@ -875,6 +878,10 @@ void Raid::SplitMoney(uint32 gid, uint32 copper, uint32 silver, uint32 gold, uin
|
||||
|
||||
uint8 member_count = 0;
|
||||
for (const auto& m : members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.group_number == gid && m.member->IsClient()) {
|
||||
member_count++;
|
||||
}
|
||||
@@ -914,6 +921,10 @@ void Raid::SplitMoney(uint32 gid, uint32 copper, uint32 silver, uint32 gold, uin
|
||||
auto platinum_split = platinum / member_count;
|
||||
|
||||
for (const auto& m : members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.group_number == gid && m.member->IsClient()) { // If Group Member is Client
|
||||
m.member->AddMoneyToPP(
|
||||
copper_split,
|
||||
@@ -952,6 +963,10 @@ void Raid::SplitMoney(uint32 gid, uint32 copper, uint32 silver, uint32 gold, uin
|
||||
void Raid::TeleportGroup(Mob* sender, uint32 zoneID, uint16 instance_id, float x, float y, float z, float heading, uint32 gid)
|
||||
{
|
||||
for (const auto& m : members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.group_number == gid && m.member->IsClient()) {
|
||||
m.member->MovePC(zoneID, instance_id, x, y, z, heading, 0, ZoneSolicited);
|
||||
}
|
||||
@@ -961,6 +976,10 @@ void Raid::TeleportGroup(Mob* sender, uint32 zoneID, uint16 instance_id, float x
|
||||
void Raid::TeleportRaid(Mob* sender, uint32 zoneID, uint16 instance_id, float x, float y, float z, float heading)
|
||||
{
|
||||
for (const auto& m : members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) {
|
||||
m.member->MovePC(zoneID, instance_id, x, y, z, heading, 0, ZoneSolicited);
|
||||
}
|
||||
@@ -981,6 +1000,10 @@ void Raid::AddRaidLooter(const char* looter)
|
||||
auto results = database.QueryDatabase(query);
|
||||
|
||||
for (auto& m : members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strcmp(looter, m.member_name) == 0) {
|
||||
m.is_looter = true;
|
||||
break;
|
||||
@@ -1002,6 +1025,10 @@ void Raid::RemoveRaidLooter(const char* looter)
|
||||
auto results = database.QueryDatabase(query);
|
||||
|
||||
for (auto& m: members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strcmp(looter, m.member_name) == 0) {
|
||||
m.is_looter = false;
|
||||
break;
|
||||
@@ -1258,6 +1285,10 @@ void Raid::SendBulkRaid(Client *to)
|
||||
void Raid::QueuePacket(const EQApplicationPacket *app, bool ack_req)
|
||||
{
|
||||
for (const auto& m : members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) {
|
||||
m.member->QueuePacket(app, ack_req);
|
||||
}
|
||||
@@ -1332,7 +1363,7 @@ void Raid::SendGroupUpdate(Client *to)
|
||||
gu->action = groupActUpdate;
|
||||
int i = 0;
|
||||
uint32 grp = GetGroup(to->GetName());
|
||||
if (grp >= MAX_RAID_MEMBERS) {
|
||||
if (grp >= MAX_RAID_GROUPS) {
|
||||
safe_delete(outapp);
|
||||
return;
|
||||
}
|
||||
@@ -1502,6 +1533,10 @@ void Raid::SendRaidMOTD()
|
||||
}
|
||||
|
||||
for (const auto& m: members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member) {
|
||||
SendRaidMOTD(m.member);
|
||||
}
|
||||
@@ -1911,6 +1946,10 @@ const char *Raid::GetClientNameByIndex(uint8 index)
|
||||
void Raid::RaidMessageString(Mob* sender, uint32 type, uint32 string_id, const char* message,const char* message2,const char* message3,const char* message4,const char* message5,const char* message6,const char* message7,const char* message8,const char* message9, uint32 distance)
|
||||
{
|
||||
for (const auto& m : members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient() && m.member != sender) {
|
||||
m.member->MessageString(type, string_id, message, message2, message3, message4, message5, message6,
|
||||
message7, message8, message9, distance);
|
||||
|
||||
+138
-103
@@ -294,12 +294,19 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
case VoiceMacroRaid: {
|
||||
Raid *r = entity_list.GetRaidByID(svm->RaidID);
|
||||
|
||||
if (!r)
|
||||
if (!r) {
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_RAID_MEMBERS; i++)
|
||||
if (r->members[i].member)
|
||||
r->members[i].member->QueuePacket(outapp);
|
||||
for (const auto& m: r->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member) {
|
||||
m.member->QueuePacket(outapp);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -1055,7 +1062,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
{
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct));
|
||||
GroupJoin_Struct* outgj = (GroupJoin_Struct*)outapp->pBuffer;
|
||||
auto outgj = (GroupJoin_Struct*)outapp->pBuffer;
|
||||
strcpy(outgj->membername, Inviter->GetName());
|
||||
strcpy(outgj->yourname, Inviter->GetName());
|
||||
outgj->action = groupActInviteInitial; // 'You have formed the group'.
|
||||
@@ -1095,7 +1102,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
Inviter->CastToClient()->UpdateLFP();
|
||||
|
||||
auto pack2 = new ServerPacket(ServerOP_GroupJoin, sizeof(ServerGroupJoin_Struct));
|
||||
ServerGroupJoin_Struct* gj = (ServerGroupJoin_Struct*)pack2->pBuffer;
|
||||
auto gj = (ServerGroupJoin_Struct*)pack2->pBuffer;
|
||||
gj->gid = group->GetID();
|
||||
gj->zoneid = zone->GetZoneID();
|
||||
gj->instance_id = zone->GetInstanceID();
|
||||
@@ -1213,7 +1220,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_GroupJoin: {
|
||||
ServerGroupJoin_Struct* gj = (ServerGroupJoin_Struct*)pack->pBuffer;
|
||||
auto gj = (ServerGroupJoin_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
if (gj->zoneid == zone->GetZoneID() && gj->instance_id == zone->GetInstanceID())
|
||||
break;
|
||||
@@ -1259,7 +1266,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_RaidAdd: {
|
||||
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
|
||||
break;
|
||||
@@ -1274,7 +1281,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_RaidRemove: {
|
||||
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
|
||||
break;
|
||||
@@ -1294,7 +1301,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_RaidDisband: {
|
||||
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
|
||||
break;
|
||||
@@ -1309,7 +1316,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_RaidLockFlag: {
|
||||
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
|
||||
break;
|
||||
@@ -1326,7 +1333,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_RaidChangeGroup: {
|
||||
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
|
||||
break;
|
||||
@@ -1354,7 +1361,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_UpdateGroup: {
|
||||
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
|
||||
break;
|
||||
@@ -1367,7 +1374,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_RaidGroupLeader: {
|
||||
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
|
||||
break;
|
||||
@@ -1375,7 +1382,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_RaidLeader: {
|
||||
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
|
||||
break;
|
||||
@@ -1395,7 +1402,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_DetailsChange: {
|
||||
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
|
||||
break;
|
||||
@@ -1410,7 +1417,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_RaidGroupDisband: {
|
||||
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
|
||||
break;
|
||||
@@ -1420,7 +1427,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
{
|
||||
auto outapp =
|
||||
new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupUpdate_Struct));
|
||||
GroupUpdate_Struct* gu = (GroupUpdate_Struct*)outapp->pBuffer;
|
||||
auto gu = (GroupUpdate_Struct*)outapp->pBuffer;
|
||||
gu->action = groupActDisband;
|
||||
strn0cpy(gu->leadersname, c->GetName(), 64);
|
||||
strn0cpy(gu->yourname, c->GetName(), 64);
|
||||
@@ -1430,27 +1437,26 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_RaidGroupAdd: {
|
||||
ServerRaidGroupAction_Struct* rga = (ServerRaidGroupAction_Struct*)pack->pBuffer;
|
||||
auto rga = (ServerRaidGroupAction_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
Raid *r = entity_list.GetRaidByID(rga->rid);
|
||||
if (r) {
|
||||
r->LearnMembers();
|
||||
r->VerifyRaid();
|
||||
auto outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct));
|
||||
GroupJoin_Struct* gj = (GroupJoin_Struct*)outapp->pBuffer;
|
||||
auto gj = (GroupJoin_Struct*)outapp->pBuffer;
|
||||
strn0cpy(gj->membername, rga->membername, 64);
|
||||
gj->action = groupActJoin;
|
||||
|
||||
for (int x = 0; x < MAX_RAID_MEMBERS; x++)
|
||||
{
|
||||
if (r->members[x].member)
|
||||
{
|
||||
if (strcmp(r->members[x].member->GetName(), rga->membername) != 0) {
|
||||
if ((rga->gid < 12) && rga->gid == r->members[x].group_number)
|
||||
{
|
||||
strn0cpy(gj->yourname, r->members[x].member->GetName(), 64);
|
||||
r->members[x].member->QueuePacket(outapp);
|
||||
}
|
||||
for (const auto& m : r->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && strcmp(m.member->GetName(), rga->membername) != 0) {
|
||||
if ((rga->gid < MAX_RAID_GROUPS) && rga->gid == m.group_number) {
|
||||
strn0cpy(gj->yourname, m.member->GetName(), 64);
|
||||
m.member->QueuePacket(outapp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1460,27 +1466,26 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_RaidGroupRemove: {
|
||||
ServerRaidGroupAction_Struct* rga = (ServerRaidGroupAction_Struct*)pack->pBuffer;
|
||||
auto rga = (ServerRaidGroupAction_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
Raid *r = entity_list.GetRaidByID(rga->rid);
|
||||
if (r) {
|
||||
r->LearnMembers();
|
||||
r->VerifyRaid();
|
||||
auto outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct));
|
||||
GroupJoin_Struct* gj = (GroupJoin_Struct*)outapp->pBuffer;
|
||||
auto gj = (GroupJoin_Struct*)outapp->pBuffer;
|
||||
strn0cpy(gj->membername, rga->membername, 64);
|
||||
gj->action = groupActLeave;
|
||||
|
||||
for (int x = 0; x < MAX_RAID_MEMBERS; x++)
|
||||
{
|
||||
if (r->members[x].member)
|
||||
{
|
||||
if (strcmp(r->members[x].member->GetName(), rga->membername) != 0) {
|
||||
if ((rga->gid < 12) && rga->gid == r->members[x].group_number)
|
||||
{
|
||||
strn0cpy(gj->yourname, r->members[x].member->GetName(), 64);
|
||||
r->members[x].member->QueuePacket(outapp);
|
||||
}
|
||||
for (const auto& m : r->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && strcmp(m.member->GetName(), rga->membername) != 0) {
|
||||
if ((rga->gid < MAX_RAID_GROUPS) && rga->gid == m.group_number) {
|
||||
strn0cpy(gj->yourname, m.member->GetName(), 64);
|
||||
m.member->QueuePacket(outapp);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1490,21 +1495,19 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_RaidGroupSay: {
|
||||
ServerRaidMessage_Struct* rmsg = (ServerRaidMessage_Struct*)pack->pBuffer;
|
||||
auto rmsg = (ServerRaidMessage_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
Raid *r = entity_list.GetRaidByID(rmsg->rid);
|
||||
if (r)
|
||||
{
|
||||
for (int x = 0; x < MAX_RAID_MEMBERS; x++)
|
||||
{
|
||||
if (r->members[x].member) {
|
||||
if (strcmp(rmsg->from, r->members[x].member->GetName()) != 0)
|
||||
{
|
||||
if (r->members[x].group_number == rmsg->gid) {
|
||||
if (!r->members[x].is_bot && r->members[x].member->GetFilter(FilterGroupChat) != 0)
|
||||
{
|
||||
r->members[x].member->ChannelMessageSend(rmsg->from, r->members[x].member->GetName(), ChatChannel_Group, rmsg->language, rmsg->lang_skill, rmsg->message);
|
||||
}
|
||||
if (r) {
|
||||
for (const auto& m :r->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && strcmp(m.member->GetName(), rmsg->from) != 0) {
|
||||
if (m.group_number == rmsg->gid) {
|
||||
if (m.member->GetFilter(FilterGroupChat) != 0) {
|
||||
m.member->ChannelMessageSend(rmsg->from, m.member->GetName(), ChatChannel_Group, rmsg->language, rmsg->lang_skill, rmsg->message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1514,20 +1517,20 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
break;
|
||||
}
|
||||
case ServerOP_RaidSay: {
|
||||
ServerRaidMessage_Struct* rmsg = (ServerRaidMessage_Struct*)pack->pBuffer;
|
||||
if (zone)
|
||||
{
|
||||
auto rmsg = (ServerRaidMessage_Struct*)pack->pBuffer;
|
||||
if (zone) {
|
||||
Raid *r = entity_list.GetRaidByID(rmsg->rid);
|
||||
if (r)
|
||||
{
|
||||
for (int x = 0; x < MAX_RAID_MEMBERS; x++)
|
||||
{
|
||||
if (r->members[x].member) {
|
||||
if (strcmp(rmsg->from, r->members[x].member->GetName()) != 0)
|
||||
{
|
||||
if (!r->members[x].is_bot && r->members[x].member->GetFilter(FilterGroupChat) != 0)
|
||||
{
|
||||
r->members[x].member->ChannelMessageSend(rmsg->from, r->members[x].member->GetName(), ChatChannel_Raid, rmsg->language, rmsg->lang_skill, rmsg->message);
|
||||
|
||||
if (r) {
|
||||
for (const auto& m :r->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member) {
|
||||
if (strcmp(rmsg->from, m.member->GetName()) != 0) {
|
||||
if (!m.is_bot && m.member->GetFilter(FilterGroupChat) != 0) {
|
||||
m.member->ChannelMessageSend(rmsg->from, m.member->GetName(), ChatChannel_Raid, rmsg->language, rmsg->lang_skill, rmsg->message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2144,10 +2147,13 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
} else if (update_type == CZUpdateType_Raid) {
|
||||
auto client_raid = entity_list.GetRaidByID(update_identifier);
|
||||
if (client_raid) {
|
||||
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) {
|
||||
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) {
|
||||
auto raid_member = client_raid->members[member_index].member->CastToClient();
|
||||
DialogueWindow::Render(raid_member, message);
|
||||
for (const auto& m : client_raid->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) {
|
||||
DialogueWindow::Render( m.member->CastToClient(), message);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2235,24 +2241,27 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
} else if (update_type == CZUpdateType_Raid) {
|
||||
auto client_raid = entity_list.GetRaidByID(update_identifier);
|
||||
if (client_raid) {
|
||||
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) {
|
||||
auto client_raid_member = client_raid->members[member_index].member;
|
||||
if (client_raid_member && client_raid_member->IsClient()) {
|
||||
for (const auto& m : client_raid->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) {
|
||||
switch (update_subtype) {
|
||||
case CZLDoNUpdateSubtype_AddLoss:
|
||||
client_raid_member->UpdateLDoNWinLoss(theme_id, false);
|
||||
m.member->UpdateLDoNWinLoss(theme_id, false);
|
||||
break;
|
||||
case CZLDoNUpdateSubtype_AddPoints:
|
||||
client_raid_member->UpdateLDoNPoints(theme_id, points);
|
||||
m.member->UpdateLDoNPoints(theme_id, points);
|
||||
break;
|
||||
case CZLDoNUpdateSubtype_AddWin:
|
||||
client_raid_member->UpdateLDoNWinLoss(theme_id, true);
|
||||
m.member->UpdateLDoNWinLoss(theme_id, true);
|
||||
break;
|
||||
case CZLDoNUpdateSubtype_RemoveLoss:
|
||||
client_raid_member->UpdateLDoNWinLoss(theme_id, false, true);
|
||||
m.member->UpdateLDoNWinLoss(theme_id, false, true);
|
||||
break;
|
||||
case CZLDoNUpdateSubtype_RemoveWin:
|
||||
client_raid_member->UpdateLDoNWinLoss(theme_id, true, true);
|
||||
m.member->UpdateLDoNWinLoss(theme_id, true, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -2365,9 +2374,13 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
} else if (update_type == CZUpdateType_Raid) {
|
||||
auto client_raid = entity_list.GetRaidByID(update_identifier);
|
||||
if (client_raid) {
|
||||
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) {
|
||||
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) {
|
||||
auto raid_member = client_raid->members[member_index].member->CastToClient();
|
||||
for (const auto& m : client_raid->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) {
|
||||
auto raid_member = m.member->CastToClient();
|
||||
raid_member->SendMarqueeMessage(type, priority, fade_in, fade_out, duration, message);
|
||||
}
|
||||
}
|
||||
@@ -2418,9 +2431,13 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
} else if (update_type == CZUpdateType_Raid) {
|
||||
auto client_raid = entity_list.GetRaidByID(update_identifier);
|
||||
if (client_raid) {
|
||||
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) {
|
||||
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) {
|
||||
auto raid_member = client_raid->members[member_index].member->CastToClient();
|
||||
for (const auto& m : client_raid->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) {
|
||||
auto raid_member = m.member->CastToClient();
|
||||
raid_member->Message(type, message);
|
||||
}
|
||||
}
|
||||
@@ -2486,9 +2503,13 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
} else if (update_type == CZUpdateType_Raid) {
|
||||
auto client_raid = entity_list.GetRaidByID(update_identifier);
|
||||
if (client_raid) {
|
||||
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) {
|
||||
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) {
|
||||
auto raid_member = client_raid->members[member_index].member->CastToClient();
|
||||
for (const auto& m : client_raid->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) {
|
||||
auto raid_member = m.member->CastToClient();
|
||||
switch (update_subtype) {
|
||||
case CZMoveUpdateSubtype_MoveZone:
|
||||
raid_member->MoveZone(zone_short_name);
|
||||
@@ -2567,9 +2588,13 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
} else if (update_type == CZUpdateType_Raid) {
|
||||
auto client_raid = entity_list.GetRaidByID(update_identifier);
|
||||
if (client_raid) {
|
||||
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) {
|
||||
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) {
|
||||
auto raid_member = client_raid->members[member_index].member->CastToClient();
|
||||
for (const auto& m : client_raid->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) {
|
||||
auto raid_member = m.member->CastToClient();
|
||||
raid_member->SetEntityVariable(variable_name, variable_value);
|
||||
}
|
||||
}
|
||||
@@ -2601,7 +2626,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
}
|
||||
case ServerOP_CZSignal:
|
||||
{
|
||||
CZSignal_Struct* CZS = (CZSignal_Struct*) pack->pBuffer;
|
||||
auto CZS = (CZSignal_Struct*) pack->pBuffer;
|
||||
uint8 update_type = CZS->update_type;
|
||||
int update_identifier = CZS->update_identifier;
|
||||
int signal_id = CZS->signal_id;
|
||||
@@ -2624,10 +2649,13 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
} else if (update_type == CZUpdateType_Raid) {
|
||||
auto client_raid = entity_list.GetRaidByID(update_identifier);
|
||||
if (client_raid) {
|
||||
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) {
|
||||
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) {
|
||||
auto raid_member = client_raid->members[member_index].member->CastToClient();
|
||||
raid_member->Signal(signal_id);
|
||||
for (const auto& m : client_raid->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) {
|
||||
m.member->CastToClient()->Signal(signal_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2696,9 +2724,13 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
} else if (update_type == CZUpdateType_Raid) {
|
||||
auto client_raid = entity_list.GetRaidByID(update_identifier);
|
||||
if (client_raid) {
|
||||
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) {
|
||||
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) {
|
||||
auto raid_member = client_raid->members[member_index].member->CastToClient();
|
||||
for (const auto& m : client_raid->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m.member && m.member->IsClient()) {
|
||||
auto raid_member = m.member->CastToClient();
|
||||
switch (update_subtype) {
|
||||
case CZSpellUpdateSubtype_Cast:
|
||||
raid_member->ApplySpellBuff(spell_id);
|
||||
@@ -2825,9 +2857,12 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
} else if (update_type == CZUpdateType_Raid) {
|
||||
auto client_raid = entity_list.GetRaidByID(update_identifier);
|
||||
if (client_raid) {
|
||||
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) {
|
||||
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) {
|
||||
auto raid_member = client_raid->members[member_index].member->CastToClient();
|
||||
for (const auto& m : client_raid->members) {
|
||||
if (m.is_bot) {
|
||||
continue;
|
||||
}
|
||||
if (m.member && m.member->IsClient()) {
|
||||
auto raid_member = m.member->CastToClient();
|
||||
switch (update_subtype) {
|
||||
case CZTaskUpdateSubtype_ActivityReset:
|
||||
raid_member->ResetTaskActivity(task_identifier, task_subidentifier);
|
||||
|
||||
+1
-1
@@ -1262,7 +1262,7 @@ bool Client::CanEnterZone(const std::string& zone_short_name, int16 instance_ver
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!z->flag_needed.empty() && Strings::IsNumber(z->flag_needed) && Strings::ToInt(z->flag_needed) == 1) {
|
||||
if (!z->flag_needed.empty() && Strings::IsNumber(z->flag_needed) && Strings::ToBool(z->flag_needed)) {
|
||||
if (Admin() < minStatusToIgnoreZoneFlags && !HasZoneFlag(z->zoneidnumber)) {
|
||||
LogInfo(
|
||||
"Character [{}] does not have the flag to be in this zone [{}]!",
|
||||
|
||||
Reference in New Issue
Block a user