Refining

Status
Not open for further replies.
Newbie Spellweaver
Joined
Nov 17, 2007
Messages
7
Reaction score
0
Is there any way to get the refine work all right in iRose?
So you get dura and HR everytime you refine (so you will be able to max an item).
Like 120 dura max HR...(Didn't find this in search function)
 
Like i said it's really easy to add.

All you need to do is find this (may be slightly different in your version but if you can't figure this out then you probably shouldn't be running a server)
Code:
BEGINPACKET( pak, 0x7bc )
            if( success )
            {
in worldpakets.cpp.
The stuff after it defines what happens if your refine is a success.

Here is the full conditional as I am using it.
Again this is going to be a little different than you have in your own since I rewrote most of this function.
If you just copy this whole thing then your server WILL fail to compile. Just pick out the important stuff and copy it.
Code:
BEGINPACKET( pak, 0x7bc )
            if( success )
            {
                thisclient->items[item].refine = nextlevel*16;
                thisclient->items[item].durability += nextlevel;
                ADDBYTE    ( pak, 0x10 );//successful
            }
            else
            {
                if(GServer->Config.KillOnFail || nextlevel > 5)
                {
                    ClearItem( thisclient->items[item] );
                }
                else
                {
                    thisclient->items[item].refine = (nextlevel-2)*16;
                }
                ADDBYTE    ( pak, 0x11 );//Fail
            }
            {ADDBYTE    ( pak, 0x04 );}
            ADDBYTE    ( pak, material1 );
            ADDWORD   ( pak, BuildItemHead( thisclient->items[material1] ) );
            ADDDWORD   ( pak, BuildItemData( thisclient->items[material1] ) );
            ADDBYTE    ( pak, item );
            ADDWORD   ( pak, BuildItemHead( thisclient->items[item] ) );
            ADDDWORD   ( pak, BuildItemData( thisclient->items[item] ) );
            ADDBYTE    ( pak, 0x00 );
            ADDDWORD   ( pak, 0x002f0000 );
            ADDDWORD   ( pak, 0x00000017 );
            thisclient->client->SendPacket( &pak );
If your existing packet structure does not match this then DO NOT copy this packet over or your server will cause your client to disconnect when you try refining something.

The important part of this code is ONLY the bit where we actually modify the item.
This is what is done normally
Code:
thisclient->items[item].refine = nextlevel*16;
This is what you need to add right after it, inside the conditional.
Code:
thisclient->items[item].durability += nextlevel;

The formula I added will add an amount equal to your item's next refine level to your item's durability
feel free to modify this in any way your hearts desire.
 
Status
Not open for further replies.
Back