diff --git a/utils/sql/db_update_manifest.txt b/utils/sql/db_update_manifest.txt index ca7a29f25..9be222856 100644 --- a/utils/sql/db_update_manifest.txt +++ b/utils/sql/db_update_manifest.txt @@ -404,7 +404,7 @@ 9148|2020_01_28_corpse_guild_consent_id.sql|SHOW COLUMNS FROM `character_corpses` LIKE 'guild_consent_id'|empty| 9149|2020_02_06_globalloot.sql|SHOW COLUMNS FROM `global_loot` LIKE 'hot_zone'|empty| 9150|2020_02_06_aa_reset_on_death.sql|SHOW COLUMNS FROM `aa_ability` LIKE 'reset_on_death'|empty| -9151|2020_03_05_npc_always_aggro.sql|SHOW COLUMNS FROM `npc_types` LIKE 'always_aggros_foes'|empty| +9151|2020_03_05_npc_always_aggro.sql|SHOW COLUMNS FROM `npc_types` LIKE 'always_aggro'|empty| # Upgrade conditions: # This won't be needed after this system is implemented, but it is used database that are not diff --git a/utils/sql/git/required/2020_03_05_npc_always_aggro.sql b/utils/sql/git/required/2020_03_05_npc_always_aggro.sql index d9e6351a3..83641998c 100644 --- a/utils/sql/git/required/2020_03_05_npc_always_aggro.sql +++ b/utils/sql/git/required/2020_03_05_npc_always_aggro.sql @@ -1 +1 @@ -ALTER TABLE `npc_types` ADD COLUMN `always_aggros_foes` tinyint(4) NOT NULL DEFAULT 0; +ALTER TABLE `npc_types` ADD COLUMN `always_aggro` tinyint(1) NOT NULL DEFAULT 0; diff --git a/zone/aggro.cpp b/zone/aggro.cpp index fac15457e..87b98d599 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -139,7 +139,7 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { if (RuleB(Aggro, UseLevelAggro)) { - if (GetLevel() < RuleI(Aggro, MinAggroLevel) && mob->GetLevelCon(GetLevel()) == CON_GRAY && GetBodyType() != 3 && !AlwaysAggrosFoes()) + if (GetLevel() < RuleI(Aggro, MinAggroLevel) && mob->GetLevelCon(GetLevel()) == CON_GRAY && GetBodyType() != 3 && !AlwaysAggro()) { towho->Message(Chat::White, "...%s is red to me (basically)", mob->GetName(), dist2, iAggroRange2); return; @@ -147,7 +147,7 @@ void NPC::DescribeAggro(Client *towho, Mob *mob, bool verbose) { } else { - if(GetINT() > RuleI(Aggro, IntAggroThreshold) && mob->GetLevelCon(GetLevel()) == CON_GRAY && !AlwaysAggrosFoes()) { + if(GetINT() > RuleI(Aggro, IntAggroThreshold) && mob->GetLevelCon(GetLevel()) == CON_GRAY && !AlwaysAggro()) { towho->Message(Chat::White, "...%s is red to me (basically)", mob->GetName(), dist2, iAggroRange2); return; @@ -318,7 +318,7 @@ bool Mob::CheckWillAggro(Mob *mob) { //old InZone check taken care of above by !mob->CastToClient()->Connected() ( ( GetLevel() >= RuleI(Aggro, MinAggroLevel)) - ||(GetBodyType() == 3) || AlwaysAggrosFoes() + ||(GetBodyType() == 3) || AlwaysAggro() ||( mob->IsClient() && mob->CastToClient()->IsSitting() ) ||( mob->GetLevelCon(GetLevel()) != CON_GRAY) @@ -352,7 +352,7 @@ bool Mob::CheckWillAggro(Mob *mob) { //old InZone check taken care of above by !mob->CastToClient()->Connected() ( ( GetINT() <= RuleI(Aggro, IntAggroThreshold) ) - || AlwaysAggrosFoes() + || AlwaysAggro() ||( mob->IsClient() && mob->CastToClient()->IsSitting() ) ||( mob->GetLevelCon(GetLevel()) != CON_GRAY) @@ -384,7 +384,7 @@ bool Mob::CheckWillAggro(Mob *mob) { LogAggro("Dist^2: [{}]\n", dist2); LogAggro("Range^2: [{}]\n", iAggroRange2); LogAggro("Faction: [{}]\n", fv); - LogAggro("AlwaysAggroFlag: [{}]\n", AlwaysAggrosFoes()); + LogAggro("AlwaysAggroFlag: [{}]\n", AlwaysAggro()); LogAggro("Int: [{}]\n", GetINT()); LogAggro("Con: [{}]\n", GetLevelCon(mob->GetLevel())); diff --git a/zone/corpse.cpp b/zone/corpse.cpp index 5858d5acc..fd4174868 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -262,7 +262,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp) : Mob ( 0, // uint8 in_legtexture, 0, // uint8 in_feettexture, 0, // uint8 in_usemodel, - 0 // bool in_always_aggros_foes + 0 // bool in_always_aggro ), corpse_decay_timer(RuleI(Character, CorpseDecayTimeMS)), corpse_rez_timer(RuleI(Character, CorpseResTimeMS)), diff --git a/zone/mob.cpp b/zone/mob.cpp index 2e3d3d290..5d25c42f0 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -94,7 +94,7 @@ Mob::Mob( uint8 in_legtexture, uint8 in_feettexture, uint16 in_usemodel, - bool in_always_aggros_foes + bool in_always_aggro ) : attack_timer(2000), attack_dw_timer(2000), @@ -276,7 +276,7 @@ Mob::Mob( qglobal = 0; spawned = false; rare_spawn = false; - always_aggros_foes = in_always_aggros_foes; + always_aggro = in_always_aggro; InitializeBuffSlots(); diff --git a/zone/mob.h b/zone/mob.h index 2a89ba384..f1c128080 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -579,7 +579,7 @@ public: inline const GravityBehavior GetFlyMode() const { return flymode; } bool IsBoat() const; bool IsControllableBoat() const; - inline const bool AlwaysAggrosFoes() const { return always_aggros_foes; } + inline const bool AlwaysAggro() const { return always_aggro; } //Group virtual bool HasRaid() = 0; @@ -1391,7 +1391,7 @@ protected: Timer ranged_timer; float attack_speed; //% increase/decrease in attack speed (not haste) int attack_delay; //delay between attacks in 10ths of seconds - bool always_aggros_foes; + bool always_aggro; int16 slow_mitigation; // Allows for a slow mitigation (100 = 100%, 50% = 50%) Timer tic_timer; Timer mana_timer; diff --git a/zone/npc.cpp b/zone/npc.cpp index 307e7a926..6df237d5d 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -114,7 +114,7 @@ NPC::NPC(const NPCType *npc_type_data, Spawn2 *in_respawn, const glm::vec4 &posi npc_type_data->legtexture, npc_type_data->feettexture, npc_type_data->use_model, - npc_type_data->always_aggros_foes + npc_type_data->always_aggro ), attacked_timer(CombatEventTimer_expire), swarm_timer(100), diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 3b03d2563..cad4e1df8 100755 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2507,7 +2507,7 @@ const NPCType *ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load "npc_types.stuck_behavior, " "npc_types.model, " "npc_types.flymode, " - "npc_types.always_aggros_foes " + "npc_types.always_aggro " "FROM npc_types %s", where_condition.c_str() ); @@ -2709,7 +2709,7 @@ const NPCType *ZoneDatabase::LoadNPCTypesData(uint32 npc_type_id, bool bulk_load temp_npctype_data->stuck_behavior = atoi(row[109]); temp_npctype_data->use_model = atoi(row[110]); temp_npctype_data->flymode = atoi(row[111]); - temp_npctype_data->always_aggros_foes = atoi(row[112]); + temp_npctype_data->always_aggro = atoi(row[112]); temp_npctype_data->skip_auto_scale = false; // hardcoded here for now diff --git a/zone/zonedump.h b/zone/zonedump.h index 80508f233..0a1bcd07d 100644 --- a/zone/zonedump.h +++ b/zone/zonedump.h @@ -147,7 +147,7 @@ struct NPCType int8 stuck_behavior; uint16 use_model; int8 flymode; - bool always_aggros_foes; + bool always_aggro; }; namespace player_lootitem {