Mumbles 193 Posted November 18, 2013 Utility: @go commandOriginal concept by : http://herc.ws/board/topic/14-utility-added-feature-jtynnes-go-command-alternative-txt-format/ Description:Alternative @go command. Allows for unlimited aliasing, as well as level and group restrictions for each destination. Additional options to add a delay, prevent use when dead, and charge per use are available; default cost is defined with '.cost', but this parameter can be set manually with 'go()'. These extra features are disabled by default. Be mindful that the delay uses a temporary player variable, '@go_delay'; if the player logs out, this variable will be cleared. If you would like for a more secure delay, replace all instances of '@go_delay' with 'go_delay'. Download:https://github.com/datmumbles/Scripts/raw/master/cmd/go.txt 5 Begin, Chemical Crush, TioHugo and 2 others reacted to this Quote Share this post Link to post Share on other sites
mrlongshen 22 Posted November 18, 2013 nice bro. thanks alot ! Quote Share this post Link to post Share on other sites
kerbiii 5 Posted November 19, 2013 (edited) please make one for @warp /@rura /@mapmove Edited November 19, 2013 by kerbiii Quote Share this post Link to post Share on other sites
kerbiii 5 Posted November 23, 2013 i got this error [Error]: script:op_2: invalid data for operator C_LOR[Debug]: Data: C_ARG[Debug]: Data: number value=0[Debug]: Source (NPC): at_go (invisible/not on a map) Quote Share this post Link to post Share on other sites
Mumbles 193 Posted November 23, 2013 i got this error [Error]: script:op_2: invalid data for operator C_LOR [Debug]: Data: C_ARG [Debug]: Data: number value=0 [Debug]: Source (NPC): at_go (invisible/not on a map) This script is supported on Hercules at revision 463cbc9. If you want to manually fix this error, add these lines to db/const.txt: IOT_CHAR 1 IOT_PARTY 2 IOT_GUILD 3++false 0+true 1 If you are already using the current revision, have you added or customised any locations? If so, please post your changed code. Quote Share this post Link to post Share on other sites
kerbiii 5 Posted November 23, 2013 i got this error [Error]: script:op_2: invalid data for operator C_LOR [Debug]: Data: C_ARG [Debug]: Data: number value=0 [Debug]: Source (NPC): at_go (invisible/not on a map) This script is supported on Hercules at revision 463cbc9. If you want to manually fix this error, add these lines to db/const.txt: IOT_CHAR 1 IOT_PARTY 2 IOT_GUILD 3++false 0+true 1 If you are already using the current revision, have you added or customised any locations? If so, please post your changed code. okay i already added that in const.txt and yes i add custom location, if (alias("0", "inv", "Invek", "invek")) { Go("Invek",146, 164, 0, 0, .cost); } else if (alias("36", "pro", "pront", "prontera")) { Go("prontera",156, 184, 0, 0, .cost); } else { message strcharinfo(0), "Invalid location number, or name."; message strcharinfo(0), "Params: "; message strcharinfo(0), "Warps you to a city."; message strcharinfo(0), "0: Invek 1: Morroc 2: Geffen 3: Payon 4: Alberta"; message strcharinfo(0), "5: Izlude 6: Al De Baran 7: Lutie 8: Comodo 9: Yuno"; message strcharinfo(0), "10: Amatsu 11: Gonryun 12: Umbala 13: Niflheim 14: Louyang"; message strcharinfo(0), "15: Novice Grounds 16: Prison 17: Jawaii 18: Ayothaya 19: Einbroch"; message strcharinfo(0), "20: Lighthalzen 21: Einbech 22: Hugel 23: Rachel 24: Veins"; message strcharinfo(0), "25: Moscovia 26: Midgard Camp 27: Manuk 28: Splendide 29: Brasilis"; message strcharinfo(0), "30: El Dicastes 31: Mora 32: Dewata 33: Malangdo 34: Malaya"; message strcharinfo(0), "35: Eclage 36: Prontera"; message strcharinfo(0), "@Go failed."; } Quote Share this post Link to post Share on other sites
Mhalicot 392 Posted November 23, 2013 (edited) ^ Please post your code inside This Code box, click <> at the toolbar of your reply window then add your code so that we can easily read/test your script Edited November 23, 2013 by sevenzz23 Quote Share this post Link to post Share on other sites
kerbiii 5 Posted November 23, 2013 ^ Please post your code inside This Code box, click <> at the toolbar of your reply window then add your code so that we can easily read/test your script [cbox]/*========================================================= @go command Original concept by jTynne Revised by Mumbles =========================================================== Compatibility: Optimised for Hercules emulators. =========================================================== Description: Alternative @go command. Allows for unlimited aliasing, as well as level and group restrictions for each destination. Additional options to add a delay, prevent use when dead, and charge per use are available; default cost is defined with '.cost', but this parameter can be set manually with 'go()'. These extra features are disabled by default. Be mindful that the delay uses a temporary player variable, '@go_delay'; if the player logs out, this variable will be cleared. If you would like for a more secure delay, replace all instances of '@go_delay' with 'go_delay'. =========================================================*/ - script at_go -1,{ /*----------------------------------------------------- Configuration -----------------------------------------------------*/ OnInit: .delay = 15; // Delay per use, in seconds (default: 0) .cost = 2500; // Default cost to use command if '.charge' is enabled .charge = 1; // Charge to use command? 0 = no, 1 = yes (default: 0) .deadlock = 1; // Prevent usage when dead? 0 = no, 1 = yes (default: 0) bindatcmd("go", strnpcinfo(3) +"::OnAtcommand", 0, 2); end; /*----------------------------------------------------- Function: Go() ------------------------------------------------------- Description: Warps player and checks prerequisites. ------------------------------------------------------- Usage: go(<"map_name">, , , , , ) -----------------------------------------------------*/ function Go { if (.deadlock && !Hp) { message strcharinfo(0), "You may not use @go when you are dead."; } else if (.delay && @Go_delay > gettimetick(2)) { message strcharinfo(0), "You must wait "+ (@Go_delay - gettimetick(2)) +" seconds before warping again."; } else if (BaseLevel < getarg(3)) { message strcharinfo(0), "You must be at least level "+ getarg(3) +" to warp to this map."; } else if (getgroupid() < getarg(4) || getmapflag(getarg(0), mf_nowarp)) { message strcharinfo(0), "You are not authorised to warp to this map."; } else if (.charge && Zeny < getarg(5)) { message strcharinfo(0), "You must have at least "+ getarg(5) +" zeny to warp to this map."; } else { if (.delay) { @Go_delay = gettimetick(2) + .delay; } if (.charge) { Zeny -= getarg(5); } warp getarg(0), getarg(1), getarg(2); end; } message strcharinfo(0), "@Go failed."; end; } /*----------------------------------------------------- Function: alias() ------------------------------------------------------- Description: Determines if input matches alias. ------------------------------------------------------- Usage: alias(<"number">, <"name1">{, <"name2">, <...>}) -----------------------------------------------------*/ function alias { for (.@i = 0; .@i < getargcount(); .@i++) { if (@input$ == getarg(.@i)) { @input$ = ""; return 1; } } return 0; } OnAtcommand: @input$ = .@atcmd_parameters$[0]; if (alias("0", "inv", "Invek", "invek")) { Go("Invek",146, 164, 0, 0, .cost); } else if (alias("1", "moc", "mor", "morocc", "morroc")) { Go("morocc", 160, 100, 0, 0, .cost); } else if (alias("2", "gef", "geffen")) { Go("geffen", 120, 70, 0, 0, .cost); } else if (alias("3", "pay", "payo", "payon")) { Go("payon", 174, 98, 0, 0, .cost); } else if (alias("4", "alb", "alberta")) { Go("alberta", 192, 147, 0, 0, .cost); } else if (alias("5", "izl", "izlude")) { Go("izlude", 127, 109, 0, 0, .cost); } else if (alias("6", "ald", "alde", "aldebaran")) { Go("aldebaran", 140, 114, 0, 0, .cost); } else if (alias("7", "xmas", "lutie")) { Go("xmas", 148, 117, 0, 0, .cost); } else if (alias("8", "com", "comodo")) { Go("comodo",189, 151, 0, 0, .cost); } else if (alias("9", "juno", "yuno")) { Go("yuno", 157, 182, 0, 0, .cost); } else if (alias("10", "ama", "amat", "amatsu")) { Go("amatsu", 115, 153, 0, 0, .cost); } else if (alias("11", "Gon", "Gonr", "Gonryun")) { Go("Gonryun", 159, 116, 0, 0, .cost); } else if (alias("12", "umb", "umbala", "umbrella")) { Go("umbala", 90, 154, 0, 0, .cost); } else if (alias("13", "nif", "niflheim")) { Go("niflheim", 195, 175, 0, 0, .cost); } else if (alias("14", "lou", "louyang")) { Go("louyang", 218, 99, 0, 0, .cost); } else if (alias("15", "nov", "ng", "novice")) { Go("new_1-1", 53, 111, 0, 10, .cost); } else if (alias("16", "jail", "prison")) { Go("sec_pri", 23, 61, 0, 10, .cost); } else if (alias("17", "jaw", "jawaii")) { Go("jawaii", 221, 221, 0, 0, .cost); } else if (alias("18", "ayo", "ayotaya", "ayothaya")) { Go("ayothaya", 151, 165, 0, 0, .cost); } else if (alias("19", "ein", "einbroch")) { Go("einbroch", 64, 200, 0, 0, .cost); } else if (alias("20", "lhz", "light", "lighthalzen")) { Go("lighthalzen", 158, 92, 0, 0, .cost); } else if (alias("21", "einbe", "einbech")) { Go("einbech", 176, 125, 0, 0, .cost); } else if (alias("22", "hug", "hugel")) { Go("hugel", 96, 145, 0, 0, .cost); } else if (alias("23", "rach", "rachel")) { Go("rachel", 130, 110, 0, 0, .cost); } else if (alias("24", "ve", "veins")) { Go("veins", 216, 123, 0, 0, .cost); } else if (alias("25", "mosc", "mosk", "moscovia")) { Go("moscovia", 223, 184, 0, 0, .cost); } else if (alias("26", "camp", "mid", "midgard")) { Go("mid_camp", 180, 240, 0, 0, .cost); } else if (alias("27", "man", "manuk")) { Go("manuk", 282, 138, 0, 0, .cost); } else if (alias("28", "spl", "splend", "splendide")) { Go("splendide", 197, 176, 0, 0, .cost); } else if (alias("29", "br", "bra", "brasil", "brasilis")) { Go("brasilis", 182, 239, 0, 0, .cost); } else if (alias("30", "el", "eldic", "dic", "dicastes")) { Go("dicastes01", 198, 187, 0, 0, .cost); } else if (alias("31", "mora")) { Go("mora", 44, 151, 0, 0, .cost); } else if (alias("32", "dew", "dewata")) { Go("dewata", 200, 180, 0, 0, .cost); } else if (alias("33", "mal", "malang", "malangdo")) { Go("malangdo", 140, 114, 0, 0, .cost); } else if (alias("34", "port", "malay", "malaya")) { Go("malaya", 242, 211, 0, 0, .cost); } else if (alias("35", "ecl", "ecla", "eclag", "eclage")) { Go("eclage", 110, 39, 0, 0, .cost); } else if (alias("36", "pro", "pront", "prontera")) { Go("prontera",156, 184, 0, 0, .cost); } else { message strcharinfo(0), "Invalid location number, or name."; message strcharinfo(0), "Params: "; message strcharinfo(0), "Warps you to a city."; message strcharinfo(0), "0: Invek 1: Morroc 2: Geffen 3: Payon 4: Alberta"; message strcharinfo(0), "5: Izlude 6: Al De Baran 7: Lutie 8: Comodo 9: Yuno"; message strcharinfo(0), "10: Amatsu 11: Gonryun 12: Umbala 13: Niflheim 14: Louyang"; message strcharinfo(0), "15: Novice Grounds 16: Prison 17: Jawaii 18: Ayothaya 19: Einbroch"; message strcharinfo(0), "20: Lighthalzen 21: Einbech 22: Hugel 23: Rachel 24: Veins"; message strcharinfo(0), "25: Moscovia 26: Midgard Camp 27: Manuk 28: Splendide 29: Brasilis"; message strcharinfo(0), "30: El Dicastes 31: Mora 32: Dewata 33: Malangdo 34: Malaya"; message strcharinfo(0), "35: Eclage 36: Prontera"; message strcharinfo(0), "@Go failed."; } end; }[/cbox] Quote Share this post Link to post Share on other sites
Mumbles 193 Posted November 23, 2013 ^ Please post your code inside This Code box, click <> at the toolbar of your reply window then add your codeso that we can easily read/test your script [cbox]/*=========================================================@go commandOriginal concept by jTynneRevised by Mumbles===========================================================Compatibility:Optimised for Hercules emulators.===========================================================Description:Alternative @go command. Allows for unlimited aliasing, aswell as level and group restrictions for each destination.Additional options to add a delay, prevent use when dead,and charge per use are available; default cost is definedwith '.cost', but this parameter can be set manually with'go()'. These extra features are disabled by default.Be mindful that the delay uses a temporary player variable,'@go_delay'; if the player logs out, this variable will becleared. If you would like for a more secure delay, replaceall instances of '@go_delay' with 'go_delay'.=========================================================*/- script at_go -1,{/*-----------------------------------------------------Configuration-----------------------------------------------------*/OnInit:.delay = 15; // Delay per use, in seconds (default: 0).cost = 2500; // Default cost to use command if '.charge' is enabled.charge = 1; // Charge to use command? 0 = no, 1 = yes (default: 0).deadlock = 1; // Prevent usage when dead? 0 = no, 1 = yes (default: 0)bindatcmd("go", strnpcinfo(3) +"::OnAtcommand", 0, 2);end;/*-----------------------------------------------------Function: Go()-------------------------------------------------------Description: Warps player and checks prerequisites.-------------------------------------------------------Usage:go(<"map_name">, , , , , )-----------------------------------------------------*/function Go {if (.deadlock && !Hp) {message strcharinfo(0), "You may not use @go when you are dead.";} else if (.delay && @Go_delay > gettimetick(2)) {message strcharinfo(0), "You must wait "+ (@Go_delay - gettimetick(2)) +" seconds before warping again.";} else if (BaseLevel < getarg(3)) {message strcharinfo(0), "You must be at least level "+ getarg(3) +" to warp to this map.";} else if (getgroupid() < getarg(4) || getmapflag(getarg(0), mf_nowarp)) {message strcharinfo(0), "You are not authorised to warp to this map.";} else if (.charge && Zeny < getarg(5)) {message strcharinfo(0), "You must have at least "+ getarg(5) +" zeny to warp to this map.";} else {if (.delay) {@Go_delay = gettimetick(2) + .delay;}if (.charge) {Zeny -= getarg(5);}warp getarg(0), getarg(1), getarg(2);end;}message strcharinfo(0), "@Go failed.";end;}/*-----------------------------------------------------Function: alias()-------------------------------------------------------Description: Determines if input matches alias.-------------------------------------------------------Usage: alias(<"number">, <"name1">{, <"name2">, <...>})-----------------------------------------------------*/function alias {for (.@i = 0; .@i < getargcount(); .@i++) {if (@input$ == getarg(.@i)) {@input$ = "";return 1;}}return 0;}OnAtcommand:@input$ = .@atcmd_parameters$[0];if (alias("0", "inv", "Invek", "invek")) {Go("Invek",146, 164, 0, 0, .cost);} else if (alias("1", "moc", "mor", "morocc", "morroc")) {Go("morocc", 160, 100, 0, 0, .cost);} else if (alias("2", "gef", "geffen")) {Go("geffen", 120, 70, 0, 0, .cost);} else if (alias("3", "pay", "payo", "payon")) {Go("payon", 174, 98, 0, 0, .cost);} else if (alias("4", "alb", "alberta")) {Go("alberta", 192, 147, 0, 0, .cost);} else if (alias("5", "izl", "izlude")) {Go("izlude", 127, 109, 0, 0, .cost);} else if (alias("6", "ald", "alde", "aldebaran")) {Go("aldebaran", 140, 114, 0, 0, .cost);} else if (alias("7", "xmas", "lutie")) {Go("xmas", 148, 117, 0, 0, .cost);} else if (alias("8", "com", "comodo")) {Go("comodo",189, 151, 0, 0, .cost);} else if (alias("9", "juno", "yuno")) {Go("yuno", 157, 182, 0, 0, .cost);} else if (alias("10", "ama", "amat", "amatsu")) {Go("amatsu", 115, 153, 0, 0, .cost);} else if (alias("11", "Gon", "Gonr", "Gonryun")) {Go("Gonryun", 159, 116, 0, 0, .cost);} else if (alias("12", "umb", "umbala", "umbrella")) {Go("umbala", 90, 154, 0, 0, .cost);} else if (alias("13", "nif", "niflheim")) {Go("niflheim", 195, 175, 0, 0, .cost);} else if (alias("14", "lou", "louyang")) {Go("louyang", 218, 99, 0, 0, .cost);} else if (alias("15", "nov", "ng", "novice")) {Go("new_1-1", 53, 111, 0, 10, .cost);} else if (alias("16", "jail", "prison")) {Go("sec_pri", 23, 61, 0, 10, .cost);} else if (alias("17", "jaw", "jawaii")) {Go("jawaii", 221, 221, 0, 0, .cost);} else if (alias("18", "ayo", "ayotaya", "ayothaya")) {Go("ayothaya", 151, 165, 0, 0, .cost);} else if (alias("19", "ein", "einbroch")) {Go("einbroch", 64, 200, 0, 0, .cost);} else if (alias("20", "lhz", "light", "lighthalzen")) {Go("lighthalzen", 158, 92, 0, 0, .cost);} else if (alias("21", "einbe", "einbech")) {Go("einbech", 176, 125, 0, 0, .cost);} else if (alias("22", "hug", "hugel")) {Go("hugel", 96, 145, 0, 0, .cost);} else if (alias("23", "rach", "rachel")) {Go("rachel", 130, 110, 0, 0, .cost);} else if (alias("24", "ve", "veins")) {Go("veins", 216, 123, 0, 0, .cost);} else if (alias("25", "mosc", "mosk", "moscovia")) {Go("moscovia", 223, 184, 0, 0, .cost);} else if (alias("26", "camp", "mid", "midgard")) {Go("mid_camp", 180, 240, 0, 0, .cost);} else if (alias("27", "man", "manuk")) {Go("manuk", 282, 138, 0, 0, .cost);} else if (alias("28", "spl", "splend", "splendide")) {Go("splendide", 197, 176, 0, 0, .cost);} else if (alias("29", "br", "bra", "brasil", "brasilis")) {Go("brasilis", 182, 239, 0, 0, .cost);} else if (alias("30", "el", "eldic", "dic", "dicastes")) {Go("dicastes01", 198, 187, 0, 0, .cost);} else if (alias("31", "mora")) {Go("mora", 44, 151, 0, 0, .cost);} else if (alias("32", "dew", "dewata")) {Go("dewata", 200, 180, 0, 0, .cost);} else if (alias("33", "mal", "malang", "malangdo")) {Go("malangdo", 140, 114, 0, 0, .cost);} else if (alias("34", "port", "malay", "malaya")) {Go("malaya", 242, 211, 0, 0, .cost);} else if (alias("35", "ecl", "ecla", "eclag", "eclage")) {Go("eclage", 110, 39, 0, 0, .cost);} else if (alias("36", "pro", "pront", "prontera")) {Go("prontera",156, 184, 0, 0, .cost);} else {message strcharinfo(0), "Invalid location number, or name.";message strcharinfo(0), "Params: ";message strcharinfo(0), "Warps you to a city.";message strcharinfo(0), "0: Invek 1: Morroc 2: Geffen 3: Payon 4: Alberta";message strcharinfo(0), "5: Izlude 6: Al De Baran 7: Lutie 8: Comodo 9: Yuno";message strcharinfo(0), "10: Amatsu 11: Gonryun 12: Umbala 13: Niflheim 14: Louyang";message strcharinfo(0), "15: Novice Grounds 16: Prison 17: Jawaii 18: Ayothaya 19: Einbroch";message strcharinfo(0), "20: Lighthalzen 21: Einbech 22: Hugel 23: Rachel 24: Veins";message strcharinfo(0), "25: Moscovia 26: Midgard Camp 27: Manuk 28: Splendide 29: Brasilis";message strcharinfo(0), "30: El Dicastes 31: Mora 32: Dewata 33: Malangdo 34: Malaya";message strcharinfo(0), "35: Eclage 36: Prontera";message strcharinfo(0), "@Go failed.";}end;}[/cbox] I was unable to replicate the error with your version of my script. Tested on 463cbc9. Quote Share this post Link to post Share on other sites
TioHugo 0 Posted July 2, 2014 (edited) How can I add exceptions by group_id? @edit Sorry! I didn't see the date of posting Edited July 2, 2014 by TioHugo Quote Share this post Link to post Share on other sites
jaBote 438 Posted July 2, 2014 How can I add exceptions by group_id? @edit Sorry! I didn't see the date of posting Release posts don't die unless the topic starter abandons the community or the community can't support them. Could you please elaborate on this? Quote Share this post Link to post Share on other sites
TioHugo 0 Posted July 2, 2014 If I set that @go costs 3k zeny, I wish it were only for users from group_id 0. Users with higher group_id are not needed to pay, are the exception. Quote Share this post Link to post Share on other sites
Mumbles 193 Posted July 2, 2014 If I set that @go costs 3k zeny, I wish it were only for users from group_id 0. Users with higher group_id are not needed to pay, are the exception. Is this bypass only for the Zeny cost? If so, edit line 70: } else if (.charge && Zeny < getarg(5)) { } else if (.charge && Zeny < getarg(5) && getgroupid() < .bypass_id) { Then, add this to line 46: .bypass_id = 1; // Minimum group ID to bypass zeny cost 1 TioHugo reacted to this Quote Share this post Link to post Share on other sites
TioHugo 0 Posted July 2, 2014 Actually, the bypass' for zeny cost and delay! Quote Share this post Link to post Share on other sites
Mumbles 193 Posted July 2, 2014 Edit this: } else if (.delay && @go_delay > gettimetick(2)) { } else if (.delay && @go_delay > gettimetick(2) && getgroupid() < .bypass_id) { 1 TioHugo reacted to this Quote Share this post Link to post Share on other sites
TioHugo 0 Posted July 2, 2014 Works perfectly! Thank you Quote Share this post Link to post Share on other sites
Mumbles 193 Posted July 3, 2014 Works perfectly! Thank you Glad to hear that; you're welcome! Quote Share this post Link to post Share on other sites
Kong 9 Posted February 20, 2015 Hi Mumbles, I'm having a small problem with the nowarp mapflag. The command is still usable even if the map is set with a 'nowarp' mapflag. Quote Share this post Link to post Share on other sites
Mumbles 193 Posted February 20, 2015 Hi Mumbles, I'm having a small problem with the nowarp mapflag. The command is still usable even if the map is set with a 'nowarp' mapflag. Hi Kong, Thanks for the feedback. I'll push an update when I get back to my desk; for now, you can add this block of code at line 62 to accommodate your needs: } else if (getmapflag(getarg(0), mf_nowarp)) { message strcharinfo(0), "You are not authorised to warp to this map."; Quote Share this post Link to post Share on other sites
Kong 9 Posted February 20, 2015 Hi Mumbles, I'm having a small problem with the nowarp mapflag. The command is still usable even if the map is set with a 'nowarp' mapflag. Hi Kong, Thanks for the feedback. I'll push an update when I get back to my desk; for now, you can add this block of code at line 62 to accommodate your needs: } else if (getmapflag(getarg(0), mf_nowarp)) { message strcharinfo(0), "You are not authorised to warp to this map."; Hi Mumbles, unfortunately this didn't solve the problem. I was still able to use the @go command even if my current map has a mapflag 'nowarp'. I think the problem is with the argument, it gets the value which is the one set for each @go towns. It doesn't read the mapflag of your current map location. Quote Share this post Link to post Share on other sites
Mumbles 193 Posted February 20, 2015 Hi Mumbles, unfortunately this didn't solve the problem. I was still able to use the @go command even if my current map has a mapflag 'nowarp'. I think the problem is with the argument, it gets the value which is the one set for each @go towns. It doesn't read the mapflag of your current map location. Hi Kong, Per mf_nowarp's documentation (see nowarp.txt), mf_nowarp prevents the use of @go to a map, not from it. There is currently no mapflag (that I'm aware of) that prevents warping from the map, but you can circumvent this by either adding your own blacklist/filter of disabled maps. This is an example of a blacklist injection (though I wouldn't recommend punching this into this script exactly as it is written): setarray .@blacklist$[0], "payon", "prontera", "izlude";for (.@i = 0; .@i < getarraysize(.@blacklist$); .@i++) { if (strcharinfo(3) == .@blacklist$[.@i])) { message strcharinfo(0), "You may not warp from this map."; end; }} Quote Share this post Link to post Share on other sites
Kong 9 Posted February 20, 2015 (edited) Sorry Mumbles, I think you have a wrong interpretation to nowarp mapflags. I decided to revert back to the original @go command for you to see the difference. Here's a screenshot: I tried to use @go command on the map where I have a 'nowarp' mapflag and as you can see, the failed message text says that "You are not authorized to warp from your current map" and that's exactly how nowarp mapflags work. This is the mapflag used for most pvp and gvg maps. Afaik. Nowarp prevents you from using @warp and @go commands on the specified map (meaning you can't use these commands on the map where the mapflag is set to nowarp). On the other hand, we have the Nowarpto mapflag. This however, prevents you from warping to the specified map. Ex: You are in Prontera. You have a mapflag of Nowarp That means you cannot use @warp and @go commands while you are in Prontera Another example, when you have mapflag of Nowarpto in Izlude and you are in Prontera That means there's no way you can use @go / @warp command to go to Izlude other than maybe, an npc or warp portal. Thanks in advance Edit: I have fixed it now. function go { getmapxy(.@map$, .@x, .@y, 0); if (.deadlock && !Hp) { message strcharinfo(0), "You may not use @go when you are dead."; } else if (getmapflag(.@map$, mf_nowarp)) { message strcharinfo(0), "You are not authorized to warp from your current map."; } else if (.town && !getmapflag(strcharinfo(3), mf_town)) { message strcharinfo(0), "You may only use @go in towns."; } else if (.delay && @go_delay > gettimetick(2)) { message strcharinfo(0), "You must wait "+ (@go_delay - gettimetick(2)) +" seconds before warping again."; } else if (BaseLevel < getarg(3)) { message strcharinfo(0), "You must be at least level "+ getarg(3) +" to warp to this map."; } else if (getgroupid() < getarg(4) || getmapflag(getarg(0), mf_nowarp)) { message strcharinfo(0), "You are not authorized to warp to this map."; } else if (.charge && Zeny < getarg(5)) { message strcharinfo(0), "You must have at least "+ getarg(5) +" zeny to warp to this map."; } else { if (.delay) { @go_delay = gettimetick(2) + .delay; } if (.charge) { Zeny -= getarg(5); } warp getarg(0), getarg(1), getarg(2); end; } message strcharinfo(0), "@go failed."; end; } Changes: replaced mf_nowarp from line 72 to mf_nowarpto since that's most likely how it should work added getmapxy script to get current location at line 60 added new script from line 64 that will check for current location if it has mf_nowarp thus preventing the use of @go. Edited February 20, 2015 by Kong Quote Share this post Link to post Share on other sites
Mumbles 193 Posted February 20, 2015 Changes: [*]replaced mf_nowarp from line 72 to mf_nowarpto since that's most likely how it should work [*]added getmapxy script to get current location at line 60 [*]added new script from line 64 that will check for current location if it has mf_nowarp thus preventing the use of @go. You could probably do without getmapxy() since the script is attached to a player when run; strcharinfo(3) will return the attached player's map name. I'd say you were correct in changing mf_nowarp to mf_nowarpto, should the function of nowarpto be that players cannot warp to the map (duh; though sometimes the documentation isn't tell-all). Someone should really update the documentation for both mapflags, as they are either lacking in information or documented incorrectly. /swt 1 Kong reacted to this Quote Share this post Link to post Share on other sites
Kong 9 Posted February 20, 2015 (edited) Got it, thank you very much Mumbles! ~ Edit: function go { if (.deadlock && !Hp) { message strcharinfo(0), "You may not use @go when you are dead."; } else if (getmapflag(strcharinfo(3), mf_nowarp)) { message strcharinfo(0), "You are not authorized to warp from your current map."; } else if (.town && !getmapflag(strcharinfo(3), mf_town)) { message strcharinfo(0), "You may only use @go in towns."; } else if (.delay && @go_delay > gettimetick(2)) { message strcharinfo(0), "You must wait "+ (@go_delay - gettimetick(2)) +" seconds before warping again."; } else if (BaseLevel < getarg(3)) { message strcharinfo(0), "You must be at least level "+ getarg(3) +" to warp to this map."; } else if (getgroupid() < getarg(4) || getmapflag(getarg(0), mf_nowarp)) { message strcharinfo(0), "You are not authorized to warp to this map."; } else if (.charge && Zeny < getarg(5)) { message strcharinfo(0), "You must have at least "+ getarg(5) +" zeny to warp to this map."; } else { if (.delay) { @go_delay = gettimetick(2) + .delay; } if (.charge) { Zeny -= getarg(5); } warp getarg(0), getarg(1), getarg(2); end; } message strcharinfo(0), "@go failed."; end; } Edited February 20, 2015 by Kong Quote Share this post Link to post Share on other sites
Mumbles 193 Posted February 20, 2015 Got it, thank you very much Mumbles! ~ Can you please confirm (via in-game test) that nowarpto prevents this version of @go from warping to a map flagged with nowarpto, and that nowarp prevents warping from a map flagged with nowarp? I am unable to test any in-game behaviours at this time. Quote Share this post Link to post Share on other sites