Skip to content
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

Update native branch #2763

Merged
merged 9 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions sql/migrations/20240828201652_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
DROP PROCEDURE IF EXISTS add_migration;
DELIMITER ??
CREATE PROCEDURE `add_migration`()
BEGIN
DECLARE v INT DEFAULT 1;
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20240828201652');
IF v = 0 THEN
INSERT INTO `migrations` VALUES ('20240828201652');
-- Add your query below.


-- Fix gossip of Xizk Goodstitch.
DELETE FROM `gossip_menu` WHERE `entry`=2685;
INSERT INTO `gossip_menu` (`entry`, `text_id`, `script_id`, `condition_id`) VALUES (2685, 3357, 0, 0);
INSERT INTO `gossip_menu` (`entry`, `text_id`, `script_id`, `condition_id`) VALUES (2685, 3358, 0, 67);


-- End of migration.
END IF;
END??
DELIMITER ;
CALL add_migration();
DROP PROCEDURE IF EXISTS add_migration;
25 changes: 25 additions & 0 deletions sql/migrations/20240914160609_world.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
DROP PROCEDURE IF EXISTS add_migration;
DELIMITER ??
CREATE PROCEDURE `add_migration`()
BEGIN
DECLARE v INT DEFAULT 1;
SET v = (SELECT COUNT(*) FROM `migrations` WHERE `id`='20240914160609');
IF v = 0 THEN
INSERT INTO `migrations` VALUES ('20240914160609');
-- Add your query below.


-- Add missing spawns for creature Longsnout.
INSERT INTO `creature` (`guid`, `id`, `id2`, `id3`, `id4`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecsmin`, `spawntimesecsmax`, `wander_distance`, `health_percent`, `mana_percent`, `movement_type`, `spawn_flags`, `visibility_mod`) VALUES (113, 119, 0, 0, 0, 0, -9788.9, 646.32, 35.616, 0.376152, 120, 120, 15, 100, 100, 1, 0, 0);
INSERT INTO `creature` (`guid`, `id`, `id2`, `id3`, `id4`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecsmin`, `spawntimesecsmax`, `wander_distance`, `health_percent`, `mana_percent`, `movement_type`, `spawn_flags`, `visibility_mod`) VALUES (189, 119, 0, 0, 0, 0, -9848.83, 648.454, 39.7502, 2.28436, 120, 120, 15, 100, 100, 1, 0, 0);
INSERT INTO `creature` (`guid`, `id`, `id2`, `id3`, `id4`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecsmin`, `spawntimesecsmax`, `wander_distance`, `health_percent`, `mana_percent`, `movement_type`, `spawn_flags`, `visibility_mod`) VALUES (190, 119, 0, 0, 0, 0, -9876.36, 688.972, 35.3996, 5.31748, 120, 120, 15, 100, 100, 1, 0, 0);
INSERT INTO `creature` (`guid`, `id`, `id2`, `id3`, `id4`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecsmin`, `spawntimesecsmax`, `wander_distance`, `health_percent`, `mana_percent`, `movement_type`, `spawn_flags`, `visibility_mod`) VALUES (703, 119, 0, 0, 0, 0, -9932.71, 660.869, 32.7262, 5.23372, 120, 120, 15, 100, 100, 1, 0, 0);
INSERT INTO `creature` (`guid`, `id`, `id2`, `id3`, `id4`, `map`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecsmin`, `spawntimesecsmax`, `wander_distance`, `health_percent`, `mana_percent`, `movement_type`, `spawn_flags`, `visibility_mod`) VALUES (1448, 119, 0, 0, 0, 0, -9957.65, 675.479, 32.483, 3.74679, 120, 120, 15, 100, 100, 1, 0, 0);


-- End of migration.
END IF;
END??
DELIMITER ;
CALL add_migration();
DROP PROCEDURE IF EXISTS add_migration;
4 changes: 2 additions & 2 deletions src/game/Commands/DebugCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ bool ChatHandler::HandleSpellInfosCommand(char *args)
PSendSysMessage("MaxTargetLevel%u:DmgClass%u:rangeIndex%u", pSpell->MaxTargetLevel, pSpell->DmgClass, pSpell->rangeIndex);
PSendSysMessage("procChance%u:procFlags0x%x:procCharges%u", pSpell->procChance, pSpell->procFlags, pSpell->procCharges);
PSendSysMessage("InterruptFlags0x%x:AuraInterruptFlags0x%x:PreventionType%x:spellLevel%u", pSpell->InterruptFlags, pSpell->AuraInterruptFlags, pSpell->PreventionType, pSpell->spellLevel);
PSendSysMessage("SpellSpecific%u:Binaire%s:spellPriority%u:Positive%u", Spells::GetSpellSpecific(pSpell->Id), pSpell->IsBinary() ? "OUI" : "NON", pSpell->spellPriority, pSpell->IsPositiveSpell());
PSendSysMessage("RecoveryTime%u:CategoryRecoveryTime%u:PvEHeartBeat%s", pSpell->RecoveryTime, pSpell->CategoryRecoveryTime, pSpell->IsPvEHeartBeat() ? "OUI" : "NON");
PSendSysMessage("SpellSpecific%u:Binaire%s:spellPriority%u:Positive%u", Spells::GetSpellSpecific(pSpell->Id), pSpell->IsBinary() ? "YES" : "NO", pSpell->spellPriority, pSpell->IsPositiveSpell());
PSendSysMessage("RecoveryTime%u:CategoryRecoveryTime%u:PvEHeartBeat%s", pSpell->RecoveryTime, pSpell->CategoryRecoveryTime, pSpell->IsPvEHeartBeat() ? "YES" : "NO");
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions src/game/Commands/ServerCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,8 @@ bool ChatHandler::HandleWorldTestCommand(char *args)
return false;
}
PSendSysMessage("My worldmask is 0x%x. My target worldmask is 0x%x.", me->GetWorldMask(), target->GetWorldMask());
PSendSysMessage("I see the target ? %s", me->CanSeeInWorld(target) ? "oui" : "non");
PSendSysMessage("My target sees me ? %s", target->CanSeeInWorld(me) ? "oui" : "non");
PSendSysMessage("I see the target ? %s", me->CanSeeInWorld(target) ? "yes" : "no");
PSendSysMessage("My target sees me ? %s", target->CanSeeInWorld(me) ? "yes" : "no");
return true;
}

Expand Down
39 changes: 31 additions & 8 deletions src/game/Group/Group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ bool Group::Create(ObjectGuid guid, char const* name)
Player::ConvertInstancesToGroup(leader, this, guid);

// store group in database
CharacterDatabase.BeginTransaction();
CharacterDatabase.BeginTransaction(m_Id);
CharacterDatabase.PExecute("DELETE FROM `groups` WHERE `group_id` ='%u'", m_Id);
CharacterDatabase.PExecute("DELETE FROM `group_member` WHERE `group_id` ='%u'", m_Id);

Expand All @@ -154,14 +154,12 @@ bool Group::Create(ObjectGuid guid, char const* name)
m_targetIcons[4].GetRawValue(), m_targetIcons[5].GetRawValue(),
m_targetIcons[6].GetRawValue(), m_targetIcons[7].GetRawValue(),
isRaidGroup());
CharacterDatabase.CommitTransaction();
}

if (!AddMember(guid, name))
return false;

if (!isBGGroup())
CharacterDatabase.CommitTransaction();

_updateLeaderFlag();

return true;
Expand Down Expand Up @@ -622,7 +620,7 @@ void Group::Disband(bool hideDestroy, ObjectGuid initiator)

if (!isBGGroup())
{
CharacterDatabase.BeginTransaction();
CharacterDatabase.BeginTransaction(m_Id);
CharacterDatabase.PExecute("DELETE FROM `groups` WHERE `group_id`='%u'", m_Id);
CharacterDatabase.PExecute("DELETE FROM `group_member` WHERE `group_id`='%u'", m_Id);
CharacterDatabase.CommitTransaction();
Expand Down Expand Up @@ -1584,8 +1582,11 @@ bool Group::_addMember(ObjectGuid guid, char const* name, bool isAssistant, uint
if (!isBGGroup() && !(player && player->IsSavingDisabled()))
{
// insert into group table
CharacterDatabase.BeginTransaction(m_Id);
CharacterDatabase.PExecute("INSERT INTO `group_member` (`group_id`, `member_guid`, `assistant`, `subgroup`) VALUES('%u','%u','%u','%u')",
m_Id, member.guid.GetCounter(), ((member.assistant == 1) ? 1 : 0), member.group);
CharacterDatabase.CommitTransaction();

}

return true;
Expand Down Expand Up @@ -1620,7 +1621,11 @@ bool Group::_removeMember(ObjectGuid guid)
}

if (!isBGGroup())
{
CharacterDatabase.BeginTransaction(m_Id);
CharacterDatabase.PExecute("DELETE FROM `group_member` WHERE `member_guid`='%u'", guid.GetCounter());
CharacterDatabase.CommitTransaction();
}

if (m_leaderGuid == guid) // leader was removed
{
Expand Down Expand Up @@ -1690,7 +1695,7 @@ void Group::_setLeader(ObjectGuid guid)
uint32 leader_lowguid = m_leaderGuid.GetCounter();

// TODO: set a time limit to have this function run rarely cause it can be slow
CharacterDatabase.BeginTransaction();
CharacterDatabase.BeginTransaction(m_Id);

// update the group's bound instances when changing leaders

Expand Down Expand Up @@ -1791,8 +1796,10 @@ bool Group::_swapMembersGroup(ObjectGuid guid, ObjectGuid swapGuid)
// Don't need to change group counters since we are swapping
if (!isBGGroup())
{
CharacterDatabase.BeginTransaction(m_Id);
CharacterDatabase.PExecute("UPDATE `group_member` SET `subgroup`='%u' WHERE `member_guid`='%u'", slot->group, guid.GetCounter());
CharacterDatabase.PExecute("UPDATE `group_member` SET `subgroup`='%u' WHERE `member_guid`='%u'", swapSlot->group, swapGuid.GetCounter());
CharacterDatabase.CommitTransaction();
}

return true;
Expand All @@ -1809,7 +1816,11 @@ bool Group::_setMembersGroup(ObjectGuid guid, uint8 group)
SubGroupCounterIncrease(group);

if (!isBGGroup())
{
CharacterDatabase.BeginTransaction(m_Id);
CharacterDatabase.PExecute("UPDATE `group_member` SET `subgroup`='%u' WHERE `member_guid`='%u'", group, guid.GetCounter());
CharacterDatabase.CommitTransaction();
}

return true;
}
Expand All @@ -1822,7 +1833,12 @@ bool Group::_setAssistantFlag(ObjectGuid guid, bool const& state)

slot->assistant = state;
if (!isBGGroup())
{
CharacterDatabase.BeginTransaction(m_Id);
CharacterDatabase.PExecute("UPDATE `group_member` SET `assistant`='%u' WHERE `member_guid`='%u'", (state) ? 1 : 0, guid.GetCounter());
CharacterDatabase.CommitTransaction();
}

return true;
}

Expand All @@ -1844,7 +1860,11 @@ bool Group::_setMainTank(ObjectGuid guid)
m_mainTankGuid = guid;

if (!isBGGroup())
{
CharacterDatabase.BeginTransaction(m_Id);
CharacterDatabase.PExecute("UPDATE `groups` SET `main_tank_guid`='%u' WHERE `group_id`='%u'", m_mainTankGuid.GetCounter(), m_Id);
CharacterDatabase.CommitTransaction();
}

return true;
}
Expand All @@ -1867,8 +1887,11 @@ bool Group::_setMainAssistant(ObjectGuid guid)
m_mainAssistantGuid = guid;

if (!isBGGroup())
CharacterDatabase.PExecute("UPDATE `groups` SET `main_assistant_guid`='%u' WHERE `group_id`='%u'",
m_mainAssistantGuid.GetCounter(), m_Id);
{
CharacterDatabase.BeginTransaction(m_Id);
CharacterDatabase.PExecute("UPDATE `groups` SET `main_assistant_guid`='%u' WHERE `group_id`='%u'", m_mainAssistantGuid.GetCounter(), m_Id);
CharacterDatabase.CommitTransaction();
}

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/game/Handlers/GroupHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recv_data)

Player* player = HashMapHolder<Player>::Find(guid);

if (!player || player->GetGroup() != _player->GetGroup())
if (!player || !player->IsInSameRaidWith(_player))
{
WorldPacket data(SMSG_PARTY_MEMBER_STATS_FULL, 3 + 4 + 1);
data << guid.WriteAsPacked();
Expand Down
2 changes: 1 addition & 1 deletion src/game/Movement/TargetedMovementGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void TargetedMovementGeneratorMedium<T, D>::_setTargetLocation(T &owner)
// prevent redundant micro-movement for pets, other followers.
else if (!i_target->IsMoving() && owner.movespline->Finalized() && i_target->IsWithinDistInMap(&owner, 1.4f * m_fOffset))
{
owner.GetPosition(x, y, z);
return;
}
else
{
Expand Down
5 changes: 2 additions & 3 deletions src/game/Objects/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10331,8 +10331,10 @@ InventoryResult Player::CanUnequipItem(uint16 pos, bool swap) const
return EQUIP_ERR_ALREADY_LOOTED;

// you cannot unequip main hand weapon while disarmed
#if SUPPORTED_CLIENT_BUILD > CLIENT_BUILD_1_6_1
if (IsMainHandPos(pos) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISARMED))
return EQUIP_ERR_NOT_WHILE_DISARMED;
#endif

// do not allow unequipping gear except weapons, offhands, projectiles, relics in combat
if (!pProto->CanChangeEquipStateInCombat())
Expand Down Expand Up @@ -20293,9 +20295,6 @@ uint32 Player::SelectResurrectionSpellId() const
case 20765:
spellId = 20761;
break; // rank 5
case 27239:
spellId = 27240;
break; // rank 6
default:
sLog.Out(LOG_BASIC, LOG_LVL_ERROR, "Unhandled spell %u: S.Resurrection", dummyAura->GetId());
continue;
Expand Down
6 changes: 6 additions & 0 deletions src/game/Spells/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1747,6 +1747,12 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
}
return;
}
case 11920: // Net Guard
{
if (Creature* pCaster = ToCreature(GetCaster()))
pCaster->GetThreatManager().modifyThreatPercent(target, -50);
return;
}
case 12623: // Suppression
{
if (Creature* pCreature = target->ToCreature())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ struct boss_razorgoreAI : public ScriptedAI

void GetAIInformation(ChatHandler& handler) override
{
handler.PSendSysMessage("* CombatMovement : %s", IsCombatMovementEnabled() ? "OUI" : "NON");
handler.PSendSysMessage("* CombatMovement : %s", IsCombatMovementEnabled() ? "YES" : "NO");
}
};

Expand Down