Commit Graph
648 Commits
Author SHA1 Message Date
xinef1 f431459063 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

(cherry picked from commit e1f14215d86fc9f0cd041f0e87bf0a689c086329)
2022-02-16 04:49:24 +01:00
Shauren f2b4f2208e Core/Objects: ported master branch handling for properly destroying objects via out of range and destroy object opcode
# Conflicts:
#	src/server/game/Entities/Creature/Creature.cpp
2022-02-02 16:24:42 +01:00
ariel- af98e8516c Core/Auras: reworked multiplicative AuraEffects calculation 2021-11-28 12:14:05 +01:00
Ovahlord 2c70d98449 warning fix² 2021-11-11 17:59:45 +01:00
Ovahlord 5ca475a764 Core/Movement: split SetCanFly for player and creature class and handle their part accordingly 2021-11-10 13:53:14 +01:00
Ovahlord edbbeba5a2 Core/Movement: ported client control logic updates from 335 branch 2021-11-06 23:41:34 +01:00
Ovahlord 7a602d4b44 Core/Creatures: apply database defined movementflags on (re)spawn and on reaching home only
This allows manipulating movementflags without having to block everything via CREATURE_FLAG_EXTRA_NO_MOVE_FLAGS_UPDATE
Yo @keader that flag is your fuckery. gimme feedback
2021-10-31 10:52:45 +01:00
Ovahlord 217299beed Core/Creatures: improved movement flag updating for creatures by taking db values more serious 2021-10-30 22:12:01 +02:00
Ovahlord d3da33dff0 Core/Creatures: store the original entry of a creature instead of the current one as creatures may change their entry during runtime 2021-10-30 15:41:47 +02:00
Ovahlord b10f962ba3 Core/Creatures: several cleanups and improvements to spell focusing to reduce edge case issues 2021-10-21 13:18:24 +02:00
Ovahlord 949f92e0a1 Core/AI: ported charm updates from 335 2021-09-16 16:48:07 +02:00
Ovahlord 0dfa919f09 Core/Creatures: optimized sparring checks by handling them via variable instead of map lookups and expose its value to helpers to allow manipulation during runtime 2021-07-26 15:48:16 +02:00
Giacomo Pozzoni d83cd33bd4 Core/Pools: Fix pools with 1 member never spawning anything anymore (#26620)
* Core/Pools: Fix pools with 1 member never spawning anything anymore

Attempts to fix a 6 years old bug and never fixed by the original author.

* Remove respawn times from db once a respawn has been handled

* Allow to specify if Despawn1Object() should save or not the respawn time. We don't need to do that when respawning an object.

* Apply the same fix to GameObjects too
# Conflicts:
#	src/server/game/Pools/PoolMgr.h
2021-06-27 06:33:19 +02:00
Ovahlord b5994ec6c5 Core/Units: improved logic for determining when a power update shall happen 2021-04-30 16:48:26 +02:00
Ovahlord 1675506c97 Core/Creatures: update a creature's home position on engage when it's using a cyclic spline 2021-03-14 09:23:29 +01:00
Ovahlord a80faa391b Core/Creatures: moved AIReaction to AtEngage to ensure that ai reactions wont be sent when entering combat with a creature that might not even engage us 2021-03-14 09:22:16 +01:00
Ovahlord e59bc54a62 Core/Misc: fixed more static analysis warnings 2021-03-11 19:47:07 +01:00
Ovahlord 6b0f11d6b9 Core/Creatures: always fall back to base creature data when selecting display IDs for difficulty entries
Some sniffed query packets contain display IDs for difficulty entries that are completely wrong so we are safe to assume that we always fall back to the display of the original creature ID instead of the one of the difficulty entry
2021-02-28 16:27:05 +01:00
Giacomo Pozzoni 48a0dde345 Core/Creature: Add new db field InteractionPauseTimer
Add new db field InteractionPauseTimer to allow to define different interaction pause timers for each creature (the previous system was a global setting in worldserver.conf Creature.MovingStopTimeForPlayer)

Set all columns in creature_template_movement as optional (can be NULL, default NULL). Fill only the columns that should override the default C++ value
2021-02-21 16:50:55 +01:00
Ovahlord 0299fa4fe1 Core/Misc: replace boost::optional with std::optional 2021-02-19 14:07:43 +01:00
Ovahlord c3e9861723 Core/Movement: implement creature movement info table to override movement speeds based on movement IDs
thx to @xvwyh for providing initial table data for the most common entries
2021-02-16 16:56:10 +01:00
Ovahlord cc25457fe8 Core/Units: send AI reactions uppon entering combat instead of attacking an enemy 2021-01-31 14:08:58 +01:00
Giacomo Pozzoni 5e3b57bae7 Core/Unit: Fix movement hiccups in water
* Core/Unit: Allow to define Units which can enter water but cannot swim

Allow to define Units which can enter water but cannot swim, i.e. crabs walking at the bottom of a sea.

* Add UNIT_FLAG_SWIMMING to creatures when entering combat

* Fix charmed creatures not entering water

* Always allow Creatures controlled by players to enter water

* Add swimming flag when possessing a unit and remove it properly at the end, even if the creature engaged combat before and after.
When adding/removing UNIT_FLAG_SWIMMING manually calling Creature::RefreshSwimmingFlag(true) might be required.
2021-01-11 12:33:54 +01:00
Ovahlord 88024e0e74 Core/Packets: converted more packets to packet class 2020-11-02 17:51:08 +01:00
Ovahlord 0008916251 Core/Creatures: skip model gender randomization for creatures that have their display ID overriden in creature table 2020-10-29 18:03:16 +01:00
Ovahlord 90e5e85afd Core/Misc: updated a bunch of packets to packet class 2020-10-21 12:04:13 +02:00
Ovahlord 44be244ced Core/Units: remove excessive spam of animation tier spline update packets on every movement update 2020-09-28 19:33:14 +02:00
Ovahlord 0a480f3ae8 Core/Units: update internal facing of units on every update tick when a target guid or a tracking channeled spell is being used 2020-09-23 20:48:43 +02:00
Ovahlord 27c1fd6aee Core/Movement: implement cyclic spline database support 2020-09-21 00:32:55 +02:00
Ovahlord 3274117cec Core/Spells: cleaned up and improved spell focusing behavior
* removed hacky update_object call from SetSpellFocus helper
* corrected facing behaivior in SetSpellFocus
* spells with SPELL_ATTR5_DONT_TURN_DURING_CAST will no longer set a target guid for proper clientside facing behaivior
* channeled spells with a destination target will no longer pick a objectTarget
* update serverside orientation for channeled spells with SPELL_ATTR1_CHANNEL_TRACK_TARGET
2020-09-09 20:08:35 +02:00
Ovahlord 9d345f0d87 Core/Creatures: creature groups no longer unnecessarily throw their data on the heap and formations now support inversing angles when waypoint Ids are 0 2020-08-28 23:02:05 +02:00
Ovahlord a657a21c4a Core/Units: backported hit, dodge, parry and crit chance updates from 335 and fixed logics in 4.x specific code 2020-08-23 17:14:34 +02:00
Ovahlord 9340f8d9df Core/Units: add new functionality for units to block or enable combat entirely via helper to reflect what CREATURE_DIFFICULTYFLAGS_IGNORE_COMBAT and client ai functions imply 2020-07-29 15:46:09 +02:00
Ovahlord 64c4b4f529 Core/Misc: converted quest, creature and quest query packets to packet class and ported query data caching from 335 branch 2020-07-28 21:34:12 +02:00
Ovahlord 9d618c3162 Core/Creatures: ensure that ai is enabled when updating ai for corpses 2020-07-24 12:32:51 +02:00
Ovahlord 1ab7a9328f Core/Combat: reduce differences between 4.x and 335 2020-07-22 21:37:02 +02:00
Treeston f41cfa9185 Core/SmartAI: SmartAI creatures no longer process health-based hooks after death. 2020-07-22 19:21:21 +02:00
Ovahlord 2c88471fe3 Scripts/Misc: more followups 2020-07-22 19:20:54 +02:00
Treeston c7c4f267c4 Core/AI: Finally move the "is creature engaged" flag to be a property of the creature AI, where it honestly always belonged. Fixes #17981 and #23602 for real this time. 2020-07-22 19:14:52 +02:00
Ovahlord 47ef91c23d Core/Misc: more fixups 2020-07-22 18:10:50 +02:00
Treeston a16d691dd8 Core/Entities: Kick engagement logic upstairs to Unit (from ThreatManager), since all Units with AI need it (not just those with threat list). Fixes #17981.
# Conflicts:
#	src/server/game/Combat/ThreatManager.cpp
#	src/server/game/Entities/Creature/Creature.cpp
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Entities/Unit/Unit.h
2020-07-22 18:05:06 +02:00
Giacomo Pozzoni 509499efbe 3.3.5 threat assert (#23034)
* Core/Creature: Change assert about Threat to log
2020-07-22 18:00:15 +02:00
Treeston 8dedfaea4b Core/Creature: Get rid of a few Creature::getAttackerForHelper misuses. That's not what the function does, folks. 2020-07-22 17:55:23 +02:00
Treeston 7df7dcca7d Core/Threat: Threat system adjustments:
* Online states are now re-evaluated before victim update instead of continuously. Closes #22226. Tagging #21501.
* Victim update now happens every 1s as opposed to every server tick unless current target goes away.
* Suppressed threat is no longer re-established until the victim gains additional threat (by hitting the target, for instance).
* Assistance threat is now split between non-controlled units threatened by target, as opposed to all units threatened by target.

# Conflicts:
#	src/server/game/Combat/ThreatManager.cpp
2020-07-22 17:44:05 +02:00
Treeston 1020d1995f Core/Creature: Fall back to combat list if calling for help without threat list 2020-07-22 17:42:38 +02:00
Treeston 6f6b6534bf Core/Creature: Some adjustments to Creature::CallForHelp. Now works even if the Creature hasn't selected a victim yet. 2020-07-22 17:38:22 +02:00
Treeston d9e6e82c7d Core/Unit: UNIT_FLAG renames
[UNIT_FLAG_PLAYER_CONTROLLED -> UNIT_FLAG_POSSESSED]
[UNIT_FLAG_PVP_ATTACKABLE -> UNIT_FLAG_PLAYER_CONTROLLED]
Signed off by: Shauren, Warlockbugs.

# Conflicts:
#	src/server/game/Entities/Object/Object.cpp
#	src/server/game/Entities/Pet/Pet.cpp
#	src/server/game/Entities/Unit/UnitDefines.h
#	src/server/game/Spells/Auras/SpellAuraEffects.cpp
#	src/server/game/Spells/Spell.cpp
2020-07-22 17:32:51 +02:00
Treeston 528953ab8f Core/Creature: Adjust SelectVictim behavior: (PR #21324)
- No more automatic combat -> threat promotion. This matches anecdotal retail behavior - spells already in transit will not cause mob to chase you if its primary target vanishes before the spell hits.
- Prevent mobbing by stopping creatures from auto-acquiring a nearby target just because the primary target vanished.
2020-07-22 17:18:01 +02:00
Treeston 7c666188c1 typo 2020-07-22 17:16:50 +02:00
Treeston f9b4dd7420 Core/Creature: add an assertion to guard against infinite loops 2020-07-22 17:16:42 +02:00