HerculesWS / Hercules

Hercules is a collaborative software development project revolving around the creation of a robust massively multiplayer online role playing game (MMORPG) server package. Written in C, the program is very versatile and provides NPCs, warps and modifications. The project is jointly managed by a group of volunteers located around the world as well as a tremendous community providing QA and support. Hercules is a continuation of the original Athena project.
http://herc.ws
GNU General Public License v3.0
891 stars 756 forks source link

ForceSerial not working #703

Open Jedzkie opened 9 years ago

Jedzkie commented 9 years ago

Hi All!

I tried to put force serial in this item ID#13921 (Antique_Pipe_Box) and by using getitem, the items stacked, it does not separate the items one by one, Im using 2010-06-16aRagexeRE and pre-re configuration, using the latest herc version.

Thanks!

MishimaHaruna commented 8 years ago

Is this still a problem? If so, was your getitem specifying an amount greater than 1? Does it stack between separate getitem calls?

Jedzkie commented 8 years ago

@MishimaHaruna yes its greater than 1, no it does not stack in seperate getitem calls.

AnnieRuru commented 8 years ago

how to reproduce ? if you mean this...

{
    Id: 13921
    AegisName: "Antique_Pipe_Box"
    Name: "Gentleman's Pipe Box"
    Type: 18
    Buy: 20
    Weight: 10
    Trade: {
        nodrop: true
        notrade: true
        noselltonpc: true
        nocart: true
        nogstorage: true
        nomail: true
        noauction: true
    }
    Script: <" getitem 5377,5; ">
},

I got 5 Gentleman's Pipe in separated, non stack

Jedzkie commented 8 years ago

Nope, not that. I mean the box itself not the items that get in the box. For example getitem Antique_Pipe_Box,5;

AnnieRuru commented 8 years ago

does all cash shop item (type 18) give separate items ? if it is, then the fix is very easy, I can do it

EDIT: I think I understand the question now ... let me test ... confirm this bug ... I think I can pull request this one

no need I guess, I fix directly since it just 1 line code

AnnieRuru commented 8 years ago

that will be my last time to fix stuffs on the source code Ind gave me repo access to fix npc scripts and documentations only .....

AnnieRuru commented 8 years ago

tested again item_db.conf, having the red potion force serial

{
    Id: 501
    AegisName: "Red_Potion"
    Name: "Red Potion"
    Type: 0
    Buy: 50
    Weight: 70
    ForceSerial: true
    Script: <" itemheal rand(45,65),0; ">
},

then the script

prontera,155,185,5  script  give split  1_F_MARIA,{
    getitem 501, 1;
    getitem 501, 2;
    getitem 501, 3;
    getitem 501, 4;
    getitem 502, 1;
    getitem 502, 2;
    getitem 502, 3;
    getitem 502, 4;
    end;
}
prontera,158,185,5  script  merge   1_F_MARIA,{
    mergeitem;
    end;
}

it seems to be working correctly already

@Jedzkie try again ?

hemagx commented 8 years ago

you don't need to add ForceSerial to any Cash Item Type items, as it's being serialized automatically. i'm trying to find your issue, but i don't understand the actual issue o-o

dastgirp commented 8 years ago

@hemagx He meant to say getitem ItemID, 5; If ItemID is having ForceSerial as true, it would stack those 5 item

AnnieRuru commented 8 years ago

you don't need to add ForceSerial to any Cash Item Type items, as it's being serialized automatically.

in hercules, item type 18 IT_CASH are not serialized automatically

hemagx commented 8 years ago

@AnnieRuru i've implemented it myself in hercules ^^"

if( ( !itemdb->isstackable2(data) || data->flag.force_serial || data->type == IT_CASH) && !item_data->unique_id )
        sd->status.inventory[i].unique_id = itemdb->unique_id(sd);
kyeme commented 8 years ago

Another bug https://github.com/HerculesWS/Hercules/issues/704

hemagx commented 8 years ago

@dastgir that normal ! for each getitem the serial will be the same if the item can be stacked actually, but if you do another getitem the both stacks wont be together it will get another serial.

hemagx commented 8 years ago

@kyeme i would test this issue, however i have no RO client in this PC, if you wanna help me debug, please send me PM in the forum

hemagx commented 8 years ago

@Jedzkie Dastgri mentioned what you talk about to me in IRC, indeed some stackable items doesn't stack with serials, but it's Due bug in Aegis and they did not mean to design it this way. no point in doing it, neither emulate an bug.

AnnieRuru commented 8 years ago

I see, then we shouldn't emulate aegis bug ...