Index: src/map/pc.c
===================================================================
--- src/map/pc.c (revision 17294)
+++ src/map/pc.c (working copy)
@@ -6644,14 +6644,13 @@
sd->st->state = END;
}
- npc_script_event(sd,NPCE_DIE);
-
/* e.g. not killed thru pc_damage */
if( pc_issit(sd) ) {
clif_status_load(&sd->bl,SI_SIT,0);
}
+
+ pc_setdead(sd);
- pc_setdead(sd);
//Reset menu skills/item skills
if (sd->skillitem)
sd->skillitem = sd->skillitemlv = 0;
@@ -6701,42 +6700,6 @@
break;
}
- if (src && src->type == BL_PC)
- {
- struct map_session_data *ssd = (struct map_session_data *)src;
- pc_setparam(ssd, SP_KILLEDRID, sd->bl.id);
- npc_script_event(ssd, NPCE_KILLPC);
-
- if (battle_config.pk_mode&2) {
- ssd->status.manner -= 5;
- if(ssd->status.manner < 0)
- sc_start(&sd->bl,src,SC_NOCHAT,100,0,0);
-#if 0
- // PK/Karma system code (not enabled yet) [celest]
- // originally from Kade Online, so i don't know if any of these is correct ^^;
- // note: karma is measured REVERSE, so more karma = more 'evil' / less honourable,
- // karma going down = more 'good' / more honourable.
- // The Karma System way...
-
- if (sd->status.karma > ssd->status.karma) { // If player killed was more evil
- sd->status.karma--;
- ssd->status.karma--;
- }
- else if (sd->status.karma < ssd->status.karma) // If player killed was more good
- ssd->status.karma++;
-
-
- // or the PK System way...
-
- if (sd->status.karma > 0) // player killed is dishonourable?
- ssd->status.karma--; // honour points earned
- sd->status.karma++; // honour points lost
-
- // To-do: Receive exp on certain occasions
-#endif
- }
- }
-
if(battle_config.bone_drop==2
|| (battle_config.bone_drop==1 && map[sd->bl.m].flag.pvp))
{
Index: src/map/status.c
===================================================================
--- src/map/status.c (revision 17294)
+++ src/map/status.c (working copy)
@@ -1288,6 +1288,46 @@
battle_config.clear_unit_ondeath&target->type)
skill_clear_unitgroup(target);
+ //We do this so no possible errors can occur when warping a dead character
+ if (target->type == BL_PC) {
+ struct map_session_data *sd = (TBL_PC*)target;
+ npc_script_event(sd,NPCE_DIE);
+ if (src && src->type == BL_PC) {
+ struct map_session_data *ssd = (struct map_session_data *)src;
+ pc_setparam(ssd, SP_KILLEDRID, sd->bl.id);
+ npc_script_event(ssd,NPCE_KILLPC);
+
+ if (battle_config.pk_mode&2) {
+ ssd->status.manner -= 5;
+ if(ssd->status.manner < 0)
+ sc_start(&sd->bl,src,SC_NOCHAT,100,0,0);
+#if 0
+ // PK/Karma system code (not enabled yet) [celest]
+ // originally from Kade Online, so i don't know if any of these is correct ^^;
+ // note: karma is measured REVERSE, so more karma = more 'evil' / less honourable,
+ // karma going down = more 'good' / more honourable.
+ // The Karma System way...
+
+ if (sd->status.karma > ssd->status.karma) { // If player killed was more evil
+ sd->status.karma--;
+ ssd->status.karma--;
+ }
+ else if (sd->status.karma < ssd->status.karma) // If player killed was more good
+ ssd->status.karma++;
+
+
+ // or the PK System way...
+
+ if (sd->status.karma > 0) // player killed is dishonourable?
+ ssd->status.karma--; // honour points earned
+ sd->status.karma++; // honour points lost
+
+ // To-do: Receive exp on certain occasions
+#endif
+ }
+ }
+ }
+
if(target->type&BL_REGEN)
{ //Reset regen ticks.
struct regen_data *regen = status_get_regen_data(target);