|
You last visited: Today at 12:57
Advertisement
Little code help
Discussion on Little code help within the Flyff Private Server forum part of the Flyff category.
01/31/2020, 16:36
|
#1
|
elite*gold: 0
Join Date: Apr 2019
Posts: 81
Received Thanks: 7
|
Little code help
How can posibly change this code into specific item and not a raised pet and i wanted to be on the 10th and 20th rb will get a specific item too? please help me
Code:
#ifdef __REBIRTH
void CDPSrvr::OnDoReb( CAr & ar, DPID dpidCache, DPID dpidUser, LPBYTE lpBuf, u_long uBufSize )
{
#ifdef __SYSSECURITY
try{
#endif
OBJID idScroll;
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );
if( IsValidObj( pUser ) )
{
ar >> idScroll;
CItemElem* pItemElem = pUser->m_Inventory.GetAtId( idScroll );
if( pItemElem )
{
if( pItemElem->GetProp()->dwID == II_SYS_REB_SCROLL && pUser->GetLevel() == 150 && pUser->GetExpPercent() == 9999 )
{
if( pUser->m_nReb >= 30 )
{
pUser->AddText("You've reached the maximum number of Rebirth level's.");
return;
}
if( pUser->m_Inventory.GetEmptyCount() > 9 ) // 14-06-14
{
CItemElem* pEQ;
//if( pUser->CreateItem( &newItem ) )
{
for( int i = 0; i < MAX_HUMAN_PARTS; i++ )
{
switch( i )
{
case PARTS_UPPER_BODY: pEQ = pUser->m_Inventory.GetEquip( i ); if( pEQ ) { pUser->EquipItem( pEQ, FALSE, i ); } break;
case PARTS_CAP: pEQ = pUser->m_Inventory.GetEquip( i ); if( pEQ ) { pUser->EquipItem( pEQ, FALSE, i ); } break;
case PARTS_HAND: pEQ = pUser->m_Inventory.GetEquip( i ); if( pEQ ) { pUser->EquipItem( pEQ, FALSE, i ); } break;
case PARTS_FOOT: pEQ = pUser->m_Inventory.GetEquip( i ); if( pEQ ) { pUser->EquipItem( pEQ, FALSE, i ); } break;
case PARTS_LWEAPON: pEQ = pUser->m_Inventory.GetEquip( i ); if( pEQ ) { pUser->EquipItem( pEQ, FALSE, i ); } break;
case PARTS_RWEAPON: pEQ = pUser->m_Inventory.GetEquip( i ); if( pEQ ) { pUser->EquipItem( pEQ, FALSE, i ); } break;
case PARTS_SHIELD: pEQ = pUser->m_Inventory.GetEquip( i ); if( pEQ ) { pUser->EquipItem( pEQ, FALSE, i ); } break;
}
}
if( pUser->GetWeaponItem( PARTS_RWEAPON ) )
return;
pUser->InitLevel( JOB_VAGRANT, 1 );
// 14-06-14
//pUser->m_nReb++;
if( ++pUser->m_nReb == 30 )
{
CItemElem itemElem;
itemElem.m_pPet = new CPet();
itemElem.m_pPet->SetKind(PK_SPIDER);
itemElem.m_pPet->SetLevel(PL_S);
itemElem.m_pPet->SetExp(itemElem.m_pPet->GetMaxExp());
itemElem.m_pPet->SetLife(99);
itemElem.m_dwItemId = itemElem.m_pPet->GetItemId();
itemElem.m_pPet->SetEnergy(itemElem.m_pPet->GetMaxEnergy());
int nLevel, i;
for( i = PL_D, nLevel = 1; i <= PL_S; ++i, nLevel += 2 )
{
itemElem.m_pPet->SetAvailLevel(i,nLevel);
}
itemElem.SetSerialNumber();
itemElem.m_nItemNum = 1;
pUser->CreateItem(&itemElem);
}
//pUser->AddText("Deinem Inventar wurde ein Item f? das Platin Level hinzugef?t.");
pUser->UpdateItem( (BYTE)( pItemElem->m_dwObjId ), UI_NUM, pItemElem->m_nItemNum - 1 );
g_UserMng.UpdateUser( pUser, 2 );
}
}
else
//pUser->AddText("Du brauchst mehr als 8 Slots im Inventar frei um die Scroll zu aktivieren.");
pUser->AddText("You need more than 9 slots in your Inventory for activating the Scroll."); // 14-06-14
}else{
pUser->AddText("You have to reach the Max. Level & 99.99% exp first to do a Rebirth");
return;
}
}
}
#ifdef __SYSSECURITY
}
catch(...)
{
Error("Error on Line %d in %s",__LINE__,__FILE__);
}
#endif
}
#endif // __REBIRTH
|
|
|
02/01/2020, 04:27
|
#2
|
elite*gold: 0
Join Date: Mar 2013
Posts: 200
Received Thanks: 38
|
Code:
if( ++pUser->m_nReb == 30 )
{
CItemElem itemElem;
itemElem.m_pPet = new CPet();
itemElem.m_pPet->SetKind(PK_SPIDER);
itemElem.m_pPet->SetLevel(PL_S);
itemElem.m_pPet->SetExp(itemElem.m_pPet->GetMaxExp());
itemElem.m_pPet->SetLife(99);
itemElem.m_dwItemId = itemElem.m_pPet->GetItemId();
itemElem.m_pPet->SetEnergy(itemElem.m_pPet->GetMaxEnergy());
int nLevel, i;
for( i = PL_D, nLevel = 1; i <= PL_S; ++i, nLevel += 2 )
{
itemElem.m_pPet->SetAvailLevel(i,nLevel);
}
itemElem.SetSerialNumber();
itemElem.m_nItemNum = 1;
pUser->CreateItem(&itemElem);
}
That's for the pet, you can remove the code if you do not want to get a pet at level 30
for the specific items you can actually set it on event.lua on resource
you're welcome ^_^
|
|
|
02/01/2020, 16:43
|
#3
|
elite*gold: 0
Join Date: Apr 2019
Posts: 81
Received Thanks: 7
|
Quote:
Originally Posted by flyffdev
Code:
if( ++pUser->m_nReb == 30 )
{
CItemElem itemElem;
itemElem.m_pPet = new CPet();
itemElem.m_pPet->SetKind(PK_SPIDER);
itemElem.m_pPet->SetLevel(PL_S);
itemElem.m_pPet->SetExp(itemElem.m_pPet->GetMaxExp());
itemElem.m_pPet->SetLife(99);
itemElem.m_dwItemId = itemElem.m_pPet->GetItemId();
itemElem.m_pPet->SetEnergy(itemElem.m_pPet->GetMaxEnergy());
int nLevel, i;
for( i = PL_D, nLevel = 1; i <= PL_S; ++i, nLevel += 2 )
{
itemElem.m_pPet->SetAvailLevel(i,nLevel);
}
itemElem.SetSerialNumber();
itemElem.m_nItemNum = 1;
pUser->CreateItem(&itemElem);
}
That's for the pet, you can remove the code if you do not want to get a pet at level 30
for the specific items you can actually set it on event.lua on resource
you're welcome ^_^
|
Thanks for the reply sir! I got it hehe thank you Godblesss you!!
|
|
|
|
Similar Threads
|
Hello Please Little Help Just Little Not much
12/30/2011 - SRO Private Server - 1 Replies
I need Add D12 Lucky Powder To Npc How I can do it ?
|
Little Gaikoz,Little Cancer & Little KazeAaze!?
10/19/2010 - Grand Chase - 6 Replies
where the heck could i get them!?
PLS GIMME HELP!! T_T
|
little kazeaaze and little gaikoz trouble???
03/30/2010 - Grand Chase Philippines - 8 Replies
Hey! have youve been tired of hunting this pets????.....well, ill give you a tip!...
1.the gaikoz pet that I got was in kazeaaze castle.....try to go there 10 times straight,lets if your to lucky enough to get it....
2. the kazeaaze pet that i got was from the BERMESIAH LAST STAND!yes!,,,,,,in my first try I got it!....and im lucky enough to get it!(GCPH)
still not working!......
|
little kazeaaze and little gaikoz trouble???
01/26/2010 - Grand Chase Hacks, Bots, Cheats & Exploits - 17 Replies
Hey! have youve been tired of hunting this pets????.....well, ill give you a tip!...
1.the gaikoz pet that I got was in kazeaaze castle.....try to go there 10 times straight,lets if your to lucky enough to get it....
2. the kazeaaze pet that i got was from the BERMESIAH LAST STAND!yes!,,,,,,in my first try I got it!....and im lucky enough to get it!(GCPH)
still not working!......
|
[Problem]I have little idea and i need little help.
11/13/2009 - SRO Private Server - 0 Replies
I am playing on swsro and i'am botting. i'am using lolkop's loader to increase auto grab range but i it's increased too much (too many times). my char is going from item to item on the map instead of botting. i want to increase my auto grab only for little rang to bit bigger range than normal ;] but how to do it? please tell me ;p
|
All times are GMT +2. The time now is 12:57.
|
|