Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int pc_refine_rod(lua_State* L)
- {
- LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
- if (!lua_isnumber(L, 1) || !ch)
- {
- lua_pushboolean(L, 0);
- return 1;
- }
- WORD cell = lua_tonumber(L, 1);
- LPITEM old_rod = ch->GetInventoryItem(cell);
- if (old_rod && old_rod->GetType() == ITEM_ROD && old_rod->GetValue(4))
- {
- LPITEM new_rod = ch->AutoGiveItem(old_rod->GetValue(4));
- old_rod->CopyAttributeTo(new_rod);
- old_rod->SetCount(0);
- lua_pushboolean(L, 1);
- return 1;
- }
- lua_pushboolean(L, 0);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement