summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--db/const.txt3
-rw-r--r--sql-files/main.sql4
-rw-r--r--sql-files/upgrades/2013-10-30--19-53.sql5
-rw-r--r--sql-files/upgrades/index.txt1
-rw-r--r--src/char/char.c20
-rw-r--r--src/common/mmo.h3
-rw-r--r--src/map/clif.c15
-rw-r--r--src/map/clif.h2
-rw-r--r--src/map/map.h3
-rw-r--r--src/map/mob.c6
10 files changed, 55 insertions, 7 deletions
diff --git a/db/const.txt b/db/const.txt
index ddc4a188a..a90b87356 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -418,6 +418,9 @@ killerrid 121 1
killedrid 122 1
SlotChange 123 1
CharRename 124 1
+ModExp 125 1
+ModDrop 126 1
+ModDeath 127 1
bMaxHP 6
bMaxSP 8
diff --git a/sql-files/main.sql b/sql-files/main.sql
index 2c91d58b1..f8a225ee9 100644
--- a/sql-files/main.sql
+++ b/sql-files/main.sql
@@ -661,6 +661,7 @@ INSERT INTO `sql_updates` (`timestamp`) VALUES (1366078541);
INSERT INTO `sql_updates` (`timestamp`) VALUES (1381354728);
INSERT INTO `sql_updates` (`timestamp`) VALUES (1381423003);
INSERT INTO `sql_updates` (`timestamp`) VALUES (1382892428);
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1383162785);
INSERT INTO `sql_updates` (`timestamp`) VALUES (1383167577);
--
@@ -715,6 +716,9 @@ INSERT INTO `interreg` (`varname`, `value`) VALUES
CREATE TABLE IF NOT EXISTS `account_data` (
`account_id` int(11) unsigned NOT NULL default '0',
`bank_vault` int(11) unsigned NOT NULL default '0',
+ `base_exp` TINYINT( 4 ) UNSIGNED NOT NULL default '0',
+ `base_drop` TINYINT( 4 ) UNSIGNED NOT NULL default '0',
+ `base_death` TINYINT( 4 ) UNSIGNED NOT NULL default '0',
PRIMARY KEY (`account_id`)
) ENGINE=MyISAM;
diff --git a/sql-files/upgrades/2013-10-30--19-53.sql b/sql-files/upgrades/2013-10-30--19-53.sql
new file mode 100644
index 000000000..05481cff4
--- /dev/null
+++ b/sql-files/upgrades/2013-10-30--19-53.sql
@@ -0,0 +1,5 @@
+#1383162785
+ALTER TABLE `account_data` ADD `base_exp` TINYINT( 4 ) UNSIGNED NOT NULL default '0';
+ALTER TABLE `account_data` ADD `base_drop` TINYINT( 4 ) UNSIGNED NOT NULL default '0';
+ALTER TABLE `account_data` ADD `base_death` TINYINT( 4 ) UNSIGNED NOT NULL default '0';
+INSERT INTO `sql_updates` (`timestamp`) VALUES (1383162785); \ No newline at end of file
diff --git a/sql-files/upgrades/index.txt b/sql-files/upgrades/index.txt
index ca06e9c31..1fc0ebd77 100644
--- a/sql-files/upgrades/index.txt
+++ b/sql-files/upgrades/index.txt
@@ -7,4 +7,5 @@
2013-10-09--21-38.sql
2013-10-10--16-36.sql
2013-10-27--16-47.sql
+2013-10-30--19-53.sql
2013-10-30--21-12.sql \ No newline at end of file
diff --git a/src/char/char.c b/src/char/char.c
index 4a04c521d..3cc1547ac 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -499,12 +499,12 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus* p)
strcat(save_status, " status");
}
- if( p->bank_vault != cp->bank_vault ) {
- if( SQL_ERROR == SQL->Query(sql_handle, "REPLACE INTO `%s` (`account_id`,`bank_vault`) VALUES ('%d','%d')",account_data_db,p->account_id,p->bank_vault) ) {
+ if( p->bank_vault != cp->bank_vault || p->mod_exp != cp->mod_exp || p->mod_drop != cp->mod_drop || p->mod_death != p->mod_death ) {
+ if( SQL_ERROR == SQL->Query(sql_handle, "REPLACE INTO `%s` (`account_id`,`bank_vault`,`base_exp`,`base_drop`,`base_death`) VALUES ('%d','%d','%d','%d','%d')",account_data_db,p->account_id,p->bank_vault,p->mod_exp,p->mod_drop,p->mod_death) ) {
Sql_ShowDebug(sql_handle);
errors++;
} else
- strcat(save_status, " bank");
+ strcat(save_status, " accdata");
}
//Values that will seldom change (to speed up saving)
@@ -1353,15 +1353,21 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything
mercenary_owner_fromsql(char_id, p);
strcat(t_msg, " mercenary");
- //`account_data` (`account_id`,`bank_vault`)
- if( SQL_ERROR == SQL->StmtPrepare(stmt, "SELECT `bank_vault` FROM `%s` WHERE `account_id`=? LIMIT 1", account_data_db)
+ /* default */
+ p->mod_exp = p->mod_drop = p->mod_death = 100;
+
+ //`account_data` (`account_id`,`bank_vault`,`base_exp`,`base_drop`,`base_death`)
+ if( SQL_ERROR == SQL->StmtPrepare(stmt, "SELECT `bank_vault`,`base_exp`,`base_drop`,`base_death` FROM `%s` WHERE `account_id`=? LIMIT 1", account_data_db)
|| SQL_ERROR == SQL->StmtBindParam(stmt, 0, SQLDT_INT, &account_id, 0)
|| SQL_ERROR == SQL->StmtExecute(stmt)
- || SQL_ERROR == SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &p->bank_vault, 0, NULL, NULL) )
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 0, SQLDT_INT, &p->bank_vault, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 1, SQLDT_USHORT, &p->mod_exp, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 2, SQLDT_USHORT, &p->mod_drop, 0, NULL, NULL)
+ || SQL_ERROR == SQL->StmtBindColumn(stmt, 3, SQLDT_USHORT, &p->mod_death, 0, NULL, NULL) )
SqlStmt_ShowDebug(stmt);
if( SQL_SUCCESS == SQL->StmtNextRow(stmt) )
- strcat(t_msg, " bank");
+ strcat(t_msg, " accdata");
if (save_log) ShowInfo("Loaded char (%d - %s): %s\n", char_id, p->name, t_msg); //ok. all data load successfuly!
SQL->StmtFree(stmt);
diff --git a/src/common/mmo.h b/src/common/mmo.h
index 5f4da6eb0..b1a1caf24 100644
--- a/src/common/mmo.h
+++ b/src/common/mmo.h
@@ -415,6 +415,9 @@ struct mmo_charstatus {
time_t delete_date;
+ /* `account_data` modifiers */
+ unsigned short mod_exp,mod_drop,mod_death;
+
unsigned char font;
};
diff --git a/src/map/clif.c b/src/map/clif.c
index 6efc73880..c099d5a1b 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -17798,6 +17798,19 @@ void clif_bank_withdraw(struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK
clif->send(&p,sizeof(p), &sd->bl, SELF);
}
+/* TODO: official response packet (tried 0x8cb/0x97b but the display was quite screwed up.) */
+/* currently mimicing */
+void clif_show_modifiers (struct map_session_data *sd) {
+
+ if( sd->status.mod_exp != 100 || sd->status.mod_drop != 100 || sd->status.mod_death != 100 ) {
+ char output[128];
+
+ snprintf(output,128,"Base EXP : %d%% | Base Drop: %d%% | Base Death Penalty: %d%%",
+ sd->status.mod_exp,sd->status.mod_drop,sd->status.mod_death);
+ clif->broadcast2(&sd->bl,output, strlen(output) + 1, 0xffbc90, 0x190, 12, 0, 0, SELF);
+ }
+
+}
/* */
unsigned short clif_decrypt_cmd( int cmd, struct map_session_data *sd ) {
@@ -18600,6 +18613,8 @@ void clif_defaults(void) {
/* Bank System [Yommy/Hercules] */
clif->bank_deposit = clif_bank_deposit;
clif->bank_withdraw = clif_bank_withdraw;
+ /* */
+ clif->show_modifiers = clif_show_modifiers;
/*------------------------
*- Parse Incoming Packet
*------------------------*/
diff --git a/src/map/clif.h b/src/map/clif.h
index 1710cfc88..710cb6590 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -1006,6 +1006,8 @@ struct clif_interface {
/* Bank System [Yommy/Hercules] */
void (*bank_deposit) (struct map_session_data *sd, enum e_BANKING_DEPOSIT_ACK reason);
void (*bank_withdraw) (struct map_session_data *sd,enum e_BANKING_WITHDRAW_ACK reason);
+ /* */
+ void (*show_modifiers) (struct map_session_data *sd);
/*------------------------
*- Parse Incoming Packet
*------------------------*/
diff --git a/src/map/map.h b/src/map/map.h
index 31ee0ef60..20e328c88 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -360,6 +360,9 @@ enum _sp {
SP_KILLEDRID=122,
SP_SLOTCHANGE=123,
SP_CHARRENAME=124,
+ SP_MOD_EXP=125,
+ SP_MOD_DROP=126,
+ SP_MOD_DEATH=127,
// Mercenaries
SP_MERCFLEE=165, SP_MERCKILLS=189, SP_MERCFAITH=190,
diff --git a/src/map/mob.c b/src/map/mob.c
index e3e079131..b8a8ed6c5 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2332,6 +2332,12 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) {
drop_rate = 1;
}
#endif
+ if( sd && sd->status.mod_drop != 100 ) {
+ drop_rate = drop_rate * sd->status.mod_drop / 100;
+ if( drop_rate < 1 )
+ drop_rate = 1;
+ }
+
// attempt to drop the item
if (rnd() % 10000 >= drop_rate)
continue;