Compare commits

..

10 Commits

Author SHA1 Message Date
Aeadoin 87cb74b851 [Release] 22.8.1 (#3152) 2023-03-27 17:55:48 -04:00
Alex King 26c267db1b [Cleanup] "equipped" not "equiped", "dual" not "duel". (#3149)
* [Cleanup] "equipped" not "equiped", "dual" not "duel".

# Notes
- These are spelled incorrectly.

* Update spdat.h

* Formatting further.

* Update api_service.cpp
2023-03-27 17:55:37 -04:00
Aeadoin 99f8e6cef5 [Bug Fix] Fix for NPCs having spells interrupted. (#3150) 2023-03-27 16:57:08 -04:00
Aeadoin b6917ec782 [Release] 22.8.0 (#3148) 2023-03-25 20:48:43 -04:00
Aeadoin eb51550109 [Cleanup] Cleanup Strings::ToInt uses. (#3142)
* [Cleanup] Cleanup Strings::ToInt uses.

* fix for conversion

* remove != 0

* cleanup
2023-03-25 20:32:30 -04:00
Alex King 9d1ace627c [Feature] Add support for -1 extradmgskill to allow all skills to be scaled. (#3136)
* [Feature] Add support for -1 extradmgskill to allow all skills to be scaled.

- `$mob->GetSkillDmgAmt(skill_id)` now uses `int` instead of `uint16`.

- `statbonuses:GetSkillDamageAmount(skill_id)` now uses `-1` properly.
- `mob:GetSkillDmgAmt(skill_id)` now uses `int` instead of `uint16`.

- A `-1` value in `extradmgskill` denotes the ability to scale all skills at once.
- Consolidated `AddItemBonuses()`, `AdditiveWornBonuses()`, `CalcItemBonuses()`, and `CalcRecommendedLevelBonus()` to mob-based methods to avoid code duplication.
- Bots, NPCs, and Mercs can now use additive worn effects if the rule is enabled, as well as all other proper stat bonuses that only clients had before.
- No SQL update required to change `extradmgskill` and `extradmgamt` to `int` as they already are this type in the database, just had to adjust `item_data.h` and `shareddb.cpp`.

* Update mob.cpp

* Cleanup.

* Cleanup.

* Move #include <vector> to header.

* Add method for GetExtraDamageSkills

* fix additembonuses

* Update bonuses.cpp

* Update mob.cpp

* Out of bounds.

* Update bonuses.cpp

---------

Co-authored-by: Aeadoin <109764533+Aeadoin@users.noreply.github.com>
2023-03-25 20:26:01 -04:00
Aeadoin ec3ef411a1 [Fix] Fix for SQL Query in npc_scale_global_base (#3144) 2023-03-25 20:08:40 -04:00
Aeadoin 1394b6a4d2 [Hotfix] Fix for Items looted from corpses. (#3147) 2023-03-25 20:00:31 -04:00
Aeadoin 7f41547963 [Crash] Fix for crash in Raid::QueuePacket (#3145)
* [Crash] Fix for crash in Raid::QueuePacket

* bots can't be a part of BalanceMana

* corrected additions

* adding additional is_bot gates

* updating raid for loops to be range based.

* typo

* formatting

* formatting
2023-03-25 18:02:05 -04:00
Alex King 2e4071cdcf [Cleanup] Remove extern bool Critical (#3146)
# Notes
- This is unused.
2023-03-25 17:48:40 -04:00
46 changed files with 1257 additions and 1692 deletions
+26
View File
@@ -1,3 +1,29 @@
## [22.8.1] - 03/27/2023
### Fixes
* Fix for NPCs having spells interrupted. ([#3150](https://github.com/EQEmu/Server/pull/3150)) @Aeadoin 2023-03-27
## [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 ## [22.7.0] - 03/24/2023
### Bots ### Bots
+1 -1
View File
@@ -812,7 +812,7 @@ uint32 Database::GetAccountIDByChar(const char* charname, uint32* oCharID) {
auto row = results.begin(); auto row = results.begin();
uint32 accountId = Strings::ToInt(row[0]); uint32 accountId = Strings::ToUnsignedInt(row[0]);
if (oCharID) if (oCharID)
*oCharID = Strings::ToUnsignedInt(row[1]); *oCharID = Strings::ToUnsignedInt(row[1]);
+3 -3
View File
@@ -499,7 +499,7 @@ bool Database::CheckDatabaseConvertPPDeblob(){
ExtendedProfile_Struct* e_pp; ExtendedProfile_Struct* e_pp;
uint32 pplen = 0; uint32 pplen = 0;
uint32 i; uint32 i;
int character_id = 0; uint32 character_id = 0;
int account_id = 0; int account_id = 0;
int number_of_characters = 0; int number_of_characters = 0;
int printppdebug = 0; /* Prints Player Profile */ int printppdebug = 0; /* Prints Player Profile */
@@ -929,12 +929,12 @@ bool Database::CheckDatabaseConvertPPDeblob(){
for (auto row = results.begin(); row != results.end(); ++row) { for (auto row = results.begin(); row != results.end(); ++row) {
char_iter_count++; 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 results2 = QueryDatabase(squery);
auto row2 = results2.begin(); auto row2 = results2.begin();
pp = (Convert::PlayerProfile_Struct*)row2[1]; pp = (Convert::PlayerProfile_Struct*)row2[1];
e_pp = (ExtendedProfile_Struct*)row2[11]; e_pp = (ExtendedProfile_Struct*)row2[11];
character_id = Strings::ToInt(row[0]); character_id = Strings::ToUnsignedInt(row[0]);
account_id = Strings::ToInt(row2[4]); account_id = Strings::ToInt(row2[4]);
/* Convert some data from the character_ table that is still relevant */ /* Convert some data from the character_ table that is still relevant */
firstlogon = Strings::ToUnsignedInt(row2[5]); firstlogon = Strings::ToUnsignedInt(row2[5]);
+3 -3
View File
@@ -5524,9 +5524,9 @@ struct ServerLootItem_Struct {
uint32 aug_6; // uint32 aug_5; uint32 aug_6; // uint32 aug_5;
bool attuned; bool attuned;
std::string custom_data; std::string custom_data;
uint32 ornamenticon; uint32 ornamenticon {};
uint32 ornamentidfile; uint32 ornamentidfile {};
uint32 ornament_hero_model; uint32 ornament_hero_model {};
uint16 trivial_min_level; uint16 trivial_min_level;
uint16 trivial_max_level; uint16 trivial_max_level;
uint16 npc_min_level; uint16 npc_min_level;
+1 -1
View File
@@ -384,7 +384,7 @@ namespace PlayerEvent {
}; };
struct AAPurchasedEvent { struct AAPurchasedEvent {
int32 aa_id; uint32 aa_id;
int32 aa_cost; int32 aa_cost;
int32 aa_previous_id; int32 aa_previous_id;
int32 aa_next_id; int32 aa_next_id;
+2 -2
View File
@@ -449,8 +449,8 @@ namespace EQ
int8 Shielding; // PoP: Shielding % int8 Shielding; // PoP: Shielding %
int8 StunResist; // PoP: Stun Resist % int8 StunResist; // PoP: Stun Resist %
int8 StrikeThrough; // PoP: Strike Through % int8 StrikeThrough; // PoP: Strike Through %
uint32 ExtraDmgSkill; int32 ExtraDmgSkill;
uint32 ExtraDmgAmt; int32 ExtraDmgAmt;
int8 SpellShield; // PoP: Spell Shield % int8 SpellShield; // PoP: Spell Shield %
int8 Avoidance; // PoP: Avoidance + int8 Avoidance; // PoP: Avoidance +
int8 Accuracy; // PoP: Accuracy + int8 Accuracy; // PoP: Accuracy +
+6 -6
View File
@@ -964,10 +964,10 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_
// Flags // Flags
item.ArtifactFlag = Strings::ToBool(row[ItemField::artifactflag]); item.ArtifactFlag = Strings::ToBool(row[ItemField::artifactflag]);
item.Attuneable = !disable_attuneable && Strings::ToInt(row[ItemField::attuneable]) != 0; item.Attuneable = !disable_attuneable && Strings::ToBool(row[ItemField::attuneable]);
item.BenefitFlag = Strings::ToBool(row[ItemField::benefitflag]) != 0; item.BenefitFlag = Strings::ToBool(row[ItemField::benefitflag]);
item.FVNoDrop = Strings::ToInt(row[ItemField::fvnodrop]) != 0; item.FVNoDrop = Strings::ToBool(row[ItemField::fvnodrop]);
item.Magic = Strings::ToBool(row[ItemField::magic]) != 0; 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.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.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])); 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]); item.SkillModType = Strings::ToUnsignedInt(row[ItemField::skillmodtype]);
// Extra Damage Skill // Extra Damage Skill
item.ExtraDmgSkill = Strings::ToUnsignedInt(row[ItemField::extradmgskill]); item.ExtraDmgSkill = Strings::ToInt(row[ItemField::extradmgskill]);
item.ExtraDmgAmt = Strings::ToUnsignedInt(row[ItemField::extradmgamt]); item.ExtraDmgAmt = Strings::ToInt(row[ItemField::extradmgamt]);
// Bard // Bard
item.BardType = Strings::ToUnsignedInt(row[ItemField::bardtype]); item.BardType = Strings::ToUnsignedInt(row[ItemField::bardtype]);
+19 -1
View File
@@ -260,13 +260,31 @@ const std::map<EQ::skills::SkillType, std::string>& EQ::skills::GetSkillTypeMap(
return skill_type_map; 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) std::string EQ::skills::GetSkillName(SkillType skill)
{ {
if (skill >= Skill1HBlunt && skill <= Skill2HPiercing) { if (skill >= Skill1HBlunt && skill <= Skill2HPiercing) {
auto skills = GetSkillTypeMap(); auto skills = GetSkillTypeMap();
return skills[skill]; return skills[skill];
} }
return std::string(); return {};
} }
EQ::SkillProfile::SkillProfile() EQ::SkillProfile::SkillProfile()
+2
View File
@@ -24,6 +24,7 @@
#include <string> #include <string>
#include <map> #include <map>
#include <vector>
namespace EQ namespace EQ
@@ -170,6 +171,7 @@ namespace EQ
bool IsMeleeDmg(SkillType skill); bool IsMeleeDmg(SkillType skill);
extern const std::map<SkillType, std::string>& GetSkillTypeMap(); extern const std::map<SkillType, std::string>& GetSkillTypeMap();
extern const std::vector<SkillType>& GetExtraDamageSkills();
std::string GetSkillName(SkillType skill); std::string GetSkillName(SkillType skill);
} /*skills*/ } /*skills*/
+2 -2
View File
@@ -504,7 +504,7 @@ enum SpellRestriction
HAS_NO_ILLUSIONS_OF_GRANDEUR_BUFF = 12519, // HAS_NO_ILLUSIONS_OF_GRANDEUR_BUFF = 12519, //
IS_HP_ABOVE_50_PCT = 16010, // IS_HP_ABOVE_50_PCT = 16010, //
IS_HP_UNDER_50_PCT = 16031, // IS_HP_UNDER_50_PCT = 16031, //
IS_OFF_HAND_EQUIPED = 27672, // You must be wielding a weapon or shield in your offhand to use this ability. IS_OFF_HAND_EQUIPPED = 27672, // You must be wielding a weapon or shield in your offhand to use this ability.
HAS_NO_PACT_OF_FATE_RECOURSE_BUFF = 29556, // This spell will not work while Pact of Fate Recourse is active. | caster restriction | HAS_NO_PACT_OF_FATE_RECOURSE_BUFF = 29556, // This spell will not work while Pact of Fate Recourse is active. | caster restriction |
HAS_NO_SHROUD_OF_PRAYER_BUFF = 32339, // Your target cannot receive another Quiet Prayer this soon. HAS_NO_SHROUD_OF_PRAYER_BUFF = 32339, // Your target cannot receive another Quiet Prayer this soon.
IS_MANA_BELOW_20_PCT = 38311, // This ability requires you to be at or below 20% of your maximum mana. IS_MANA_BELOW_20_PCT = 38311, // This ability requires you to be at or below 20% of your maximum mana.
@@ -1211,7 +1211,7 @@ typedef enum {
#define SE_Double_Backstab_Front 473 // implemented - Chance to double backstab from front #define SE_Double_Backstab_Front 473 // implemented - Chance to double backstab from front
#define SE_Pet_Crit_Melee_Damage_Pct_Owner 474 // implemenetd - Critical damage mod applied to pets from owner #define SE_Pet_Crit_Melee_Damage_Pct_Owner 474 // implemenetd - Critical damage mod applied to pets from owner
#define SE_Trigger_Spell_Non_Item 475 // implemented - Trigger spell on cast only if not from item click. #define SE_Trigger_Spell_Non_Item 475 // implemented - Trigger spell on cast only if not from item click.
#define SE_Weapon_Stance 476 // implemented, @Misc, Apply a specific spell buffs automatically depending 2Hander, Shield or Duel Wield is equiped, base: spellid, base: 0=2H 1=Shield 2=DW, max: none #define SE_Weapon_Stance 476 // implemented, @Misc, Apply a specific spell buffs automatically depending 2Hander, Shield or Dual Wield is equipped, base: spellid, base: 0=2H 1=Shield 2=DW, max: none
#define SE_Hatelist_To_Top_Index 477 // Implemented - Chance to be set to top of rampage list #define SE_Hatelist_To_Top_Index 477 // Implemented - Chance to be set to top of rampage list
#define SE_Hatelist_To_Tail_Index 478 // Implemented - Chance to be set to bottom of rampage list #define SE_Hatelist_To_Tail_Index 478 // Implemented - Chance to be set to bottom of rampage list
#define SE_Ff_Value_Min 479 // implemented, @Ff, Minimum base value of a spell that can be focused, base: spells to be focused base1 value #define SE_Ff_Value_Min 479 // implemented, @Ff, Minimum base value of a spell that can be focused, base: spells to be focused base1 value
+2 -2
View File
@@ -25,7 +25,7 @@
// Build variables // Build variables
// these get injected during the build pipeline // these get injected during the build pipeline
#define CURRENT_VERSION "22.7.0-dev" // always append -dev to the current version for custom-builds #define CURRENT_VERSION "22.8.1-dev" // always append -dev to the current version for custom-builds
#define LOGIN_VERSION "0.8.0" #define LOGIN_VERSION "0.8.0"
#define COMPILE_DATE __DATE__ #define COMPILE_DATE __DATE__
#define COMPILE_TIME __TIME__ #define COMPILE_TIME __TIME__
@@ -42,7 +42,7 @@
* Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt * Manifest: https://github.com/EQEmu/Server/blob/master/utils/sql/db_update_manifest.txt
*/ */
#define CURRENT_BINARY_DATABASE_VERSION 9226 #define CURRENT_BINARY_DATABASE_VERSION 9227
#define CURRENT_BINARY_BOTS_DATABASE_VERSION 9038 #define CURRENT_BINARY_BOTS_DATABASE_VERSION 9038
+5 -5
View File
@@ -32,7 +32,7 @@ Database::Database(
user.c_str(), user.c_str(),
pass.c_str(), pass.c_str(),
name.c_str(), name.c_str(),
Strings::ToInt(port), Strings::ToUnsignedInt(port),
&errnum, &errnum,
errbuf errbuf
) )
@@ -93,7 +93,7 @@ bool Database::GetLoginDataFromAccountInfo(
auto row = results.begin(); auto row = results.begin();
id = Strings::ToInt(row[0]); id = Strings::ToUnsignedInt(row[0]);
password = row[1]; password = row[1];
LogDebug( LogDebug(
@@ -145,7 +145,7 @@ bool Database::GetLoginTokenDataFromToken(
} }
if (strcmp(row[2], "login_server_id") == 0) { 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; found_login_id = true;
continue; continue;
} }
@@ -373,7 +373,7 @@ Database::DbWorldRegistration Database::GetWorldRegistration(
r.server_list_type = Strings::ToInt(row[3]); r.server_list_type = Strings::ToInt(row[3]);
r.is_server_trusted = Strings::ToInt(row[2]) > 0; r.is_server_trusted = Strings::ToInt(row[2]) > 0;
r.server_list_description = row[4]; 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) { if (r.server_admin_id <= 0) {
return r; return r;
@@ -513,7 +513,7 @@ bool Database::CreateWorldRegistration(
auto row = results.begin(); auto row = results.begin();
id = Strings::ToInt(row[0]); id = Strings::ToUnsignedInt(row[0]);
auto insert_query = fmt::format( auto insert_query = fmt::format(
"INSERT INTO login_world_servers SET id = {0}, long_name = '{1}', short_name = '{2}', last_ip_address = '{3}', \n" "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 = ''", "login_server_list_type_id = 3, login_server_admin_id = {4}, is_server_trusted = 0, tag_description = ''",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "eqemu-server", "name": "eqemu-server",
"version": "22.7.0", "version": "22.8.1",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/EQEmu/Server.git" "url": "https://github.com/EQEmu/Server.git"
+1
View File
@@ -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| 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| 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| 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: # Upgrade conditions:
# This won't be needed after this system is implemented, but it is used database that are not # 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 `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 `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 `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`; 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
View File
@@ -1448,9 +1448,9 @@ bool ZoneDatabase::LoadAlternateAdvancement(Client *c) {
int i = 0; int i = 0;
for(auto row = results.begin(); row != results.end(); ++row) { for(auto row = results.begin(); row != results.end(); ++row) {
uint32 aa = Strings::ToInt(row[0]); uint32 aa = Strings::ToUnsignedInt(row[0]);
uint32 value = Strings::ToInt(row[1]); uint32 value = Strings::ToUnsignedInt(row[1]);
uint32 charges = Strings::ToInt(row[2]); uint32 charges = Strings::ToUnsignedInt(row[2]);
auto rank = zone->GetAlternateAdvancementRank(aa); auto rank = zone->GetAlternateAdvancementRank(aa);
if(!rank) { if(!rank) {
@@ -1775,7 +1775,7 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
if(results.Success()) { if(results.Success()) {
for(auto row = results.begin(); row != results.end(); ++row) { for(auto row = results.begin(); row != results.end(); ++row) {
auto ability = new AA::Ability; auto ability = new AA::Ability;
ability->id = Strings::ToInt(row[0]); ability->id = Strings::ToUnsignedInt(row[0]);
ability->name = row[1]; ability->name = row[1];
ability->category = Strings::ToInt(row[2]); ability->category = Strings::ToInt(row[2]);
//EQ client has classes left shifted by one bit for some odd reason //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->status = Strings::ToInt(row[7]);
ability->type = Strings::ToInt(row[8]); ability->type = Strings::ToInt(row[8]);
ability->charges = Strings::ToInt(row[9]); ability->charges = Strings::ToInt(row[9]);
ability->grant_only = Strings::ToInt(row[10]) != 0 ? true : false; ability->grant_only = Strings::ToBool(row[10]);
ability->reset_on_death = Strings::ToInt(row[11]) != 0 ? true : false; ability->reset_on_death = Strings::ToBool(row[11]);
ability->first_rank_id = Strings::ToInt(row[12]); ability->first_rank_id = Strings::ToInt(row[12]);
ability->first = nullptr; ability->first = nullptr;
@@ -1814,7 +1814,7 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
if(results.Success()) { if(results.Success()) {
for(auto row = results.begin(); row != results.end(); ++row) { for(auto row = results.begin(); row != results.end(); ++row) {
auto rank = new AA::Rank; 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->upper_hotkey_sid = Strings::ToInt(row[1]);
rank->lower_hotkey_sid = Strings::ToInt(row[2]); rank->lower_hotkey_sid = Strings::ToInt(row[2]);
rank->title_sid = Strings::ToInt(row[3]); rank->title_sid = Strings::ToInt(row[3]);
@@ -1846,8 +1846,8 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
if(results.Success()) { if(results.Success()) {
for(auto row = results.begin(); row != results.end(); ++row) { for(auto row = results.begin(); row != results.end(); ++row) {
AA::RankEffect effect; AA::RankEffect effect;
int rank_id = Strings::ToInt(row[0]); uint32 rank_id = Strings::ToUnsignedInt(row[0]);
effect.slot = Strings::ToInt(row[1]); effect.slot = Strings::ToUnsignedInt(row[1]);
effect.effect_id = Strings::ToInt(row[2]); effect.effect_id = Strings::ToInt(row[2]);
effect.base_value = Strings::ToInt(row[3]); effect.base_value = Strings::ToInt(row[3]);
effect.limit_value = Strings::ToInt(row[4]); effect.limit_value = Strings::ToInt(row[4]);
@@ -1871,7 +1871,7 @@ bool ZoneDatabase::LoadAlternateAdvancementAbilities(std::unordered_map<int, std
results = QueryDatabase(query); results = QueryDatabase(query);
if(results.Success()) { if(results.Success()) {
for(auto row = results.begin(); row != results.end(); ++row) { 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 aa_id = Strings::ToInt(row[1]);
int points = Strings::ToInt(row[2]); int points = Strings::ToInt(row[2]);
+1 -1
View File
@@ -41,7 +41,7 @@ public:
Rank *GetRankByPointsSpent(int current_level); Rank *GetRankByPointsSpent(int current_level);
int GetMaxLevel(Mob *who); int GetMaxLevel(Mob *who);
int id; uint32 id;
std::string name; std::string name;
int category; int category;
int classes; int classes;
+1 -1
View File
@@ -29,7 +29,7 @@ public:
Rank() { } Rank() { }
~Rank() { } ~Rank() { }
int id; uint32 id;
int upper_hotkey_sid; int upper_hotkey_sid;
int lower_hotkey_sid; int lower_hotkey_sid;
int title_sid; int title_sid;
+1 -1
View File
@@ -27,7 +27,7 @@ namespace AA
struct RankEffect struct RankEffect
{ {
int slot; uint32 slot;
int effect_id; int effect_id;
int base_value; int base_value;
int limit_value; int limit_value;
+2 -2
View File
@@ -471,11 +471,11 @@ Json::Value ApiGetMobListDetail(EQ::Net::WebsocketServerConnection *connection,
row["has_primary_aggro"] = mob->HasPrimaryAggro(); row["has_primary_aggro"] = mob->HasPrimaryAggro();
row["has_project_illusion"] = mob->HasProjectIllusion(); row["has_project_illusion"] = mob->HasProjectIllusion();
row["has_projectile_attack"] = mob->HasProjectileAttack(); row["has_projectile_attack"] = mob->HasProjectileAttack();
row["has_shield_equiped"] = mob->HasShieldEquiped(); row["has_shield_equipped"] = mob->HasShieldEquipped();
row["has_special_abilities"] = mob->HasSpecialAbilities(); row["has_special_abilities"] = mob->HasSpecialAbilities();
row["has_tar_reflection"] = mob->HasTargetReflection(); row["has_tar_reflection"] = mob->HasTargetReflection();
row["has_temp_pets_active"] = mob->HasTempPetsActive(); row["has_temp_pets_active"] = mob->HasTempPetsActive();
row["has_two_hand_blunt_equiped"] = mob->HasTwoHandBluntEquiped(); row["has_two_hand_blunt_equipped"] = mob->HasTwoHandBluntEquipped();
row["has_two_hander_equipped"] = mob->HasTwoHanderEquipped(); row["has_two_hander_equipped"] = mob->HasTwoHanderEquipped();
row["hate_summon"] = mob->HateSummon(); row["hate_summon"] = mob->HateSummon();
row["helm_texture"] = mob->GetHelmTexture(); row["helm_texture"] = mob->GetHelmTexture();
+43 -29
View File
@@ -592,7 +592,7 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit)
} }
// Try Shield Block OR TwoHandBluntBlockCheck // Try Shield Block OR TwoHandBluntBlockCheck
if (HasShieldEquiped() && (aabonuses.ShieldBlock || spellbonuses.ShieldBlock || itembonuses.ShieldBlock) && (InFront || bBlockFromRear)) { if (HasShieldEquipped() && (aabonuses.ShieldBlock || spellbonuses.ShieldBlock || itembonuses.ShieldBlock) && (InFront || bBlockFromRear)) {
int chance = aabonuses.ShieldBlock + spellbonuses.ShieldBlock + itembonuses.ShieldBlock; int chance = aabonuses.ShieldBlock + spellbonuses.ShieldBlock + itembonuses.ShieldBlock;
if (counter_block || counter_all) { if (counter_block || counter_all) {
float counter = (counter_block + counter_all) / 100.0f; float counter = (counter_block + counter_all) / 100.0f;
@@ -604,7 +604,7 @@ bool Mob::AvoidDamage(Mob *other, DamageHitInfo &hit)
} }
} }
if (HasTwoHandBluntEquiped() && (aabonuses.TwoHandBluntBlock || spellbonuses.TwoHandBluntBlock || itembonuses.TwoHandBluntBlock) && (InFront || bBlockFromRear)) { if (HasTwoHandBluntEquipped() && (aabonuses.TwoHandBluntBlock || spellbonuses.TwoHandBluntBlock || itembonuses.TwoHandBluntBlock) && (InFront || bBlockFromRear)) {
int chance = aabonuses.TwoHandBluntBlock + itembonuses.TwoHandBluntBlock + spellbonuses.TwoHandBluntBlock; int chance = aabonuses.TwoHandBluntBlock + itembonuses.TwoHandBluntBlock + spellbonuses.TwoHandBluntBlock;
if (counter_block || counter_all) { if (counter_block || counter_all) {
float counter = (counter_block + counter_all) / 100.0f; float counter = (counter_block + counter_all) / 100.0f;
@@ -874,7 +874,7 @@ int Mob::ACSum(bool skip_caps)
int ac = 0; // this should be base AC whenever shrouds come around int ac = 0; // this should be base AC whenever shrouds come around
ac += itembonuses.AC; // items + food + tribute ac += itembonuses.AC; // items + food + tribute
int shield_ac = 0; int shield_ac = 0;
if (HasShieldEquiped() && IsOfClientBot()) { if (HasShieldEquipped() && IsOfClientBot()) {
auto inst = (IsClient()) ? GetInv().GetItem(EQ::invslot::slotSecondary) : CastToBot()->GetBotItem(EQ::invslot::slotSecondary); auto inst = (IsClient()) ? GetInv().GetItem(EQ::invslot::slotSecondary) : CastToBot()->GetBotItem(EQ::invslot::slotSecondary);
if (inst) { if (inst) {
if (inst->GetItemRecommendedLevel(true) <= GetLevel()) { if (inst->GetItemRecommendedLevel(true) <= GetLevel()) {
@@ -1555,7 +1555,7 @@ bool Mob::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool
if (Hand == EQ::invslot::slotPrimary || Hand == EQ::invslot::slotSecondary) if (Hand == EQ::invslot::slotPrimary || Hand == EQ::invslot::slotSecondary)
my_hit.base_damage = DoDamageCaps(my_hit.base_damage); my_hit.base_damage = DoDamageCaps(my_hit.base_damage);
auto shield_inc = spellbonuses.ShieldEquipDmgMod + itembonuses.ShieldEquipDmgMod + aabonuses.ShieldEquipDmgMod; auto shield_inc = spellbonuses.ShieldEquipDmgMod + itembonuses.ShieldEquipDmgMod + aabonuses.ShieldEquipDmgMod;
if (shield_inc > 0 && HasShieldEquiped() && Hand == EQ::invslot::slotPrimary) { if (shield_inc > 0 && HasShieldEquipped() && Hand == EQ::invslot::slotPrimary) {
my_hit.base_damage = my_hit.base_damage * (100 + shield_inc) / 100; my_hit.base_damage = my_hit.base_damage * (100 + shield_inc) / 100;
hate = hate * (100 + shield_inc) / 100; hate = hate * (100 + shield_inc) / 100;
} }
@@ -2505,8 +2505,10 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
bool ownerInGroup = false; bool ownerInGroup = false;
if ((give_exp->HasGroup() && give_exp->GetGroup()->IsGroupMember(give_exp->GetUltimateOwner())) if ((give_exp->HasGroup() && give_exp->GetGroup()->IsGroupMember(give_exp->GetUltimateOwner()))
|| (give_exp->IsPet() && (give_exp->GetOwner()->IsClient() || (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; ownerInGroup = true;
}
give_exp = give_exp->GetUltimateOwner(); 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 && give_exp->IsTempPet() && give_exp->IsPetOwnerClient()) {
if (give_exp->IsNPC() && give_exp->CastToNPC()->GetSwarmOwner()) { if (give_exp->IsNPC() && give_exp->CastToNPC()->GetSwarmOwner()) {
Mob* temp_owner = entity_list.GetMobID(give_exp->CastToNPC()->GetSwarmOwner()); Mob* temp_owner = entity_list.GetMobID(give_exp->CastToNPC()->GetSwarmOwner());
if (temp_owner) if (temp_owner) {
give_exp = temp_owner; give_exp = temp_owner;
} }
} }
}
int PlayerCount = 0; // QueryServ Player Counting int PlayerCount = 0; // QueryServ Player Counting
Client *give_exp_client = nullptr; Client *give_exp_client = nullptr;
if (give_exp && give_exp->IsClient()) if (give_exp && give_exp->IsClient()) {
give_exp_client = give_exp->CastToClient(); give_exp_client = give_exp->CastToClient();
}
//do faction hits even if we are a merchant, so long as a player killed us //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()); hate_list.DoFactionHits(GetNPCFactionID(), GetPrimaryFaction(), GetFactionAmount());
}
bool IsLdonTreasure = (GetClass() == LDON_TREASURE); 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 */ /* Send the EVENT_KILLED_MERIT event for all raid members */
for (int i = 0; i < MAX_RAID_MEMBERS; i++) { for (const auto& m : kr->members) {
if (kr->members[i].member != nullptr && kr->members[i].member->IsClient()) { // If Group Member is Client if (m.is_bot) {
Client *c = kr->members[i].member; continue;
}
if (m.member && m.member->IsClient()) { // If Group Member is Client
Client *c = m.member;
c->RecordKilledNPCEvent(this); c->RecordKilledNPCEvent(this);
if (parse->HasQuestSub(GetNPCTypeID(), EVENT_KILLED_MERIT)) { if (parse->HasQuestSub(GetNPCTypeID(), EVENT_KILLED_MERIT)) {
parse->EventNPC(EVENT_KILLED_MERIT, this, c, "killed", 0); 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()); c->SetFactionLevel(c->CharacterID(), GetNPCFactionID(), c->GetBaseClass(), c->GetBaseRace(), c->GetDeity());
}
PlayerCount++; PlayerCount++;
} }
@@ -2586,9 +2596,13 @@ bool NPC::Death(Mob* killer_mob, int64 damage, uint16 spell, EQ::skills::SkillTy
QS->s1.NPCID = GetNPCTypeID(); QS->s1.NPCID = GetNPCTypeID();
QS->s1.ZoneID = GetZoneID(); QS->s1.ZoneID = GetZoneID();
QS->s1.Type = 2; // Raid Fight QS->s1.Type = 2; // Raid Fight
for (int i = 0; i < MAX_RAID_MEMBERS; i++) { for (const auto& m : kr->members) {
if (kr->members[i].member != nullptr && kr->members[i].member->IsClient()) { // If Group Member is Client if (m.is_bot) {
Client *c = kr->members[i].member; continue;
}
if (m.member && m.member->IsClient()) { // If Group Member is Client
Client *c = m.member;
QS->Chars[PlayerCount].char_id = c->CharacterID(); QS->Chars[PlayerCount].char_id = c->CharacterID();
PlayerCount++; 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()); Raid* r = entity_list.GetRaidByClient(killer->CastToClient());
if (r) { if (r) {
int i = 0; 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()) { switch (r->GetLootType()) {
case 0: case 0:
case 1: case 1:
if (r->members[x].member && r->members[x].is_raid_leader) { if (m.member && m.is_raid_leader) {
corpse->AllowPlayerLoot(r->members[x].member, i); corpse->AllowPlayerLoot(m.member, i);
i++; i++;
} }
break; break;
case 2: case 2:
if (r->members[x].member && r->members[x].is_raid_leader) { if (m.member && (m.is_raid_leader || m.is_group_leader)) {
corpse->AllowPlayerLoot(r->members[x].member, i); corpse->AllowPlayerLoot(m.member, i);
i++;
}
else if (r->members[x].member && r->members[x].is_group_leader) {
corpse->AllowPlayerLoot(r->members[x].member, i);
i++; i++;
} }
break; break;
case 3: case 3:
if (r->members[x].member && r->members[x].is_looter) { if (m.member && m.is_looter) {
corpse->AllowPlayerLoot(r->members[x].member, i); corpse->AllowPlayerLoot(m.member, i);
i++; i++;
} }
break; break;
case 4: case 4:
if (r->members[x].member) { if (m.member) {
corpse->AllowPlayerLoot(r->members[x].member, i); corpse->AllowPlayerLoot(m.member, i);
i++; i++;
} }
break; break;
@@ -5981,7 +5995,7 @@ void Mob::DoShieldDamageOnShielder(Mob *shield_target, int64 hit_damage_done, EQ
} }
int mitigation = shielder->GetShielderMitigation(); //Default shielder mitigates 25 pct of damage taken, this can be increased up to max 50 by equipping a shield item int mitigation = shielder->GetShielderMitigation(); //Default shielder mitigates 25 pct of damage taken, this can be increased up to max 50 by equipping a shield item
if (shielder->IsClient() && shielder->HasShieldEquiped()) { if (shielder->IsClient() && shielder->HasShieldEquipped()) {
EQ::ItemInstance* inst = shielder->CastToClient()->GetInv().GetItem(EQ::invslot::slotSecondary); EQ::ItemInstance* inst = shielder->CastToClient()->GetInv().GetItem(EQ::invslot::slotSecondary);
if (inst) { if (inst) {
const EQ::ItemData* shield = inst->GetItem(); const EQ::ItemData* shield = inst->GetItem();
+481 -391
View File
File diff suppressed because it is too large Load Diff
+13 -359
View File
@@ -1112,7 +1112,7 @@ void Bot::GenerateAppearance() {
uint16 Bot::GetPrimarySkillValue() { uint16 Bot::GetPrimarySkillValue() {
EQ::skills::SkillType skill = EQ::skills::HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill EQ::skills::SkillType skill = EQ::skills::HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
if (bool equiped = m_inv.GetItem(EQ::invslot::slotPrimary); !equiped) { if (bool equipped = m_inv.GetItem(EQ::invslot::slotPrimary); !equipped) {
skill = EQ::skills::SkillHandtoHand; skill = EQ::skills::SkillHandtoHand;
} else { } else {
uint8 type = m_inv.GetItem(EQ::invslot::slotPrimary)->GetItem()->ItemType; //is this the best way to do this? uint8 type = m_inv.GetItem(EQ::invslot::slotPrimary)->GetItem()->ItemType; //is this the best way to do this?
@@ -3462,7 +3462,7 @@ void Bot::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) {
if(item) { if(item) {
if(strlen(item->IDFile) > 2) 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); 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(item) {
if(strlen(item->IDFile) > 2) 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); ns->spawn.equipment_tint.Secondary.Color = GetEquipmentColor(EQ::textures::weaponSecondary);
} }
@@ -4870,7 +4870,7 @@ int Bot::GetBaseSkillDamage(EQ::skills::SkillType skill, Mob *target)
float skill_bonus = skill_level / 10.0f; float skill_bonus = skill_level / 10.0f;
float ac_bonus = 0.0f; float ac_bonus = 0.0f;
const EQ::ItemInstance *inst = nullptr; const EQ::ItemInstance *inst = nullptr;
if (HasShieldEquiped()) if (HasShieldEquipped())
inst = GetBotItem(EQ::invslot::slotSecondary); inst = GetBotItem(EQ::invslot::slotSecondary);
else if (HasTwoHanderEquipped()) else if (HasTwoHanderEquipped())
inst = GetBotItem(EQ::invslot::slotPrimary); inst = GetBotItem(EQ::invslot::slotPrimary);
@@ -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. // 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) { void Bot::CalcBotStats(bool showtext) {
if (!GetBotOwner()) if (!GetBotOwner())
@@ -9105,16 +8757,18 @@ std::vector<Mob*> Bot::GetApplySpellList(
auto* r = GetRaid(); auto* r = GetRaid();
auto group_id = r->GetGroup(GetCleanName()); auto group_id = r->GetGroup(GetCleanName());
if (r && EQ::ValueWithin(group_id, 0, (MAX_RAID_GROUPS - 1))) { if (r && EQ::ValueWithin(group_id, 0, (MAX_RAID_GROUPS - 1))) {
for (auto i = 0; i < MAX_RAID_MEMBERS; i++) { for (const auto& m : r->members) {
auto* m = r->members[i].member; if (m.is_bot) {
if (m && m->IsClient() && (!is_raid_group_only || r->GetGroup(m) == group_id)) { continue;
l.push_back(m); }
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()) { if (allow_pets && m.member->HasPet()) {
l.push_back(m->GetPet()); 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) { for (const auto& b : sbl) {
l.push_back(b); l.push_back(b);
} }
+1 -3
View File
@@ -184,9 +184,7 @@ public:
void RogueAssassinate(Mob* other) override; void RogueAssassinate(Mob* other) override;
void DoClassAttacks(Mob *target, bool IsRiposte=false); void DoClassAttacks(Mob *target, bool IsRiposte=false);
void CalcBonuses() override; 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; void MakePet(uint16 spell_id, const char* pettype, const char *petname = nullptr) override;
FACTION_VALUE GetReverseFactionCon(Mob* iOther) override; FACTION_VALUE GetReverseFactionCon(Mob* iOther) override;
inline bool IsPet() override { return false; } inline bool IsPet() override { return false; }
+48 -60
View File
@@ -798,24 +798,21 @@ bool Client::SendAllPackets() {
} }
void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req, CLIENT_CONN_STATUS required_state, eqFilterType filter) { void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req, CLIENT_CONN_STATUS required_state, eqFilterType filter) {
if(filter!=FilterNone){ if (filter != FilterNone && GetFilter(filter) == FilterHide) {
//this is incomplete... no support for FilterShowGroupOnly or FilterShowSelfOnly return;
if(GetFilter(filter) == FilterHide)
return; //Client has this filter on, no need to send packet
} }
if(client_state != CLIENT_CONNECTED && required_state == CLIENT_CONNECTED){
if (client_state != CLIENT_CONNECTED && required_state == CLIENT_CONNECTED) {
AddPacket(app, ack_req); AddPacket(app, ack_req);
return; return;
} }
// if the program doesnt care about the status or if the status isnt what we requested // 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 // todo: save packets for later use
AddPacket(app, ack_req); AddPacket(app, ack_req);
} }
else if (eqs) else if (eqs) {
{
eqs->QueuePacket(app, ack_req); eqs->QueuePacket(app, ack_req);
} }
} }
@@ -4143,42 +4140,32 @@ void Client::UpdateLFP() {
bool Client::GroupFollow(Client* inviter) { bool Client::GroupFollow(Client* inviter) {
if (inviter) if (inviter) {
{
isgrouped = true; isgrouped = true;
Raid* raid = entity_list.GetRaidByClient(inviter); Raid* raid = entity_list.GetRaidByClient(inviter);
Raid* iraid = entity_list.GetRaidByClient(this); Raid* iraid = entity_list.GetRaidByClient(this);
//inviter has a raid don't do group stuff instead do raid stuff! //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) // Suspend the merc while in a raid (maybe a rule could be added for this)
if (GetMerc()) if (GetMerc()) {
GetMerc()->Suspend(); GetMerc()->Suspend();
}
uint32 groupToUse = 0xFFFFFFFF; uint32 groupToUse = 0xFFFFFFFF;
for (int x = 0; x < MAX_RAID_MEMBERS; x++) for (const auto& m : raid->members) {
{ if (m.member && m.member == inviter) {
if (raid->members[x].member) groupToUse = m.group_number;
{
//this assumes the inviter is in the zone
if (raid->members[x].member == inviter){
groupToUse = raid->members[x].group_number;
break; break;
} }
} }
} if (iraid == raid) {
if (iraid == raid)
{
//both in same raid //both in same raid
uint32 ngid = raid->GetGroup(inviter->GetName()); uint32 ngid = raid->GetGroup(inviter->GetName());
if (raid->GroupCount(ngid) < 6) if (raid->GroupCount(ngid) < 6) {
{
raid->MoveMember(GetName(), ngid); raid->MoveMember(GetName(), ngid);
raid->SendGroupDisband(this); raid->SendGroupDisband(this);
//raid->SendRaidGroupAdd(GetName(), ngid); raid->GroupUpdate(ngid);
//raid->SendGroupUpdate(this);
raid->GroupUpdate(ngid); //break
} }
return false; return false;
} }
@@ -4336,9 +4323,9 @@ bool Client::GroupFollow(Client* inviter) {
uint16 Client::GetPrimarySkillValue() uint16 Client::GetPrimarySkillValue()
{ {
EQ::skills::SkillType skill = EQ::skills::HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill EQ::skills::SkillType skill = EQ::skills::HIGHEST_SKILL; //because nullptr == 0, which is 1H Slashing, & we want it to return 0 from GetSkill
bool equiped = m_inv.GetItem(EQ::invslot::slotPrimary); bool equipped = m_inv.GetItem(EQ::invslot::slotPrimary);
if (!equiped) if (!equipped)
skill = EQ::skills::SkillHandtoHand; skill = EQ::skills::SkillHandtoHand;
else { else {
@@ -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)) if (m_aggrometer.set_pct(AggroMeter::AT_Secondary, has_aggro ? cur_tar->GetHateRatio(this, secondary) : secondary ? 100 : 0))
add_entry(AggroMeter::AT_Secondary); add_entry(AggroMeter::AT_Secondary);
// fuuuuuuuuuuuuuuuuuuuuuuuucckkkkkkkkkkkkkkk raids
if (IsRaidGrouped()) { if (IsRaidGrouped()) {
auto raid = GetRaid(); auto raid = GetRaid();
if (raid) { if (raid) {
auto gid = raid->GetGroup(this); auto gid = raid->GetGroup(this);
if (gid < 12) { if (gid < MAX_RAID_GROUPS) {
int at_id = AggroMeter::AT_Group1; int at_id = AggroMeter::AT_Group1;
for (int i = 0; i < MAX_RAID_MEMBERS; ++i) { for (const auto& m : raid->members) {
if (raid->members[i].member && raid->members[i].member != this && raid->members[i].group_number == gid) { 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(), raid->members[i].member))) 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)); add_entry(static_cast<AggroMeter::AggroTypes>(at_id));
at_id++; at_id++;
if (at_id > AggroMeter::AT_Group5) if (at_id > AggroMeter::AT_Group5)
@@ -10724,11 +10710,11 @@ void Client::ApplyWeaponsStance()
FindBuff(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_2H])) { FindBuff(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_2H])) {
BuffFadeBySpellID(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_2H]); BuffFadeBySpellID(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_2H]);
} }
else if (!HasShieldEquiped() && IsBuffSpell(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]) && else if (!HasShieldEquipped() && IsBuffSpell(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]) &&
FindBuff(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) { FindBuff(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) {
BuffFadeBySpellID(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]); BuffFadeBySpellID(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]);
} }
else if (!HasDualWeaponsEquiped() && else if (!HasDualWeaponsEquipped() &&
IsBuffSpell(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD]) && IsBuffSpell(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD]) &&
FindBuff(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) { FindBuff(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) {
BuffFadeBySpellID(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD]); BuffFadeBySpellID(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD]);
@@ -10740,14 +10726,14 @@ void Client::ApplyWeaponsStance()
} }
weaponstance.spellbonus_buff_spell_id = spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_2H]; weaponstance.spellbonus_buff_spell_id = spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_2H];
} }
else if (HasShieldEquiped() && IsBuffSpell(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) { else if (HasShieldEquipped() && IsBuffSpell(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) {
if (!FindBuff(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) { if (!FindBuff(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) {
SpellOnTarget(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD], this); SpellOnTarget(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD], this);
} }
weaponstance.spellbonus_buff_spell_id = spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]; weaponstance.spellbonus_buff_spell_id = spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD];
} }
else if (HasDualWeaponsEquiped() && IsBuffSpell(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) { else if (HasDualWeaponsEquipped() && IsBuffSpell(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) {
if (!FindBuff(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) { if (!FindBuff(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) {
SpellOnTarget(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD], this); SpellOnTarget(spellbonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD], this);
@@ -10790,11 +10776,11 @@ void Client::ApplyWeaponsStance()
FindBuff(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_2H])) { FindBuff(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_2H])) {
BuffFadeBySpellID(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_2H]); BuffFadeBySpellID(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_2H]);
} }
else if (!HasShieldEquiped() && IsBuffSpell(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]) && else if (!HasShieldEquipped() && IsBuffSpell(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]) &&
FindBuff(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) { FindBuff(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) {
BuffFadeBySpellID(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]); BuffFadeBySpellID(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]);
} }
else if (!HasDualWeaponsEquiped() && IsBuffSpell(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD]) && else if (!HasDualWeaponsEquipped() && IsBuffSpell(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD]) &&
FindBuff(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) { FindBuff(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) {
BuffFadeBySpellID(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD]); BuffFadeBySpellID(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD]);
} }
@@ -10807,14 +10793,14 @@ void Client::ApplyWeaponsStance()
} }
weaponstance.itembonus_buff_spell_id = itembonuses.WeaponStance[WEAPON_STANCE_TYPE_2H]; weaponstance.itembonus_buff_spell_id = itembonuses.WeaponStance[WEAPON_STANCE_TYPE_2H];
} }
else if (HasShieldEquiped() && IsBuffSpell(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) { else if (HasShieldEquipped() && IsBuffSpell(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) {
if (!FindBuff(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) { if (!FindBuff(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) {
SpellOnTarget(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD], this); SpellOnTarget(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD], this);
} }
weaponstance.itembonus_buff_spell_id = itembonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]; weaponstance.itembonus_buff_spell_id = itembonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD];
} }
else if (HasDualWeaponsEquiped() && IsBuffSpell(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) { else if (HasDualWeaponsEquipped() && IsBuffSpell(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) {
if (!FindBuff(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) { if (!FindBuff(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) {
SpellOnTarget(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD], this); SpellOnTarget(itembonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD], this);
} }
@@ -10847,12 +10833,12 @@ void Client::ApplyWeaponsStance()
BuffFadeBySpellID(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_2H]); BuffFadeBySpellID(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_2H]);
} }
else if (!HasShieldEquiped() && IsBuffSpell(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]) && else if (!HasShieldEquipped() && IsBuffSpell(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]) &&
FindBuff(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) { FindBuff(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) {
BuffFadeBySpellID(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]); BuffFadeBySpellID(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]);
} }
else if (!HasDualWeaponsEquiped() && IsBuffSpell(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD]) && else if (!HasDualWeaponsEquipped() && IsBuffSpell(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD]) &&
FindBuff(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) { FindBuff(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) {
BuffFadeBySpellID(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD]); BuffFadeBySpellID(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD]);
} }
@@ -10865,14 +10851,14 @@ void Client::ApplyWeaponsStance()
weaponstance.aabonus_buff_spell_id = aabonuses.WeaponStance[WEAPON_STANCE_TYPE_2H]; weaponstance.aabonus_buff_spell_id = aabonuses.WeaponStance[WEAPON_STANCE_TYPE_2H];
} }
else if (HasShieldEquiped() && IsBuffSpell(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) { else if (HasShieldEquipped() && IsBuffSpell(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) {
if (!FindBuff(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) { if (!FindBuff(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD])) {
SpellOnTarget(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD], this); SpellOnTarget(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD], this);
} }
weaponstance.aabonus_buff_spell_id = aabonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD]; weaponstance.aabonus_buff_spell_id = aabonuses.WeaponStance[WEAPON_STANCE_TYPE_SHIELD];
} }
else if (HasDualWeaponsEquiped() && IsBuffSpell(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) { else if (HasDualWeaponsEquipped() && IsBuffSpell(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) {
if (!FindBuff(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) { if (!FindBuff(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD])) {
SpellOnTarget(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD], this); SpellOnTarget(aabonuses.WeaponStance[WEAPON_STANCE_TYPE_DUAL_WIELD], this);
@@ -10956,11 +10942,14 @@ std::vector<Client *> Client::GetPartyMembers()
std::vector<Client *> clients_to_update = {}; std::vector<Client *> clients_to_update = {};
// raid // raid
Raid *raid = entity_list.GetRaidByClient(this); if (const auto raid = entity_list.GetRaidByClient(this)) {
if (raid) { for (auto &m : raid->members) {
for (auto &e : raid->members) { if (m.is_bot) {
if (e.member && e.member->IsClient()) { continue;
clients_to_update.push_back(e.member->CastToClient()); }
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* r = GetRaid();
auto group_id = r->GetGroup(this); auto group_id = r->GetGroup(this);
if (r && EQ::ValueWithin(group_id, 0, (MAX_RAID_GROUPS - 1))) { if (r && EQ::ValueWithin(group_id, 0, (MAX_RAID_GROUPS - 1))) {
for (auto i = 0; i < MAX_RAID_MEMBERS; i++) { for (const auto& m : r->members) {
auto* m = r->members[i].member; if (m.member && m.member->IsClient() && (!is_raid_group_only || r->GetGroup(m.member) == group_id)) {
if (m && m->IsClient() && (!is_raid_group_only || r->GetGroup(m) == group_id)) { l.push_back(m.member);
l.push_back(m);
if (allow_pets && m->HasPet()) { if (allow_pets && m.member->HasPet()) {
l.push_back(m->GetPet()); l.push_back(m.member->GetPet());
} }
if (allow_bots) { 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) { for (const auto& b : sbl) {
l.push_back(b); l.push_back(b);
} }
+1 -4
View File
@@ -588,7 +588,7 @@ public:
//This calculates total Attack Rating to match very close to what the client should show //This calculates total Attack Rating to match very close to what the client should show
uint32 GetTotalATK(); uint32 GetTotalATK();
uint32 GetATKRating(); uint32 GetATKRating();
//This gets the skill value of the item type equiped in the Primary Slot //This gets the skill value of the item type equipped in the Primary Slot
uint16 GetPrimarySkillValue(); uint16 GetPrimarySkillValue();
bool Flurry(); bool Flurry();
@@ -1645,9 +1645,6 @@ public:
protected: protected:
friend class Mob; 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 CalcEdibleBonuses(StatBonuses* newbon);
void MakeBuffFadePacket(uint16 spell_id, int slot_id, bool send_message = true); void MakeBuffFadePacket(uint16 spell_id, int slot_id, bool send_message = true);
bool client_data_loaded; bool client_data_loaded;
+8 -8
View File
@@ -1964,10 +1964,10 @@ int Lua_Mob::GetFcDamageAmtIncoming(Lua_Mob caster, int32 spell_id)
return self->GetFcDamageAmtIncoming(caster, 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(); Lua_Safe_Call_Int();
return self->GetSkillDmgAmt(skill); return self->GetSkillDmgAmt(skill_id);
} }
void Lua_Mob::SetAllowBeneficial(bool value) { void Lua_Mob::SetAllowBeneficial(bool value) {
@@ -2170,14 +2170,14 @@ bool Lua_Mob::IsTargetable() {
return self->IsTargetable(); return self->IsTargetable();
} }
bool Lua_Mob::HasShieldEquiped() { bool Lua_Mob::HasShieldEquipped() {
Lua_Safe_Call_Bool(); Lua_Safe_Call_Bool();
return self->HasShieldEquiped(); return self->HasShieldEquipped();
} }
bool Lua_Mob::HasTwoHandBluntEquiped() { bool Lua_Mob::HasTwoHandBluntEquipped() {
Lua_Safe_Call_Bool(); Lua_Safe_Call_Bool();
return self->HasTwoHandBluntEquiped(); return self->HasTwoHandBluntEquipped();
} }
bool Lua_Mob::HasTwoHanderEquipped() { bool Lua_Mob::HasTwoHanderEquipped() {
@@ -3321,9 +3321,9 @@ luabind::scope lua_register_mob() {
.def("HasOwner", (bool(Lua_Mob::*)(void))&Lua_Mob::HasOwner) .def("HasOwner", (bool(Lua_Mob::*)(void))&Lua_Mob::HasOwner)
.def("HasPet", (bool(Lua_Mob::*)(void))&Lua_Mob::HasPet) .def("HasPet", (bool(Lua_Mob::*)(void))&Lua_Mob::HasPet)
.def("HasProcs", &Lua_Mob::HasProcs) .def("HasProcs", &Lua_Mob::HasProcs)
.def("HasShieldEquiped", (bool(Lua_Mob::*)(void))&Lua_Mob::HasShieldEquiped) .def("HasShieldEquipped", (bool(Lua_Mob::*)(void))&Lua_Mob::HasShieldEquipped)
.def("HasTimer", &Lua_Mob::HasTimer) .def("HasTimer", &Lua_Mob::HasTimer)
.def("HasTwoHandBluntEquiped", (bool(Lua_Mob::*)(void))&Lua_Mob::HasTwoHandBluntEquiped) .def("HasTwoHandBluntEquipped", (bool(Lua_Mob::*)(void))&Lua_Mob::HasTwoHandBluntEquipped)
.def("HasTwoHanderEquipped", (bool(Lua_Mob::*)(void))&Lua_Mob::HasTwoHanderEquipped) .def("HasTwoHanderEquipped", (bool(Lua_Mob::*)(void))&Lua_Mob::HasTwoHanderEquipped)
.def("Heal", &Lua_Mob::Heal) .def("Heal", &Lua_Mob::Heal)
.def("HealDamage", (void(Lua_Mob::*)(uint64))&Lua_Mob::HealDamage) .def("HealDamage", (void(Lua_Mob::*)(uint64))&Lua_Mob::HealDamage)
+3 -3
View File
@@ -392,7 +392,7 @@ public:
int GetModSkillDmgTaken(int skill); int GetModSkillDmgTaken(int skill);
int GetSkillDmgTaken(int skill); int GetSkillDmgTaken(int skill);
int GetFcDamageAmtIncoming(Lua_Mob caster, int32 spell_id); int GetFcDamageAmtIncoming(Lua_Mob caster, int32 spell_id);
int GetSkillDmgAmt(uint16 skill); int GetSkillDmgAmt(int skill_id);
void SetAllowBeneficial(bool value); void SetAllowBeneficial(bool value);
bool GetAllowBeneficial(); bool GetAllowBeneficial();
bool IsBeneficialAllowed(Lua_Mob target); bool IsBeneficialAllowed(Lua_Mob target);
@@ -431,8 +431,8 @@ public:
uint8 GetNimbusEffect2(); uint8 GetNimbusEffect2();
uint8 GetNimbusEffect3(); uint8 GetNimbusEffect3();
bool IsTargetable(); bool IsTargetable();
bool HasShieldEquiped(); bool HasShieldEquipped();
bool HasTwoHandBluntEquiped(); bool HasTwoHandBluntEquipped();
bool HasTwoHanderEquipped(); bool HasTwoHanderEquipped();
uint32 GetHerosForgeModel(uint8 material_slot); uint32 GetHerosForgeModel(uint8 material_slot);
uint32 IsEliteMaterialItem(uint8 material_slot); uint32 IsEliteMaterialItem(uint8 material_slot);
+7 -1
View File
@@ -1,5 +1,7 @@
#ifdef LUA_EQEMU #ifdef LUA_EQEMU
#include "../common/data_verification.h"
#include "lua.hpp" #include "lua.hpp"
#include <luabind/luabind.hpp> #include <luabind/luabind.hpp>
@@ -1097,7 +1099,11 @@ int32 Lua_StatBonuses::GetSkillReuseTime(int idx) const {
int32 Lua_StatBonuses::GetSkillDamageAmount(int idx) const { int32 Lua_StatBonuses::GetSkillDamageAmount(int idx) const {
Lua_Safe_Call_Int(); 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 { int Lua_StatBonuses::GetHPPercCap(int idx) const {
-1
View File
@@ -85,7 +85,6 @@ volatile bool RunLoops = true;
#endif #endif
extern volatile bool is_zone_loaded; extern volatile bool is_zone_loaded;
extern bool Critical = false;
#include "zone_event_scheduler.h" #include "zone_event_scheduler.h"
#include "../common/file.h" #include "../common/file.h"
-385
View File
@@ -190,391 +190,6 @@ float Merc::GetDefaultSize() {
return MercSize; 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() int Merc::GroupLeadershipAAHealthEnhancement()
{ {
Group *g = GetGroup(); Group *g = GetGroup();
-4
View File
@@ -268,10 +268,6 @@ public:
bool FindTarget(); bool FindTarget();
protected: 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); int64 GetFocusEffect(focusType type, uint16 spell_id, bool from_buff_tic = false);
std::vector<MercSpell> merc_spells; std::vector<MercSpell> merc_spells;
+42 -19
View File
@@ -16,6 +16,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#include "../common/data_verification.h"
#include "../common/spdat.h" #include "../common/spdat.h"
#include "../common/strings.h" #include "../common/strings.h"
#include "../common/misc_functions.h" #include "../common/misc_functions.h"
@@ -135,6 +136,7 @@ Mob::Mob(
AI_Init(); AI_Init();
SetMoving(false); SetMoving(false);
moved = false; moved = false;
turning = false; turning = false;
m_RewindLocation = glm::vec3(); m_RewindLocation = glm::vec3();
@@ -145,13 +147,16 @@ Mob::Mob(
clean_name[0] = 0; clean_name[0] = 0;
lastname[0] = 0; lastname[0] = 0;
if (in_name) { if (in_name) {
strn0cpy(name, in_name, 64); strn0cpy(name, in_name, 64);
strn0cpy(orig_name, in_name, 64); strn0cpy(orig_name, in_name, 64);
} }
if (in_lastname) { if (in_lastname) {
strn0cpy(lastname, in_lastname, 64); strn0cpy(lastname, in_lastname, 64);
} }
current_hp = in_cur_hp; current_hp = in_cur_hp;
max_hp = in_max_hp; max_hp = in_max_hp;
base_hp = in_max_hp; base_hp = in_max_hp;
@@ -184,8 +189,7 @@ Mob::Mob(
fearspeed = 0.625f; fearspeed = 0.625f;
base_fearspeed = 25; base_fearspeed = 25;
// npcs // npcs
} } else {
else {
base_walkspeed = base_runspeed * 100 / 265; base_walkspeed = base_runspeed * 100 / 265;
walkspeed = ((float) base_walkspeed) * 0.025f; walkspeed = ((float) base_walkspeed) * 0.025f;
base_fearspeed = base_runspeed * 100 / 127; base_fearspeed = base_runspeed * 100 / 127;
@@ -199,7 +203,6 @@ Mob::Mob(
m_PlayerState = 0; m_PlayerState = 0;
// sanity check // sanity check
if (runspeed < 0 || runspeed > 20) { if (runspeed < 0 || runspeed > 20) {
runspeed = 1.25f; runspeed = 1.25f;
@@ -234,10 +237,10 @@ Mob::Mob(
slow_mitigation = 0; slow_mitigation = 0;
findable = false; findable = false;
trackable = true; trackable = true;
has_shieldequiped = false; has_shield_equipped = false;
has_twohandbluntequiped = false; has_two_hand_blunt_equipped = false;
has_twohanderequipped = false; has_two_hander_equipped = false;
has_duelweaponsequiped = false; has_dual_weapons_equipped = false;
can_facestab = false; can_facestab = false;
has_numhits = false; has_numhits = false;
has_MGB = false; has_MGB = false;
@@ -245,12 +248,7 @@ Mob::Mob(
SpellPowerDistanceMod = 0; SpellPowerDistanceMod = 0;
last_los_check = false; last_los_check = false;
if (in_aa_title > 0) { aa_title = in_aa_title > 0 ? in_aa_title : 0xFF;
aa_title = in_aa_title;
}
else {
aa_title = 0xFF;
}
AC = in_ac; AC = in_ac;
ATK = in_atk; ATK = in_atk;
@@ -5549,16 +5547,41 @@ int16 Mob::GetSkillReuseTime(uint16 skill)
return skill_reduction; return skill_reduction;
} }
int Mob::GetSkillDmgAmt(uint16 skill) int Mob::GetSkillDmgAmt(int skill_id)
{ {
int skill_dmg = 0; int skill_dmg = 0;
// All skill dmg(only spells do this) + Skill specific if (!EQ::ValueWithin(skill_id, ALL_SKILLS, EQ::skills::HIGHEST_SKILL)) {
skill_dmg += spellbonuses.SkillDamageAmount[EQ::skills::HIGHEST_SKILL + 1] + itembonuses.SkillDamageAmount[EQ::skills::HIGHEST_SKILL + 1] + aabonuses.SkillDamageAmount[EQ::skills::HIGHEST_SKILL + 1] return skill_dmg;
+ itembonuses.SkillDamageAmount[skill] + spellbonuses.SkillDamageAmount[skill] + aabonuses.SkillDamageAmount[skill]; }
skill_dmg += spellbonuses.SkillDamageAmount2[EQ::skills::HIGHEST_SKILL + 1] + itembonuses.SkillDamageAmount2[EQ::skills::HIGHEST_SKILL + 1] skill_dmg += (
+ itembonuses.SkillDamageAmount2[skill] + spellbonuses.SkillDamageAmount2[skill]; 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; return skill_dmg;
} }
+18 -15
View File
@@ -484,19 +484,19 @@ public:
void TempName(const char *newname = nullptr); void TempName(const char *newname = nullptr);
void SetTargetable(bool on); void SetTargetable(bool on);
bool IsTargetable() const { return m_targetable; } bool IsTargetable() const { return m_targetable; }
bool HasShieldEquiped() const { return has_shieldequiped; } bool HasShieldEquipped() const { return has_shield_equipped; }
inline void SetShieldEquiped(bool val) { has_shieldequiped = val; } inline void SetShieldEquipped(bool val) { has_shield_equipped = val; }
bool HasTwoHandBluntEquiped() const { return has_twohandbluntequiped; } bool HasTwoHandBluntEquipped() const { return has_two_hand_blunt_equipped; }
inline void SetTwoHandBluntEquiped(bool val) { has_twohandbluntequiped = val; } inline void SetTwoHandBluntEquipped(bool val) { has_two_hand_blunt_equipped = val; }
bool HasTwoHanderEquipped() { return has_twohanderequipped; } bool HasTwoHanderEquipped() { return has_two_hander_equipped; }
void SetTwoHanderEquipped(bool val) { has_twohanderequipped = val; } void SetTwoHanderEquipped(bool val) { has_two_hander_equipped = val; }
bool HasDualWeaponsEquiped() const { return has_duelweaponsequiped; } bool HasDualWeaponsEquipped() const { return has_dual_weapons_equipped; }
bool HasBowEquipped() const { return has_bowequipped; } bool HasBowEquipped() const { return has_bowequipped; }
void SetBowEquipped(bool val) { has_bowequipped = val; } void SetBowEquipped(bool val) { has_bowequipped = val; }
bool HasArrowEquipped() const { return has_arrowequipped; } bool HasArrowEquipped() const { return has_arrowequipped; }
void SetArrowEquipped(bool val) { has_arrowequipped = val; } void SetArrowEquipped(bool val) { has_arrowequipped = val; }
bool HasBowAndArrowEquipped() const { return HasBowEquipped() && HasArrowEquipped(); } bool HasBowAndArrowEquipped() const { return HasBowEquipped() && HasArrowEquipped(); }
inline void SetDuelWeaponsEquiped(bool val) { has_duelweaponsequiped = val; } inline void SetDualWeaponsEquipped(bool val) { has_dual_weapons_equipped = val; }
bool CanFacestab() { return can_facestab; } bool CanFacestab() { return can_facestab; }
void SetFacestab(bool val) { can_facestab = val; } void SetFacestab(bool val) { can_facestab = val; }
virtual uint8 ConvertItemTypeToSkillID(uint8 item_type); virtual uint8 ConvertItemTypeToSkillID(uint8 item_type);
@@ -664,8 +664,6 @@ public:
virtual int32 CalcItemATKCap() { return 0; } virtual int32 CalcItemATKCap() { return 0; }
virtual bool IsSitting() const { return false; } virtual bool IsSitting() const { return false; }
int CalcRecommendedLevelBonus(uint8 level, uint8 reclevel, int basestat);
void CopyHateList(Mob* to); void CopyHateList(Mob* to);
//Group //Group
@@ -953,7 +951,7 @@ public:
int16 GetMeleeDmgPositionMod(Mob* defender); int16 GetMeleeDmgPositionMod(Mob* defender);
int16 GetSkillReuseTime(uint16 skill); int16 GetSkillReuseTime(uint16 skill);
int GetCriticalChanceBonus(uint16 skill); int GetCriticalChanceBonus(uint16 skill);
int GetSkillDmgAmt(uint16 skill); int GetSkillDmgAmt(int skill_id);
int16 GetPositionalDmgAmt(Mob* defender); int16 GetPositionalDmgAmt(Mob* defender);
inline bool CanBlockSpell() const { return(spellbonuses.FocusEffects[focusBlockNextSpell]); } inline bool CanBlockSpell() const { return(spellbonuses.FocusEffects[focusBlockNextSpell]); }
bool DoHPToManaCovert(int32 mana_cost = 0); bool DoHPToManaCovert(int32 mana_cost = 0);
@@ -1378,6 +1376,11 @@ public:
void ApplyAABonuses(const AA::Rank &rank, StatBonuses* newbon); void ApplyAABonuses(const AA::Rank &rank, StatBonuses* newbon);
bool CheckAATimer(int timer); 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; } int NPCAssistCap() { return npc_assist_cap; }
void AddAssistCap() { ++npc_assist_cap; } void AddAssistCap() { ++npc_assist_cap; }
void DelAssistCap() { --npc_assist_cap; } void DelAssistCap() { --npc_assist_cap; }
@@ -1696,10 +1699,10 @@ protected:
bool silenced; bool silenced;
bool amnesiad; bool amnesiad;
bool offhand; bool offhand;
bool has_shieldequiped; bool has_shield_equipped;
bool has_twohandbluntequiped; bool has_two_hand_blunt_equipped;
bool has_twohanderequipped; bool has_two_hander_equipped;
bool has_duelweaponsequiped; bool has_dual_weapons_equipped;
bool has_bowequipped = false; bool has_bowequipped = false;
bool has_arrowequipped = false; bool has_arrowequipped = false;
bool use_double_melee_round_dmg_bonus; bool use_double_melee_round_dmg_bonus;
-1
View File
@@ -162,7 +162,6 @@ public:
virtual void SetTarget(Mob* mob); 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; } 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 void CalcBonuses();
virtual int GetCurrentBuffSlots() const { return RuleI(Spells, MaxBuffSlotsNPC); } virtual int GetCurrentBuffSlots() const { return RuleI(Spells, MaxBuffSlotsNPC); }
virtual int GetCurrentSongSlots() const { return RuleI(Spells, MaxSongSlotsNPC); } virtual int GetCurrentSongSlots() const { return RuleI(Spells, MaxSongSlotsNPC); }
+7 -7
View File
@@ -2273,14 +2273,14 @@ bool Perl_Mob_IsTargetable(Mob* self) // @categories Stats and Attributes
return self->IsTargetable(); return self->IsTargetable();
} }
bool Perl_Mob_HasShieldEquiped(Mob* self) // @categories Stats and Attributes bool Perl_Mob_HasShieldEquipped(Mob* self) // @categories Stats and Attributes
{ {
return self->HasShieldEquiped(); return self->HasShieldEquipped();
} }
bool Perl_Mob_HasTwoHandBluntEquiped(Mob* self) // @categories Stats and Attributes bool Perl_Mob_HasTwoHandBluntEquipped(Mob* self) // @categories Stats and Attributes
{ {
return self->HasTwoHandBluntEquiped(); return self->HasTwoHandBluntEquipped();
} }
bool Perl_Mob_HasTwoHanderEquipped(Mob* self) // @categories Stats and Attributes bool Perl_Mob_HasTwoHanderEquipped(Mob* self) // @categories Stats and Attributes
@@ -2517,7 +2517,7 @@ void Perl_Mob_ApplySpellBuff(Mob* self, int spell_id, int duration) // @categori
self->ApplySpellBuff(spell_id, duration); 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); return self->GetSkillDmgAmt(skill_id);
} }
@@ -3257,9 +3257,9 @@ void perl_register_mob()
package.add("HasOwner", &Perl_Mob_HasOwner); package.add("HasOwner", &Perl_Mob_HasOwner);
package.add("HasPet", &Perl_Mob_HasPet); package.add("HasPet", &Perl_Mob_HasPet);
package.add("HasProcs", &Perl_Mob_HasProcs); package.add("HasProcs", &Perl_Mob_HasProcs);
package.add("HasShieldEquiped", &Perl_Mob_HasShieldEquiped); package.add("HasShieldEquipped", &Perl_Mob_HasShieldEquipped);
package.add("HasTimer", &Perl_Mob_HasTimer); package.add("HasTimer", &Perl_Mob_HasTimer);
package.add("HasTwoHandBluntEquiped", &Perl_Mob_HasTwoHandBluntEquiped); package.add("HasTwoHandBluntEquipped", &Perl_Mob_HasTwoHandBluntEquipped);
package.add("HasTwoHanderEquipped", &Perl_Mob_HasTwoHanderEquipped); package.add("HasTwoHanderEquipped", &Perl_Mob_HasTwoHanderEquipped);
package.add("HateSummon", &Perl_Mob_HateSummon); package.add("HateSummon", &Perl_Mob_HateSummon);
package.add("Heal", &Perl_Mob_Heal); package.add("Heal", &Perl_Mob_Heal);
+7 -3
View File
@@ -448,9 +448,13 @@ void QuestManager::ZoneRaid(const char *zone_name) {
initiator->MoveZone(zone_name); initiator->MoveZone(zone_name);
} else { } else {
auto client_raid = initiator->GetRaid(); auto client_raid = initiator->GetRaid();
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) { for (const auto& m : client_raid->members) {
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) { if (m.is_bot) {
auto raid_member = client_raid->members[member_index].member->CastToClient(); continue;
}
if (m.member && m.member->IsClient()) {
auto raid_member = m.member->CastToClient();
raid_member->MoveZone(zone_name); raid_member->MoveZone(zone_name);
} }
} }
+43 -4
View File
@@ -611,9 +611,8 @@ void Raid::RaidGroupSay(const char *msg, Client *c, uint8 language, uint8 lang_s
uint32 Raid::GetPlayerIndex(const char *name) uint32 Raid::GetPlayerIndex(const char *name)
{ {
for(int x = 0; x < MAX_RAID_MEMBERS; x++) for (int x = 0; x < MAX_RAID_MEMBERS; x++) {
{ if (strcmp(name, members[x].member_name) == 0) {
if(strcmp(name, members[x].member_name) == 0) {
return x; return x;
} }
} }
@@ -832,6 +831,10 @@ void Raid::BalanceMana(int32 penalty, uint32 gid, float range, Mob* caster, int3
manataken /= numMem; manataken /= numMem;
for (const auto& m : members) { for (const auto& m : members) {
if (m.is_bot) {
continue;
}
if (m.member && m.group_number == gid) { if (m.member && m.group_number == gid) {
distance = DistanceSquared(caster->GetPosition(), m.member->GetPosition()); 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; uint8 member_count = 0;
for (const auto& m : members) { for (const auto& m : members) {
if (m.is_bot) {
continue;
}
if (m.member && m.group_number == gid && m.member->IsClient()) { if (m.member && m.group_number == gid && m.member->IsClient()) {
member_count++; member_count++;
} }
@@ -914,6 +921,10 @@ void Raid::SplitMoney(uint32 gid, uint32 copper, uint32 silver, uint32 gold, uin
auto platinum_split = platinum / member_count; auto platinum_split = platinum / member_count;
for (const auto& m : members) { 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 if (m.member && m.group_number == gid && m.member->IsClient()) { // If Group Member is Client
m.member->AddMoneyToPP( m.member->AddMoneyToPP(
copper_split, 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) 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) { for (const auto& m : members) {
if (m.is_bot) {
continue;
}
if (m.member && m.group_number == gid && m.member->IsClient()) { if (m.member && m.group_number == gid && m.member->IsClient()) {
m.member->MovePC(zoneID, instance_id, x, y, z, heading, 0, ZoneSolicited); 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) void Raid::TeleportRaid(Mob* sender, uint32 zoneID, uint16 instance_id, float x, float y, float z, float heading)
{ {
for (const auto& m : members) { for (const auto& m : members) {
if (m.is_bot) {
continue;
}
if (m.member && m.member->IsClient()) { if (m.member && m.member->IsClient()) {
m.member->MovePC(zoneID, instance_id, x, y, z, heading, 0, ZoneSolicited); 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); auto results = database.QueryDatabase(query);
for (auto& m : members) { for (auto& m : members) {
if (m.is_bot) {
continue;
}
if (strcmp(looter, m.member_name) == 0) { if (strcmp(looter, m.member_name) == 0) {
m.is_looter = true; m.is_looter = true;
break; break;
@@ -1002,6 +1025,10 @@ void Raid::RemoveRaidLooter(const char* looter)
auto results = database.QueryDatabase(query); auto results = database.QueryDatabase(query);
for (auto& m: members) { for (auto& m: members) {
if (m.is_bot) {
continue;
}
if (strcmp(looter, m.member_name) == 0) { if (strcmp(looter, m.member_name) == 0) {
m.is_looter = false; m.is_looter = false;
break; break;
@@ -1258,6 +1285,10 @@ void Raid::SendBulkRaid(Client *to)
void Raid::QueuePacket(const EQApplicationPacket *app, bool ack_req) void Raid::QueuePacket(const EQApplicationPacket *app, bool ack_req)
{ {
for (const auto& m : members) { for (const auto& m : members) {
if (m.is_bot) {
continue;
}
if (m.member && m.member->IsClient()) { if (m.member && m.member->IsClient()) {
m.member->QueuePacket(app, ack_req); m.member->QueuePacket(app, ack_req);
} }
@@ -1332,7 +1363,7 @@ void Raid::SendGroupUpdate(Client *to)
gu->action = groupActUpdate; gu->action = groupActUpdate;
int i = 0; int i = 0;
uint32 grp = GetGroup(to->GetName()); uint32 grp = GetGroup(to->GetName());
if (grp >= MAX_RAID_MEMBERS) { if (grp >= MAX_RAID_GROUPS) {
safe_delete(outapp); safe_delete(outapp);
return; return;
} }
@@ -1502,6 +1533,10 @@ void Raid::SendRaidMOTD()
} }
for (const auto& m: members) { for (const auto& m: members) {
if (m.is_bot) {
continue;
}
if (m.member) { if (m.member) {
SendRaidMOTD(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) 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) { for (const auto& m : members) {
if (m.is_bot) {
continue;
}
if (m.member && m.member->IsClient() && m.member != sender) { if (m.member && m.member->IsClient() && m.member != sender) {
m.member->MessageString(type, string_id, message, message2, message3, message4, message5, message6, m.member->MessageString(type, string_id, message, message2, message3, message4, message5, message6,
message7, message8, message9, distance); message7, message8, message9, distance);
+1 -1
View File
@@ -133,7 +133,7 @@ int Mob::GetBaseSkillDamage(EQ::skills::SkillType skill, Mob *target)
float ac_bonus = 0.0f; float ac_bonus = 0.0f;
const EQ::ItemInstance *inst = nullptr; const EQ::ItemInstance *inst = nullptr;
if (IsClient()) { if (IsClient()) {
if (HasShieldEquiped()) { if (HasShieldEquipped()) {
inst = CastToClient()->GetInv().GetItem(EQ::invslot::slotSecondary); inst = CastToClient()->GetInv().GetItem(EQ::invslot::slotSecondary);
} else if (HasTwoHanderEquipped()) { } else if (HasTwoHanderEquipped()) {
inst = CastToClient()->GetInv().GetItem(EQ::invslot::slotPrimary); inst = CastToClient()->GetInv().GetItem(EQ::invslot::slotPrimary);
+3 -3
View File
@@ -8075,8 +8075,8 @@ bool Mob::PassCastRestriction(int value)
return true; return true;
break; break;
case IS_OFF_HAND_EQUIPED: case IS_OFF_HAND_EQUIPPED:
if (HasShieldEquiped() || CanThisClassDualWield()) if (HasShieldEquipped() || CanThisClassDualWield())
return true; return true;
break; break;
@@ -9284,7 +9284,7 @@ void Mob::SendCastRestrictionMessage(int requirement_id, bool target_requirement
case IS_HP_UNDER_50_PCT: case IS_HP_UNDER_50_PCT:
Message(Chat::Red, fmt::format("{} This target must be at oe below 50 pct of its maximum hit points.", msg).c_str()); Message(Chat::Red, fmt::format("{} This target must be at oe below 50 pct of its maximum hit points.", msg).c_str());
break; break;
case IS_OFF_HAND_EQUIPED: case IS_OFF_HAND_EQUIPPED:
Message(Chat::Red, fmt::format("{} You must be wielding a weapon or shield in your offhand to use this ability.", msg).c_str()); Message(Chat::Red, fmt::format("{} You must be wielding a weapon or shield in your offhand to use this ability.", msg).c_str());
break; break;
case HAS_NO_PACT_OF_FATE_RECOURSE_BUFF: case HAS_NO_PACT_OF_FATE_RECOURSE_BUFF:
+2 -1
View File
@@ -437,11 +437,12 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
//this is a special case for NPCs with no mana... //this is a special case for NPCs with no mana...
if (IsNPC() && my_curmana == my_maxmana) { if (IsNPC() && my_curmana == my_maxmana) {
mana_cost = 0; mana_cost = 0;
} } else {
DoSpellInterrupt(spell_id, mana_cost, my_curmana); DoSpellInterrupt(spell_id, mana_cost, my_curmana);
return false; return false;
} }
} }
}
if (mana_cost > GetMana()) { if (mana_cost > GetMana()) {
mana_cost = GetMana(); mana_cost = GetMana();
+2 -2
View File
@@ -920,7 +920,7 @@ int64 Mob::TuneClientAttack(Mob* other, bool no_avoid, bool no_hit_chance, int h
if (Hand == EQ::invslot::slotPrimary || Hand == EQ::invslot::slotSecondary) if (Hand == EQ::invslot::slotPrimary || Hand == EQ::invslot::slotSecondary)
my_hit.base_damage = CastToClient()->DoDamageCaps(my_hit.base_damage); my_hit.base_damage = CastToClient()->DoDamageCaps(my_hit.base_damage);
auto shield_inc = spellbonuses.ShieldEquipDmgMod + itembonuses.ShieldEquipDmgMod + aabonuses.ShieldEquipDmgMod; auto shield_inc = spellbonuses.ShieldEquipDmgMod + itembonuses.ShieldEquipDmgMod + aabonuses.ShieldEquipDmgMod;
if (shield_inc > 0 && HasShieldEquiped() && Hand == EQ::invslot::slotPrimary) { if (shield_inc > 0 && HasShieldEquipped() && Hand == EQ::invslot::slotPrimary) {
my_hit.base_damage = my_hit.base_damage * (100 + shield_inc) / 100; my_hit.base_damage = my_hit.base_damage * (100 + shield_inc) / 100;
hate = hate * (100 + shield_inc) / 100; hate = hate * (100 + shield_inc) / 100;
} }
@@ -1040,7 +1040,7 @@ int64 Mob::TuneACSum(bool skip_caps, int ac_override, int add_ac)
} }
int shield_ac = 0; int shield_ac = 0;
if (HasShieldEquiped() && IsOfClientBot()) { if (HasShieldEquipped() && IsOfClientBot()) {
auto inst = (IsClient()) ? GetInv().GetItem(EQ::invslot::slotSecondary) : CastToBot()->GetBotItem(EQ::invslot::slotSecondary); auto inst = (IsClient()) ? GetInv().GetItem(EQ::invslot::slotSecondary) : CastToBot()->GetBotItem(EQ::invslot::slotSecondary);
if (inst) { if (inst) {
if (inst->GetItemRecommendedLevel(true) <= GetLevel()) { if (inst->GetItemRecommendedLevel(true) <= GetLevel()) {
+135 -100
View File
@@ -294,12 +294,19 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
case VoiceMacroRaid: { case VoiceMacroRaid: {
Raid *r = entity_list.GetRaidByID(svm->RaidID); Raid *r = entity_list.GetRaidByID(svm->RaidID);
if (!r) if (!r) {
break; break;
}
for (int i = 0; i < MAX_RAID_MEMBERS; i++) for (const auto& m: r->members) {
if (r->members[i].member) if (m.is_bot) {
r->members[i].member->QueuePacket(outapp); continue;
}
if (m.member) {
m.member->QueuePacket(outapp);
}
}
break; break;
} }
@@ -1055,7 +1062,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
{ {
auto outapp = auto outapp =
new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct)); 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->membername, Inviter->GetName());
strcpy(outgj->yourname, Inviter->GetName()); strcpy(outgj->yourname, Inviter->GetName());
outgj->action = groupActInviteInitial; // 'You have formed the group'. 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(); Inviter->CastToClient()->UpdateLFP();
auto pack2 = new ServerPacket(ServerOP_GroupJoin, sizeof(ServerGroupJoin_Struct)); 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->gid = group->GetID();
gj->zoneid = zone->GetZoneID(); gj->zoneid = zone->GetZoneID();
gj->instance_id = zone->GetInstanceID(); gj->instance_id = zone->GetInstanceID();
@@ -1213,7 +1220,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break; break;
} }
case ServerOP_GroupJoin: { case ServerOP_GroupJoin: {
ServerGroupJoin_Struct* gj = (ServerGroupJoin_Struct*)pack->pBuffer; auto gj = (ServerGroupJoin_Struct*)pack->pBuffer;
if (zone) { if (zone) {
if (gj->zoneid == zone->GetZoneID() && gj->instance_id == zone->GetInstanceID()) if (gj->zoneid == zone->GetZoneID() && gj->instance_id == zone->GetInstanceID())
break; break;
@@ -1259,7 +1266,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break; break;
} }
case ServerOP_RaidAdd: { case ServerOP_RaidAdd: {
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer; auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
if (zone) { if (zone) {
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID()) if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break; break;
@@ -1274,7 +1281,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break; break;
} }
case ServerOP_RaidRemove: { case ServerOP_RaidRemove: {
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer; auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
if (zone) { if (zone) {
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID()) if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break; break;
@@ -1294,7 +1301,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break; break;
} }
case ServerOP_RaidDisband: { case ServerOP_RaidDisband: {
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer; auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
if (zone) { if (zone) {
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID()) if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break; break;
@@ -1309,7 +1316,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break; break;
} }
case ServerOP_RaidLockFlag: { case ServerOP_RaidLockFlag: {
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer; auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
if (zone) { if (zone) {
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID()) if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break; break;
@@ -1326,7 +1333,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break; break;
} }
case ServerOP_RaidChangeGroup: { case ServerOP_RaidChangeGroup: {
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer; auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
if (zone) { if (zone) {
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID()) if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break; break;
@@ -1354,7 +1361,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break; break;
} }
case ServerOP_UpdateGroup: { case ServerOP_UpdateGroup: {
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer; auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
if (zone) { if (zone) {
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID()) if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break; break;
@@ -1367,7 +1374,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break; break;
} }
case ServerOP_RaidGroupLeader: { case ServerOP_RaidGroupLeader: {
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer; auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
if (zone) { if (zone) {
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID()) if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break; break;
@@ -1375,7 +1382,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break; break;
} }
case ServerOP_RaidLeader: { case ServerOP_RaidLeader: {
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer; auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
if (zone) { if (zone) {
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID()) if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break; break;
@@ -1395,7 +1402,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break; break;
} }
case ServerOP_DetailsChange: { case ServerOP_DetailsChange: {
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer; auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
if (zone) { if (zone) {
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID()) if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break; break;
@@ -1410,7 +1417,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break; break;
} }
case ServerOP_RaidGroupDisband: { case ServerOP_RaidGroupDisband: {
ServerRaidGeneralAction_Struct* rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer; auto rga = (ServerRaidGeneralAction_Struct*)pack->pBuffer;
if (zone) { if (zone) {
if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID()) if (rga->zoneid == zone->GetZoneID() && rga->instance_id == zone->GetInstanceID())
break; break;
@@ -1420,7 +1427,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
{ {
auto outapp = auto outapp =
new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupUpdate_Struct)); new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupUpdate_Struct));
GroupUpdate_Struct* gu = (GroupUpdate_Struct*)outapp->pBuffer; auto gu = (GroupUpdate_Struct*)outapp->pBuffer;
gu->action = groupActDisband; gu->action = groupActDisband;
strn0cpy(gu->leadersname, c->GetName(), 64); strn0cpy(gu->leadersname, c->GetName(), 64);
strn0cpy(gu->yourname, c->GetName(), 64); strn0cpy(gu->yourname, c->GetName(), 64);
@@ -1430,27 +1437,26 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break; break;
} }
case ServerOP_RaidGroupAdd: { case ServerOP_RaidGroupAdd: {
ServerRaidGroupAction_Struct* rga = (ServerRaidGroupAction_Struct*)pack->pBuffer; auto rga = (ServerRaidGroupAction_Struct*)pack->pBuffer;
if (zone) { if (zone) {
Raid *r = entity_list.GetRaidByID(rga->rid); Raid *r = entity_list.GetRaidByID(rga->rid);
if (r) { if (r) {
r->LearnMembers(); r->LearnMembers();
r->VerifyRaid(); r->VerifyRaid();
auto outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct)); 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); strn0cpy(gj->membername, rga->membername, 64);
gj->action = groupActJoin; gj->action = groupActJoin;
for (int x = 0; x < MAX_RAID_MEMBERS; x++) for (const auto& m : r->members) {
{ if (m.is_bot) {
if (r->members[x].member) continue;
{
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);
} }
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; break;
} }
case ServerOP_RaidGroupRemove: { case ServerOP_RaidGroupRemove: {
ServerRaidGroupAction_Struct* rga = (ServerRaidGroupAction_Struct*)pack->pBuffer; auto rga = (ServerRaidGroupAction_Struct*)pack->pBuffer;
if (zone) { if (zone) {
Raid *r = entity_list.GetRaidByID(rga->rid); Raid *r = entity_list.GetRaidByID(rga->rid);
if (r) { if (r) {
r->LearnMembers(); r->LearnMembers();
r->VerifyRaid(); r->VerifyRaid();
auto outapp = new EQApplicationPacket(OP_GroupUpdate, sizeof(GroupJoin_Struct)); 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); strn0cpy(gj->membername, rga->membername, 64);
gj->action = groupActLeave; gj->action = groupActLeave;
for (int x = 0; x < MAX_RAID_MEMBERS; x++) for (const auto& m : r->members) {
{ if (m.is_bot) {
if (r->members[x].member) continue;
{
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);
} }
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; break;
} }
case ServerOP_RaidGroupSay: { case ServerOP_RaidGroupSay: {
ServerRaidMessage_Struct* rmsg = (ServerRaidMessage_Struct*)pack->pBuffer; auto rmsg = (ServerRaidMessage_Struct*)pack->pBuffer;
if (zone) { if (zone) {
Raid *r = entity_list.GetRaidByID(rmsg->rid); Raid *r = entity_list.GetRaidByID(rmsg->rid);
if (r) if (r) {
{ for (const auto& m :r->members) {
for (int x = 0; x < MAX_RAID_MEMBERS; x++) if (m.is_bot) {
{ continue;
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 (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; break;
} }
case ServerOP_RaidSay: { case ServerOP_RaidSay: {
ServerRaidMessage_Struct* rmsg = (ServerRaidMessage_Struct*)pack->pBuffer; auto rmsg = (ServerRaidMessage_Struct*)pack->pBuffer;
if (zone) if (zone) {
{
Raid *r = entity_list.GetRaidByID(rmsg->rid); Raid *r = entity_list.GetRaidByID(rmsg->rid);
if (r)
{ if (r) {
for (int x = 0; x < MAX_RAID_MEMBERS; x++) for (const auto& m :r->members) {
{ if (m.is_bot) {
if (r->members[x].member) { continue;
if (strcmp(rmsg->from, r->members[x].member->GetName()) != 0) }
{
if (!r->members[x].is_bot && r->members[x].member->GetFilter(FilterGroupChat) != 0) if (m.member) {
{ if (strcmp(rmsg->from, m.member->GetName()) != 0) {
r->members[x].member->ChannelMessageSend(rmsg->from, r->members[x].member->GetName(), ChatChannel_Raid, rmsg->language, rmsg->lang_skill, rmsg->message); 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) { } else if (update_type == CZUpdateType_Raid) {
auto client_raid = entity_list.GetRaidByID(update_identifier); auto client_raid = entity_list.GetRaidByID(update_identifier);
if (client_raid) { if (client_raid) {
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) { for (const auto& m : client_raid->members) {
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) { if (m.is_bot) {
auto raid_member = client_raid->members[member_index].member->CastToClient(); continue;
DialogueWindow::Render(raid_member, message); }
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) { } else if (update_type == CZUpdateType_Raid) {
auto client_raid = entity_list.GetRaidByID(update_identifier); auto client_raid = entity_list.GetRaidByID(update_identifier);
if (client_raid) { if (client_raid) {
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) { for (const auto& m : client_raid->members) {
auto client_raid_member = client_raid->members[member_index].member; if (m.is_bot) {
if (client_raid_member && client_raid_member->IsClient()) { continue;
}
if (m.member && m.member->IsClient()) {
switch (update_subtype) { switch (update_subtype) {
case CZLDoNUpdateSubtype_AddLoss: case CZLDoNUpdateSubtype_AddLoss:
client_raid_member->UpdateLDoNWinLoss(theme_id, false); m.member->UpdateLDoNWinLoss(theme_id, false);
break; break;
case CZLDoNUpdateSubtype_AddPoints: case CZLDoNUpdateSubtype_AddPoints:
client_raid_member->UpdateLDoNPoints(theme_id, points); m.member->UpdateLDoNPoints(theme_id, points);
break; break;
case CZLDoNUpdateSubtype_AddWin: case CZLDoNUpdateSubtype_AddWin:
client_raid_member->UpdateLDoNWinLoss(theme_id, true); m.member->UpdateLDoNWinLoss(theme_id, true);
break; break;
case CZLDoNUpdateSubtype_RemoveLoss: case CZLDoNUpdateSubtype_RemoveLoss:
client_raid_member->UpdateLDoNWinLoss(theme_id, false, true); m.member->UpdateLDoNWinLoss(theme_id, false, true);
break; break;
case CZLDoNUpdateSubtype_RemoveWin: case CZLDoNUpdateSubtype_RemoveWin:
client_raid_member->UpdateLDoNWinLoss(theme_id, true, true); m.member->UpdateLDoNWinLoss(theme_id, true, true);
break; break;
default: default:
break; break;
@@ -2365,9 +2374,13 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
} else if (update_type == CZUpdateType_Raid) { } else if (update_type == CZUpdateType_Raid) {
auto client_raid = entity_list.GetRaidByID(update_identifier); auto client_raid = entity_list.GetRaidByID(update_identifier);
if (client_raid) { if (client_raid) {
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) { for (const auto& m : client_raid->members) {
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) { if (m.is_bot) {
auto raid_member = client_raid->members[member_index].member->CastToClient(); continue;
}
if (m.member && m.member->IsClient()) {
auto raid_member = m.member->CastToClient();
raid_member->SendMarqueeMessage(type, priority, fade_in, fade_out, duration, message); 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) { } else if (update_type == CZUpdateType_Raid) {
auto client_raid = entity_list.GetRaidByID(update_identifier); auto client_raid = entity_list.GetRaidByID(update_identifier);
if (client_raid) { if (client_raid) {
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) { for (const auto& m : client_raid->members) {
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) { if (m.is_bot) {
auto raid_member = client_raid->members[member_index].member->CastToClient(); continue;
}
if (m.member && m.member->IsClient()) {
auto raid_member = m.member->CastToClient();
raid_member->Message(type, message); 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) { } else if (update_type == CZUpdateType_Raid) {
auto client_raid = entity_list.GetRaidByID(update_identifier); auto client_raid = entity_list.GetRaidByID(update_identifier);
if (client_raid) { if (client_raid) {
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) { for (const auto& m : client_raid->members) {
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) { if (m.is_bot) {
auto raid_member = client_raid->members[member_index].member->CastToClient(); continue;
}
if (m.member && m.member->IsClient()) {
auto raid_member = m.member->CastToClient();
switch (update_subtype) { switch (update_subtype) {
case CZMoveUpdateSubtype_MoveZone: case CZMoveUpdateSubtype_MoveZone:
raid_member->MoveZone(zone_short_name); 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) { } else if (update_type == CZUpdateType_Raid) {
auto client_raid = entity_list.GetRaidByID(update_identifier); auto client_raid = entity_list.GetRaidByID(update_identifier);
if (client_raid) { if (client_raid) {
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) { for (const auto& m : client_raid->members) {
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) { if (m.is_bot) {
auto raid_member = client_raid->members[member_index].member->CastToClient(); continue;
}
if (m.member && m.member->IsClient()) {
auto raid_member = m.member->CastToClient();
raid_member->SetEntityVariable(variable_name, variable_value); raid_member->SetEntityVariable(variable_name, variable_value);
} }
} }
@@ -2601,7 +2626,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
} }
case ServerOP_CZSignal: case ServerOP_CZSignal:
{ {
CZSignal_Struct* CZS = (CZSignal_Struct*) pack->pBuffer; auto CZS = (CZSignal_Struct*) pack->pBuffer;
uint8 update_type = CZS->update_type; uint8 update_type = CZS->update_type;
int update_identifier = CZS->update_identifier; int update_identifier = CZS->update_identifier;
int signal_id = CZS->signal_id; 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) { } else if (update_type == CZUpdateType_Raid) {
auto client_raid = entity_list.GetRaidByID(update_identifier); auto client_raid = entity_list.GetRaidByID(update_identifier);
if (client_raid) { if (client_raid) {
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) { for (const auto& m : client_raid->members) {
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) { if (m.is_bot) {
auto raid_member = client_raid->members[member_index].member->CastToClient(); continue;
raid_member->Signal(signal_id); }
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) { } else if (update_type == CZUpdateType_Raid) {
auto client_raid = entity_list.GetRaidByID(update_identifier); auto client_raid = entity_list.GetRaidByID(update_identifier);
if (client_raid) { if (client_raid) {
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) { for (const auto& m : client_raid->members) {
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) { if (m.is_bot) {
auto raid_member = client_raid->members[member_index].member->CastToClient(); continue;
}
if (m.member && m.member->IsClient()) {
auto raid_member = m.member->CastToClient();
switch (update_subtype) { switch (update_subtype) {
case CZSpellUpdateSubtype_Cast: case CZSpellUpdateSubtype_Cast:
raid_member->ApplySpellBuff(spell_id); 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) { } else if (update_type == CZUpdateType_Raid) {
auto client_raid = entity_list.GetRaidByID(update_identifier); auto client_raid = entity_list.GetRaidByID(update_identifier);
if (client_raid) { if (client_raid) {
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) { for (const auto& m : client_raid->members) {
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) { if (m.is_bot) {
auto raid_member = client_raid->members[member_index].member->CastToClient(); continue;
}
if (m.member && m.member->IsClient()) {
auto raid_member = m.member->CastToClient();
switch (update_subtype) { switch (update_subtype) {
case CZTaskUpdateSubtype_ActivityReset: case CZTaskUpdateSubtype_ActivityReset:
raid_member->ResetTaskActivity(task_identifier, task_subidentifier); raid_member->ResetTaskActivity(task_identifier, task_subidentifier);
+1 -1
View File
@@ -1262,7 +1262,7 @@ bool Client::CanEnterZone(const std::string& zone_short_name, int16 instance_ver
return false; 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)) { if (Admin() < minStatusToIgnoreZoneFlags && !HasZoneFlag(z->zoneidnumber)) {
LogInfo( LogInfo(
"Character [{}] does not have the flag to be in this zone [{}]!", "Character [{}] does not have the flag to be in this zone [{}]!",