Jump to content

Den

Inactive Member
  • Posts

    110
  • Joined

  • Last visited

  • Days Won

    5
  • Feedback

    0%

Posts posted by Den

  1. int item_unequip_selected(lua_State* L)
    	{
    		LPCHARACTER ch = CQuestManager::instance().GetCurrentCharacterPtr();
    
    		if (!lua_isnumber(L, 1))
    		{
    			sys_err("Argument error.");
    			lua_pushboolean(L, false);
    			return 1;
    		}
    
    		BYTE bCell = lua_tonumber(L, 1); //bcell == BYTE, iCell == INT, dCell == DWORD ....
    		if (bCell < 0 || bCell >= WEAR_MAX_NUM)
    		{
    			sys_err("Invalid wear position %d. Index out of range(0..%d)", bCell, WEAR_MAX_NUM);
    			lua_pushboolean(L, false);
    			return 1;
    		}
    
    
    		//LPITEM item = CQuestManager::instance().GetCurrentItem();       //current item in used
    		LPITEM equipped = ch->GetWear(bCell);                            //current equipped item on target slot
    
    		//check the pointers
    		if (!ch || !equipped)//!item) 
    		{
    			sys_err("No Item or Character Visible.");
    			lua_pushboolean(L,false);
    			return 1; 
    		}
    
    		//remove the equipped item
    		if (equipped->IsEquipped())
    		{
    			sys_log(0, "item_unequip_selected Player: %s Vnum: %d Cell: %d ::: TRUE ",ch->GetName(), item->GetVnum(), bCell);
    			ch->UnequipItem(equipped);
    			lua_pushboolean(L, true);
    			return 1;
    		}
    		else 
    		{
    			sys_log(0, "item_unequip_selected Player: %s Vnum: %d Cell: %d ::: False ",ch->GetName(), item->GetVnum(), bCell);
    			lua_pushboolean(L, false);
    			return 1;
    		}
    	}

    try this

    • Love 1
  2. 11 minutes ago, Zhymer said:

    Can't figure out in those txt where is the success rate, can you explain?

    Group RefineStepTables, RefineGradeTables for example.

    Group RefineStepTables									
    {									
    	Group Default								
    	{								
    		#NEED_COUNT	FEE	STEP_LOWEST	STEP_LOW	STEP_MID	STEP_HIGH	STEP_HIGHEST
    		STEP_LOWEST	2	400	50	40	10	0	0
    		STEP_LOW	2	400	5	90	5	0	0
    		STEP_MID	2	5000	0	0	10	90	0
    		STEP_HIGH	2	10000	0	0	0	90	10
    	}								
    }	

    Refining STEP_LOWEST you'll have 50% chance it'll remain STEP_LOWEST, 40% chance it'll be STEP_LOW after and 10% it'll be STEP_MID after. The same for the rest.

    For STEP_LOW you'll have 5% chance it'll degrade to STEP_LOWEST, 90% chance it'll remain on STEP_LOW and 5% it'll be STEP_MID after etc.

     

    • Good 1
×
×
  • 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.