Advertisement
idontusemyphone

Untitled

Dec 11th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. enum {
  2. MAP_TELEPORT_COUNT = 16,
  3. };
  4.  
  5. ACMD(do_map)
  6. {
  7. char arg1[256];
  8. one_argument(argument, arg1, sizeof(arg1));
  9.  
  10. if (!*arg) return;
  11. if (!isnhdigit(*arg1)) return;
  12. if (ch->IsHack()) return;
  13. if (!ch->CanWarp()) return;
  14.  
  15. BYTE i;
  16. str_to_number(i, arg1);
  17.  
  18. if (i >= MAP_TELEPORT_COUNT) return;
  19.  
  20. struct SMapInfo {
  21. long x;
  22. long y;
  23. BYTE level;
  24. } s_MapInfo[MAP_TELEPORT_COUNT] = {
  25. { 3608, 8776, 0 },
  26. { 4693, 9642, 0 },
  27. { 10240 + 604, 16640 + 1303, 0 },
  28. { 7936 + 258, 9984 + 270, 0 },
  29. { 9474 + 75, 5376 + 446, 0 },
  30. { 9477 + 632, 7171 + 545, 75 },
  31. { 11264 + 295, 15104 + 1413, 135 },
  32. { 11776 + 318, 16640 + 428, 115 },
  33. { 12288 + 253, 5120 + 980, 95 },
  34. { 557, 1579, 0 },
  35. { 9696, 2784, 0 },
  36. { 6656 + 355, 8704 + 439, 0 },
  37. { 1385, 2349, 0 },
  38. { 14592 + 393, 7424 + 538, 0 },
  39. { 8731, 2426, 0 },
  40. { 0, 0, 0 },
  41. };
  42.  
  43. if (ch->GetLevel() < s_MapInfo[i].level)
  44. {
  45. ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("map-level-limit %d"), s_MapInfo[i].level);
  46. }
  47. else if (s_MapInfo[i].x == 0)
  48. {
  49. BYTE bEmpire = ch->GetEmpire();
  50. ch->WarpSet( g_start_position[bEmpire][0], g_start_position[bEmpire][1]);
  51. }
  52. else
  53. ch->WarpSet(s_MapInfo[i].x * 100, s_MapInfo[i].y * 100);
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement