|
You last visited: Today at 05:08
Advertisement
Calling a buff item instead of skill
Discussion on Calling a buff item instead of skill within the Flyff Private Server forum part of the Flyff category.
08/29/2018, 08:34
|
#1
|
elite*gold: 0
Join Date: Jul 2016
Posts: 230
Received Thanks: 7
|
Calling a buff item instead of skill
I tried adding guild buff and it's working fine however i would like to call a scroll instead of skill.
I tried editing the code from BUFF_SKILL TO BUFF_ITEM but it won't work.
What i did was. BUFF_SKILL, SI_BUFF_GUILD01 to BUFF_ITEM, II_SYS_SYS_SCR_NEW
Here's the part of code that i tried editing. Wish to hear from experienced people. Thanks a lot.
HTML Code:
#ifdef __GUILD_BUFF
void CDPSrvr::OnBuffGuildByAPP( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE, u_long )
{
#ifdef __FIX_ANTI_HACKING
try{
#endif // __FIX_ANTI_HACKING
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );
CMover* pMover = pUser;
int nCurSel;
int nGold;
nGold = 0;
int valid = 0;
ar >> nCurSel;
CCtrl* pCtrl = (CCtrl*)pMover;
CGuild *pGuild = pUser->GetGuild();
if( IsValidObj( pUser ) )
{
if ( pGuild )
{
switch( nCurSel )
{
case 0:
{
if ( pGuild->m_nLevel > 19 )
{
if( pUser->HasBuff(BUFF_SKILL, SI_BUFF_GUILD01) )
valid = 1;
if ( valid != 1 )
{
nGold = 250000000;
if ( pUser->GetGold() > nGold )
{
pUser->AddGold( -nGold );
pCtrl->DoAddBuff( SI_BUFF_GUILD01, 1, pCtrl );
}
else
pUser->AddDefinedText( TID_GUILD_ERROR_NO_PENYA );
}
else
pUser->AddDefinedText( TID_GUILD_DEJA_BUFF );
}
else
{
pUser->AddDefinedText( TID_GUILD_LOW_LVL );
}
}
break;
case 1:
{
if ( pGuild->m_nLevel > 29 )
{
if( pUser->HasBuff(BUFF_SKILL, SI_BUFF_GUILD02) )
valid = 1;
if ( valid != 1 )
{
nGold = 250000000;
if ( pUser->GetGold() > nGold )
{
pUser->AddGold( -nGold );
pCtrl->DoAddBuff( SI_BUFF_GUILD02, 1, pCtrl );
}
else
pUser->AddDefinedText( TID_GUILD_ERROR_NO_PENYA );
}
else
pUser->AddDefinedText( TID_GUILD_DEJA_BUFF );
}
else
{
pUser->AddDefinedText( TID_GUILD_LOW_LVL );
}
}
break;
case 2:
Anyone?
|
|
|
08/29/2018, 22:42
|
#2
|
elite*gold: 0
Join Date: Nov 2009
Posts: 627
Received Thanks: 688
|
Quote:
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );
CMover* pMover = pUser;
int nCurSel;
int nGold;
nGold = 0;
int valid = 0;
ar >> nCurSel;
CCtrl* pCtrl = (CCtrl*)pMover;
CGuild *pGuild = pUser->GetGuild();
|
Are you serious?
|
|
|
08/30/2018, 01:46
|
#3
|
elite*gold: 28
Join Date: Feb 2010
Posts: 463
Received Thanks: 277
|
Quote:
Originally Posted by cookie69
Are you serious? 
|
Same for
Code:
CCtrl* pCtrl = (CCtrl*)pMover;
need to check the pMover... or check the pUser before
Code:
CMover* pMover = pUser;
|
|
|
08/30/2018, 21:31
|
#4
|
elite*gold: 0
Join Date: Nov 2009
Posts: 627
Received Thanks: 688
|
Quote:
Originally Posted by naruto66620
Same for
Code:
CCtrl* pCtrl = (CCtrl*)pMover;
need to check the pMover... or check the pUser before
Code:
CMover* pMover = pUser;
|
Nop, this will never trigger the exception. You can cast any pointer to NULL as long as you do not use the pointer reference.
So:
Quote:
CMover* pMover = pUser;
and
CCtrl* pCtrl = (CCtrl*)pMover;
|
Will never trigger any exception as you do not do for example
Quote:
By the way, if you want to close the game client when a bot/cheat is detected, it is not recommended at all to call ExitProcess() or any exit API. It is better to just crash it like this:
Quote:
|
|
|
08/31/2018, 04:23
|
#5
|
elite*gold: 0
Join Date: Jul 2016
Posts: 230
Received Thanks: 7
|
Thank you all for answering my question. I didn't create that code i just leeched it from somewhere.
Would you mind telling me more about how because i'm kinda clueless about it.
I thought i just needed to replace BUFF_SKILL to BUFF_ITEM but i was really wrong.
I tried editing some stuff too and unfortunately didn't change a thing.
|
|
|
08/31/2018, 11:52
|
#6
|
elite*gold: 50
Join Date: Feb 2014
Posts: 288
Received Thanks: 245
|
DoApplySkill(obj, ItemProp, nullptr, false, 0 ,0 0);
|
|
|
08/31/2018, 18:14
|
#7
|
elite*gold: 0
Join Date: Jul 2016
Posts: 230
Received Thanks: 7
|
Quote:
Originally Posted by Jupsi332
DoApplySkill(obj, ItemProp, nullptr, false, 0 ,0 0);
|
Though i don't really understand much on how to completely make it work.
I'm still trying my best to make it work.
If there's someone who's willing to share some codes please do. Thanks a lot.
|
|
|
09/01/2018, 13:35
|
#8
|
elite*gold: 0
Join Date: Nov 2016
Posts: 31
Received Thanks: 9
|
Quote:
if(pUser->GetGuild() != NULL )
{
if( pUser->GetGuild()->m_nLevel >= 30)
{
if( !pUser->HasBuff( BUFF_ITEM, II_SYS_SYS_GUILDBUFF_LV30 ) )
{
ItemProp* pProp = prj.GetItemProp( II_SYS_SYS_GUILDBUFF_LV30 );
if( pProp )
{
pUser->DoApplySkill( pUser, pProp, NULL );
}
}
}
}
|
go edit
|
|
|
 |
Similar Threads
|
[HELP] EP 6 (or 5.5?) Item Mall: Gold instead of AP?
11/12/2012 - Shaiya Private Server - 2 Replies
Hello! :D
I'm making great headway with my EP6 (or 5.5 server, whatever you prefer) but I am curious about something. How would I/could I change the currency from AP to gold in the item mall.
Contact me via Skype - coolwier65
|
VIP update in a form of item instead of making query manually
06/06/2011 - EO PServer Hosting - 4 Replies
Hi, I've been searching guides on how to update the VIP level and found out on how to update it manually. But, can the VIP level be customized into some form of item (should be in PP type) that when you were right click on to it, it will automatically updating your character's VIP level..say that the player can update it according to him at anytime.
Purpose : As an event' gift or when the particular player is donating to the server.
|
Instead of cracking each new copartner.
06/06/2006 - Conquer Online 2 - 1 Replies
Why not edit the program to stop recieving messages that it must update to continue. Possible?
|
Instead of cotobo
03/10/2006 - Conquer Online 2 - 6 Replies
I would like to ask if there is another pker disconector but one reacting on lovering hp ..not like cotobo on "blue,black,red namer"
Well my problem is.. im mining with cotobo..and thers 1 fucking ennouying guy attacking me ..so i get d/c. And he do it just for fun...running in mine attacking miners..and d/c em. So i ask if there is another disconecting program..with option
"disconect when hp lower then XXX" I tried to find such a program but i failed. So if any one know such program or have...
|
Play CO 1.0 instead of 2.0
11/18/2005 - Conquer Online 2 - 10 Replies
Righty, there must be a way of playing Conqueronline 1.0 still.. I've tried opening the conquer shortcut which misses the patch window, but when I try login it says 'Invalid version ID.'
Anyone figured out a way of getting past this and logging in?
|
All times are GMT +1. The time now is 05:08.
|
|