Jump to content

Necro

Premium
  • Posts

    236
  • Joined

  • Last visited

  • Days Won

    3
  • Feedback

    0%

Posts posted by Necro

  1. Hi guys, i set index for belt system: 

    	if (GetType() == ITEM_BELT)
    	{
    		return ATTRIBUTE_SET_BELT;
    	}

    but when i use item(71051)

    then sysser write me this:

    number_ex: number(): first argument is bigger than second argument 0 -> -1, item_attribute.cpp 405

    Here is the item_attribute

    bool CItem::AddRareAttribute()
    {
    	int count = GetRareAttrCount();
    
    	if (count >= 1)
    		return false;
    
    	int pos = count + 5;
    	TPlayerItemAttribute & attr = m_aAttr[pos];
    
    	int nAttrSet = GetAttributeSetIndex();
    	std::vector<int> avail;
    
    	for (int i = 0; i < MAX_APPLY_NUM; ++i)
    	{
    		const TItemAttrTable & r = g_map_itemRare[i];
    
    		if (r.dwApplyIndex != 0 && r.bMaxLevelBySet[nAttrSet] > 0 && HasRareAttr(i) != true)
    		{
    			avail.push_back(i);
    		}
    	}
    
    	const TItemAttrTable& r = g_map_itemRare[avail[number(0, avail.size() - 1)]];
    	int nAttrLevel = 5;
    
    	if (nAttrLevel > r.bMaxLevelBySet[nAttrSet])
    		nAttrLevel = r.bMaxLevelBySet[nAttrSet];
    
    	attr.bType = r.dwApplyIndex;
    	attr.sValue = r.lValues[nAttrLevel - 1];
    
    	UpdatePacket();
    
    	Save();
    
    	const char * pszIP = NULL;
    
    	if (GetOwner() && GetOwner()->GetDesc())
    		pszIP = GetOwner()->GetDesc()->GetHostName();
    
    	LogManager::instance().ItemLog(pos, attr.bType, attr.sValue, GetID(), "SET_RARE", "", pszIP ? pszIP : "", GetOriginalVnum());
    	return true;
    }

    Thanks for every idea

  2. But server_timer must be defined by login or something else ;)

    You can make and use sth like: when core_start begin :P

    Sorry i dont see core_start 

     

    		QUEST_CLICK_EVENT,
    		QUEST_KILL_EVENT,
    		QUEST_TIMER_EVENT,
    		QUEST_LEVELUP_EVENT,
    		QUEST_LOGIN_EVENT,
    		QUEST_LOGOUT_EVENT,
    		QUEST_BUTTON_EVENT,
    		QUEST_INFO_EVENT,
    		QUEST_CHAT_EVENT,
    		QUEST_ATTR_IN_EVENT,
    		QUEST_ATTR_OUT_EVENT,
    		QUEST_ITEM_USE_EVENT,
    		QUEST_SERVER_TIMER_EVENT,
    		QUEST_ENTER_STATE_EVENT,
    		QUEST_LEAVE_STATE_EVENT,
    		QUEST_LETTER_EVENT,
    		QUEST_ITEM_TAKE_EVENT,
    		QUEST_TARGET_EVENT,
    		QUEST_PARTY_KILL_EVENT,
    		QUEST_UNMOUNT_EVENT,
    		QUEST_ITEM_PICK_EVENT,
    		QUEST_SIG_USE_EVENT,
    		QUEST_ITEM_INFORMER_EVENT,
    		QUEST_UPGRADE_EVENT,
    		QUEST_DEAD_EVENT,
    		QUEST_EVENT_COUNT

    Do you have this new function?

  3. Hi guys, i use mainline src (game/db) and i have problem with party:

    1# When are members in different maps, they can get exp/yang

    2# When one member is in dungeon and he gets command -> warp_all_to_vilage -> All members in different maps are warp too.

     

    Does anybody know, where could be a problem? Thank you very much.

     

  4. What is the problem guys? 

     

    0701 06:47:33421 :: Traceback (most recent call last):
    
    0701 06:47:33421 ::   File "ui.py", line 1007, in CallEvent
    
    0701 06:47:33422 ::   File "uiChannel.py", line 60, in <lambda>
    
    0701 06:47:33422 ::   File "uiChannel.py", line 134, in __Fill_Up_ChannelList
    
    0701 06:47:33422 ::   File "uiChannel.py", line 140, in __RequestServerStateList
    
    0701 06:47:33422 ::   File "uiChannel.py", line 131, in __GetServerID
    
    0701 06:47:33422 :: UnboundLocalError
    0701 06:47:33422 :: : 
    0701 06:47:33422 :: local variable 'serverID' referenced before assignment

     

  5. Hi guys, i have little problem with 6/7 bonus, in source i change -> in char_item.cpp:

    Code:
    if (LC_IsEurope() || LC_IsSingapore() || LC_IsVietnam())
    	return false;

    but i cannot still give attribute to subject

    Here is the item_proto: https://metin2.download/picture/114A0r8CHbsU7VvHMM6x5tQyhmm6mXTc/.png 

    Nad how it looks in game: https://metin2.download/picture/4r7nX1AqYfibS3ddTq23fvuOOs6Ptd4a/.png

    char_item.cpp:

    case 71051 :
    	{
    		// if (LC_IsEurope() || LC_IsSingapore() || LC_IsVietnam())
    		//     return false;
    									
    		LPITEM item2;
    
    		if (!IsValidItemPosition(DestCell) || !(item2 = GetInventoryItem(wDestCell)))
    			return false;
    
    		if (item2->IsExchanging() == true)
    			return false;
    
    		if (item2->GetAttributeSetIndex() == -1)
    		{
    	    	ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ĽÓĽşŔ» şŻ°ćÇŇ Ľö ľř´Â ľĆŔĚĹŰŔÔ´Ď´Ů."));
    		    return false;
    		}
    
    		if (item2->AddRareAttribute() == true)
    		{
    			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Ľş°řŔűŔ¸·Î ĽÓĽşŔĚ Ăß°ˇ µÇľú˝Ŕ´Ď´Ů"));
    
    			int iAddedIdx = item2->GetRareAttrCount() + 4;
    			char buf[21];
    			snprintf(buf, sizeof(buf), "%u", item2->GetID());
    
    			LogManager::instance().ItemLog(
    				GetPlayerID(),
    				item2->GetAttributeType(iAddedIdx),
    				item2->GetAttributeValue(iAddedIdx),
    				item->GetID(),
    				"ADD_RARE_ATTR",
    				buf,
    				GetDesc()->GetHostName(),
    				item->GetOriginalVnum());
    
    			item->SetCount(item->GetCount() - 1);
    		}
    		else
    		{
    			ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´ő ŔĚ»ó ŔĚ ľĆŔĚĹŰŔ¸·Î ĽÓĽşŔ» Ăß°ˇÇŇ Ľö ľř˝Ŕ´Ď´Ů"));
    		}
    	}
    break;
    
    case 71052 :
    {
    	// if (LC_IsEurope() || LC_IsSingapore() || LC_IsVietnam())
    	//     return false;
    									
    	LPITEM item2;
    
    	if (!IsValidItemPosition(DestCell) || !(item2 = GetItem(DestCell)))
    		return false;
    
    	if (item2->IsExchanging() == true)
    		return false;
    
    	if (item2->GetAttributeSetIndex() == -1)
    	{
    		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("ĽÓĽşŔ» şŻ°ćÇŇ Ľö ľř´Â ľĆŔĚĹŰŔÔ´Ď´Ů."));
    		return false;
    	}
    
    	if (item2->ChangeRareAttribute() == true)
    	{
    		char buf[21];
    		snprintf(buf, sizeof(buf), "%u", item2->GetID());
    		LogManager::instance().ItemLog(this, item, "CHANGE_RARE_ATTR", buf);
    
    		item->SetCount(item->GetCount() - 1);
    	}
    	else
    	{
    		ChatPacket(CHAT_TYPE_INFO, LC_TEXT("şŻ°ć ˝ĂĹł ĽÓĽşŔĚ ľř˝Ŕ´Ď´Ů"));
    	}
    }
    break;

    Thanks for help.

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