Commit Graph

928 Commits

Author SHA1 Message Date
ariel-
d73e4015d1 Core/Spells: fixed crash
Closes #19924

(cherry picked from commit 9f765a1620)
2020-07-16 22:00:30 +02:00
Gustavo
23a113756e Core/Spells Allow bosses to receive KnockBack under certain conditions (#19312)
Conditions: Not player, not controlled by player and not hunter's pet

(cherry picked from commit 3bfe67792d)
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
Shauren
c3dcbe04dc Core/Spells: Assign spell effect handles for new apply aura effects 2020-06-22 11:04:57 +02:00
Keader
c9c178db19 Core/Spells: Removed duplicated check again followup 3a0417f712
to send some info to client

(cherry picked from commit ed43883160)
2020-06-14 23:49:05 +02:00
Keader
19602c2e83 Core/Spells: Removed duplicated check
unitTarget was checked twice in Spell::EffectTaunt

(cherry picked from commit 3a0417f712)
2020-06-14 23:49:05 +02:00
Chaouki Dhib
419689b485 Core/Spells: change to the way the spell effect SPELL_EFFECT_JUMP work
(cherry picked from commit d625c0f619)
2020-06-14 20:04:17 +02:00
Shauren
c7306439e7 Core/Spells: Implement using different difficulty data from all spell related db2s, not just SpellEffect and SpellPower 2020-06-12 01:29:18 +02:00
Shauren
63fba47511 Core/Items: Implemented new bonus type (extra ItemEffect) 2020-06-05 00:27:40 +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-
4f6d38fe9d Core/Entities: moved PetAura handling to Player where it belongs
(cherry picked from commit 231ec8331b)
2020-04-29 01:36:47 +02:00
ariel-
1929ca3aa1 Core/Scripts: remove OnDummyEffect hook/sOnDummyEffect ai hook
- Duplicated logic never used, sometimes only ScriptMgr version was called, sometimes only AI
- They only encourage bad scripting practices
- You can still use OnSpellHit or a SpellScript

(cherry picked from commit b6b59f6c23)
2020-04-29 01:36:46 +02:00
ariel-
93c19c4194 Core/Misc: camelize GetFaction/SetFaction properly
(cherry picked from commit 4c4dca6d69)
2020-04-29 01:36:41 +02:00
ccrs
2d4549023a Core/Unit: 2170541a51 followup
use true as default value since pretty much all the script calls will expect that

(cherry picked from commit c7a57e2a09)
2020-04-28 17:42:26 +02:00
ccrs
1f0dc07ef1 Core/Unit: cleanup UnitState enum
(cherry picked from commit bf56049f2f)
2020-04-24 17:18:50 +02:00
Chaouki Dhib
5d076cfe29 Core/Spells: fix wrong distance calculations in AoE spells [Needs testing] (#16290)
Core/Spells: Fix wrong distance calculations in AoE spells.
Pull request #16290 by chaodhib.
God bless, finally.

(cherry picked from commit a1f2f30c14)
2020-04-24 17:18:49 +02:00
ariel-
ebc06b1d04 Core/Auras: reworked multiplicative AuraEffects calculation
- Splitted containers for flat modifiers and pct modifiers, as they now have different handling
- Amount is now multiplied only on apply; on unapply, iterate through auras and reset the counter
- Fixes many cases of rounding error due to applying/unapplying of small factors
- Allows amounts to be zeroed (ie with an AuraEffect of amount -100)
- Do a partial revert of 6dc37a9add, auras should update amounts only for items allowed (ie no more giving crit to a sword while having an axe in the other hand and being Poleaxe spec'd)
- SPELL_AURA_MOD_SCALE now scales additively, rather than multiplicatively (checked in sniffs)

Closes #18687

(cherry picked from commit c69a7d1223)
2020-04-24 17:18:47 +02:00
Shauren
3700e0ef5d Core/Misc: Defined new summon properties titles 2020-04-07 17:27:40 +02:00
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
Shauren
d934824421 Core/Items: Implement azerite empowered items 2019-12-05 00:12:35 +01:00
Shauren
1238583312 Core/Spells: Fixed value of aura effects for stat mod auras applied by items 2019-11-30 12:11:29 +01:00
Shauren
96575e33bb Core/Items: Add location filters to Player::GetItemByEntry 2019-11-29 00:10:29 +01:00
Shauren
cf0e233689 Core/Spells: Force creating only 1 enchanting scroll when targeting a vellum with enchantments 2019-11-26 23:20:11 +01:00
Shauren
0a2d9ad2f7 Core/Items: Add ItemContext param to Item::Create function 2019-11-23 00:03:42 +01:00
Shauren
ec9d624aec Core/Items: Implement azerite essences
* Implement inspecting heart of azeroth data
* Fixed heart of azeroth item level - bonuses now apply
2019-11-22 11:02:04 +01:00
Shauren
ad774a8e0e Core/Spells: Make missing spell/aura effect handler assignments a compile time error instead of runtime crash 2019-11-21 14:36:16 +01:00
Shauren
3beb17c452 Core/Spells: Fixed crash when casting spells with effect type > 264 2019-11-21 13:58:58 +01:00
Shauren
38d04775db Core/Spells: Delete ancient bg mark code from create item spell effect 2019-10-18 19:38:03 +02:00
Shauren
04ab611111 Core/Spells: Fixed calling spellhit script hooks on launch when spell hits both caster and target with different effects 2019-08-31 11:11:23 +02:00
Traesh
c924840ce7 Core/Spells: Implement SpellMisc::LaunchDelay 2019-08-31 11:11:23 +02:00
xinef1
60663d1374 Ensure that all actions are compared to fixed point in time (ie. world update start) (#18910)
- Actions will not be dependent on processing moment
- Increased GameObjects cooldown resolution to milliseconds, fixes arming time of traps to be exactly one second and not something from range (1000, 1999)
- Created GameTime namespace and UpdateTime class and moved there some code out of world

(cherrypicked from 7567cafec8)
2019-08-17 20:04:14 +02:00
ariel-
396457e36a Core/Movement: Corrected all speed checks after 23b6991273
Ref issue #19210

(cherrypicked from 2e68736afc)
2019-08-17 20:04:14 +02:00
xinef1
a32d5cfa17 Core/SmartAI: Various fixes and extensions for smart scripts: (#18673)
- Possible crashes fixed
- Memory leak fixed
- Implemented checking of vehicle conditions
- Extended eventphasemask to 12 bits (sql required to change DB field type)
- SMART_EVENT_GOSSIP_HELLO - added possibility to detect for gameobject reportUse call
- Renamed action SMART_ACTION_SET_FLY to SMART_ACTION_SET_DISABLE_GRAVITY (to reflect actual functionality)
- Added targetsLimit to action SMART_ACTION_CAST and SMART_ACTION_INVOKER_CAST to limit max amount of targets (selected randomly)
- Action SMART_ACTION_TALK corrected to always work as intended
- Properly call GroupEventHappens in action SMART_ACTION_CALL_GROUPEVENTHAPPENS if invoker was charmed or owned by the player
- Properly utilize followAngle in action SMART_ACTION_FOLLOW (db orientation should be in degrees), but keep backward compatibility
- Added action SMART_ACTION_SET_CAN_FLY (119) 0/1
- Added action SMART_ACTION_REMOVE_AURAS_BY_TYPE (120) AuraType, can be used to exit vehicle for example
- Added action SMART_ACTION_SET_SIGHT_DIST (121) sightDist
- Added action SMART_ACTION_FLEE (122) fleeTime
- Added action SMART_ACTION_ADD_THREAT (123) +threat, -threat
- Added action SMART_ACTION_LOAD_EQUIPMENT (124) equipmentId
- Added action SMART_ACTION_TRIGGER_RANDOM_TIMED_EVENT (125) minId, maxId
- Added action SMART_ACTION_REMOVE_ALL_GAMEOBJECTS (126), removes all owned gameobjects
- Added action SMART_ACTION_STOP_MOTION (127), stopMoving, movementExpired
- Extended target SMART_TARGET_HOSTILE_SECOND_AGGRO with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_HOSTILE_LAST_AGGRO with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_HOSTILE_RANDOM with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_HOSTILE_RANDOM_NOT_TOP with following parameters maxdist, playerOnly, powerType + 1
- Extended target SMART_TARGET_THREAT_LIST with maxdist
- Extended target SMART_TARGET_OWNER_OR_SUMMONER to be able to get charmer/owner of current owner
- Added new target SMART_TARGET_FARTHEST with maxDist, playerOnly, isInLos restrictions
- Added SpellHit hook to GameObjectAI and extended SmartGameObjectAI to call SMART_EVENT_SPELLHIT when gameobject is hit by spell
- Call GameObjectAI Reset hook on gameobject respawn (for ex. to reset one time events in smart scripts)
- Fixed some logic errors in code
- SmartAI Escorts properly despawn escortee if no players are in range
- Disable Evading while charming creature with SmartAI
- Don't call SMART_EVENT_RESPAWN for dead units before they actually respawn
- Don't call SMART_EVENT_RESPAWN for not spawned gameobjects
- Properly call SMART_EVENT_RESPAWN for gameobject respawn
- Allow action SMART_ACTION_SET_IN_COMBAT_WITH_ZONE to utilize targetlist
- Allow action SMART_ACTION_CALL_FOR_HELP to utilize targetList
- Allow action SMART_ACTION_SET_INVINCIBILITY_HP_LEVEL to utilize targetList
- Allow action SMART_ACTION_SET_VISIBILITY to utilize targetList
- Allow action SMART_ACTION_SET_ACTIVE to utilize targetList
- Allow action SMART_ACTION_ATTACK_START to select random attack target instead of first on the list
- Allow gameobjects to summon gameobjects with action SMART_ACTION_SUMMON_GO
- Properly store action invokers for action SMART_ACTION_WP_START, if no player invokers are found, distance despawn check won't be used
- Allow action SMART_ACTION_WP_RESUME to compensate for the state the unit actually is in (eg. combat)
- Allow action SMART_ACTION_MOVE_TO_POS to select random of the avaiable targets, not only the first one.
- Allow action SMART_ACTION_MOVE_TO_POS to utilize x, y, z parameters as an offset to calculated coordinates
- Action SMART_ACTION_RESPAWN_TARGET should never modify respawntime of already spawned gameobjects, use dedicated function
- Properly delete ontime events created by SMART_ACTION_CREATE_TIMED_EVENT
- If action could not be started because conditions were not satisfied, do not recalculate the waittime to action repeattime, use smaller value to recheck more frequently
- Allow target SMART_TARGET_CLOSEST_PLAYER to be used by gameobjects
- Allow target SMART_TARGET_OWNER_OR_SUMMONER to be used by gameobjects
- Fixed SMART_EVENT_COUNTER_SET to be only called for the id that was incremented
- Changed the way counters work
- Protect PhaseInc from surpassing maximum phase
- Added loading checks for missing NON_REPEATABLE flag if no repeatmin, repeatmax is set
- Added spell validation for SMART_ACTION_CROSS_CAST

(cherrypicked from b0ae5fadd1)
2019-08-17 20:04:14 +02:00
Keader
dc1cddf3bb Core/Spells: Split ProcFlags of PROC_HIT_INTERRUPT
Followup: 44d0d24af8
2019-08-01 15:23:08 -03:00
Keader
44d0d24af8 Core/Spells: Fixed PROC_HIT_INTERRUPT not triggering by PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS
Cherrypick of 3ffe570b21
2019-08-01 11:38:25 -03:00
xinef1
cfefd27cb8 Added some missing SetFallInformation calls (#19121)
Fixed HP drop bug on zeppelins
Fixed possible packet relocation problems on huge transports

(cherrypicked from b3f04ec157)
2019-07-21 21:06:54 +02:00
xinef1
89f728cd5b Core/Misc: Fixed player corpse looting, added player corpse loot and some more (#19122)
* Fixed corpse looting in wintergrasp
Added corpse loot for wintergrasp quests and To the Looter Go the Spoils (1166) achievement
Don't generate money for loot if no loot mode is available
Simplified few things

(cherrypicked from 2412886ef6)
2019-07-21 21:06:54 +02: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
xinef1
ca26c33145 Implemented binary resistances and some more (#18933)
- Fixed possible exploit with tamed pets having template immunities
- Implemented binary resistances
- Corrected resistances calculations
- Pets properly inherit players spell penetration
- Fixed doubled block calculation for damaging melee spells
- Auras removing snare effects will only remove the snaring component
- Shapeshifting will properly remove movement impairing auras only and not crowd control (dragon's breath)
- Immunities are properly checked versus all schools appearing in spell, unit is immune only if immune to all schools
- Spells with melee and magic school mask should compare armor reduction with resistances and select smaller reduction
- Demonic Circle: Teleport no longer removes root effects

(cherrypicked from 93746e8c4a)
2019-07-21 21:06:54 +02:00
xinef1
92e95ddf55 Core/Spells: Fixed spell effect 93 (SPELL_EFFECT_FORCE_DESELECT) (#19001)
(cherrypicked from 9e1b286984)
2019-07-21 21:06:54 +02:00
Gerhood
7e83cce81f Core/Spells: implement Mad/Crazy Alchemist's potions
(cherrypicked frombab59b28faad262dc5d9873ca7c0856477ec4d66)
2019-07-21 21:06:54 +02:00
xinef1
68cc366d88 Core/Spells: Corrected summon category SUMMON_CATEGORY_VEHICLE (#19052)
(cherrypicked from 227d5a9288)
2019-06-15 18:41:09 +02:00
Shauren
bcaaa3d6f6 Core/DataStores: Updated db2 structures to 8.1.5 2019-06-08 17:10:00 +02:00
Shauren
82c7b6c568 Core/Items: Drop item random property and suffix - all random stats must be given using bonus lists 2019-06-08 17:09:20 +02:00
Shauren
455959c606 Core/PacketIO: Rewrite updatefield handling 2019-06-08 17:06:57 +02:00
Shauren
d5992f7711 Core/Spells: Add missing spell and aura effect handler array entries
Closes #23015
2019-02-04 16:47:41 +01:00
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
Shauren
8e1d5d5143 Core/Spells: Updated gathering profession skills 2018-12-07 19:09:10 +01:00
Shauren
1b67a2626b Core/Players: Update profession rank handling with new split skill values for each expansion 2018-12-02 17:39:41 +01:00
Shauren
0a779bd791 Core/PacketIO: Updated packet structures to 8.0.1 2018-11-05 00:00:34 +01:00