enum GuildHousesPvP{ GUILDHOUSEPVPMAPID = 1, // MapId};class TestScript : public PlayerScript{public: TestScript() : PlayerScript("Test_Script") { } struct Test_Script_Guards : public PlayerScript { void OnMapChanged(Player* player) override ///@TODO: Maybe MapScript OnMapUpdate is more effective here ? Would be ugly because you'd have to get every player on map.... meh. { if (player->GetMapId() == GUILDHOUSEPVPMAPID && player->GetGuildId() != 0) // Note: NULL is 0, just NULL is commonly used for strings (Readability) /*Set faction for NPC GUIDs to whatever is approperiate. Handle it by getting the guids of guards.*/ return; } };};class TestScriptGuild : public GuildScript ///@TODO: If OnMapUpdate is used, this can be entirely removed.{public: TestScriptGuild() : GuildScript("Test_Script_Guild") { } struct Test_Script_Guild : public GuildScript { void OnGuildRemoveMember(Guild* /*guild*/, Player* player, bool /*isDisbanding*/, bool /*isKicked*/) override { if (player->GetMapId() == GUILDHOUSEPVPMAPID) player->RepopAtGraveyard(); // Or whatever. Maybe tele to a location depending on faction. // However, first, player is kicked out if he is removed from guild (and on map). Do not allow player joining the map without guild in the first place and we are good. return; } };};