summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2017-04-29 01:02:59 +0200
committerGitHub <noreply@github.com>2017-04-29 01:02:59 +0200
commite9daf0e172d5441ec6d264b4056db4f7f3e5780a (patch)
treee1caabf5f8b31434cc0d37de0a73d520a3171950
parent116a10e40cd80bc0629c36bf907868219ff6360b (diff)
parentb767de877460a7fb55c4c8a6bd8e21bcbe079b07 (diff)
downloadhercules-e9daf0e172d5441ec6d264b4056db4f7f3e5780a.tar.gz
hercules-e9daf0e172d5441ec6d264b4056db4f7f3e5780a.tar.bz2
hercules-e9daf0e172d5441ec6d264b4056db4f7f3e5780a.tar.xz
hercules-e9daf0e172d5441ec6d264b4056db4f7f3e5780a.zip
Merge pull request #1713 from Jedzkie/17-DropAnnounce
Fixes #994
-rw-r--r--conf/map/battle/drops.conf9
-rw-r--r--conf/messages.conf7
-rw-r--r--db/pre-re/item_db.conf5
-rw-r--r--db/re/item_db.conf5
-rw-r--r--doc/item_db.txt3
-rw-r--r--src/map/battle.c1
-rw-r--r--src/map/battle.h1
-rw-r--r--src/map/itemdb.c3
-rw-r--r--src/map/itemdb.h3
-rw-r--r--src/map/mob.c29
-rw-r--r--src/map/pc.c7
-rwxr-xr-xtools/configconverter.pl1
12 files changed, 22 insertions, 52 deletions
diff --git a/conf/map/battle/drops.conf b/conf/map/battle/drops.conf
index 547a4ae4e..4dbbf8fd5 100644
--- a/conf/map/battle/drops.conf
+++ b/conf/map/battle/drops.conf
@@ -146,12 +146,3 @@ drops_by_luk2: 0
// 1: Only marine spheres drop items.
// 2: All alchemist summons drop items.
alchemist_summon_reward: 1
-
-// Make broadcast ** Player1 won Pupa's Pupa Card (chance 0.01%) ***
-// This can be set to any value between 0~10000.
-// Note: It also announces STEAL skill usage with rare items
-// 0 = don't show announces at all
-// 1 = show announces for 0.01% drop chance items
-// 333 = show announces for 3.33% or lower drop chance items
-// 10000 = show announces for all items
-rare_drop_announce: 0
diff --git a/conf/messages.conf b/conf/messages.conf
index 768bee777..a1b070391 100644
--- a/conf/messages.conf
+++ b/conf/messages.conf
@@ -469,12 +469,7 @@
538: Hack on trade: character '%s' (account: %d) try to trade more items that he has.
539: This player has %d of a kind of item (id: %d), and tried to trade %d of them.
540: This player has been definitively blocked.
-// Rare Items Drop/Steal announce
-541: '%s' got %s's %s (chance: %0.02f%%)
-//541: %.0s%.0sSomeone got %s
-542: '%s' stole %s's %s (chance: %0.02f%%)
-//542: %.0s%.0sSomeone stole %s
-//543-545 FREE
+//541-545 FREE
// @showmobs
546: Please enter a mob name/id (usage: @showmobs <mob name/id>)
547: Invalid mob name %s!
diff --git a/db/pre-re/item_db.conf b/db/pre-re/item_db.conf
index cfa7cb7d1..7309af4d3 100644
--- a/db/pre-re/item_db.conf
+++ b/db/pre-re/item_db.conf
@@ -70,7 +70,7 @@ item_db: (
Taekwon: true/false (boolean, defaults to false)
Star_Gladiator: true/false (boolean, defaults to false)
Soul_Linker: true/false (boolean, defaults to false)
- Gunslinger: true/false (boolean, defaults to false)
+ Gunslinger: true/false (boolean, defaults to false)
Ninja: true/false (boolean, defaults to false)
Gangsi: true/false (boolean, defaults to false)
Death_Knight: true/false (boolean, defaults to false)
@@ -93,6 +93,7 @@ item_db: (
BuyingStore: true/false (boolean, defaults to false)
Delay: Delay to use item (int, defaults to 0)
KeepAfterUse: true/false (boolean, defaults to false)
+ DropAnnounce: true/false (boolean, defaults to false)
Trade: { (defaults to no restrictions)
override: GroupID (int, defaults to 100)
nodrop: true/false (boolean, defaults to false)
@@ -63262,6 +63263,7 @@ item_db: (
Name: "Episode 13.1 Poporing Key"
Type: 3
Weight: 10
+ DropAnnounce: true
},
{
Id: 7783
@@ -63269,6 +63271,7 @@ item_db: (
Name: "Episode 13.2 Poring Key"
Type: 3
Weight: 10
+ DropAnnounce: true
},
{
Id: 7784
diff --git a/db/re/item_db.conf b/db/re/item_db.conf
index d1f416b08..b47bd46d4 100644
--- a/db/re/item_db.conf
+++ b/db/re/item_db.conf
@@ -70,7 +70,7 @@ item_db: (
Taekwon: true/false (boolean, defaults to false)
Star_Gladiator: true/false (boolean, defaults to false)
Soul_Linker: true/false (boolean, defaults to false)
- Gunslinger: true/false (boolean, defaults to false)
+ Gunslinger: true/false (boolean, defaults to false)
Ninja: true/false (boolean, defaults to false)
Gangsi: true/false (boolean, defaults to false)
Death_Knight: true/false (boolean, defaults to false)
@@ -93,6 +93,7 @@ item_db: (
BuyingStore: true/false (boolean, defaults to false)
Delay: Delay to use item (int, defaults to 0)
KeepAfterUse: true/false (boolean, defaults to false)
+ DropAnnounce: true/false (boolean, defaults to false)
Trade: { (defaults to no restrictions)
override: GroupID (int, defaults to 100)
nodrop: true/false (boolean, defaults to false)
@@ -80968,12 +80969,14 @@ item_db: (
AegisName: "Gold_Key77"
Name: "Episode 13.1 Poporing Key"
Weight: 10
+ DropAnnounce: true
},
{
Id: 7783
AegisName: "Silver_Key77"
Name: "Episode 13.2 Poring Key"
Weight: 10
+ DropAnnounce: true
},
{
Id: 7784
diff --git a/doc/item_db.txt b/doc/item_db.txt
index 6ffc8a52b..86e397636 100644
--- a/doc/item_db.txt
+++ b/doc/item_db.txt
@@ -71,6 +71,7 @@ item_db: (
BuyingStore: true/false (boolean, defaults to false)
Delay: Delay to use item (int, defaults to 0)
KeepAfterUse: true/false (boolean, defaults to false)
+ DropAnnounce: true/false (boolean, defaults to false)
Trade: { (defaults to no restrictions)
override: GroupID (int, defaults to 100)
nodrop: true/false (boolean, defaults to false)
@@ -290,6 +291,8 @@ ForceSerial: Whether the item will be given new unique id or not. When the item
BuyingStore: Whether the item can be sold via buyingstore, one must also edit
data\buyingstoreitemlist.txt for client to accept item.
+DropAnnounce: Enables global announcement of the selected item when dropped by monster.
+
Delay: Delay for an item to be used again. Value is in milliseconds.
There is a max concurrent number of entries modifiable in
src/map/itemdb.h as MAX_ITEMDELAYS.
diff --git a/src/map/battle.c b/src/map/battle.c
index a4e6d8dd1..cf08bf96c 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -7210,7 +7210,6 @@ static const struct battle_data {
{ "mob_npc_event_type", &battle_config.mob_npc_event_type, 1, 0, 1, },
{ "character_size", &battle_config.character_size, 1|2, 0, 1|2, },
{ "retaliate_to_master", &battle_config.retaliate_to_master, 1, 0, 1, },
- { "rare_drop_announce", &battle_config.rare_drop_announce, 0, 0, 10000, },
{ "duel_allow_pvp", &battle_config.duel_allow_pvp, 0, 0, 1, },
{ "duel_allow_gvg", &battle_config.duel_allow_gvg, 0, 0, 1, },
{ "duel_allow_teleport", &battle_config.duel_allow_teleport, 0, 0, 1, },
diff --git a/src/map/battle.h b/src/map/battle.h
index d582f3c92..a5e50407e 100644
--- a/src/map/battle.h
+++ b/src/map/battle.h
@@ -407,7 +407,6 @@ struct Battle_Config {
int mob_npc_event_type; //Determines on who the npc_event is executed. [Skotlex]
int character_size; // if riders have size=2, and baby class riders size=1 [Lupus]
- int rare_drop_announce; // chance <= to show rare drops global announces
int retaliate_to_master; //Whether when a mob is attacked by another mob, it will retaliate versus the mob or the mob's master. [Skotlex]
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index a35aa67f1..4076e295c 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -2073,6 +2073,9 @@ int itemdb_readdb_libconfig_sub(struct config_setting_t *it, int n, const char *
if ((t = libconfig->setting_get_member(it, "KeepAfterUse")))
id.flag.keepafteruse = libconfig->setting_get_bool(t) ? 1 : 0;
+ if ((t = libconfig->setting_get_member(it, "DropAnnounce")))
+ id.flag.drop_announce = libconfig->setting_get_bool(t) ? 1 : 0;
+
if (itemdb->lookup_const(it, "Delay", &i32) && i32 >= 0)
id.delay = i32;
diff --git a/src/map/itemdb.h b/src/map/itemdb.h
index 138a783ae..f77801e09 100644
--- a/src/map/itemdb.h
+++ b/src/map/itemdb.h
@@ -111,8 +111,6 @@ enum item_itemid {
ITEMID_FRAGMENT_OF_CRYSTAL = 7321,
ITEMID_SKULL_ = 7420,
ITEMID_TOKEN_OF_SIEGFRIED = 7621,
- ITEMID_GOLD_KEY77 = 7782,
- ITEMID_SILVER_KEY77 = 7783,
ITEMID_SPECIAL_ALLOY_TRAP = 7940,
ITEMID_CATNIP_FRUIT = 11602,
ITEMID_RED_POUCH_OF_SURPRISE = 12024,
@@ -510,6 +508,7 @@ struct item_data {
unsigned keepafteruse : 1;
unsigned force_serial : 1;
unsigned no_options: 1; // < disallows use of item options on the item. (non-equippable items are automatically flagged) [Smokexyz]
+ unsigned drop_announce : 1; // Official Drop Announce [Jedzkie]
} flag;
struct {// item stacking limitation
unsigned short amount;
diff --git a/src/map/mob.c b/src/map/mob.c
index 74d25b805..52705cf4d 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2151,6 +2151,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
struct map_session_data *sd = BL_CAST(BL_PC, src);
struct map_session_data *tmpsd[DAMAGELOG_SIZE] = { NULL };
struct map_session_data *mvp_sd = sd, *second_sd = NULL, *third_sd = NULL;
+ struct item_data *id = NULL;
struct {
struct party_data *p;
@@ -2439,23 +2440,13 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
ditem = mob->setdropitem(md->db->dropitem[i].nameid, 1, it);
- //A Rare Drop Global Announce by Lupus
- if( mvp_sd && drop_rate <= battle_config.rare_drop_announce ) {
- char message[128];
- sprintf (message, msg_txt(541), mvp_sd->status.name, md->name, it->jname, (float)drop_rate/100);
- //MSG: "'%s' won %s's %s (chance: %0.02f%%)"
- intif->broadcast(message, (int)strlen(message)+1, BC_DEFAULT);
+ // Official Drop Announce [Jedzkie]
+ if (mvp_sd != NULL) {
+ if ((id = itemdb->search(it->nameid)) != NULL && id->flag.drop_announce) {
+ clif->item_drop_announce(mvp_sd, it->nameid, md->name);
+ }
}
- /* heres the thing we got the feature set up however we're still discussing how to best define the ids,
- * so while we discuss, for a small period of time, the list is hardcoded (yes officially only those 2 use it,
- * thus why we're unsure on how to best place the setting) */
- /* temp, will not be hardcoded for long thudu. */
- // TODO: This should be a field in the item db.
- if (mvp_sd != NULL
- && (it->nameid == ITEMID_GOLD_KEY77 || it->nameid == ITEMID_SILVER_KEY77)) /* for when not hardcoded: add a check on mvp bonus drop as well */
- clif->item_drop_announce(mvp_sd, it->nameid, md->name);
-
// Announce first, or else ditem will be freed. [Lance]
// By popular demand, use base drop rate for autoloot code. [Skotlex]
mob->item_drop(md, dlist, ditem, 0, md->db->dropitem[i].p, homkillonly);
@@ -2592,14 +2583,6 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
clif->mvp_item(mvp_sd, item.nameid);
log_mvp[0] = item.nameid;
- //A Rare MVP Drop Global Announce by Lupus
- if (rate <= battle_config.rare_drop_announce) {
- char message[128];
- sprintf(message, msg_txt(541), mvp_sd->status.name, md->name, data->jname, rate/100.);
- //MSG: "'%s' won %s's %s (chance: %0.02f%%)"
- intif->broadcast(message, (int)strlen(message)+1, BC_DEFAULT);
- }
-
if((temp = pc->additem(mvp_sd,&item,1,LOG_TYPE_PICKDROP_PLAYER)) != 0) {
clif->additem(mvp_sd,0,0,temp);
map->addflooritem(&md->bl, &item, 1, mvp_sd->bl.m, mvp_sd->bl.x, mvp_sd->bl.y, mvp_sd->status.char_id, (second_sd?second_sd->status.char_id : 0), (third_sd ? third_sd->status.char_id : 0), 1);
diff --git a/src/map/pc.c b/src/map/pc.c
index f0d050feb..ca7387474 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5491,13 +5491,6 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, uint16 skil
//Logs items, Stolen from mobs [Lupus]
logs->pick_mob(md, LOG_TYPE_STEAL, -1, &tmp_item, data);
- //A Rare Steal Global Announce by Lupus
- if(md->db->dropitem[i].p<=battle_config.rare_drop_announce) {
- char message[128];
- sprintf (message, msg_txt(542), sd->status.name, md->db->jname, data->jname, (float)md->db->dropitem[i].p / 100);
- //MSG: "'%s' stole %s's %s (chance: %0.02f%%)"
- intif->broadcast(message, (int)strlen(message)+1, BC_DEFAULT);
- }
return 1;
}
diff --git a/tools/configconverter.pl b/tools/configconverter.pl
index 4fafd1f64..dc511aaef 100755
--- a/tools/configconverter.pl
+++ b/tools/configconverter.pl
@@ -677,7 +677,6 @@ my @defaults = (
drops_by_luk => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 0},
drops_by_luk2 => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 0},
alchemist_summon_reward => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 1},
- rare_drop_announce => {parse => \&parsecfg_int, print => \&printcfg_int, path => "drops:", default => 0},
base_exp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 100},
job_exp_rate => {parse => \&parsecfg_int, print => \&printcfg_int, path => "exp:", default => 100},
multi_level_up => {parse => \&parsecfg_bool, print => \&printcfg_bool, path => "exp:", default => "false"},