Jump to content
  • 0

Warping back to departure point


Adam

Question


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  111
  • Reputation:   3
  • Joined:  06/29/12
  • Last Seen:  

Hello people,

Once again, need you expert advise on this case:

We created a PvP room which people can access from almost any town using a custom warper.

To get out of this room they simply use a warp

pvpt.jpg

At the moment this warp only warps back to prontera, regardless where people came from at the first place.

QUESTION :

Is there a way to make sure people when they use the warp out are warped back where they first came from ?

Thanks you in advance, all suggestions are welcome !

Edited by iROnic
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

You could use this for example:

xxxx,xxx,xxx,0 script Out#Portal 45,4,2,{
OnTouch:
mes "[Portal]";
mes "Where would you like to go?";
next;
switch(select("prontera.:morocc.:geffen.:payon.:alberta.:Cancel.")) {
case 1: warp "prontera",107,60; end;
case 2: warp "morocc",157,96; end;
case 3: warp "geffen",120,36; end;
case 4: warp "payon",96,100; end;
case 5: warp "alberta",41,243; end;
case 6: close;
}
}

If you wanna do it your way, you're gonna have to get the warper who sent players into that map to save their last position by using:

*getmapxy("<variable for map name>",<variable for x>,<variable for y>,<type>{,"<search string>"})
This function will locate a character object, NPC object or pet's coordinates
and place their coordinates into the variables specified when calling it. It
will return 0 if the search was successful, and -1 if the parameters given were
not variables or the search was not successful.
Type is the type of object to search for:
 0 - Character object
 1 - NPC object
 2 - Pet object
 3 - Monster object
 4 - Homunculus object
 5 - Mercenary object
 6 - Elemental object

While 3 is meant to look for a monster object, no searching will be done if you
specify type 3, and the function will always return -1.
The search string is optional. If it is not specified, the location of the
invoking character will always be returned for types 0 and 2, the location of
the NPC running this function for type 1.
If a search string is specified, for types 0 and 1, the character or NPC with
the specified name will be located. If type is 3, the search will locate the
current pet of the character who's name is given in the search string, it will
NOT locate a pet by name.

In a variable and then get the NPC to warp back those players using their saved map in the variable.

Refer to the post http://rathena.org/board/topic/68349-warping-back-to-departure-point/#entry124791 below mine :>

Edited by Mysterious
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

When players warp to the map, add temporary variables for map location:

getmapxy(@tmap$,@tx,@ty,0);

Then use a scripted warp instead of a warp portal:

<header> 45,2,2,{
   warp @tmap$,@tx,@ty;
   end;
}

@Mysterious: That isn't quite what he wants. xP

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  94
  • Topics Per Day:  0.02
  • Content Count:  2192
  • Reputation:   252
  • Joined:  11/11/11
  • Last Seen:  

When players warp to the map, add temporary variables for map location:

getmapxy(@tmap$,@tx,@ty,0);

Then use a scripted warp instead of a warp portal:

<header> 45,2,2,{
warp @tmap$,@tx,@ty;
end;
}

@Mysterious: That isn't quite what he wants. xP

I was editing my post when you replied D:

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

I was editing my post when you replied D:

It's just because you aren't Tyranitar enough :<

  • Upvote 2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  111
  • Reputation:   3
  • Joined:  06/29/12
  • Last Seen:  

:D

You guyz are just awesome, thanks a lot for the golden help :)

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

just some precaution...

make sure you add in a nosave mapflag into the map when using euphy script.

why ?

because the variable / data stored inside the character..will be removed upon player logout..

so, if you didnt have the mapflag ..your charcter will probably stuck inside..and ur map server will spam error also.

this is because the warper warp you based on the saved variable.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  111
  • Reputation:   3
  • Joined:  06/29/12
  • Last Seen:  

Thanks a lot for warning me, really appreciate it Emistry ! :)

Once again thanks all for helping me out.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...