Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
ZhengPeiRu21
2022-04-26 08:42:57 -06:00
committed by GitHub
7 changed files with 236 additions and 6 deletions

View File

@@ -223,7 +223,7 @@ function inst_simple_restarter {
function inst_download_client_data {
# change the following version when needed
local VERSION=v13
local VERSION=v14
echo "#######################"
echo "Client data downloader"

View File

@@ -0,0 +1,73 @@
-- DB update 2022_04_25_01 -> 2022_04_25_02
DROP PROCEDURE IF EXISTS `updateDb`;
DELIMITER //
CREATE PROCEDURE updateDb ()
proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE';
SELECT COUNT(*) INTO @COLEXISTS
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2022_04_25_01';
IF @COLEXISTS = 0 THEN LEAVE proc; END IF;
START TRANSACTION;
ALTER TABLE version_db_world CHANGE COLUMN 2022_04_25_01 2022_04_25_02 bit;
SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1650555535836713900'; IF OK <> 'FALSE' THEN LEAVE proc; END IF;
--
-- START UPDATING QUERIES
--
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1650555535836713900');
DELETE FROM `player_loot_template` WHERE (`Entry` IN (1, 0)) AND (`Item` IN (43323, 43314, 44809, 43324, 44808, 43322));
INSERT INTO `player_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES
(0, 43323, 0, 100, 1, 1, 0, 5, 5, 'Wintergrasp - Alliance - Quiver of Dragonbone Arrows'),
(1, 43323, 0, 100, 1, 1, 0, 5, 5, 'Wintergrasp - Horde - Quiver of Dragonbone Arrows'),
(0, 43314, 0, 100, 1, 1, 0, 5, 5, 'Wintergrasp - Alliance - Eternal Ember'),
(1, 43314, 0, 100, 1, 1, 0, 5, 5, 'Wintergrasp - Horde - Eternal Ember'),
(0, 44809, 0, 100, 1, 1, 0, 5, 5, 'Wintergrasp - Alliance - Horde Herb Pouch'),
(1, 43324, 0, 100, 1, 1, 0, 5, 5, 'Wintergrasp - Horde - Alliance Herb Pouch'),
(0, 44808, 0, 100, 1, 1, 0, 5, 5, 'Wintergrasp - Alliance - Imbued Horde Armor'),
(1, 43322, 0, 100, 1, 1, 0, 5, 5, 'Wintergrasp - Horde - Enchanted Alliance Breastplates');
DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId` = 28) AND (`SourceGroup` IN (0, 1)) AND (`SourceEntry` IN (43323, 43314, 44809, 43324, 44808, 43322));
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(28, 0, 43323, 0, 0, 23, 0, 4587, 0, 0, 0, 0, 0, '', 'Alliance - Quiver of Dragonbone Arrows - drop in The Forest of Shadows'),
(28, 0, 43323, 0, 0, 47, 0, 13154, 8, 0, 0, 0, 0, '', 'Alliance - Quiver of Dragonbone Arrows - drop while quest 13154 is in progress'),
(28, 0, 43323, 0, 1, 23, 0, 4587, 0, 0, 0, 0, 0, '', 'Alliance - Quiver of Dragonbone Arrows - drop in The Forest of Shadows'),
(28, 0, 43323, 0, 1, 47, 0, 13196, 8, 0, 0, 0, 0, '', 'Alliance - Quiver of Dragonbone Arrows - drop while quest 13196 is in progress'),
(28, 1, 43323, 0, 0, 23, 0, 4587, 0, 0, 0, 0, 0, '', 'Horde - Quiver of Dragonbone Arrows - drop in The Forest of Shadows'),
(28, 1, 43323, 0, 0, 47, 0, 13193, 8, 0, 0, 0, 0, '', 'Horde - Quiver of Dragonbone Arrows - drop while quest 13193 is in progress'),
(28, 1, 43323, 0, 1, 23, 0, 4587, 0, 0, 0, 0, 0, '', 'Horde - Quiver of Dragonbone Arrows - drop in The Forest of Shadows'),
(28, 1, 43323, 0, 1, 47, 0, 13199, 8, 0, 0, 0, 0, '', 'Horde - Quiver of Dragonbone Arrows - drop while quest 13199 is in progress'),
(28, 0, 43314, 0, 0, 23, 0, 4584, 0, 0, 0, 0, 0, '', 'Alliance - Eternal Ember - drop in The Cauldron of Flames'),
(28, 0, 43314, 0, 0, 47, 0, 13197, 8, 0, 0, 0, 0, '', 'Alliance - Eternal Ember - drop while quest 13197 is in progress'),
(28, 0, 43314, 0, 1, 23, 0, 4584, 0, 0, 0, 0, 0, '', 'Alliance - Eternal Ember - drop in The Cauldron of Flames'),
(28, 0, 43314, 0, 1, 47, 0, 236, 8, 0, 0, 0, 0, '', 'Alliance - Eternal Ember - drop while quest 236 is in progress'),
(28, 1, 43314, 0, 0, 23, 0, 4584, 0, 0, 0, 0, 0, '', 'Horde - Eternal Ember - drop in The Cauldron of Flames'),
(28, 1, 43314, 0, 0, 47, 0, 13191, 8, 0, 0, 0, 0, '', 'Horde - Eternal Ember - drop while quest 13191 is in progress'),
(28, 1, 43314, 0, 1, 23, 0, 4584, 0, 0, 0, 0, 0, '', 'Horde - Eternal Ember - drop in The Cauldron of Flames'),
(28, 1, 43314, 0, 1, 47, 0, 13200, 8, 0, 0, 0, 0, '', 'Horde - Eternal Ember - drop while quest 13200 is in progress'),
(28, 0, 44809, 0, 0, 23, 0, 4590, 0, 0, 0, 0, 0, '', 'Alliance - Horde Herb Pouch - drop in The Steppe of Life'),
(28, 0, 44809, 0, 0, 47, 0, 13156, 8, 0, 0, 0, 0, '', 'Alliance - Horde Herb Pouch - drop while quest 13156 is in progress'),
(28, 0, 44809, 0, 1, 23, 0, 4590, 0, 0, 0, 0, 0, '', 'Alliance - Horde Herb Pouch - drop in The Steppe of Life'),
(28, 0, 44809, 0, 1, 47, 0, 13195, 8, 0, 0, 0, 0, '', 'Alliance - Horde Herb Pouch - drop while quest 13195 is in progress'),
(28, 1, 43324, 0, 0, 23, 0, 4590, 0, 0, 0, 0, 0, '', 'Horde - Alliance Herb Pouch - drop in The Steppe of Life'),
(28, 1, 43324, 0, 0, 47, 0, 13194, 8, 0, 0, 0, 0, '', 'Horde - Alliance Herb Pouch - drop while quest 13194 is in progress'),
(28, 1, 43324, 0, 1, 23, 0, 4590, 0, 0, 0, 0, 0, '', 'Horde - Alliance Herb Pouch - drop in The Steppe of Life'),
(28, 1, 43324, 0, 1, 47, 0, 13201, 8, 0, 0, 0, 0, '', 'Horde - Alliance Herb Pouch - drop while quest 13201 is in progress'),
(28, 0, 44808, 0, 0, 23, 0, 4585, 0, 0, 0, 0, 0, '', 'Alliance - Imbued Horde Armor - drop in Glacial Falls'),
(28, 0, 44808, 0, 0, 47, 0, 13198, 8, 0, 0, 0, 0, '', 'Alliance - Imbued Horde Armor - drop while quest 13198 is in progress'),
(28, 0, 44808, 0, 1, 23, 0, 4585, 0, 0, 0, 0, 0, '', 'Alliance - Imbued Horde Armor - drop in Glacial Falls'),
(28, 0, 44808, 0, 1, 47, 0, 13153, 8, 0, 0, 0, 0, '', 'Alliance - Imbued Horde Armor - drop while quest 13153 is in progress'),
(28, 1, 43322, 0, 0, 23, 0, 4585, 0, 0, 0, 0, 0, '', 'Horde - Enchanted Alliance Breastplates - drop in Glacial Falls'),
(28, 1, 43322, 0, 0, 47, 0, 13192, 8, 0, 0, 0, 0, '', 'Horde - Enchanted Alliance Breastplates - drop while quest 13192 is in progress'),
(28, 1, 43322, 0, 1, 23, 0, 4585, 0, 0, 0, 0, 0, '', 'Horde - Enchanted Alliance Breastplates - drop in Glacial Falls'),
(28, 1, 43322, 0, 1, 47, 0, 13202, 8, 0, 0, 0, 0, '', 'Horde - Enchanted Alliance Breastplates - drop while quest 13202 is in progress');
--
-- END UPDATING QUERIES
--
UPDATE version_db_world SET date = '2022_04_25_02' WHERE sql_rev = '1650555535836713900';
COMMIT;
END //
DELIMITER ;
CALL updateDb();
DROP PROCEDURE IF EXISTS `updateDb`;

View File

@@ -0,0 +1,29 @@
-- DB update 2022_04_25_02 -> 2022_04_25_03
DROP PROCEDURE IF EXISTS `updateDb`;
DELIMITER //
CREATE PROCEDURE updateDb ()
proc:BEGIN DECLARE OK VARCHAR(100) DEFAULT 'FALSE';
SELECT COUNT(*) INTO @COLEXISTS
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'version_db_world' AND COLUMN_NAME = '2022_04_25_02';
IF @COLEXISTS = 0 THEN LEAVE proc; END IF;
START TRANSACTION;
ALTER TABLE version_db_world CHANGE COLUMN 2022_04_25_02 2022_04_25_03 bit;
SELECT sql_rev INTO OK FROM version_db_world WHERE sql_rev = '1650789793340379741'; IF OK <> 'FALSE' THEN LEAVE proc; END IF;
--
-- START UPDATING QUERIES
--
INSERT INTO `version_db_world` (`sql_rev`) VALUES ('1650789793340379741');
UPDATE `item_template` SET `spellppmRate_1` = 2 WHERE `entry` = 17076;
--
-- END UPDATING QUERIES
--
UPDATE version_db_world SET date = '2022_04_25_03' WHERE sql_rev = '1650789793340379741';
COMMIT;
END //
DELIMITER ;
CALL updateDb();
DROP PROCEDURE IF EXISTS `updateDb`;

View File

@@ -704,29 +704,60 @@ void BattlefieldWG::OnGameObjectCreate(GameObject* go)
void BattlefieldWG::HandleKill(Player* killer, Unit* victim)
{
if (killer == victim)
{
return;
}
TeamId killerTeam = killer->GetTeamId();
// xinef: tower cannons also grant rank
if (victim->GetTypeId() == TYPEID_PLAYER || IsKeepNpc(victim->GetEntry()) || victim->GetEntry() == NPC_WINTERGRASP_TOWER_CANNON)
{
for (GuidUnorderedSet::const_iterator itr = m_PlayersInWar[killerTeam].begin(); itr != m_PlayersInWar[killerTeam].end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(*itr))
if (victim->GetTypeId() == TYPEID_PLAYER && victim->HasAura(SPELL_LIEUTENANT))
{
// Quest - Wintergrasp - PvP Kill - Horde/Alliance
for (auto& playerGuid : m_PlayersInWar[killerTeam])
{
if (Player* player = ObjectAccessor::FindPlayer(playerGuid))
{
if (player->GetDistance2d(killer) < 40)
{
player->KilledMonsterCredit(killerTeam == TEAM_HORDE ? NPC_QUEST_PVP_KILL_ALLIANCE : NPC_QUEST_PVP_KILL_HORDE);
}
}
}
}
for (auto& playerGuid : m_PlayersInWar[killerTeam])
{
if (Player* player = ObjectAccessor::FindPlayer(playerGuid))
{
if (player->GetDistance2d(killer) < 40)
{
PromotePlayer(player);
}
}
}
// Xinef: Allow to Skin non-released corpse
if (victim->GetTypeId() == TYPEID_PLAYER)
{
victim->SetUnitFlag(UNIT_FLAG_SKINNABLE);
}
}
else if (victim->IsVehicle() && !killer->IsFriendlyTo(victim))
{
// Quest - Wintergrasp - PvP Kill - Vehicle
for (GuidUnorderedSet::const_iterator itr = m_PlayersInWar[killerTeam].begin(); itr != m_PlayersInWar[killerTeam].end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(*itr))
for (auto& playerGuid : m_PlayersInWar[killerTeam])
{
if (Player* player = ObjectAccessor::FindPlayer(playerGuid))
{
if (player->GetDistance2d(killer) < 40)
{
player->KilledMonsterCredit(NPC_QUEST_PVP_KILL_VEHICLE);
}
}
}
}
}

View File

@@ -218,6 +218,8 @@ enum WintergraspNpcs
NPC_QUEST_SOUTHERN_TOWER_KILL = 35074,
NPC_QUEST_VEHICLE_PROTECTED = 31284,
NPC_QUEST_PVP_KILL_VEHICLE = 31093,
NPC_QUEST_PVP_KILL_HORDE = 39019,
NPC_QUEST_PVP_KILL_ALLIANCE = 31086,
};
struct BfWGCoordGY

View File

@@ -2259,8 +2259,12 @@ bool Player::HasQuestForItem(uint32 itemid, uint32 excludeQuestId /* 0 */, bool
// hide quest if player is in raid-group and quest is no raid quest
if (GetGroup() && GetGroup()->isRaidGroup() && !qinfo->IsAllowedInRaid(GetMap()->GetDifficulty()))
if (!InBattleground()) //there are two ways.. we can make every bg-quest a raidquest, or add this code here.. i don't know if this can be exploited by other quests, but i think all other quests depend on a specific area.. but keep this in mind, if something strange happens later
{
if (!InBattleground() && !GetGroup()->isBFGroup()) //there are two ways.. we can make every bg-quest a raidquest, or add this code here.. i don't know if this can be exploited by other quests, but i think all other quests depend on a specific area.. but keep this in mind, if something strange happens later
{
continue;
}
}
// There should be no mixed ReqItem/ReqSource drop
// This part for ReqItem drop

View File

@@ -403,11 +403,20 @@ public:
bool OnGossipHello(Player* player, Creature* creature) override
{
if (creature->IsQuestGiver())
{
player->PrepareQuestMenu(creature->GetGUID());
}
if (creature->IsVendor())
{
AddGossipItemFor(player, GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
}
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
if (!wintergrasp)
{
return true;
}
if (creature->IsQuestGiver())
{
@@ -583,6 +592,8 @@ public:
QuestRelationBounds qir = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(creature->GetEntry());
QuestGiverStatus result = DIALOG_STATUS_NONE;
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
for (QuestRelations::const_iterator i = qir.first; i != qir.second; ++i)
{
QuestGiverStatus result2 = DIALOG_STATUS_NONE;
@@ -659,6 +670,73 @@ public:
break;
}
if (wintergrasp)
{
// Certain quests are only available when attacking / defending
bool hasCorrectZoneControl = false;
switch (questId)
{
// Horde attacker
case QUEST_BONES_AND_ARROWS_HORDE_ATT:
case QUEST_JINXING_THE_WALLS_HORDE_ATT:
case QUEST_SLAY_THEM_ALL_HORDE_ATT:
case QUEST_FUELING_THE_DEMOLISHERS_HORDE_ATT:
case QUEST_HEALING_WITH_ROSES_HORDE_ATT:
case QUEST_DEFEND_THE_SIEGE_HORDE_ATT:
if (wintergrasp->GetAttackerTeam() == TEAM_HORDE)
{
hasCorrectZoneControl = true;
}
break;
// Horde defender
case QUEST_BONES_AND_ARROWS_HORDE_DEF:
case QUEST_WARDING_THE_WALLS_HORDE_DEF:
case QUEST_SLAY_THEM_ALL_HORDE_DEF:
case QUEST_FUELING_THE_DEMOLISHERS_HORDE_DEF:
case QUEST_HEALING_WITH_ROSES_HORDE_DEF:
case QUEST_TOPPLING_THE_TOWERS_HORDE_DEF:
case QUEST_STOP_THE_SIEGE_HORDE_DEF:
if (wintergrasp->GetDefenderTeam() == TEAM_HORDE)
{
hasCorrectZoneControl = true;
}
break;
// Alliance attacker
case QUEST_BONES_AND_ARROWS_ALLIANCE_ATT:
case QUEST_WARDING_THE_WARRIORS_ALLIANCE_ATT:
case QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_ATT:
case QUEST_DEFEND_THE_SIEGE_ALLIANCE_ATT:
case QUEST_A_RARE_HERB_ALLIANCE_ATT:
case QUEST_FUELING_THE_DEMOLISHERS_ALLIANCE_ATT:
if (wintergrasp->GetAttackerTeam() == TEAM_ALLIANCE)
{
hasCorrectZoneControl = true;
}
break;
// Alliance defender
case QUEST_BONES_AND_ARROWS_ALLIANCE_DEF:
case QUEST_WARDING_THE_WARRIORS_ALLIANCE_DEF:
case QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_DEF:
case QUEST_SHOUTHERN_SABOTAGE_ALLIANCE_DEF:
case QUEST_STOP_THE_SIEGE_ALLIANCE_DEF:
case QUEST_A_RARE_HERB_ALLIANCE_DEF:
case QUEST_FUELING_THE_DEMOLISHERS_ALLIANCE_DEF:
if (wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE)
{
hasCorrectZoneControl = true;
}
break;
default:
hasCorrectZoneControl = true;
break;
}
if (!hasCorrectZoneControl)
{
continue;
}
}
QuestStatus status = player->GetQuestStatus(questId);
if (status == QUEST_STATUS_NONE)
{
@@ -689,6 +767,19 @@ public:
return result;
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{
ClearGossipMenuFor(player);
switch (action)
{
case GOSSIP_ACTION_TRADE:
player->GetSession()->SendListInventory(creature->GetGUID());
break;
}
return true;
}
};
class npc_wg_siege_machine : public CreatureScript