Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- EmuDevs OutdoorPvP Tutorial
- http://emudevs.com
- TrinityCore Tutorial
- */
- #include "OutdoorPvPHPP.h"
- OutdoorPvPHellFire::OutdoorPvPHellFire()
- {
- m_TypeId = OUTDOOR_PVP_HPP;
- hordeResources = 300;
- allyResources = 300;
- }
- bool OutdoorPvPHellFire::SetupOutdoorPvP()
- {
- for (uint8 i = 0; i < sizeof(OutdoorPvPZone) / sizeof(uint32); ++i)
- RegisterZone(OutdoorPvPZone[i]);
- return true;
- }
- void OutdoorPvPHellFire::HandlePlayerEnterZone(Player* player, uint32 zone)
- {
- ChatHandler(player->GetSession()).SendSysMessage("You have entered a war zone!");
- OutdoorPvP::HandlePlayerEnterZone(player, zone);
- }
- void OutdoorPvPHellFire::HandlePlayerLeaveZone(Player* player, uint32 zone)
- {
- OutdoorPvP::HandlePlayerLeaveZone(player, zone);
- }
- void OutdoorPvPHellFire::HandleKill(Player* player, Unit* killed)
- {
- if (killed->GetTypeId() != TYPEID_PLAYER)
- {
- switch (killed->GetEntry())
- {
- case 10000: // Horde guard
- hordeResources -= 5;
- break;
- }
- }
- OutdoorPvP::HandleKill(player, killed);
- }
- bool OutdoorPvPHellFire::Update(uint32 diff)
- {
- allyResources -= 3;
- hordeResources -= 3;
- if (allyResources <= 0)
- {
- // Horde wins
- }
- if (hordeResources <= 0)
- {
- // Ally wins
- }
- OutdoorPvP::Update(diff);
- return false;
- }
- class pvp_resource_hellfire : public OutdoorPvPScript
- {
- public:
- pvp_resource_hellfire() : OutdoorPvPScript("pvp_resource_hellfire") { }
- OutdoorPvP* GetOutdoorPvP() const
- {
- return new OutdoorPvPHellFire();
- }
- };
- void AddSC_pvp_hp()
- {
- new pvp_resource_hellfire;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement