Автор: ZzAQ: Дата: 06.10.2008
/*==========================================
* @autolootitem by Zephyrus
* Turns on/off AutoLoot for a specific player
*------------------------------------------*/
int atcommand_autolootitem(const int fd, struct map_session_data* sd, const char* command, const char* message)
{
struct item_data *item_data = NULL;
if (!message || !*message) {
if (sd->state.autolootitem) {
sd->state.autolootitem = 0;
clif_displaymessage(fd, "Autolootitem is now OFF.");
} else
clif_displaymessage(fd, "Please, enter Item name or its ID (usage: @autolootitem ).");
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;
}
sd->state.autolootitem = item_data->nameid; // Autoloot Activated
sprintf(atcmd_output, "Autolooting Item: '%s'/'%s' {%d}",
item_data->name, item_data->jname, item_data->nameid);
clif_displaymessage(fd, atcmd_output);
if (sd->state.autolootitem && sd->state.autoloot) {
// Autoloot should be turned off
sd->state.autoloot = 0;
clif_displaymessage(fd, "Autoloot is now off (cannot be actitaved together).");
}
return 0;
}
{ "autolootitem", 0, atcommand_autolootitem },
sd = map_charid2sd(dlist->first_charid);
if( sd == NULL ) sd = map_charid2sd(dlist->second_charid);
if( sd == NULL ) sd = map_charid2sd(dlist->third_charid);
if( sd && (( sd->state.autoloot && drop_rate <= sd->state.autoloot ) ||
sd = map_charid2sd(dlist->first_charid);
if( sd == NULL ) sd = map_charid2sd(dlist->second_charid);
if( sd == NULL ) sd = map_charid2sd(dlist->third_charid);
if( sd && (( sd->state.autoloot && drop_rate <= sd->state.autoloot ) ||
( sd->state.autolootitem && ditem->item_data.nameid == sd->state.autolootitem ))
Автор: : Дата: 01.01.1970