summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKomurka <Komurka@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-20 12:42:24 +0000
committerKomurka <Komurka@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-20 12:42:24 +0000
commitfe3cdd0b0d0be3554f0bb3e7733d36c52c7188da (patch)
treef4a4226cfe89157ad3ce0b998a6c823b4010a7e4 /src
parent35f25e039487ea5ebaab78c02ee6bbe3e88d9edc (diff)
downloadhercules-fe3cdd0b0d0be3554f0bb3e7733d36c52c7188da.tar.gz
hercules-fe3cdd0b0d0be3554f0bb3e7733d36c52c7188da.tar.bz2
hercules-fe3cdd0b0d0be3554f0bb3e7733d36c52c7188da.tar.xz
hercules-fe3cdd0b0d0be3554f0bb3e7733d36c52c7188da.zip
* Updated item_bluebox.txt, item_giftbox.txt, item_violetbox.txt, item_db.txt, mob_db.txt, added item_cookie_bag.txt
- new databases from Aegis 10.2 - implemented Cookie Bag item - added missing mobs - note: yes, I know that random item databases can be shorter (item_bluebox.txt, item_violetbox.txt, item_cookie_bag.txt, but not with current implementation of item randomizing for expamle: - there are 9285 items in item_bluebox.txt, and 1000000/9285 = real value - so line with Red Potion would contain rate = 1000000/9285*12 = real value (can't be) I think it's better to have bigger db, and do ONE rand check, than shorter and check it even 1000 times ~~ (in function itemdb_searchrandomid) so please, don't mess with them, or change them * Changed MAX_RANDITEM from 2000 to 10000 to fit new databases - Added reading of new file - item_cookie_bag.txt git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5341 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/itemdb.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index ccc3b49d4..6b0900541 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -15,7 +15,7 @@
#include "script.h"
#include "pc.h"
-#define MAX_RANDITEM 2000
+#define MAX_RANDITEM 10000
#define MAX_ITEMGROUP 32
// ** ITEMDB_OVERRIDE_NAME_VERBOSE **
// 定義すると、itemdb.txtとgrfで名前が異なる場合、表示します.
@@ -23,9 +23,9 @@
static struct dbt* item_db;
-static struct random_item_data blue_box[MAX_RANDITEM], violet_box[MAX_RANDITEM], card_album[MAX_RANDITEM], gift_box[MAX_RANDITEM], scroll[MAX_RANDITEM], finding_ore[MAX_RANDITEM];
-static int blue_box_count=0, violet_box_count=0, card_album_count=0, gift_box_count=0, scroll_count=0, finding_ore_count = 0;
-static int blue_box_default=0, violet_box_default=0, card_album_default=0, gift_box_default=0, scroll_default=0, finding_ore_default = 0;
+static struct random_item_data blue_box[MAX_RANDITEM], violet_box[MAX_RANDITEM], card_album[MAX_RANDITEM], gift_box[MAX_RANDITEM], scroll[MAX_RANDITEM], finding_ore[MAX_RANDITEM], cookie_bag[MAX_RANDITEM];
+static int blue_box_count=0, violet_box_count=0, card_album_count=0, gift_box_count=0, scroll_count=0, finding_ore_count = 0, cookie_bag_count=0;
+static int blue_box_default=0, violet_box_default=0, card_album_default=0, gift_box_default=0, scroll_default=0, finding_ore_default = 0, cookie_bag_default=0;
static struct item_group itemgroup_db[MAX_ITEMGROUP];
@@ -84,7 +84,7 @@ int itemdb_searchrandomid(int flags)
struct {
int nameid,count;
struct random_item_data *list;
- } data[7];
+ } data[8];
// for BCC32 compile error
data[0].nameid = 0; data[0].count = 0; data[0].list = NULL;
@@ -94,8 +94,9 @@ int itemdb_searchrandomid(int flags)
data[4].nameid = gift_box_default; data[4].count = gift_box_count; data[4].list = gift_box;
data[5].nameid = scroll_default; data[5].count = scroll_count; data[5].list = scroll;
data[6].nameid = finding_ore_default; data[6].count = finding_ore_count; data[6].list = finding_ore;
+ data[7].nameid = cookie_bag_default; data[7].count = cookie_bag_count; data[7].list = cookie_bag;
- if(flags>=1 && flags<=6){
+ if(flags>=1 && flags<=7){
nameid=data[flags].nameid;
count=data[flags].count;
list=data[flags].list;
@@ -354,6 +355,7 @@ static int itemdb_read_randomitem(void)
{"item_giftbox.txt", gift_box, &gift_box_count, &gift_box_default },
{"item_scroll.txt", scroll, &scroll_count, &scroll_default },
{"item_findingore.txt", finding_ore,&finding_ore_count, &finding_ore_default },
+ {"item_cookie_bag.txt", cookie_bag,&cookie_bag_count, &cookie_bag_default },
};
for(i=0;i<sizeof(data)/sizeof(data[0]);i++){
@@ -361,6 +363,7 @@ static int itemdb_read_randomitem(void)
int *pc=data[i].pcount;
int *pdefault=data[i].pdefault;
char *fn=(char *) data[i].filename;
+ ln=0;
*pdefault = 0;
sprintf(line, "%s/%s", db_path, fn);