Skip to content

Commit

Permalink
[z2815] Creature: Implement Pursuit
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Jun 21, 2023
1 parent dc9b81c commit 37206a9
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sql/base/mangos.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`;
CREATE TABLE `db_version` (
`version` varchar(120) DEFAULT NULL,
`creature_ai_version` varchar(120) DEFAULT NULL,
`required_z2814_01_mangos_worldstate_expression_spawn_group` bit(1) DEFAULT NULL
`required_z2815_01_mangos_pursuit` bit(1) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Used DB version notes';

--
Expand Down Expand Up @@ -1277,7 +1277,7 @@ CREATE TABLE `creature_template` (
`SpeedRun` float NOT NULL DEFAULT '0',
`Detection` INT(10) UNSIGNED NOT NULL DEFAULT '18' COMMENT 'Detection range for proximity',
`CallForHelp` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Range in which creature calls for help?',
`Pursuit` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'When exceeded during pursuit creature evades?',
`Pursuit` INT(10) UNSIGNED NOT NULL DEFAULT '15000' COMMENT 'Hit refresh time after which creature evades',
`Leash` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Leash range from combat start position',
`Timeout` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Time for refreshing leashing before evade?',
`UnitClass` tinyint(3) unsigned NOT NULL DEFAULT '0',
Expand Down
5 changes: 5 additions & 0 deletions sql/updates/mangos/z2815_01_mangos_pursuit.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE db_version CHANGE COLUMN required_z2814_01_mangos_worldstate_expression_spawn_group required_z2815_01_mangos_pursuit bit;

UPDATE creature_template SET Pursuit=15000 WHERE Pursuit=0;


2 changes: 1 addition & 1 deletion src/game/Combat/CombatManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void CombatManager::TriggerCombatTimer(Unit* target)

void CombatManager::TriggerCombatTimer(bool pvp)
{
m_combatTimer = pvp ? 5000 : 15000;
m_combatTimer = pvp ? 5000 : m_owner->GetPursuit();
m_lastRefreshPos = m_owner->GetPosition();
}

Expand Down
1 change: 1 addition & 0 deletions src/game/Entities/Creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ class Creature : public Unit
void SetCombatStartPosition(Position const& pos) { m_combatStartPos = pos; }
void GetCombatStartPosition(Position& pos) const { pos = m_combatStartPos; }
Position const& GetCombatStartPosition() const { return m_combatStartPos; }
uint32 GetPursuit() const override { return GetCreatureInfo()->Pursuit; }

void SetRespawnCoord(CreatureCreatePos const& pos) { m_respawnPos = pos.m_pos; }
void SetRespawnCoord(float x, float y, float z, float ori) { m_respawnPos.x = x; m_respawnPos.y = y; m_respawnPos.z = z; m_respawnPos.o = ori; }
Expand Down
1 change: 1 addition & 0 deletions src/game/Entities/Unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -1621,6 +1621,7 @@ class Unit : public WorldObject
void EngageInCombatWithAggressor(Unit* aggressor);
void ClearInCombat();
void HandleExitCombat(bool customLeash, bool pvpCombat = false);
virtual uint32 GetPursuit() const { return 15000; }

SpellAuraHolderBounds GetSpellAuraHolderBounds(uint32 spell_id)
{
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_sql.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
#define REVISION_DB_REALMD "required_z2800_01_realmd_platform"
#define REVISION_DB_LOGS "required_z2778_01_logs_anticheat"
#define REVISION_DB_CHARACTERS "required_z2799_01_characters_account_data"
#define REVISION_DB_MANGOS "required_z2814_01_mangos_worldstate_expression_spawn_group"
#define REVISION_DB_MANGOS "required_z2815_01_mangos_pursuit"
#endif // __REVISION_SQL_H__

0 comments on commit 37206a9

Please sign in to comment.