Vassy
-
Posts
46 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by Vassy
-
-
As i sayd above, this are the files from my server where i dont have the bug.
I get in chat "The person you are trying to trade has the inventory full."
Look. Here is the function that checks the inventory space.
Spoilerif (!GetCompany()->CheckSpace())
{
victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방의 소지품에 빈 공간이 없습니다."));
GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소지품에 빈 공간이 없습니다."));
goto EXCHANGE_END;
}locale_string.txt
Spoiler"상대방의 소지품에 빈 공간이 없습니다.";
"The partner dont have enough space in inventory.";"소지품에 빈 공간이 없습니다.";
"You dont have enigh space in inventory";and ASCI version
Spoiler"»ó´ëąćŔÇ ĽŇÁöÇ°żˇ şó °ř°ŁŔĚ ľř˝Ŕ´Ď´Ů.";
"The partner dont have enough space in inventory.";"ĽŇÁöÇ°żˇ şó °ř°ŁŔĚ ľř˝Ŕ´Ď´Ů.";
"You dont have enigh space in inventory";Good luck.
-
It works. I was that dumb and not testing with the correct item. In my if condition are actually 200 vnum but here i posted only 19060.
#Solved.
-
exchange.h
Spoiler#ifndef __INC_METIN_II_GAME_EXCHANGE_H__
#define __INC_METIN_II_GAME_EXCHANGE_H__class CGrid;
enum EExchangeValues
{
EXCHANGE_ITEM_MAX_NUM = 12,
EXCHANGE_MAX_DISTANCE = 1000
};class CExchange
{
public:
CExchange(LPCHARACTER pOwner);
~CExchange();bool Accept(bool bIsAccept = true);
void Cancel();bool AddGold(long lGold);
bool AddItem(TItemPos item_pos, BYTE display_pos);
bool RemoveItem(BYTE pos);LPCHARACTER GetOwner() { return m_pOwner; }
CExchange * GetCompany() { return m_pCompany; }bool GetAcceptStatus() { return m_bAccept; }
void SetCompany(CExchange * pExchange) { m_pCompany = pExchange; }
private:
bool Done();
bool Check(int * piItemCount);
bool CheckSpace();private:
CExchange * m_pCompany; // 상대방의 CExchange 포인터LPCHARACTER m_pOwner;
TItemPos m_aItemPos[EXCHANGE_ITEM_MAX_NUM];
LPITEM m_apItems[EXCHANGE_ITEM_MAX_NUM];
BYTE m_abItemDisplayPos[EXCHANGE_ITEM_MAX_NUM];bool m_bAccept;
long m_lGold;CGrid * m_pGrid;
};
#endif
exchange.cpp
Spoiler#include "stdafx.h"
#include "../../libgame/include/grid.h"
#include "utils.h"
#include "desc.h"
#include "desc_client.h"
#include "char.h"
#include "item.h"
#include "item_manager.h"
#include "packet.h"
#include "log.h"
#include "db.h"
#include "locale_service.h"
#include "../../common/length.h"
#include "exchange.h"
#include "DragonSoul.h"void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, DWORD arg1, TItemPos arg2, DWORD arg3, void * pvData = NULL);
// 교환 패킷
void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, DWORD arg1, TItemPos arg2, DWORD arg3, void * pvData)
{
if (!ch->GetDesc())
return;struct packet_exchange pack_exchg;
pack_exchg.header = HEADER_GC_EXCHANGE;
pack_exchg.sub_header = sub_header;
pack_exchg.is_me = is_me;
pack_exchg.arg1 = arg1;
pack_exchg.arg2 = arg2;
pack_exchg.arg3 = arg3;if (sub_header == EXCHANGE_SUBHEADER_GC_ITEM_ADD && pvData)
{
thecore_memcpy(&pack_exchg.alSockets, ((LPITEM) pvData)->GetSockets(), sizeof(pack_exchg.alSockets));
thecore_memcpy(&pack_exchg.aAttr, ((LPITEM) pvData)->GetAttributes(), sizeof(pack_exchg.aAttr));
}
else
{
memset(&pack_exchg.alSockets, 0, sizeof(pack_exchg.alSockets));
memset(&pack_exchg.aAttr, 0, sizeof(pack_exchg.aAttr));
}ch->GetDesc()->Packet(&pack_exchg, sizeof(pack_exchg));
}// 교환을 시작
bool CHARACTER::ExchangeStart(LPCHARACTER victim)
{
if (this == victim) // 자기 자신과는 교환을 못한다.
return false;if (IsObserverMode())
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("관전 상태에서는 교환을 할 수 없습니다."));
return false;
}if (victim->IsNPC())
return false;//PREVENT_TRADE_WINDOW
#ifdef ENABLE_OFFLINE_SHOP_SYSTEM
if ( IsOpenSafebox() || GetShopOwner() || GetMyShop() || IsCubeOpen() || GetOfflineShopOwner() || IsAcceOpen())
{
ChatPacket( CHAT_TYPE_INFO, LC_TEXT("다른 거래창이 열려있을경우 거래를 할수 없습니다." ) );
return false;
}if ( victim->IsOpenSafebox() || victim->GetShopOwner() || victim->GetMyShop() || victim->IsCubeOpen() || victim->GetOfflineShopOwner() || victim->IsAcceOpen())
{
ChatPacket( CHAT_TYPE_INFO, LC_TEXT("상대방이 다른 거래중이라 거래를 할수 없습니다." ) );
return false;
}
#else
if (IsOpenSafebox() || GetShopOwner() || GetMyShop() || IsCubeOpen() || IsAcceOpen())
{
ChatPacket( CHAT_TYPE_INFO, LC_TEXT("다른 거래창이 열려있을경우 거래를 할수 없습니다." ) );
return false;
}if (victim->IsOpenSafebox() || victim->GetShopOwner() || victim->GetMyShop() || victim->IsCubeOpen() || victim->IsAcceOpen())
{
ChatPacket( CHAT_TYPE_INFO, LC_TEXT("상대방이 다른 거래중이라 거래를 할수 없습니다." ) );
return false;
}
#endif
//END_PREVENT_TRADE_WINDOW
int iDist = DISTANCE_APPROX(GetX() - victim->GetX(), GetY() - victim->GetY());// 거리 체크
if (iDist >= EXCHANGE_MAX_DISTANCE)
return false;if (GetExchange())
return false;if (victim->GetExchange())
{
exchange_packet(this, EXCHANGE_SUBHEADER_GC_ALREADY, 0, 0, NPOS, 0);
return false;
}if (victim->IsBlockMode(BLOCK_EXCHANGE))
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방이 교환 거부 상태입니다."));
return false;
}SetExchange(M2_NEW CExchange(this));
victim->SetExchange(M2_NEW CExchange(victim));victim->GetExchange()->SetCompany(GetExchange());
GetExchange()->SetCompany(victim->GetExchange());//
SetExchangeTime();
victim->SetExchangeTime();exchange_packet(victim, EXCHANGE_SUBHEADER_GC_START, 0, GetVID(), NPOS, 0);
exchange_packet(this, EXCHANGE_SUBHEADER_GC_START, 0, victim->GetVID(), NPOS, 0);return true;
}CExchange::CExchange(LPCHARACTER pOwner)
{
m_pCompany = NULL;m_bAccept = false;
for (int i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
{
m_apItems = NULL;
m_aItemPos = NPOS;
m_abItemDisplayPos = 0;
}m_lGold = 0;
m_pOwner = pOwner;
pOwner->SetExchange(this);m_pGrid = M2_NEW CGrid(4,3);
}CExchange::~CExchange()
{
M2_DELETE(m_pGrid);
}bool CExchange::AddItem(TItemPos item_pos, BYTE display_pos)
{
assert(m_pOwner != NULL && GetCompany());if (!item_pos.IsValidItemPosition())
return false;// 장비는 교환할 수 없음
if (item_pos.IsEquipPosition())
return false;LPITEM item;
if (!(item = m_pOwner->GetItem(item_pos)))
return false;if ( int(m_pOwner->GetQuestFlag("BlockItem.Enable")) == 1 )
{
m_pOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("TEXT_HAPPINESS_02"));
return false;
}
if (IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_GIVE))
{
m_pOwner->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("아이템을 건네줄 수 없습니다."));
return false;
}if (true == item->isLocked())
{
return false;
}// 이미 교환창에 추가된 아이템인가?
if (item->IsExchanging())
{
sys_log(0, "EXCHANGE under exchanging");
return false;
}if (!m_pGrid->IsEmpty(display_pos, 1, item->GetSize()))
{
sys_log(0, "EXCHANGE not empty item_pos %d %d %d", display_pos, 1, item->GetSize());
return false;
}Accept(false);
GetCompany()->Accept(false);for (int i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
{
if (m_apItems)
continue;m_apItems = item;
m_aItemPos = item_pos;
m_abItemDisplayPos = display_pos;
m_pGrid->Put(display_pos, 1, item->GetSize());item->SetExchanging(true);
exchange_packet(m_pOwner,
EXCHANGE_SUBHEADER_GC_ITEM_ADD,
true,
item->GetVnum(),
TItemPos(RESERVED_WINDOW, display_pos),
item->GetCount(),
item);exchange_packet(GetCompany()->GetOwner(),
EXCHANGE_SUBHEADER_GC_ITEM_ADD,
false,
item->GetVnum(),
TItemPos(RESERVED_WINDOW, display_pos),
item->GetCount(),
item);sys_log(0, "EXCHANGE AddItem success %s pos(%d, %d) %d", item->GetName(), item_pos.window_type, item_pos.cell, display_pos);
return true;
}// 추가할 공간이 없음
return false;
}bool CExchange::RemoveItem(BYTE pos)
{
if (pos >= EXCHANGE_ITEM_MAX_NUM)
return false;if (!m_apItems[pos])
return false;TItemPos PosOfInventory = m_aItemPos[pos];
m_apItems[pos]->SetExchanging(false);m_pGrid->Get(m_abItemDisplayPos[pos], 1, m_apItems[pos]->GetSize());
exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_ITEM_DEL, true, pos, NPOS, 0);
exchange_packet(GetCompany()->GetOwner(), EXCHANGE_SUBHEADER_GC_ITEM_DEL, false, pos, PosOfInventory, 0);Accept(false);
GetCompany()->Accept(false);m_apItems[pos] = NULL;
m_aItemPos[pos] = NPOS;
m_abItemDisplayPos[pos] = 0;
return true;
}bool CExchange::AddGold(long gold)
{
if (gold <= 0)
return false;if (GetOwner()->GetGold() < gold)
{
// 가지고 있는 돈이 부족.
exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_LESS_GOLD, 0, 0, NPOS, 0);
return false;
}if ( LC_IsCanada() == true || LC_IsEurope() == true )
{
if ( m_lGold > 0 )
{
return false;
}
}Accept(false);
GetCompany()->Accept(false);m_lGold = gold;
exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_GOLD_ADD, true, m_lGold, NPOS, 0);
exchange_packet(GetCompany()->GetOwner(), EXCHANGE_SUBHEADER_GC_GOLD_ADD, false, m_lGold, NPOS, 0);
return true;
}// 돈이 충분히 있는지, 교환하려는 아이템이 실제로 있는지 확인 한다.
bool CExchange::Check(int * piItemCount)
{
if (GetOwner()->GetGold() < m_lGold)
return false;int item_count = 0;
for (int i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
{
if (!m_apItems)
continue;if (!m_aItemPos.IsValidItemPosition())
return false;if (m_apItems != GetOwner()->GetItem(m_aItemPos))
return false;++item_count;
}*piItemCount = item_count;
return true;
}bool CExchange::CheckSpace()
{
static CGrid s_grid1(5, INVENTORY_MAX_NUM / 5 / 2); // inven page 1 9 Rows a 5 Columns
static CGrid s_grid2(5, INVENTORY_MAX_NUM / 5 / 2); // inven page 2 9 Rows a 5 Columnss_grid1.Clear();
s_grid2.Clear();LPCHARACTER victim = GetCompany()->GetOwner();
LPITEM item;
int i;for (i = 0; i < INVENTORY_MAX_NUM / 2; ++i)
{
if (!(item = victim->GetInventoryItem(i)))
continue;s_grid1.Put(i, 1, item->GetSize());
}
for (i = INVENTORY_MAX_NUM / 2; i < INVENTORY_MAX_NUM; ++i)
{
if (!(item = victim->GetInventoryItem(i)))
continue;s_grid2.Put(i - INVENTORY_MAX_NUM / 2, 1, item->GetSize());
}static std::vector <WORD> s_vDSGrid(DRAGON_SOUL_INVENTORY_MAX_NUM);
bool bDSInitialized = false;
for (i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
{
if (!(item = m_apItems))
continue;BYTE itemSize = item->GetSize();
if (item->IsDragonSoul())
{
if (!victim->DragonSoul_IsQualified())
return false;if (!bDSInitialized) {
bDSInitialized = true;
victim->CopyDragonSoulItemGrid(s_vDSGrid);
}bool bExistEmptySpace = false;
WORD wBasePos = DSManager::instance().GetBasePosition(item);
if (wBasePos >= DRAGON_SOUL_INVENTORY_MAX_NUM)
return false;for (int i = 0; i < DRAGON_SOUL_BOX_SIZE; i++)
{
WORD wPos = wBasePos + i;
if (0 == s_vDSGrid[wBasePos])
{
bool bEmpty = true;
for (int j = 1; j < item->GetSize(); j++)
{
if (s_vDSGrid[wPos + j * DRAGON_SOUL_BOX_COLUMN_NUM])
{
bEmpty = false;
break;
}
}
if (bEmpty)
{
for (int j = 0; j < item->GetSize(); j++)
{
s_vDSGrid[wPos + j * DRAGON_SOUL_BOX_COLUMN_NUM] = wPos + 1;
}
bExistEmptySpace = true;
break;
}
}
if (bExistEmptySpace)
break;
}
if (!bExistEmptySpace)
return false;
}
else
{
int iPos = s_grid1.FindBlank(1, itemSize);
if (iPos >= 0) {
s_grid1.Put(iPos, 1, itemSize);
continue;
}iPos = s_grid2.FindBlank(1, itemSize);
if (iPos >= 0) {
s_grid2.Put(iPos, 1, itemSize);
continue;
}return false; // No space left in inventory
}
}return true;
}// 교환 끝 (아이템과 돈 등을 실제로 옮긴다)
bool CExchange::Done()
{
int empty_pos, i;
LPITEM item;LPCHARACTER victim = GetCompany()->GetOwner();
for (i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
{
if (!(item = m_apItems))
continue;if (item->IsDragonSoul())
empty_pos = victim->GetEmptyDragonSoulInventory(item);
else
empty_pos = victim->GetEmptyInventory(item->GetSize());if (empty_pos < 0)
{
sys_err("Exchange::Done : Cannot find blank position in inventory %s <-> %s item %s",
m_pOwner->GetName(), victim->GetName(), item->GetName());
continue;
}assert(empty_pos >= 0);
if (item->GetVnum() == 90008 || item->GetVnum() == 90009) // VCARD
{
VCardUse(m_pOwner, victim, item);
continue;
}m_pOwner->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), 255);
item->RemoveFromCharacter();
if (item->IsDragonSoul())
item->AddToCharacter(victim, TItemPos(DRAGON_SOUL_INVENTORY, empty_pos));
else
item->AddToCharacter(victim, TItemPos(INVENTORY, empty_pos));
ITEM_MANAGER::instance().FlushDelayedSave(item);item->SetExchanging(false);
{
char exchange_buf[51];snprintf(exchange_buf, sizeof(exchange_buf), "%s %u %u", item->GetName(), GetOwner()->GetPlayerID(), item->GetCount());
LogManager::instance().ItemLog(victim, item, "EXCHANGE_TAKE", exchange_buf);snprintf(exchange_buf, sizeof(exchange_buf), "%s %u %u", item->GetName(), victim->GetPlayerID(), item->GetCount());
LogManager::instance().ItemLog(GetOwner(), item, "EXCHANGE_GIVE", exchange_buf);if (item->GetVnum() >= 80003 && item->GetVnum() <= 80007)
{
LogManager::instance().GoldBarLog(victim->GetPlayerID(), item->GetID(), EXCHANGE_TAKE, "");
LogManager::instance().GoldBarLog(GetOwner()->GetPlayerID(), item->GetID(), EXCHANGE_GIVE, "");
}
}m_apItems = NULL;
}if (m_lGold)
{
GetOwner()->PointChange(POINT_GOLD, -m_lGold, true);
victim->PointChange(POINT_GOLD, m_lGold, true);if (m_lGold > 1000)
{
char exchange_buf[51];
snprintf(exchange_buf, sizeof(exchange_buf), "%u %s", GetOwner()->GetPlayerID(), GetOwner()->GetName());
LogManager::instance().CharLog(victim, m_lGold, "EXCHANGE_GOLD_TAKE", exchange_buf);snprintf(exchange_buf, sizeof(exchange_buf), "%u %s", victim->GetPlayerID(), victim->GetName());
LogManager::instance().CharLog(GetOwner(), m_lGold, "EXCHANGE_GOLD_GIVE", exchange_buf);
}
}m_pGrid->Clear();
return true;
}// 교환을 동의
bool CExchange::Accept(bool bAccept)
{
if (m_bAccept == bAccept)
return true;m_bAccept = bAccept;
// 둘 다 동의 했으므로 교환 성립
if (m_bAccept && GetCompany()->m_bAccept)
{
int iItemCount;LPCHARACTER victim = GetCompany()->GetOwner();
//PREVENT_PORTAL_AFTER_EXCHANGE
GetOwner()->SetExchangeTime();
victim->SetExchangeTime();
//END_PREVENT_PORTAL_AFTER_EXCHANGE// exchange_check 에서는 교환할 아이템들이 제자리에 있나 확인하고,
// 엘크도 충분히 있나 확인한다, 두번째 인자로 교환할 아이템 개수
// 를 리턴한다.
if (!Check(&iItemCount))
{
GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("돈이 부족하거나 아이템이 제자리에 없습니다."));
victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방의 돈이 부족하거나 아이템이 제자리에 없습니다."));
goto EXCHANGE_END;
}// 리턴 받은 아이템 개수로 상대방의 소지품에 남은 자리가 있나 확인한다.
if (!CheckSpace())
{
GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방의 소지품에 빈 공간이 없습니다."));
victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소지품에 빈 공간이 없습니다."));
goto EXCHANGE_END;
}// 상대방도 마찬가지로..
if (!GetCompany()->Check(&iItemCount))
{
victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("돈이 부족하거나 아이템이 제자리에 없습니다."));
GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방의 돈이 부족하거나 아이템이 제자리에 없습니다."));
goto EXCHANGE_END;
}if (!GetCompany()->CheckSpace())
{
victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방의 소지품에 빈 공간이 없습니다."));
GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소지품에 빈 공간이 없습니다."));
goto EXCHANGE_END;
}if (db_clientdesc->GetSocket() == INVALID_SOCKET)
{
sys_err("Cannot use exchange feature while DB cache connection is dead.");
victim->ChatPacket(CHAT_TYPE_INFO, "Unknown error");
GetOwner()->ChatPacket(CHAT_TYPE_INFO, "Unknown error");
goto EXCHANGE_END;
}if (Done())
{
if (m_lGold) // 돈이 있을 만 저장
GetOwner()->Save();if (GetCompany()->Done())
{
if (GetCompany()->m_lGold) // 돈이 있을 때만 저장
victim->Save();// INTERNATIONAL_VERSION
GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s 님과의 교환이 성사 되었습니다."), victim->GetName());
victim->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("%s 님과의 교환이 성사 되었습니다."), GetOwner()->GetName());
// END_OF_INTERNATIONAL_VERSION
}
}EXCHANGE_END:
Cancel();
return false;
}
else
{
// 아니면 accept에 대한 패킷을 보내자.
exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_ACCEPT, true, m_bAccept, NPOS, 0);
exchange_packet(GetCompany()->GetOwner(), EXCHANGE_SUBHEADER_GC_ACCEPT, false, m_bAccept, NPOS, 0);
return true;
}
}// 교환 취소
void CExchange::Cancel()
{
exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_END, 0, 0, NPOS, 0);
GetOwner()->SetExchange(NULL);for (int i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
{
if (m_apItems)
m_apItems->SetExchanging(false);
}if (GetCompany())
{
GetCompany()->SetCompany(NULL);
GetCompany()->Cancel();
}M2_DELETE(this);
}*Note that i dont have extented spaces for the exchange dialog. Is the default 12 sockets exchange.
-
I dont have this bug on my server. If you want i can give you my exchange.cpp file.
-
Hi. I want to add max 3 bonuses on some items.
I found in char_item.cpp this function:
case USE_ADD_ATTRIBUTE :
[]...[]
if (item2->GetAttributeCount() < 4) { // 연재가 특수처리 // 절대로 연재가 추가 안될거라 하여 하드 코딩함. if (item->GetVnum() == 71152 || item->GetVnum() == 76024) { if ((item2->GetType() == ITEM_WEAPON) || (item2->GetType() == ITEM_ARMOR && item2->GetSubType() == ARMOR_BODY)) { bool bCanUse = true; for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i) { if (item2->GetLimitType(i) == LIMIT_LEVEL && item2->GetLimitValue(i) > 40) { bCanUse = false; break; } } if (false == bCanUse) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("적용 레벨보다 높아 사용이 불가능합니다.")); break; } } else { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("무기와 갑옷에만 사용 가능합니다.")); break; } } char buf[21]; snprintf(buf, sizeof(buf), "%u", item2->GetID()); item2->AddAttribute(); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("속성 추가에 성공하였습니다.")); int iAddedIdx = item2->GetAttributeCount() - 1; LogManager::instance().ItemLog( GetPlayerID(), item2->GetAttributeType(iAddedIdx), item2->GetAttributeValue(iAddedIdx), item->GetID(), "ADD_ATTRIBUTE2_SUCCESS", buf, GetDesc()->GetHostName(), item->GetOriginalVnum()); item->SetCount(item->GetCount() - 1); } else { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("더이상 이 아이템을 이용하여 속성을 추가할 수 없습니다.")); }
I saw in the funcions above the line
if (item2->GetAttributeCount() < 4) {
so i adapted a funcions which looks like this
if (item2->GetVnum() == 19060) { if (item2->GetAttributeCount() < 3) { // 연재가 특수처리 // 절대로 연재가 추가 안될거라 하여 하드 코딩함. char buf[21]; snprintf(buf, sizeof(buf), "%u", item2->GetID()); item2->AddAttribute(); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("속성 추가에 성공하였습니다.")); int iAddedIdx = item2->GetAttributeCount() - 1; LogManager::instance().ItemLog( GetPlayerID(), item2->GetAttributeType(iAddedIdx), item2->GetAttributeValue(iAddedIdx), item->GetID(), "ADD_ATTRIBUTE2_SUCCESS", buf, GetDesc()->GetHostName(), item->GetOriginalVnum()); item->SetCount(item->GetCount() - 1); } else { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("더이상 이 아이템을 이용하여 속성을 추가할 수 없습니다.")); } } else { if (item2->GetAttributeCount() < 4) { // 연재가 특수처리 // 절대로 연재가 추가 안될거라 하여 하드 코딩함. if (item->GetVnum() == 71152 || item->GetVnum() == 76024) { if ((item2->GetType() == ITEM_WEAPON) || (item2->GetType() == ITEM_ARMOR && item2->GetSubType() == ARMOR_BODY)) { bool bCanUse = true; for (int i = 0; i < ITEM_LIMIT_MAX_NUM; ++i) { if (item2->GetLimitType(i) == LIMIT_LEVEL && item2->GetLimitValue(i) > 40) { bCanUse = false; break; } } if (false == bCanUse) { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("적용 레벨보다 높아 사용이 불가능합니다.")); break; } } else { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("무기와 갑옷에만 사용 가능합니다.")); break; } } char buf[21]; snprintf(buf, sizeof(buf), "%u", item2->GetID()); item2->AddAttribute(); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("속성 추가에 성공하였습니다.")); int iAddedIdx = item2->GetAttributeCount() - 1; LogManager::instance().ItemLog( GetPlayerID(), item2->GetAttributeType(iAddedIdx), item2->GetAttributeValue(iAddedIdx), item->GetID(), "ADD_ATTRIBUTE2_SUCCESS", buf, GetDesc()->GetHostName(), item->GetOriginalVnum()); item->SetCount(item->GetCount() - 1); } else { ChatPacket(CHAT_TYPE_INFO, LC_TEXT("더이상 이 아이템을 이용하여 속성을 추가할 수 없습니다.")); } }
Soo, now when i add bonuses on the item with vnum 19060, should be added only 3 bonuses.
The only problem i have is that this just dont work.
Did someone have any ideas?
Thanks and sorry for my bad english.
-
Hi. I want to limit the max number of bonuses on an item.
Let's say you can add on an item 4 bonuses (without marble). How i can limit that to max 3 bonuses? Thanks.
-
-
-
Post uiMesenger line 318.
-
-
Hi. Im almost sure i saw somewhere a tutorial to see the full OX question.
Did someone know how?
-
As i sayd, you have to destroy metins for the books. I checked by IP and he has only one account. Event if he had from somewhere all the books and SS, he cant have 3 skills M at level 38. You have to have level 51 for 3 skills M.
-
Hi guys. A player from my server had 3 skills P at level 38. Note that on my server the skillbooks and SS needs to be farmed and he has only 400 minutes gameplay.
What can be the problem? I found this on YT but my launcher is encrypted with mpress.
Thanks.
EDIT: He also had unlimited CD on Charge skill.
-
Note that item_proto and mob_proto have their own LZO key, separate from Index/Pack keys. Also be sure you edited the headers aswell. MCOZ, EPKD, etc.
-
Hi guys. On monday im gonna buy a VPS to install my server on IT. The problem is that i never installed a server on a VPS from 0.
Until now, i buy a VPS with metin2 server on it and all i do is to rm -rf game and install mine (same with mysql).
Can someone give me a tutorial how to install metin2 server on a fresh FreeBSD VPS?
Thanks.
-
Hi guys. I have a problem on the server. The ores dont spawn in any map.
Where is the function that should spwan the ores?
Thanks.
-
-
Thank you soo much guys. I upgraded to 2GB and all looks good. I have 1GB free.
I was not sure if the Mem tab refers to the RAM memory. Im very new in FreeBSD and who knows to what memory was refering to...
Thanks you agian. Problem solved.
-
Hi guys. I have a problem with my server. Sometimes i get extreme lag and i get in syserr "heart_idle: losing x seconds. (lag occured)".
I tryed to look into this problem and using the "top" command i saw that this problem happens when Free memory tab is very low.
I attached a photo to understand better what i talk about.
Now is 15MB and the server runs fine (even if still very low memory), but sometimes the Free memory drops at about 3KB and i get lag.
Now, i want to know in first place if this is reffering to the RAM memory and not some virtual memory and secound, how i can solve the problem?
The RAM memory from the host is 1GB (at least that's what they say).
Thanks and sorry for my bad english.
-
Hm... I wonder where they have the ox map (113). I put your MAP ALLOW in my game99 and ox map dont work. (i put everythng from game99 in channel1 (split per cores) .
-
No man. I dont want to use blessing scrolls as an upgrade item. I want to USE the blessing scroll to make them +.
Exactly how you use the blessing scroll for an armour for example.
I dont want the players to lose the stone.
-
I did this ma friend. I can make stones + at blacksmith.
I want to make them + with Blessing Scroll.
-
-
Trade Bug
in Community Support - Questions & Answers
Posted
Is about the Aceept function. Not the CheckSpace.