Commit Graph

460 Commits

Author SHA1 Message Date
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
SnapperRy 3897de67a4 Core/Creature: update health/mana/damage/armor when changing a creature's entry while keeping the original level.
Fixes an issue introduced in a6ef9d4.

(cherry picked from commit 3d075da504)
2017-03-03 22:01:47 +01:00
treeston 205ec4c3bf Core/Unit: Standardize SetFacingTo and SetFacingToObject behavior while moving. Both now fail while moving unless arg2 bool is true.
Movement/SplineChain: Bump value range for DB chainId up to uint16 (0 to 65535) from uint8 (0 to 255). Turns out sniffs generate far more chains than I expected.

(cherry picked from commit 2170541a51)

Code style follow-up, I blame Notepad++.
(cherry picked from commit 7860da0de6)
2017-03-02 20:47:29 +01:00
treeston e941d7e04b Creature/Scripting: Move CreatureAI::CanRespawn to CreatureScript::CanSpawn. Now also applies to initial spawn. Dynamic spawning prep.
(cherry picked from commit b3d44d6c36)

Game/Scripting: Follow-up to b3d44d6. Fix script selection for creatures on difficulty > 0.
(cherry picked from commit 91c2b3162d)

Build fix.
(cherry picked from commit a9f1151f2c)

Fine, this time I actually built it. Promise.
(cherry picked from commit 0c2c88ed50)
2017-02-26 15:30:15 +01:00
Shauren 5dbe9e7890 Core/Creatures: Implemented all creature equipment modifiers
* It is now possible to give creatures a mythic/heroic weapon

Closes #19160
2017-02-19 10:58:08 +01:00
treeston bbbf8df8e5 Entities/Gossip: The Big One™ that gets rid of all uses of The Bad™ and The Ugly™, e.g. gossip preprocessor macros, and replaces them with the new-and-shiny gossip functions.
(cherry picked from commit d55426f5b4)
2017-02-18 17:50:00 +01:00
treeston 5c01d14056 Entities/Creature: Add arg2 to DespawnOrUnsummon to allow overriding respawn time. This matches changes that will be merged as part of dynamic spawning, allowing scripts to transition early.
(cherry picked from commit 4bcc8078d7)
2017-02-18 17:16:10 +01:00
SnapperRy 6ea973adec Core/SmartAI: add param2 to SMART_ACTION_UPDATE_TEMPLATE, allowing to specify if creature's level should remain the same between entry updates.
A value of 0 (default) forces the creature to keep its current level between entry updates.

Fixes #16371

(cherry picked from commit a6ef9d4539)
2017-02-18 14:47:01 +01:00
Treeston 8b7934f718 Core/Spells: Fix orientation- and targeting-related issues if the creature isn't currently engaged in combat. (#17120)
Also disable spell focus system for vehicle control auras.

Closes #16572
Closes #17016
(cherry picked from commit 6f85422f0b)
2017-02-12 17:04:08 +01:00
Treeston 346e4824be Entities/Unit: Cleanup refactor. Changes: (#17819)
+ Unit::m_movedPlayer -> Unit::m_playerMovingMe
+ Player::m_mover -> Player::m_unitMovedByMe
+ Unit::GetMover() -> Unit::GetUnitBeingMoved()
+ Unit::GetPlayerMover() -> Unit::GetPlayerBeingMoved()
+ NEW: Unit::GetClientControllingPlayer()
(cherry picked from commit 8deda7ed7f)

# Conflicts:
#	src/server/game/Entities/Player/Player.cpp
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Handlers/MiscHandler.cpp
#	src/server/game/Handlers/MovementHandler.cpp
#	src/server/game/Handlers/SpellHandler.cpp
#	src/server/game/Server/WorldSession.cpp
#	src/server/game/Spells/SpellEffects.cpp
#	src/server/game/Spells/SpellInfo.cpp
2017-02-12 16:24:25 +01:00
Treeston 62e7d7042c Core/Creature: Fix health regeneration. Creatures immediately reset to full health upon reaching home, rather than slowly regaining it over multiple seconds, which allows players to re-engage them at less than max health. (#17756)
(cherry picked from commit fdd78d2077)

Entities/Creature: Fix spawn health, fdd78d2 follow-up. Fixes and closes #17757.
(cherry picked from commit 5b6eb29b74)

Entity/Creature: Fix spawn health, for real this time. Closes #17757. Also for real this time.
(cherry picked from commit ac35f93c2d)
2017-02-11 22:58:58 +01:00
SnapperRy c9cb63653a Core/Creature: implement INHABIT_ROOT to apply UNIT_STATE_ROOT to creature (#17543)
Add flag 8 to InhabitType for creatures that should appear rooted client-side
(cherry picked from commit f78ab9aba4)
2017-02-05 17:32:10 +01:00
jackpoz 2355facafe Core/Creature: Fix assertion triggered
Fix assertion triggered when a Creature was summoned at an invalid position with Auras loaded as Creature addons.
Fix #17415

(cherry picked from commit 75319e4a68)
2017-02-01 22:53:21 +01:00
DDuarte 0c511397a4 Revert "Merge pull request #16433 from Tonghost/3.3.5"
This reverts commit e3d52990dd, reversing
changes made to 6d8e39f59c.

Opens #16759

(cherry picked from commit 5aae01986f)
2017-01-09 21:50:49 +01:00
ForesterDev 5c2705fadc Core: updated creature type flags enum (#17128)
Core/Misc: Update CreatureTypeFlags enum according to TrinityCoreWiki
(cherry picked from commit fb0881398a)

# Conflicts:
#	src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp
#	src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp
#	src/server/game/AI/SmartScripts/SmartAI.cpp
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Miscellaneous/SharedDefines.h
2017-01-09 02:00:17 +01:00
treeston 489027703e Entities/Unit: Finally fix no-path evasion.
- When a creature cannot find a path to its victim, it begins evading all attacks and regenerating health.
- If this persists for 5 seconds, it evades back to spawn position with new EvadeReason value EVADE_REASON_NO_PATH.
- Also some SmartAI cleanup (why oh why does it have so much duplicated code) and getting rid of #defines in favor of type-checked compile-time constants.

(cherry picked from commit 7b1560fccb)
2017-01-07 21:33:28 +01:00
vincent-michael 86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Shauren ac1dc758b9 Core/Units: Cleanup hardcoded magic numbers for byte field offsets 2016-12-13 20:58:22 +01:00
Shauren 5411ca8cdf Core/Units: Removed attack speed float to int conversion special case in building SMSG_UPDATE_OBJECT 2016-11-25 17:58:48 +01:00
Shauren bbc983fc3d Core/Creatures: Fixed visuals for spells cast by creatures that have missile/travel time
Closes #17950
2016-09-16 17:22:58 +02:00
Malcrom f10a4c1364 Core/Creatures: Implemented loading animkits from creature_addon (#17834) 2016-08-20 23:53:07 +02:00
Shauren e405ac5f41 Fixed nopch build and some leftover warnings 2016-07-20 13:27:04 +02:00
Shauren 70137b8f3a Merge branch '6.x' of https://github.com/TrinityCore/TrinityCore into legion 2016-07-06 00:05:13 +02:00
Shauren 73aababbd4 Core/Spells: Fixed handling spell interrupts - PreventionType dbc field is a bitmask 2016-06-23 22:19:52 +02:00
Shauren c95f4a5070 Core/GameObjects: Updated GameObjectTemplate to 7.0.3.21796 2016-05-30 23:49:35 +02:00
Shauren df6d557a4d Core/Entities: Updated updatefields to 7.0.3.21414 2016-05-20 23:50:20 +02:00
Chaouki Dhib 3cbbcdb51a Core/Movement: Clean up and improvements on Unit::SetSpeed (#16843)
- Clean up of Unit::SetSpeed (mostly cherry picks from the 6.x branch):
- the opcode sent depends on the unit. until now, MSG_MOVE_SET_* were sent for every units which isn't like retail behavior.
- Removed the unused method parameter "forced" from Unit::SetSpeed
- Renamed Unit::SetSpeed to SetSpeedRate
- Removed the unused method parameter "forced" from Unit::UpdateSpeed
- Added utility method Unit::SetSpeed which take the new flat value.
(cherry picked from commit dc3327f9c5)

# Conflicts:
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Handlers/MovementHandler.cpp
#	src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp
#	src/server/scripts/EasternKingdoms/ZulAman/boss_nalorakk.cpp
#	src/server/scripts/EasternKingdoms/ZulAman/boss_zuljin.cpp
#	src/server/scripts/Kalimdor/zone_azshara.cpp
#	src/server/scripts/Kalimdor/zone_durotar.cpp
#	src/server/scripts/Outland/zone_hellfire_peninsula.cpp
2016-04-16 02:26:24 +01:00
Naios 9cc97f226d Core/Game: Rewrote the ScriptMgr to support script reloading.
* Finally this commit enables dynamic script hotswapping
  and finished the PR #15671.
* Split the storage layout to use optimized storages
  for database bound and unbound scripts.
* Add several unload workers to reload scripts correctly
  -> Requires further investigation.
* Fixes memory leaks in ScriptMgr when dropping invalid scripts.
* Fixes VehicleScripts
* Makes OutdoorPvP scripts reloadable
* Makes InstanceMapScripts reloadable
* Makes CommandScripts reloadable
2016-04-11 21:14:00 +02:00
treeston 181da2a65c - Clean up spell facing behavior a bit. Visual target behavior should now be a lot smoother.
- Clean up Creature.cpp. NULL -> nullptr, gotta love it.
- Renamed some recently added members of Creature to match code style.

(cherry picked from commit 1cf1d4a1ea)
2016-04-09 17:47:45 +02:00
treeston d5ec4ce97b Entities/Creature: Fix bugs with pets not properly reacquiring target after spell cast. Closes #16824.
(cherry picked from commit accad00567)
2016-04-09 17:28:11 +02:00
Vincent-Michael 179b521dce Core: Remove whitespaces
(cherry picked from commit 5e74c2223b)
2016-04-09 17:14:08 +02:00
jackpoz 307a93839b Core/Creatures: Fix dead creatures spawn position on restart
Fix dead flying creatures ignoring being spawned below the floor in instances on server restart because of not taking into account vmap height.
Fix #16777

(cherry picked from commit 912514c198)
2016-04-09 17:10:24 +02:00
treeston 3b67e57e0e Core/Creature: Prevent friendly vehicles from trying to attack their rider after dismounting.
(cherry picked from commit 89e2afb8f9)
2016-04-08 22:48:06 +02:00
Treeston 7135a23d33 Merge pull request #16467 from Treeston/3.3.5-FixEvadeMode
[3.3.5] Creature/AI: Fix incorrect evade logic
(cherry picked from commit 8eabbb0427)
2016-04-05 18:02:46 +02:00
Incorrect f8d5031fca Core/Creature: Do not load equipment with id = 1 when creature.equipment_id is 0
Closes #16416

(cherry picked from commit cc3ae640a4)
2016-04-02 19:32:03 +02:00
Rushor 92a80979dd Game/Creature: Implement CREATURE_FLAG_EXTRA_IMMUNITY_KNOCKBACK
* updates #16423

(cherry picked from commit 110e0fd092)
2016-04-02 19:24:13 +02:00
Shauren e6e3e799d0 Build fixes 2016-04-02 19:22:30 +02:00
pete318 2fe84d7471 Prevent duplicate spawns for same spawn ID
If there is an alive instance of the creature upon creature spawn, skip
spawn entirely. If there are only dead instances, despawn them. A new dead
corpse in the creatures home position will be respawned.

Closes: #16462
(cherry picked from commit fe2a0fda44)
2016-04-02 17:51:03 +02:00
Trisjdc a51ec98044 Core/Creatures: Reset unit flags/dynamic flags on Creature::SetDeathState(JUST_RESPAWNED)
(cherry picked from commit 132be2d25a)
2016-04-02 17:49:20 +02:00
r00ty-tc 6cd7b58065 Adjustments to spell facing - Adjusted HaveAtClient to accept Object* (still accepts all subordinates) - Use grid searcher to find players in visibility range for unit - Use client cache instead of "See or Detect" to decide who to send updates to - Adjusted SendUpdateToPlayer to send createobject packet only if not known to client
(cherry picked from commit c0693a6ee52d31840ab2ee878c4881884b857638)
2016-04-01 12:43:10 +01:00