Advertisement
Guest User

Untitled

a guest
Oct 16th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1.     int pc_refine_rod(lua_State* L)
  2.     {
  3.         LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
  4.         if (!lua_isnumber(L, 1) || !ch)
  5.         {
  6.             lua_pushboolean(L, 0);
  7.             return 1;
  8.         }
  9.         WORD cell = lua_tonumber(L, 1);
  10.         LPITEM old_rod = ch->GetInventoryItem(cell);
  11.         if (old_rod && old_rod->GetType() == ITEM_ROD && old_rod->GetValue(4))
  12.         {
  13.             LPITEM new_rod = ch->AutoGiveItem(old_rod->GetValue(4));
  14.             old_rod->CopyAttributeTo(new_rod);
  15.             old_rod->SetCount(0);
  16.             lua_pushboolean(L, 1);
  17.             return 1;
  18.         }
  19.         lua_pushboolean(L, 0);
  20.         return 1;
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement