diff --git a/sql/wow_ro/1_wintergrasp.sql b/sql/wow_ro/1_wintergrasp.sql index 57de8f2..8101ba4 100644 --- a/sql/wow_ro/1_wintergrasp.sql +++ b/sql/wow_ro/1_wintergrasp.sql @@ -1,28 +1,11 @@ -DELETE FROM `command` WHERE name IN ('wg','wg enable','wg start','wg status','wg stop','wg switch','wg timer'); -INSERT INTO `command` VALUES ('wg', '3', 'Syntax: .wg $subcommand.'); -INSERT INTO `command` VALUES ('wg enable', '3', 'Syntax: .wg enable [on/off] Enable/Disable Wintergrasp outdoorPvP.'); -INSERT INTO `command` VALUES ('wg start', '3', 'Syntax: .wg start\r\nForce Wintergrasp battle start.'); -INSERT INTO `command` VALUES ('wg status', '3', 'Syntax: .wg status\r\nWintergrasp info, defender, timer, wartime.'); -INSERT INTO `command` VALUES ('wg stop', '3', 'Syntax: .wg stop\r\nForce Wintergrasp battle stop (No rewards).'); -INSERT INTO `command` VALUES ('wg switch', '3', 'Syntax: .wg switch\r\nSwitchs Wintergrasp defender team.'); -INSERT INTO `command` VALUES ('wg timer', '3', 'Syntax: .wg timer $minutes\r\nChange the current timer. Min value = 1, Max value 60 (Wartime), 1440 (Not Wartime)'); -/* Temp removed gameobject stopping you getting to the relic -* 60070 - [Wintergrasp Keep Collision Wall X:5396.209961 Y:2840.010010 Z:432.268005 MapId:571 -* 60476 - [Doodad_WG_Keep_Door01_collision01 X:5397.109863 Y:2841.540039 Z:425.901001 MapId:571]*/ -DELETE FROM gameobject WHERE guid = '60070'; -DELETE FROM gameobject WHERE guid = '60476'; - -/* Change incorrect spells used by Defender's Portal's */ -UPDATE `gameobject_template` SET `data0`=54643 WHERE `entry` in(190763,192819); DELETE FROM `trinity_string` WHERE entry IN (756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,780,781); - -INSERT INTO `trinity_string` VALUES ('756', 'Battle begins!', '', '', '', '', '', '', '', ''); +INSERT INTO `trinity_string` VALUES ('756', 'Battle begins!', '', '', '', '', '', '', '', 'Битва началась'); INSERT INTO `trinity_string` VALUES ('757', '%s has successfully defended the fortress!', '', '', '', '', '', '', '', ''); INSERT INTO `trinity_string` VALUES ('758', '%s has taken over the fortress!', '', '', '', '', '', '', '', ''); INSERT INTO `trinity_string` VALUES ('759', 'The %s siege workshop has been damaged by the %s!', '', '', '', '', '', '', '', ''); INSERT INTO `trinity_string` VALUES ('760', 'The %s siege workshop has been destroyed by the %s!', '', '', '', '', '', '', '', ''); -INSERT INTO `trinity_string` VALUES ('761', 'The %s tower has been damaged!', '', '', '', '', '', '', '', ''); -INSERT INTO `trinity_string` VALUES ('762', 'The %s tower has been destroyed!', '', '', '', '', '', '', '', ''); +INSERT INTO `trinity_string` VALUES ('761', 'The %s tower has been damaged!', '', '', '', '', '', '', '', '%s башня повреждена'); +INSERT INTO `trinity_string` VALUES ('762', 'The %s tower has been destroyed!', '', '', '', '', '', '', '', '%s башня уничтожена!'); INSERT INTO `trinity_string` VALUES ('763', 'Wintergrasp fortress is under attack!', '', '', '', '', '', '', '', ''); INSERT INTO `trinity_string` VALUES ('764', 'Wintergrasp is now under the control of the %s.', '', '', '', '', '', '', '', ''); INSERT INTO `trinity_string` VALUES ('765', 'Wintergrasp timer set to %s.', '', '', '', '', '', '', '', ''); @@ -31,8 +14,34 @@ INSERT INTO `trinity_string` VALUES ('767', 'Wintergrasp battle finished.', '', INSERT INTO `trinity_string` VALUES ('768', 'Wintergrasp info: %s controlled. Timer: %s. Wartime: %s. Number of Players: (Horde: %u, Alliance: %u)', '', '', '', '', '', '', '', ''); INSERT INTO `trinity_string` VALUES ('769', 'Wintergrasp outdoorPvP is disabled.', '', '', '', '', '', '', '', ''); INSERT INTO `trinity_string` VALUES ('770', 'Wintergrasp outdoorPvP is enabled.', '', '', '', '', '', '', '', ''); -INSERT INTO `trinity_string` VALUES ('771', 'You have reached Rank 1: Corporal', '', '', '', '', '', '', '', ''); -INSERT INTO `trinity_string` VALUES ('772', 'You have reached Rank 2: First Lieutenant', '', '', '', '', '', '', '', ''); -INSERT INTO `trinity_string` VALUES ('773', 'Not enough players to begin the battle.', '', '', '', '', '', '', '', ''); -INSERT INTO `trinity_string` VALUES ('780', '30 minutes left before the battle of Wintergrasp!', '', '', '', '', '', '', '', ''); -INSERT INTO `trinity_string` VALUES ('781', '10 minutes left before the battle of Wintergrasp!', '', '', '', '', '', '', '', ''); \ No newline at end of file +INSERT INTO `trinity_string` VALUES ('771', 'You have reached Rank 1: Corporal', '', '', '', '', '', '', '', 'Вы достигли Ранга 1: Капрал'); +INSERT INTO `trinity_string` VALUES ('772', 'You have reached Rank 2: First Lieutenant', '', '', '', '', '', '', '', 'Вы достигли Ранга 2: Лейтенант'); +REPLACE INTO `trinity_string` VALUES ('780', 'Before the Battle of Wintergrasp left 30 minutes!', '', '', '', '', '', '', '', 'До битвы на Озере Ледяных Оков осталось 30 минут!'); +REPLACE INTO `trinity_string` VALUES ('781', 'Before the Battle of Wintergrasp left 10 minutes!', '', '', '', '', '', '', '', 'До битвы на Озере Ледяных Оков осталось 10 минут!'); +REPLACE INTO `trinity_string` VALUES ('782', 'The battle for Wintergrasp has stopped! Not enough defenders. Wintergrasp Fortress remains Attackers.', '', '', '', '', '', '', '', 'Битва за Озеро Ледяных Оков Остановлена. Не хватает защитников. Крепость переходит атакующей стороне.'); +REPLACE INTO `trinity_string` VALUES ('783', 'The battle for Wintergrasp has stopped! Not enough attackers. Wintergrasp Fortress remains Defenders.', '', '', '', '', '', '', '', 'Битва за Озеро Ледяных Оков Остановлена. Не хватает нападающих. Крепость остается защитникам.'); +DELETE FROM `command` WHERE name IN ('wg','wg enable','wg start','wg status','wg stop','wg switch','wg timer'); +INSERT INTO `command` VALUES ('wg', '3', 'Syntax: .wg $subcommand.'); +INSERT INTO `command` VALUES ('wg enable', '3', 'Syntax: .wg enable [on/off] Enable/Disable Wintergrasp outdoorPvP.'); +INSERT INTO `command` VALUES ('wg start', '3', 'Syntax: .wg start\r\nForce Wintergrasp battle start.'); +INSERT INTO `command` VALUES ('wg status', '3', 'Syntax: .wg status\r\nWintergrasp info, defender, timer, wartime.'); +INSERT INTO `command` VALUES ('wg stop', '3', 'Syntax: .wg stop\r\nForce Wintergrasp battle stop (No rewards).'); +INSERT INTO `command` VALUES ('wg switch', '3', 'Syntax: .wg switch\r\nSwitchs Wintergrasp defender team.'); +INSERT INTO `command` VALUES ('wg timer', '3', 'Syntax: .wg timer $minutes\r\nChange the current timer. Min value = 1, Max value 60 (Wartime), 1440 (Not Wartime)'); +/*Spirit healer FIX */ +UPDATE creature_template SET npcflag=npcflag|32768 WHERE entry IN (31841,31842); +/* Temp removed gameobject stopping you getting to the relic +* 60070 - [Wintergrasp Keep Collision Wall X:5396.209961 Y:2840.010010 Z:432.268005 MapId:571 +* 60476 - [Doodad_WG_Keep_Door01_collision01 X:5397.109863 Y:2841.540039 Z:425.901001 MapId:571]*/ +DELETE FROM gameobject WHERE id IN ('194323', '194162'); + +/*Defender's Portal Activate Proper Spell +Not need it now*/ +/* +REPLACE INTO `spell_linked_spell` VALUES ('54640','54643','0','Defender\'s Portal Activate Proper Spell'); +*/ + +/* Teleport WG SPELLs*/ +REPLACE INTO `spell_target_position` VALUES ('59096', '571', '5325.06', '2843.36', '409.285', '3.20278'); +REPLACE INTO `spell_target_position` VALUES ('58632', '571', '5097.79', '2180.29', '365.61', '2.41'); +REPLACE INTO `spell_target_position` VALUES ('58633', '571', '5026.80', '3676.69', '362.58', '3.94'); \ No newline at end of file diff --git a/src/server/game/OutdoorPvP/Zones/OutdoorPvPWG.cpp b/src/server/game/OutdoorPvP/Zones/OutdoorPvPWG.cpp index 5693b31..8ab83fe 100644 --- a/src/server/game/OutdoorPvP/Zones/OutdoorPvPWG.cpp +++ b/src/server/game/OutdoorPvP/Zones/OutdoorPvPWG.cpp @@ -388,9 +388,9 @@ QueryResult_AutoPtr result = WorldDatabase.PQuery("SELECT guid, id FROM creature _LoadTeamPair(m_goDisplayPair, OutdoorPvPWGGODisplayPair); _LoadTeamPair(m_creEntryPair, OutdoorPvPWGCreEntryPair); - m_warTime = false; + m_wartime = false; m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_START_TIME) * MINUTE * IN_MILLISECONDS; - + sWorld.SendWintergraspState(); m_towerDamagedCount[TEAM_ALLIANCE] = 0; m_towerDestroyedCount[TEAM_ALLIANCE] = 0; m_towerDamagedCount[TEAM_HORDE] = 0; @@ -544,7 +544,7 @@ void OutdoorPvPWG::ProcessEvent(GameObject *obj, uint32 eventId) } for (PlayerSet::iterator itr = m_players[getAttackerTeam()].begin(); itr != m_players[getAttackerTeam()].end(); ++itr) { - if (getDefenderTeam() == TEAM_ALLIANCE) + if (getDefenderTeam()==TEAM_ALLIANCE) { TeamIDsound=OutdoorPvP_WG_SOUND_KEEP_CAPTURED_HORDE; //Allience Worn Sound } @@ -564,23 +564,26 @@ void OutdoorPvPWG::ProcessEvent(GameObject *obj, uint32 eventId) if (m_towerDestroyedCount[getAttackerTeam()]) { for (PlayerSet::iterator itr = m_players[getDefenderTeam()].begin(); itr != m_players[getDefenderTeam()].end(); ++itr) - if ((*itr)->getLevel() > 69) + if ((*itr)->getLevel() > 76) (*itr)->SetAuraStack(SPELL_TOWER_CONTROL, (*itr), m_towerDestroyedCount[getAttackerTeam()]); } if (attStack) { for (PlayerSet::iterator itr = m_players[getAttackerTeam()].begin(); itr != m_players[getAttackerTeam()].end(); ++itr) - if ((*itr)->getLevel() > 69) + if ((*itr)->getLevel() > 76) (*itr)->SetAuraStack(SPELL_TOWER_CONTROL, (*itr), attStack); } + else + { + if (m_timer < 600000) + m_timer = 0; + else + m_timer = m_timer - 600000; // - 10 mins + } } msgStr = fmtstring(objmgr.GetTrinityStringForDBCLocale(LANG_BG_WG_TOWER_DESTROYED), msgStr.c_str()); sWorld.SendZoneText(ZONE_WINTERGRASP, msgStr.c_str()); - if (m_timer < 10*MINUTE*IN_MILLISECONDS) - m_timer = 0; - else - m_timer -= 10*MINUTE*IN_MILLISECONDS; for (PlayerSet::iterator itr = m_players[getDefenderTeam()].begin(); itr != m_players[getDefenderTeam()].end(); ++itr) { if (getDefenderTeam()==TEAM_ALLIANCE) @@ -904,10 +907,10 @@ void OutdoorPvPWG::BroadcastStateChange(BuildingState *state) const } // Called at Start and Battle End -void OutdoorPvPWG::UpdateCreatureInfo(Creature *creature) +bool OutdoorPvPWG::UpdateCreatureInfo(Creature *creature) { if (!creature) - return; + return false; uint32 entry = creature->GetEntry(); switch(GetCreatureType(entry)) { @@ -926,19 +929,19 @@ void OutdoorPvPWG::UpdateCreatureInfo(Creature *creature) creature->SetVisibility(VISIBILITY_OFF); creature->setFaction(35); } - break; + return false; case CREATURE_OTHER: if (isWarTime()) { creature->SetVisibility(VISIBILITY_OFF); - creature->SetControlled(true, UNIT_STAT_STUNNED); + creature->setFaction(35); } else { - creature->SetControlled(false, UNIT_STAT_STUNNED); + creature->RestoreFaction(); creature->SetVisibility(VISIBILITY_ON); } - break; + return false; case CREATURE_SPIRIT_GUIDE: if (isWarTime()) { @@ -950,15 +953,15 @@ void OutdoorPvPWG::UpdateCreatureInfo(Creature *creature) creature->SetVisibility(VISIBILITY_OFF); //creature->setDeathState(DEAD); } - break; + return false; case CREATURE_SPIRIT_HEALER: creature->SetVisibility(isWarTime() ? VISIBILITY_OFF : VISIBILITY_ON); - break; + return false; case CREATURE_ENGINEER: - break; + return false; case CREATURE_SIEGE_VEHICLE: //creature->DisappearAndDie(); - break; + return false; case CREATURE_GUARD: case CREATURE_SPECIAL: { @@ -968,10 +971,10 @@ void OutdoorPvPWG::UpdateCreatureInfo(Creature *creature) entry = getDefenderTeam() == TEAM_ALLIANCE ? itr->second : itr->first; _RespawnCreatureIfNeeded(creature, entry); } - break; + return false; } default: - break; + return false; } } @@ -1064,9 +1067,12 @@ void OutdoorPvPWG::HandlePlayerEnterZone(Player * plr, uint32 zone) if (isWarTime()) { - plr->CastSpell(plr, 58730, true); - - if (plr->getLevel() > 69) + if (plr->getLevel() < 77) + { + plr->CastSpell(plr, SPELL_TELEPORT_DALARAN, true); + return; + } + if (plr->getLevel() > 76) { if (!plr->HasAura(SPELL_RECRUIT) && !plr->HasAura(SPELL_CORPORAL) && !plr->HasAura(SPELL_LIEUTENANT)) @@ -1097,10 +1103,7 @@ void OutdoorPvPWG::HandlePlayerResurrects(Player * plr, uint32 zone) if (isWarTime()) { - if (plr->HasAura(58730)) - plr->RemoveAura(58730); - - if (plr->getLevel() > 69) + if (plr->getLevel() > 76) { // Tenacity if (plr->GetTeamId() == TEAM_ALLIANCE && m_tenacityStack > 0 || @@ -1213,10 +1216,10 @@ void OutdoorPvPWG::HandleKill(Player *killer, Unit *victim) if (Group *pGroup = killer->GetGroup()) { for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) - if (itr->getSource()->IsAtGroupRewardDistance(killer) && itr->getSource()->getLevel() > 69) + if (itr->getSource()->IsAtGroupRewardDistance(killer) && itr->getSource()->getLevel() > 76) PromotePlayer(itr->getSource()); } - else if (killer->getLevel() > 69) + else if (killer->getLevel() > 76) PromotePlayer(killer); } } @@ -1233,11 +1236,11 @@ void OutdoorPvPWG::UpdateTenacityStack() int32 newStack = 0; for (PlayerSet::iterator itr = m_players[TEAM_ALLIANCE].begin(); itr != m_players[TEAM_ALLIANCE].end(); ++itr) - if ((*itr)->getLevel() > 69) + if ((*itr)->getLevel() > 76) ++allianceNum; for (PlayerSet::iterator itr = m_players[TEAM_HORDE].begin(); itr != m_players[TEAM_HORDE].end(); ++itr) - if ((*itr)->getLevel() > 69) + if ((*itr)->getLevel() > 76) ++hordeNum; if (allianceNum && hordeNum) @@ -1262,7 +1265,7 @@ void OutdoorPvPWG::UpdateTenacityStack() if (team != TEAM_NEUTRAL) { for (PlayerSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) - if ((*itr)->getLevel() > 69) + if ((*itr)->getLevel() > 76) (*itr)->RemoveAurasDueToSpell(SPELL_TENACITY); for (CreatureSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr) @@ -1279,7 +1282,7 @@ void OutdoorPvPWG::UpdateTenacityStack() newStack = 20; for (PlayerSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) - if ((*itr)->getLevel() > 69) + if ((*itr)->getLevel() > 76) (*itr)->SetAuraStack(SPELL_TENACITY, (*itr), newStack); for (CreatureSet::const_iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr) @@ -1294,7 +1297,7 @@ void OutdoorPvPWG::UpdateClockDigit(uint32 &timer, uint32 digit, uint32 mod) { m_clock[digit] = value; SendUpdateWorldState(ClockWorldState[digit], (timer + time(NULL))); - sWorld.SetWintergraspTimer(timer + time(NULL), digit); + sWorld.SetWintergrapsTimer(timer + time(NULL), digit); } } @@ -1305,13 +1308,14 @@ void OutdoorPvPWG::UpdateClock() UpdateClockDigit(timer, 1, 10); else UpdateClockDigit(timer, 0, 10); - - // Announce in Dalaran 30 minutes - if ((m_timer>1800000) && (m_timer<1801000) && (m_warTime == false)) + +//Announce in all world, comment it if you don't like/need it + // Announce 30 minutes left + if ((m_timer>1800000) && (m_timer<1802000) && (m_wartime==false)) sWorld.SendWorldText(LANG_BG_WG_WORLD_ANNOUNCE_30); - // Announce in Dalaran 10 minutes - if ((m_timer>600000) && (m_timer<601000) && (m_warTime == false)) + // Announce 10 minutes left + if ((m_timer>600000) && (m_timer<602000) && (m_wartime==false)) sWorld.SendWorldText(LANG_BG_WG_WORLD_ANNOUNCE_10); } @@ -1403,24 +1407,13 @@ bool OutdoorPvPWG::Update(uint32 diff) { if (m_timer != 1) // 1 = forceStopBattle sWorld.SendZoneText(ZONE_WINTERGRASP, fmtstring(objmgr.GetTrinityStringForDBCLocale(entry), objmgr.GetTrinityStringForDBCLocale(getDefenderTeam() == TEAM_ALLIANCE ? LANG_BG_AB_ALLY : LANG_BG_AB_HORDE))); - EndBattle(); } else { if (m_timer != 1) // 1 = forceStartBattle sWorld.SendZoneText(ZONE_WINTERGRASP, objmgr.GetTrinityStringForDBCLocale(LANG_BG_WG_BATTLE_STARTS)); - - if (!m_players[m_defender].empty() && !m_players[getAttackerTeam()].empty()) - StartBattle(); - else - { - m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_INTERVAL) * MINUTE * IN_MILLISECONDS; - sWorld.SendZoneText(ZONE_WINTERGRASP, objmgr.GetTrinityStringForDBCLocale(LANG_BG_WG_NOT_ENOUGH_PLAYERS)); - - if (m_players[m_defender].empty()) - forceChangeTeam(); - } + StartBattle(); } UpdateAllWorldObject(); @@ -1435,26 +1428,28 @@ bool OutdoorPvPWG::Update(uint32 diff) void OutdoorPvPWG::forceStartBattle() { // Uptime will do all the work - m_warTime = false; + m_wartime = false; if (m_timer != 1) { m_timer = 1; sWorld.SendZoneText(ZONE_WINTERGRASP, objmgr.GetTrinityStringForDBCLocale(LANG_BG_WG_BATTLE_FORCE_START)); } + sWorld.SendWintergraspState(); } void OutdoorPvPWG::forceStopBattle() { // Uptime will do all the work. if (!isWarTime()) - m_warTime = true; + m_wartime = true; if (m_timer != 1) { m_timer = 1; sWorld.SendZoneText(ZONE_WINTERGRASP, objmgr.GetTrinityStringForDBCLocale(LANG_BG_WG_BATTLE_FORCE_STOP)); } + sWorld.SendWintergraspState(); } void OutdoorPvPWG::forceChangeTeam() @@ -1471,25 +1466,60 @@ void OutdoorPvPWG::forceChangeTeam() // Can be forced by gm's while in battle so have to reset in case it was wartime void OutdoorPvPWG::StartBattle() { - m_warTime = true; + int CountDef=0; + int CountAtk=0; + m_wartime = true; m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_BATTLE_TIME) * MINUTE * IN_MILLISECONDS; +for (PlayerSet::iterator itr = m_players[getDefenderTeam()].begin(); itr != m_players[getDefenderTeam()].end(); ++itr) +{ + if ((*itr)->getLevel() < 77) + { + (*itr)->CastSpell((*itr), SPELL_TELEPORT_DALARAN, true); + } + else + { + CountDef++; + (*itr)->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED); + (*itr)->RemoveAurasByType(SPELL_AURA_FLY); + (*itr)->PlayDirectSound(OutdoorPvP_WG_SOUND_START_BATTLE); // START Battle + } +} + +for (PlayerSet::iterator itr = m_players[getAttackerTeam()].begin(); itr != m_players[getAttackerTeam()].end(); ++itr) +{ + if ((*itr)->getLevel() < 77) + { + (*itr)->CastSpell((*itr), SPELL_TELEPORT_DALARAN, true); + } + else + { + CountAtk++; + (*itr)->RemoveAurasByType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED); + (*itr)->RemoveAurasByType(SPELL_AURA_FLY); + (*itr)->PlayDirectSound(OutdoorPvP_WG_SOUND_START_BATTLE); // START Battle + } +} +// Antifarm System, uncomment if you need +/*if ((CountAtk<5) || (CountDef<5)) + { + if (CountAtk<=CountDef) + sWorld.SendWorldText(LANG_BG_WG_WORLD_NO_ATK); + if (CountDefCastSpell((*itr), 58730, true); - - (*itr)->PlayDirectSound(OutdoorPvP_WG_SOUND_START_BATTLE); // START Battle - } - for (PlayerSet::iterator itr = m_players[getAttackerTeam()].begin(); itr != m_players[getAttackerTeam()].end(); ++itr) - { - (*itr)->CastSpell((*itr), 58730, true); - - (*itr)->PlayDirectSound(OutdoorPvP_WG_SOUND_START_BATTLE); // START Battle - } // destroyed all vehicles for (uint32 team = 0; team < 2; ++team) @@ -1498,8 +1528,7 @@ void OutdoorPvPWG::StartBattle() { Creature *veh = *m_vehicles[team].begin(); m_vehicles[team].erase(m_vehicles[team].begin()); - ((Vehicle*)veh)->RemoveAllPassengers(); - veh->ForcedDespawn(); + veh->setDeathState(JUST_DIED); } } @@ -1511,7 +1540,7 @@ void OutdoorPvPWG::StartBattle() (*itr)->RemoveAurasDueToSpell(SPELL_LIEUTENANT); (*itr)->RemoveAurasDueToSpell(SPELL_TOWER_CONTROL); (*itr)->RemoveAurasDueToSpell(SPELL_SPIRITUAL_IMMUNITY); - if ((*itr)->getLevel() > 69) + if ((*itr)->getLevel() > 76) { (*itr)->SetAuraStack(SPELL_TOWER_CONTROL, (*itr), 3); (*itr)->CastSpell(*itr, SPELL_RECRUIT, true); @@ -1526,10 +1555,12 @@ void OutdoorPvPWG::StartBattle() (*itr)->RemoveAurasDueToSpell(SPELL_LIEUTENANT); (*itr)->RemoveAurasDueToSpell(SPELL_TOWER_CONTROL); (*itr)->RemoveAurasDueToSpell(SPELL_SPIRITUAL_IMMUNITY); - if ((*itr)->getLevel() > 69) + if ((*itr)->getLevel() > 76) (*itr)->CastSpell(*itr, SPELL_RECRUIT, true); } UpdateTenacityStack(); + // Update timer in players battlegrounds tab + sWorld.SendWintergraspState(); } void OutdoorPvPWG::EndBattle() @@ -1537,20 +1568,20 @@ void OutdoorPvPWG::EndBattle() // Cast Essence of Wintergrasp to all players (CheckCast will determine who to cast) sWorld.setWorldState(WORLDSTATE_WINTERGRASP_CONTROLING_FACTION, getDefenderTeam()); sWorld.UpdateAreaDependentAuras(); - //Sound on End Battle - for (PlayerSet::iterator itr = m_players[getDefenderTeam()].begin(); itr != m_players[getDefenderTeam()].end(); ++itr) - { - if (getDefenderTeam()==TEAM_ALLIANCE) - { - TeamIDsound=OutdoorPvP_WG_SOUND_ALLIANCE_WINS; //Allience Win - } - else TeamIDsound=OutdoorPvP_WG_SOUND_HORDE_WINS; //Horde Win - (*itr)->PlayDirectSound(TeamIDsound) ; // SoundOnEndWin - } - for (PlayerSet::iterator itr = m_players[getAttackerTeam()].begin(); itr != m_players[getAttackerTeam()].end(); ++itr) - { - (*itr)->PlayDirectSound(OutdoorPvP_WG_SOUND_NEAR_VICTORY) ; // SoundOnEndLoose - } +//Sound on End Battle +for (PlayerSet::iterator itr = m_players[getDefenderTeam()].begin(); itr != m_players[getDefenderTeam()].end(); ++itr) +{ + if (getDefenderTeam()==TEAM_ALLIANCE) + { + TeamIDsound=OutdoorPvP_WG_SOUND_ALLIANCE_WINS; //Allience Win + } + else TeamIDsound=OutdoorPvP_WG_SOUND_HORDE_WINS; //Horde Win + (*itr)->PlayDirectSound(TeamIDsound) ; // SoundOnEndWin +} +for (PlayerSet::iterator itr = m_players[getAttackerTeam()].begin(); itr != m_players[getAttackerTeam()].end(); ++itr) +{ + (*itr)->PlayDirectSound(OutdoorPvP_WG_SOUND_NEAR_VICTORY) ; // SoundOnEndLoose +} for (uint32 team = 0; team < 2; ++team) { @@ -1559,8 +1590,7 @@ void OutdoorPvPWG::EndBattle() { Creature *veh = *m_vehicles[team].begin(); m_vehicles[team].erase(m_vehicles[team].begin()); - //((Vehicle*)veh)->RemoveAllPassengers(); - veh->ForcedDespawn(); + veh->setDeathState(JUST_DIED); } if (m_players[team].empty()) @@ -1572,7 +1602,8 @@ void OutdoorPvPWG::EndBattle() if ((*itr)->isDead()) { (*itr)->ResurrectPlayer(1.0f); - sObjectAccessor.ConvertCorpseForPlayer((*itr)->GetGUID()); + sObjectAccessor.ConvertCorpseForPlayer((*itr)->GetGUID()); + //ObjectAccessor::Instance().ConvertCorpseForPlayer((*itr)->GetGUID()); } (*itr)->RemoveAurasDueToSpell(SPELL_TENACITY); (*itr)->CombatStop(true); @@ -1613,7 +1644,7 @@ void OutdoorPvPWG::EndBattle() { // Calculate Level 70+ with Corporal or Lieutenant rank for (PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) - if ((*itr)->getLevel() > 69 && ((*itr)->HasAura(SPELL_LIEUTENANT) || (*itr)->HasAura(SPELL_CORPORAL))) + if ((*itr)->getLevel() > 76 && ((*itr)->HasAura(SPELL_LIEUTENANT) || (*itr)->HasAura(SPELL_CORPORAL))) ++playersWithRankNum; baseHonor = team == getDefenderTeam() ? sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_WIN_BATTLE) : sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_LOSE_BATTLE); @@ -1623,8 +1654,6 @@ void OutdoorPvPWG::EndBattle() baseHonor += (sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_DAMAGED_BUILDING) * damagedNum); if (playersWithRankNum) baseHonor /= playersWithRankNum; - if (baseHonor > 2500) - baseHonor = 2500; } for (PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr) @@ -1710,10 +1739,11 @@ void OutdoorPvPWG::EndBattle() } } - m_warTime = false; + m_wartime = false; m_timer = sWorld.getConfig(CONFIG_OUTDOORPVP_WINTERGRASP_INTERVAL) * MINUTE * IN_MILLISECONDS; - TeamCastSpell(getAttackerTeam(), SPELL_TELEPORT_DALARAN); RemoveOfflinePlayerWGAuras(); + // Update timer in players battlegrounds tab + sWorld.SendWintergraspState(); } bool OutdoorPvPWG::CanBuildVehicle(OPvPCapturePointWG *workshop) const diff --git a/src/server/game/OutdoorPvP/Zones/OutdoorPvPWG.h b/src/server/game/OutdoorPvP/Zones/OutdoorPvPWG.h index bb55ab4..5130ded 100644 --- a/src/server/game/OutdoorPvP/Zones/OutdoorPvPWG.h +++ b/src/server/game/OutdoorPvP/Zones/OutdoorPvPWG.h @@ -21,7 +21,7 @@ #include "OutdoorPvPImpl.h" -#define ZONE_DALARAN 4395 +#define ZONE_DALARAN 4395 #define ZONE_WINTERGRASP 4197 #define POS_X_CENTER 5100 #define MAX_VEHICLE_PER_WORKSHOP 4 @@ -51,11 +51,13 @@ enum OutdoorPvPWGSpell SPELL_DAMAGED_BUILDING = 59201, SPELL_INTACT_BUILDING = 59203, - SPELL_TELEPORT_DALARAN = 53360, - SPELL_VICTORY_AURA = 60044, -}; - + SPELL_TELEPORT_ALLIENCE_CAMP = 58632, + SPELL_TELEPORT_HORDE_CAMP = 58633, + SPELL_TELEPORT_FORTRESS = 59096, + SPELL_TELEPORT_DALARAN = 53360, + SPELL_VICTORY_AURA = 60044, +}; const uint16 GameEventWintergraspDefender[2] = {50, 51}; @@ -69,11 +71,12 @@ enum OutdoorPvP_WG_Sounds OutdoorPvP_WG_SOUND_NEAR_VICTORY = 8456, OutdoorPvP_WG_SOUND_HORDE_WINS = 8454, OutdoorPvP_WG_SOUND_ALLIANCE_WINS = 8455, - OutdoorPvP_WG_SOUND_START_BATTLE = 11803, - OutdoorPvP_WG_SOUND_WORKSHOP_Horde = 6205, // - OutdoorPvP_WG_SOUND_WORKSHOP_ALLIANCE = 6298, // + OutdoorPvP_WG_SOUND_WORKSHOP_Horde = 6205, // время убивать орда + OutdoorPvP_WG_SOUND_WORKSHOP_ALLIANCE = 6298, // к оружию альянс OutdoorPvP_WG_HORDE_CAPTAIN = 8333, - OutdoorPvP_WG_ALLIANCE_CAPTAIN = 8232 + OutdoorPvP_WG_ALLIANCE_CAPTAIN = 8232, +// OutdoorPvP_WG_SOUND_START_BATTLE = 11803, //L70ETC Concert + OutdoorPvP_WG_SOUND_START_BATTLE = 3439, //Standart BG Start sound }; enum DataId @@ -238,7 +241,7 @@ class OutdoorPvPWG : public OutdoorPvP void ModifyWorkshopCount(TeamId team, bool add); uint32 GetTimer() const { return m_timer / 1000; }; - bool isWarTime() const { return m_warTime; }; + bool isWarTime() const { return m_wartime; }; void setTimer(uint32 timer) { if (timer >= 0) m_timer = timer; }; uint32 GetNumPlayersA() const { return m_players[TEAM_ALLIANCE].size(); }; uint32 GetNumPlayersH() const { return m_players[TEAM_HORDE].size(); }; @@ -254,6 +257,8 @@ class OutdoorPvPWG : public OutdoorPvP void RemovePlayerFromResurrectQueue(uint64 player_guid); void RelocateDeadPlayers(Creature *cr); // BG end + void SendInitWorldStatesTo(Player *player = NULL) const; + uint32 m_timer; protected: // Temporal BG specific till 3.2 std::vector m_ResurrectQueue; // Player GUID @@ -279,9 +284,8 @@ class OutdoorPvPWG : public OutdoorPvP TeamPairMap m_creEntryPair, m_goDisplayPair; QuestGiverPositionMap m_qgPosMap; - bool m_warTime; + bool m_wartime; bool m_changeDefender; - uint32 m_timer; uint32 m_clock[2]; uint32 m_workshopCount[2]; uint32 m_towerDestroyedCount[2]; @@ -299,7 +303,7 @@ class OutdoorPvPWG : public OutdoorPvP void PromotePlayer(Player *player) const; void UpdateTenacityStack(); void UpdateAllWorldObject(); - void UpdateCreatureInfo(Creature *creature); + bool UpdateCreatureInfo(Creature *creature); bool UpdateGameObjectInfo(GameObject *go) const; bool CanBuildVehicle(OPvPCapturePointWG *workshop) const; @@ -307,7 +311,6 @@ class OutdoorPvPWG : public OutdoorPvP void RebuildAllBuildings(); - void SendInitWorldStatesTo(Player *player = NULL) const; void RemoveOfflinePlayerWGAuras(); void RewardMarkOfHonor(Player *player, uint32 count); void MoveQuestGiver(uint32 guid); diff --git a/src/server/scripts/Northrend/wintergrasp.cpp b/src/server/scripts/Northrend/wintergrasp.cpp index 00c7ca5..ed4591e 100644 --- a/src/server/scripts/Northrend/wintergrasp.cpp +++ b/src/server/scripts/Northrend/wintergrasp.cpp @@ -15,7 +15,7 @@ */ #include "ScriptPCH.h" -#include "../../game/OutdoorPvP/Zones/OutdoorPvPWG.h" +#include "OutdoorPvPWG.h" #define GOSSIP_HELLO_DEMO1 "Build catapult." #define GOSSIP_HELLO_DEMO2 "Build demolisher." @@ -50,13 +50,8 @@ bool GossipHello_npc_demolisher_engineerer(Player* pPlayer, Creature* pCreature) if(pPlayer->isGameMaster() || pCreature->GetZoneScript() && pCreature->GetZoneScript()->GetData(pCreature->GetDBTableGUIDLow())) { - if (pPlayer->HasAura(SPELL_RECRUIT)) + if (pPlayer->HasAura(SPELL_CORPORAL)) pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_DEMO1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - else if (pPlayer->HasAura(SPELL_CORPORAL)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_DEMO1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_DEMO2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - } else if (pPlayer->HasAura(SPELL_LIEUTENANT)) { pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_DEMO1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); diff --git a/src/server/shared/revision_nr.h b/src/server/shared/revision_nr.h index 2e0587f..afbc9dd 100644 --- a/src/server/shared/revision_nr.h +++ b/src/server/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "179" + #define REVISION_NR "180" #endif // __REVISION_NR_H__