diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-01 17:59:34 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-01 17:59:34 +0000 |
commit | c8d4b89b3de0e8db730fbd375c5b4abd38ac6dff (patch) | |
tree | 4e4aea82151528492ca70b515bd59deb00152b80 /src/map/status.c | |
parent | 5c7ca41032aec98589071c485eccf695f594638c (diff) | |
download | hercules-c8d4b89b3de0e8db730fbd375c5b4abd38ac6dff.tar.gz hercules-c8d4b89b3de0e8db730fbd375c5b4abd38ac6dff.tar.bz2 hercules-c8d4b89b3de0e8db730fbd375c5b4abd38ac6dff.tar.xz hercules-c8d4b89b3de0e8db730fbd375c5b4abd38ac6dff.zip |
- Cleaned up some more the SC_JAILED code
- merged in atcommands jailfor, jailtime, charjailtime. Thanks to Meruru and Coltaro for the code.
- Cleaned the code of atcommnds jail and unjail
- Be warned that the code MAY contain bugs as I adjusted it to save the character's position before jailing, allowing the automatic unjailing to warp you back to the exact spot you were at before being jailed.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8038 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/status.c')
-rw-r--r-- | src/map/status.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/map/status.c b/src/map/status.c index 87ebd6795..a2038456a 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -4311,7 +4311,7 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val struct status_change* sc; struct status_data *status; struct view_data *vd; - int opt_flag , calc_flag, undead_flag; + int opt_flag, calc_flag, undead_flag; nullpo_retr(0, bl); sc=status_get_sc(bl); @@ -5395,6 +5395,17 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val break; case SC_JAILED: tick = val1>0?1000:250; + if (sd && sd->mapindex != val2) + { + int pos = (bl->x&0xFFFF)|(bl->y<<16), //Current Coordinates + map = sd->mapindex; //Current Map + //1. Place in Jail (val2 -> Jail Map, val3 -> x, val4 -> y + if (pc_setpos(sd,(unsigned short)val2,val3,val4, 3) == 0) + pc_setsavepoint(sd, (unsigned short)val2,val3,val4); + //2. Set restore point (val3 -> return map, val4 return coords + val3 = map; + val4 = pos; + } break; default: if (calc_flag == SCB_NONE && StatusSkillChangeTable[type]==0) @@ -5587,11 +5598,6 @@ int status_change_start(struct block_list *bl,int type,int rate,int val1,int val if(sd && sd->pd) pet_sc_check(sd, type); //Skotlex: Pet Status Effect Healing - if (type==SC_JAILED && sd && sd->mapindex != val2) { - if (pc_setpos(sd,(unsigned short)val2,0, 0, 3) == 0) - pc_setsavepoint(sd, (unsigned short)val2, 0, 0); - } - if (type==SC_BERSERK) { sc->data[type].val2 = 5*status->max_hp/100; status_heal(bl, status->max_hp, 0, 1); //Do not use percent_heal as this healing must override BERSERK's block. @@ -5937,8 +5943,8 @@ int status_change_end( struct block_list* bl , int type,int tid ) //natural expiration. if(sd && sd->mapindex == sc->data[type].val2) { - if (pc_setpos(sd,(unsigned short)sc->data[type].val3,0, 0, 3) == 0) - pc_setsavepoint(sd, (unsigned short)sc->data[type].val3, 0, 0); + if (pc_setpos(sd,(unsigned short)sc->data[type].val3,sc->data[type].val4&0xFFFF, sc->data[type].val4>>16, 3) == 0) + pc_setsavepoint(sd, sd->mapindex, bl->x, bl->y); } break; //guess hes not in jail :P } |