|
You last visited: Today at 12:52
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.
10/07/2011, 16:04
|
#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::AddGold( int nGold, BOOL bSend ) { if( nGold == 0 ) return TRUE;
int nTotal = GetGold() + nGold;
if( nGold > 0 ) { if( nTotal < 0 ) nTotal = INT_MAX; } else // nGold < 0 { if( nTotal < 0 ) { nTotal = 0; } } SetGold( nTotal );
#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.AddSetPointParam( this, DST_GOLD, nTotal ); #endif // __WORLDSERVER }
return TRUE; }
|
|
|
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?
|
|
|
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.
|
|
|
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
|
|
|
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.
|
|
|
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?
|
|
|
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.
|
|
|
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
|
|
|
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 ^^
|
|
|
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.
|
|
|
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
|
|
|
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
|
|
|
10/08/2011, 01:45
|
#13
|
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().
|
|
|
10/08/2011, 09:57
|
#14
|
elite*gold: 380
Join Date: Oct 2008
Posts: 2,262
Received Thanks: 381
|
In welcher sourcen datei muss man das adden?
|
|
|
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 ^^
|
|
|
|
|
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.
|
|