summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-18 19:15:41 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-18 19:15:41 +0000
commitb5300be8f74ab64d90d71e20a11d2f0d5497c8bd (patch)
tree2a262c7bc75a45f63fc0c357a5f890225163c557 /src
parent1873fa595be71ef3f98ada3decf43a3f13b12720 (diff)
downloadhercules-b5300be8f74ab64d90d71e20a11d2f0d5497c8bd.tar.gz
hercules-b5300be8f74ab64d90d71e20a11d2f0d5497c8bd.tar.bz2
hercules-b5300be8f74ab64d90d71e20a11d2f0d5497c8bd.tar.xz
hercules-b5300be8f74ab64d90d71e20a11d2f0d5497c8bd.zip
- When walking into a Guild Dungeon your pvp_points will be set to 5 so you have to die twice before being warped out.
- If jobchanging while disguised, the disguise will be removed, since it can't be kept and still calculate correctly the new job class to use. - Fuuma shurikens are now unbreakable code-wise (like all maces, books, etc) - Applied Meruru's patch to increase speed of easy path seeks. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9518 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/clif.c4
-rw-r--r--src/map/path.c71
-rw-r--r--src/map/pc.c6
-rw-r--r--src/map/skill.c1
4 files changed, 49 insertions, 33 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index a695ee78b..668ef21ee 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8308,7 +8308,11 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
clif_set0199(fd, 1);
if (map[sd->bl.m].flag.gvg_dungeon)
+ {
clif_set0199(fd,2); //TODO: Figure out the real thing to do here.
+ if (!sd->pvp_point)
+ sd->pvp_point=5; //Need to die twice to be warped out.
+ }
if(map_flag_gvg(sd->bl.m))
clif_set0199(fd,3);
diff --git a/src/map/path.c b/src/map/path.c
index 9e247f366..550defaa8 100644
--- a/src/map/path.c
+++ b/src/map/path.c
@@ -23,6 +23,13 @@
struct tmp_path { short x,y,dist,before,cost,flag;};
#define calc_index(x,y) (((x)+(y)*MAX_WALKPATH) & (MAX_WALKPATH*MAX_WALKPATH-1))
+const char walk_choices [3][3] =
+{
+ {1,0,7},
+ {2,-1,6},
+ {3,4,5},
+};
+
/*==========================================
* 経路探索補助heap push
*------------------------------------------
@@ -307,14 +314,14 @@ int path_search_long_real(struct shootpath_data *spd,int m,int x0,int y0,int x1,
* path探索 (x0,y0)->(x1,y1)
*------------------------------------------
*/
+
int path_search_real(struct walkpath_data *wpd,int m,int x0,int y0,int x1,int y1,int flag,cell_t flag2)
{
int heap[MAX_HEAP+1];
struct tmp_path tp[MAX_WALKPATH*MAX_WALKPATH];
- int i,rp,x,y;
- int xs,ys;
+ register int i,x,y,dx,dy;
+ int rp,xs,ys;
struct map_data *md;
- int dx,dy;
nullpo_retr(0, wpd);
@@ -331,36 +338,36 @@ int path_search_real(struct walkpath_data *wpd,int m,int x0,int y0,int x1,int y1
if(x1<0 || x1>=md->xs || y1<0 || y1>=md->ys || map_getcellp(md,x1,y1,flag2))
return -1;
- // easy
- // この内部では、0 <= x+dx < sx, 0 <= y+dy < sy は保証されている
- dx = (x1-x0<0) ? -1 : 1;
- dy = (y1-y0<0) ? -1 : 1;
- for(x=x0,y=y0,i=0;x!=x1 || y!=y1;){
- if(i>=sizeof(wpd->path))
- return -1;
- if(x!=x1 && y!=y1){
- if(map_getcellp(md,x+dx,y ,flag2))
- break;
- if(map_getcellp(md,x ,y+dy,flag2))
- break;
- if(map_getcellp(md,x+dx,y+dy,flag2))
- break;
- x+=dx;
- y+=dy;
- wpd->path[i++]=(dx<0) ? ((dy>0)? 1 : 3) : ((dy<0)? 5 : 7);
- } else if(x!=x1){
- if(map_getcellp(md,x+dx,y ,flag2))
- break;
- x+=dx;
- wpd->path[i++]=(dx<0) ? 2 : 6;
- } else if(y!=y1){
- if(map_getcellp(md,x ,y+dy,flag2))
- break;
- y+=dy;
- wpd->path[i++]=(dy>0) ? 0 : 4;
- }
+ // easy and better [Meruru]
+ dx = ((dx = x1-x0)) ? ((dx<0) ? -1 : 1) : 0;
+ dy = ((dy = y1-y0)) ? ((dy<0) ? -1 : 1) : 0;
+
+ //Better faster stronger simple path algo. [Meruru]
+ for(x=x0,y=y0,i=0;i < sizeof(wpd->path);)
+ {
+ wpd->path[i++] = walk_choices[-dy + 1][dx + 1];
+
+ x += dx;
+ y += dy;
+
+ if(x == x1) dx = 0;
+ if(y == y1) dy = 0;
+
+ if((!dx && !dy) || map_getcellp(md,x,y,flag2))
+ break;
}
- if (x==x1 && y==y1) { //easy path successful.
+
+ /*
+ You may be thinking what about diagonal
+ moves? Cant they cause a error with this some how?
+ Answer is NO! The only time this can cause a error
+ is if the target block lies on the diagonal and
+ is non walkable. But rember we already checked that
+ up above! So no problems here... I think [Meruru]
+ */
+
+ if (x==x1 && y==y1)
+ { //easy path successful.
wpd->path_len=i;
wpd->path_pos=0;
wpd->path_half=0;
diff --git a/src/map/pc.c b/src/map/pc.c
index e6ae6c8af..8ffa54291 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5538,7 +5538,11 @@ int pc_jobchange(struct map_session_data *sd,int job, int upper)
pc_unequipitem(sd,sd->equip_index[i],2); // ?備外し
}
- //Change look
+ //Change look, if disguised, you need to undisguise
+ //to correctly calculate new job sprite without
+ if (sd->disguise)
+ pc_disguise(sd, 0);
+
status_set_viewdata(&sd->bl, job);
clif_changelook(&sd->bl,LOOK_BASE,sd->vd.class_); // move sprite update to prevent client crashes with incompatible equipment [Valaris]
if(sd->vd.cloth_color)
diff --git a/src/map/skill.c b/src/map/skill.c
index 0c2485307..c69ecbaeb 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -1650,6 +1650,7 @@ int skill_break_equip (struct block_list *bl, unsigned short where, int rate, in
case W_MACE: // Axes and Maces can't be broken [DracoRPG]
case W_STAFF:
case W_BOOK: //Rods and Books can't be broken [Skotlex]
+ case W_HUUMA:
where &= ~EQP_WEAPON;
}
}