Jump to content

Cripplez

Member
  • Posts

    118
  • Joined

  • Last visited

  • Feedback

    0%

Posts posted by Cripplez

  1. Version of Files XXX

    Hello, I tried to add the regen.txt in a new map, i added the same regen (with differenct coord) of another map with the same group vnum but when i start the server i have this syserr

    SYSERR: Jul 14 19:16:26 :: SpawnMob: SpawnMob: no mob data for vnum 3031
    SYSERR: Jul 14 19:16:26 :: SpawnMob: SpawnMob: no mob data for vnum 3031
    SYSERR: Jul 14 19:16:26 :: SpawnMob: SpawnMob: no mob data for vnum 3031
    SYSERR: Jul 14 19:16:26 :: SpawnMob: SpawnMob: no mob data for vnum 3031
    SYSERR: Jul 14 19:16:26 :: SpawnMob: SpawnMob: no mob data for vnum 3031
    SYSERR: Jul 14 19:16:26 :: SpawnMob: SpawnMob: no mob data for vnum 3031

    I can't understand why in a map there are no problem with this group, in the other it says this, like it is trying to spawn the mob 3031 (that in fac doesn't exist) instead of spawning the group vnum

    Anyone else had this problem?

     

  2. HNfS5Eb.png

    I did everything in the guide, but when i put the mouse over this i can't see the tooltip and it doesn't let me click it... i can't understand why... the syserr are empty too ?

  3.  

    Hello, I tried to add this argument in client source but when I try to open the client with the correct argument it doesn't load it, if the argument is wrong it says the message of error.

    Do you know what could be the problem?

     

        if (strstr(lpCmdLine, "--open-testmt2") == 0)
            MessageBox(NULL, "[Error] Start from autopatcher", "metin2client", MB_ICONSTOP);
            return 0;

     

  4. Version of Files XXX

    Hello, I'm trying to make one or more quest that gives you ATTBONUS_HUMAN every 20 level.

    I mean, at level 20 it will give you permanently +10 halfhuman, at level 40 again +10, level 60 +10 halfhuman, etc..

    So that at level 100 you will have a total of 50 halfhuman permanently
    Do you know how can this be done? Thank you


    I tried with this but someone lose the bonus when relog
     

    quest test_human_1 begin
    	state start begin
    	
    		when login or levelup with pc.get_level() >= 20 begin
    			affect.add_collect(apply.ATTBONUS_HUMAN, 10, 60*60*24*365*60)
    			q.done()
    			set_quest_state("test_human_2")
    			set_state("__complete")
    		end
    	end
    	state __complete begin
    	end
    end
    quest test_human_2 begin
    	state start begin
    	
    		when login or levelup with pc.get_level() >= 40 begin
    			affect.add_collect(apply.ATTBONUS_HUMAN, 10, 60*60*24*365*60)
    			q.done()
    			set_quest_state("test_human_3")
    			set_state("__complete")
    		end
    	end
    	state __complete begin
    	end
    end
    
    //and the same quest till level 100

     

  5. 1 hour ago, Cripplez said:

    @Mali61 I have a small problem, if i try to compare a weapon or armor with stones it doesn't work :(

    The equipped Item with stones is okay, but the item in inventory with stones can't be compared. Let me know if you can try it and see what I mean

     

    54 minutes ago, Mali61 said:

    spacer.png


    I tested again and it works for me too when the player is GM, when the player is not GM I can't compare weapon/armor with stones :(

    • Metin2 Dev 4
    • Love 1
  6. Version of Files martysama

    Hello, I'm trying to add the extended item award from Vegas: 

    This is the hidden content, please

    I have a problem compiling this part, but i think i did everything correcly

    tQDMrwV.png

     

     

     

    This is my ItemAwardManager.cpp

    Spoiler
    
    #include "stdafx.h"
    #include "QID.h"
    #include "DBManager.h"
    #include "ItemAwardManager.h"
    #ifdef ENABLE_EXTEND_ITEM_AWARD
    #include <float.h>
    inline double uniform_random(const double a, const double b)
    {
    	return thecore_random() / (RAND_MAX + 1.f) * (b - a) + a;
    }
    
    inline float gauss_random(const float fAverage, const float sigma)
    {
    	static bool bHasNextGaussian = false;
    	static float fNextGaussian = 0.0f;
    
    	if (bHasNextGaussian)
    	{
    		bHasNextGaussian = false;
    		return (fNextGaussian * sigma) + fAverage;
    	}
    	else
    	{
    		double v1(0), v2(0), s(0);
    		do
    		{
    			v1 = uniform_random(-1.f, 1.f);
    			v2 = uniform_random(-1.f, 1.f);
    			s = (v1 * v1) + (v2 * v2);
    		} while (s >= 1.f || fabs(s) < FLT_EPSILON);
    
    		const double multiplier = sqrtf(-2 * logf(s) / s);
    		fNextGaussian = v2 * multiplier;
    		bHasNextGaussian = true;
    		return (v1 * multiplier) * sigma + fAverage;
    	}
    }
    #endif
    #include "Peer.h"
    
    #include "ClientManager.h"
    
    
    
    DWORD g_dwLastCachedItemAwardID = 0;
    ItemAwardManager::ItemAwardManager()
    {
    }
    
    ItemAwardManager::~ItemAwardManager()
    {
    }
    
    void ItemAwardManager::RequestLoad()
    {
    	char szQuery[QUERY_MAX_LEN];
    #ifdef ENABLE_EXTEND_ITEM_AWARD	
    	snprintf(szQuery, sizeof(szQuery), "SELECT id, login, vnum, count, socket0, socket1, socket2, "
    			"attrtype0, attrvalue0, "
    			"attrtype1, attrvalue1, "
    			"attrtype2, attrvalue2, "
    			"attrtype3, attrvalue3, "
    			"attrtype4, attrvalue4, "
    			"attrtype5, attrvalue5, "
    			"attrtype6, attrvalue6, "
    			"mall, why "
    			"FROM item_award WHERE taken_time IS NULL and id > %d", g_dwLastCachedItemAwardID);
    #else
    	snprintf(szQuery, sizeof(szQuery), "SELECT id,login,vnum,count,socket0,socket1,socket2,mall,why FROM item_award WHERE taken_time IS NULL and id > %d", g_dwLastCachedItemAwardID);
    #endif
    	CDBManager::instance().ReturnQuery(szQuery, QID_ITEM_AWARD_LOAD, 0, NULL);
    }
    
    void ItemAwardManager::Load(SQLMsg * pMsg)
    {
    	MYSQL_RES * pRes = pMsg->Get()->pSQLResult;
    
    	for (uint i = 0; i < pMsg->Get()->uiNumRows; ++i)
    	{
    		MYSQL_ROW row = mysql_fetch_row(pRes);
    		int col = 0;
    
    		DWORD dwID = 0;
    		str_to_number(dwID, row[col++]);
    
    		if (m_map_award.find(dwID) != m_map_award.end())
    			continue;
    
    		TItemAward * kData = new TItemAward;
    		memset(kData, 0, sizeof(TItemAward));
    
    		kData->dwID	= dwID;
    		trim_and_lower(row[col++], kData->szLogin, sizeof(kData->szLogin));
    		str_to_number(kData->dwVnum, row[col++]);
    		str_to_number(kData->dwCount, row[col++]);
    		str_to_number(kData->dwSocket0, row[col++]);
    		str_to_number(kData->dwSocket1, row[col++]);
    		str_to_number(kData->dwSocket2, row[col++]);
    #ifdef ENABLE_EXTEND_ITEM_AWARD
    		for (size_t j = 0; j < ITEM_ATTRIBUTE_MAX_NUM; j++)
    		{
    			str_to_number(kData->aAttr[j].bType, row[col++]);
    			str_to_number(kData->aAttr[j].sValue, row[col++]);
    		}
    #endif
    		str_to_number(kData->bMall, row[col++]);
    
    		if (row[col])
    		{
    			strlcpy(kData->szWhy, row[col], sizeof(kData->szWhy));
    			
    			char* whyStr = kData->szWhy;	
    			char cmdStr[100] = "";	
    			strcpy(cmdStr,whyStr);	
    			char command[20] = "";
    			// @fixme203 directly GetCommand instead of strcpy
    			CClientManager::instance().GetCommand(cmdStr, command);				// command ¾ò±â
    			//sys_err("%d,  %s",pItemAward->dwID,command);
    			if( !(strcmp(command,"GIFT") ))	// command °¡ GIFTÀ̸é
    			{
    				TPacketItemAwardInfromer giftData;
    				strcpy(giftData.login, kData->szLogin);	
    				strcpy(giftData.command, command);					
    				giftData.vnum = kData->dwVnum;				
    				CClientManager::instance().ForwardPacket(HEADER_DG_ITEMAWARD_INFORMER,&giftData,sizeof(TPacketItemAwardInfromer));
    			}
    		}
    
    		m_map_award.insert(std::make_pair(dwID, kData));
    
    		printf("ITEM_AWARD load id %u bMall %d \n", kData->dwID, kData->bMall);
    		sys_log(0, "ITEM_AWARD: load id %lu login %s vnum %lu count %u socket %lu", kData->dwID, kData->szLogin, kData->dwVnum, kData->dwCount, kData->dwSocket0);
    		std::set<TItemAward *> & kSet = m_map_kSetAwardByLogin[kData->szLogin];
    		kSet.insert(kData);
    
    		if (dwID > g_dwLastCachedItemAwardID)
    			g_dwLastCachedItemAwardID = dwID;
    	}
    }
    
    std::set<TItemAward *> * ItemAwardManager::GetByLogin(const char * c_pszLogin)
    {
    	itertype(m_map_kSetAwardByLogin) it = m_map_kSetAwardByLogin.find(c_pszLogin);
    
    	if (it == m_map_kSetAwardByLogin.end())
    		return NULL;
    
    	return &it->second;
    }
    
    void ItemAwardManager::Taken(DWORD dwAwardID, DWORD dwItemID)
    {
    	itertype(m_map_award) it = m_map_award.find(dwAwardID);
    
    	if (it == m_map_award.end())
    	{
    		sys_log(0, "ITEM_AWARD: Taken ID not exist %lu", dwAwardID);
    		return;
    	}
    
    	TItemAward * k = it->second;
    	k->bTaken = true;
    
    	//
    	// Update taken_time in database to prevent not to give him again.
    	//
    	char szQuery[QUERY_MAX_LEN];
    
    	snprintf(szQuery, sizeof(szQuery),
    			"UPDATE item_award SET taken_time=NOW(),item_id=%u WHERE id=%u AND taken_time IS NULL",
    			dwItemID, dwAwardID);
    
    	CDBManager::instance().ReturnQuery(szQuery, QID_ITEM_AWARD_TAKEN, 0, NULL);
    }
    
    std::map<DWORD, TItemAward *>& ItemAwardManager::GetMapAward()
    {
    	return m_map_award;
    }
    
    std::map<std::string, std::set<TItemAward *> >& ItemAwardManager::GetMapkSetAwardByLogin()
    {
    	return m_map_kSetAwardByLogin;
    }
    
    #ifdef USE_ITEM_AWARD_CHECK_ATTRIBUTES
    /*******************************************************************\
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    ||| Attribute set index, return a specific index by item type & item sub type.
    ||| List initialization (since C++11)
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    \*******************************************************************/
    int8_t ItemAwardManager::GetItemAttributeSetIndex(const uint8_t bItemType, const uint8_t bItemSubType) const
    {
    	using TAttributeMapT = std::map<uint8_t, std::map<uint8_t, int8_t>>;
    	static const TAttributeMapT mapAttrSetFields =
    	{
    		{ ITEM_WEAPON,
    			{
    				{WEAPON_ARROW, ITEM_ATTRIBUTE_NONE},
    				#ifdef ENABLE_QUIVER_SYSTEM
    				{WEAPON_QUIVER, ITEM_ATTRIBUTE_NONE},
    				#endif
    			}
    		},
    		
    		{ ITEM_ARMOR,
    			{
    				{ARMOR_BODY, ATTRIBUTE_SET_BODY},
    				{ARMOR_WRIST, ATTRIBUTE_SET_WRIST},
    				{ARMOR_FOOTS, ATTRIBUTE_SET_FOOTS},
    				{ARMOR_NECK, ATTRIBUTE_SET_NECK},
    				{ARMOR_HEAD, ATTRIBUTE_SET_HEAD},
    				{ARMOR_SHIELD, ATTRIBUTE_SET_SHIELD},
    				{ARMOR_EAR, ATTRIBUTE_SET_EAR},
    			}
    		},
    		
    		{ ITEM_COSTUME,
    			{
    				{COSTUME_BODY, ATTRIBUTE_SET_BODY},
    				{COSTUME_HAIR, ATTRIBUTE_SET_HEAD},
    				#ifdef ENABLE_WEAPON_COSTUME_SYSTEM
    				{COSTUME_WEAPON, ATTRIBUTE_SET_WEAPON},
    				#endif
    				#ifdef ENABLE_MOUNT_COSTUME_SYSTEM
    				{COSTUME_MOUNT, ITEM_ATTRIBUTE_NONE},
    				#endif
    			}
    		},
    	};
    
    	const auto c_iter_type = mapAttrSetFields.find(bItemType);
    	if (c_iter_type != mapAttrSetFields.end())
    	{
    		const auto c_iter_sub_type = c_iter_type->second.find(bItemSubType);
    		if (c_iter_sub_type != c_iter_type->second.end())
    			return c_iter_sub_type->second;
    		else if (c_iter_type->first == ITEM_WEAPON)
    			return ATTRIBUTE_SET_WEAPON;
    	}
    
    	return ITEM_ATTRIBUTE_NONE;
    }
    
    
    /*******************************************************************\
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    ||| 15.04.2018 - Added a check for attr types and values min - max.
    ||| You can't insert wrong bonuses into a specific item.
    ||| Eg. Add 2000M MAX_HP on your Sword+9, was possible, now not.
    ||| Eg. Add +500 INT to your shield, now there's a check for min-max value of player.item_attr Lv.1 - Lv.5
    ||| and your 500 INT value will be replaced with max value from lvl5 of bonus, like 12 (lv5), that happen with all the bonuses,
    |||	same thing with the values lower than lvl1, like 5 HP_REGEN on your neck, when the minimum (lv1) is 10, the value will be replaced with 10.
    ||| If the bonus type can't be added into a specific item, the bonus will be ignored > deleted. (example: critical pct to armor)
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    \*******************************************************************/
    void ItemAwardManager::CheckItemAttributes(TItemAward & rkItemAward, const TItemTable & rkItemTable, const std::vector<TItemAttrTable> vec_itemAttrTable)
    {
    	const uint8_t bItemType = rkItemTable.bType;
    	const uint8_t bItemSubType = rkItemTable.bSubType;
    	const int8_t iAttributeSet = GetItemAttributeSetIndex(bItemType, bItemSubType);
    	if (iAttributeSet != ITEM_ATTRIBUTE_NONE)
    	{
    		for (size_t i = 0; i < ITEM_ATTRIBUTE_MAX_NUM; ++i)
    		{
    			const uint8_t bApplyType = rkItemAward.aAttr[i].bType;
    			const bool bIsAddonTypeItem = (bApplyType == APPLY_SKILL_DAMAGE_BONUS || bApplyType == APPLY_NORMAL_HIT_DAMAGE_BONUS);
    
    			const TItemAttrTable * pkAttrTable = NULL;
    			for (size_t j = 0; j < vec_itemAttrTable.size(); ++j)
    			{
    				const TItemAttrTable & rkAttrTable = vec_itemAttrTable.at(j);
    				if (rkAttrTable.dwApplyIndex == bApplyType && !bIsAddonTypeItem)
    				{
    					const uint8_t bAttrLevel = rkAttrTable.bMaxLevelBySet[iAttributeSet];
    					if (bAttrLevel > 0)
    					{
    						pkAttrTable = &rkAttrTable;
    						break;
    					}
    				}
    			}
    
    			if (pkAttrTable)
    			{
    				const int16_t sMinValue = static_cast<int16_t>(pkAttrTable->lValues[0]);
    				const int16_t sMaxValue = static_cast<int16_t>(pkAttrTable->lValues[(sizeof(pkAttrTable->lValues) / sizeof(pkAttrTable->lValues[0])) - 1]);
    				rkItemAward.aAttr[i].sValue = MINMAX(sMinValue, rkItemAward.aAttr[i].sValue, sMaxValue);
    			}
    			else if (!bIsAddonTypeItem)
    			{
    				rkItemAward.aAttr[i].bType = 0;
    				rkItemAward.aAttr[i].sValue = 0;
    			}
    		}
    	}
    }
    #endif
    
    #ifdef ENABLE_EXTEND_ITEM_AWARD
    /*******************************************************************\
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    ||| 02.04.2018 - Fixed unknown average/skill damage bonus value.
    ||| player.item_proto.addon_type = -1 (Eg. 189, 199, 299, 1139, 1179, 2159, 2179, 3169, 3219, 5119, 5129, 6019, 6069, 6079, 7169)[+0 - +9]
    ||| That's for the items which have addon type (-1) and you added them in item shop without bonuses like skill damage or hit damage,
    ||| value x, y as default, so they'll will be without bonuses and get 'bugged'.
    ||| Now when the item will be inserted there'll be a check if item doesn't have those bonuses (from query) add a random average/skill damage bonus value.
    ||| INSERT INTO player.item_award(`login`, `vnum`, `count`, `mall`) VALUES ('account', 189, 1, 1); 
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    \*******************************************************************/
    void ItemAwardManager::CheckItemAddonType(TItemAward & rkItemAward, const TItemTable & rkItemTable)
    {
    	const bool bIsAddonTypeItem = (rkItemTable.sAddonType == -1);
    	if (!bIsAddonTypeItem)
    		return;
    	
    	bool bHasBonus = false;
    	for (size_t i = 0; i < ITEM_ATTRIBUTE_MAX_NUM; ++i)
    	{
    		const uint8_t bType = rkItemAward.aAttr[i].bType;
    		const int16_t sValue = rkItemAward.aAttr[i].sValue;
    
    		if ((bType == APPLY_SKILL_DAMAGE_BONUS || bType == APPLY_NORMAL_HIT_DAMAGE_BONUS) && sValue)
    		{
    			bHasBonus = true; 
    			break;
    		}
    	}
    
    	if (!bHasBonus)
    	{
    		const int16_t sApplySkillDamageValue = MINMAX(-30, static_cast<int16_t>((gauss_random(0, 5) + 0.5f)), 30);
    		const int16_t sApplyNormalHitValue = std::abs(sApplySkillDamageValue) <= 20 ?
    												(-2 * sApplySkillDamageValue) + std::abs(number(-8, 8) + number(-8, 8)) + number(1, 4) :
    												(-2 * sApplySkillDamageValue) + number(1, 5);
    		
    		rkItemAward.aAttr[0].bType = APPLY_NORMAL_HIT_DAMAGE_BONUS;
    		rkItemAward.aAttr[0].sValue = sApplyNormalHitValue;	
    		rkItemAward.aAttr[1].bType = APPLY_SKILL_DAMAGE_BONUS;
    		rkItemAward.aAttr[1].sValue = sApplySkillDamageValue;
    	}
    }
    
    /*******************************************************************\
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    ||| 12.04.2019 - Added support for books.
    ||| Check skill types, unknown skill, skill vnum need to be saved into socket0, 
    ||| (4=Aura of the Sword < player.skill_proto), if the skill vnum is unknown, there will be a random book based on pc races, 
    ||| excluded skills PASSIVE, GUILD, SUPPORT.
    ||| INSERT INTO player.item_award(`login`, `vnum`, `count`, `mall`) VALUES ('account', 50300, 1, 1); # Random book
    ||| INSERT INTO player.item_award(`login`, `vnum`, `count`, `socket0`, `mall`) VALUES ('account', 50300, 1, 4, 1); # Specific book by skill vnum
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    \*******************************************************************/
    void ItemAwardManager::CheckItemSkillBook(TItemAward & rkItemAward, const std::vector<TSkillTable> vec_skillTable)
    {
    	const bool bIsBookItem = (rkItemAward.dwVnum == ITEM_SKILL_VNUM || rkItemAward.dwVnum == ITEM_SKILLFORGET_VNUM);
    	if (!bIsBookItem)
    		return;
    
    	uint32_t dwSocket0SkillVnum = rkItemAward.dwSocket0;
    	bool bHasSkill = false;
    	for (size_t i = 0; i < vec_skillTable.size(); ++i)
    	{
    		if (vec_skillTable[i].dwVnum == dwSocket0SkillVnum)
    		{
    			bHasSkill = true;
    			break;
    		}
    	}
    
    	if (!bHasSkill)
    	{
    		do
    		{
    			const TSkillTable * pkSkillTable = &vec_skillTable.at(number(0, vec_skillTable.size() - 1));
    			if (!pkSkillTable)
    				continue;
    
    			const uint32_t dwSkillVnum = pkSkillTable->dwVnum;
    			const uint8_t bSkillType = pkSkillTable->bType;
    
    			const bool bIsPCSkill = (JOB_WARRIOR + 1 <= bSkillType && bSkillType <= JOB_SHAMAN + 1) || bSkillType == 7;
    			if (!bIsPCSkill)
    				continue;
    			
    			dwSocket0SkillVnum = dwSkillVnum;
    			break;
    		}
    		while (true);
    
    		rkItemAward.dwSocket0 = dwSocket0SkillVnum;
    	}
    }
    
    /*******************************************************************\
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    ||| 11.04.2019 - Fixed unstackable items.
    ||| Check if item count overflow occured, then set it to maximum.
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    \*******************************************************************/
    void ItemAwardManager::CheckItemCount(TItemAward & rkItemAward, const TItemTable & rkItemTable)
    {
    	const bool bIsStackableItem = (rkItemTable.dwFlags & ITEM_FLAG_STACKABLE);
    	if (rkItemAward.dwCount > 1 && !bIsStackableItem)
    		rkItemAward.dwCount = 1;
    	else
    		rkItemAward.dwCount = MINMAX(1, rkItemAward.dwCount, ITEM_MAX_COUNT);
    }
    
    /*******************************************************************\
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    ||| TODO-UNFINISHED: Check if apply_type exists in bonuses.
    ||| Check if apply_value, apply_duration is equal with grades (1/2/3/4/5) from settings, blend.txt
    |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
    \*******************************************************************/
    void ItemAwardManager::CheckItemBlend(TItemAward & rkItemAward, const TItemTable & rkItemTable)
    {
    	const bool bIsBlendItem = (rkItemTable.bType == ITEM_BLEND);
    	if (!bIsBlendItem)
    		return;
    	
    	const uint32_t bApplyType = rkItemAward.dwSocket0;
    	const uint32_t bApplyValue = rkItemAward.dwSocket1;
    	const uint32_t dwApplyDuration = rkItemAward.dwSocket2;
    	
    	if (bApplyType == 0 || bApplyValue == 0 || dwApplyDuration == 0)
    		sys_err("ItemAwardManager: Unknown sockets for ITEM_BLEND.");
    }
    #endif

     

     

    @VegaS™Do you know how I could fix this? :P Thank you

     

     

    Vegas helped me, i needed to add

    #include <math.h>

    at the beninning

     

    #solved

    • Metin2 Dev 5
    • Good 2
    • Love 1
  7. 2 hours ago, Mali61 said:

    1.Make item stackable from proto

    2.uiinventory.py:

    Find in def __DropSrcItemToDestItemInInventory(self, srcItemVID, srcItemSlotPos, dstItemSlotPos):

    
    		elif item.IsMetin(srcItemVID):
    			self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos)

    Change:

    
    		elif item.IsMetin(srcItemVID) and not item.IsMetin(player.GetItemIndex(dstItemSlotPos)):
    			self.AttachMetinToItem(srcItemSlotPos, dstItemSlotPos)

    3.char_item.cpp

    Find in case ITEM_METIN:

    
    						ITEM_MANAGER::instance().RemoveItem(item, "REMOVE (METIN)");

    Change:

    
    						item->SetCount(item->GetCount() - 1);

     

     

    Thank you, all works perfect.

    Just one last thing, how can i make that when i try to stack a stone with another stone with the same vnum the background is yellow instead of red?

    9C1j0gP.png

  8. Solved doing this instead:

     

    					case USE_TUNING:
    					case USE_DETACHMENT:
    						{
    							LPITEM item2;
                              
    							if (!IsValidItemPosition(DestCell) || !(item2 = GetItem(DestCell)))
    								return false;
    
    							if (item2->IsExchanging() || item2->IsEquipped()) // @fixme114
    								return false;
                              
    							switch (item->GetVnum())
    							{
    								case 71032:
    									if (item2->GetType() != ITEM_WEAPON)
    									{
    										ChatPacket(CHAT_TYPE_INFO, LC_TEXT("error_refine_only_weapon"));
    										return false;
    									}
    									break;
    								case 39022:
    									if (item2->GetSubType() == ARMOR_BODY)
    									{
    									}
                                    	else
    									{
    										ChatPacket(CHAT_TYPE_INFO, LC_TEXT("error_refine_only_armor"));
    										return false;
    									}
    									break;
    							}
    
    #ifdef ENABLE_ACCE_SYSTEM
    							if (item->GetValue(0) == ACCE_CLEAN_ATTR_VALUE0)
    							{
    								if (!CleanAcceAttr(item, item2))
    									return false;
    
    								return true;
    							}
    #endif

     

  9. Hello

    I'm trying to make this refine item only for item_weapon and another refine item for item_armor

    I tried something like this but it's not working, the item 71032 should only work for weapon but when i use it on a weapon or another item it says the message of error

    Do you know how i can fix this? Thank you

    					case USE_TUNING:
    					case USE_DETACHMENT:
    						{
    							LPITEM item2;
    							switch (item->GetVnum())
    							{
    								case 71032:
    									if (item2->GetType() != ITEM_WEAPON)
    									{
    										ChatPacket(CHAT_TYPE_INFO, LC_TEXT("error_refine_only_weapon"));
    										return false;
    									}
    									break;
    								case 39022:
    									if (item2->GetSubType() != ARMOR_BODY)
    									{
    										ChatPacket(CHAT_TYPE_INFO, LC_TEXT("error_refine_only_armor"));
    										return false;
    									}
    									break;
    							}
                              
    
    							if (!IsValidItemPosition(DestCell) || !(item2 = GetItem(DestCell)))
    								return false;
    
    							if (item2->IsExchanging() || item2->IsEquipped()) // @fixme114
    								return false;
    
    #ifdef ENABLE_ACCE_SYSTEM
    							if (item->GetValue(0) == ACCE_CLEAN_ATTR_VALUE0)
    							{
    								if (!CleanAcceAttr(item, item2))
    									return false;
    
    								return true;
    							}
    #endif

     

  10. Ok I fixed all the syserr and now it is empty, but when i use the item 71032 it doesnt show this:

    self.probText.SetText(localeInfo.REFINE_SUCCESS_PROBALITY % (self.percentage2))

     

     

    Maybe it is not correct using this here for what I need?

    		if itemVnum == 71032:
    			self.probText.SetText(localeInfo.REFINE_SUCCESS_PROBALITY % (self.percentage2))
    		else:
    			self.probText.SetText(localeInfo.REFINE_SUCCESS_PROBALITY % (self.percentage))
  11. Hello, i would like to change this part of the uirefine.py that if you use the scroll vnum 71032 you will see +10% in the probability success

    I tried something like this, but when i try to use the scroll it doesn't work and in the syserr i have this

     

    	def Open(self, targetItemPos, nextGradeItemVnum, cost, prob, type, itemVnum):
    
    		if False == self.isLoaded:
    			self.__LoadScript()
    
    		self.__Initialize()
    
    		self.targetItemPos = targetItemPos
    		self.vnum = nextGradeItemVnum
    		self.cost = cost
    		self.percentage = prob
    		self.percentage2 = prob + 10
    		self.type = type
    		
    		if itemVnum == 71032:
    			self.probText.SetText(localeInfo.REFINE_SUCCESS_PROBALITY % (self.percentage2))
    		else:
    			self.probText.SetText(localeInfo.REFINE_SUCCESS_PROBALITY % (self.percentage))
    0220 13:34:53671 :: Traceback (most recent call last):
    
    0220 13:34:53671 ::   File "game.py", line 809, in OpenRefineDialog
    
    0220 13:34:53671 ::   File "interfaceModule.py", line 975, in OpenRefineDialog
    
    0220 13:34:53671 :: TypeError
    0220 13:34:53671 :: : 
    0220 13:34:53671 :: Open() takes exactly 7 arguments (6 given)
    0220 13:34:53671 :: 
    
    0220 13:34:53672 :: Traceback (most recent call last):
    
    0220 13:34:53672 ::   File "game.py", line 812, in AppendMaterialToRefineDialog
    
    0220 13:34:53672 ::   File "interfaceModule.py", line 978, in AppendMaterialToRefineDialog
    
    0220 13:34:53672 ::   File "uiRefine.py", line 375, in AppendMaterial
    
    0220 13:34:53672 ::   File "uiRefine.py", line 378, in UpdateDialog
    
    0220 13:34:53672 :: AttributeError
    0220 13:34:53672 :: : 
    0220 13:34:53672 :: 'RefineDialogNew' object has no attribute 'toolTip'
    0220 13:34:53672 :: 
    
    0220 13:34:53672 :: Traceback (most recent call last):
    
    0220 13:34:53672 ::   File "game.py", line 812, in AppendMaterialToRefineDialog
    
    0220 13:34:53672 ::   File "interfaceModule.py", line 978, in AppendMaterialToRefineDialog
    
    0220 13:34:53672 ::   File "uiRefine.py", line 375, in AppendMaterial
    
    0220 13:34:53672 ::   File "uiRefine.py", line 378, in UpdateDialog
    
    0220 13:34:53672 :: AttributeError
    0220 13:34:53672 :: : 
    0220 13:34:53672 :: 'RefineDialogNew' object has no attribute 'toolTip'
    0220 13:34:53672 :: 
    

     

    Do you know if there is an easy way to do this? Thank you

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