Commit Graph

1218 Commits

Author SHA1 Message Date
Treeston
1493920495 Core/Movement: Replace old TargetedMovementGenerator into ChaseMovementGenerator and FollowMovementGenerator, full rewrite for both.
- Chase to angle is now functional. Pets use this to chase behind the target. Closes #19925.
- Chase to arbitrary range interval works. Not used anywhere, but you can technically make hunter-like mobs.
- Pets now follow the hunter cleanly and without stutter stepping. Also fix some other things. Closes #8924.

(cherry picked from commit 2a84562dc8)
2021-09-24 23:37:43 +02:00
ariel-
765987a9f5 Core/Misc: whitespace/tab cleanup
(cherry picked from commit bcc7427fbc)
2021-09-23 22:50:09 +02:00
Treeston
bc89e1cdb0 Core/Position: Refactor GetAngle -> GetAbsoluteAngle because code clarity is good.
(cherry picked from commit 4692e10ca2)
2021-09-23 22:21:29 +02:00
Mikhail Redko
f8dda8a4fc Core/Creatures: implement CREATURE_FLAG_EXTRA_NO_SELL_VENDOR (#21642)
* Add CREATURE_FLAG_EXTRA_NO_SELL_VENDOR and use it for a single no-sell vendor in game (there are more of them in later expansions)

(cherry picked from commit 7c5b69d18b)
2021-09-19 22:54:08 +02:00
Meji
0a83f74876 Core/Achievements: Update CriteriaType enum (#26856) 2021-09-08 22:07:01 +02:00
Shauren
8a4e1119ac Core/Spells: Unify spell effect access api in both branches 2021-09-04 15:13:15 +02:00
ariel-
f3548d45d0 Core/Spells: rework part 3: spells only handle at most one UnitAura and one DynObjAura during its lifetime
Closes #15088

(cherry picked from commit e8d5aa56cc)
2021-08-28 15:59:11 +02:00
Shauren
f8c03a9066 Core/Creatures: Reworked setting move types in database
* Each move type has its own field instead of trying to combine everything in InhabitType
* Allow overriding movement separately for each spawn

(cherry picked from commit 592516ae69)
2021-08-24 13:43:06 +02:00
ariel-
9f0204b357 Scripts/Command: build fix for horrible outdated boost version used by travis
(cherry picked from commit 68dde9f8c5)
2021-08-23 19:18:49 +02:00
Treeston
e47e95b6dc Core/VMap: Add outdoor state to Map::GetFullTerrainStatusForPosition. Add WorldObject::IsOutdoors, basic member access.
Ref #21479.

(cherry picked from commit e79c595b69)
2021-08-08 21:21:34 +02:00
ariel-
67a1a1d29b Core/GameObject: implemented gameobject_overrides table to change faction and flags values on a per-spawn basis
Updates #20957
Closes #20958

(cherry picked from commit 34967e9c32)
2021-08-08 21:21:34 +02:00
Gooyeth
493be0c888 Scripts/Commands: add AI/ScriptName to .gobject info (PR #21419)
(cherry picked from commit 42a11e97d5)
2021-06-21 00:10:39 +02:00
Treeston
809c38994a Core/Threat: Custom ThreatListIterator that transparently iterates over the backing map (instead of using heap iterators) when working with the unsorted threat list. This greatly reduces the range of actions that can cause iterator invalidation.
Also some minor adjustments to .debug threat, which no longer hides certain invalid states from view.

(cherry picked from commit 4cb13af4fa)
2021-06-19 23:33:24 +02:00
Treeston
7db3f7ca96 DB/SpawnGroup: Instance spawn group data for Tempest Keep: The Eye and Hellfire Citadel: Ramparts.
(also some minor adjustments to command output for convenience)

(cherry picked from commit 51e28ae76a)
2021-06-16 23:01:48 +02:00
Treeston
7c0ac5b959 Misc: assert -> ASSERT
(cherry picked from commit 6c3c200cc5)
2021-06-16 22:51:16 +02:00
Treeston
386ec58233 Scripts/Commands: new command '.debug instancespawn'
(cherry picked from commit 6ce078d8e8)
2021-06-16 22:50:04 +02:00
ariel-
d0f4310c44 Core/Entities: don't allow client control if player is still affected by any lose of control state
(cherry picked from commit e315e41d36)
2021-06-16 21:26:57 +02:00
ariel-
861cf261c5 Core/Formations: update codestyle and fix crash
Closes #21288

(cherry picked from commit 73cc613dc8)
2021-06-16 19:26:32 +02:00
ariel-
3bc3b3eeeb Core/Globals: revert back to unordered_map for templates
Partial revert of commit b64c504314
See discussion on b64c504314

(cherry picked from commit b75ff7d4bf)
2021-06-16 01:29:25 +02:00
ariel-
21556667c1 Core/Globals: throw some RAII into ObjectMgr, and load templates into vectors
Ref #14274

(cherry picked from commit b64c504314)
2021-06-16 01:00:11 +02:00
ariel-
fccf1a8c62 Core/Auras: removed caster dependency from core
- Decoupled Unit logic: split of spell critical chance into done (caster bonuses) and taken (target bonuses), this allows to precalculate caster bonuses on aura apply and then check victim's auras on damage/healing calc
- Made static a bunch of methods (they no longer have this pointer because they are now called from periodic handlers which may or may not have an active caster in world)
- Simplified all AuraEffect bonuses into AuraEffect::_amount, no more duplicated code
- Critical chance and whether or not caster is player owned unit (for resilience calcs) is now saved one level upper, on Aura itself (it's impossible as of 3.3.5 to have different effects with different critical chances)
- Minor cleanup of SPELL_DAMAGE_CLASS_NONE and Arcane Potency (#18813) crit handling

Closes #19876

(cherry picked from commit cb9e72e521)
2021-06-13 00:59:13 +02:00
Shauren
f6b919fafe Core/Reputation: Named all reputation flags 2021-06-05 23:00:06 +02:00
Shauren
80a6347b7a Core/Reputation: Implemented "friendship reputation" 2021-06-04 19:27:26 +02:00
Shauren
6ecfe58cae Core/Maps & Extractors: Move copypasted map file headers into a single shared file and replace #defines with enums 2021-05-29 21:21:37 +02:00
Treeston
e090c9a00e Scripts/Commands: New command: .debug threatinfo
(cherry picked from commit f45c211987)
2021-05-16 21:57:35 +02:00
Treeston
8b7728f82e 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.

(cherry picked from commit 3bb33e3108)
2021-05-16 21:56:06 +02:00
Shauren
b9d63c2009 Core/Scripts: Remove deprecated overload of QuestReward without LootItemType argument 2021-05-16 21:56:06 +02:00
Treeston
dce39aedc2 Core/Combat: Some more sanity check asserts to try and track down #21187.
Also, some anti-annoyance treatment for dot tele.

(cherry picked from commit fdacf12739)
2021-05-16 21:56:05 +02:00
Treeston
5aee452943 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

(cherry picked from commit 9f9507e6a1)
2021-05-16 21:56:05 +02:00
Treeston
34c7810fe5 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.

(cherry picked from commit 532ab1c7f8)
2021-05-16 21:56:01 +02:00
Shauren
2906926173 Core/Scenes: Fix scenes played by package id storing pointers to stack variables 2021-05-12 14:23:21 +02:00
Shauren
f072bc4ca1 Core/Commands: Add ItemContext argument to .additem and .additemset commands 2021-05-11 18:25:22 +02:00
Shauren
14098b28b3 Core/Chat: Allow incorrect spell/skill language assignments to mirror client behavior 2021-05-03 23:53:24 +02:00
Matan Shukry
3b578fc6b9 Core/Chat: Load chat language data from db2 and implement serverside chat translations 2021-05-03 23:53:24 +02:00
jackpoz
4f643e3f32 Core/Misc: Removed unneeded checks
(cherry picked from commit 513e153a13)
2021-04-16 20:53:41 +02:00
Treeston
9b141207d1 [3.3.5] CastSpell unclusterfucking (that's a word now) (#21123)
Core/Spell: The giant CastSpell unclusterfucking (that's a word now) of this generation.

- CastSpell now always takes three arguments - target, spellId, and a struct containing extra arguments
- This struct (CastSpellExtraArgs, see SpellDefines.h) serves as a conglomerate of every previous combination of the 20 billion different CastSpell overloads, all merged into one
  - It has some great utility constructors - check them out! All of these can be used to implicitly construct the ExtraArgs object.
- A gajillion refactors to make everything behave the way it always has

(cherry picked from commit d507a7e338)
2021-04-16 15:22:42 +02:00
Jeremy
446fc391f0 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

(cherry picked from commit e42903ec16)
2021-04-15 05:53:27 +02:00
ariel-
61585de8ae Core/Scripts: fix codestyle
(cherry picked from commit e2a97ba7e7)
2021-04-15 05:53:27 +02:00
jackpoz
e17e4e6f07 Core/Misc: Replace time(NULL) with GameTime::GetGameTime()
(cherry picked from commit 12701cb0c6)

 Conflicts:
	src/server/game/Achievements/AchievementMgr.cpp
	src/server/game/AuctionHouse/AuctionHouseMgr.cpp
	src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp
	src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp
	src/server/game/Battlefield/Battlefield.cpp
	src/server/game/Battlefield/Zones/BattlefieldWG.cpp
	src/server/game/Battlegrounds/BattlegroundMgr.cpp
	src/server/game/Calendar/CalendarMgr.h
	src/server/game/DungeonFinding/LFGQueue.cpp
	src/server/game/Entities/Corpse/Corpse.cpp
	src/server/game/Entities/Creature/Creature.cpp
	src/server/game/Entities/Item/Item.cpp
	src/server/game/Entities/Pet/Pet.cpp
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Entities/Unit/Unit.cpp
	src/server/game/Globals/ObjectMgr.cpp
	src/server/game/Grids/ObjectGridLoader.cpp
	src/server/game/Guilds/Guild.cpp
	src/server/game/Handlers/AuctionHouseHandler.cpp
	src/server/game/Handlers/BattlefieldHandler.cpp
	src/server/game/Handlers/CalendarHandler.cpp
	src/server/game/Handlers/CharacterHandler.cpp
	src/server/game/Handlers/ChatHandler.cpp
	src/server/game/Handlers/LFGHandler.cpp
	src/server/game/Handlers/MailHandler.cpp
	src/server/game/Handlers/MiscHandler.cpp
	src/server/game/Handlers/MovementHandler.cpp
	src/server/game/Handlers/PetHandler.cpp
	src/server/game/Handlers/QueryHandler.cpp
	src/server/game/Handlers/TicketHandler.cpp
	src/server/game/Instances/InstanceSaveMgr.cpp
	src/server/game/Server/WorldSession.cpp
	src/server/game/Server/WorldSocket.cpp
	src/server/game/Spells/Auras/SpellAuras.cpp
	src/server/game/Tickets/TicketMgr.cpp
	src/server/game/Tickets/TicketMgr.h
	src/server/game/World/World.cpp
	src/server/scripts/Commands/cs_gobject.cpp
	src/server/scripts/Commands/cs_instance.cpp
	src/server/scripts/Commands/cs_list.cpp
	src/server/scripts/Northrend/zone_wintergrasp.cpp
	src/server/scripts/Spells/spell_item.cpp
2021-04-15 05:53:27 +02:00
Andrew Letson
dbd9f88bf0 Scripts/Commands: Add failure state for quest remove (#20611)
Add more verbose messaging to the .quest remove command

(cherry picked from commit 1cedcf0bf3)
2021-04-15 05:53:27 +02:00
Matan Shukry
079bc7800e Core/Cheats: Power - set max power on all powers initially + on regenerate (#26235) 2021-04-13 19:05:36 +02:00
Shauren
d29dd1eeb5 Core/Misc: Change all unix time columns in character database to bigint (signed) 2021-04-05 23:47:05 +02:00
ForesterDev
7bd3914663 Scripts/Commands: modify command .dismount to target any selected player (#19788)
- change security lvl for command .dismount to 2 (gamemasters). For players there is /dismount command

Closes #19788

(cherry picked from commit 661dfee80e)
2021-03-15 20:17:31 +01:00
ariel-
88ae43fa51 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)

(cherry picked from commit 78a1c687a2)
2021-03-15 20:17:31 +01:00
Shauren
6879440acb Core/Commands: Fixed .bnetaccount gameaccountcreate command generating too long passwords 2021-03-03 17:43:04 +01:00
Ovah
2a51edc5bc Core/Creatures: Implemented extra flag to use offhand attacks (#21008)
* Fixed initial offhand attack timer so the main and offhand attacks will now act blizzlike instead of getting executed at the same time

Note: since some creature equipment items cannot be identified as weapon since they are only visual items there is no way to detect this automaticly
(cherry picked from commit 869affa893)
2021-02-25 18:50:55 +01:00
jackpoz
1c24819741 Core/Misc: Fix static analysis issues
(cherry picked from commit 97f33dc779)
2021-02-06 21:41:51 +01:00
ccrs
bf12bae467 Core/Misc: waypoint movement
- Creature: update current waypoint to store nodeId and pathId
- MotionMaster: change variable type on GetMotionSlotType and GetMotionSlot to keep consistency and prevent errors (ASSERT is now no longer needed)
- UnitAI: add new waypoint hooks WaypointPathStarted and WaypointPathEnded
- SAI: handle WAYPOINT related events if creature is no escorting
* SMART_EVENT_WAYPOINT_RESUMED still not implemented for no escorting

TODO: the new hooks can save, now duplicated, logic on EscortAI and SAI

closes #20777
updates #20310
updates 21bd52cb99

(cherry picked from commit e10d7dd45c)
2021-01-29 19:23:53 +01:00
Robingad
5274f5ea54 Core/Commands: Fixed .go zonexy command (#25825) 2021-01-25 18:29:59 +01:00
Matan Shukry
1d51013b71 Scripts/Commands: Fixed .modify gender not setting correct customizations (#25920) 2021-01-23 15:35:22 +01:00