|
@@ -5781,7 +5781,7 @@ BUILDIN_FUNC(areapercentheal)
|
|
|
|
|
|
/*==========================================
|
|
|
* Warpparty - [Fredzilla] [Paradox924X]
|
|
|
- * Syntax: warpparty "to_mapname",x,y,Party_ID,{"from_mapname"};
|
|
|
+ * Syntax: warpparty "to_mapname",x,y,Party_ID,{<"from_mapname">,<range x>,<range y>};
|
|
|
* If 'from_mapname' is specified, only the party members on that map will be warped
|
|
|
*------------------------------------------*/
|
|
|
BUILDIN_FUNC(warpparty)
|
|
@@ -5789,9 +5789,7 @@ BUILDIN_FUNC(warpparty)
|
|
|
TBL_PC *sd = NULL;
|
|
|
TBL_PC *pl_sd;
|
|
|
struct party_data* p;
|
|
|
- int type;
|
|
|
- int mapindex = 0, m = -1;
|
|
|
- int i;
|
|
|
+ int type, mapindex = 0, m = -1, i, rx = 0, ry = 0;
|
|
|
|
|
|
const char* str = script_getstr(st,2);
|
|
|
int x = script_getnum(st,3);
|
|
@@ -5800,6 +5798,10 @@ BUILDIN_FUNC(warpparty)
|
|
|
const char* str2 = NULL;
|
|
|
if ( script_hasdata(st,6) )
|
|
|
str2 = script_getstr(st,6);
|
|
|
+ if (script_hasdata(st, 7))
|
|
|
+ rx = script_getnum(st, 7);
|
|
|
+ if (script_hasdata(st, 8))
|
|
|
+ ry = script_getnum(st, 8);
|
|
|
|
|
|
p = party_search(p_id);
|
|
|
if(!p)
|
|
@@ -5863,7 +5865,20 @@ BUILDIN_FUNC(warpparty)
|
|
|
pc_setpos(pl_sd,sd->status.save_point.map,sd->status.save_point.x,sd->status.save_point.y,CLR_TELEPORT);
|
|
|
break;
|
|
|
case 3: // Leader
|
|
|
+ if (p->party.member[i].leader)
|
|
|
+ continue;
|
|
|
case 4: // m,x,y
|
|
|
+ if (rx || ry) {
|
|
|
+ int x1 = x + rx, y1 = y + ry,
|
|
|
+ x0 = x - rx, y0 = y - ry;
|
|
|
+ uint8 attempts = 10;
|
|
|
+
|
|
|
+ do {
|
|
|
+ x = x0 + rnd()%(x1 - x0 + 1);
|
|
|
+ y = y0 + rnd()%(y1 - y0 + 1);
|
|
|
+ } while ((--attempts) > 0 && !map_getcell(m, x, y, CELL_CHKPASS));
|
|
|
+ }
|
|
|
+
|
|
|
if(!map[pl_sd->bl.m].flag.noreturn && !map[pl_sd->bl.m].flag.nowarp && pc_job_can_entermap((enum e_job)pl_sd->status.class_, m, pl_sd->group_level))
|
|
|
pc_setpos(pl_sd,mapindex,x,y,CLR_TELEPORT);
|
|
|
break;
|
|
@@ -22894,7 +22909,7 @@ struct script_function buildin_func[] = {
|
|
|
BUILDIN_DEF(warp,"sii?"),
|
|
|
BUILDIN_DEF2(warp, "warpchar", "sii?"),
|
|
|
BUILDIN_DEF(areawarp,"siiiisii??"),
|
|
|
- BUILDIN_DEF(warpparty,"siii?"), // [Fredzilla] [Paradox924X]
|
|
|
+ BUILDIN_DEF(warpparty,"siii???"), // [Fredzilla] [Paradox924X]
|
|
|
BUILDIN_DEF(warpguild,"siii"), // [Fredzilla]
|
|
|
BUILDIN_DEF(setlook,"ii?"),
|
|
|
BUILDIN_DEF(changelook,"ii?"), // Simulates but don't Store it
|