Commit Graph

363 Commits

Author SHA1 Message Date
jackpoz
afbc478919 Core/Map: Load the grid of TempSummons owned by Players
Ensure to load the grid of TempSummons owned by Players when the relocate to another cell
2019-12-21 16:27:46 +01:00
jackpoz
42ab6010f8 Core/Map: Move a log from ERROR to WARN
Move "Could not load MMAP" log from ERROR to WARN as 99% of times is a false positive
2019-09-21 18:05:19 +02:00
ForesterDev
07e2264964 Core/PacketIO: updated SMSG_PLAY_SOUND, SMSG_PLAY_MUSIC and SMSG_PLAY_OBJECT_SOUND (#23636)
* Core/PacketIO: SMSG_PLAY_SOUND

(cherry picked from commit 82a33c7fa8)

# Conflicts:
#	src/server/game/Battlefield/Battlefield.cpp
#	src/server/game/Battlegrounds/Battleground.cpp
#	src/server/game/Battlegrounds/BattlegroundMgr.cpp
#	src/server/game/Battlegrounds/BattlegroundMgr.h
#	src/server/game/Entities/Object/Object.cpp
#	src/server/game/Server/Packets/MiscPackets.cpp
#	src/server/game/Server/Protocol/Opcodes.cpp
#	src/server/game/Texts/CreatureTextMgr.cpp
#	src/server/game/Texts/CreatureTextMgr.h
#	src/server/scripts/Commands/cs_misc.cpp

* Update for 3.3.5

* Core/PacketIO: updated and enabled SMSG_PLAY_MUSIC

(cherry picked from commit c6718dc120)

# Conflicts:
#	src/server/game/Maps/Map.cpp
#	src/server/game/Server/Packets/MiscPackets.cpp
#	src/server/game/Server/Protocol/Opcodes.cpp
#	src/server/game/Server/Protocol/Opcodes.h
#	src/server/game/Spells/SpellEffects.cpp

* Core/Packets: added SMSG_PLAY_OBJECT_SOUND packet class

(cherry picked from commit 1272e9eea6)

# Conflicts:
#	src/server/game/Server/Packets/MiscPackets.cpp
#	src/server/game/Server/Packets/MiscPackets.h
#	src/server/game/Server/Protocol/Opcodes.cpp

* fic build

* change variable names

* fix build error field will be initialized after
2019-08-23 19:28:21 +02:00
Shauren
7ee0891b0f Warning fix 2019-08-17 22:40:50 +02:00
Shauren
3a4216fd97 Core/Map: Kill zoneId from RespawnInfo, all it did was significantly slow down startup to make one gm command faster 2019-08-17 22:30:27 +02:00
Treeston
3d4bebd8d9 Scripts/FollowerAI: Some cleanup:
- FollowerAI properly resumes follow after evading.
- Removed duplicated getters from CreatureAI (IsEscorted vs IsEscortNPC), they were used to do the same thing
- FollowerAI properly assists in combat.
- FollowerAI properly despawns if quest is abandoned.
- FollowerAI now supports dynamic respawning for escort NPCs.
2019-08-01 18:32:26 +02:00
ForesterDev
b9756de7e5 Core/PacketIO: Updated SMSG_OVERRIDE_LIGHT (#23635)
* Core/PacketIO: Updated SMSG_OVERRIDE_LIGHT

(cherry picked from commit 4c94108ba9)

# Conflicts:
#	src/server/game/Maps/Map.cpp
#	src/server/game/Server/Packets/MiscPackets.cpp
#	src/server/game/Server/Packets/MiscPackets.h
#	src/server/game/Server/Protocol/Opcodes.cpp
2019-07-25 11:08:31 +02:00
Treeston
d60082ae86 Core/Misc: Various dynspawn cleanup and refactors split off from pooling rewrite:
- Map::RemoveRespawnTime(SpawnObjectType, LowType, doRespawn) split into Map::Respawn and Map::RemoveRespawnTime, without the extra boolean
- Map::RemoveRespawnTime(RespawnInfo*) merged into Map::DeleteRespawnInfo(RespawnInfo*) and is now private
- Map::DeleteRespawnInfo(void) renamed to Map::UnloadAllRespawnInfos to properly describe what it does
- Map::ProcessRespawns now actually saves the delayed respawn time to DB if the respawn was delayed
- Map::AddRespawnInfo now takes const reference, and returns success as a boolean
- Map::AddRespawnInfo no longer offers an unused "replace" parameter
- Map::DeleteRespawnInfo no longer offers a variety of unused private overloads
- Map::SaveRespawnTime no longer offers a tantalizing writeDB parameter. Parameter is now called "startup" to properly describe what it does.
- Map::SaveRespawnInfoDB now takes RespawnInfo reference instead of all the various fields. Still public because compatibility mode. QQ.
- Map::GetWorldObjectBySpawnId sanitized
- Map::GetXRespawnTime methods sanitized to all go through Map::GetRespawnTime
2019-07-15 17:14:58 +02:00
Treeston
26440857c1 Core/Spawns: Exterminate CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY with extreme prejudice. (It didn't work anyway.) 2019-07-15 15:57:04 +02:00
Treeston
374597c8e9 Core/DB: Unify creature_respawn and gameobject_respawn into a single respawn table 2019-07-14 18:49:38 +02:00
ccrs
965ec9a571 Core/Weather: 6eecb68 followup
missing IntervalTimer::Update call
2019-07-10 23:16:58 +02:00
Shauren
6eecb685ce Core/Weather: Fixed weather updates to be thread safe
(cherry picked from commit 6eb9973947)
2019-07-09 21:17:59 +02:00
Nayd
9a9af3cc5f Core/Packets: Update and enable SMSG_WEATHER
(cherry picked from commit 6f7d048765)
2019-07-09 21:17:59 +02:00
Treeston
84b7b2e08e Entities/Unit: Nuke Map::ForceRespawn from orbit, with the following implications:
- .npc respawn no longer causes stupid things to happen (Fixes #23014)
- ::DeleteFromDB methods on Creature and GameObject rewritten to be as sensible as such a colossally stupid method can ever be. They're static now.
- .npc delete and .gobj delete ported to new argument handling, and rewritten as per above. They can no longer crash the server when used in instances, too. Yay for that.
- Adjusted various dusty cobwebbed hacks around the core (why does waypoint visualization use permanent spawns *shudder*) to still work too.
2019-07-08 11:56:41 +02:00
Treeston
ded18a2690 Entities/Creature: Some asserts are now LOG_ERRORs that block spawning. Fix a group spawning bug exposed by the CoS merge. Improve some command output. 2019-07-07 19:18:32 +02:00
ccrs
953b05459a Core/Instance: add new hook & method 2019-06-29 19:24:05 +02:00
Jeremy
9fcbd8f15d Core/Movement: Fix some undermap issues with random movement/fear/blink (#22937)
* Core/Movement:
- Only move to point if there is a path that is not a shortcut (which will make the unit move through terrain)
- Added new function to check if there is a vmap floor without search distance
- Units that can fly, are underground but far above the vmap floor will stay underground (bronze drakes in tanaris)
- Don't remove PATHFIND_SHORTCUT from path type in some cases

* Core/Object: Ignore UpdateAllowedPositionZ for flying units.

- This will make flying units go through mountains instead of going to the top and back to the bottom to reach you.

* Core/Object: Revert some changes and let MovePositionToFirstCollision deal with a position without ground

* Missing groundZ change for objects on transport

* use CanFly instead of IsFlying
2019-04-07 20:15:40 +02:00
Aokromes
a2f910fe5c Core/mmaps: add category to 2 logs 2019-02-24 13:41:02 +01:00
Shauren
8d1bb258fc Tools:
* mapextractor - fixed compressing liquid data
* vmapextractor - fixed extracting liquids inside WMOs
* vmapextractor - implemented new WMO flags
* vmapextractor - store model type for gameobject models
* mmap_generator - fixed processing liquids broken in e5d23103f3

(cherry picked from commit 2c64bb97e6)
2019-02-23 22:00:05 +01:00
Treeston
fcfcb0eb6f Happy New Year, folks. It's 2019! 2019-01-01 15:45:25 +01:00
Giacomo Pozzoni
9a924fb9d5 Core/Misc: Log more information in asserts (#22783)
* Core/Misc: Log more information in asserts

Add a new function GetDebugInfos() to types that could trigger an ASSERT() to easily include more useful information in crashlogs.
This is an initial commit that requires many more commits to implement the new GetDebugInfos() function in all required types.
If the type doesn't have the function, the global default one is picked which doesn't log anything.

* Core/Misc: Fix dynamic build

Add missing attribute for dynamic build

* Core/Misc: Fix gcc/clang build

* Core/Misc: Rename GetDebugInfos() to GetDebugInfo()

* Core/Misc: Fix FormatAssertionMessage() adding an extra '\0'

* Core/Misc: Add GetDebugInfo support to Unit

* Core/Misc: Add GetDebugInfo support to Creature

* Core/Misc: Add more info to GetDebugInfo for Creature

* Core/Misc: Add GetDebugInfo support to GameObject

* Core/Misc: Add GetDebugInfo support to Player

* Core/Misc: Add more GetDebugInfo info

* Core/Misc: Add GetDebugInfo support to Item

* Core/Misc: Add GetDebugInfo support to Bag

* Core/Misc: Add GetDebugInfo support to Transport

* Core/Misc: Add GetDebugInfo support to TempSummon, Minion, Guardian, Pet

* Core/Misc: Add GetDebugInfo support to Map, InstanceMap

* Core/Misc: Add GetDebugInfo support to Spell

* Core/Misc: Fix build warning

* Core/Misc: Add GetDebugInfo support to Aura

* Core/Misc: Add GetDebugInfo support to UnitAI
2018-12-14 22:01:16 +01:00
Treeston
969436adfe Core/Maps: Fix a crash when spawning a spawn group 2018-08-29 18:07:31 +02:00
Treeston
b7c0f1961c visibility range check, fac4700 follow-up 2018-07-24 10:46:14 +02:00
Treeston
fac470014b Core/Maps: Continue updating creatures that own auras applied to players. Closes #22110. 2018-07-24 10:42:41 +02:00
ccrs
982643cd96 Core/Movement: MotionMaster reimplementation (#21888)
Internal structure and handling changes, nothing behavioural (or thats the intention at least).
2018-06-03 10:06:57 -07:00
Shauren
2e84035125 Core/Maps: Fixed uninitialized variable in Map::GetAreaId
Closes #21828
2018-04-19 18:06:41 +02:00
Shauren
4988d9d405 Warning fix 2018-04-07 21:57:47 +02:00
Shauren
b9c6bbb51d Core/Maps: Adjusted logic in GetFullTerrainStatusForPosition to closer match what the client does regarding being inside WMOs
Closes #21625
Closes #21624
Closes #21516
2018-04-07 21:36:15 +02:00
Shauren
2dadbda24a Revert "Core/Entities: Reduce the probability of units dropping under the map (#21322)"
This reverts commit 9e0faace9a.
2018-04-07 21:36:14 +02:00
ariel-
080d2c6cd4 Core/Spells: rework part 4: iterate over effects first
Ref #18395

Implement far spell queue processing
Closes #7395
2018-03-09 14:41:28 -03:00
Shauren
2baa81065b Core/Movement: Fixed creature hover
Closes #15177
2018-03-08 23:13:51 +01:00
Jeremy
367db4e1d6 Core/Maps: Fixed outdoors check (#21551) 2018-03-03 22:00:41 +01:00
Treeston
ec916db294 Core/VMap: Use fuzzy equality and gridmap tolerance for floor-finding. Closes #21338. Supersedes #21479. 2018-02-26 18:11:29 +01:00
Treeston
e79c595b69 Core/VMap: Add outdoor state to Map::GetFullTerrainStatusForPosition. Add WorldObject::IsOutdoors, basic member access.
Ref #21479.
2018-02-26 17:40:40 +01:00
Treeston
94b5d9bfa1 Core/Spawning: Actually check spawn group state before processing a respawn. It feels like that is something that should've been noticed at some point.
Also remove CreatureScript::CanSpawn since nobody uses it, and spawn groups do the same thing.
2018-02-22 20:31:42 +01:00
Jeremy
9e0faace9a Core/Entities: Reduce the probability of units dropping under the map (#21322)
Reduce the probabilty of going under the map
2018-02-16 20:59:19 +01:00
Treeston
51e28ae76a DB/SpawnGroup: Instance spawn group data for Tempest Keep: The Eye and Hellfire Citadel: Ramparts.
(also some minor adjustments to command output for convenience)
2018-01-25 13:45:11 +01:00
Treeston
3bb33e3108 Core/Map: New Map::ForceRespawn to override objections and force a respawn (equivalent to force = true). Use this to fix various GM commands.
Scripts/Valithria: Fix an issue that could get the encounter stuck in an unloaded state.
2018-01-07 19:53:39 +01:00
Treeston
e0b609a178 Core/Map: Fix a crash that could happen if a player moved very far away from a creature they were in combat with. Closes #21177. 2018-01-04 15:19:37 +01:00
Treeston
9f9507e6a1 Core/Misc: A variety of clean-up changes, mostly following up on 532ab1c to fix legacy bugs exposed by it:
- Triggers can no longer have a threat list (this may expose some ugliness in old legacy scripts)
- Threat entries are forced to OFFLINE if the AI refuses to attack the target
- Clean up passive creature evade behavior to be more consistent
- Fix a months old issue in spawn group management that would cause "Inactive" to incorrectly show in .list respawns for system groups outside of map 0
- Valithria script cleanups, remove old hacks and make it work with the new system. Closes #21174.
- Some strings cleanup
2018-01-04 04:46:41 +01:00
Treeston
532ab1c7f8 Core: Combat/threat system rewrite (PR #19930)
- PvE combat is now always mutual. UNIT_FLAG_IN_COMBAT is backed by actual references to the units we're in combat with.
- PvP combat is now also tracked, and almost always mutual; spells like Vanish and Feign Death can break this rule. That means we can easily determine a list of players we're fighting.
- By extension, IsInCombatWith now has sensible behavior when invoked on nonplayers.
- Threat and combat systems are no longer the same.
  - They still have an enforced relationship (threat implies combat - clearing combat clears threat)...
  - ...but we can have combat without threat. A creature (with threat list) isn't considered to be engaged until it has an entry on its threat list...
  - ...which means we can now faithfully replicate retail engage behavior. Combat on projectile launch - engagement start on projectile impact. Yay for progress!
- AI method refactor, as already ported in 6113b9d - `JustEngagedWith`, `JustEnteredCombat` and `JustExitedCombat`.
- Vehicle threat is now properly pooled on the main vehicle body (fixes #16542).
- Various edge case bug fixes for threat redirects (Misdirection "cancelling" Vigilance and similar).
- Target re-selection is now significantly faster.
- Fixed a ton of other smaller edge case bugs, probably.

Closes #7951 and #19998.
2018-01-03 20:04:19 +01:00
tkrokli
f6b6f57a6d Update copyright note for 2018
Best wishes for the new year.
2018-01-01 01:55:29 +01:00
Jeremy
e42903ec16 Core/Entities: Fix some weird movement due to los issues (#21125)
* Core/Entities: Fix some weird movement due to los issues
- Made LoS check use collisionHeight instead of midsection. Value was too low.
- Gnomes will now have a breath bar more quickly than for example a tauren.
- Changes have been made to checking for ground z as well, some tweeking might be needed but removed most of the scattered +2.0f/+0.5f/we
* Add 0.05f to isInAir check in Creature::UpdateMovementFlags
2017-12-29 22:32:07 +01:00
jackpoz
12701cb0c6 Core/Misc: Replace time(NULL) with GameTime::GetGameTime() 2017-12-24 22:50:59 +01:00
Gustavo
51c4196acf Core/Entities: add extra use of UPDATETYPE_CREATE_OBJECT2 (#20955) 2017-12-15 21:11:02 -03:00
ariel-
78a1c687a2 Core/Misc: minor typo and codestyle fixes
- Replace NULL uses in new code with nullptr
- Fix wrong (accumulated) load time log when loading calendar invites
- Make Creature::CanRegenerateHealth const as its just a getter
- Mark OnlyOnceAreaTriggerScript::OnTrigger as final in case someone wants to override that (you are supposed to use protected _OnTrigger hook)
2017-12-13 14:43:12 -03:00
jackpoz
925557d1c0 Core/Misc: Fix static analysis issues
Fix various coverity reported issues
2017-12-08 15:14:51 +01:00
Aokromes
5f2c5f2ed3 Misc: Kill trailing white spaces 2017-11-25 01:05:15 +01:00
r00ty-tc
3446424540 Core/Spawn: Limit saved/stored respawn time.
- Limit to time_t maximum, for the compiled-for architecture.

Closes #20834
2017-11-15 00:59:23 +01:00
r00ty-tc
55b9a3f65f Core/Spawns: Resolve crash in BattlegroundAV
- Correctly set spawngroup on spawned creatures in Alterac Valley BG
 - Sanity check on application of dynamic spawn rates (not for BG/Arena
   maps)
 - Check that spawndata exists before using it.

Closes #20535
2017-10-05 19:41:54 +02:00