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.