Register for your free account! | Forgot your password?

Go Back   elitepvpers › MMORPGs › Flyff › Flyff Private Server
You last visited: Today at 17:09

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Help] Restrict Shops to Saint Morning

Discussion on [Help] Restrict Shops to Saint Morning within the Flyff Private Server forum part of the Flyff category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2020
Posts: 26
Received Thanks: 3
[Help] Restrict Shops to Saint Morning

Hi, this part of code is not working for me? Can anyone help me?

Code:
#ifdef __ALLOW_VENDING_AREA
        switch (CContinent::GetInstance()->GetContinent(pUser))
        {
        case TOWN_SAINCITY:
        case CONT_SAINTMORNING:
            break;
        default:
            pUser->AddText("You must be in Saint City to open a shop!");
            return;
            break;
        }
#endif //__ALLOW_VENDING_AREA
I added it under CDPSrvr::OnPVendorOpen
I can still open a shop, but the shop title doesn't appear.
Also the pUser->AddText is not appearing
Leese is offline  
Old   #2
 
Hyellow's Avatar
 
elite*gold: 0
Join Date: Feb 2020
Posts: 64
Received Thanks: 23
Try this one. If you want to restrict player to vend from Faris.

Under:
Code:
		if( !( pUser->HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_FONTEDIT ) ) )
			ParsingEffect(szPVendor, strlen(szPVendor) );
Add this:
Code:
		//__DISABLE_VEND
		switch (CContinent::GetInstance()->GetContinent(pUser))
		{
		case TOWN_FLARINENOSPLE:
		case CONT_FLARIS:
		{
			pUser->AddText("You're not allowed to vend here!");
			return;
			break;
		}
		}
		//__DISABLE_VEND
Hyellow is offline  
Thanks
1 User
Old   #3
 
Ecrypter's Avatar
 
elite*gold: 0
Join Date: Aug 2014
Posts: 653
Received Thanks: 218
Define it in your versioncomon.h Worldserver
Ecrypter is offline  
Old   #4
 
elite*gold: 0
Join Date: Apr 2020
Posts: 26
Received Thanks: 3
Quote:
Originally Posted by Hyellow View Post
Try this one. If you want to restrict player to vend from Faris.

Under:
Code:
		if( !( pUser->HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_FONTEDIT ) ) )
			ParsingEffect(szPVendor, strlen(szPVendor) );
Add this:
Code:
		//__DISABLE_VEND
		switch (CContinent::GetInstance()->GetContinent(pUser))
		{
		case TOWN_FLARINENOSPLE:
		case CONT_FLARIS:
		{
			pUser->AddText("You're not allowed to vend here!");
			return;
			break;
		}
		}
		//__DISABLE_VEND
Thank you! will try this soon.

Quote:
Originally Posted by Ecrypter View Post
Define it in your versioncomon.h Worldserver
Ofcourse did this ^^
Leese is offline  
Old   #5
 
Hyellow's Avatar
 
elite*gold: 0
Join Date: Feb 2020
Posts: 64
Received Thanks: 23
Quote:
Originally Posted by Leese View Post
Thank you! will try this soon.
Np, lemme know if it works. ^_^
Hyellow is offline  
Old   #6
 
Ecrypter's Avatar
 
elite*gold: 0
Join Date: Aug 2014
Posts: 653
Received Thanks: 218
Quote:
Originally Posted by Leese View Post
Hi, this part of code is not working for me? Can anyone help me?

Code:
#ifdef __ALLOW_VENDING_AREA
        switch (CContinent::GetInstance()->GetContinent(pUser))
        {
        case TOWN_SAINCITY:
        case CONT_SAINTMORNING:
            break;
        default:
            pUser->AddText("You must be in Saint City to open a shop!");
            return;
            break;
        }
#endif //__ALLOW_VENDING_AREA
Actually your code is allowing to create private shop in saint morning

I added it under CDPSrvr::OnPVendorOpen
I can still open a shop, but the shop title doesn't appear.
Also the pUser->AddText is not appearing

find this:
Add this below
PHP Code:
#ifdef __ALLOW_VENDING_AREA
  
switch( CContinent::GetInstance()->GetContinent( pUser ) )
  {
   case 
TOWN_FLARINENOSPLE:
   case 
CONT_FLARIS:
    break;
   default:
    
pUser->AddText("You must be in Flaris to open a shop!");
    return;
    break;
  }
#endif //__ALLOW_VENDING_AREA 
// ´ëÀüÀå¿¡¼*´Â °³ÀλóÁ¡À» ¿*¼ö ¾ø½À´Ï´Ù.
CWorld* pWorld = pUser->GetWorld();
if( pWorld && pWorld->GetID() == WI_WORLD_GUILDWAR )
{
pUser->AddText( prj.GetText(TID_GAME_GUILDCOMBAT_CANNOT_TRADE) ); //±æµå´ëÀüÀå ¿¡¼*´Â °Å·¡¿¡ °üÇÑ ¸ðµç°ÍµéÀ» ÀÌ¿ë ÇÒ ¼ö ¾ø½À´Ï´Ù.
return;
}
#if __VER >= 11 // __GUILD_COMBAT_1TO1
if( g_GuildCombat1to1Mng.IsPossibleUser( pUser ) )
{
pUser->AddText( prj.GetText(TID_GAME_GUILDCOMBAT_CANNOT_TRADE) ); //±æµå´ëÀüÀå ¿¡¼*´Â °Å·¡¿¡ °üÇÑ ¸ðµç°ÍµéÀ» ÀÌ¿ë ÇÒ ¼ö ¾ø½À´Ï´Ù.
return;
}
#endif // __GUILD_COMBAT_1TO1
Ecrypter is offline  
Old   #7
 
Hyellow's Avatar
 
elite*gold: 0
Join Date: Feb 2020
Posts: 64
Received Thanks: 23
According to ____

TOWN Stuff is not necessary if it comes about this issue.

WorldServer (VersionCommon.h)
Code:
#define  __SM_SHOPS_ONLY
DPSrver.cpp
Code:
void CDPSrvr::OnPVendorOpen( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
{
	if( uBufSize > 55 )	// 4 + 4 + 48 - 1		= 55
		return;

	char szPVendor[MAX_VENDORNAME];	// °³ÀÎ »óÁ¡ À̸§( 48 )
	ar.ReadString( szPVendor, MAX_VENDORNAME );	

	CUser* pUser	= g_UserMng.GetUser( dpidCache, dpidUser );
	if( IsValidObj( pUser ) )
	{
/*		
#ifdef __Y_BEAUTY_SHOP_CHARGE
		if( ::GetLanguage() == LANG_TWN )
		{
			if( !(pUser->HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_VENDOR ) ) )
			{
				return;
			}
		}
#endif //__Y_BEAUTY_SHOP_CHARGE
*/

#ifdef __RULE_0615
		if( prj.IsInvalidName( szPVendor ) || prj.IsAllowedLetter( szPVendor, TRUE ) == FALSE )
			pUser->AddDiagText( prj.GetText( TID_DIAG_0020 ) ); 
#endif	// __RULE_0615

		if( !( pUser->HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_FONTEDIT ) ) )
			ParsingEffect(szPVendor, strlen(szPVendor) );
		
		// ´ëÀüÀå¿¡¼*´Â °³ÀλóÁ¡À» ¿*¼ö ¾ø½À´Ï´Ù.
		CWorld* pWorld = pUser->GetWorld();

#ifdef __SM_SHOPS_ONLY
		switch (CContinent::GetInstance()->GetContinent(pUser))
		{
		case CONT_SAINTMORNING:
			break;
		default:
			pUser->AddText("You can only open personal shops in saint morning.");
			return;
			break;
	}
#endif //__SM_SHOPS_ONLY

		if( pWorld && pWorld->GetID() == WI_WORLD_GUILDWAR )
		{			
			pUser->AddText( prj.GetText(TID_GAME_GUILDCOMBAT_CANNOT_TRADE) ); //±æµå´ëÀüÀå ¿¡¼*´Â °Å·¡¿¡ °üÇÑ ¸ðµç°ÍµéÀ» ÀÌ¿ë ÇÒ ¼ö ¾ø½À´Ï´Ù.
			return;
		}
Hyellow is offline  
Old   #8
 
elite*gold: 0
Join Date: Apr 2020
Posts: 26
Received Thanks: 3
Quote:
Originally Posted by Hyellow View Post
According to ____

TOWN Stuff is not necessary if it comes about this issue.

WorldServer (VersionCommon.h)
Code:
#define  __SM_SHOPS_ONLY
DPSrver.cpp
Code:
void CDPSrvr::OnPVendorOpen( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
{
	if( uBufSize > 55 )	// 4 + 4 + 48 - 1		= 55
		return;

	char szPVendor[MAX_VENDORNAME];	// °³ÀÎ »óÁ¡ À̸§( 48 )
	ar.ReadString( szPVendor, MAX_VENDORNAME );	

	CUser* pUser	= g_UserMng.GetUser( dpidCache, dpidUser );
	if( IsValidObj( pUser ) )
	{
/*		
#ifdef __Y_BEAUTY_SHOP_CHARGE
		if( ::GetLanguage() == LANG_TWN )
		{
			if( !(pUser->HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_VENDOR ) ) )
			{
				return;
			}
		}
#endif //__Y_BEAUTY_SHOP_CHARGE
*/

#ifdef __RULE_0615
		if( prj.IsInvalidName( szPVendor ) || prj.IsAllowedLetter( szPVendor, TRUE ) == FALSE )
			pUser->AddDiagText( prj.GetText( TID_DIAG_0020 ) ); 
#endif	// __RULE_0615

		if( !( pUser->HasBuff( BUFF_ITEM, II_SYS_SYS_SCR_FONTEDIT ) ) )
			ParsingEffect(szPVendor, strlen(szPVendor) );
		
		// ´ëÀüÀå¿¡¼*´Â °³ÀλóÁ¡À» ¿*¼ö ¾ø½À´Ï´Ù.
		CWorld* pWorld = pUser->GetWorld();

#ifdef __SM_SHOPS_ONLY
		switch (CContinent::GetInstance()->GetContinent(pUser))
		{
		case CONT_SAINTMORNING:
			break;
		default:
			pUser->AddText("You can only open personal shops in saint morning.");
			return;
			break;
	}
#endif //__SM_SHOPS_ONLY

		if( pWorld && pWorld->GetID() == WI_WORLD_GUILDWAR )
		{			
			pUser->AddText( prj.GetText(TID_GAME_GUILDCOMBAT_CANNOT_TRADE) ); //±æµå´ëÀüÀå ¿¡¼*´Â °Å·¡¿¡ °üÇÑ ¸ðµç°ÍµéÀ» ÀÌ¿ë ÇÒ ¼ö ¾ø½À´Ï´Ù.
			return;
		}
Okay so, it works right now. Made a mistake by tweaking the AddText function.

Problem right now is, a player has to press the button of opening the shop first before the error pops up.

Scenario I would love to have:
Player clicks "Private Shop" in Continent/Region -> Error or Window directly pops up.

Can I make this continent/region check client sided instead of server sided?
Leese is offline  
Old   #9
 
elite*gold: 0
Join Date: Aug 2010
Posts: 67
Received Thanks: 42
Of course you can. Do it like I did. You put in DPSrvr.cpp CDPSrvr::OnPVendorOpen under:
Code:
if( IsValidObj( pUser ) )
{
This:
Code:
if( CContinent::GetInstance()->GetContinent(pUser) != CONT_SAINTMORNING )
	return;
In WndVendor.cpp under:
Code:
if( g_pPlayer->m_vtInfo.VendorIsVendor() == FALSE )
	return TRUE;
Put this:
Code:
if( CContinent::GetInstance()->GetMapNo(g_pPlayer) != 4 )
{
	g_WndMng.PutString( "Du kannst nur in Saint Morning einen Shop aufmachen." );
	return TRUE;
}
Dont forget to include Continent.h at the beginning of WndVendor.cpp otherwise you will get error
Code:
#include "Continent.h"
The message will come, once you press the button.
Knusper02 is offline  
Thanks
2 Users
Old   #10
 
elite*gold: 0
Join Date: Apr 2020
Posts: 26
Received Thanks: 3
Quote:
Originally Posted by Knusper02 View Post
Of course you can. Do it like I did. You put in DPSrvr.cpp CDPSrvr::OnPVendorOpen under:
Code:
if( IsValidObj( pUser ) )
{
This:
Code:
if( CContinent::GetInstance()->GetContinent(pUser) != CONT_SAINTMORNING )
	return;
In WndVendor.cpp under:
Code:
if( g_pPlayer->m_vtInfo.VendorIsVendor() == FALSE )
	return TRUE;
Put this:
Code:
if( CContinent::GetInstance()->GetMapNo(g_pPlayer) != 4 )
{
	g_WndMng.PutString( "Du kannst nur in Saint Morning einen Shop aufmachen." );
	return TRUE;
}
Dont forget to include Continent.h at the beginning of WndVendor.cpp otherwise you will get error
Code:
#include "Continent.h"
The message will come, once you press the button.
That was exactly what I needed, thank you so much <3

#closerequest
Leese is offline  
Reply


Similar Threads Similar Threads
Saint Morning Crash! :/ help...
02/18/2013 - Flyff Private Server - 2 Replies
Hay, Leute ich weiß nemme weiter.... ich kann mich überal hin teleportieren... auser nach sm egal ob mit dem Teleporter oder Mit einem Blinkwing... wenn ich mich teleportet habe hat der client ein standbild und crashed.... Error: mfg. Kevin
Flaris + Saint Morning NPC Spawn
09/14/2008 - Flyff Private Server - 3 Replies
Halli Hallo, Ich hör auf mit Pserver bis alle DBs zum Download zu 100% sind. Macht keinen Sinn oder ich spiel einfach nurnoch Offi Server. Also sagen wir so, habe Flaris full Npc gespawned, bis auf Frankie, hab den ned gefunden. Saint Morning, eigtl.alle bis auf die oben bei Station, die Theaterkinder und einen noch, sonst alle wichtigen. RapidShare: Easy Filehosting Viel Spaß, hoffe es bringt euch weiter :)



All times are GMT +1. The time now is 17:10.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.