Advertisement
Kapa3a

Fix drop yang

Nov 20th, 2023
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 8.41 KB | Source Code | 0 0
  1. find in char_battle.cpp:
  2.  
  3. else if (1 == number(1, iGold10DropPct))
  4.     {
  5.         //
  6.         // µ· ĆřĹş˝Ä µĺ·Ó
  7.         //
  8.         for (int i = 0; i < 10; ++i)
  9.         {
  10.             int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
  11.             iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
  12.             iGold *= iGoldMultipler;
  13.  
  14.             if (iGold == 0)
  15.             {
  16.                 continue;
  17.             }
  18.  
  19.             // NOTE: µ· ĆřĹşŔş Á¦ 3ŔÇ ĽŐ Ăł¸®¸¦ ÇĎÁö ľĘŔ˝
  20.             if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
  21.             {
  22.                 pos.x = GetX() + (number(-7, 7) * 20);
  23.                 pos.y = GetY() + (number(-7, 7) * 20);
  24.  
  25.                 item->AddToGround(GetMapIndex(), pos);
  26.                 item->StartDestroyEvent();
  27.  
  28.                 iTotalGold += iGold; // Total gold
  29.             }
  30.         }
  31.     }
  32. else if (1 == number(1, iGold10DropPct))
  33.     {
  34.         //
  35.         // µ· ĆřĹş˝Ä µĺ·Ó
  36.         //
  37.         for (int i = 0; i < 10; ++i)
  38.         {
  39.             int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
  40.             iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
  41.             iGold *= iGoldMultipler;
  42.  
  43.             if (iGold == 0)
  44.             {
  45.                 continue;
  46.             }
  47.  
  48.             // NOTE: µ· ĆřĹşŔş Á¦ 3ŔÇ ĽŐ Ăł¸®¸¦ ÇĎÁö ľĘŔ˝
  49.             if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
  50.             {
  51.                 pos.x = GetX() + (number(-7, 7) * 20);
  52.                 pos.y = GetY() + (number(-7, 7) * 20);
  53.  
  54.                 item->AddToGround(GetMapIndex(), pos);
  55.                 item->StartDestroyEvent();
  56.  
  57.                 iTotalGold += iGold; // Total gold
  58.             }
  59.         }
  60.     }
  61. Try to remove whole else if and check if it's working (save it somewhere maybe in case it wouldn't work).
  62.  
  63. @EDIT:
  64.  
  65. I didn't notice you also want to remove it from bosses. I have no time right now to adjust it but you can try it on your own. You have everything around this else if I gave you higher.
  66.  
  67. @EDIT2:
  68.  
  69. char_battle.cpp on the beggining add
  70.  
  71. #include "../../common/service.h"
  72. #include "../../common/service.h"
  73. common/service.h on the end add
  74.  
  75. #define DISABLE_YANG_BOMB
  76. #define DISABLE_YANG_BOMB
  77. char_battle.cpp change in Reward()
  78.  
  79.     if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)
  80.     {
  81.         if (1 == number(1, iGold10DropPct))
  82.             iGoldMultipler *= 10; // 1% Č®·ü·Î µ· 10ąč
  83.  
  84.         int iSplitCount = number(25, 35);
  85.  
  86.         for (int i = 0; i < iSplitCount; ++i)
  87.         {
  88.             int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
  89.             if (test_server)
  90.                 sys_log(0, "iGold %d", iGold);
  91.             iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
  92.             iGold *= iGoldMultipler;
  93.  
  94.             if (iGold == 0)
  95.             {
  96.                 continue ;
  97.             }
  98.  
  99.             if (test_server)
  100.             {
  101.                 sys_log(0, "Drop Moeny MobGoldAmountRate %d %d", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);
  102.                 sys_log(0, "Drop Money gold %d GoldMin %d GoldMax %d", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);
  103.             }
  104.  
  105.             // NOTE: µ· ĆřĹşŔş Á¦ 3ŔÇ ĽŐ Ăł¸®¸¦ ÇĎÁö ľĘŔ
  106. #ifdef DISABLE_YANG_BOMB
  107.             pkAttacker->GiveGold(iGold / iSplitCount);
  108.             iTotalGold += iGold;
  109. #else
  110.             if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
  111.             {
  112.                 pos.x = GetX() + ((number(-14, 14) + number(-14, 14)) * 23);
  113.                 pos.y = GetY() + ((number(-14, 14) + number(-14, 14)) * 23);
  114.  
  115.                 item->AddToGround(GetMapIndex(), pos);
  116.                 item->StartDestroyEvent();
  117.  
  118.                 iTotalGold += iGold; // Total gold
  119.             }
  120. #endif
  121.         }
  122.     }
  123.     // 1% Č®·ü·Î µ·Ŕ» 10°ł ¶łľî ¶ß¸°´Ů. (10ąč µĺ·ÓŔÓ
  124. #ifndef DISABLE_YANG_BOMB
  125.     else if (1 == number(1, iGold10DropPct))
  126.     {
  127.         //
  128.         // µ· ĆřĹş˝Ä µĺ·Ó
  129.         //
  130.         for (int i = 0; i < 10; ++i)
  131.         {
  132.             int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
  133.             iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
  134.             iGold *= iGoldMultipler;
  135.  
  136.             if (iGold == 0)
  137.             {
  138.                 continue;
  139.             }
  140.  
  141.             // NOTE: µ· ĆřĹşŔş Á¦ 3ŔÇ ĽŐ Ăł¸®¸¦ ÇĎÁö ľĘŔ˝
  142.             if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
  143.             {
  144.                 pos.x = GetX() + (number(-7, 7) * 20);
  145.                 pos.y = GetY() + (number(-7, 7) * 20);
  146.  
  147.                 item->AddToGround(GetMapIndex(), pos);
  148.                 item->StartDestroyEvent();
  149.  
  150.                 iTotalGold += iGold; // Total gold
  151.             }
  152.         }
  153.     }
  154. #endif
  155.     else
  156.     {
  157.         //
  158.         // ŔĎąÝŔűŔÎ ąć˝ÄŔÇ µ· µĺ·Ó
  159.         //
  160.         int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
  161.         iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
  162.         iGold *= iGoldMultipler;
  163.  
  164.         int iSplitCount;
  165.  
  166.         if (iGold >= 3 && !LC_IsYMIR())
  167.             iSplitCount = number(1, 3);
  168.         else if (GetMobRank() >= MOB_RANK_BOSS)
  169.         {
  170.             iSplitCount = number(3, 10);
  171.  
  172.             if ((iGold / iSplitCount) == 0)
  173.                 iSplitCount = 1;
  174.         }
  175.         else
  176.             iSplitCount = 1;
  177.  
  178.         if (iGold != 0)
  179.         {
  180.             iTotalGold += iGold; // Total gold
  181.  
  182.             for (int i = 0; i < iSplitCount; ++i)
  183.             {
  184.                 if (isAutoLoot)
  185.                 {
  186.                     pkAttacker->GiveGold(iGold / iSplitCount);
  187.                 }
  188.                 else if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold / iSplitCount)))
  189.                 {
  190.                     pos.x = GetX() + (number(-7, 7) * 20);
  191.                     pos.y = GetY() + (number(-7, 7) * 20);
  192.  
  193.                     item->AddToGround(GetMapIndex(), pos);
  194.                     item->StartDestroyEvent();
  195.                 }
  196.             }
  197.         }
  198.     }
  199.     if (GetMobRank() >= MOB_RANK_BOSS && !IsStone() && GetMobTable().dwGoldMax != 0)
  200.     {
  201.         if (1 == number(1, iGold10DropPct))
  202.             iGoldMultipler *= 10; // 1% Č®·ü·Î µ· 10ąč
  203.  
  204.         int iSplitCount = number(25, 35);
  205.  
  206.         for (int i = 0; i < iSplitCount; ++i)
  207.         {
  208.             int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
  209.             if (test_server)
  210.                 sys_log(0, "iGold %d", iGold);
  211.             iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
  212.             iGold *= iGoldMultipler;
  213.  
  214.             if (iGold == 0)
  215.             {
  216.                 continue ;
  217.             }
  218.  
  219.             if (test_server)
  220.             {
  221.                 sys_log(0, "Drop Moeny MobGoldAmountRate %d %d", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);
  222.                 sys_log(0, "Drop Money gold %d GoldMin %d GoldMax %d", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);
  223.             }
  224.  
  225.             // NOTE: µ· ĆřĹşŔş Á¦ 3ŔÇ ĽŐ Ăł¸®¸¦ ÇĎÁö ľĘŔ
  226. #ifdef DISABLE_YANG_BOMB
  227.             pkAttacker->GiveGold(iGold / iSplitCount);
  228.             iTotalGold += iGold;
  229. #else
  230.             if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
  231.             {
  232.                 pos.x = GetX() + ((number(-14, 14) + number(-14, 14)) * 23);
  233.                 pos.y = GetY() + ((number(-14, 14) + number(-14, 14)) * 23);
  234.  
  235.                 item->AddToGround(GetMapIndex(), pos);
  236.                 item->StartDestroyEvent();
  237.  
  238.                 iTotalGold += iGold; // Total gold
  239.             }
  240. #endif
  241.         }
  242.     }
  243.     // 1% Č®·ü·Î µ·Ŕ» 10°ł ¶łľî ¶ß¸°´Ů. (10ąč µĺ·ÓŔÓ
  244. #ifndef DISABLE_YANG_BOMB
  245.     else if (1 == number(1, iGold10DropPct))
  246.     {
  247.         //
  248.         // µ· ĆřĹş˝Ä µĺ·Ó
  249.         //
  250.         for (int i = 0; i < 10; ++i)
  251.         {
  252.             int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
  253.             iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
  254.             iGold *= iGoldMultipler;
  255.  
  256.             if (iGold == 0)
  257.             {
  258.                 continue;
  259.             }
  260.  
  261.             // NOTE: µ· ĆřĹşŔş Á¦ 3ŔÇ ĽŐ Ăł¸®¸¦ ÇĎÁö ľĘŔ˝
  262.             if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
  263.             {
  264.                 pos.x = GetX() + (number(-7, 7) * 20);
  265.                 pos.y = GetY() + (number(-7, 7) * 20);
  266.  
  267.                 item->AddToGround(GetMapIndex(), pos);
  268.                 item->StartDestroyEvent();
  269.  
  270.                 iTotalGold += iGold; // Total gold
  271.             }
  272.         }
  273.     }
  274. #endif
  275.     else
  276.     {
  277.         //
  278.         // ŔĎąÝŔűŔÎ ąć˝ÄŔÇ µ· µĺ·Ó
  279.         //
  280.         int iGold = number(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax);
  281.         iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
  282.         iGold *= iGoldMultipler;
  283.  
  284.         int iSplitCount;
  285.  
  286.         if (iGold >= 3 && !LC_IsYMIR())
  287.             iSplitCount = number(1, 3);
  288.         else if (GetMobRank() >= MOB_RANK_BOSS)
  289.         {
  290.             iSplitCount = number(3, 10);
  291.  
  292.             if ((iGold / iSplitCount) == 0)
  293.                 iSplitCount = 1;
  294.         }
  295.         else
  296.             iSplitCount = 1;
  297.  
  298.         if (iGold != 0)
  299.         {
  300.             iTotalGold += iGold; // Total gold
  301.  
  302.             for (int i = 0; i < iSplitCount; ++i)
  303.             {
  304.                 if (isAutoLoot)
  305.                 {
  306.                     pkAttacker->GiveGold(iGold / iSplitCount);
  307.                 }
  308.                 else if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold / iSplitCount)))
  309.                 {
  310.                     pos.x = GetX() + (number(-7, 7) * 20);
  311.                     pos.y = GetY() + (number(-7, 7) * 20);
  312.  
  313.                     item->AddToGround(GetMapIndex(), pos);
  314.                     item->StartDestroyEvent();
  315.                 }
  316.             }
  317.         }
  318.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement