Permalink
Browse files

* Updated/added stolen item/zeny logging.

- For SQL apply upgrade_svn15086_log.sql to upgrade tables `picklog` and `zenylog`; for TXT no action is necessary.

git-svn-id: http://eathena-project.googlecode.com/svn/trunk@15086 54d463be-8e91-2dee-dedb-b68131a5f0ec
  • Loading branch information...
1 parent a1ea717 commit 88f8cf5be3d9c54c9db0e5369cfc30d6074e9c3d ai4rei committed Apr 8, 2012
Showing with 21 additions and 8 deletions.
  1. +4 −0 Changelog-Trunk.txt
  2. +2 −2 sql-files/logs.sql
  3. +4 −0 sql-files/upgrade_svn15086_log.sql
  4. +1 −1 src/map/log.c
  5. +1 −1 src/map/log.h
  6. +9 −4 src/map/pc.c
View
@@ -1,9 +1,13 @@
Date Added
+2012/04/08
+ * Updated/added stolen item/zeny logging. [Ai4rei]
+ - For SQL apply upgrade_svn15086_log.sql to upgrade tables `picklog` and `zenylog`; for TXT no action is necessary.
2012/03/19
* Added documentation for script command *getnpcid (follow up to r15083). [Ai4rei]
- Added optional 'npc name' parameter to *getnpcid to allow querying information of other NPCs.
* Added item/zeny logging to auction transactions. [Ai4rei]
+ - For SQL apply upgrade_svn15084_log.sql to upgrade tables `picklog` and `zenylog`; for TXT no action is necessary.
* Added script command getnpcid() which accepts a parameter (currently only option is 0) and returns an id pertaining to the NPC (currently only supports GID,
for use in making an NPC perform an action using script commands that require a GID (e.g. unit*). [Paradox924X]
2012/02/18
View
@@ -9,7 +9,7 @@ CREATE TABLE `picklog` (
`id` int(11) NOT NULL auto_increment,
`time` datetime NOT NULL default '0000-00-00 00:00:00',
`char_id` int(11) NOT NULL default '0',
- `type` enum('M','P','L','T','V','S','N','C','A','R','G','E','B','I') NOT NULL default 'P',
+ `type` enum('M','P','L','T','V','S','N','C','A','R','G','E','B','I','D') NOT NULL default 'P',
`nameid` int(11) NOT NULL default '0',
`amount` int(11) NOT NULL default '1',
`refine` tinyint(3) unsigned NOT NULL default '0',
@@ -30,7 +30,7 @@ CREATE TABLE `zenylog` (
`time` datetime NOT NULL default '0000-00-00 00:00:00',
`char_id` int(11) NOT NULL default '0',
`src_id` int(11) NOT NULL default '0',
- `type` enum('M','T','V','S','N','A','E','B','I') NOT NULL default 'S',
+ `type` enum('M','T','V','S','N','A','E','B','I','D') NOT NULL default 'S',
`amount` int(11) NOT NULL default '0',
`map` varchar(11) NOT NULL default '',
PRIMARY KEY (`id`),
@@ -0,0 +1,4 @@
+-- Adds 'D' to `type` in `picklog` and `zenylog`
+
+ALTER TABLE `picklog` MODIFY `type` ENUM('M','P','L','T','V','S','N','C','A','R','G','E','B','I','D') NOT NULL DEFAULT 'P';
+ALTER TABLE `zenylog` MODIFY `type` ENUM('M','T','V','S','N','A','E','B','I','D') NOT NULL DEFAULT 'S';
View
@@ -52,7 +52,7 @@ static char log_picktype2char(e_log_pick_type type)
case LOG_TYPE_PICKDROP_MONSTER: return 'M'; // (M)onster
case LOG_TYPE_NPC: return 'S'; // NPC (S)hop
case LOG_TYPE_SCRIPT: return 'N'; // (N)PC Script
- //case LOG_TYPE_STEAL: return 'D'; // Steal/Snatcher
+ case LOG_TYPE_STEAL: return 'D'; // Steal/Snatcher
case LOG_TYPE_CONSUME: return 'C'; // (C)onsumed
//case LOG_TYPE_PRODUCE: return 'O'; // Pr(O)duced/Ingredients
//case LOG_TYPE_MVP: return 'U'; // MVP Rewards
View
@@ -32,7 +32,7 @@ typedef enum e_log_pick_type
LOG_TYPE_PICKDROP_MONSTER = 0x0008,
LOG_TYPE_NPC = 0x0010,
LOG_TYPE_SCRIPT = 0x0020,
- //LOG_TYPE_STEAL = 0x0040,
+ LOG_TYPE_STEAL = 0x0040,
LOG_TYPE_CONSUME = 0x0080,
//LOG_TYPE_PRODUCE = 0x0100,
//LOG_TYPE_MVP = 0x0200,
View
@@ -4042,8 +4042,8 @@ int pc_steal_item(struct map_session_data *sd,struct block_list *bl, int lv)
party_foreachsamemap(pc_show_steal,sd,AREA_SIZE,sd,tmp_item.nameid);
//Logs items, Stolen from mobs [Lupus]
- log_pick(&md->bl, LOG_TYPE_PICKDROP_MONSTER, itemid, -1, NULL);
- log_pick(&sd->bl, LOG_TYPE_PICKDROP_PLAYER, itemid, 1, NULL);
+ log_pick(&md->bl, LOG_TYPE_STEAL, itemid, -1, NULL);
+ log_pick(&sd->bl, LOG_TYPE_STEAL, itemid, 1, NULL);
//A Rare Steal Global Announce by Lupus
if(md->db->dropitem[i].p<=battle_config.rare_drop_announce) {
@@ -4074,10 +4074,15 @@ int pc_steal_coin(struct map_session_data *sd,struct block_list *target)
if( (md->class_ >= 1324 && md->class_ < 1364) || (md->class_ >= 1938 && md->class_ < 1946) )
return 0;
+ // FIXME: This formula is either custom or outdated.
skill = pc_checkskill(sd,RG_STEALCOIN)*10;
rate = skill + (sd->status.base_level - md->level)*3 + sd->battle_status.dex*2 + sd->battle_status.luk*2;
- if(rand()%1000 < rate) {
- pc_getzeny(sd,md->level*10 + rand()%100);
+ if(rand()%1000 < rate)
+ {
+ int amount = md->level*10 + rand()%100;
+
+ log_zeny(sd, LOG_TYPE_STEAL, sd, amount);
+ pc_getzeny(sd, amount);
md->state.steal_coin_flag = 1;
return 1;
}

0 comments on commit 88f8cf5

Please sign in to comment.