-
Notifications
You must be signed in to change notification settings - Fork 237
Twink server trinity eluna #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
dd53994
b4e9ea0
7e7372e
ed08a62
71c4a75
564ef85
7d024be
cb5753d
250f206
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
|
|
||
| build*/ | ||
| bin/ | ||
| .directory | ||
| .mailmap | ||
| *.orig | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -260,7 +260,7 @@ Creature::Creature(bool isWorldObject): Unit(isWorldObject), MapObject(), m_grou | |||||||||||||||||||||||||||||
| m_AlreadyCallAssistance(false), m_AlreadySearchedAssistance(false), m_cannotReachTarget(false), m_cannotReachTimer(0), | ||||||||||||||||||||||||||||||
| m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL), m_originalEntry(0), m_homePosition(), m_transportHomePosition(), | ||||||||||||||||||||||||||||||
| m_creatureInfo(nullptr), m_creatureData(nullptr), m_stringIds(), _waypointPathId(0), _currentWaypointNodeInfo(0, 0), | ||||||||||||||||||||||||||||||
| m_formation(nullptr), m_triggerJustAppeared(true), m_respawnCompatibilityMode(false), _lastDamagedTime(0), | ||||||||||||||||||||||||||||||
| m_formation(nullptr), m_triggerJustAppeared(true), m_respawnCompatibilityMode(false), m_assistCheckTime(0), _lastDamagedTime(0), | ||||||||||||||||||||||||||||||
| _regenerateHealth(true), _regenerateHealthLock(false), _isMissingCanSwimFlagOutOfCombat(false) | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| m_regenTimer = CREATURE_REGEN_INTERVAL; | ||||||||||||||||||||||||||||||
|
|
@@ -804,6 +804,34 @@ void Creature::Update(uint32 diff) | |||||||||||||||||||||||||||||
| m_boundaryCheckTime -= diff; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| if (IsEngaged() && IsAlive() && !IsPet() && !IsCharmed() && !IsTotem() && !IsTrigger()) | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| // Only check for creatures that can actually call for help | ||||||||||||||||||||||||||||||
| if (!GetCharmerOrOwnerGUID().IsPlayer()) | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| if (diff >= m_assistCheckTime) | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| float radius = sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS); | ||||||||||||||||||||||||||||||
| if (radius > 0.0f) | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| // Use CallForHelp which directly engages nearby creatures | ||||||||||||||||||||||||||||||
| CallForHelp(radius); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // Set next assistance check time | ||||||||||||||||||||||||||||||
| m_assistCheckTime = sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY); | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||
| m_assistCheckTime -= diff; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
| else | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
| // Reset timer when not in combat | ||||||||||||||||||||||||||||||
| if (m_assistCheckTime > 0) | ||||||||||||||||||||||||||||||
| m_assistCheckTime = 0; | ||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // if periodic combat pulse is enabled and we are both in combat and in a dungeon, do this now | ||||||||||||||||||||||||||||||
| if (m_combatPulseDelay > 0 && IsEngaged() && GetMap()->IsDungeon()) | ||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||
|
|
@@ -2330,6 +2358,7 @@ void Creature::CallAssistance() | |||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| float radius = sWorld->getFloatConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable combatTargets is declared but never used. It's created as an empty vector and then the code directly iterates over enemy->GetCombatManager().GetPvECombatRefs() without populating or using this vector. This unused variable should be removed.
| std::vector<Unit*> combatTargets; |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment says "trigger first check after 5 seconds", but the actual delay is determined by CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY which may not be 5 seconds. The comment should either be generic (e.g., "Initialize assistance check timer based on config") or be updated to match the actual config value.
| // Initialize assistance check timer to trigger first check after 5 seconds | |
| // Initialize assistance check timer based on config value |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicated conditional check: Lines 3340 and 3347 contain the exact same complex condition !IsPet() && !IsCharmed() && !GetCharmerOrOwnerGUID().IsPlayer() && !IsTotem() && !IsTrigger(). These two blocks should be combined into a single if statement to improve code maintainability and readability.
| if (!IsPet() && !IsCharmed() && !GetCharmerOrOwnerGUID().IsPlayer() && !IsTotem() && !IsTrigger()) | |
| { | |
| m_assistCheckTime = sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY); | |
| } | |
| // Call for assistance from nearby creatures | |
| // Only do this for non-player controlled creatures in normal world content | |
| if (!IsPet() && !IsCharmed() && !GetCharmerOrOwnerGUID().IsPlayer() && !IsTotem() && !IsTrigger()) | |
| { | |
| // Call for assistance from nearby creatures | |
| // Only do this for non-player controlled creatures in normal world content | |
| if (!IsPet() && !IsCharmed() && !GetCharmerOrOwnerGUID().IsPlayer() && !IsTotem() && !IsTrigger()) | |
| { | |
| m_assistCheckTime = sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY); |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CallAssistance() is being called here when a creature engages in combat. However, with the new periodic assistance check added in the Update() method (lines 807-833), creatures will continuously call for help throughout combat. This could result in duplicate or excessive assistance calls. Consider whether both the initial call here and the periodic calls in Update() are both necessary, or if one should be removed to avoid redundant behavior.
| if (!IsPet() && !IsCharmed() && !GetCharmerOrOwnerGUID().IsPlayer() && !IsTotem() && !IsTrigger()) | |
| { | |
| CallAssistance(); | |
| } | |
| // Assistance is now handled by the periodic check in Update(), so no immediate call here. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -467,7 +467,8 @@ enum ItemSubclassRecipe | |||||
| ITEM_SUBCLASS_ENCHANTING_FORMULA = 8, | ||||||
| ITEM_SUBCLASS_FISHING_MANUAL = 9, | ||||||
| ITEM_SUBCLASS_JEWELCRAFTING_RECIPE = 10, | ||||||
| ITEM_SUBCLASS_INSCRIPTION_TECHNIQUE = 11 | ||||||
| ITEM_SUBCLASS_INSCRIPTION_TECHNIQUE = 11, | ||||||
| ITEM_SUBCLASS_LINGUISTICS_BOOK = 12 | ||||||
| }; | ||||||
|
|
||||||
| #define MAX_ITEM_SUBCLASS_RECIPE 12 | ||||||
|
||||||
| #define MAX_ITEM_SUBCLASS_RECIPE 12 | |
| #define MAX_ITEM_SUBCLASS_RECIPE 13 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1327,7 +1327,16 @@ enum SpellCustomErrors | |||||
| SPELL_CUSTOM_ERROR_MAX_NUMBER_OF_RECRUITS = 96, // You already have the max number of recruits. | ||||||
| SPELL_CUSTOM_ERROR_MAX_NUMBER_OF_VOLUNTEERS = 97, // You already have the max number of volunteers. | ||||||
| SPELL_CUSTOM_ERROR_FROSTMOURNE_RENDERED_RESURRECT = 98, // Frostmourne has rendered you unable to resurrect. | ||||||
| SPELL_CUSTOM_ERROR_CANT_MOUNT_WITH_SHAPESHIFT = 99 // You can't mount while affected by that shapeshift. | ||||||
| SPELL_CUSTOM_ERROR_CANT_MOUNT_WITH_SHAPESHIFT = 99, // You can't mount while affected by that shapeshift. | ||||||
| SPELL_CUSTOM_ERROR_INTRO_QUEST_ACTIVE = 100,// You cannot use that until you've completed the introduction quest. | ||||||
| SPELL_CUSTOM_ERROR_STORMWIND_NEUTRAL = 101,// You must be at least Neutral with Stormwind to use that. | ||||||
| SPELL_CUSTOM_ERROR_IRONFORGEORGNOME_NEUTRAL = 102,// You must be at least Neutral with Ironforge or Gnomeregan Exiles to use that. | ||||||
|
||||||
| SPELL_CUSTOM_ERROR_IRONFORGEORGNOME_NEUTRAL = 102,// You must be at least Neutral with Ironforge or Gnomeregan Exiles to use that. | |
| SPELL_CUSTOM_ERROR_IRONFORGE_OR_GNOME_NEUTRAL = 102,// You must be at least Neutral with Ironforge or Gnomeregan Exiles to use that. |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent naming: ORGRIMMARORDARKSPEAR should have underscores between the words for better readability, like ORGRIMMAR_OR_DARKSPEAR to match the naming pattern used elsewhere in the codebase.
| SPELL_CUSTOM_ERROR_ORGRIMMARORDARKSPEAR_NEUTRAL = 105,// You must be at least Neutral with Orgrimmar or Darkspear Trolls to use that. | |
| SPELL_CUSTOM_ERROR_ORGRIMMAR_OR_DARKSPEAR_NEUTRAL = 105,// You must be at least Neutral with Orgrimmar or Darkspear Trolls to use that. |
Copilot
AI
Dec 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MAX_SKILL_TYPE constant is incorrectly set to 789, but it should be 790 since the highest skill ID (SKILL_LINGUISTICS) is now 789. The max constant should be one greater than the highest enum value to accommodate array sizing and iteration.
| #define MAX_SKILL_TYPE 789 | |
| #define MAX_SKILL_TYPE 790 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This periodic
CallForHelpcheck in the Update loop could cause significant performance issues. The function is called every CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY milliseconds for every engaged creature, which performs radius-based grid searches. This is expensive when there are many creatures in combat. Consider whether this periodic assistance calling is necessary, given thatCallAssistance()is already called inAtEngage()at line 3349.