Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Flyff > Flyff Private Server > Flyff PServer Guides & Releases
You last visited: Today at 12:52

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

Advertisement



[Source Tut] Get Perin automatically

Discussion on [Source Tut] Get Perin automatically within the Flyff PServer Guides & Releases forum part of the Flyff Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2011
Posts: 36
Received Thanks: 6
[Source Tut] Get Perin automatically

Replace AddGold function with mine:

PHP Code:
BOOL CMover::AddGoldint nGoldBOOL bSend )
{
    if( 
nGold == )
        return 
TRUE;

    
int nTotal GetGold() + nGold;

    if( 
nGold )
    {
        if( 
nTotal )        
            
nTotal INT_MAX;
    }
    else    
// nGold < 0
    
{
        if( 
nTotal )        
        {
            
nTotal    0;
        }
    }
    
SetGoldnTotal );

#ifdef __WORLDSERVER
    
if( GetGold() > 400000000 
    {
        
CItemElem itemelem;
        
itemelem.m_nItemNum 1;
        
itemelem.m_bCharged TRUE;
        
BYTE nID;
        
itemelem.m_dwItemId II_SYS_SYS_SCR_PERIN;

        for( ; 
GetGold() - PERIN_VALUE 400000000 ; )
        {
            
GetGold() -= PERIN_VALUE
        
itemelem.m_nItemNum += 1;
        }
        ( ( 
CUser*)this)->CreateItem( &itemelem, &nID );
    }
#endif __WORLDSERVER

    
if( bSend )
    {
    
#ifdef __WORLDSERVER
        
g_UserMng.AddSetPointParamthisDST_GOLDnTotal );
    
#endif    // __WORLDSERVER
    
}

    return 
TRUE;

Carlyle~ is offline  
Old 10/07/2011, 16:05   #2
 
elite*gold: 4
Join Date: Mar 2010
Posts: 3,148
Received Thanks: 1,535
what is when you activate a perin? that will be then automaticly a perin again?
Jopsi332 is offline  
Old 10/07/2011, 16:08   #3
 
elite*gold: 0
Join Date: Sep 2011
Posts: 36
Received Thanks: 6
Well, you´re right, I will modify it, just a second.

Edit:
You can activate perins until you reach 500.000.000 penya.
Carlyle~ is offline  
Old 10/07/2011, 16:11   #4
 
elite*gold: 4
Join Date: Mar 2010
Posts: 3,148
Received Thanks: 1,535
Ok thanks, than it is really userfull for me
Jopsi332 is offline  
Old 10/07/2011, 17:23   #5
 
elite*gold: 0
Join Date: Sep 2011
Posts: 36
Received Thanks: 6
I deleted the post because of duping issues.
Carlyle~ is offline  
Old 10/07/2011, 20:06   #6
 
elite*gold: 0
Join Date: Nov 2008
Posts: 13
Received Thanks: 0
It might still be useful, people can modify it, maybe?
Ultimeta is offline  
Old 10/07/2011, 20:49   #7
 
elite*gold: 0
Join Date: Sep 2011
Posts: 36
Received Thanks: 6
Ok, I fixxed duping bug.
Haven´t testes this but it should work.
Carlyle~ is offline  
Old 10/07/2011, 20:49   #8
 
elite*gold: 4
Join Date: Mar 2010
Posts: 3,148
Received Thanks: 1,535
what do you mean with modify? it works fine
Jopsi332 is offline  
Old 10/07/2011, 23:52   #9
 
elite*gold: 0
Join Date: Aug 2011
Posts: 206
Received Thanks: 117
Easily do it like this:
Code:
void CUser::AddGoldText( int nPlus )
{
	char szPlus[64];
	char szGold[64];

	sprintf( szPlus, "%d", nPlus );
	sprintf( szGold, "%d", GetGold() );

	CString strPlus = GetNumberFormatEx( szPlus );
	CString strGold = GetNumberFormatEx( szGold );

	if( GetGold() > 1900000000 )
	{
		CItemElem pItem;
		pItem.m_nItemNum = 19;
		pItem.m_bCharged = TRUE;
		pItem.m_dwItemId = II_SYS_SYS_SCR_PERIN;
		BYTE nID;
		CreateItem( &pItem, &nID );
		AddGold( -1900000000 );
	}

	AddDefinedText( TID_GAME_REAPMONEY, "%s %s", strPlus, strGold );
}
Then theres no Bug with Perin activating.. (Thx to Pumbaaa)^^
But i dont know the Function for checking full inventory, so if your inventory is full, penya would be deducted without getting Perins ^^
Yakuzai. is offline  
Old 10/08/2011, 00:43   #10
 
elite*gold: 0
Join Date: Sep 2011
Posts: 36
Received Thanks: 6
In my code there´s no perin bug too.
Next time check before posting.
Carlyle~ is offline  
Old 10/08/2011, 00:46   #11
 
elite*gold: 455
Join Date: Jun 2009
Posts: 1,601
Received Thanks: 1,103
He posted this because it's smarter than yours :b
Flash! is offline  
Thanks
1 User
Old 10/08/2011, 00:51   #12
 
elite*gold: 4
Join Date: Mar 2010
Posts: 3,148
Received Thanks: 1,535
and it is by 1,9 mrd, it s better than 500 million ;D;D
Jopsi332 is offline  
Old 10/08/2011, 01:45   #13
 
Pumbaaa's Avatar
 
elite*gold: 20
Join Date: Apr 2009
Posts: 804
Received Thanks: 828
Code:
void CUser::AddGoldText( int nPlus )
{
	char szPlus[64];
	char szGold[64];

	sprintf( szPlus, "%d", nPlus );
	sprintf( szGold, "%d", GetGold() );

	CString strPlus = GetNumberFormatEx( szPlus );
	CString strGold = GetNumberFormatEx( szGold );

	if( GetGold() > 1900000000 &&  this->m_Inventory.GetEmptyCount() < 1 )
	{
		CItemElem pItem;
		pItem.m_nItemNum = 19;
		pItem.m_bCharged = TRUE;
		pItem.m_dwItemId = II_SYS_SYS_SCR_PERIN;
		BYTE nID;
		CreateItem( &pItem, &nID );
		AddGold( -1900000000 );
	}

	AddDefinedText( TID_GAME_REAPMONEY, "%s %s", strPlus, strGold );
}
EDIT besser wäre noch this->m_Inventory.GetEmptyCount() < 1 anstatt ::GetCount().
Pumbaaa is offline  
Thanks
4 Users
Old 10/08/2011, 09:57   #14

 
™Dryad's Avatar
 
elite*gold: 380
Join Date: Oct 2008
Posts: 2,262
Received Thanks: 381
In welcher sourcen datei muss man das adden?
™Dryad is offline  
Old 10/08/2011, 10:06   #15
 
elite*gold: 4
Join Date: Mar 2010
Posts: 3,148
Received Thanks: 1,535
ich glaube user.cpp, verbessert mich wenn nicht ^^
Jopsi332 is offline  
Reply


Similar Threads Similar Threads
[Source Frage]Perin
07/05/2012 - Flyff Private Server - 27 Replies
Hey, hier mal eine kleine Frage ^^ Wenn ich eine Funktion habe, die die Penya überwachen soll, und dann, falls die Penya 100.000.000 übersteigen, diese in einen Perin umwandeln soll, wo müsste ich diese Funktion dann wie einbauen, bzw. wie müsste die Funktion aussehen, ich hab jetzt mal das hier gemacht : void CMover::UpdatePerin() { if(((CUser*)this)->GetGold() > 100000000) { SetGold(((CUser*)this)->GetGold() - 100000000); } }
I want to Buffs automatically
07/12/2011 - Rappelz - 4 Replies
Hi I would like to know how to give money and Buffs has character creation automatically Pelase
Tausche [Buru] Perin gegen [Augu] Perin
02/27/2011 - Flyff Trading - 1 Replies
wie schon im topic steht suche perin auf dem server augu und biete perin auf buru
[HELP] MSG closed automatically when use another DB..!!
11/29/2009 - EO PServer Hosting - 6 Replies
23:07:33¡¾0¡¢Init Database thread...¡¿ 23:07:33¡¾1¡¢Init world thread...¡¿ 23:07:33¡¾2¡¢Init map group thread...¡¿ 23:07:48¡¾Kernel logic closing...¡¿
Automatically add int instead of str on agbot
11/12/2008 - Silkroad Online - 3 Replies
How can i automatically add int instead of str when I level up using agbot? I was making a new char ang planning on making it pure it but everytime i level up it automatically adds str. how can i change it into int?



All times are GMT +2. The time now is 12:52.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

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