Jump to content

C++ Change refine


Recommended Posts

I solve the problem with this code.

In char_item.cpp

	    if (pkNewItem->GetVnum() == 230 )
{
            ITEM_MANAGER::CopyAllAttrTo(item, pkNewItem); // copy the all the bonus on the new item
            LogManager::instance().ItemLog(this, pkNewItem, "REFINE SUCCESS", pkNewItem->GetName());
            // rewrite the bonus 1-5 (0)
            for (BYTE i = 0; i < 5; ++i)
            pkNewItem->SetForceAttribute(i, 0, 0);
	            BYTE bCell = item->GetCell();
	            // DETAIL_REFINE_LOG
            NotifyRefineSuccess(this, item, IsRefineThroughGuild() ? "GUILD" : "POWER");
            DBManager::instance().SendMoneyLog(MONEY_LOG_REFINE, item->GetVnum(), -cost);
            ITEM_MANAGER::instance().RemoveItem(item, "REMOVE (REFINE SUCCESS)");
            // END_OF_DETAIL_REFINE_LOG
	            pkNewItem->AddToCharacter(this, TItemPos(INVENTORY, bCell));
            ITEM_MANAGER::instance().FlushDelayedSave(pkNewItem);
	            sys_log(0, "Refine Success %d", cost);
            pkNewItem->AttrLog();
            //PointChange(POINT_GOLD, -cost);
            sys_log(0, "PayPee %d", cost);
            PayRefineFee(cost);
            sys_log(0, "PayPee End %d", cost);
}
	// on the item who is not in the above list, the bonus remain all.
        else if (pkNewItem)
        {
            ITEM_MANAGER::CopyAllAttrTo(item, pkNewItem);
            LogManager::instance().ItemLog(this, pkNewItem, "REFINE SUCCESS", pkNewItem->GetName());
	            BYTE bCell = item->GetCell();
	            // DETAIL_REFINE_LOG
            NotifyRefineSuccess(this, item, IsRefineThroughGuild() ? "GUILD" : "POWER");
            DBManager::instance().SendMoneyLog(MONEY_LOG_REFINE, item->GetVnum(), -cost);
            ITEM_MANAGER::instance().RemoveItem(item, "REMOVE (REFINE SUCCESS)");
            // END_OF_DETAIL_REFINE_LOG
	            pkNewItem->AddToCharacter(this, TItemPos(INVENTORY, bCell));
            ITEM_MANAGER::instance().FlushDelayedSave(pkNewItem);
	            sys_log(0, "Refine Success %d", cost);
            pkNewItem->AttrLog();
            //PointChange(POINT_GOLD, -cost);
            sys_log(0, "PayPee %d", cost);
            PayRefineFee(cost);
            sys_log(0, "PayPee End %d", cost);
        }
	 
	
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.