From ab5b273d3cc02f9db39864b39c55a619dc0a88e6 Mon Sep 17 00:00:00 2001 From: megamage Date: Fri, 22 May 2009 10:29:48 -0500 Subject: [PATCH] *Some work on wintergrasp. Player can get ranks by killing other players and can build vehicles at workshop. Vehicles can be used to destroy buildings. Except these no other thing is done. --HG-- branch : trunk --- .../3466_world_scripts_(wintergrasp).sql | 19 + src/bindings/scripts/CMakeLists.txt | 1 + src/bindings/scripts/ScriptMgr.cpp | 6 + src/bindings/scripts/VC80/80ScriptDev2.vcproj | 4177 +++++++++-------- src/bindings/scripts/VC90/90ScriptDev2.vcproj | 14 +- .../scripts/zone/wintergrasp/wintergrasp.cpp | 60 + src/game/CMakeLists.txt | 3 + src/game/CreatureAIImpl.h | 2 - src/game/OutdoorPvP.cpp | 5 + src/game/OutdoorPvP.h | 26 +- src/game/OutdoorPvPEP.cpp | 2 +- src/game/OutdoorPvPEP.h | 2 +- src/game/OutdoorPvPHP.cpp | 2 +- src/game/OutdoorPvPHP.h | 2 +- src/game/OutdoorPvPImpl.h | 38 + src/game/OutdoorPvPMgr.cpp | 14 + src/game/OutdoorPvPNA.cpp | 2 +- src/game/OutdoorPvPNA.h | 2 +- src/game/OutdoorPvPObjectiveAI.cpp | 1 + src/game/OutdoorPvPSI.cpp | 2 +- src/game/OutdoorPvPSI.h | 2 +- src/game/OutdoorPvPTF.cpp | 2 +- src/game/OutdoorPvPTF.h | 2 +- src/game/OutdoorPvPZM.cpp | 2 +- src/game/OutdoorPvPZM.h | 2 +- src/game/Vehicle.cpp | 10 +- src/game/Wintergrasp.cpp | 75 + src/game/Wintergrasp.h | 42 + win/VC80/game.vcproj | 144 +- win/VC90/game.vcproj | 144 +- 30 files changed, 2700 insertions(+), 2105 deletions(-) create mode 100644 sql/updates/3466_world_scripts_(wintergrasp).sql create mode 100644 src/bindings/scripts/scripts/zone/wintergrasp/wintergrasp.cpp create mode 100644 src/game/OutdoorPvPImpl.h create mode 100644 src/game/Wintergrasp.cpp create mode 100644 src/game/Wintergrasp.h diff --git a/sql/updates/3466_world_scripts_(wintergrasp).sql b/sql/updates/3466_world_scripts_(wintergrasp).sql new file mode 100644 index 000000000..ac757d126 --- /dev/null +++ b/sql/updates/3466_world_scripts_(wintergrasp).sql @@ -0,0 +1,19 @@ +DELETE FROM `spell_script_target` WHERE entry IN +(56575,56661,56663,56665,56667,56669,61408); +INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES +(56575, 1, 27852), +(56661, 1, 27852), +(56663, 1, 27852), +(56665, 1, 27852), +(56667, 1, 27852), +(56669, 1, 27852), +(61408, 1, 27852); + + +update creature_template set maxhealth = 133525, minhealth = 133525, maxmana = 51360, minmana = 51360, spell1 = 53114, spell2 = 53112, spell3=53110 where entry = 28670; +update creature_template set maxhealth = 30000, minhealth = 30000, speed = 2, spell1=50025, spell2=50989, VehicleId = 36 where entry = 27881; +update creature_template set maxhealth = 50000, minhealth = 50000, speed = 1.6, spell1=50896, spell2=50652, VehicleId = 106 where entry = 28094; +update creature_template set maxhealth = 75000, minhealth = 75000, speed = 1, spell1=51678, VehicleId = 117 where entry IN (28312,32627); +update creature_template set maxhealth = 50000, minhealth = 50000, spell1=51362, VehicleId = 116 where entry IN (28319,32629); + +update creature_template set scriptname = "npc_demolisher_engineerer" where entry in (30400,30499); \ No newline at end of file diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 8d1ade57b..b89344f2b 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -477,6 +477,7 @@ SET(trinityscript_LIB_SRCS scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp scripts/zone/vault_of_archavon/boss_archavon.cpp scripts/zone/vault_of_archavon/def_vault_of_archavon.h + scripts/zone/wintergrasp/wintergrasp.cpp system.cpp ) diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index 9ba94eb4a..e98ea3395 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -628,6 +628,9 @@ extern void AddSC_zulaman(); //Vault of Archavon extern void AddSC_boss_archavon(); +//Region +extern void AddSC_wintergrasp(); + // ------------------- void LoadDatabase() { @@ -1510,6 +1513,9 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") //Vault of Archavon AddSC_boss_archavon(); + //Region + AddSC_wintergrasp(); + // ------------------- outstring_log(">> Loaded %i C++ Scripts.", num_sc_scripts); diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 9ec9a72ec..1a39f5b39 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -458,14 +458,14 @@ RelativePath="..\scripts\npc\npc_professions.cpp" > + + - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + - - + - + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index b92dd51a0..cfcbcc540 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -457,14 +457,14 @@ RelativePath="..\scripts\npc\npc_professions.cpp" > + + - - + > + + + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "precompiled.h" +#include "Wintergrasp.h" + +bool GossipHello_npc_demolisher_engineerer(Player *player, Creature *_creature) +{ + if(_creature->isQuestGiver()) + player->PrepareQuestMenu(_creature->GetGUID()); + + if(player->HasAura(SPELL_CORPORAL)) + player->ADD_GOSSIP_ITEM(0, "Build catapult.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + else if(player->HasAura(SPELL_LIEUTENANT)) + { + player->ADD_GOSSIP_ITEM(0, "Build catapult.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + player->ADD_GOSSIP_ITEM(0, "Build demolisher.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM(0, "Build siege engine.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + } + + player->SEND_GOSSIP_MENU(_creature->GetNpcTextId(), _creature->GetGUID()); + return true; +} + +bool GossipSelect_npc_demolisher_engineerer(Player* player, Creature* me, uint32 uiSender, uint32 uiAction) +{ + player->CLOSE_GOSSIP_MENU(); + switch(uiAction - GOSSIP_ACTION_INFO_DEF) + { + case 0: player->CastSpell(player, 56663, false); break; + case 1: player->CastSpell(player, 56575, false); break; + case 2: player->CastSpell(player, TEAM_ID(player->GetTeam()) ? 61408 : 56661, false); break; + } + + return true; +} + +void AddSC_wintergrasp() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_demolisher_engineerer"; + newscript->pGossipHello = &GossipHello_npc_demolisher_engineerer; + newscript->pGossipSelect = &GossipSelect_npc_demolisher_engineerer; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt index 89a9e4609..44e692b71 100644 --- a/src/game/CMakeLists.txt +++ b/src/game/CMakeLists.txt @@ -293,6 +293,9 @@ SET(game_STAT_SRCS GroupReference.cpp GroupReference.h GroupRefManager.h + OutdoorPvPImpl.h + Wintergrasp.h + Wintergrasp.cpp ) add_library(game STATIC ${game_STAT_SRCS}) diff --git a/src/game/CreatureAIImpl.h b/src/game/CreatureAIImpl.h index f404f0d95..95a16d0ac 100644 --- a/src/game/CreatureAIImpl.h +++ b/src/game/CreatureAIImpl.h @@ -1,6 +1,4 @@ /* - * Copyright (C) 2005-2009 MaNGOS - * * Copyright (C) 2008-2009 Trinity * * This program is free software; you can redistribute it and/or modify diff --git a/src/game/OutdoorPvP.cpp b/src/game/OutdoorPvP.cpp index 97acf08ce..0bfc8a6e0 100644 --- a/src/game/OutdoorPvP.cpp +++ b/src/game/OutdoorPvP.cpp @@ -17,6 +17,7 @@ */ #include "OutdoorPvP.h" +#include "OutdoorPvPImpl.h" #include "OutdoorPvPMgr.h" #include "ObjectAccessor.h" #include "ObjectMgr.h" @@ -776,3 +777,7 @@ bool OutdoorPvP::HandleAreaTrigger(Player *plr, uint32 trigger) return false; } +void OutdoorPvP::RegisterZone(uint32 zoneId) +{ + sOutdoorPvPMgr.AddZone(zoneId, this); +} diff --git a/src/game/OutdoorPvP.h b/src/game/OutdoorPvP.h index c1c39c1ff..48a478b55 100644 --- a/src/game/OutdoorPvP.h +++ b/src/game/OutdoorPvP.h @@ -26,23 +26,15 @@ #define OPVP_TRIGGER_CREATURE_ENTRY 12999 -enum ObjectiveStates{ - OBJECTIVESTATE_NEUTRAL = 0, - OBJECTIVESTATE_ALLIANCE = 1, - OBJECTIVESTATE_HORDE = 2, - OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE = 3, - OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE = 4, - OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE = 5, - OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE = 6 -}; - -enum OutdoorPvPTypes{ +enum OutdoorPvPTypes +{ OUTDOOR_PVP_HP = 1, - OUTDOOR_PVP_NA = 2, - OUTDOOR_PVP_TF = 3, - OUTDOOR_PVP_ZM = 4, - OUTDOOR_PVP_SI = 5, - OUTDOOR_PVP_EP = 6 + OUTDOOR_PVP_NA, + OUTDOOR_PVP_TF, + OUTDOOR_PVP_ZM, + OUTDOOR_PVP_SI, + OUTDOOR_PVP_EP, + OPVP_WINTERGRASP, }; // struct for go spawning @@ -220,6 +212,8 @@ protected: // players in the zones of this outdoorpvp, 0 - alliance, 1 - horde std::set m_PlayerGuids[2]; uint32 m_TypeId; + + void RegisterZone(uint32 zoneid); }; #endif /*OUTDOOR_PVP_H_*/ diff --git a/src/game/OutdoorPvPEP.cpp b/src/game/OutdoorPvPEP.cpp index fc688314e..4eddab08a 100644 --- a/src/game/OutdoorPvPEP.cpp +++ b/src/game/OutdoorPvPEP.cpp @@ -789,7 +789,7 @@ OutdoorPvPEP::OutdoorPvPEP() bool OutdoorPvPEP::SetupOutdoorPvP() { for(int i = 0; i < EPBuffZonesNum; ++i) - sOutdoorPvPMgr.AddZone(EPBuffZones[i],this); + RegisterZone(EPBuffZones[i]); m_OutdoorPvPObjectives.push_back(new OutdoorPvPObjectiveEP_EWT(this)); m_OutdoorPvPObjectives.push_back(new OutdoorPvPObjectiveEP_PWT(this)); diff --git a/src/game/OutdoorPvPEP.h b/src/game/OutdoorPvPEP.h index 08d31de5c..f6199ac5a 100644 --- a/src/game/OutdoorPvPEP.h +++ b/src/game/OutdoorPvPEP.h @@ -19,7 +19,7 @@ #ifndef OUTDOOR_PVP_EP_ #define OUTDOOR_PVP_EP_ -#include "OutdoorPvP.h" +#include "OutdoorPvPImpl.h" #include "DBCStructure.h" diff --git a/src/game/OutdoorPvPHP.cpp b/src/game/OutdoorPvPHP.cpp index 6058b82c1..60ceb7f4e 100644 --- a/src/game/OutdoorPvPHP.cpp +++ b/src/game/OutdoorPvPHP.cpp @@ -70,7 +70,7 @@ bool OutdoorPvPHP::SetupOutdoorPvP() m_HordeTowersControlled = 0; // add the zones affected by the pvp buff for(int i = 0; i < OutdoorPvPHPBuffZonesNum; ++i) - sOutdoorPvPMgr.AddZone(OutdoorPvPHPBuffZones[i],this); + RegisterZone(OutdoorPvPHPBuffZones[i]); m_OutdoorPvPObjectives.push_back(new OutdoorPvPObjectiveHP(this,HP_TOWER_BROKEN_HILL)); diff --git a/src/game/OutdoorPvPHP.h b/src/game/OutdoorPvPHP.h index a538f82b2..7ccccd2fa 100644 --- a/src/game/OutdoorPvPHP.h +++ b/src/game/OutdoorPvPHP.h @@ -19,7 +19,7 @@ #ifndef OUTDOOR_PVP_HP_ #define OUTDOOR_PVP_HP_ -#include "OutdoorPvP.h" +#include "OutdoorPvPImpl.h" #define OutdoorPvPHPBuffZonesNum 6 // HP, citadel, ramparts, blood furnace, shattered halls, mag's lair diff --git a/src/game/OutdoorPvPImpl.h b/src/game/OutdoorPvPImpl.h new file mode 100644 index 000000000..17602b073 --- /dev/null +++ b/src/game/OutdoorPvPImpl.h @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2008-2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef OUTDOORPVP_IMPL_H +#define OUTDOORPVP_IMPL_H + +#include "SharedDefines.h" +#include "OutdoorPvP.h" +#include "Player.h" + +#define TEAM_ID(a) (a == ALLIANCE ? 0 : 1) + +enum ObjectiveStates +{ + OBJECTIVESTATE_NEUTRAL = 0, + OBJECTIVESTATE_ALLIANCE, + OBJECTIVESTATE_HORDE, + OBJECTIVESTATE_NEUTRAL_ALLIANCE_CHALLENGE, + OBJECTIVESTATE_NEUTRAL_HORDE_CHALLENGE, + OBJECTIVESTATE_ALLIANCE_HORDE_CHALLENGE, + OBJECTIVESTATE_HORDE_ALLIANCE_CHALLENGE, +}; + +#endif diff --git a/src/game/OutdoorPvPMgr.cpp b/src/game/OutdoorPvPMgr.cpp index 2050a6c11..4016b84a7 100644 --- a/src/game/OutdoorPvPMgr.cpp +++ b/src/game/OutdoorPvPMgr.cpp @@ -23,6 +23,7 @@ #include "OutdoorPvPZM.h" #include "OutdoorPvPSI.h" #include "OutdoorPvPEP.h" +#include "Wintergrasp.h" #include "Player.h" #include "Policies/SingletonImp.h" @@ -125,6 +126,19 @@ void OutdoorPvPMgr::InitOutdoorPvP() m_OutdoorPvPSet.push_back(pOP); sLog.outDebug("OutdoorPvP : EP successfully initiated."); } + + pOP = new OPvPWintergrasp; + // respawn, init variables + if(!pOP->SetupOutdoorPvP()) + { + sLog.outDebug("OutdoorPvP : Wintergrasp init failed."); + delete pOP; + } + else + { + m_OutdoorPvPSet.push_back(pOP); + sLog.outDebug("OutdoorPvP : Wintergrasp successfully initiated."); + } } void OutdoorPvPMgr::AddZone(uint32 zoneid, OutdoorPvP *handle) diff --git a/src/game/OutdoorPvPNA.cpp b/src/game/OutdoorPvPNA.cpp index 9030337f2..c46c92a64 100644 --- a/src/game/OutdoorPvPNA.cpp +++ b/src/game/OutdoorPvPNA.cpp @@ -256,7 +256,7 @@ bool OutdoorPvPNA::SetupOutdoorPvP() { // m_TypeId = OUTDOOR_PVP_NA; _MUST_ be set in ctor, because of spawns cleanup // add the zones affected by the pvp buff - sOutdoorPvPMgr.AddZone(NA_BUFF_ZONE,this); + RegisterZone(NA_BUFF_ZONE); // halaa m_obj = new OutdoorPvPObjectiveNA(this); diff --git a/src/game/OutdoorPvPNA.h b/src/game/OutdoorPvPNA.h index 92e0b9dcb..15b314d4e 100644 --- a/src/game/OutdoorPvPNA.h +++ b/src/game/OutdoorPvPNA.h @@ -21,7 +21,7 @@ // TODO: "sometimes" set to neutral -#include "OutdoorPvP.h" +#include "OutdoorPvPImpl.h" // kill credit for pks const uint32 NA_CREDIT_MARKER = 24867; diff --git a/src/game/OutdoorPvPObjectiveAI.cpp b/src/game/OutdoorPvPObjectiveAI.cpp index 233fffd6b..35247d812 100644 --- a/src/game/OutdoorPvPObjectiveAI.cpp +++ b/src/game/OutdoorPvPObjectiveAI.cpp @@ -21,6 +21,7 @@ #include "Player.h" #include "Unit.h" #include "OutdoorPvPMgr.h" +#include "OutdoorPvPImpl.h" #include "World.h" #define MAX_OUTDOOR_PVP_DISTANCE 200 // the max value in capture point type go data0 is 100 currently, so use twice that much to handle leaving as well diff --git a/src/game/OutdoorPvPSI.cpp b/src/game/OutdoorPvPSI.cpp index 366c59233..0f61e6c3f 100644 --- a/src/game/OutdoorPvPSI.cpp +++ b/src/game/OutdoorPvPSI.cpp @@ -58,7 +58,7 @@ void OutdoorPvPSI::UpdateWorldState() bool OutdoorPvPSI::SetupOutdoorPvP() { for(int i = 0; i < OutdoorPvPSIBuffZonesNum; ++i) - sOutdoorPvPMgr.AddZone(OutdoorPvPSIBuffZones[i],this); + RegisterZone(OutdoorPvPSIBuffZones[i]); return true; } diff --git a/src/game/OutdoorPvPSI.h b/src/game/OutdoorPvPSI.h index 1f2331b42..3b60cb525 100644 --- a/src/game/OutdoorPvPSI.h +++ b/src/game/OutdoorPvPSI.h @@ -19,7 +19,7 @@ #ifndef OUTDOOR_PVP_SI_ #define OUTDOOR_PVP_SI_ -#include "OutdoorPvP.h" +#include "OutdoorPvPImpl.h" const uint32 SI_SILITHYST_FLAG_GO_SPELL = 29518; diff --git a/src/game/OutdoorPvPTF.cpp b/src/game/OutdoorPvPTF.cpp index 01b224cff..5c4ed9dd7 100644 --- a/src/game/OutdoorPvPTF.cpp +++ b/src/game/OutdoorPvPTF.cpp @@ -276,7 +276,7 @@ bool OutdoorPvPTF::SetupOutdoorPvP() // add the zones affected by the pvp buff for(int i = 0; i < OutdoorPvPTFBuffZonesNum; ++i) - sOutdoorPvPMgr.AddZone(OutdoorPvPTFBuffZones[i],this); + RegisterZone(OutdoorPvPTFBuffZones[i]); m_OutdoorPvPObjectives.push_back(new OutdoorPvPObjectiveTF(this,TF_TOWER_NW)); m_OutdoorPvPObjectives.push_back(new OutdoorPvPObjectiveTF(this,TF_TOWER_N)); diff --git a/src/game/OutdoorPvPTF.h b/src/game/OutdoorPvPTF.h index 255ddb1fd..2d99a93c7 100644 --- a/src/game/OutdoorPvPTF.h +++ b/src/game/OutdoorPvPTF.h @@ -1,7 +1,7 @@ #ifndef OUTDOOR_PVP_TF_ #define OUTDOOR_PVP_TF_ -#include "OutdoorPvP.h" +#include "OutdoorPvPImpl.h" const uint32 OutdoorPvPTFBuffZonesNum = 5; diff --git a/src/game/OutdoorPvPZM.cpp b/src/game/OutdoorPvPZM.cpp index 6077a0ba6..156251773 100644 --- a/src/game/OutdoorPvPZM.cpp +++ b/src/game/OutdoorPvPZM.cpp @@ -203,7 +203,7 @@ bool OutdoorPvPZM::SetupOutdoorPvP() // add the zones affected by the pvp buff for(int i = 0; i < OutdoorPvPZMBuffZonesNum; ++i) - sOutdoorPvPMgr.AddZone(OutdoorPvPZMBuffZones[i],this); + RegisterZone(OutdoorPvPZMBuffZones[i]); m_OutdoorPvPObjectives.push_back(new OutdoorPvPObjectiveZM_Beacon(this,ZM_BEACON_WEST)); m_OutdoorPvPObjectives.push_back(new OutdoorPvPObjectiveZM_Beacon(this,ZM_BEACON_EAST)); diff --git a/src/game/OutdoorPvPZM.h b/src/game/OutdoorPvPZM.h index 405c0133b..f4a60f8c8 100644 --- a/src/game/OutdoorPvPZM.h +++ b/src/game/OutdoorPvPZM.h @@ -19,7 +19,7 @@ #ifndef OUTDOOR_PVP_ZM_ #define OUTDOOR_PVP_ZM_ -#include "OutdoorPvP.h" +#include "OutdoorPvPImpl.h" #include "Language.h" const uint32 OutdoorPvPZMBuffZonesNum = 5; diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp index 9dd36895d..d05c7085b 100644 --- a/src/game/Vehicle.cpp +++ b/src/game/Vehicle.cpp @@ -45,10 +45,11 @@ void Vehicle::AddToWorld() AIM_Initialize(); switch(GetEntry()) { - case 27850:InstallAccessory(27905,1);break; - case 28312:InstallAccessory(28319,7);break; - case 32627:InstallAccessory(32629,7);break; + case 27850:InstallAccessory(27905,1);break; + case 28312:InstallAccessory(28319,7);break; + case 32627:InstallAccessory(32629,7);break; } + //setPowerType(POWER_ENERGY);SetMaxPower(POWER_ENERGY, 100); } } @@ -84,6 +85,9 @@ void Vehicle::setDeathState(DeathState s) // overwrite vir void Vehicle::Update(uint32 diff) { Creature::Update(diff); + //310 + //if(getPowerType() == POWER_ENERGY) + // ModifyPower(POWER_ENERGY, 1); } bool Vehicle::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 vehicleId, uint32 team) diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp new file mode 100644 index 000000000..a2cbb3d7c --- /dev/null +++ b/src/game/Wintergrasp.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (C) 2008-2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "Wintergrasp.h" +#include "SpellAuras.h" +#include "Vehicle.h" + +bool OPvPWintergrasp::SetupOutdoorPvP() +{ + RegisterZone(ZONE_WINTERGRASP); + return true; +} + +void OPvPWintergrasp::HandlePlayerEnterZone(Player * plr, uint32 zone) +{ + if(!plr->HasAura(SPELL_RECRUIT) && !plr->HasAura(SPELL_CORPORAL) + && !plr->HasAura(SPELL_LIEUTENANT)) + plr->CastSpell(plr, SPELL_RECRUIT, true); + OutdoorPvP::HandlePlayerEnterZone(plr, zone); +} + +void OPvPWintergrasp::HandlePlayerLeaveZone(Player * plr, uint32 zone) +{ + if(plr->m_Vehicle) + plr->m_Vehicle->Dismiss(); + OutdoorPvP::HandlePlayerLeaveZone(plr, zone); +} + +void OPvPWintergrasp::HandleKill(Player *killer, Unit *victim) +{ + if(victim->GetTypeId() == TYPEID_PLAYER) + { + // We handle promotion here because player should not get promotion if he has buff but do the kill outside the zone + if(victim->getLevel() >= 70) + { + if(Aura *aur = killer->GetAura(SPELL_RECRUIT)) + { + if(aur->GetStackAmount() >= 5) + { + killer->RemoveAura(SPELL_RECRUIT); + killer->CastSpell(killer, SPELL_CORPORAL, true); + } + else + killer->CastSpell(killer, SPELL_RECRUIT, true); + } + else if(Aura *aur = killer->GetAura(SPELL_CORPORAL)) + { + if(aur->GetStackAmount() >= 5) + { + killer->RemoveAura(SPELL_CORPORAL); + killer->CastSpell(killer, SPELL_LIEUTENANT, true); + } + else + killer->CastSpell(killer, SPELL_CORPORAL, true); + } + else if(killer->HasAura(SPELL_LIEUTENANT)) + killer->CastSpell(killer, SPELL_LIEUTENANT, true); + } + } +} diff --git a/src/game/Wintergrasp.h b/src/game/Wintergrasp.h new file mode 100644 index 000000000..1a698c4c1 --- /dev/null +++ b/src/game/Wintergrasp.h @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2008-2009 Trinity + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef TRINITY_WINTERGRASP_H +#define TRINITY_WINTERGRASP_H + +#include "OutdoorPvPImpl.h" + +#define ZONE_WINTERGRASP 4197 + +#define SPELL_RECRUIT 37795 +#define SPELL_CORPORAL 33280 +#define SPELL_LIEUTENANT 55629 + +#define SPELL_TENICITY 58549 +#define SPELL_TENICITY_VEHICLE 59911 + +class OPvPWintergrasp : public OutdoorPvP +{ + public: + bool SetupOutdoorPvP(); + void HandlePlayerEnterZone(Player *plr, uint32 zone); + void HandlePlayerLeaveZone(Player *plr, uint32 zone); + void HandleKill(Player *killer, Unit *victim); +}; + +#endif diff --git a/win/VC80/game.vcproj b/win/VC80/game.vcproj index 002b5e7fb..9b37bb359 100644 --- a/win/VC80/game.vcproj +++ b/win/VC80/game.vcproj @@ -841,70 +841,6 @@ RelativePath="..\..\src\game\ObjectGridLoader.h" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1690,6 +1626,86 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/win/VC90/game.vcproj b/win/VC90/game.vcproj index 15fc293a0..ebe03efaa 100644 --- a/win/VC90/game.vcproj +++ b/win/VC90/game.vcproj @@ -842,70 +842,6 @@ RelativePath="..\..\src\game\ObjectGridLoader.h" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1691,6 +1627,86 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +