Jump to content
  • 0

Warping to saved location through warp portal


blurryrox

Question


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   4
  • Joined:  06/27/12
  • Last Seen:  

Hi guys.

I have tried to find this using search but i could not find anything.

I am trying to get my kafra to get the location of a player before tele-*porting to a place where i put my custom npc in.

and when they exit the building using the warp portal, they will go back to the location before they teleport using the kafra.

kafra_functions.txt

// Teleport Function ==================================================
function	script	F_KafTele	{
	getmapxy(@mapname$,@mapx,@mapy,UNITTYPE_PC);
	mes "[Kafra Employee]";
	mes "Please choose";
	mes "your destination.";
	next;

	menu 	@wrpC$[0],M_Wrp0, @wrpC$[1],M_Wrp1, @wrpC$[2],M_Wrp2, @wrpC$[3],M_Wrp3, 
		@wrpC$[4],M_Wrp4, @wrpC$[5],M_Wrp5, @wrpC$[6],M_Wrp6;

	M_Wrp0:
		set @num, 0;
		goto L_Warp;
	M_Wrp1:
		set @num, 1;
		goto L_Warp;
	M_Wrp2:
		set @num, 2;
		goto L_Warp;
	M_Wrp3:
		set @num, 3;
		goto L_Warp;
	M_Wrp4:
		set @num, 4;
		goto L_Warp;
	M_Wrp5:
		set @num, 5;
		goto L_Warp;
	M_Wrp6:
		set @num, 6;

	L_Warp:
		if (@wrpC$[@num] == "Cancel") return;
		// Consume "Free Ticket for Kafra Transportation" if available.
		// Do not consume if in Guild castle
		if(countitem(7060) > 0 && getarg(0) != 2) delitem 7060,1;
		else {
			if (Zeny<@wrpP[@num]){
				mes "[Kafra Employee]";
				mes "I'm sorry, but you don't have";
				mes "enough zeny for the Teleport";
				mes "Service. The fee to teleport";
				mes "to "+@wrpD$[@num]+" is "+@wrpP[@num]+" zeny.";
				close2;
				cutin "", 255;
				end;
			}
			set Zeny, Zeny-@wrpP[@num];
			set RESRVPTS, RESRVPTS + (@wrpP[@num]/16);
		}
		
		if (@wrpD$[@num] == "Alberta") warp "alberta", 117, 56;
		if (@wrpD$[@num] == "Al De Baran") warp "aldebaran",168,112;
		if (@wrpD$[@num] == "Aldebaran") warp "aldebaran",168,112;
		if (@wrpD$[@num] == "Comodo") warp "comodo", 209, 143;
		if (@wrpD$[@num] == "Izlude") warp "izlude", 91, 136;
		if (@wrpD$[@num] == "Geffen") warp "geffen", 120, 39;
		if (@wrpD$[@num] == "Morroc") warp "morocc", 156, 46;
		if (@wrpD$[@num] == "Payon") warp "payon", 161, 58;
		if (@wrpD$[@num] == "Prontera") warp "prontera", 116, 72;
		if (@wrpD$[@num] == "Mjolnir Dead Pit") warp "mjolnir_02", 99, 351;
		if (@wrpD$[@num] == "Comodo Pharos Beacon") warp "cmd_fild07", 127, 134;
		if (@wrpD$[@num] == "Orc Dungeon") warp "gef_fild10", 52, 326;
		if (@wrpD$[@num] == "Umbala") warp "umbala", 100, 154;
		if (@wrpD$[@num] == "Juno") warp "yuno", 158, 125;
		if (@wrpD$[@num] == "^FFA500Office^000000") warp "prt_in", 50, 105;
		cutin "", 255;
		end;

prt_in,53,105,0    script    #officewarpout    45,1,1,{
	if (getmapxy(@mapname$,@mapx,@mapy,UNITTYPE_PC)!=0) goto WarpTwo;
		warp "+@mapname$+","+@mapx+","+@mapy+"; end;
	Warptwo:
		warp "prontera",136,186; end;
	}


}

Something like this, i am not sure wether the coding is correct or not, just putting this so you guys get the idea.

Edited by blurryrox
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

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

prontera,155,181,4	script	Entrance_NPC	45,{
	getmapxy( @last_map$,@last_x,@last_y,0 );
	warp "prt_in",0,0;
	end;
}
prontera,155,181,4	script	Exit_NPC	45,{
	if (@last_map$ == "") {
		@last_map$ = "SavePoint";
		@last_x = 0;
		@last_y = 0;
	}
	warp @last_map$,@last_x,@last_y;
	end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  26
  • Reputation:   4
  • Joined:  06/27/12
  • Last Seen:  

so can this be added inside kafra's teleport function?

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...