Commit Graph

539 Commits

Author SHA1 Message Date
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
Keader
db80892a41 Build fix
(cherry picked from commit 3aadb72eaa)
2020-08-18 18:53:13 +02:00
Keader
251c1811ae Core/Custom: Fixed SPELLMOD_COOLDOWN exploit on Duel Reset system
Followup 0048d4b618
Closes #17419

(cherry picked from commit e254ebebbe)
2020-08-18 18:53:13 +02:00
Keader
04c303a7e5 Core/Custom: Fixed Duel Reset Exploits
Close #17419
*Fixed exploit with SPELLMOD_COOLDOWN
*Fixed exploit with some items (like Sylvanas' Music Box)
*Little cleanup

(cherry picked from commit 0048d4b618)
2020-08-14 17:38:52 +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-
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
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
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
ccrs
104e745edf Core/Misc: cleanup SetInFront uses
Set in front modifies only the serverside orientation, use with care.
Also check for current focus to prevent things like incorrect damage on casting creatures (ie dragon breath direction change in your face because of some taunt missclick)

(cherry picked from commit 229444b74a)
2020-04-28 17:51:25 +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
Aokromes
b0bf1275ee New Year 2020-01-02 06:44:10 +01:00
ariel-
590009b084 Core/Scripts: converted Argent Tournament pennants to AI
Closes #14616

(cherrypicked from 804257b99a)
2019-08-17 20:04:14 +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
jackpoz
154f9a03e7 Core/Misc: Fix static analysis issues
(cherrypicked from 6940071994)
2019-08-17 20:04:14 +02:00
ariel-
5f70be050f Core/Scripts: fix Nightfall proc chance and reduce it for victims with level above 60
Closes #15734

(cherrypicked from eac9c1f0b9)
2019-08-17 20:04:14 +02:00
Kittnz
1c926d0171 Script/GO: Alliance Bell, Horde Bell and Karazhan Bell will now send a bell sound on the start of each hour. (#19145)
* Script/GO: Alliance Bell, Horde Bell and Karazhan Bell will now send a bell sound on the start of each hour.

How many times it rings depence on the hour.

* fix little things from pr comments

* Added OnGameEvent

* Fix braces

* almost finished

* fix enum

* Add gameobjects to the game event

Fix override for InitializeAI

* enum squash

* remove braces

* Rename 9999_99_99_99_world.sql to 2017_02_19_01_world.sql

(cherrypicked from 495339a2c7)
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
Shauren
e8e89f58fb Core/DBLayer: Prevent using prepared statements on wrong database 2019-07-27 01:00:37 +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
vincent-michael
5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
Traesh
9d210476e5 Core/Creatures: Update creature model handling with new display scale (#22567) 2018-11-07 20:23:30 +01:00
Shauren
921235b3e9 Core/Misc: Fixed rotation of many gameobjects summoned in tol barad, garrison and various scripts 2018-05-07 17:45:09 +02:00
sirikfoll
2378266acd Scripts/Events Implement Pilgrim's Bounty Bountiful Table
(cherry picked from commit 75df296bb6)

Rename SQL file
(cherry picked from commit 13031f300f)
2018-03-12 16:39:45 +01:00
Mihapro
8199eef81c Core/Misc: Added helper function Unit::SetFullPower
* Also renamed Unit::getPowerType and Unit::setPowerType to follow style guidelines

Ref #20981
2018-01-03 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
Aokromes
c547627d95 Misc: Kill trailing white spaces 2017-11-25 01:40:43 +01:00
funjoker
465012978f Core/Scripting: Implemented Conversation scripts (#20758) 2017-11-18 12:40:56 +01:00
joschiwald
2c4246f341 Fixed build 2017-09-06 16:10:32 +02:00
Kittnz
a755a78f9c Core/Event: Change Midsummer Music container to vector
(cherry picked from commit e0c2482fa1)
2017-09-06 16:04:47 +02:00
Kittnz
c41a4f39f6 Core/Event: Change Midsummer Music to search grid only
(cherry picked from commit 30a3a93ef9)
2017-09-06 16:04:23 +02:00
Kittnz
58fa54801f Core/Scripts: Initialize rnd and remove where it was not needed
(cherry picked from commit eee7fa3fa7)
2017-09-05 11:20:44 +02:00
Kittnz
bd938d643d Core/Event: Pirate Day Music during the event
(cherry picked from commit 963278459a)
2017-09-05 11:10:56 +02:00
Kittnz
8fb07040ac Core/Event: Add Darkmoon Fair Music during the event
(cherry picked from commit e3560f3f51)
2017-09-05 11:05:51 +02:00
Kittnz
c06d6b290e Core/Event: Add Midsummer Music during the event
(cherry picked from commit 19f8acdb61)
2017-09-05 10:42:08 +02:00
Kittnz
2a3a68dfab Core/Event: Fix Brewfest Music
Was only playing the same song over and over again.

(cherry picked from commit 3eacc25e5d)
2017-08-21 21:19:52 +02:00
Kittnz
b8479333c2 Core/Event: Add Brewfest Music during the event
Note: Dark Iron invasion music can be added with a trigger at a later stage
(cherry picked from commit 002b0a7a65)

Update 2016_10_05_11_world_335.sql
(cherry picked from commit cccb1c5dde)

Fix non PCH build.
(cherry picked from commit 81d4c02f34)
2017-08-20 23:23:47 +02:00
Shauren
1de03622c5 Scripts: Delete broken multi profession trainer script (can now be done in db)
* Build fix
2017-08-20 15:06:59 +02:00
Shauren
b85d46138b Core/Creatures: Deleted obsolete pet trainer script and fixed build 2017-07-27 00:04:37 +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
Shauren
2200b4b0e1 Nopch fix 2017-05-24 21:30:43 +02:00
Shauren
c5d3dd90be Core/Game: Include cleanup
* Mostly aimed at removing Log/DatabaseEnv includes from other headers
* Fix most packet headers including other packet headers - moved common structures such as ItemInstance to their own files
* Moved SAI function definitions to source files (massive or requiring many different dependencies)
2017-05-18 23:53:25 +02:00
Shauren
9299e9bde0 Core/Grids: Ported cmangos/mangos-wotlk@ea99457e50 2017-05-13 19:37:33 +02:00
Aokromes
7717b833c2 missing part 2017-04-16 17:22:52 +02:00
Aokromes
98dc10c580 Core/Trainers: Fix Multiprofession Trainers
By Malcrom, cherry pick from 6fef0d2eb2
2017-04-16 16:09:40 +02:00