Назад

@alootid1-4

Автор: dimjke: Дата: 12.08.2010

atcommand.c
ищем команду @autolootitem
заменяем весь код на

/*==========================================
* @autolootitem by mrboob
*------------------------------------------*/
int atcommand_autolootitem(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
struct item_data *item_data = NULL;
char postfix;

postfix = command[strlen(command)-1];

if (!message || !*message) {
switch(postfix){
case '4':
if (sd->state.autolootid4) {
sd->state.autolootid4 = 0;
clif_displaymessage(fd, "Autolootitem4 have been turned OFF.");
} else
clif_displaymessage(fd, "Please, enter Item name or its ID (usage: @alootid4 ).");
break;
case '3':
if (sd->state.autolootid3) {
sd->state.autolootid3 = 0;
clif_displaymessage(fd, "Autolootitem3 have been turned OFF.");
} else
clif_displaymessage(fd, "Please, enter Item name or its ID (usage: @alootid3 ).");
break;
case '2':
if (sd->state.autolootid2) {
sd->state.autolootid2 = 0;
clif_displaymessage(fd, "Autolootitem2 have been turned OFF.");
} else
clif_displaymessage(fd, "Please, enter Item name or its ID (usage: @alootid2 ).");
break;
default:
if (sd->state.autolootid) {
sd->state.autolootid = 0;
clif_displaymessage(fd, "Autolootitem have been turned OFF.");
} else
clif_displaymessage(fd, "Please, enter Item name or its ID (usage: @alootid ).");
break;
}
return -1;
}

if ((item_data = itemdb_exists(atoi(message))) == NULL)
item_data = itemdb_searchname(message);

if (!item_data) {
// No items founds in the DB with Id or Name
clif_displaymessage(fd, "Item not found.");
return -1;
}

switch(postfix){
case '4':
sd->state.autolootid4 = item_data->nameid;
break;
case '3':
sd->state.autolootid3 = item_data->nameid;
break;
case '2':
sd->state.autolootid2 = item_data->nameid;
break;
default:
sd->state.autolootid = item_data->nameid;
break;
}

sprintf(atcmd_output, "Autolooting Item: '%s'/'%s' {%d}",
item_data->name, item_data->jname, item_data->nameid);
clif_displaymessage(fd, atcmd_output);

return 0;
}


{ "alootid2",           10,     atcommand_autolootitem },
{ "alootid3", 10, atcommand_autolootitem },
{ "alootid4", 10, atcommand_autolootitem }, // mrboob


далее идем в mob.c
всю функцию static void mob_item_drop заменям на это

/*==========================================
* Sets the item_drop into the item_drop_list.
* Also performs logging and autoloot if enabled.
* rate is the drop-rate of the item, required for autoloot.
* flag : Killed only by homunculus?
*------------------------------------------*/
static void mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, struct item_drop *ditem, int loot, int drop_rate, unsigned short flag)
{
TBL_PC* sd;

if(log_config.enable_logs&0x10)
{ //Logs items, dropped by mobs [Lupus]
if (loot)
log_pick_mob(md, "L", ditem->item_data.nameid, -ditem->item_data.amount, &ditem->item_data);
else
log_pick_mob(md, "M", ditem->item_data.nameid, -ditem->item_data.amount, NULL);
}

sd = map_charid2sd(dlist->first_charid);
if( sd == NULL ) sd = map_charid2sd(dlist->second_charid);
if( sd == NULL ) sd = map_charid2sd(dlist->third_charid);
//by BlackSoul
if ( sd && ( sd->state.showdrop > 0 ) && ( drop_rate <= sd->state.showdrop ) )
{
char atcmd_output [100];
if ( itemdb_exists ( ditem->item_data.nameid ) )
{
sprintf(atcmd_output, "You won %s's %s ( %2.2f % )", md->db->name, itemdb_exists ( ditem->item_data.nameid )->jname, ( drop_rate/100.00 ) );
clif_announce( &sd->bl, atcmd_output, strlen ( atcmd_output)+1, 0xBE59FF, 3);
}
}
//BlackSoul - end

if( sd
&& (drop_rate <= sd->state.autoloot || ditem->item_data.nameid == sd->state.autolootid || ditem->item_data.nameid == sd->state.autolootid2 || ditem->item_data.nameid == sd->state.autolootid3 || ditem->item_data.nameid == sd->state.autolootid4 )
&& (battle_config.idle_no_autoloot == 0 || DIFF_TICK(last_tick, sd->idletime) < battle_config.idle_no_autoloot)
&& (battle_config.homunculus_autoloot?1:!flag)
#ifdef AUTOLOOT_DISTANCE
&& check_distance_blxy(&sd->bl, dlist->x, dlist->y, AUTOLOOT_DISTANCE)
#endif
) { //Autoloot.
if (party_share_loot(party_search(sd->status.party_id),
sd, &ditem->item_data, sd->status.char_id) == 0
) {
ers_free(item_drop_ers, ditem);
return;
}
}
ditem->next = dlist->item;
dlist->item = ditem;
}


и последнее..топаем в pc.h
после строк unsigned short autolootid; // [Zephyrus]

unsigned short autolootid2;
unsigned short autolootid3;
unsigned short autolootid4;

Автор: : Дата: 01.01.1970