void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); Battleground* pBG = _player->GetBattleground(); uint64 guid; recv_data >> guid; Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); if(!unit) return; if(!unit->isSpiritService()) // it's not spirit service return; if(pBG) sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, pBG, guid); else { // Wintergrasp Hack till 3.2 and it's implemented as BG if(GetPlayer()->GetZoneId() == 4197) { OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197); if(pvpWG && pvpWG->isWarTime()) pvpWG->SendAreaSpiritHealerQueryOpcode(_player, guid); } } }
void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data) { sLog->outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); Battleground *bg = _player->GetBattleground(); uint64 guid; recv_data >> guid; Creature *unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) return; if (!unit->isSpiritService()) // it's not spirit service return; if (bg) bg->AddPlayerToResurrectQueue(guid, _player->GetGUID()); else { // Wintergrasp Hack till 3.2 and it's implemented as BG if (GetPlayer()->GetZoneId() == 4197) { OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197); if (pvpWG && pvpWG->isWarTime()) pvpWG->AddPlayerToResurrectQueue(guid, _player->GetGUID()); } } }
void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data) { sLog->outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); Battleground *bg = _player->GetBattleground(); uint64 guid; recv_data >> guid; Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) return; if (!unit->isSpiritService()) // it's not spirit service return; if (bg) bg->AddPlayerToResurrectQueue(guid, _player->GetGUID()); else { // Wintergrasp Hack till 3.2 and it's implemented as BG if (GetPlayer()->GetZoneId() == 4197) { OutdoorPvPWG *pvpWG = (OutdoorPvPWG*)sOutdoorPvPMgr->GetOutdoorPvPToZoneId(4197); if (pvpWG && pvpWG != 0) if (QueryResult result = CharacterDatabase.PQuery("SELECT value FROM worldstates WHERE value= '%u' AND entry = '%u'", 1, 31001)) pvpWG->SendAreaSpiritHealerQueryOpcode(_player, guid); } } }
Creature* ObjectAccessor::GetNPCIfCanInteractWith(Player const &player, uint64 guid, uint32 npcflagmask) { // unit checks if (!guid) return NULL; // exist Creature *unit = GetCreature(player, guid); if (!unit) return NULL; // player check if(!player.CanInteractWithNPCs(!unit->isSpiritService())) return NULL; // appropriate npc type if(npcflagmask && !unit->HasFlag( UNIT_NPC_FLAGS, npcflagmask )) return NULL; // alive or spirit healer if(!unit->isAlive() && (!unit->isSpiritService() || player.isAlive() )) return NULL; // not allow interaction under control if(unit->GetCharmerOrOwnerGUID()) return NULL; // not enemy if( unit->IsHostileTo(&player)) return NULL; // not unfriendly if(FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(unit->getFaction())) if(factionTemplate->faction) if(FactionEntry const* faction = sFactionStore.LookupEntry(factionTemplate->faction)) if(faction->reputationListID >= 0 && player.GetReputationMgr().GetRank(faction) <= REP_UNFRIENDLY) return NULL; // not too far if(!unit->IsWithinDistInMap(&player,INTERACTION_DISTANCE)) return NULL; return unit; }
void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); Battleground *bg = _player->GetBattleground(); uint64 guid; recv_data >> guid; Creature *unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) return; if (!unit->isSpiritService()) // it's not spirit service return; if (bg) bg->AddPlayerToResurrectQueue(guid, _player->GetGUID()); }
void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data) { sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); Battleground *bg = _player->GetBattleground(); uint64 guid; recv_data >> guid; Creature *unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) return; if (!unit->isSpiritService()) // it's not spirit service return; if (bg) sBattlegroundMgr->SendAreaSpiritHealerQueryOpcode(_player, bg, guid); }
void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket& recv_data) { DEBUG_LOG("WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); BattleGround* bg = _player->GetBattleGround(); if (!bg) return; ObjectGuid guid; recv_data >> guid; Creature* unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) return; if (!unit->isSpiritService()) // it's not spirit service return; sScriptMgr.OnGossipHello(GetPlayer(), unit); }
void WorldSession::HandleAreaSpiritHealerQueryOpcode( WorldPacket & recv_data ) { DEBUG_LOG("WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); BattleGround *bg = _player->GetBattleGround(); if (!bg) return; uint64 guid; recv_data >> guid; Creature *unit = GetPlayer()->GetMap()->GetCreature(guid); if (!unit) return; if(!unit->isSpiritService()) // it's not spirit service return; unit->SendAreaSpiritHealerQueryOpcode(GetPlayer()); }
void WorldSession::HandleAreaSpiritHealerQueueOpcode(WorldPacket & recv_data ) { sLog.outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUEUE"); BattleGround *bg = _player->GetBattleGround(); if (!bg) return; uint64 guid; recv_data >> guid; Creature *unit = ObjectAccessor::GetCreature(*_player, guid); if (!unit) return; if (!unit->isSpiritService()) // it's not spirit service return; bg->AddPlayerToResurrectQueue(guid, _player->GetGUID()); }
void WorldSession::HandleAreaSpiritHealerQueryOpcode(WorldPacket & recv_data ) { sLog.outDebug("WORLD: CMSG_AREA_SPIRIT_HEALER_QUERY"); BattleGround *bg = _player->GetBattleGround(); if (!bg) return; uint64 guid; recv_data >> guid; Creature *unit = ObjectAccessor::GetCreature(*_player, guid); if (!unit) return; if (!unit->isSpiritService()) // it's not spirit service return; sBattleGroundMgr.SendAreaSpiritHealerQueryOpcode(_player, bg, guid); }