Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/mangos-wotlk/server
Browse files Browse the repository at this point in the history
  • Loading branch information
blueboy committed Sep 21, 2012
2 parents cde8934 + d8b0c2a commit ebae824
Show file tree
Hide file tree
Showing 146 changed files with 4,066 additions and 2,555 deletions.
290 changes: 167 additions & 123 deletions doc/EventAI.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions doc/script_commands.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -236,11 +236,11 @@ Where "A -> B" means that the command is executed from A with B as target.


23 SCRIPT_COMMAND_MORPH_TO_ENTRY_OR_MODEL resultingSource = Creature 23 SCRIPT_COMMAND_MORPH_TO_ENTRY_OR_MODEL resultingSource = Creature
* datalong=creature entry/modelid (depend on data_flags) OR 0 to demorph * datalong=creature entry/modelid (depend on data_flags) OR 0 to demorph
* data_flags= 0x01 to use datalong value as modelid explicit * data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL: use datalong value as modelid explicit


24 SCRIPT_COMMAND_MOUNT_TO_ENTRY_OR_MODEL resultingSource = Creature 24 SCRIPT_COMMAND_MOUNT_TO_ENTRY_OR_MODEL resultingSource = Creature
* datalong=creature entry/modelid (depend on data_flags) OR 0 to dismount * datalong=creature entry/modelid (depend on data_flags) OR 0 to dismount
* data_flags= 0x01 to use datalong value as modelid explicit * data_flags & SCRIPT_FLAG_COMMAND_ADDITIONAL: use datalong value as modelid explicit


25 SCRIPT_COMMAND_SET_RUN resultingSource = Creature 25 SCRIPT_COMMAND_SET_RUN resultingSource = Creature
* datalong= bool 0=off, 1=on * datalong= bool 0=off, 1=on
Expand Down
41 changes: 25 additions & 16 deletions sql/mangos.sql
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
`version` varchar(120) default NULL, `version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL,
`cache_id` int(10) default '0', `cache_id` int(10) default '0',
`required_12097_01_mangos_mangos_string` bit(1) default NULL `required_12148_02_mangos_mangos_string` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';


-- --
Expand Down Expand Up @@ -141,7 +141,6 @@ CREATE TABLE `areatrigger_teleport` (
`heroic_key2` mediumint(8) unsigned NOT NULL default '0', `heroic_key2` mediumint(8) unsigned NOT NULL default '0',
`required_quest_done` int(11) unsigned NOT NULL default '0', `required_quest_done` int(11) unsigned NOT NULL default '0',
`required_quest_done_heroic` int(11) unsigned NOT NULL default '0', `required_quest_done_heroic` int(11) unsigned NOT NULL default '0',
`required_failed_text` text,
`target_map` smallint(5) unsigned NOT NULL default '0', `target_map` smallint(5) unsigned NOT NULL default '0',
`target_position_x` float NOT NULL default '0', `target_position_x` float NOT NULL default '0',
`target_position_y` float NOT NULL default '0', `target_position_y` float NOT NULL default '0',
Expand Down Expand Up @@ -3932,6 +3931,7 @@ INSERT INTO `mangos_string` VALUES
(815,'Initiate',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (815,'Initiate',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(816,'Your body is too exhausted to travel to the Spectral Realm.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (816,'Your body is too exhausted to travel to the Spectral Realm.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(817,'Warning: You\'ve entered a no-fly zone and are about to be dismounted!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (817,'Warning: You\'ve entered a no-fly zone and are about to be dismounted!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(818,'You can\'t enter Black Morass until you rescue Thrall from Durnholde Keep.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1000,'Exiting daemon...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (1000,'Exiting daemon...',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1001,'Account deleted: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (1001,'Account deleted: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
(1002,'Account %s NOT deleted (probably sql file format was updated)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), (1002,'Account %s NOT deleted (probably sql file format was updated)',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL),
Expand Down Expand Up @@ -18040,6 +18040,7 @@ CREATE TABLE `spell_template` (
`effect0_radius_idx` int(11) unsigned NOT NULL DEFAULT '0', `effect0_radius_idx` int(11) unsigned NOT NULL DEFAULT '0',
`effect0_apply_aura_name` int(11) unsigned NOT NULL DEFAULT '0', `effect0_apply_aura_name` int(11) unsigned NOT NULL DEFAULT '0',
`effect0_misc_value` int(11) unsigned NOT NULL DEFAULT '0', `effect0_misc_value` int(11) unsigned NOT NULL DEFAULT '0',
`effect0_misc_value_b` int(11) unsigned NOT NULL DEFAULT '0',
`effect0_trigger_spell` int(11) unsigned NOT NULL DEFAULT '0', `effect0_trigger_spell` int(11) unsigned NOT NULL DEFAULT '0',
`comments` varchar(255) NOT NULL, `comments` varchar(255) NOT NULL,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
Expand All @@ -18051,20 +18052,28 @@ CREATE TABLE `spell_template` (
LOCK TABLES `spell_template` WRITE; LOCK TABLES `spell_template` WRITE;
/*!40000 ALTER TABLE `spell_template` DISABLE KEYS */; /*!40000 ALTER TABLE `spell_template` DISABLE KEYS */;
INSERT INTO `spell_template` VALUES INSERT INTO `spell_template` VALUES
-- ID proc_flags chnce dur ef0 tarA0 rad aur misc trigger -- id proc_flags chnce dur ef0 tarA0 rad aur misc miscB, trigger
(21387, 0x00000028, 15, 21, 6, 1, 0, 42, 0, 21388, 'Melt-Weapon trigger aura related used by Ragnaros'), (21387, 0x00000028, 15, 21, 6, 1, 0, 42, 0, 0, 21388, 'Melt-Weapon trigger aura related used by Ragnaros'),
(23363, 0x00000000, 101, 21, 76, 18, 0, 0, 179804, 0, 'Summon Drakonid Corpse Trigger'), (23363, 0x00000000, 101, 21, 76, 18, 0, 0, 179804, 0, 0, 'Summon Drakonid Corpse Trigger'),
(25192, 0x00000000, 101, 21, 76, 18, 0, 0, 180619, 0, 'Summon Ossirian Crystal'), (25192, 0x00000000, 101, 21, 76, 18, 0, 0, 180619, 0, 0, 'Summon Ossirian Crystal'),
(26133, 0x00000000, 101, 21, 76, 18, 0, 0, 180795, 0, 'Summon Sandworm Base'), (26133, 0x00000000, 101, 21, 76, 18, 0, 0, 180795, 0, 0, 'Summon Sandworm Base'),
(44920, 0x00000000, 101, 21, 6, 1, 0, 56, 24941, 0, 'Model - Shattered Sun Marksman - BE Male Tier 4'), (34810, 0x00000000, 101, 21, 28, 42, 8, 0, 20083, 64, 0, 'Summon Summoned Bloodwarder Mender behind of the caster'),
(44924, 0x00000000, 101, 21, 6, 1, 0, 56, 24945, 0, 'Model - Shattered Sun Marksman - BE Female Tier 4'), (34817, 0x00000000, 101, 21, 28, 44, 8, 0, 20078, 64, 0, 'Summon Summoned Bloodwarder Reservist right of the caster'),
(44928, 0x00000000, 101, 21, 6, 1, 0, 56, 24949, 0, 'Model - Shattered Sun Marksman - Draenei Male Tier 4'), (34818, 0x00000000, 101, 21, 28, 43, 8, 0, 20078, 64, 0, 'Summon Summoned Bloodwarder Reservist left of the caster'),
(44932, 0x00000000, 101, 21, 6, 1, 0, 56, 24953, 0, 'Model - Shattered Sun Marksman - Draenei Female Tier 4'), (34819, 0x00000000, 101, 21, 28, 41, 8, 0, 20078, 64, 0, 'Summon Summoned Bloodwarder Reservist front of the caster'),
(45158, 0x00000000, 101, 21, 6, 1, 0, 56, 25119, 0, 'Model - Shattered Sun Warrior - BE Female Tier 4'), (35153, 0x00000000, 101, 21, 28, 42, 8, 0, 20405, 64, 0, 'Summon Nether Charge behind of the caster'),
(45162, 0x00000000, 101, 21, 6, 1, 0, 56, 25123, 0, 'Model - Shattered Sun Warrior - BE Male Tier 4'), (35904, 0x00000000, 101, 21, 28, 44, 8, 0, 20405, 64, 0, 'Summon Nether Charge right of the caster'),
(45166, 0x00000000, 101, 21, 6, 1, 0, 56, 25127, 0, 'Model - Shattered Sun Warrior - Draenei Female Tier 4'), (35905, 0x00000000, 101, 21, 28, 43, 8, 0, 20405, 64, 0, 'Summon Nether Charge left of the caster'),
(45170, 0x00000000, 101, 21, 6, 1, 0, 56, 25131, 0, 'Model - Shattered Sun Warrior - Draenei Male Tier 4'), (35906, 0x00000000, 101, 21, 28, 41, 8, 0, 20405, 64, 0, 'Summon Nether Charge front of the caster'),
(62388, 0x00000000, 101, 21, 6, 1, 0, 4, 0, 0, 'Aura required for Demonic Circle 48020'); (44920, 0x00000000, 101, 21, 6, 1, 0, 56, 24941, 0, 0, 'Model - Shattered Sun Marksman - BE Male Tier 4'),
(44924, 0x00000000, 101, 21, 6, 1, 0, 56, 24945, 0, 0, 'Model - Shattered Sun Marksman - BE Female Tier 4'),
(44928, 0x00000000, 101, 21, 6, 1, 0, 56, 24949, 0, 0, 'Model - Shattered Sun Marksman - Draenei Male Tier 4'),
(44932, 0x00000000, 101, 21, 6, 1, 0, 56, 24953, 0, 0, 'Model - Shattered Sun Marksman - Draenei Female Tier 4'),
(45158, 0x00000000, 101, 21, 6, 1, 0, 56, 25119, 0, 0, 'Model - Shattered Sun Warrior - BE Female Tier 4'),
(45162, 0x00000000, 101, 21, 6, 1, 0, 56, 25123, 0, 0, 'Model - Shattered Sun Warrior - BE Male Tier 4'),
(45166, 0x00000000, 101, 21, 6, 1, 0, 56, 25127, 0, 0, 'Model - Shattered Sun Warrior - Draenei Female Tier 4'),
(45170, 0x00000000, 101, 21, 6, 1, 0, 56, 25131, 0, 0, 'Model - Shattered Sun Warrior - Draenei Male Tier 4'),
(62388, 0x00000000, 101, 21, 6, 1, 0, 4, 0, 0, 0, 'Aura required for Demonic Circle 48020');
/*!40000 ALTER TABLE `spell_template` ENABLE KEYS */; /*!40000 ALTER TABLE `spell_template` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;


Expand Down
3 changes: 3 additions & 0 deletions sql/updates/12112_01_mangos_spell_template.sql
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE db_version CHANGE COLUMN required_12097_01_mangos_mangos_string required_12112_01_mangos_spell_template bit;

ALTER TABLE spell_template ADD COLUMN effect0_misc_value_b int(11) unsigned NOT NULL DEFAULT '0' AFTER effect0_misc_value;
12 changes: 12 additions & 0 deletions sql/updates/12113_01_mangos_spell_template.sql
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,12 @@
ALTER TABLE db_version CHANGE COLUMN required_12112_01_mangos_spell_template required_12113_01_mangos_spell_template bit;

DELETE FROM spell_template WHERE id IN (34810, 34817, 34818, 34819, 35153, 35904, 35905, 35906);
INSERT INTO spell_template VALUES
(34810, 0x00000000, 101, 21, 28, 42, 8, 0, 20083, 64, 0, 'Summon Summoned Bloodwarder Mender behind of the caster'),
(34817, 0x00000000, 101, 21, 28, 44, 8, 0, 20078, 64, 0, 'Summon Summoned Bloodwarder Reservist right of the caster'),
(34818, 0x00000000, 101, 21, 28, 43, 8, 0, 20078, 64, 0, 'Summon Summoned Bloodwarder Reservist left of the caster'),
(34819, 0x00000000, 101, 21, 28, 41, 8, 0, 20078, 64, 0, 'Summon Summoned Bloodwarder Reservist front of the caster'),
(35153, 0x00000000, 101, 21, 28, 42, 8, 0, 20405, 64, 0, 'Summon Nether Charge behind of the caster'),
(35904, 0x00000000, 101, 21, 28, 44, 8, 0, 20405, 64, 0, 'Summon Nether Charge right of the caster'),
(35905, 0x00000000, 101, 21, 28, 43, 8, 0, 20405, 64, 0, 'Summon Nether Charge left of the caster'),
(35906, 0x00000000, 101, 21, 28, 41, 8, 0, 20405, 64, 0, 'Summon Nether Charge front of the caster');
3 changes: 3 additions & 0 deletions sql/updates/12148_01_mangos_areatrigger_teleport.sql
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE db_version CHANGE COLUMN required_12113_01_mangos_spell_template required_12148_01_mangos_areatrigger_teleport bit;

ALTER TABLE areatrigger_teleport DROP COLUMN required_failed_text;
5 changes: 5 additions & 0 deletions sql/updates/12148_02_mangos_mangos_string.sql
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE db_version CHANGE COLUMN required_12148_01_mangos_areatrigger_teleport required_12148_02_mangos_mangos_string bit;

DELETE FROM mangos_string WHERE entry=818;
INSERT INTO mangos_string VALUES
(818,'You can\'t enter Black Morass until you rescue Thrall from Durnholde Keep.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL);
10 changes: 5 additions & 5 deletions src/game/AchievementMgr.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
#include "CellImpl.h" #include "CellImpl.h"
#include "Language.h" #include "Language.h"
#include "MapManager.h" #include "MapManager.h"
#include "BattleGround.h" #include "BattleGround/BattleGround.h"
#include "BattleGroundAB.h" #include "BattleGround/BattleGroundAB.h"
#include "Map.h" #include "Map.h"
#include "InstanceData.h" #include "InstanceData.h"
#include "DBCStructure.h" #include "DBCStructure.h"
Expand Down Expand Up @@ -922,7 +922,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
case 156: // AB, win while controlling all 5 flags (all nodes) case 156: // AB, win while controlling all 5 flags (all nodes)
case 784: // EY, win while holding 4 bases (all nodes) case 784: // EY, win while holding 4 bases (all nodes)
{ {
if (!bg->IsAllNodesConrolledByTeam(GetPlayer()->GetTeam())) if (!bg->IsAllNodesControlledByTeam(GetPlayer()->GetTeam()))
continue; continue;
break; break;
} }
Expand Down Expand Up @@ -2556,7 +2556,7 @@ void AchievementGlobalMgr::LoadCompletedAchievements()
delete result; delete result;


sLog.outString(); sLog.outString();
sLog.outString(">> Loaded %lu realm completed achievements.", (unsigned long)m_allCompletedAchievements.size()); sLog.outString(">> Loaded " SIZEFMTD " realm completed achievements.", m_allCompletedAchievements.size());
} }


void AchievementGlobalMgr::LoadRewards() void AchievementGlobalMgr::LoadRewards()
Expand Down Expand Up @@ -2783,5 +2783,5 @@ void AchievementGlobalMgr::LoadRewardLocales()
delete result; delete result;


sLog.outString(); sLog.outString();
sLog.outString(">> Loaded %lu achievement reward locale strings", (unsigned long)m_achievementRewardLocales.size()); sLog.outString(">> Loaded " SIZEFMTD " achievement reward locale strings", m_achievementRewardLocales.size());
} }
6 changes: 3 additions & 3 deletions src/game/AuctionHouseBot/AuctionHouseBot.cpp
Original file line number Original file line Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "AuctionHouseBot.h" #include "AuctionHouseBot.h"
#include "ProgressBar.h" #include "ProgressBar.h"
#include "Log.h" #include "Log.h"
#include "../ObjectMgr.h" #include "ObjectMgr.h"
#include "../AuctionHouseMgr.h" #include "AuctionHouseMgr.h"
#include "SystemConfig.h" #include "SystemConfig.h"
#include "../SQLStorages.h" #include "SQLStorages.h"


// Format is YYYYMMDDRR where RR is the change in the conf file // Format is YYYYMMDDRR where RR is the change in the conf file
// for that day. // for that day.
Expand Down
8 changes: 4 additions & 4 deletions src/game/AuctionHouseBot/AuctionHouseBot.h
Original file line number Original file line Diff line number Diff line change
@@ -1,11 +1,11 @@
#ifndef AUCTION_HOUSE_BOT_H #ifndef AUCTION_HOUSE_BOT_H
#define AUCTION_HOUSE_BOT_H #define AUCTION_HOUSE_BOT_H


#include "../World.h" #include "World.h"
#include "Config/Config.h" #include "Config/Config.h"
#include "../AuctionHouseMgr.h" #include "AuctionHouseMgr.h"
#include "../SharedDefines.h" #include "SharedDefines.h"
#include "../Item.h" #include "Item.h"


// shadow of ItemQualities with skipped ITEM_QUALITY_HEIRLOOM, anything after ITEM_QUALITY_ARTIFACT(6) in fact // shadow of ItemQualities with skipped ITEM_QUALITY_HEIRLOOM, anything after ITEM_QUALITY_ARTIFACT(6) in fact
enum AuctionQuality enum AuctionQuality
Expand Down
1 change: 1 addition & 0 deletions src/game/AuctionHouseMgr.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ AuctionHouseEntry const* AuctionHouseMgr::GetAuctionHouseEntry(Unit* unit)
{ {
case ALLIANCE: houseid = player->GetAuctionAccessMode() == 0 ? 1 : 6; break; case ALLIANCE: houseid = player->GetAuctionAccessMode() == 0 ? 1 : 6; break;
case HORDE: houseid = player->GetAuctionAccessMode() == 0 ? 6 : 1; break; case HORDE: houseid = player->GetAuctionAccessMode() == 0 ? 6 : 1; break;
default: break;
} }
} }
} }
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace MaNGOS
data << ObjectGuid(targetGuid); data << ObjectGuid(targetGuid);
data << uint32(strlen(text) + 1); data << uint32(strlen(text) + 1);
data << text; data << text;
data << uint8(i_source ? i_source->GetChatTag() : CHAT_TAG_NONE); data << uint8(i_source ? i_source->GetChatTag() : uint8(CHAT_TAG_NONE));
} }


ChatMsg i_msgtype; ChatMsg i_msgtype;
Expand Down Expand Up @@ -152,7 +152,7 @@ namespace MaNGOS
data << ObjectGuid(targetGuid); data << ObjectGuid(targetGuid);
data << uint32(strlen(str) + 1); data << uint32(strlen(str) + 1);
data << str; data << str;
data << uint8(i_source ? i_source->GetChatTag() : CHAT_TAG_NONE); data << uint8(i_source ? i_source->GetChatTag() : uint8(CHAT_TAG_NONE));
} }
private: private:


Expand Down
10 changes: 8 additions & 2 deletions src/game/BattleGround.h → src/game/BattleGround/BattleGround.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ class BattleGround
virtual void StartingEventOpenDoors() {} virtual void StartingEventOpenDoors() {}


/* achievement req. */ /* achievement req. */
virtual bool IsAllNodesConrolledByTeam(Team /*team*/) const { return false; } virtual bool IsAllNodesControlledByTeam(Team /*team*/) const { return false; }
bool IsTeamScoreInRange(Team team, uint32 minScore, uint32 maxScore) const; bool IsTeamScoreInRange(Team team, uint32 minScore, uint32 maxScore) const;


/* Battleground */ /* Battleground */
Expand Down Expand Up @@ -458,7 +458,13 @@ class BattleGround
virtual void HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/) {} virtual void HandleAreaTrigger(Player* /*Source*/, uint32 /*Trigger*/) {}
// must be implemented in BG subclass if need AND call base class generic code // must be implemented in BG subclass if need AND call base class generic code
virtual void HandleKillPlayer(Player* player, Player* killer); virtual void HandleKillPlayer(Player* player, Player* killer);
virtual void HandleKillUnit(Creature* /*unit*/, Player* /*killer*/) { return; }; virtual void HandleKillUnit(Creature* /*unit*/, Player* /*killer*/) {}

// Process Capture event
virtual bool HandleEvent(uint32 /*eventId*/, GameObject* /*go*/) { return false; }

// Called when a gameobject is created
virtual void HandleGameObjectCreate(GameObject* /*go*/) {}


/* Battleground events */ /* Battleground events */
virtual void EventPlayerDroppedFlag(Player* /*player*/) {} virtual void EventPlayerDroppedFlag(Player* /*player*/) {}
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "Util.h" #include "Util.h"
#include "WorldPacket.h" #include "WorldPacket.h"
#include "MapManager.h" #include "MapManager.h"
#include "DBCStores.h" // TODO REMOVE this when graveyard handling for pvp is updated #include "DBCStores.h" // TODO REMOVE this when graveyard handling for pvp is updated


BattleGroundAB::BattleGroundAB() BattleGroundAB::BattleGroundAB()
{ {
Expand Down Expand Up @@ -113,17 +113,17 @@ void BattleGroundAB::Update(uint32 diff)
{ {
m_lastTick[team] -= BG_AB_TickIntervals[points]; m_lastTick[team] -= BG_AB_TickIntervals[points];
m_TeamScores[team] += BG_AB_TickPoints[points]; m_TeamScores[team] += BG_AB_TickPoints[points];
m_HonorScoreTics[team] += BG_AB_TickPoints[points]; m_honorScoreTicks[team] += BG_AB_TickPoints[points];
m_ReputationScoreTics[team] += BG_AB_TickPoints[points]; m_ReputationScoreTics[team] += BG_AB_TickPoints[points];
if (m_ReputationScoreTics[team] >= m_ReputationTics) if (m_ReputationScoreTics[team] >= m_ReputationTics)
{ {
(team == BG_TEAM_ALLIANCE) ? RewardReputationToTeam(509, 10, ALLIANCE) : RewardReputationToTeam(510, 10, HORDE); (team == BG_TEAM_ALLIANCE) ? RewardReputationToTeam(509, 10, ALLIANCE) : RewardReputationToTeam(510, 10, HORDE);
m_ReputationScoreTics[team] -= m_ReputationTics; m_ReputationScoreTics[team] -= m_ReputationTics;
} }
if (m_HonorScoreTics[team] >= m_HonorTics) if (m_honorScoreTicks[team] >= m_honorTicks)
{ {
RewardHonorToTeam(GetBonusHonorFromKill(1), (team == BG_TEAM_ALLIANCE) ? ALLIANCE : HORDE); RewardHonorToTeam(GetBonusHonorFromKill(1), (team == BG_TEAM_ALLIANCE) ? ALLIANCE : HORDE);
m_HonorScoreTics[team] -= m_HonorTics; m_honorScoreTicks[team] -= m_honorTicks;
} }
if (!m_IsInformedNearVictory && m_TeamScores[team] > BG_AB_WARNING_NEAR_VICTORY_SCORE) if (!m_IsInformedNearVictory && m_TeamScores[team] > BG_AB_WARNING_NEAR_VICTORY_SCORE)
{ {
Expand Down Expand Up @@ -177,7 +177,7 @@ void BattleGroundAB::StartingEventOpenDoors()
OpenDoorEvent(BG_EVENT_DOOR); OpenDoorEvent(BG_EVENT_DOOR);


// Players that join battleground after start are not eligible to get achievement. // Players that join battleground after start are not eligible to get achievement.
StartTimedAchievement(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, BG_AB_EVENT_START_BATTLE); StartTimedAchievement(ACHIEVEMENT_CRITERIA_TYPE_WIN_BG, AB_EVENT_START_BATTLE);
} }


void BattleGroundAB::AddPlayer(Player* plr) void BattleGroundAB::AddPlayer(Player* plr)
Expand Down Expand Up @@ -463,17 +463,17 @@ void BattleGroundAB::Reset()


for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i) for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i)
{ {
m_TeamScores[i] = 0; m_TeamScores[i] = 0;
m_lastTick[i] = 0; m_lastTick[i] = 0;
m_HonorScoreTics[i] = 0; m_honorScoreTicks[i] = 0;
m_ReputationScoreTics[i] = 0; m_ReputationScoreTics[i] = 0;
m_TeamScores500Disadvantage[i] = false; m_TeamScores500Disadvantage[i] = false;
} }


m_IsInformedNearVictory = false; m_IsInformedNearVictory = false;
bool isBGWeekend = BattleGroundMgr::IsBGWeekend(GetTypeID()); bool isBGWeekend = BattleGroundMgr::IsBGWeekend(GetTypeID());
m_HonorTics = (isBGWeekend) ? BG_AB_ABBGWeekendHonorTicks : BG_AB_NotABBGWeekendHonorTicks; m_honorTicks = isBGWeekend ? AB_WEEKEND_HONOR_INTERVAL : AB_NORMAL_HONOR_INTERVAL;
m_ReputationTics = (isBGWeekend) ? BG_AB_ABBGWeekendReputationTicks : BG_AB_NotABBGWeekendReputationTicks; m_ReputationTics = isBGWeekend ? AB_WEEKEND_REPUTATION_INTERVAL : AB_NORMAL_REPUTATION_INTERVAL;


for (uint8 i = 0; i < BG_AB_NODES_MAX; ++i) for (uint8 i = 0; i < BG_AB_NODES_MAX; ++i)
{ {
Expand Down Expand Up @@ -563,11 +563,10 @@ void BattleGroundAB::UpdatePlayerScore(Player* source, uint32 type, uint32 value


bool BattleGroundAB::IsAllNodesControlledByTeam(Team team) const bool BattleGroundAB::IsAllNodesControlledByTeam(Team team) const
{ {
uint8 count = 0;
for (uint8 i = 0; i < BG_AB_NODES_MAX; ++i) for (uint8 i = 0; i < BG_AB_NODES_MAX; ++i)
if ((team == ALLIANCE && m_Nodes[i] == BG_AB_NODE_STATUS_ALLY_OCCUPIED) || if ((team == ALLIANCE && m_Nodes[i] != BG_AB_NODE_STATUS_ALLY_OCCUPIED) ||
(team == HORDE && m_Nodes[i] == BG_AB_NODE_STATUS_HORDE_OCCUPIED)) (team == HORDE && m_Nodes[i] != BG_AB_NODE_STATUS_HORDE_OCCUPIED))
++count; return false;


return count == BG_AB_NODES_MAX; return true;
} }
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ enum BG_AB_Sounds
BG_AB_SOUND_NEAR_VICTORY = 8456 BG_AB_SOUND_NEAR_VICTORY = 8456
}; };


#define BG_AB_NotABBGWeekendHonorTicks 330 #define AB_NORMAL_HONOR_INTERVAL 260
#define BG_AB_ABBGWeekendHonorTicks 200 #define AB_WEEKEND_HONOR_INTERVAL 160
#define BG_AB_NotABBGWeekendReputationTicks 200 #define AB_NORMAL_REPUTATION_INTERVAL 160
#define BG_AB_ABBGWeekendReputationTicks 150 #define AB_WEEKEND_REPUTATION_INTERVAL 120
#define BG_AB_EVENT_START_BATTLE 9158 #define AB_EVENT_START_BATTLE 9158


// Tick intervals and given points: case 0,1,2,3,4,5 captured nodes // Tick intervals and given points: case 0,1,2,3,4,5 captured nodes
const uint32 BG_AB_TickIntervals[6] = {0, 12000, 9000, 6000, 3000, 1000}; const uint32 BG_AB_TickIntervals[6] = {0, 12000, 9000, 6000, 3000, 1000};
Expand Down Expand Up @@ -202,7 +202,7 @@ class BattleGroundAB : public BattleGround
virtual void EventPlayerClickedOnFlag(Player* source, GameObject* target_obj) override; virtual void EventPlayerClickedOnFlag(Player* source, GameObject* target_obj) override;


/* achievement req. */ /* achievement req. */
bool IsAllNodesControlledByTeam(Team team) const; // overwrited bool IsAllNodesControlledByTeam(Team team) const override;
bool IsTeamScores500Disadvantage(Team team) const { return m_TeamScores500Disadvantage[GetTeamIndexByTeamId(team)]; } bool IsTeamScores500Disadvantage(Team team) const { return m_TeamScores500Disadvantage[GetTeamIndexByTeamId(team)]; }
private: private:
/* Gameobject spawning/despawning */ /* Gameobject spawning/despawning */
Expand All @@ -227,10 +227,10 @@ class BattleGroundAB : public BattleGround
BG_AB_BannerTimer m_BannerTimers[BG_AB_NODES_MAX]; BG_AB_BannerTimer m_BannerTimers[BG_AB_NODES_MAX];
uint32 m_NodeTimers[BG_AB_NODES_MAX]; uint32 m_NodeTimers[BG_AB_NODES_MAX];
uint32 m_lastTick[BG_TEAMS_COUNT]; uint32 m_lastTick[BG_TEAMS_COUNT];
uint32 m_HonorScoreTics[BG_TEAMS_COUNT]; uint32 m_honorScoreTicks[BG_TEAMS_COUNT];
uint32 m_ReputationScoreTics[BG_TEAMS_COUNT]; uint32 m_ReputationScoreTics[BG_TEAMS_COUNT];
bool m_IsInformedNearVictory; bool m_IsInformedNearVictory;
uint32 m_HonorTics; uint32 m_honorTicks;
uint32 m_ReputationTics; uint32 m_ReputationTics;
// need for achievements // need for achievements
bool m_TeamScores500Disadvantage[BG_TEAMS_COUNT]; bool m_TeamScores500Disadvantage[BG_TEAMS_COUNT];
Expand Down
Loading

0 comments on commit ebae824

Please sign in to comment.