Jump to content

Adimgar

Members
  • Posts

    17
  • Joined

  • Last visited

Community Answers

  1. Adimgar's post in mob.cpp - autoloot flag autoloot system was marked as the answer   
    Solved:
    diff --git a/src/map/itemdb.cpp b/src/map/itemdb.cpp index 1a56cd2df..a535c724b 100644 --- a/src/map/itemdb.cpp +++ b/src/map/itemdb.cpp @@ -649,6 +649,18 @@ uint64 ItemDatabase::parseBodyNode(const YAML::Node &node) { if (!exists) item->flag.dropEffect = DROPEFFECT_NONE; } + + if (this->nodeExists(flagNode, "NoAutoLoot")) { + bool active; + + if (!this->asBool(flagNode, "NoAutoLoot", active)) + return 0; + + item->flag.noautoloot = active; + } else { + if (!exists) + item->flag.noautoloot = false; + } } else { if (!exists) { item->flag.buyingstore = false; @@ -657,6 +669,7 @@ uint64 ItemDatabase::parseBodyNode(const YAML::Node &node) { item->flag.guid = false; item->flag.bindOnEquip = false; item->flag.broadcast = false; + item->flag.noautoloot = false; if (!(item->flag.delay_consume & DELAYCONSUME_TEMP)) item->flag.delay_consume = DELAYCONSUME_NONE; item->flag.dropEffect = DROPEFFECT_NONE; @@ -2115,6 +2128,8 @@ static bool itemdb_read_sqldb_sub(std::vector<std::string> str) { flags["NoConsume"] = std::stoi(str[index]) ? "true" : "false"; if (!str[++index].empty()) flags["DropEffect"] = str[index]; + if (!str[++index].empty()) + flags["NoAutoLoot"] = std::stoi(str[index]) ? "true" : "false"; node["Flags"] = flags; YAML::Node delay; @@ -2219,7 +2234,7 @@ static int itemdb_read_sqldb(void) { "`location_head_top`,`location_head_mid`,`location_head_low`,`location_armor`,`location_right_hand`,`location_left_hand`,`location_garment`,`location_shoes`,`location_right_accessory`,`location_left_accessory`," "`location_costume_head_top`,`location_costume_head_mid`,`location_costume_head_low`,`location_costume_garment`,`location_ammo`,`location_shadow_armor`,`location_shadow_weapon`,`location_shadow_shield`,`location_shadow_shoes`,`location_shadow_right_accessory`,`location_shadow_left_accessory`," "`weapon_level`,`equip_level_min`,`equip_level_max`,`refineable`,`view`,`alias_name`," - "`flag_buyingstore`,`flag_deadbranch`,`flag_container`,`flag_uniqueid`,`flag_bindonequip`,`flag_dropannounce`,`flag_noconsume`,`flag_dropeffect`," + "`flag_buyingstore`,`flag_deadbranch`,`flag_container`,`flag_uniqueid`,`flag_bindonequip`,`flag_dropannounce`,`flag_noconsume`,`flag_dropeffect`,`flag_noautoloot`," "`delay_duration`,`delay_status`,`stack_amount`,`stack_inventory`,`stack_cart`,`stack_storage`,`stack_guildstorage`,`nouse_override`,`nouse_sitting`," "`trade_override`,`trade_nodrop`,`trade_notrade`,`trade_tradepartner`,`trade_nosell`,`trade_nocart`,`trade_nostorage`,`trade_noguildstorage`,`trade_nomail`,`trade_noauction`,`script`,`equip_script`,`unequip_script`" #ifdef RENEWAL diff --git a/src/map/itemdb.hpp b/src/map/itemdb.hpp index 5307110e8..3594457eb 100644 --- a/src/map/itemdb.hpp +++ b/src/map/itemdb.hpp @@ -901,6 +901,7 @@ struct item_data bool broadcast; ///< Will be broadcasted if someone obtain the item [Cydh] bool bindOnEquip; ///< Set item as bound when equipped e_item_drop_effect dropEffect; ///< Drop Effect Mode + bool noautoloot; } flag; struct {// item stacking limitation uint16 amount; diff --git a/src/map/mob.cpp b/src/map/mob.cpp index 2ea69795e..31472a496 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -2252,6 +2252,8 @@ static void mob_item_drop(struct mob_data *md, struct item_drop_list *dlist, str if( sd == NULL ) sd = map_charid2sd(dlist->second_charid); if( sd == NULL ) sd = map_charid2sd(dlist->third_charid); test_autoloot = sd + && (itemdb_search(ditem->item_data.nameid))->flag.noautoloot == false + && (itemdb_type(ditem->item_data.nameid) != IT_CARD) && (drop_rate <= sd->state.autoloot || pc_isautolooting(sd, ditem->item_data.nameid)) && (flag?(battle_config.homunculus_autoloot?(battle_config.hom_idle_no_share == 0 || !pc_isidle_hom(sd)):0): (battle_config.idle_no_autoloot == 0 || DIFF_TICK(last_tick, sd->idletime) < battle_config.idle_no_autoloot)); ALTER TABLE item_db_re ADD COLUMN `flag_noautoloot` tinyint(1) unsigned DEFAULT NULL AFTER `flag_dropeffect`; ALTER TABLE item_db2_re ADD COLUMN `flag_noautoloot` tinyint(1) unsigned DEFAULT NULL AFTER `flag_dropeffect`; Thanks to @Litro Endemic
     
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.