Refining

Results 1 to 7 of 7
  1. #1
    Apprentice LOLMAO is offline
    MemberRank
    Nov 2007 Join Date
    7Posts

    Refining

    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)


  2. #2
    Last of the OsRose Devs Purpleyouko is offline
    MemberRank
    Oct 2006 Join Date
    Missouri USALocation
    2,161Posts

    Re: Refining

    you can make it do whatever you like if you code it that way.
    the code for refining is in Worldpackets. Function bool CWorldServer::pakModifiedItem( CPlayer* thisclient, CPacket* P )

  3. #3
    Apprentice LOLMAO is offline
    MemberRank
    Nov 2007 Join Date
    7Posts

    Re: Refining

    Do you also know what to change in it?

  4. #4
    Last of the OsRose Devs Purpleyouko is offline
    MemberRank
    Oct 2006 Join Date
    Missouri USALocation
    2,161Posts

    Re: Refining

    Of course I do. I rewrote the whole function for osprose

    It's pretty easy

  5. #5
    Apprentice LOLMAO is offline
    MemberRank
    Nov 2007 Join Date
    7Posts

    Re: Refining

    Mind telling me :P?^^

  6. #6
    Enthusiast daniel3 is offline
    MemberRank
    Sep 2007 Join Date
    36Posts

    Re: Refining

    i need to know this too please

  7. #7
    Last of the OsRose Devs Purpleyouko is offline
    MemberRank
    Oct 2006 Join Date
    Missouri USALocation
    2,161Posts

    Re: Refining

    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.



Advertisement