Pillows Posted August 10, 2014 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 26 Reputation: 2 Joined: 08/12/12 Last Seen: January 10, 2015 Share 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 Link to comment Share on other sites More sharing options...
GodKnows Jhomz Posted August 10, 2014 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 333 Reputation: 68 Joined: 09/05/12 Last Seen: June 13, 2023 Share 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 Link to comment Share on other sites More sharing options...
Pillows Posted August 13, 2014 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 26 Reputation: 2 Joined: 08/12/12 Last Seen: January 10, 2015 Author Share 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 Link to comment Share on other sites More sharing options...
GodKnows Jhomz Posted August 13, 2014 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 333 Reputation: 68 Joined: 09/05/12 Last Seen: June 13, 2023 Share 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 Link to comment Share on other sites More sharing options...
Pillows Posted August 13, 2014 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 26 Reputation: 2 Joined: 08/12/12 Last Seen: January 10, 2015 Author Share 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 Link to comment Share on other sites More sharing options...
GodKnows Jhomz Posted August 13, 2014 Group: Members Topic Count: 38 Topics Per Day: 0.01 Content Count: 333 Reputation: 68 Joined: 09/05/12 Last Seen: June 13, 2023 Share 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 Link to comment Share on other sites More sharing options...
iwillnot Posted April 5, 2019 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 51 Reputation: 23 Joined: 04/28/12 Last Seen: April 22, 2022 Share Posted April 5, 2019 I have updated this patch. See below. Quote Link to comment Share on other sites More sharing options...
Forshaken Posted February 24, 2020 Group: Members Topic Count: 15 Topics Per Day: 0.01 Content Count: 152 Reputation: 21 Joined: 11/12/18 Last Seen: February 8 Share 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 Link to comment Share on other sites More sharing options...
Takuyakii Posted March 5, 2020 Group: Members Topic Count: 41 Topics Per Day: 0.02 Content Count: 215 Reputation: 11 Joined: 08/30/19 Last Seen: March 6 Share 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 Link to comment Share on other sites More sharing options...
Forshaken Posted March 5, 2020 Group: Members Topic Count: 15 Topics Per Day: 0.01 Content Count: 152 Reputation: 21 Joined: 11/12/18 Last Seen: February 8 Share Posted March 5, 2020 1 hour ago, Takuyakii said: can i have the link of the patch? can someone update this ? thanks ! Fixed Quote Link to comment Share on other sites More sharing options...
Takuyakii Posted March 5, 2020 Group: Members Topic Count: 41 Topics Per Day: 0.02 Content Count: 215 Reputation: 11 Joined: 08/30/19 Last Seen: March 6 Share Posted March 5, 2020 1 minute ago, Forshaken said: Fixed How? can you comment here how ? and can you paste the code herE? Quote Link to comment Share on other sites More sharing options...
Forshaken Posted March 6, 2020 Group: Members Topic Count: 15 Topics Per Day: 0.01 Content Count: 152 Reputation: 21 Joined: 11/12/18 Last Seen: February 8 Share 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 Link to comment Share on other sites More sharing options...
Takuyakii Posted March 6, 2020 Group: Members Topic Count: 41 Topics Per Day: 0.02 Content Count: 215 Reputation: 11 Joined: 08/30/19 Last Seen: March 6 Share 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 Link to comment Share on other sites More sharing options...
coperation Posted March 8, 2020 Group: Members Topic Count: 8 Topics Per Day: 0.00 Content Count: 63 Reputation: 2 Joined: 01/16/12 Last Seen: March 31 Share Posted March 8, 2020 how to fixed this ? 1 Quote Link to comment Share on other sites More sharing options...
Akbare Posted August 10, 2020 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 491 Reputation: 20 Joined: 11/19/11 Last Seen: June 5, 2023 Share Posted August 10, 2020 any solution for this ? thx Quote Link to comment Share on other sites More sharing options...
Scanty Posted August 12, 2020 Group: Members Topic Count: 3 Topics Per Day: 0.00 Content Count: 90 Reputation: 26 Joined: 11/08/15 Last Seen: April 3 Share 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 Link to comment Share on other sites More sharing options...
Akbare Posted August 13, 2020 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 491 Reputation: 20 Joined: 11/19/11 Last Seen: June 5, 2023 Share 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 Link to comment Share on other sites More sharing options...
xG000000 Posted November 5, 2020 Group: Members Topic Count: 7 Topics Per Day: 0.00 Content Count: 16 Reputation: 0 Joined: 10/07/20 Last Seen: August 24, 2021 Share Posted November 5, 2020 how to make 5 of charm will only work in inventory then if have 6 only 5 will work Quote Link to comment Share on other sites More sharing options...
Rook1es Posted January 18, 2021 Group: Members Topic Count: 11 Topics Per Day: 0.00 Content Count: 97 Reputation: 5 Joined: 06/21/15 Last Seen: September 28, 2024 Share 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 Link to comment Share on other sites More sharing options...
Ruhn Posted October 17, 2021 Group: Members Topic Count: 23 Topics Per Day: 0.01 Content Count: 67 Reputation: 1 Joined: 04/15/20 Last Seen: Yesterday at 01:53 AM Share 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 Link to comment Share on other sites More sharing options...
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.