-
Posts
217 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by ‚Point‘
-
-
i think there should be a client part to?
For effect
- 1
-
Yes i know
-
In Item proto is only one "Skillbook"
-
i dont think so.
This have nothing to do with the system at all because this should be clientside to change. (I think so)
-
Hi guys!
Im looking for a nice Pet System to buy.
Maybe like Official, maybe like WoM or maybe complet new.
Just PN me.Nice Regards
-
Hi guys!
Someone know how to set exact name from skillbooks & polymoph marble?
Nice Regards
-
I would pay nice!
Search and Developer for something like this:
-
Yes i did already, but if i want to open Costume Inventory it closes...
EDIT: fixxed
-
i cant remember anymore, thats the problem..
Someone got time to look via Teamviewer maybe? My Skype: -EDIT-
-
i doesnt did it by my self so i cant help you - sorry!
-
worked, thank you!
-
Hi guys!
I got Item-swap like this:https://metin2.download/picture/1efj0IEC75Z6ktKtR9keBBS2F4V4GG2E/.gif
i want to change the red background, how can i do this?
Nice Regards -
Hi guys!
I wanted to remove Belt inventory. Now i got Problem, that client closes if i want to open the Costume Inventory.
Client syserr:
SpoileruiInventory.py(line:192) __LoadWindow
ui.py(line:2711) GetChildCostumeWindow.LoadWindow.BindObject - <type 'exceptions.KeyError'>:'BeltInventorySlot'
0104 19:27:08461 :: ============================================================================================================
0104 19:27:08461 :: Abort!!!!Some help would be nice
-
Maybe someone got new SQL fetch link?
Its doesnt work any more...Edit: Just got an Problem with DNS , already fixxed
-
I want that if i use Command "/ip" it only clears my 5 inventory pages and not my equip i wear.
Someone know how to make that? -
I got it fixxed. Thx for help
-
I did but i still go this "empty place" between Level & Price...
https://metin2.download/picture/bfqYKwz7ZKB1wk80Hj24n2RiLBH0VHQh/.pngDoes someone know, how to make break in Itemdesc.txt so there is an break ingame too?
-
-
Hi Guys!
I got a bug in Belt inventory. I just did a video to show:
https://youtu.be/dI9huqFCNE8If someone know how to fix it would be nice.
Other way, if someone know how to remove this inventory, it would be okay tooNice Regards & Happy New Year!
EDIT: I removed it. Pls close
-
28 minutes ago, Shisui said:
Add the lines in itemdesc.txt with their id and descripton, if you want.
Why i have to do this? Which lines?
Can i remove the following empty place?
https://metin2.download/picture/6RxV1U85Qr1sK0jagDOfbo0P9ASo3Wz2/.png
-
Thx. What you mean with "add them to itemdesc".?
-
I got following bug by selling "Taus" in Shop.
There is no time, just this "BLEND_POTION_NO_TIME"Help would be nice.
Nice Regards
-
please help
-
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, const TItemPos &arg2, DWORD arg3, void * pvData = NULL);
// ¡¾©©?? ?©¢?¢Ò
void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, DWORD arg1, const 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) // ?U¡¾a ?U¢©?¡Æu¢¥A ¡¾©©???¡í ¢¬?C?¢¥?.
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())
{
ChatPacket( CHAT_TYPE_INFO, LC_TEXT("´Ù¸¥ °Å·¡Ã¢ÀÌ ¿·ÁÀÖÀ»°æ¿ì °Å·¡¸¦ ÇÒ¼ö ¾ø½À´Ï´Ù." ) );
return false;
}if ( victim->IsOpenSafebox() || victim->GetShopOwner() || victim->GetMyShop() || victim->IsCubeOpen() || victim->GetOfflineShopOwner())
{
ChatPacket( CHAT_TYPE_INFO, LC_TEXT("»ó´ë¹æÀÌ ´Ù¸¥ °Å·¡ÁßÀ̶ó °Å·¡¸¦ ÇÒ¼ö ¾ø½À´Ï´Ù." ) );
return false;
}
#else
if (IsOpenSafebox() || GetShopOwner() || GetMyShop() || IsCubeOpen())
{
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("´Ù¸¥ °Å·¡Ã¢ÀÌ ¿·ÁÀÖÀ»°æ¿ì °Å·¡¸¦ ÇÒ¼ö ¾ø½À´Ï´Ù."));
return false;
}if (victim->IsOpenSafebox() || victim->GetShopOwner() || victim->GetMyShop() || victim->IsCubeOpen())
{
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(8,4);
}CExchange::~CExchange()
{
M2_DELETE(m_pGrid);
}bool CExchange::AddItem(const TItemPos &item_pos, BYTE display_pos)
{
assert(m_pOwner != NULL && GetCompany());if (!item_pos.IsValidItemPosition())
return false;// ????¢¥A ¡¾©©??C? ?o ???¢©
if (item_pos.IsEquipPosition())
return false;LPITEM item;
if (!(item = m_pOwner->GetItem(item_pos)))
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;
}
// ???? ¡¾©©???¢¨?¢§ ?©¬¡Æ¢§¥ì? ???????I¡Æ¢§?
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;
}// ?©¬¡Æ¢§C? ¡Æ?¡Æ¨©?? ???¢©
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 long gold)
{
if (gold <= 0)
return false;if (GetOwner()->GetGold() < gold)
{
// ¡Æ¢§Ao¡Æi ?O¢¥A ¥ì¡¤?? ?IA¡¤.
exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_LESS_GOLD, 0, 0, NPOS, 0);
return false;
}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;
}// ¥ì¡¤?? ???©¢?¡À ?O¢¥AAo, ¡¾©©??C?¡¤A¢¥A ???????? ¢©CA|¡¤I ?O¢¥AAo ?¢ç?I C?¢¥?.
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 / 5); // inven page 1
static CGrid s_grid2(5, INVENTORY_MAX_NUM/5 / 5); // inven page 2
static CGrid s_grid3(5, INVENTORY_MAX_NUM/5 / 5); // inven page 3
static CGrid s_grid4(5, INVENTORY_MAX_NUM/5 / 5); // inven page 4
static CGrid s_grid5(5, INVENTORY_MAX_NUM/5 / 5); // inven page 5
s_grid1.Clear();
s_grid2.Clear();
s_grid3.Clear();
s_grid4.Clear();
s_grid5.Clear();LPCHARACTER victim = GetCompany()->GetOwner();
LPITEM item;int i;
for (i = 0; i < INVENTORY_MAX_NUM / 5; ++i)
{
if (!(item = victim->GetInventoryItem(i)))
continue;
s_grid1.Put(i, 1, item->GetSize());
}
for (i = INVENTORY_MAX_NUM / 5; i < (INVENTORY_MAX_NUM / 5) * 2; ++i)
{
if (!(item = victim->GetInventoryItem(i)))
continue;
s_grid2.Put(i - INVENTORY_MAX_NUM / 5, 1, item->GetSize());
}
for (i = (INVENTORY_MAX_NUM / 5) * 2; i < (INVENTORY_MAX_NUM / 5) * 3; ++i)
{
if (!(item = victim->GetInventoryItem(i)))
continue;
s_grid3.Put(i - (INVENTORY_MAX_NUM / 5) * 2, 1, item->GetSize());
}
for (i = (INVENTORY_MAX_NUM / 5) * 3; i < (INVENTORY_MAX_NUM / 5) * 4; ++i)
{
if (!(item = victim->GetInventoryItem(i)))
continue;
s_grid4.Put(i -(INVENTORY_MAX_NUM / 5) * 3, 1, item->GetSize());
}
for (i = (INVENTORY_MAX_NUM / 5) * 4; i < (INVENTORY_MAX_NUM / 5) * 5; ++i)
{
if (!(item = victim->GetInventoryItem(i)))
continue;
s_grid5.Put(i - (INVENTORY_MAX_NUM / 5) * 4, 1, item->GetSize());
}// ??... ??¡Æ¢§ ¡Æ©©?¢¥¢©? ¡Æ¡ÆAo¢¬¢¬... ?e???¢ç ?I???¡í ©©e¢¬O ?I?? ?¢¬¡Æi ¥ì?¢Òo ¢¬¢¬¥ìc ©©¡í ?©¬¢¬???¢¥? ¢´©¢¢´©¢
static std::vector <WORD> s_vDSGrid(DRAGON_SOUL_INVENTORY_MAX_NUM);
// ??¢¥U ?e???¢ç?¡í ¡¾©©??C?Ao ???¡í ¡Æ¢§¢¥E???? ?¨Ï?C¡¤I, ?e???¢ç ?I?? ??¡íc¢¥A ?e???¢ç?? ?O?¡í ¢Ò¡× C?¥ì¥ì¡¤? C?¢¥?.
bool bDSInitialized = false;
for (i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
{
if (!(item = m_apItems))
continue;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, item->GetSize());
if (iPos >= 0)
{
s_grid1.Put(iPos, 1, item->GetSize());
}
else
{
iPos = s_grid2.FindBlank(1, item->GetSize());
if (iPos >= 0)
{
s_grid2.Put(iPos, 1, item->GetSize());
}
else
{
iPos = s_grid3.FindBlank(1, item->GetSize());
if (iPos >= 0)
{
s_grid3.Put(iPos, 1, item->GetSize());
}
else
{
iPos = s_grid4.FindBlank(1, item->GetSize());
if (iPos >= 0)
{
s_grid4.Put(iPos, 1, item->GetSize());
}
else
{
iPos = s_grid5.FindBlank(1, item->GetSize());
if (iPos >= 0)
{
s_grid5.Put(iPos, 1, item->GetSize());
}
else
{
return false;
}
}
}
}
}
}
}
return true;
}
#include "config.h"
// ¡¾©©?? ©©¢§ (??????¡Æu ¥ì¡¤ ¥ìi?¡í ¢©CA|¡¤I ??¡¾a¢¥?)
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)
{
return false;
}
}
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)
{
return false;
}assert(empty_pos >= 0);
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;
}// ¡¾©©???¡í ¥ì??C
bool CExchange::Accept(bool bAccept)
{
if (m_bAccept == bAccept)
return true;m_bAccept = bAccept;
// ¥ì? ¢¥? ¥ì??C C©¬?¢¬?C¡¤I ¡¾©©?? ??¢¬©©
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 ?¢§?¡©¢¥A ¡¾©©??C? ??????¥ìe?? A|?U¢¬¢ç?¢§ ?O©©? ?¢ç?IC?¡Æi,
// ?¢´?¨Ï¥ì¥ì ???©¢?¡À ?O©©? ?¢ç?IC?¢¥?, ¥ìI??A¡Æ ?I?U¡¤I ¡¾©©??C? ?????? ¡Æ©©?o
// ¢¬| ¢¬¢ç??C?¢¥?.
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;
}// ¡ío¢¥e??¥ì¥ì ¢¬¢ÒA?¡Æ¢§Ao¡¤I..
// »ó´ë¹æµµ ¸¶Âù°¡Áö·Î..
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
{
// ??¢¥?¢¬e accept?¢§ ¢¥eC? ?©¢?¢Ò?¡í ?¢¬©©¡í?U.
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;
}
}// ¡¾©©?? ?e??
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);
}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 = 32,
EXCHANGE_MAX_DISTANCE = 1000
};class CExchange
{
public:
CExchange(LPCHARACTER pOwner);
~CExchange();bool Accept(bool bIsAccept = true);
void Cancel();bool AddGold(long long lGold);
bool AddItem(const 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; // ¡ío¢¥e???C CExchange ?¡À?I?ILPCHARACTER 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 long m_lGold;CGrid * m_pGrid;
};
#endif
Exchange System like WoM
in Paid Support / Searching / Recruiting
Posted
still looking for someone who can made this...