Jump to content

GameMaster Restriction without SQL


Recommended Posts

First u need the IsLowGM function.

//char.cpp
add under
BOOL CHARACTER::IsGM() const

this
BOOL CHARACTER::IsLowGM() const
{
	return m_pointsInstant.gm_level > GM_PLAYER && m_pointsInstant.gm_level > GM_HIGH_WIZARD && m_pointsInstant.gm_level < GM_IMPLEMENTOR;
}

//char.h
add under
BOOL 			IsGM() const;

this
BOOL			IsLowGM() const;

now let's restrict some actions for GM

//char.cpp
void CHARACTER::PartyInvite(LPCHARACTER pchInvitee)
 add under
 	else if (pchInvitee->IsBlockMode(BLOCK_PARTY_INVITE))
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<ÆÄƼ> %s ´ÔÀÌ ÆÄƼ °ÅºÎ »óÅÂÀÔ´Ï´Ù."), pchInvitee->GetName());
		return;
	}
	
this

	else if (IsLowGM() == true && pchInvitee->IsLowGM() == false)
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Party> You cannot send a party invitation to a player!"));
		return;
	}
	else if (IsLowGM() == false && pchInvitee->IsLowGM() == true)
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<Party> You cannot send a party invitation to a GameMaster!"));
		return;
	}

void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, BYTE bItemCount)
add
	if (IsLowGM())
	{
		ChatPacket(CHAT_TYPE_INFO, "You can't open shop! You are GM!");
		return;
	}
//end char.cpp

//exchange.cpp
bool CHARACTER::ExchangeStart(LPCHARACTER victim)
add
	if (!IsLowGM() && victim->IsLowGM())
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot trade items with a Game Master."));
		return false;
	}
	if (IsLowGM() && !victim->IsLowGM())
	{
		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Game Masters cannot trade items with players."));
		return false;
	}
//end exchange.cpp

//shop_manager.cpp
void CShopManager::Buy(LPCHARACTER ch, BYTE pos)
add
	if (ch->IsLowGM() && pkShop->IsPCShop())
	{
		ch->ChatPacket(CHAT_TYPE_INFO, "GameMasters cannot buy items from players' shops.");
		return;
	}
//end shop_manager.cpp

and for offlineshop
//offlineshop_manager.cpp
void COfflineShopManager::Buy(LPCHARACTER ch, BYTE pos)
add
	if (ch->IsLowGM())
	{
		ch->ChatPacket(CHAT_TYPE_INFO, "GameMasters cannot buy items from players' shops.");
		return;
	}
//end offlineshop_manager.cpp

GL ✌?️

  • Confused 2
  • Love 3
Link to comment
Share on other sites

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.