Commit Graph
447 Commits
Author SHA1 Message Date
Shauren e8e89f58fb Core/DBLayer: Prevent using prepared statements on wrong database 2019-07-27 01:00:37 +02:00
xinef1 ad008c43b7 Core/Misc: Fix various crashes, also related to multithreading (#19012)
* When iterating groups we have to either do it not in multithreaded context (map updates) or start with checking maps (they are guaranteed to change in single thread update).
* Properly clear ComboPoint references on player remove
* remove some possible references item may have when it is deleted during save.
* Also clear all hostile references when unit is removed from map.

(cherrypicked from 86da1a19bb36edf3242dafac6e45e87434ddff73)
2019-07-21 21:06:54 +02:00
xinef1 b485f3e673 Few small optimizations here and there (#18684)
Changes list:
- Added CharacterGuidByNameContainer which contains name -> guid unordered map (updated along CharacterInfo)
- Extended CharacterInfo structure with GuildId
- Extended CharacterInfo structure with ArenaTeamId[3], for all possible teams (2v2, 3v3, 5v5)
- Removed CHAR_SEL_GUID_BY_NAME and CHAR_SEL_CHAR_GUID_BY_NAME synchronous queries, name -> guid can be now retrieved in World::GetCharacterGuidByName
- Removed CHAR_SEL_GUID_RACE_ACC_BY_NAME synchronous query, guid can be retrieved by name and rest of the data can be retrieved by guid
- Removed CHAR_SEL_CHAR_LEVEL synchronous query, level can be retrieved by guid
- Changed CHAR_SEL_CHARACTER_ACTIONS_SPEC to asynchronous query, action bars are now loaded asynchronously
- Removed CHAR_SEL_CHARACTER_NAME_CLASS synchronous query, guid can be retrieved by name and rest of the data can be retrieved by guid
- Removed CHAR_SEL_PLAYER_ARENA_TEAMS and CHAR_SEL_ARENA_TEAM_ID_BY_PLAYER_GUID synchronous queries, arena teams are now stored in CharacterInfo
- Replaced synchronous db calls with CharacterInfo lookups
- Removed ObjectMgr::GetPlayerGUIDByName, as it used db query
- Replaced some unnecessary UpdateObjectVisibility() calls because they were either duplicated (called few lines above in other function) or it is enough to call DestroyForNearbyPlayers because object is being removed or should be invisible and DestroyForNearbyPlayers is faster
- Corrected typo in Player::DestroyForPlayer, only items in slots 0 to EQUIPMENT_SLOT_END are sent to other players
- Renamed Player::GetGuildIdFromDB to Player::GetGuildIdFromCharacterInfo and changed the function to use CharacterInfo structure
- Renamed Player::GetArenaTeamIdFromDB to Player::GetArenaTeamIdFromCharacterInfo and changed the function to use CharacterInfo structure
- Renamed Player::GetLevelFromDB to Player::GetLevelFromCharacterInfo and changed the function to use CharacterInfo structure
- Removed GameEventMgr::_questToEventLinks and associated functions, eventId is now stored in Quest class under _eventIdForQuest variable
- Changed some functions checking quest status to use other functions for quest status check instead of duplicating code
- Removed callback from add friend, because we can get the guid from appropriate storage, no need to make db query
- Removed callback from add ignore, because we can get the guid from appropriate storage, no need to make db query
- Added callback to unwrap wrapped items asynchronously
- Removed synchronous select in tutorials to check if we have any entries in db, if any entry exists in db, m_TutorialsChanged variable will have TUTORIALS_FLAG_LOADED_FROM_DB flag added and it is no longer necessary to query database

(cherrypicked from b955456008191e60b6bda1f22e3486a3792b08db)
2019-07-21 21:06:54 +02:00
Shauren 3714bf8e7a Core/Misc: Updated GameObjectTemplate structure 2019-07-14 19:20:45 +02:00
Shauren 455959c606 Core/PacketIO: Rewrite updatefield handling 2019-06-08 17:06:57 +02:00
Kittnz 83e6fde066 Core/Objects: increase sight range of all Infinite, Gigantic and Large objects & correct general default visibility distance (#22892)
Note: This does not make the object active.

Some info on range
https://trinitycore.atlassian.net/wiki/spaces/tc/pages/74950924/Lua+Scene+Script+Documentation#LuaSceneScriptDocumentation-ActorAOIRange

#21111 #21681 #22891

Thanks Kinzcool & Kelno
2019-01-16 20:48:01 +01:00
vincent-michael 5620eb9463 Update copyright note for 2019
auto happy = new year(2019);
2019-01-01 10:14:33 +01:00
Shauren 0a779bd791 Core/PacketIO: Updated packet structures to 8.0.1 2018-11-05 00:00:34 +01:00
Shauren 738f37d3cf Core/Maps: Replaced spawnmask with difficulty list 2018-09-15 17:55:26 +02:00
Jeremy bee4f04b13 Core/GameObject: Set SpellVisualID to capturePoint.SpellVisual1 when creating Capture Points (#22159) 2018-07-15 12:40:39 +02:00
Shauren a51cd47f80 Core/GameObjects: Set GO_FLAG_MAP_OBJECT for gameobjects that use a WMO model 2018-04-10 23:49:19 +02:00
Shauren b3b685a43d Core/GameObjects: Implement getting proper area in GAMEOBJECT_TYPE_PHASEABLE_MO 2018-04-09 00:05:20 +02:00
Traesh b7bb5e6a98 Core/Spells: Implemented personal summons (#19231)
* By default determined by summon property flag SUMMON_PROP_FLAG_PERSONAL_SPAWN

Closes #18254
2018-04-08 21:35:33 +03:00
Shauren 42f9deb21e Core/Maps: Implemented getting area id from gameobject spawns
Yes, you can now spawn LK platform anywhere and it will treat you as inside Icecrown Citadel
2018-03-28 22:01:22 +02:00
Shauren 91be2332e2 Core/Entities: Phasing rewrite
* Optimized phase visibility checking
* Handle all phase flags

Closes #16758
Closes #21119
2018-03-25 19:28:36 +03:00
Shauren 007b5a68c5 Core/DataStores: Fixed db2 structures after 7.3.5 2018-03-12 23:11:49 +01:00
joschiwald dc43a08d36 Core/Misc: Fixed new-delete-type-mismatch issue reported by AddressSanitizer 2018-01-28 23:34:14 +01:00
joschiwald 6226189a16 Core/Entities: Created factory methods to create new areatriggers, creatures and gameobjects 2018-01-27 23:02:46 +01:00
ariel- 2c022a5aa8 Core/Entities: fix interaction of traps with ffa pvp and sanctuary flags
- Traps should select ATTACKABLE not UNFRIENDLY targets (it shouldn't attack unfriendly targets on sanctuary zones for example)
- Made more readable the nasty oneliner in Unit::_IsValidAttackTarget

Closes #6464
Closes #18271

(cherry picked from commit ef227d7e64a3dc62fbf0cba0209202310b1af00b)
2018-01-21 14:51:49 +01:00
ariel- 6d246e4a0a Core/Gameobject: fixed sometimes not found linked trap
Closes #18256

(cherry picked from commit 400a69bf9efb227e8734668f07ed2f3f2863ba47)

# Conflicts:
#	src/server/game/Entities/GameObject/GameObject.cpp
2018-01-13 15:46:05 +01:00
Shauren bb718b5578 Core/Entities: Remove phasemask 2018-01-10 22:01:40 +01:00
joschiwald 5e3e4182c8 Core/Entities: Extended SpawnMask to 64 bit 2018-01-06 19:56:11 +01:00
DoctorKraft 2ee6ce6849 Core/Packets: Implemented SMSG_GAME_OBJECT_UI_ACTION (#20919) 2018-01-04 01:15:33 +01:00
vincent-michael 7d00ae4045 Update copyright note for 2018
auto happy = new year(2018);
2018-01-01 00:40:17 +01:00
ariel- 0c81d70394 Core/GameObject: use a friendly trigger for positive spells.
Fixes an issue with Skadi Harpoons.

Note to self: should actually implement GameObject casting already :/

(cherry picked from commit 3f1d020a2cee1436c5e0c891bc7a63147659b497)
2017-12-30 21:32:08 +01:00
ariel- 35219e098b Core/Gameobject: remove immune flags from trigger used to cast GO spells
Spells were failing flags check in Unit::_IsValidAttackTarget

Closes #18206

(cherry picked from commit 1ae3da101c272fde6183ee6073b208ba35a1b658)
2017-12-10 18:35:14 +01:00
SnapperRy 448ccc2b9e Core/GameObject: spawn linked traps at gameobject creation instead of using DB spawns. (#18172)
Closes #11328.

(cherry picked from commit a38c094a11dc61c8ee1153e0aee6de9a406d6a61)
2017-11-26 22:22:24 +01:00
joschiwald 3a254dd0da Fixed another mistake in c6881bd8a4
Thx @zorix
2017-11-19 19:45:20 +01:00
joschiwald eac1648181 Fixed cherry pick fail in c6881bd8a4 2017-11-11 21:45:41 +01:00
Snapper d25a8d42a3 Core/GameObjects: Handle despawning and respawning of nearby linked traps on gameobject despawn and respawn
Closes #12139
Closes #17553

(cherry picked from commit 5d9d25d5960a29d098035f9382a7b022e5294229)
2017-11-11 21:06:58 +01:00
Shauren c6881bd8a4 Core/GameObjects: Fixed Frozen Trap target selection
Closes #14238
Closes #17517

(cherry picked from commit f0ab95f19cd5e269efdee33cf02b91eb77a98277)
2017-11-11 21:05:20 +01:00
funjoker c77e76fa61 Core/Gameobject: Add WorldEffectID to Gameobject (#20785) 2017-11-05 20:24:45 +01:00
Seyden 5675902485 Core/Creatures: Implemented Basic Creature Scaling (#20026) 2017-07-29 21:40:28 +02:00
Shauren 00862295e3 Core/Spells: Fixed fishing bobbers not being usable
Closes #19773
2017-07-04 20:30:16 +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 00f5d21453 Build fix 2017-05-22 00:05:03 +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 a12a34b1dc Core/Game: Include cleanup - removed G3D classes from packets
* Use our own Position class instead, with the coords written to packets being part of type
2017-05-16 22:16:21 +02:00
Shauren 9299e9bde0 Core/Grids: Ported cmangos/mangos-wotlk@ea99457e50 2017-05-13 19:37:33 +02:00
joschiwald 036f67c0c1 Core/Collision: Replaced phasemask with proper phases in GameObject collision calculation 2017-05-05 21:22:58 +02:00
joschiwald 272d2a29e5 Core/Entities: Tweak WorldObject::IsNeverVisible to pass the seer 2017-05-05 13:31:25 +02:00
Krudor 5a36a2eb17 Core/Scripts: Add support for spawn specific C++ scripts
Closes #19247
2017-03-18 11:31:31 +01:00
jackpoz 9d09307e34 Scripts/ICC: Fix chest loot exploit
Fix an exploit at chest loot bosses Valithria and Deathbringer that allowed the first played to hit them to leave party at low hp % and loot the whole chest alone, without the party being able to loot anything.

(cherry picked from commit c4865fe63ee4bb9d401d09cb9543acaf9c853b56)

# Conflicts:
#	src/server/game/Entities/GameObject/GameObject.cpp
2017-03-03 22:31:28 +01:00
SnapperRy 83257dacf2 Core/Fishing: ignore required skill when fishing in pools.
(cherry picked from commit 4164e0cf88745a85b5b11587471b047fe0077fbb)
2017-02-26 19:21:19 +01:00
ariel- 8a3f053a2f Core/GameObject: save spawn GOState and reset to it instead of toggling from whatever current state we have
Prevents exploit of SMART_ACTION_ACTIVATE_GOBJECT

(cherry picked from commit be3199314ab4c8fba31dd29cbc3a79838e5b3138)
2017-02-18 17:17:18 +01:00
treeston 7b13e98327 AI/SmartScripts: Add param3 to SMART_ACTION_CAST and SMART_ACTION_INVOKER_CAST that allows specific triggered flags to be set (rather than all-or-nothing). Ignored if SMARTCAST_TRIGGERED is not set.
(cherry picked from commit 9072e0221b39c19fb6be154c623f45d6a9433db0)
2017-02-12 15:50:43 +01:00
ariel- c429e7d489 Core/Entities: debloat SummonGameObject parameter list using proper wrappers and enable GO rotation in scripts
- There's still an overload allowing for x, y, z, o to be passed directly
- Fixed default animstate for GameObject creation in many places, it should be 255, not 100 (checked in sniffs)

(cherry picked from commit 62bfee37cb21584cef631dda428feaf5eb829cda)

# Conflicts:
#	src/server/game/Battlefield/Battlefield.cpp
#	src/server/game/Battlegrounds/Battleground.cpp
#	src/server/game/Entities/GameObject/GameObject.cpp
#	src/server/game/Entities/GameObject/GameObject.h
#	src/server/game/Entities/Object/Object.cpp
#	src/server/game/Entities/Object/Object.h
#	src/server/game/Spells/SpellEffects.cpp
#	src/server/scripts/Commands/cs_gobject.cpp
#	src/server/scripts/EasternKingdoms/SunkenTemple/instance_sunken_temple.cpp
#	src/server/scripts/EasternKingdoms/ZulAman/zulaman.cpp
#	src/server/scripts/Kalimdor/zone_feralas.cpp
#	src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp
#	src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
#	src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
2017-02-11 20:50:29 +01:00
ariel- 02cef6f034 Core/GameObjects: Gameobject rotation (from cmangos/mangos-wotlk@2bcbc0f) (#14146)
cmangos/mangos-wotlk@0fe88f35df: [11531] Normalize gameobject's quaternion, thanks to zergtmn for pointing
cmangos/mangos-wotlk@060dfb791b: [11667] Implement transport path rotation
cmangos/mangos-wotlk@565f52c6c1: [11806] A bit gameobject code refactoring
cmangos/mangos-wotlk@6874951: [11807] Add gameobject_addon table

Closes #14146

(cherry picked from commit 2967bf59b4a47837b85c995b732a6761c9c35f7e)

# Conflicts:
#	src/server/game/Battlefield/Battlefield.cpp
#	src/server/game/Battlegrounds/Battleground.cpp
#	src/server/game/Entities/GameObject/GameObject.cpp
#	src/server/game/Entities/GameObject/GameObject.h
#	src/server/game/Entities/Object/Object.cpp
#	src/server/game/Globals/ObjectMgr.cpp
#	src/server/game/Spells/SpellEffects.cpp
#	src/server/scripts/Commands/cs_gobject.cpp
#	src/server/scripts/Northrend/Nexus/EyeOfEternity/instance_eye_of_eternity.cpp
#	src/server/scripts/OutdoorPvP/OutdoorPvPSI.cpp
2017-02-11 19:10:43 +01:00
SnapperRy 9f9692427a Core/Fishing: update fishing skill regardless of success or failure (junk items fished) (#17504)
(cherry picked from commit bf30ec9c8efb40e78cc8c123780edf12e7a2a162)
2017-02-04 23:49:42 +01:00