Advertisement
Guest User

Untitled

a guest
May 21st, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. Do service.h dodajesz
  2.  
  3. #define DUNGEON_TELEPORT_FIX
  4.  
  5. Przechodzisz do pliku cmd.gm
  6.  
  7. szukasz funkcji ACMD(do_warp)
  8.  
  9. Podmieniasz całą funkcje :
  10.  
  11. ACMD(do_warp)
  12. {
  13. char arg1[256], arg2[256];
  14.  
  15. two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
  16.  
  17. if (!*arg1)
  18. {
  19. ch->ChatPacket(CHAT_TYPE_INFO, "Usage: warp <character name> | <x meter> <y meter>");
  20. return;
  21. }
  22.  
  23. int x = 0, y = 0;
  24. #ifdef DUNGEON_TELEPORT_FIX
  25. DWORD map_index = 0;
  26. #endif
  27.  
  28.  
  29. if (isnhdigit(*arg1) && isnhdigit(*arg2))
  30. {
  31. str_to_number(x, arg1);
  32. str_to_number(y, arg2);
  33. }
  34. else
  35. {
  36. LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(arg1);
  37.  
  38. if (NULL == tch)
  39. {
  40. const CCI* pkCCI = P2P_MANAGER::instance().Find(arg1);
  41.  
  42. if (NULL != pkCCI)
  43. {
  44. if (pkCCI->bChannel != g_bChannel)
  45. {
  46. ch->ChatPacket(CHAT_TYPE_INFO, "Target is in %d channel (my channel %d)", pkCCI->bChannel, g_bChannel);
  47. return;
  48. }
  49.  
  50. ch->WarpToPID( pkCCI->dwPID );
  51. }
  52. else
  53. {
  54. ch->ChatPacket(CHAT_TYPE_INFO, "There is no one by that name");
  55. }
  56.  
  57. return;
  58. }
  59. else
  60. {
  61. x = tch->GetX() / 100;
  62. y = tch->GetY() / 100;
  63. #ifdef DUNGEON_TELEPORT_FIX
  64. map_index = tch->GetMapIndex();
  65. #endif
  66. }
  67. }
  68.  
  69. x *= 100;
  70. y *= 100;
  71.  
  72. ch->ChatPacket(CHAT_TYPE_INFO, "You warp to ( %d, %d )", x, y);
  73. #ifdef DUNGEON_TELEPORT_FIX
  74. ch->WarpSet(x, y, map_index);
  75. #else
  76. ch->WarpSet(x, y);
  77. #endif
  78. ch->Stop();
  79. }
  80.  
  81.  
  82.  
  83.  
  84. i tyle.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement