Pillows Posted August 10, 2014 Posted August 10, 2014 (edited) All credit goes to digitalhamster, fixed by ~AnnieRuru~.Reposting for personal reasons since Ea has been offline and I happen to have saved a web cache of the pages.The topic is old, so you have to manually add the modifications. Plus, the spacings didn't copy out too well.The modification works through the item's bonus script in your item_db/db2. Charm's effect don't work if you do not add type (12/etc.), job, upper, and gender in itemdb/db2. Charms will only work with items having type = 12/? on item_db/db2, so your other items won't be affected by this, just the ones you choose.Make sure type is set according to your mmo.h.For example: +++ common/mmo.h (working copy) @@ -175,6 +175,7 @@ IT_UNKNOWN2,//9 IT_AMMO, //10 IT_DELAYCONSUME,//11 + IT_CHARM, IT_CASH = 18, Looking at IT_CHARM, type is set to 12.Item stacking Add this if you want to enable item IDs to stack. It will treat each item as a separate item, in its own item slot. Example: Apple (5) will be in different items slots in your inventory and its effects will stack with each other when the code below is added. Same item effects on different item IDs will stack regardless of enabling/disabling this modification. Add this if you want items to stack: Go to itemdb.c: /*========================================== * Returns if given item's type is stackable. *------------------------------------------*/ int itemdb_isstackable(int nameid) { int type=itemdb_type(nameid); switch(type) { case IT_WEAPON: case IT_ARMOR: case IT_PETEGG: case IT_PETARMOR: + case IT_CHARM: return 0; And again, right below it: /*========================================== * Alternate version of itemdb_isstackable *------------------------------------------*/ int itemdb_isstackable2(struct item_data *data) { nullpo_retr(0, data); switch(data->type) { case IT_WEAPON: case IT_ARMOR: case IT_PETEGG: case IT_PETARMOR: + case IT_CHARM: return 0; Fixed version:Src for Renewal (manually add): Charms.txt Edited Annie's fix for older eA revisions: eA_Charms.txt Don't try to update this as a .diff, just a suggestion. Edited August 13, 2014 by Pillows 1 Quote
GodKnows Jhomz Posted August 10, 2014 Posted August 10, 2014 (edited) thanks for this, i was looking for complete src mods for this charm system but i wasn't able to find one because eA was already down. Tested and worked perfectly! You just forget to add the correct item_db script so anyone can use this. #####,Charm,Charm,12,50,,0,,,,,0xFFFFFFFF,15,2,,,60,,,{ bonus bAllStats,100; },{},{} But still, not working in Gunslinger & Ninja I wish someone will provide fix for Gunslinger & Ninja problem in Charms Mod Edited August 10, 2014 by GodKnows Jhomz Quote
Pillows Posted August 13, 2014 Author Posted August 13, 2014 thanks for this, i was looking for complete src mods for this charm system but i wasn't able to find one because eA was already down. Tested and worked perfectly! You just forget to add the correct item_db script so anyone can use this. #####,Charm,Charm,12,50,,0,,,,,0xFFFFFFFF,15,2,,,60,,,{ bonus bAllStats,100; },{},{} But still, not working in Gunslinger & Ninja I wish someone will provide fix for Gunslinger & Ninja problem in Charms Mod Oh, I never noticed. I have no idea why the original modification left out those classes. I came up with a fix, let me know if there's any more problems. Replace (status.c): if ( sd->inventory_data[i]->script && sd->inventory_data[i]->elv <= sd->status.base_level && ( 1 << sd->class_ & MAPID_BASEMASK ) & sd->inventory_data[i]->class_base[ sd->class_ & JOBL_2_1? 1: sd->class_ & JOBL_2_2? 2:0 ] && ( 1 << ( sd->class_ & JOBL_UPPER? 1: sd->class_ & JOBL_BABY? 2:0 ) ) & sd->inventory_data[i]->class_upper ) { With this: if ( sd->inventory_data[i]->script && sd->inventory_data[i]->elv <= sd->status.base_level && sd->inventory_data[i]->class_upper ) { Updated original post! Quote
GodKnows Jhomz Posted August 13, 2014 Posted August 13, 2014 thanks for this, i was looking for complete src mods for this charm system but i wasn't able to find one because eA was already down. Tested and worked perfectly! You just forget to add the correct item_db script so anyone can use this. #####,Charm,Charm,12,50,,0,,,,,0xFFFFFFFF,15,2,,,60,,,{ bonus bAllStats,100; },{},{} But still, not working in Gunslinger & Ninja I wish someone will provide fix for Gunslinger & Ninja problem in Charms Mod Oh, I never noticed. I have no idea why the original modification left out those classes. I came up with a fix, let me know if there's any more problems. Replace (status.c): if ( sd->inventory_data[i]->script && sd->inventory_data[i]->elv <= sd->status.base_level && ( 1 << sd->class_ & MAPID_BASEMASK ) & sd->inventory_data[i]->class_base[ sd->class_ & JOBL_2_1? 1: sd->class_ & JOBL_2_2? 2:0 ] && ( 1 << ( sd->class_ & JOBL_UPPER? 1: sd->class_ & JOBL_BABY? 2:0 ) ) & sd->inventory_data[i]->class_upper ) { With this: if ( sd->inventory_data[i]->script && sd->inventory_data[i]->elv <= sd->status.base_level && sd->inventory_data[i]->class_upper ) { Updated original post! Thanks for this ! But already fixed mine by getting my old src code for status.c file. this is the codes that I get somewhere here in rA or in eA forum. From : if ( sd->inventory_data[i]->script && sd->inventory_data[i]->elv <= sd->status.base_level && ( 1 << sd->class_ & MAPID_BASEMASK ) & sd->inventory_data[i]->class_base[ sd->class_ & JOBL_2_1? 1: sd->class_ & JOBL_2_2? 2:0 ] && ( 1 << ( sd->class_ & JOBL_UPPER? 1: sd->class_ & JOBL_BABY? 2:0 ) ) & sd->inventory_data[i]->class_upper ) { To : if ( sd->inventory_data[i]->script && 0 < sd->status.base_level && sd->inventory_data[i]->class_upper ) { run_script( sd->inventory_data[i]->script, 0, sd->bl.id, 0 ); Quote
Pillows Posted August 13, 2014 Author Posted August 13, 2014 thanks for this, i was looking for complete src mods for this charm system but i wasn't able to find one because eA was already down. Tested and worked perfectly! You just forget to add the correct item_db script so anyone can use this. #####,Charm,Charm,12,50,,0,,,,,0xFFFFFFFF,15,2,,,60,,,{ bonus bAllStats,100; },{},{} But still, not working in Gunslinger & Ninja I wish someone will provide fix for Gunslinger & Ninja problem in Charms Mod Oh, I never noticed. I have no idea why the original modification left out those classes. I came up with a fix, let me know if there's any more problems. Replace (status.c): if ( sd->inventory_data[i]->script && sd->inventory_data[i]->elv <= sd->status.base_level && ( 1 << sd->class_ & MAPID_BASEMASK ) & sd->inventory_data[i]->class_base[ sd->class_ & JOBL_2_1? 1: sd->class_ & JOBL_2_2? 2:0 ] && ( 1 << ( sd->class_ & JOBL_UPPER? 1: sd->class_ & JOBL_BABY? 2:0 ) ) & sd->inventory_data[i]->class_upper ) { With this: if ( sd->inventory_data[i]->script && sd->inventory_data[i]->elv <= sd->status.base_level && sd->inventory_data[i]->class_upper ) { Updated original post! Thanks for this ! But already fixed mine by getting my old src code for status.c file. this is the codes that I get somewhere here in rA or in eA forum. From : if ( sd->inventory_data[i]->script && sd->inventory_data[i]->elv <= sd->status.base_level && ( 1 << sd->class_ & MAPID_BASEMASK ) & sd->inventory_data[i]->class_base[ sd->class_ & JOBL_2_1? 1: sd->class_ & JOBL_2_2? 2:0 ] && ( 1 << ( sd->class_ & JOBL_UPPER? 1: sd->class_ & JOBL_BABY? 2:0 ) ) & sd->inventory_data[i]->class_upper ) { To : if ( sd->inventory_data[i]->script && 0 < sd->status.base_level && sd->inventory_data[i]->class_upper ) { run_script( sd->inventory_data[i]->script, 0, sd->bl.id, 0 ); That's the same line of code. Quote
GodKnows Jhomz Posted August 13, 2014 Posted August 13, 2014 Oh didn't notice that, coz in my code it has the level requirement. and I set it to 0 so anyone can use it.Btw thanks for the release and fix. Quote
Forshaken Posted February 24, 2020 Posted February 24, 2020 On 4/5/2019 at 6:53 PM, iwillnot said: I have updated this patch. See below. can you help me with this error?? Quote
Takuyakii Posted March 5, 2020 Posted March 5, 2020 On 2/25/2020 at 2:08 AM, Forshaken said: can you help me with this error?? can i have the link of the patch? can someone update this ? thanks ! Quote
Forshaken Posted March 5, 2020 Posted March 5, 2020 1 hour ago, Takuyakii said: can i have the link of the patch? can someone update this ? thanks ! Fixed Quote
Takuyakii Posted March 5, 2020 Posted March 5, 2020 1 minute ago, Forshaken said: Fixed How? can you comment here how ? and can you paste the code herE? Quote
Forshaken Posted March 6, 2020 Posted March 6, 2020 14 hours ago, Takuyakii said: How? can you comment here how ? and can you paste the code herE? Do you got my previous error? Quote
Takuyakii Posted March 6, 2020 Posted March 6, 2020 Just now, Forshaken said: Do you got my previous error? Nope, btw i found the patch file that im requesting , thanks and solved. Quote
Scanty Posted August 12, 2020 Posted August 12, 2020 I change this: map/pc.cpp --- map/pc.c (revision 14843) +++ map/pc.c (working copy) @@ -3444,6 +3444,7 @@ clif_updatestatus(sd,SP_WEIGHT); //Auto-equip if(data->flag.autoequip) pc_equipitem(sd, i, data->equip); + if(data->type == IT_CHARM) status_calc_pc(sd,0);//dh return 0; To: if (id->type == IT_CHARM) status_calc_pc(sd, SCO_NONE); //dh Now the next part: @@ -3470,6 +3473,8 @@ if(!(type&2)) clif_updatestatus(sd,SP_WEIGHT); + if(mem == IT_CHARM) status_calc_pc(sd,0);//dh + return 0; To: if(mem == IT_CHARM) status_calc_pc(sd, SCO_NONE);//dh map/itemdb.cpp id->type = atoi(str[3]); - if( id->type < 0 || id->type == IT_UNKNOWN || id->type == IT_UNKNOWN2 || ( id->type > IT_DELAYCONSUME && id->type < IT_CASH ) || id->type >= IT_MAX ) + if( id->type < 0 || id->type == IT_UNKNOWN || id->type == IT_UNKNOWN2 || ( id->type > IT_CHARM && id->type < IT_CASH ) || id->type >= IT_MAX ) {// catch invalid item types ShowWarning("itemdb_parse_dbrow: Invalid item type %d for item %d. IT_ETC will be used.\n", id->type, nameid); id->type = IT_ETC; TO: if( id->type < 0 || id->type == IT_UNKNOWN || id->type == IT_UNKNOWN2 || ( id->type > IT_SHADOWGEAR && id->type < IT_CASH && id->type > IT_CHARM ) || id->type >= IT_MAX ) I don't know about this part but... still working. db/import/itemdb.txt #####,Charm,Charm,12,50,,0,,,,,0xFFFFFFFF,15,2,,,60,,,{ bonus bAllStats,100; },{},{} TO: 30050,Charm,Charm,13,6,,0,,,,,0xFFFFFFFF,15,2,,,1,,,{bonus bStr,2; },{},{} Change to your ID. 1 Quote
Akbare Posted August 13, 2020 Posted August 13, 2020 7 hours ago, Scanty said: I change this: map/pc.cpp --- map/pc.c (revision 14843) +++ map/pc.c (working copy) @@ -3444,6 +3444,7 @@ clif_updatestatus(sd,SP_WEIGHT); //Auto-equip if(data->flag.autoequip) pc_equipitem(sd, i, data->equip); + if(data->type == IT_CHARM) status_calc_pc(sd,0);//dh return 0; To: if (id->type == IT_CHARM) status_calc_pc(sd, SCO_NONE); //dh Now the next part: @@ -3470,6 +3473,8 @@ if(!(type&2)) clif_updatestatus(sd,SP_WEIGHT); + if(mem == IT_CHARM) status_calc_pc(sd,0);//dh + return 0; To: if(mem == IT_CHARM) status_calc_pc(sd, SCO_NONE);//dh map/itemdb.cpp id->type = atoi(str[3]); - if( id->type < 0 || id->type == IT_UNKNOWN || id->type == IT_UNKNOWN2 || ( id->type > IT_DELAYCONSUME && id->type < IT_CASH ) || id->type >= IT_MAX ) + if( id->type < 0 || id->type == IT_UNKNOWN || id->type == IT_UNKNOWN2 || ( id->type > IT_CHARM && id->type < IT_CASH ) || id->type >= IT_MAX ) {// catch invalid item types ShowWarning("itemdb_parse_dbrow: Invalid item type %d for item %d. IT_ETC will be used.\n", id->type, nameid); id->type = IT_ETC; TO: if( id->type < 0 || id->type == IT_UNKNOWN || id->type == IT_UNKNOWN2 || ( id->type > IT_SHADOWGEAR && id->type < IT_CASH && id->type > IT_CHARM ) || id->type >= IT_MAX ) I don't know about this part but... still working. db/import/itemdb.txt #####,Charm,Charm,12,50,,0,,,,,0xFFFFFFFF,15,2,,,60,,,{ bonus bAllStats,100; },{},{} TO: 30050,Charm,Charm,13,6,,0,,,,,0xFFFFFFFF,15,2,,,1,,,{bonus bStr,2; },{},{} Change to your ID. thx work like a charm Quote
xG000000 Posted November 5, 2020 Posted November 5, 2020 how to make 5 of charm will only work in inventory then if have 6 only 5 will work Quote
Rook1es Posted January 18, 2021 Posted January 18, 2021 Hello can anyone help? [Warning]: Item 40315 (Lucky Charm of Strength) is an equipment with no equip-field! Making it an etc item. Quote
Ruhn Posted October 17, 2021 Posted October 17, 2021 does this work on latest rathena who uses itemdb.yml isntead of text ? im getting the error on the item "IInvalid item equip location as it has no equip location, defaulting to IT_ETC" Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.