Commit Graph

499 Commits

Author SHA1 Message Date
xinef1 fe63cd3dbb Core/Creatures: Various fixes for creatures, regarding combat conditions, despawning, and few others (#18998)
* Made some changes to kiting mechanics, simplified code and made taunt auras prolong combat no matter the distance from the spawn
Unified some creature despawning code, removed some brutal direct calls in scripts
Don't play death anim on forced despawn
Removed some redundant visibility changes on creature despawn
Fixed possible problem with pet initializing template info from difficulty greater than normal
Properly keep UNIT_FLAG_IN_COMBAT on UpdateEntry call
Moved RegenerateMana function to general Regenerate(Power) function
Fixed increased health regeneration from polymorph for pets
Implemented CREATURE_TYPE_FLAG_GHOST_VISIBLE, those creatures will be properly seen when player is dead also
Removed hackfix from Gaeriyan and Franclorn Forgewright, fixed properly
Simplified ForcedRespawnTime code in ForcedDespawn
Do not allow to assist unit while evading or when enemy is evading
Do not allow to attack other units when evading or when the unit is evading
Corrected distance checking code before creature is allowed to evade, should fix some common problems
Properly return summon position for summoned creatures as their respawn position
Properly stop all moving units on gossip hello, no matter their npc flags

(cherrypicked from e1f14215d8)
2019-07-21 21:06:54 +02:00
xinef1 ca26c33145 Implemented binary resistances and some more (#18933)
- Fixed possible exploit with tamed pets having template immunities
- Implemented binary resistances
- Corrected resistances calculations
- Pets properly inherit players spell penetration
- Fixed doubled block calculation for damaging melee spells
- Auras removing snare effects will only remove the snaring component
- Shapeshifting will properly remove movement impairing auras only and not crowd control (dragon's breath)
- Immunities are properly checked versus all schools appearing in spell, unit is immune only if immune to all schools
- Spells with melee and magic school mask should compare armor reduction with resistances and select smaller reduction
- Demonic Circle: Teleport no longer removes root effects

(cherrypicked from 93746e8c4a)
2019-07-21 21:06:54 +02:00
xinef1 ad008c43b7 Core/Misc: Fix various crashes, also related to multithreading (#19012)
* When iterating groups we have to either do it not in multithreaded context (map updates) or start with checking maps (they are guaranteed to change in single thread update).
* Properly clear ComboPoint references on player remove
* remove some possible references item may have when it is deleted during save.
* Also clear all hostile references when unit is removed from map.

(cherrypicked from 86da1a19bb)
2019-07-21 21:06:54 +02:00
xinef1 b485f3e673 Few small optimizations here and there (#18684)
Changes list:
- Added CharacterGuidByNameContainer which contains name -> guid unordered map (updated along CharacterInfo)
- Extended CharacterInfo structure with GuildId
- Extended CharacterInfo structure with ArenaTeamId[3], for all possible teams (2v2, 3v3, 5v5)
- Removed CHAR_SEL_GUID_BY_NAME and CHAR_SEL_CHAR_GUID_BY_NAME synchronous queries, name -> guid can be now retrieved in World::GetCharacterGuidByName
- Removed CHAR_SEL_GUID_RACE_ACC_BY_NAME synchronous query, guid can be retrieved by name and rest of the data can be retrieved by guid
- Removed CHAR_SEL_CHAR_LEVEL synchronous query, level can be retrieved by guid
- Changed CHAR_SEL_CHARACTER_ACTIONS_SPEC to asynchronous query, action bars are now loaded asynchronously
- Removed CHAR_SEL_CHARACTER_NAME_CLASS synchronous query, guid can be retrieved by name and rest of the data can be retrieved by guid
- Removed CHAR_SEL_PLAYER_ARENA_TEAMS and CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID synchronous queries, arena teams are now stored in CharacterInfo
- Replaced synchronous db calls with CharacterInfo lookups
- Removed ObjectMgr::GetPlayerGUIDByName, as it used db query
- Replaced some unnecessary UpdateObjectVisibility() calls because they were either duplicated (called few lines above in other function) or it is enough to call DestroyForNearbyPlayers because object is being removed or should be invisible and DestroyForNearbyPlayers is faster
- Corrected typo in Player::DestroyForPlayer, only items in slots 0 to EQUIPMENT_SLOT_END are sent to other players
- Renamed Player::GetGuildIdFromDB to Player::GetGuildIdFromCharacterInfo and changed the function to use CharacterInfo structure
- Renamed Player::GetArenaTeamIdFromDB to Player::GetArenaTeamIdFromCharacterInfo and changed the function to use CharacterInfo structure
- Renamed Player::GetLevelFromDB to Player::GetLevelFromCharacterInfo and changed the function to use CharacterInfo structure
- Removed GameEventMgr::_questToEventLinks and associated functions, eventId is now stored in Quest class under _eventIdForQuest variable
- Changed some functions checking quest status to use other functions for quest status check instead of duplicating code
- Removed callback from add friend, because we can get the guid from appropriate storage, no need to make db query
- Removed callback from add ignore, because we can get the guid from appropriate storage, no need to make db query
- Added callback to unwrap wrapped items asynchronously
- Removed synchronous select in tutorials to check if we have any entries in db, if any entry exists in db, m_TutorialsChanged variable will have TUTORIALS_FLAG_LOADED_FROM_DB flag added and it is no longer necessary to query database

(cherrypicked from b955456008)
2019-07-21 21:06:54 +02:00
treeston cc020b2a0f Core/Creature: Prevent boss creatures from ever respawning naturally.
(cherrypicked from 3ddcf40037)
2019-06-15 18:41:09 +02:00
ariel- 6135ee1ad7 Core/Creature: don't allow turning if spell would cancel due to turning to face target
Closes #18549

(cherrypicked from 6b55faba06)
(cherrypicked from  c83092a127)
2019-06-15 18:41:09 +02:00
Shauren 455959c606 Core/PacketIO: Rewrite updatefield handling 2019-06-08 17:06:57 +02:00
Kittnz 83e6fde066 Core/Objects: increase sight range of all Infinite, Gigantic and Large objects & correct general default visibility distance (#22892)
Note: This does not make the object active.

Some info on range
https://trinitycore.atlassian.net/wiki/spaces/tc/pages/74950924/Lua+Scene+Script+Documentation#LuaSceneScriptDocumentation-ActorAOIRange

#21111 #21681 #22891

Thanks Kinzcool & Kelno
2019-01-16 20:48:01 +01:00
vincent-michael 5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
Shauren f94deace76 Merge branch 'bfa' 2018-12-09 14:45:03 +01:00
xinef1 fef8e5fe14 Core/Pets: Fixed bug where pets tamed from large npcs had too big combat reach (#18909)
(cherry-picked from 2ecc0c0775)
2018-12-09 14:18:42 +01:00
xinef1 befea2f7a6 Core/Creatures: Stop falling if corpse is removed (can happen when alive unit is despawned instantly in air) (#18995)
Do not allow to start waypoint movement when unit is dead

(cherry-picked from f86ca9e3c9)
2018-12-09 14:18:42 +01:00
Keader 2e45423537 Core/Entities: Implemented CREATURE_FLAG_EXTRA_NO_MOVE_FLAGS_UPDATE (#18980)
(cherry-picked from 15ea5b1b8d)
2018-12-09 14:18:42 +01:00
Traesh 9d210476e5 Core/Creatures: Update creature model handling with new display scale (#22567) 2018-11-07 20:23:30 +01:00
Shauren 0a779bd791 Core/PacketIO: Updated packet structures to 8.0.1 2018-11-05 00:00:34 +01:00
Shauren 7512ffb058 Core/Entities: Update updatefields to 8.0.1.27980 2018-10-10 22:11:41 +02:00
Shauren 738f37d3cf Core/Maps: Replaced spawnmask with difficulty list 2018-09-15 17:55:26 +02:00
funjoker 24f51f6586 Core/Creatures: Update Scaling to 7.3.5 (#21521) 2018-04-12 22:57:49 +03:00
Shauren 91be2332e2 Core/Entities: Phasing rewrite
* Optimized phase visibility checking
* Handle all phase flags

Closes #16758
Closes #21119
2018-03-25 19:28:36 +03:00
Traesh 5734788c02 Core/Creatures: Minor HasSpell method cleanup (#21669) 2018-03-19 17:51:27 +01:00
ariel- f20e53c138 Core/Entities: Replace existing GetAuraEffectsByType + iteration uses with proper helper functions
(cherry picked from commit 3a52ad8d38)
2018-03-12 16:39:39 +01:00
ariel- f07a746321 Core/Spell: improved immunity logic for dispels
(cherry picked from commit 01d272d6cb)
2018-03-12 16:39:37 +01:00
ccrs 1c46e7ca84 Core/Pets: Pet Attack Distance
(cherry picked from commit 2d1ef6b5b0)

typo fix
by ccrs
(cherry picked from commit b049caf62f)
2018-03-11 16:42:38 +01:00
Mihapro 16a7a414ab Core/Creatures: Updated power type handling (#20981)
Closes #17476
Closes #12487
2018-03-04 12:48:22 +01:00
Shauren 91aa8e1193 Build fix
(cherry picked from commit 713bf944ae)
2018-02-05 23:43:29 +01:00
Shauren 8ed52e9dc3 Core/Scripts: Fixed ENSURE_AI assertion failures when used in Reset()/InitializeAI() hooks with hotswap
Updates #20727

(cherry picked from commit 2fd9dc2edb)
2018-02-05 23:41:39 +01:00
joschiwald 6226189a16 Core/Entities: Created factory methods to create new areatriggers, creatures and gameobjects 2018-01-27 23:02:46 +01:00
Shauren bb718b5578 Core/Entities: Remove phasemask 2018-01-10 22:01:40 +01:00
joschiwald 5e3e4182c8 Core/Entities: Extended SpawnMask to 64 bit 2018-01-06 19:56:11 +01:00
Mihapro 8199eef81c Core/Misc: Added helper function Unit::SetFullPower
* Also renamed Unit::getPowerType and Unit::setPowerType to follow style guidelines

Ref #20981
2018-01-03 16:39:32 +01:00
vincent-michael 7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
treeston 1b7fb624d3 Core/Creature: Correctly reset pathfinding capability on respawn. Prevents evade chains on some bosses. Closes #18188.
(cherry picked from commit aeb5762170)
2017-12-10 17:30:00 +01:00
joschiwald 9a9d4aa528 Core/Creature: Corrected aggro radius calculation after ea99801cd6 (#20924) 2017-11-19 16:30:54 +01:00
Ovah ea99801cd6 Core/Creature: Reworked creature aggro radius calculation (#20615)
* Core/Creatures: rewrote creature aggro radius calculation
* Formulas are taken from WoW Wiki
2017-11-15 21:56:15 +01:00
treeston 03a2f0d56a Entities/Creature: Fix an edge case issue where creatures would re-acquire target after respawn if they despawned while spell focusing.
Instance/AzjolNerub: Fix Anub'arak wall and add sequence break info. Fixes and closes #18013.

(cherry picked from commit 0d725e1336)
2017-10-03 17:35:19 +02:00
treeston a8e3654860 Core/Creature: Fix respawn logic to call reset react state BEFORE calling Reset(). Fixes Krik'thir behavior after a wipe (and maybe some others).
Fixes and closes #18011.

(cherry picked from commit aab7abfd04)
2017-10-03 17:17:11 +02:00
ariel- 63b2551870 Core/Creature: Call SetSpawnHealth after JustReachedHome in HomeMovementGenerator
Fixes issues with quests that rely on this behaviour (eg Free your Mind)

Also updated SetSpawnHealth so it doesn't do anything in case spawn is manual (SetHealth(GetHealth()) does modify things depending on deathstate)

(cherry picked from commit b8a1a18a5a)
2017-09-05 19:19:37 +02:00
Seyden 5675902485 Core/Creatures: Implemented Basic Creature Scaling (#20026) 2017-07-29 21:40:28 +02:00
Shauren 0cd5179726 Core/Creatures: Rewrite trainer handling to properly support multiple trainers on the same creature
* Trainers are now defined as templates (sniffable), assigned by gossip options
2017-07-26 00:53:51 +02:00
Shauren 3107dfe3e7 Core/Creatures: Allow talent reset gossip from level 15 instead of 10 since that is when first talent is available 2017-07-24 23:24:32 +02:00
Shauren 4226eb2ea5 Core/Misc: Some /W4 warning fixes 2017-06-07 17:23:50 +02:00
Shauren b453e12423 Core/Game: Include cleanup part 5
* ObjectMgr.h
* Player.h
* Unit.h
* G3D should no longer propagate everywhere from Spline/MotionMaster
2017-06-04 01:00:45 +02:00
Shauren 3d7c2ef88f Core/Game: Include cleanup, part 4 - packets and largest headers (after preprocessing, except player/objectmgr) 2017-05-21 23:18:43 +02:00
joschiwald b192c46b06 Core/Creature: Added UnitFlags3 to creature_template 2017-05-21 14:17:47 +02:00
Shauren b421a5c0cb Core/Game: Include cleanup - remove Map dependency from Object.h 2017-05-15 22:55:16 +02:00
Shauren 9299e9bde0 Core/Grids: Ported cmangos/mangos-wotlk@ea99457e50 2017-05-13 19:37:33 +02:00
joschiwald 036f67c0c1 Core/Collision: Replaced phasemask with proper phases in GameObject collision calculation 2017-05-05 21:22:58 +02:00
joschiwald c1cc0e9949 Core/Misc: Added Creature::CanGiveExperience helper function 2017-05-05 14:44:47 +02:00
Malcrom de0bbf4056 Core/Creature: Fixed ForcedDespawn 2017-04-24 13:49:58 +02:00
Krudor 5a36a2eb17 Core/Scripts: Add support for spawn specific C++ scripts
Closes #19247
2017-03-18 11:31:31 +01:00