blurryrox Posted December 4, 2016 Posted December 4, 2016 (edited) 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 December 4, 2016 by blurryrox Quote
0 Emistry Posted December 5, 2016 Posted December 5, 2016 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; } Quote
0 blurryrox Posted December 5, 2016 Author Posted December 5, 2016 so can this be added inside kafra's teleport function? Quote
Question
blurryrox
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 blurryrox2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.