Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. [File: /Src/server/game/src/char.cpp]
  2.  
  3. /1.) Search:
  4.  
  5. addPacket.sAlignment = m_iAlignment / 10;
  6. //2.) Replace with:
  7.  
  8. addPacket.sAlignment = m_iAlignment;
  9. //1.) Search:
  10.  
  11. pack.sAlignment = m_iAlignment / 10;
  12. //2.) Replace with:
  13.  
  14. pack.sAlignment = m_iAlignment;
  15. [File: /Src/server/game/src/char_battle.cpp]
  16.  
  17. //1.) Search:
  18.  
  19. void CHARACTER::UpdateAlignment(int iAmount)
  20. {
  21. bool bShow = false;
  22.  
  23. if (m_iAlignment == m_iRealAlignment)
  24. bShow = true;
  25.  
  26. int i = m_iAlignment / 10;
  27.  
  28. m_iRealAlignment = MINMAX(-200000, m_iRealAlignment + iAmount, 200000);
  29.  
  30. if (bShow)
  31. {
  32. m_iAlignment = m_iRealAlignment;
  33.  
  34. if (i != m_iAlignment / 10)
  35. UpdatePacket();
  36. }
  37. }
  38. //2.) Replace with:
  39.  
  40. void CHARACTER::UpdateAlignment(int iAmount)
  41. {
  42. bool bShow = false;
  43.  
  44. if (m_iAlignment == m_iRealAlignment)
  45. bShow = true;
  46.  
  47. int i = m_iAlignment;
  48.  
  49. m_iRealAlignment = MINMAX(-20000, m_iRealAlignment + iAmount, 20000);
  50.  
  51. if (bShow)
  52. {
  53. m_iAlignment = m_iRealAlignment;
  54.  
  55. if (i != m_iAlignment)
  56. UpdatePacket();
  57. }
  58. }
  59.  
  60.  
  61. [File: /Src/server/game/src/questlua_pc.cpp]
  62.  
  63. //1.) Search:
  64.  
  65. int pc_get_real_alignment(lua_State* L)
  66. {
  67. lua_pushnumber(L, CQuestManager::instance().GetCurrentCharacterPtr()->GetRealAlignment()/10);
  68. return 1;
  69. }
  70. int pc_get_alignment(lua_State* L)
  71. {
  72. lua_pushnumber(L, CQuestManager::instance().GetCurrentCharacterPtr()->GetAlignment()/10);
  73. return 1;
  74. }
  75. int pc_change_alignment(lua_State * L)
  76. {
  77. int alignment = (int)(lua_tonumber(L, 1)*10);
  78. LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
  79.  
  80. ch->UpdateAlignment(alignment);
  81. return 0;
  82. }
  83. //2.) Replace with:
  84.  
  85. int pc_get_real_alignment(lua_State* L)
  86. {
  87. lua_pushnumber(L, CQuestManager::instance().GetCurrentCharacterPtr()->GetRealAlignment());
  88. return 1;
  89. }
  90. int pc_get_alignment(lua_State* L)
  91. {
  92. lua_pushnumber(L, CQuestManager::instance().GetCurrentCharacterPtr()->GetAlignment());
  93. return 1;
  94. }
  95. int pc_change_alignment(lua_State * L)
  96. {
  97. int alignment = (int)(lua_tonumber(L, 1));
  98. LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
  99. ch->UpdateAlignment(alignment);
  100. return 0;
  101. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement