Smoke Posted May 12, 2012 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 34 Reputation: 8 Joined: 01/06/12 Last Seen: April 16, 2019 Share Posted May 12, 2012 (edited) Hello, This is the first of my code modifications, so do let me know (with possible fix and what I did wrong) if you find any bugs. What this modification does? Basically logs and announces all trades and drops by GMs using a table that's much easy to understand than normal trade logs, whilst preserving the original trade logs. Find and Replace : TradelogPatch.txt Recompile and ban your corruption! Do let me know what you think Edited May 13, 2012 by Smoke 1 Quote Link to comment Share on other sites More sharing options...
Emistry Posted May 13, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: 17 hours ago Share Posted May 13, 2012 Sorry , but according to the Source Release Section Rules Upload your diffs as an attachment or some other external link where it can be downloaded. Don't post a codebox with it. Please revise your topic and edit it. Quote Link to comment Share on other sites More sharing options...
Smoke Posted May 13, 2012 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 34 Reputation: 8 Joined: 01/06/12 Last Seen: April 16, 2019 Author Share Posted May 13, 2012 (edited) Sorry , but according to the Source Release Section Rules Upload your diffs as an attachment or some other external link where it can be downloaded. Don't post a codebox with it. Please revise your topic and edit it. Hey, I'm sorry about this but I dont use rAthena so I cannot make a diff with exact line edits. Is it fine if I make a txt file with Find and Replace ? I've added a txt file with find and replace instructions. Edited May 13, 2012 by Smoke Quote Link to comment Share on other sites More sharing options...
Critica Posted June 2, 2012 Group: Members Topic Count: 82 Topics Per Day: 0.02 Content Count: 223 Reputation: 4 Joined: 02/23/12 Last Seen: March 28, 2018 Share Posted June 2, 2012 Hey.. im getting a lot or errors using 3ceam,, can you help me..? Quote Link to comment Share on other sites More sharing options...
java Posted June 10, 2012 Group: Members Topic Count: 27 Topics Per Day: 0.01 Content Count: 265 Reputation: 35 Joined: 12/22/11 Last Seen: 27 minutes ago Share Posted June 10, 2012 where the log file is saved? Quote Link to comment Share on other sites More sharing options...
Linkin Park Posted June 10, 2012 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 227 Reputation: 11 Joined: 11/16/11 Last Seen: November 7, 2015 Share Posted June 10, 2012 where the log file is saved? tradelog table Quote Link to comment Share on other sites More sharing options...
Critica Posted June 11, 2012 Group: Members Topic Count: 82 Topics Per Day: 0.02 Content Count: 223 Reputation: 4 Joined: 02/23/12 Last Seen: March 28, 2018 Share Posted June 11, 2012 does it work to you guys? Quote Link to comment Share on other sites More sharing options...
Linkin Park Posted June 11, 2012 Group: Members Topic Count: 42 Topics Per Day: 0.01 Content Count: 227 Reputation: 11 Joined: 11/16/11 Last Seen: November 7, 2015 Share Posted June 11, 2012 Nope, it's not compatible with rAthena. Quote Link to comment Share on other sites More sharing options...
Critica Posted June 15, 2012 Group: Members Topic Count: 82 Topics Per Day: 0.02 Content Count: 223 Reputation: 4 Joined: 02/23/12 Last Seen: March 28, 2018 Share Posted June 15, 2012 im using 3ceam.. if its not compatible with both.. then.. its useless..? Quote Link to comment Share on other sites More sharing options...
Thanna Posted June 17, 2012 Group: Members Topic Count: 45 Topics Per Day: 0.01 Content Count: 271 Reputation: 7 Joined: 01/06/12 Last Seen: May 16, 2015 Share Posted June 17, 2012 can you please make a 3ceam patch, thanks in advance Quote Link to comment Share on other sites More sharing options...
Cydh Posted September 7, 2012 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 748 Joined: 06/16/12 Last Seen: February 21 Share Posted September 7, 2012 (edited) doesn't work if I implemented it totally.. XD however, thank Smoke, sorry I almost edit all ur work to be like these, my modification focuss in announcement than log because we can use picklog, right? ====================================== add in one of your battle\conf files, maybe items.conf then add this lines, so you can modif the Trade/Drop announcement states easily then use @realoadbattleconf // [Cydh] credit to [smoke] // gm_drop_announce, 1 = enable, 0 = disable // Dropped item(s) by GM Level form gm_drop_lvl_from until gm_drop_lvl_to will be announced in the public gm_drop_announce: 1 gm_drop_lvl_from: 10 gm_drop_lvl_to: 98 // [Cydh] credit to [smoke] // gm_trade_announce, 1 = enable, 0 = disable // Tradded item(s) by GM Level form gm_trade_lvl_from until gm_trade_lvl_to will be announced in the public gm_trade_announce: 1 gm_trade_lvl_from: 10 gm_trade_lvl_to: 98 inside extern struct Battle_Config in src\map\battle.h, find int item_drop_adddrop_min,item_drop_adddrop_max; //[skotlex] int prevent_logout; // Added by RoVeRT it becomes int item_drop_adddrop_min,item_drop_adddrop_max; //[skotlex] int prevent_logout; // Added by RoVeRT int gm_drop_announce; //Added by Cydh. Dropped item announcement int gm_drop_lvl_from; //Added by Cydh. Dropped item announcement int gm_drop_lvl_to; //Added by Cydh. Dropped item announcement int gm_trade_announce; //Added by Cydh. Traded item announcement int gm_trade_lvl_from; //Added by Cydh. Traded item announcement int gm_trade_lvl_to; //Added by Cydh. Traded item announcement in src\map\battle.c, inside static const struct _battle_data { const char* str; int* val; int defval; int min; int max; } battle_data[] = { .... .... }; before }; signs add new lines,and it becomes static const struct _battle_data { const char* str; int* val; int defval; int min; int max; } battle_data[] = { .... .... { "gm_drop_announce", &battle_config.gm_drop_announce, 1, 0, 1, }, //GM Dropped item announcement [Cydh] { "gm_drop_lvl_from", &battle_config.gm_drop_lvl_from, 20, 0, 99, }, //GM Dropped item announcement [Cydh] { "gm_drop_lvl_to", &battle_config.gm_drop_lvl_to, 98, 0, 99, }, //GM Dropped item announcement [Cydh] { "gm_trade_announce", &battle_config.gm_trade_announce, 1, 0, 1, }, //GM Traded item announcement [Cydh] { "gm_trade_lvl_from", &battle_config.gm_trade_lvl_from, 20, 0, 99, }, //GM Traded item announcement [Cydh] { "gm_trade_lvl_to", &battle_config.gm_trade_lvl_to, 98, 0, 99, }, //GM Traded item announcement [Cydh] }; inside pc_dropitem in map\pc.c, find int pc_dropitem(struct map_session_data *sd,int n,int amount) { nullpo_retr(1, sd); if(n < 0 || n >= MAX_INVENTORY) and change it becomes int pc_dropitem(struct map_session_data *sd,int n,int amount) { struct item_data *item_data; //GM Drop log char output[255]; //GM Dropped item announcement int gm_lvl1; //GM Dropped item announcement [Cydh]. Must be less than gm_lvl2 int gm_lvl2; //GM Dropped item announcement [Cydh]. Must be more than gm_lvl1 nullpo_retr(1, sd); gm_lvl1 = battle_config.gm_drop_lvl_from; //GM Dropped item announcement [Cydh]. Must be less than gm_lvl2 gm_lvl2 = battle_config.gm_drop_lvl_to; //GM Dropped item announcement [Cydh]. Must be more than gm_lvl1 if(gm_lvl1 > gm_lvl2) //If gm_lvl1 > gm_lvl2, swith them! { gm_lvl1 = battle_config.gm_drop_lvl_to; //GM Dropped item announcement [Cydh] gm_lvl2 = battle_config.gm_drop_lvl_from; //GM Dropped item announcement [Cydh] } if(n < 0 || n >= MAX_INVENTORY) still inside pc_dropitem in map\pc.c, find //Logs if (!map_addflooritem(&sd->status.inventory[n], amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 2)) return 0; pc_delitem(sd, n, amount, 0, 7); } return 1; change it becomes //Logs if (!map_addflooritem(&sd->status.inventory[n], amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 2)) return 0; item_data = itemdb_search(sd->status.inventory[n].nameid); //GM Drop log pc_delitem(sd, n, amount, 0, 7); if(battle_config.gm_trade_announce) //GM Dropped item announcement [Cydh] { //========================================== // GM Drop log by Smoke, edited by Cydh //========================================== if(pc_isGM(sd) >= gm_lvl1 && pc_isGM(sd) <= gm_lvl2) { sprintf(output, "%s dropped %s %dx at %s %d %d",sd->status.name,item_data->jname,amount,mapindex_id2name(map_id2index(sd->bl.m)),sd->bl.x,sd->bl.y); intif_broadcast(output, strlen(output) + 1, 0); } //========================================== } return 1; then, inside trade_tradecommit in map\ trade.c, find void trade_tradecommit(struct map_session_data *sd) { struct map_session_data *tsd; int trade_i; int flag; it becomes void trade_tradecommit(struct map_session_data *sd) { struct item_data *item_data; //GM Trade Log char output[255]; //GM Traded item announcement struct map_session_data *tsd; int trade_i; int flag; still inside trade_tradecommit in map\ trade.c, find // trade is accepted and correct. for( trade_i = 0; trade_i < 10; trade_i++ ) { int n; if (sd->deal.item[trade_i].amount) { n = sd->deal.item[trade_i].index; flag = pc_additem(tsd, &sd->status.inventory[n], sd->deal.item[trade_i].amount); if (flag == 0) { it becomes // trade is accepted and correct. for( trade_i = 0; trade_i < 10; trade_i++ ) { int n; int itemtrade_id; //GM Traded item announcement [Cydh] int itemtrade_amount; //GM Traded item announcement [Cydh] int gm_lvl1; //GM Traded item announcement [Cydh]. Must be less than gm_lvl2 int gm_lvl2; //GM Traded item announcement [Cydh]. Must be more than gm_lvl1 gm_lvl1 = battle_config.gm_drop_lvl_from; //GM Traded item announcement [Cydh]. Must be less than gm_lvl2 gm_lvl2 = battle_config.gm_drop_lvl_to; //GM Traded item announcement [Cydh]. Must be more than gm_lvl1 if(gm_lvl1 > gm_lvl2) //If gm_lvl1 > gm_lvl2, swith them! { gm_lvl1 = battle_config.gm_drop_lvl_to; //GM Traded item announcement [Cydh] gm_lvl2 = battle_config.gm_drop_lvl_from; //GM Traded item announcement [Cydh] } if (sd->deal.item[trade_i].amount) { n = sd->deal.item[trade_i].index; itemtrade_id = sd->status.inventory[n].nameid; //GM Traded item announcement [Cydh] itemtrade_amount = sd->deal.item[trade_i].amount; //GM Traded item announcement [Cydh] flag = pc_additem(tsd, &sd->status.inventory[n], sd->deal.item[trade_i].amount); if (flag == 0) { still inside trade_tradecommit in map\ trade.c, find } else clif_additem(sd, n, sd->deal.item[trade_i].amount, 0); sd->deal.item[trade_i].index = 0; sd->deal.item[trade_i].amount = 0; it becomes } else clif_additem(sd, n, sd->deal.item[trade_i].amount, 0); item_data = itemdb_search(itemtrade_id); //GM Traded item announcement if(battle_config.gm_trade_announce) //GM Traded item announcement [Cydh] { //========================================== // GM Trade log by Smoke, edited by Cydh //========================================== if(pc_isGM(sd) >= gm_lvl1 && pc_isGM(sd) <= gm_lvl2) { sprintf(output, "%s has trade %s %dx with %s", sd->status.name,item_data->jname,itemtrade_amount,tsd->status.name); intif_broadcast(output, strlen(output) + 1, 0); } //========================================== } itemtrade_id = 0; //GM Traded item announcement [Cydh] itemtrade_amount = 0; //GM Traded item announcement [Cydh] sd->deal.item[trade_i].index = 0; sd->deal.item[trade_i].amount = 0; still inside trade_tradecommit in map\ trade.c, find if (tsd->deal.item[trade_i].amount) { n = tsd->deal.item[trade_i].index; flag = pc_additem(sd, &tsd->status.inventory[n], tsd->deal.item[trade_i].amount); if (flag == 0) { //Logs (T)rade [Lupus] it becomes if (tsd->deal.item[trade_i].amount) { n = tsd->deal.item[trade_i].index; itemtrade_id = tsd->status.inventory[n].nameid; //GM Traded item announcement [Cydh] itemtrade_amount = tsd->deal.item[trade_i].amount; //GM Traded item announcement [Cydh] flag = pc_additem(sd, &tsd->status.inventory[n], tsd->deal.item[trade_i].amount); if (flag == 0) { //Logs (T)rade [Lupus] still inside trade_tradecommit is map\ trade.c, find } else clif_additem(tsd, n, tsd->deal.item[trade_i].amount, 0); tsd->deal.item[trade_i].index = 0; tsd->deal.item[trade_i].amount = 0; } it becomes } else clif_additem(tsd, n, tsd->deal.item[trade_i].amount, 0); item_data = itemdb_search(itemtrade_id); //GM Traded item announcement if(battle_config.gm_trade_announce) //GM Traded item announcement [Cydh] { //========================================== // GM Trade log by Smoke, edited by Cydh //========================================== if(pc_isGM(sd) >= gm_lvl1 && pc_isGM(sd) <= gm_lvl2) { sprintf(output, "%s has trade %s %dx with %s", tsd->status.name,item_data->jname,itemtrade_amount,sd->status.name); intif_broadcast(output, strlen(output) + 1, 0); } //========================================== } itemtrade_id = 0; //GM Traded item announcement [Cydh] itemtrade_amount = 0; //GM Traded item announcement [Cydh] tsd->deal.item[trade_i].index = 0; tsd->deal.item[trade_i].amount = 0; } all above, work fine for me. Edited September 7, 2012 by cydh Quote Link to comment Share on other sites More sharing options...
Sryx Posted November 17, 2012 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 520 Reputation: 64 Joined: 11/19/11 Last Seen: October 19, 2024 Share Posted November 17, 2012 (edited) doesn't work if I implemented it totally.. XD however, thank Smoke, sorry I almost edit all ur work to be like these, my modification focuss in announcement than log because we can use picklog, right? Error on TRADE.C, I'm using latest rAthena SVN. Edited November 17, 2012 by Rejected Quote Link to comment Share on other sites More sharing options...
Cydh Posted November 18, 2012 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 748 Joined: 06/16/12 Last Seen: February 21 Share Posted November 18, 2012 Error on TRADE.C, I'm using latest rAthena SVN. what's line? the error message? Quote Link to comment Share on other sites More sharing options...
Sryx Posted November 18, 2012 Group: Members Topic Count: 15 Topics Per Day: 0.00 Content Count: 520 Reputation: 64 Joined: 11/19/11 Last Seen: October 19, 2024 Share Posted November 18, 2012 (edited) Error on TRADE.C, I'm using latest rAthena SVN. what's line? the error message? I think this line, Sorry I forgot. flag = pc_additem(tsd, &sd->status.inventory[n], sd->deal.item[trade_i].amount); Edited November 18, 2012 by Rejected Quote Link to comment Share on other sites More sharing options...
Cydh Posted November 19, 2012 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 748 Joined: 06/16/12 Last Seen: February 21 Share Posted November 19, 2012 flag = pc_additem(tsd, &sd->status.inventory[n], sd->deal.item[trade_i].amount); I don't know why, I don't know what's the error/warning message.. try to send me PM of the compile error message and your trade.c file.. Quote Link to comment Share on other sites More sharing options...
goddameit Posted November 19, 2012 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Share Posted November 19, 2012 (edited) flag = pc_additem(tsd, &sd->status.inventory[n], sd->deal.item[trade_i].amount,LOG_TYPE_SCRIPT); int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type) you forgot this Edited November 19, 2012 by goddameit Quote Link to comment Share on other sites More sharing options...
Cydh Posted November 19, 2012 Group: Developer Topic Count: 153 Topics Per Day: 0.03 Content Count: 2285 Reputation: 748 Joined: 06/16/12 Last Seen: February 21 Share Posted November 19, 2012 flag = pc_additem(tsd, &sd->status.inventory[n], sd->deal.item[trade_i].amount,LOG_TYPE_SCRIPT); int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_log_pick_type log_type) you forgot this not forget, only based on original file.. I wasn't editing for latest rAthena version.. xD 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.