summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-26 14:03:41 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-26 14:03:41 +0000
commitbcb429dd6c87d5069b8c0b4c4c8f18f05303380f (patch)
treebab0b342329c4d1d0ac614b398d83fa0babb708b
parent6abf2948ef3d1d303013d5a1a0dc29e346a4965a (diff)
downloadhercules-bcb429dd6c87d5069b8c0b4c4c8f18f05303380f.tar.gz
hercules-bcb429dd6c87d5069b8c0b4c4c8f18f05303380f.tar.bz2
hercules-bcb429dd6c87d5069b8c0b4c4c8f18f05303380f.tar.xz
hercules-bcb429dd6c87d5069b8c0b4c4c8f18f05303380f.zip
Changed 'killerrid' and 'killedrid' from player vars to player params (bugreport:3249).
Now stored in player session data, so they don't get saved on logout anymore. Added sql upgrade script 'upgrade_svn14507.sql' to remove the now unused player variables. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14507 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt3
-rw-r--r--db/Changelog.txt2
-rw-r--r--db/const.txt2
-rw-r--r--sql-files/upgrade_svn14507.sql1
-rw-r--r--src/map/map.h2
-rw-r--r--src/map/mob.c6
-rw-r--r--src/map/pc.c12
-rw-r--r--src/map/pc.h2
8 files changed, 25 insertions, 5 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 48aabb370..4718fdc0d 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -1,6 +1,9 @@
Date Added
2010/11/26
+ * Changed 'killerrid' and 'killedrid' from player vars to player params (bugreport:3249) [ultramage]
+ - Now stored in player session data, so they don't get saved on logout anymore.
+ - Added sql upgrade script 'upgrade_svn14507.sql' to remove the now unused player variables.
* Some updates and fixes to script command documentation. [Ai4rei]
- Fixed small inaccuracy in description for homevolution (bugreport:125).
- Added ~AnnieRuru~'s fixes to item scripts, variables, and commands addtimer and addnpctimer (bugreport:373).
diff --git a/db/Changelog.txt b/db/Changelog.txt
index 5d4235477..ca2ef3de9 100644
--- a/db/Changelog.txt
+++ b/db/Changelog.txt
@@ -8,6 +8,8 @@
1475 Equestrian's Spear: NEED INFO.
13005 Angelic Wing Dagger: NEED INFO.
=======================
+2010/11/26
+ * Rev. 14507 Added killerrid and killedrid param constants to const.txt [ultramage]
2010/11/21
* Rev. 14480 Added enumeration RC2_* to const.txt for mob data 'race2' (bugreport:4561). [Ai4rei]
- Fixed bSubRace2 being documented as bSPSubRace2 (since r1257).
diff --git a/db/const.txt b/db/const.txt
index 8bf52248a..9e876661e 100644
--- a/db/const.txt
+++ b/db/const.txt
@@ -276,6 +276,8 @@ Sp 7 1
MaxSp 8 1
BaseJob 119 1
BaseClass 120 1
+killerrid 121 1
+killedrid 122 1
bMaxHP 6
bMaxSP 8
diff --git a/sql-files/upgrade_svn14507.sql b/sql-files/upgrade_svn14507.sql
new file mode 100644
index 000000000..823dee9d8
--- /dev/null
+++ b/sql-files/upgrade_svn14507.sql
@@ -0,0 +1 @@
+DELETE FROM `global_reg_value` WHERE `str` = 'killedrid' OR `str` = 'killerrid';
diff --git a/src/map/map.h b/src/map/map.h
index 9f25249e2..08cb3aada 100644
--- a/src/map/map.h
+++ b/src/map/map.h
@@ -296,6 +296,8 @@ enum _sp {
SP_BASEJOB=119, // 100+19 - celest
SP_BASECLASS=120, //Hmm.. why 100+19? I just use the next one... [Skotlex]
+ SP_KILLERRID=121,
+ SP_KILLEDRID=122,
// Mercenaries
SP_MERCFLEE=165, SP_MERCKILLS=189, SP_MERCFAITH=190,
diff --git a/src/map/mob.c b/src/map/mob.c
index 413d88f26..15e27b686 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -2406,12 +2406,12 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
{
if( sd && battle_config.mob_npc_event_type )
{
- pc_setglobalreg(sd,"killerrid",sd->bl.id);
+ pc_setparam(sd, SP_KILLERRID, sd->bl.id);
npc_event(sd,md->npc_event,0);
}
else if( mvp_sd )
{
- pc_setglobalreg(mvp_sd,"killerrid",sd?sd->bl.id:0);
+ pc_setparam(mvp_sd, SP_KILLERRID, sd?sd->bl.id:0);
npc_event(mvp_sd,md->npc_event,0);
}
else
@@ -2419,7 +2419,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type)
}
else if( mvp_sd && !md->state.npc_killmonster )
{
- pc_setglobalreg(mvp_sd,"killedrid",md->class_);
+ pc_setparam(mvp_sd, SP_KILLEDRID, md->class_);
npc_script_event(mvp_sd, NPCE_KILLNPC); // PCKillNPC [Lance]
}
diff --git a/src/map/pc.c b/src/map/pc.c
index 28ead8086..27ebf2e36 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5613,7 +5613,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
}
pc_setglobalreg(sd,"PC_DIE_COUNTER",sd->die_counter+1);
- pc_setglobalreg(sd,"killerrid",src?src->id:0);
+ pc_setparam(sd, SP_KILLERRID, src?src->id:0);
if( sd->state.bg_id )
{
struct battleground_data *bg;
@@ -5667,7 +5667,7 @@ int pc_dead(struct map_session_data *sd,struct block_list *src)
if (src && src->type == BL_PC)
{
struct map_session_data *ssd = (struct map_session_data *)src;
- pc_setglobalreg(ssd, "killedrid", sd->bl.id);
+ pc_setparam(ssd, SP_KILLEDRID, sd->bl.id);
npc_script_event(ssd, NPCE_KILLPC);
if (battle_config.pk_mode&2) {
@@ -5923,6 +5923,8 @@ int pc_readparam(struct map_session_data* sd,int type)
case SP_KARMA: val = sd->status.karma; break;
case SP_MANNER: val = sd->status.manner; break;
case SP_FAME: val = sd->status.fame; break;
+ case SP_KILLERRID: val = sd->killerrid; break;
+ case SP_KILLEDRID: val = sd->killedrid; break;
}
return val;
@@ -6043,6 +6045,12 @@ int pc_setparam(struct map_session_data *sd,int type,int val)
case SP_FAME:
sd->status.fame = val;
break;
+ case SP_KILLERRID:
+ sd->killerrid = val;
+ return 1;
+ case SP_KILLEDRID:
+ sd->killedrid = val;
+ return 1;
default:
ShowError("pc_setparam: Attempted to set unknown parameter '%d'.\n", type);
return 0;
diff --git a/src/map/pc.h b/src/map/pc.h
index 7bf3a050f..9c9408da6 100644
--- a/src/map/pc.h
+++ b/src/map/pc.h
@@ -378,6 +378,8 @@ struct map_session_data {
int duel_group; // duel vars [LuzZza]
int duel_invite;
+ int killerrid, killedrid;
+
char away_message[128]; // [LuzZza]
int cashPoints, kafraPoints;