//.gm active bool ChatHandler::HandleGMActiveCommand(const char* args, WorldSession* m_session) { auto player = m_session->GetPlayer(); bool toggle_no_notice = std::string(args) == "no_notice" ? true : false; if (player->isGMFlagSet()) { if (!toggle_no_notice) { SystemMessage(m_session, "GM Flag removed."); BlueSystemMessage(m_session, "<GM> Will no longer show in chat messages or above your name until you use this command again."); } player->removePlayerFlags(PLAYER_FLAG_GM); player->SetFaction(player->GetInitialFactionId()); player->UpdatePvPArea(); player->UpdateVisibility(); } else { if (player->hasPlayerFlags(PLAYER_FLAG_DEVELOPER)) HandleGMDevTagCommand("no_notice", m_session); SystemMessage(m_session, "GM Flag set."); BlueSystemMessage(m_session, "<GM> will now appear above your name and in chat messages until you use this command again."); player->addPlayerFlags(PLAYER_FLAG_GM); player->SetFaction(35); player->RemovePvPFlag(); player->UpdateVisibility(); } return true; }
void CompanionSummon::Load(CreatureProto* proto, Unit* owner, LocationVector & position, uint32 spellid, int32 summonslot) { Summon::Load(proto, owner, position, spellid, summonslot); SetFaction(35); setLevel(1); m_aiInterface->Init(this, AITYPE_PET, MOVEMENTTYPE_NONE, owner); m_aiInterface->SetUnitToFollow(owner); m_aiInterface->SetUnitToFollowAngle(-M_PI_FLOAT / 2); m_aiInterface->SetFollowDistance(3.0f); m_aiInterface->disable_melee = true; bInvincible = true; RemovePvPFlag(); RemoveFFAPvPFlag(); }
void Summon::Load(CreatureProto* proto, Unit* owner, LocationVector & position, uint32 spellid, int32 summonslot) { ARCEMU_ASSERT(owner != NULL); Creature::Load(proto, owner->GetMapMgr(), position.x, position.y, position.z, position.o); SetFaction(owner->GetFaction()); Phase(PHASE_SET, owner->GetPhase()); SetZoneId(owner->GetZoneId()); SetCreatedBySpell(spellid); this->summonslot = summonslot; if (owner->IsPvPFlagged()) SetPvPFlag(); else RemovePvPFlag(); if (owner->IsFFAPvPFlagged()) SetFFAPvPFlag(); else RemoveFFAPvPFlag(); if (owner->IsSanctuaryFlagged()) SetSanctuaryFlag(); else RemoveSanctuaryFlag(); SetCreatedByGUID(owner->GetGUID()); if (owner->GetSummonedByGUID() == 0) SetSummonedByGUID(owner->GetGUID()); else SetSummonedByGUID(owner->GetSummonedByGUID()); this->owner = owner; if (owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE)) SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); }