Commit Graph

214 Commits

Author SHA1 Message Date
Giacomo Pozzoni
77eaa2c1ac Scripts/Blood Furnace: Fix infinite loop in Broggok encounter
Fix infinite loop in Broggok encounter caused by https://github.com/TrinityCore/TrinityCore/pull/23300

(cherry picked from commit 30a4aca266)
2021-12-17 21:52:33 +01:00
Ianislav Vasilev
fa9683fc68 Scripts/Blood Furnace: Broggok improvements (#23300)
* 23285 Fixed lever respawn and future encounters after it respawns.

* Removed unnecessary additional container.
Made lever not to despawn and respawn but rather change flags only.

* Made one conditional branch easier to debug.

(cherry picked from commit c71e36acae)
2021-12-15 00:17:32 +01:00
ccrs
4e6c59dca7 Core/Unit: rename several getters to follow codestyle
uint8 GetLevel()
        uint8 GetLevelForTarget(WorldObject const* /*target*/)
        void SetLevel(uint8 lvl)
        uint8 GetRace()
        uint32 GetRaceMask()
        uint8 GetClass()
        uint32 GetClassMask()
        uint8 GetGender()

(cherry picked from commit 5c09ff51f7)
2021-12-13 00:42:20 +01:00
Giacomo Pozzoni
5f545f5402 3.3.5 gameobject summoner (#23289)
* Scripts/Misc: Change IsSummonedBy(Unit*) to IsSummonedBy(WorldObject*)

* Scripts/Misc: Fix build

* Core/TempSummons: Rename GetSummoner() to GetSummonerUnit()

* Core/TempSummons: Add support to TempSummons::GetSummoner() to return GameObject too

* Fix build

* Core/TempSummons: Allow GameObject to be owner of TempSummon

* Core/TempSummons: Add support to SAI for GameObject owner of TempSummon

* Scripts/Misc: Fix no-pch build

* Core/TempSummons: Implement PR comments

(cherry picked from commit 797fba98e9)
2021-12-07 00:02:03 +01:00
Killyana
cb9a1c38f1 Instance/Script: Blood Furnace
Ref #23285

(cherry picked from commit 9435caa8d1)
2021-12-05 18:39:09 +01:00
jackpoz
43a41caafb Core/Misc: Fix GCC 8 warnings
(cherry picked from commit 1d04a3b216)
2021-11-24 23:40:15 +01:00
Shauren
f2456ff319 Scripts/Areatriggers: Fixed all areatrigger scripts triggering both on enter and exit instead of only on enter 2021-11-10 00:01:50 +01:00
DanVS
28cb2af1c5 Core/Scripts: Unify Chrono Literals (#22420)
* Unify Chrono Literals

* Retire IN_MILLISECONDS

* Build fix

* Build fix (sequel)

* Retire urand()

* Edge cases

* Build

* Whitespaces

* More edge cases

* Additional cases

(cherry picked from commit 5b0f4009df)
2021-11-09 00:26:59 +01:00
Keader
b91398fd28 Scripts/Magtheridon Lair: Fixed a case when channelers get hit kill and not start fight
It's needed for cataclysm+

(cherry picked from commit 65bad41144)
2021-09-26 23:04:18 +02:00
Keader
c1641642cb Scripts/Magtheridon: Fixed Magtheridon inaccessible
Closes #21693

(cherry picked from commit 99993a7f62)
2021-09-22 23:29:33 +02:00
Shauren
8a4e1119ac Core/Spells: Unify spell effect access api in both branches 2021-09-04 15:13:15 +02:00
Keader
cb8ea03175 Core/Scripts: Fixed some delayed enrage
Closes #15367

(cherry picked from commit 63c436f5fb)
2021-06-21 00:06:41 +02:00
Keader
9b7f3bff9f Core/Scripts: Fixed tabs issues introduced in 5bef3e426a
(cherry picked from commit 31ad6358fb)
2021-06-19 23:33:24 +02:00
Keader
ad5b0fa9cd Core/Scripts: Fixed possible crashs related with JustDied
(cherry picked from commit 5bef3e426a)
2021-06-19 23:33:24 +02:00
ariel-
c77925da4a Core/Entities: killed Creature::SetInCombatWithZone and replaced with AI version
Closes #12108 (again)

(cherry picked from commit 7c9722a4ae)
2021-06-16 21:03:06 +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
Treeston
bce43de7f3 Core/AI: Some more refactoring prep for #19930. CreatureAI::EnterCombat is now called CreatureAI::JustEngagedWith. There's also two new methods on UnitAI, though they're never invoked right now.
(cherry picked from commit 6113b9dec2)
2021-04-16 20:22:13 +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
jackpoz
8244d60859 Core/Misc: Fix static analysis issues
(cherry picked from commit ad56299846)
2021-04-15 05:53:27 +02:00
ariel-
5f9e0d92d5 Core/Auras: periodics refactor part 1:
- Don't skip ticks if diff is greater than amplitude
- Fixed spells without ampltude in DBC

(cherry picked from commit 5d91beb1db)
2021-03-15 20:17:31 +01:00
Shauren
efdca47aff Core/Auras: Remove m_effIndex member of AuraEffect and always take it from SpellEffectInfo 2021-03-11 10:32:03 +01:00
Shauren
b231903932 Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup port 2020-09-04 13:38:24 +02:00
treeston
2dfafa69eb Hi, I'm Treeston, and welcome to Combat PR Prep Refactors.
Today, we're moving UNIT_FLAG_IMMUNE_TO_PC and UNIT_FLAG_IMMUNE_TO_NPC to higher-level abstraction so combat manager can react to it.
New methods on Unit:
- void SetImmuneTo<All/PC/NPC>(apply, keepCombat = false);
- bool IsImmuneTo<All/PC/NPC>() const;

(cherry picked from commit 74af880217)
2020-08-18 18:53:13 +02:00
Shauren
1c52d5fff7 Core/Misc: Replace NULL with nullptr 2020-08-14 17:06:03 +02:00
Treeston
8be23fcbbd [3.3.5] Combat/Threat rewrite - prep & refactor (#19966)
* Combat/Threat rewrite (PR #19930) prep work. Mostly refactors, and a compatibility layer on ThreatManager/HostileReference that allows scripts to be changed already.

(cherry picked from commit e2a1ccd118)
2020-08-13 22:46:44 +02:00
ariel-
8abbc097a0 Core/Scripts: fix some /W4 warnings
(cherry picked from commit d6cae113c6)
2020-07-16 22:00:29 +02:00
ariel-
5903a10a83 Core/AI: segregate GameObject ReportUse from normal Use (lock open/normal click)
Closes #19819

(cherry picked from commit 2335b9de1a)
2020-07-16 21:47:28 +02:00
ForesterDev
c34b83a467 Core/Defines: define faction templates and replace magic numbers from scripts
(cherry picked from commit abea8bf4cb)
2020-06-14 23:49:03 +02:00
Shauren
4d69cc1c56 Core/Misc: GCC build and warning fixes 2020-05-21 22:15:58 +02:00
ariel-
6604849716 Core/Scripts: unified scripted gossip/quest api
- Changed self-accessor on GameObjectAI to "me", like UnitAI
- Moved all related functions to AI, now Unit and GameObject have the same function names with identical behaviour
- Remove "OnUpdate" from CreatureScript/GameObjectScript, was never used and we already have AI Update method
- Quest methods no longer return a bool, the return value was used to call the AI version if the ScriptMgr one returned false
- Implemented GameObjectAI::Destroyed hook (was never called), implemented Damaged method
- Rename OnStateChanged to OnLootStateChanged to reflect when it's really called, and created a new hook OnStateChanged that only gets called on GOState change
- Since the functions are now only getting called from AI, made GetAI methods full virtual. (CanSpawn method is anyways going to be used on creatures with AI)

(cherry picked from commit f913f3bb89)
2020-05-03 03:04:32 +02:00
ariel-
93c19c4194 Core/Misc: camelize GetFaction/SetFaction properly
(cherry picked from commit 4c4dca6d69)
2020-04-29 01:36:41 +02:00
tkrokli
b259614778 Scripts: minimize duplicated enum names in header files (#19377)
* Scripts: Minimize duplicated enum names in header files

This reduces the number of cache resets with the Zapcc compiler

- Standard followed is instance/raid TLA + DataTypes/CreaturesIds/etc
- Partial cherry-pick of master commit 7eb4512eee
- Removed unused defines in sunken_temple.h (the core scripts using these have been moved to SAI)

(cherry picked from commit f6f36be004)
2020-04-24 17:18:51 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
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
Shauren
455959c606 Core/PacketIO: Rewrite updatefield handling 2019-06-08 17:06:57 +02:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
Shauren
9ffabae6bf Scripts/Misc: Use InstanceMap* in InstanceScript instead of Map* 2018-06-16 17:24:10 +02:00
Keader
8b601fadfe Core/Scripts: Black Temple - added comments in all SpellScripts (#18494)
(cherry picked from commit c809c220e2)
2018-03-12 16:39:45 +01:00
Keader
4c8f4cb372 Core/Scripts: Rewrite Magtheridons Lair (#18330) 2018-03-12 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
Aokromes
90badf9d7e Misc: More cleanup 2017-11-25 02:50:29 +01:00
ariel-
d5c7675bcc Core/Auras: reset periodic aura timers by default. Except when aura comes from triggered spell
Closes #17961

(cherry picked from commit b5e8e0a5db)

# Conflicts:
#	src/server/game/Entities/Unit/Unit.cpp
#	src/server/game/Entities/Unit/Unit.h
#	src/server/game/Spells/Auras/SpellAuraEffects.cpp
#	src/server/game/Spells/Auras/SpellAuraEffects.h
#	src/server/game/Spells/Auras/SpellAuras.cpp
#	src/server/game/Spells/Auras/SpellAuras.h
#	src/server/game/Spells/Spell.cpp
#	src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
#	src/server/scripts/Spells/spell_priest.cpp
2017-08-13 15:14:21 +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
a0a158b5b8 Core/Scripts: Include cleanup 2017-05-28 16:34:44 +02:00
vincent-michael
86b98686a9 Update copyright note for 2017
Happy new year
2017-01-01 16:23:13 +01:00
Duarte Duarte
7eb4512eee Scripts: Minimize duplicated enum names in header files (#18346)
This reduces the number of cache resets with the Zapcc compiler

Standard followed is instance/raid TLA + DataTypes/CreaturesIds/etc
2016-12-01 01:51:07 +00:00
Shauren
461ec27d11 Fixed nopch build, for real this time 2016-07-20 14:00:10 +02:00
Shauren
2056ce4d66 Scripts: Build fix 2016-07-17 15:20:56 +02:00
Shauren
3ac33163db Core/Misc: Fixed -Wmisleading-indentation warnings 2016-04-23 13:22:03 +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