aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/NPCHandler.cpp
AgeCommit message (Collapse)Author
2025-07-05Core/Gossip: Track started interaction types and reset only questgiver on ↵Shauren
quest accept Closes #31120
2025-06-21Core/Gossip: Use std::variant to store InteractionDataShauren
2025-03-02Core: Updated to 11.1.0Shauren
2023-11-09Core: Update to 10.2.0Shauren
2023-07-12Core: Update to 10.1.5Shauren
2023-05-29Core/Creatures: Move creature difficulty specific data from ↵Meji
creature_template table to creature_template_difficulty (#28931)
2023-05-09Core/Battlegrounds: Moved AreaSpiritHealer resurrection handling to ↵Jeremy
respective npc flags (#28508) * UNIT_NPC_FLAG_AREA_SPIRIT_HEALER * UNIT_NPC_FLAG_2_AREA_SPIRIT_HEALER_INDIVIDUAL
2023-05-06Core/Unit: Named npc flags UNIT_NPC_FLAG_AREA_SPIRIT_HEALER and ↵ModoX
UNIT_NPC_FLAG_2_AREA_SPIRIT_HEALER_INDIVIDUAL
2023-04-05Core/Creature: Added possibility to give creatures multiple gossip menu ids ↵ModoX
and control them via conditions (#28159)
2023-03-12Core/Creatures: Allow overriding default gossip menu idShauren
2023-03-10Core/Creatures: Allow overriding non-gossip based trainer ids for creaturesShauren
2023-01-08Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard ↵Shauren
compatible api)
2022-12-04Core: Updated to 10.0.2Shauren
2022-03-19Core/Misc: Improvement item durability repair logic. (#26911)Mikhail Redko
* Core/Misc: Improvement item durability repair logic. * Move item repair cost calculation logic from Player::DurabilityRepair to Item::CalculateDurabilityRepairCost * Make item repair cost calculation more congruent with client logic (std::round) * Do not repair items if player does not have enough money to pay for the repair of all items at once * Withdrawing money from guild bank only once to avoid spam in the guild bank log and reduce number of transactions in the database Closes #25937 * Fix build * Remove unnecessary scope * Fix visual studio warning and one more check for reliability (cherry picked from commit 3cef126d0a449219f154a6498d26831f86220dfa)
2022-03-06Core/Creature: Add new db field InteractionPauseTimer (#25880)Giacomo Pozzoni
* Core/Creature: Add new db field InteractionPauseTimer Add new db field InteractionPauseTimer to allow to define different interaction pause timers for each creature (the previous system was a global setting in worldserver.conf Creature.MovingStopTimeForPlayer) * Set all columns in creature_template_movement as optional (can be NULL, default NULL). Fill only the columns that should override the default C++ value * Use the InteractionPauseTimer value throughout the code instead of Creature.MovingStopTimeForPlayer * Handle InteractionPauseTimer set to 0 as "don't stop at all" * Implement InteractionPauseTimer in creature_movement_override creature_movement_override allows NULL values, in which case the values from creature_template_movement will be used for those columns that are NULL, falling back to default C++ values if creature_template_movement has NULL values too (or no rows for the creature) * Read default InteractionPauseTimer from worldserver.conf * Rename 2021_99_99_99_world.sql to 2021_01_22_00_world.sql (cherry picked from commit a22bc236ebc038c723774e5b38cd93e814ccc43d)
2022-02-13Core/Misc: Minor game include cleanupShauren
2022-02-05Add "On" to some gossip methods in AI (#25415)Maks Szokalski
* Add "On" to some methods * Update npc_innkeeper.cpp * Update zone_borean_tundra.cpp (cherry picked from commit 41188eb535e445b73909659980257da2939e4be4)
2022-02-02Warning fixesShauren
2022-02-02Core/Pets: Updated pet summoning for latest client version (5 Call Pet ↵Shauren
spells and stable size 200)
2022-01-31Core/Pets: Removed storing stable slot count in dbShauren
2022-01-31Core/PacketIO: Removed handlers for two pet opcodes that no longer existShauren
2022-01-31Core/Pets: Fixed saving pets put in stable while not being summonedShauren
Closes #26599 (cherry picked from commit 4acd6e1d3821931ad3c2355c10e1ec4da6e3fb64)
2022-01-31Core/Pet: Fix assert triggered by e203ecda88a327c4e93588f39cc4ffdcf99b30f7jackpoz
(cherry picked from commit 22a5b0fcde8f04af5ed860eeb8f6b4a59e65b723)
2022-01-31Core/Pet: Attempt to fix assertions triggered when summoning pets (#26501)Giacomo Pozzoni
* Core/Pet: Attempt to fix an assertion triggered when re-summoning the current pet * Core/Pet: Attempt to fix an assertion triggered when stabling a pet while in a vehicle * Core/Pet: Attempt to fix an assertion triggered when stabling a pet and casting spell 6962 * Core/Pet: Attempt to fix an assertion triggered when casting spell 6962 while being dead * Core/Pet: Attempt to fix an assertion triggered when summoning a pet while on vehicle 34775 * Handle cases in a generic way * Code cleanup * Core/Pet: Attempt to fix an assertion triggered when summoning a pet while on vehicle 34775 with a new character (cherry picked from commit e203ecda88a327c4e93588f39cc4ffdcf99b30f7)
2022-01-31Core/Pets: Pet management refactoring (#25191)Shauren
* Core/Pets: Pet management refactoring * Preload basic pet data on character login with async query * Load additional pet data (declined names/auras/spells/cooldowns) using async query after we are sure pet loading will succeed * Remove all select queries related to pet stable/unstable * Remove all silent pet deletions except explicit UI-triggered abandons * Fixed displaying stable master content when current pet is not summoned * Allow to stable/swap unsummoned current pet Closes #3610 Closes #21266 (cherry picked from commit 5c1fc5e3876549f5ed2b9051fffb6f3d94a67d7a)
2022-01-23Misc: Remove some unneeded/duplicated includes (#25051)Peter Keresztes Schmidt
(cherry picked from commit ddf16ae4d9eff6e849618bb6c5a00603f26daa93)
2022-01-23Core/DataStores: Port refactors from Update DBC field names to generated ↵Peter Keresztes Schmidt
ones (#24999) (cherry picked from commit c92950b3e1f6366d85d707365a8ad2caddafeecc)
2021-12-13Core/Unit: rename several getters to follow codestyleccrs
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 5c09ff51f7015b775def8d5cc1f678eaef37200f)
2021-03-21Core/Auras: Defined and implemented many new interrupt flagsShauren
2020-09-04Core/Misc: Port all the refactors sneaked in master to 3.3.5 include cleanup ↵Shauren
port
2020-08-23Core/Movement: 7fff83d6752 followupccrs
remove home position set from creature PauseMovement, and use it when necessary change log level on DelayedDelete (cherry picked from commit cd4775420a4894012616d54467eb3827430245b5)
2020-08-23Core/Movement: waypoint movement (#20121)ccrs
Following the work done in #19361 this is the cleanup and improvement of the related logic of waypoint management. Ref 28050f3 #18020 (taking the good parts and ignoring the incomplete work) (cherry picked from commit 7fff83d67526efff63867d41b9e036a19a9287b3)
2020-08-14Core/Misc: Replace NULL with nullptrShauren
2020-07-02Core/PacketIO: Convert all leftover packets to use packet classesShauren
2020-05-03Core/Scripts: unified scripted gossip/quest apiariel-
- 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 f913f3bb8977c127d200d5d4a608ab434b21bbcd)
2020-04-29Core/Misc: camelize GetFaction/SetFaction properlyariel-
(cherry picked from commit 4c4dca6d694bd1064b403a31a5b1c776a326f3ce)
2020-04-14Core/DBLayer: Implement async transaction completion callbacksShauren
2020-01-02New YearAokromes
2019-10-27Core/DataStores: Updated db2 structures to 8.2.5Shauren
2019-07-27Core/DBLayer: Prevent using prepared statements on wrong databaseShauren
2019-07-21Core/Creatures: Various fixes for creatures, regarding combat conditions, ↵xinef1
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 e1f14215d86fc9f0cd041f0e87bf0a689c086329)
2019-07-21Few small optimizations here and there (#18684)xinef1
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-06-08Core/PacketIO: Rewrite updatefield handlingShauren
2019-01-01Update copyright note for 2019vincent-michael
auto happy = new year(2019);
2018-03-14Core/Misc: Graveyards can now use conditions, SourceType = 27, SourceEntry = ↵Shauren
graveyard_zone.ID
2018-01-01Update copyright note for 2018vincent-michael
auto happy = new year(2018);
2017-11-25Misc: More cleanupAokromes
2017-08-20Core/Creatures: Fixed trainers that don't use gossip but open trainer list ↵Shauren
directly from CMSG_TRAINER_LIST
2017-08-13Core/Creatures: Implement a general way to store selection data for gossip ↵Rochet2
and fix trainer exploit (#20085) * Implement mail check * Implement CloseInteraction packet
2017-07-27Core/Creatures: Deleted obsolete pet trainer script and fixed buildShauren