Advertisement
Emistry

[RO] @go with level restriction 1.2

Oct 15th, 2016
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. // https://rathena.org/board/topic/107746-request-script-go-restrict-on-base-level/
  2.  
  3. - script Sample#at_go_restrict -1,{
  4. function func_SetLevel {
  5. setd( ".map_" + getarg( 0,"" ) ), getarg( 1,1 );
  6. return;
  7. }
  8. OnInit:
  9. bindatcmd( "go", strnpcinfo(3)+"::OnAtcommand" );
  10. bindatcmd( "warp", strnpcinfo(3)+"::OnAtcommand" );
  11.  
  12. func_SetLevel( "prontera",30 ); // prontera need level 30.
  13. func_SetLevel( "payon",99 ); // payon need level 99.
  14. end;
  15.  
  16. OnAtcommand:
  17. if ( !.@atcmd_numparameters ) {
  18. dispbottom .@atcmd_command$+" <mapname> <x> <y>";
  19. }
  20. else {
  21. switch( atoi( .@atcmd_parameters$[0] ) ) {
  22. default:
  23. callsub( OnWarp, .@atcmd_parameters$[0], .@atcmd_parameters$[1], .@atcmd_parameters$[2] );
  24. break;
  25. case 0: callsub( OnWarp, "prontera",156,191 );
  26. case 1: callsub( OnWarp, "moroc",156,93 );
  27. case 2: callsub( OnWarp, "geffen",119,59 );
  28. case 3: callsub( OnWarp, "payon",162,233 );
  29. case 4: callsub( OnWarp, "alberta",192,147 );
  30. case 5: callsub( OnWarp, "izlude",128,146 );
  31. case 6: callsub( OnWarp, "aldebaran",140,131 );
  32. case 7: callsub( OnWarp, "xmas",147,134,3 );
  33. case 8: callsub( OnWarp, "comodo",209,143,3 );
  34. case 9: callsub( OnWarp, "yuno",157,51,3 );
  35. case 10: callsub( OnWarp, "amatsu",198,84,3 );
  36. case 11: callsub( OnWarp, "gonryun",160,120,3 );
  37. case 12: callsub( OnWarp, "umbala",89,157,3 );
  38. case 13: callsub( OnWarp, "niflheim",21,153,3 );
  39. case 14: callsub( OnWarp, "louyang",217,40,3 );
  40. case 15: callsub( OnWarp, "novice",53,111,3 );
  41. case 16: callsub( OnWarp, "jail",23,61,3 );
  42. case 17: callsub( OnWarp, "jawaii",249,127,3 );
  43. case 18: callsub( OnWarp, "ayothaya",151,117,3 );
  44. case 19: callsub( OnWarp, "einbroch",4,200,5 );
  45. case 20: callsub( OnWarp, "lighthalzen",158,92,3 );
  46. case 21: callsub( OnWarp, "einbech",70,95,5 );
  47. case 22: callsub( OnWarp, "hugel",96,145,3 );
  48. case 23: callsub( OnWarp, "rachel",130,110,3 );
  49. case 24: callsub( OnWarp, "veins",216,123,3 );
  50. case 25: callsub( OnWarp, "moscovia",223,184,3 );
  51. case 26: callsub( OnWarp, "midcamp",180,240,3 );
  52. case 27: callsub( OnWarp, "manuk",282,138,3 );
  53. case 28: callsub( OnWarp, "splendide",197,176,3 );
  54. case 29: callsub( OnWarp, "brasilis",182,239,3 );
  55. case 30: callsub( OnWarp, "dicastes",198,187,3 );
  56. case 31: callsub( OnWarp, "mora",44,151,4 );
  57. case 32: callsub( OnWarp, "dewata",200,180,3 );
  58. case 33: callsub( OnWarp, "malangdo",140,114,5 );
  59. case 34: callsub( OnWarp, "malaya",242,211,5 );
  60. case 35: callsub( OnWarp, "eclage",110,39,3 );
  61. }
  62. }
  63. end;
  64.  
  65. OnWarp:
  66. .@map$ = getarg( 0,"" );
  67. .@x = getarg( 1,0 );
  68. .@y = getarg( 2,0 );
  69.  
  70. if ( getmapusers( .@map$ ) == -1 ) {
  71. dispbottom "map '"+.@map$+"' doesn't exist.";
  72. }
  73. else if ( !getmapflag( .@map$,mf_town ) || getmapflag( .@map$,mf_nowarpto ) ) {
  74. dispbottom "you cant warp to this map.";
  75. }
  76. else if ( getd( ".map_" + .@map$ ) > BaseLevel ) {
  77. dispbottom "You need higher level to warp to this map.";
  78. }
  79. else {
  80. warp .@map$,.@x,.@y;
  81. }
  82. end;
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement