game: port AVA2 Won (cheque) currency
Won point (quest flag cheque.points, max 999), /won_exchange sell|buy N at 100,000,000 Yang per Won, Won in trades and private shop prices (int32 cheque[] after the CG_MYSHOP items for clients >= mt20261027). The Won point is sent again at Entergame because the quest-load update arrives before PHASE_GAME. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f5b8424266
commit
103805998c
@@ -61,7 +61,7 @@ CPPFILE = port_cube_actor.cpp port_cube_recovery.cpp port_cube_factory.cpp port_
|
|||||||
desc_client.cpp desc_manager.cpp desc_p2p.cpp dev_log.cpp dungeon.cpp empire_text_convert.cpp entity.cpp\
|
desc_client.cpp desc_manager.cpp desc_p2p.cpp dev_log.cpp dungeon.cpp empire_text_convert.cpp entity.cpp\
|
||||||
entity_view.cpp event.cpp event_queue.cpp exchange.cpp file_loader.cpp fishing.cpp gm.cpp guild.cpp\
|
entity_view.cpp event.cpp event_queue.cpp exchange.cpp file_loader.cpp fishing.cpp gm.cpp guild.cpp\
|
||||||
guild_manager.cpp guild_war.cpp horse_rider.cpp horsename_manager.cpp input.cpp input_auth.cpp input_db.cpp\
|
guild_manager.cpp guild_war.cpp horse_rider.cpp horsename_manager.cpp input.cpp input_auth.cpp input_db.cpp\
|
||||||
input_login.cpp input_main.cpp input_p2p.cpp port_boss_track.cpp ava2_channel.cpp new_mob_timer.cpp ava2_track.cpp ava2_ticket_shop.cpp ava2_itemshop.cpp port_attr_lock.cpp port_sash.cpp port_mount.cpp port_costume_attr.cpp port_pendant.cpp port_rings.cpp port_switchbot.cpp port_special_storage.cpp offline_shop.cpp offlineshop_manager.cpp offlineshop_search_manager.cpp port_offlineshop.cpp port_ava2_dungeon.cpp port_gaya.cpp port_economy.cpp input_teen.cpp input_udp.cpp ip_ban.cpp\
|
input_login.cpp input_main.cpp input_p2p.cpp port_boss_track.cpp ava2_channel.cpp new_mob_timer.cpp ava2_track.cpp ava2_ticket_shop.cpp ava2_itemshop.cpp port_attr_lock.cpp port_sash.cpp port_mount.cpp port_costume_attr.cpp port_pendant.cpp port_rings.cpp port_switchbot.cpp port_special_storage.cpp offline_shop.cpp offlineshop_manager.cpp offlineshop_search_manager.cpp port_offlineshop.cpp port_ava2_dungeon.cpp port_gaya.cpp port_cheque.cpp port_economy.cpp input_teen.cpp input_udp.cpp ip_ban.cpp\
|
||||||
item.cpp item_addon.cpp item_attribute.cpp item_manager.cpp item_manager_idrange.cpp locale.cpp\
|
item.cpp item_addon.cpp item_attribute.cpp item_manager.cpp item_manager_idrange.cpp locale.cpp\
|
||||||
locale_service.cpp log.cpp login_data.cpp lzo_manager.cpp marriage.cpp matrix_card.cpp\
|
locale_service.cpp log.cpp login_data.cpp lzo_manager.cpp marriage.cpp matrix_card.cpp\
|
||||||
messenger_manager.cpp mining.cpp mob_manager.cpp monarch.cpp motion.cpp over9refine.cpp p2p.cpp packet_info.cpp\
|
messenger_manager.cpp mining.cpp mob_manager.cpp monarch.cpp motion.cpp over9refine.cpp p2p.cpp packet_info.cpp\
|
||||||
|
|||||||
@@ -75,6 +75,7 @@
|
|||||||
#include "item.h"
|
#include "item.h"
|
||||||
#include "port_quiver.h"
|
#include "port_quiver.h"
|
||||||
#include "port_quiver_sync.inc"
|
#include "port_quiver_sync.inc"
|
||||||
|
#include "port_cheque.h"
|
||||||
|
|
||||||
extern const BYTE g_aBuffOnAttrPoints;
|
extern const BYTE g_aBuffOnAttrPoints;
|
||||||
extern bool RaceToJob(unsigned race, unsigned *ret_job);
|
extern bool RaceToJob(unsigned race, unsigned *ret_job);
|
||||||
@@ -614,7 +615,7 @@ const char * CHARACTER::GetName() const
|
|||||||
return m_stName.empty() ? (m_pkMobData ? m_pkMobData->m_table.szLocaleName : "") : m_stName.c_str();
|
return m_stName.empty() ? (m_pkMobData ? m_pkMobData->m_table.szLocaleName : "") : m_stName.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, BYTE bItemCount)
|
void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, BYTE bItemCount, const int32_t * pCheque)
|
||||||
{
|
{
|
||||||
if (GetPart(PART_MAIN) > 2)
|
if (GetPart(PART_MAIN) > 2)
|
||||||
{
|
{
|
||||||
@@ -643,7 +644,9 @@ void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, BYTE
|
|||||||
for (int n = 0; n < bItemCount; ++n)
|
for (int n = 0; n < bItemCount; ++n)
|
||||||
{
|
{
|
||||||
const int64_t price = pTable[n].price;
|
const int64_t price = pTable[n].price;
|
||||||
if (price <= 0 || !PortGoldCanChange(nTotalMoney, price, GOLD_MAX_64))
|
const int32_t cheque = pCheque ? pCheque[n] : 0; // PORT: Won price, may stand alone
|
||||||
|
if (price < 0 || cheque < 0 || cheque > CHEQUE_MAX || (price == 0 && cheque == 0) ||
|
||||||
|
!PortGoldCanChange(nTotalMoney, price, GOLD_MAX_64))
|
||||||
{
|
{
|
||||||
ChatPacket(CHAT_TYPE_INFO, "Invalid shop price or gold limit exceeded.");
|
ChatPacket(CHAT_TYPE_INFO, "Invalid shop price or gold limit exceeded.");
|
||||||
return;
|
return;
|
||||||
@@ -779,7 +782,7 @@ void CHARACTER::OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, BYTE
|
|||||||
|
|
||||||
PacketAround(&p, sizeof(TPacketGCShopSign));
|
PacketAround(&p, sizeof(TPacketGCShopSign));
|
||||||
|
|
||||||
m_pkMyShop = CShopManager::instance().CreatePCShop(this, pTable, bItemCount);
|
m_pkMyShop = CShopManager::instance().CreatePCShop(this, pTable, bItemCount, pCheque);
|
||||||
|
|
||||||
if (IsPolymorphed() == true)
|
if (IsPolymorphed() == true)
|
||||||
{
|
{
|
||||||
@@ -2331,6 +2334,7 @@ void CHARACTER::ComputePoints()
|
|||||||
{
|
{
|
||||||
long lStat = GetPoint(POINT_STAT);
|
long lStat = GetPoint(POINT_STAT);
|
||||||
const int lGem=GetPoint(POINT_GEM);
|
const int lGem=GetPoint(POINT_GEM);
|
||||||
|
const int lCheque=GetPoint(POINT_CHEQUE);
|
||||||
long lStatResetCount = GetPoint(POINT_STAT_RESET_COUNT);
|
long lStatResetCount = GetPoint(POINT_STAT_RESET_COUNT);
|
||||||
long lSkillActive = GetPoint(POINT_SKILL);
|
long lSkillActive = GetPoint(POINT_SKILL);
|
||||||
long lSkillSub = GetPoint(POINT_SUB_SKILL);
|
long lSkillSub = GetPoint(POINT_SUB_SKILL);
|
||||||
@@ -2353,6 +2357,7 @@ void CHARACTER::ComputePoints()
|
|||||||
|
|
||||||
SetPoint(POINT_STAT, lStat);
|
SetPoint(POINT_STAT, lStat);
|
||||||
SetPoint(POINT_GEM,lGem);
|
SetPoint(POINT_GEM,lGem);
|
||||||
|
SetPoint(POINT_CHEQUE,lCheque);
|
||||||
SetPoint(POINT_SKILL, lSkillActive);
|
SetPoint(POINT_SKILL, lSkillActive);
|
||||||
SetPoint(POINT_SUB_SKILL, lSkillSub);
|
SetPoint(POINT_SUB_SKILL, lSkillSub);
|
||||||
SetPoint(POINT_HORSE_SKILL, lSkillHorse);
|
SetPoint(POINT_HORSE_SKILL, lSkillHorse);
|
||||||
@@ -3461,6 +3466,11 @@ void CHARACTER::PointChange(BYTE type, int64_t amount, bool bAmount, bool bBroad
|
|||||||
val=GetPoint(type);
|
val=GetPoint(type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case POINT_CHEQUE: // display only: PortChequeChange owns the balance
|
||||||
|
if(amount)return;
|
||||||
|
val=GetPoint(type);
|
||||||
|
break;
|
||||||
|
|
||||||
case POINT_GOLD:
|
case POINT_GOLD:
|
||||||
{
|
{
|
||||||
if (!PortGoldCanChange(GetGold(),amount,GOLD_MAX_64)) {
|
if (!PortGoldCanChange(GetGold(),amount,GOLD_MAX_64)) {
|
||||||
|
|||||||
@@ -293,6 +293,7 @@ enum EPointTypes
|
|||||||
POINT_ENCHANT_EARTH = 246,
|
POINT_ENCHANT_EARTH = 246,
|
||||||
POINT_ENCHANT_DARK = 247,
|
POINT_ENCHANT_DARK = 247,
|
||||||
POINT_GEM = 248,
|
POINT_GEM = 248,
|
||||||
|
POINT_CHEQUE = 249, // PORT: Won, mirrored from quest flag cheque.points
|
||||||
POINT_RESIST_HUMAN = 220,
|
POINT_RESIST_HUMAN = 220,
|
||||||
POINT_RESIST_MAGIC_REDUCTION = 144, // AVA2 attacker's magic resistance reduction.
|
POINT_RESIST_MAGIC_REDUCTION = 144, // AVA2 attacker's magic resistance reduction.
|
||||||
|
|
||||||
@@ -1289,7 +1290,7 @@ class CHARACTER : public CEntity, public CFSM, public CHorseRider
|
|||||||
void SetShopOwner(LPCHARACTER ch) { m_pkChrShopOwner = ch; }
|
void SetShopOwner(LPCHARACTER ch) { m_pkChrShopOwner = ch; }
|
||||||
LPCHARACTER GetShopOwner() const { return m_pkChrShopOwner;}
|
LPCHARACTER GetShopOwner() const { return m_pkChrShopOwner;}
|
||||||
|
|
||||||
void OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, BYTE bItemCount);
|
void OpenMyShop(const char * c_pszSign, TShopItemTable * pTable, BYTE bItemCount, const int32_t * pCheque = NULL);
|
||||||
LPSHOP GetMyShop() const { return m_pkMyShop; }
|
LPSHOP GetMyShop() const { return m_pkMyShop; }
|
||||||
void CloseMyShop();
|
void CloseMyShop();
|
||||||
|
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ ACMD (do_dragon_soul);
|
|||||||
ACMD (do_ds_list);
|
ACMD (do_ds_list);
|
||||||
ACMD (do_clear_affect);
|
ACMD (do_clear_affect);
|
||||||
ACMD(do_gem);
|
ACMD(do_gem);
|
||||||
|
ACMD(do_won_exchange);
|
||||||
ACMD(do_mt_economy);
|
ACMD(do_mt_economy);
|
||||||
|
|
||||||
ACMD(do_ishop);
|
ACMD(do_ishop);
|
||||||
@@ -655,6 +656,7 @@ struct command_info cmd_info[] =
|
|||||||
#endif
|
#endif
|
||||||
{ "mt_economy", do_mt_economy, 0, POS_DEAD, GM_PLAYER },
|
{ "mt_economy", do_mt_economy, 0, POS_DEAD, GM_PLAYER },
|
||||||
{ "gem", do_gem, 0, POS_DEAD, GM_PLAYER },
|
{ "gem", do_gem, 0, POS_DEAD, GM_PLAYER },
|
||||||
|
{ "won_exchange", do_won_exchange, 0, POS_DEAD, GM_PLAYER },
|
||||||
{ "\n", NULL, 0, POS_DEAD, GM_IMPLEMENTOR } /* 반드시 이 것이 마지막이어야 한다. */
|
{ "\n", NULL, 0, POS_DEAD, GM_IMPLEMENTOR } /* 반드시 이 것이 마지막이어야 한다. */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "../../common/length.h"
|
#include "../../common/length.h"
|
||||||
#include "exchange.h"
|
#include "exchange.h"
|
||||||
#include "DragonSoul.h"
|
#include "DragonSoul.h"
|
||||||
|
#include "port_cheque.h"
|
||||||
|
|
||||||
void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, int64_t arg1, TItemPos arg2, DWORD arg3, void * pvData = NULL);
|
void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, int64_t arg1, TItemPos arg2, DWORD arg3, void * pvData = NULL);
|
||||||
|
|
||||||
@@ -124,6 +125,7 @@ CExchange::CExchange(LPCHARACTER pOwner)
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_lGold = 0;
|
m_lGold = 0;
|
||||||
|
m_lCheque = 0;
|
||||||
|
|
||||||
m_pOwner = pOwner;
|
m_pOwner = pOwner;
|
||||||
pOwner->SetExchange(this);
|
pOwner->SetExchange(this);
|
||||||
@@ -275,6 +277,35 @@ bool CExchange::AddGold(int64_t gold)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PORT: Won offer; both sides need a Won-aware client (an old one would never see it).
|
||||||
|
bool CExchange::AddCheque(int64_t cheque)
|
||||||
|
{
|
||||||
|
LPCHARACTER victim = GetCompany()->GetOwner();
|
||||||
|
if (cheque <= 0 || cheque > CHEQUE_MAX || !PortChequeClientSupported(GetOwner()) || !PortChequeClientSupported(victim))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
if (PortChequeGet(GetOwner()) < cheque)
|
||||||
|
{
|
||||||
|
exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_LESS_CHEQUE, 0, 0, NPOS, 0);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!PortChequeCanChange(victim, cheque))
|
||||||
|
{
|
||||||
|
GetOwner()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("The other player can't carry more Won."));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Accept(false);
|
||||||
|
GetCompany()->Accept(false);
|
||||||
|
|
||||||
|
m_lCheque = cheque;
|
||||||
|
|
||||||
|
exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_CHEQUE_ADD, true, m_lCheque, NPOS, 0);
|
||||||
|
exchange_packet(victim, EXCHANGE_SUBHEADER_GC_CHEQUE_ADD, false, m_lCheque, NPOS, 0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// 돈이 충분히 있는지, 교환하려는 아이템이 실제로 있는지 확인 한다.
|
// 돈이 충분히 있는지, 교환하려는 아이템이 실제로 있는지 확인 한다.
|
||||||
bool CExchange::Check(int * piItemCount)
|
bool CExchange::Check(int * piItemCount)
|
||||||
{
|
{
|
||||||
@@ -285,6 +316,11 @@ bool CExchange::Check(int * piItemCount)
|
|||||||
if (m_lGold > 0 && victim->GetGold() > GOLD_MAX_64 - m_lGold)
|
if (m_lGold > 0 && victim->GetGold() > GOLD_MAX_64 - m_lGold)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// Won settles as one net transfer in Accept, so bound the victim's final balance.
|
||||||
|
if (m_lCheque > 0 && (PortChequeGet(GetOwner()) < m_lCheque ||
|
||||||
|
!PortChequeCanChange(victim, m_lCheque - GetCompany()->m_lCheque)))
|
||||||
|
return false;
|
||||||
|
|
||||||
int item_count = 0;
|
int item_count = 0;
|
||||||
|
|
||||||
for (int i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
|
for (int i = 0; i < EXCHANGE_ITEM_MAX_NUM; ++i)
|
||||||
@@ -616,12 +652,21 @@ bool CExchange::Accept(bool bAccept)
|
|||||||
|
|
||||||
if (Done())
|
if (Done())
|
||||||
{
|
{
|
||||||
if (m_lGold) // 돈이 있을 떄만 저장
|
const int64_t netCheque = m_lCheque - GetCompany()->m_lCheque;
|
||||||
|
if (netCheque)
|
||||||
|
{
|
||||||
|
PortChequeChange(GetOwner(), -netCheque);
|
||||||
|
PortChequeChange(victim, netCheque);
|
||||||
|
LogManager::instance().CharLog(victim, netCheque, "EXCHANGE_CHEQUE_TAKE", GetOwner()->GetName());
|
||||||
|
LogManager::instance().CharLog(GetOwner(), -netCheque, "EXCHANGE_CHEQUE_GIVE", victim->GetName());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_lGold || netCheque) // 돈이 있을 떄만 저장
|
||||||
GetOwner()->Save();
|
GetOwner()->Save();
|
||||||
|
|
||||||
if (GetCompany()->Done())
|
if (GetCompany()->Done())
|
||||||
{
|
{
|
||||||
if (GetCompany()->m_lGold) // 돈이 있을 때만 저장
|
if (GetCompany()->m_lGold || netCheque) // 돈이 있을 때만 저장
|
||||||
victim->Save();
|
victim->Save();
|
||||||
|
|
||||||
// INTERNATIONAL_VERSION
|
// INTERNATIONAL_VERSION
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class CExchange
|
|||||||
void Cancel();
|
void Cancel();
|
||||||
|
|
||||||
bool AddGold(int64_t lGold);
|
bool AddGold(int64_t lGold);
|
||||||
|
bool AddCheque(int64_t lCheque);
|
||||||
bool AddItem(TItemPos item_pos, BYTE display_pos);
|
bool AddItem(TItemPos item_pos, BYTE display_pos);
|
||||||
bool RemoveItem(BYTE pos);
|
bool RemoveItem(BYTE pos);
|
||||||
|
|
||||||
@@ -54,6 +55,7 @@ class CExchange
|
|||||||
|
|
||||||
bool m_bAccept;
|
bool m_bAccept;
|
||||||
int64_t m_lGold;
|
int64_t m_lGold;
|
||||||
|
int64_t m_lCheque;
|
||||||
|
|
||||||
CGrid * m_pGrid;
|
CGrid * m_pGrid;
|
||||||
|
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
|
|
||||||
#include "DragonSoul.h"
|
#include "DragonSoul.h"
|
||||||
#include "port_switchbot.h"
|
#include "port_switchbot.h"
|
||||||
|
#include "port_cheque.h"
|
||||||
|
|
||||||
#ifdef __AUCTION__
|
#ifdef __AUCTION__
|
||||||
#include "auction_manager.h"
|
#include "auction_manager.h"
|
||||||
@@ -1213,6 +1214,7 @@ void CInputDB::QuestLoad(LPDESC d, const char * c_pData)
|
|||||||
pkPC->Build();
|
pkPC->Build();
|
||||||
ch->SetPoint(POINT_GEM, ch->GetQuestFlag("gem.points"));
|
ch->SetPoint(POINT_GEM, ch->GetQuestFlag("gem.points"));
|
||||||
ch->PointChange(POINT_GEM, 0);
|
ch->PointChange(POINT_GEM, 0);
|
||||||
|
PortChequeLoad(ch);
|
||||||
|
|
||||||
if (ch->GetDesc()->IsPhase(PHASE_GAME))
|
if (ch->GetDesc()->IsPhase(PHASE_GAME))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include "port_cheque.h"
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include "../../common/teen_packet.h"
|
#include "../../common/teen_packet.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@@ -665,6 +666,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
|
|||||||
PortVipRefresh(ch, false);
|
PortVipRefresh(ch, false);
|
||||||
CSwitchbotManager::Instance().EnterGame(ch); // PORT: AVA2 switchbot (port_switchbot.cpp)
|
CSwitchbotManager::Instance().EnterGame(ch); // PORT: AVA2 switchbot (port_switchbot.cpp)
|
||||||
Ava2ChannelList(ch); // Authoritative channel after every login/warp, including same-map transfers.
|
Ava2ChannelList(ch); // Authoritative channel after every login/warp, including same-map transfers.
|
||||||
|
PortChequeLoad(ch); // PORT: a Won point sent at quest load (before PHASE_GAME) never reaches the client
|
||||||
|
|
||||||
if (LC_IsEurope())
|
if (LC_IsEurope())
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
#include "port_switchbot.h"
|
#include "port_switchbot.h"
|
||||||
#include "ava2_native_packets.h"
|
#include "ava2_native_packets.h"
|
||||||
#include "cube.h"
|
#include "cube.h"
|
||||||
|
#include "port_cheque.h"
|
||||||
|
|
||||||
extern void SendShout(const char * szText, BYTE bEmpire);
|
extern void SendShout(const char * szText, BYTE bEmpire);
|
||||||
extern int g_nPortalLimitTime;
|
extern int g_nPortalLimitTime;
|
||||||
@@ -1244,6 +1245,11 @@ void CInputMain::Exchange(LPCHARACTER ch, const char * data)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EXCHANGE_SUBHEADER_CG_CHEQUE_ADD: // arg1 == amount of won (PORT)
|
||||||
|
if (ch->GetExchange() && ch->GetExchange()->GetCompany()->GetAcceptStatus() != true)
|
||||||
|
ch->GetExchange()->AddCheque(pinfo->arg1);
|
||||||
|
break;
|
||||||
|
|
||||||
case EXCHANGE_SUBHEADER_CG_ACCEPT: // arg1 == not used
|
case EXCHANGE_SUBHEADER_CG_ACCEPT: // arg1 == not used
|
||||||
if (ch->GetExchange())
|
if (ch->GetExchange())
|
||||||
{
|
{
|
||||||
@@ -2956,7 +2962,9 @@ void CInputMain::Hack(LPCHARACTER ch, const char * c_pData)
|
|||||||
int CInputMain::MyShop(LPCHARACTER ch, const char * c_pData, size_t uiBytes)
|
int CInputMain::MyShop(LPCHARACTER ch, const char * c_pData, size_t uiBytes)
|
||||||
{
|
{
|
||||||
TPacketCGMyShop * p = (TPacketCGMyShop *) c_pData;
|
TPacketCGMyShop * p = (TPacketCGMyShop *) c_pData;
|
||||||
int iExtraLen = p->bCount * sizeof(TShopItemTable);
|
// PORT: Won-aware clients append int32 cheque[bCount] after the items.
|
||||||
|
const bool withCheque = PortChequeClientSupported(ch);
|
||||||
|
int iExtraLen = p->bCount * (sizeof(TShopItemTable) + (withCheque ? sizeof(int32_t) : 0));
|
||||||
|
|
||||||
if (uiBytes < sizeof(TPacketCGMyShop) + iExtraLen)
|
if (uiBytes < sizeof(TPacketCGMyShop) + iExtraLen)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -2978,7 +2986,8 @@ int CInputMain::MyShop(LPCHARACTER ch, const char * c_pData, size_t uiBytes)
|
|||||||
}
|
}
|
||||||
|
|
||||||
sys_log(0, "MyShop count %d", p->bCount);
|
sys_log(0, "MyShop count %d", p->bCount);
|
||||||
ch->OpenMyShop(p->szSign, (TShopItemTable *) (c_pData + sizeof(TPacketCGMyShop)), p->bCount);
|
const int32_t * pCheque = withCheque ? (const int32_t *) (c_pData + sizeof(TPacketCGMyShop) + p->bCount * sizeof(TShopItemTable)) : NULL;
|
||||||
|
ch->OpenMyShop(p->szSign, (TShopItemTable *) (c_pData + sizeof(TPacketCGMyShop)), p->bCount, pCheque);
|
||||||
return (iExtraLen);
|
return (iExtraLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -841,6 +841,7 @@ enum
|
|||||||
EXCHANGE_SUBHEADER_CG_ELK_ADD, /* arg1 == amount of gold */
|
EXCHANGE_SUBHEADER_CG_ELK_ADD, /* arg1 == amount of gold */
|
||||||
EXCHANGE_SUBHEADER_CG_ACCEPT, /* arg1 == not used */
|
EXCHANGE_SUBHEADER_CG_ACCEPT, /* arg1 == not used */
|
||||||
EXCHANGE_SUBHEADER_CG_CANCEL, /* arg1 == not used */
|
EXCHANGE_SUBHEADER_CG_CANCEL, /* arg1 == not used */
|
||||||
|
EXCHANGE_SUBHEADER_CG_CHEQUE_ADD, /* arg1 == amount of won (PORT) */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct command_exchange
|
typedef struct command_exchange
|
||||||
@@ -1395,6 +1396,9 @@ enum EPacketShopSubHeaders
|
|||||||
SHOP_SUBHEADER_GC_REFRESH_COUNT,
|
SHOP_SUBHEADER_GC_REFRESH_COUNT,
|
||||||
SHOP_SUBHEADER_GC_CHANGE_TITLE,
|
SHOP_SUBHEADER_GC_CHANGE_TITLE,
|
||||||
#endif
|
#endif
|
||||||
|
// PORT: Won prices for mt>=20261027 clients; START_CHEQUE = START + int32 cheque[SHOP_HOST_ITEM_MAX_NUM].
|
||||||
|
SHOP_SUBHEADER_GC_START_CHEQUE = 40,
|
||||||
|
SHOP_SUBHEADER_GC_NOT_ENOUGH_CHEQUE = 41,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct packet_shop_item
|
struct packet_shop_item
|
||||||
@@ -1467,6 +1471,8 @@ enum EPacketTradeSubHeaders
|
|||||||
EXCHANGE_SUBHEADER_GC_END, /* arg1 == not used */
|
EXCHANGE_SUBHEADER_GC_END, /* arg1 == not used */
|
||||||
EXCHANGE_SUBHEADER_GC_ALREADY, /* arg1 == not used */
|
EXCHANGE_SUBHEADER_GC_ALREADY, /* arg1 == not used */
|
||||||
EXCHANGE_SUBHEADER_GC_LESS_GOLD, /* arg1 == not used */
|
EXCHANGE_SUBHEADER_GC_LESS_GOLD, /* arg1 == not used */
|
||||||
|
EXCHANGE_SUBHEADER_GC_CHEQUE_ADD, /* arg1 == won (PORT) */
|
||||||
|
EXCHANGE_SUBHEADER_GC_LESS_CHEQUE, /* arg1 == not used */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct packet_position
|
struct packet_position
|
||||||
|
|||||||
@@ -0,0 +1,103 @@
|
|||||||
|
#include "stdafx.h"
|
||||||
|
#include "port_cheque.h"
|
||||||
|
#include "char.h"
|
||||||
|
#include "desc.h"
|
||||||
|
#include "questmanager.h"
|
||||||
|
#include "questpc.h"
|
||||||
|
#include "log.h"
|
||||||
|
#include "cmd.h"
|
||||||
|
#include "../../common/gold_bounds.h"
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
bool PortClientAtLeast(const CHARACTER* ch, int minDate)
|
||||||
|
{
|
||||||
|
const char* version = ch && ch->GetDesc() ? strstr(ch->GetDesc()->GetClientVersion(), "mt") : NULL;
|
||||||
|
return version && atoi(version + 2) >= minDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PortChequeClientSupported(const CHARACTER* ch)
|
||||||
|
{
|
||||||
|
return PortClientAtLeast(ch, CHEQUE_MIN_CLIENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
static quest::PC* FN_cheque_pc(const CHARACTER* ch)
|
||||||
|
{
|
||||||
|
if (!ch || !ch->IsPC())
|
||||||
|
return NULL;
|
||||||
|
quest::PC* pc = quest::CQuestManager::instance().GetPCForce(ch->GetPlayerID());
|
||||||
|
return pc && pc->IsLoaded() ? pc : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int PortChequeGet(const CHARACTER* ch)
|
||||||
|
{
|
||||||
|
quest::PC* pc = FN_cheque_pc(ch);
|
||||||
|
if (!pc)
|
||||||
|
return 0;
|
||||||
|
const int value = pc->GetFlag("cheque.points");
|
||||||
|
return value < 0 ? 0 : (value > CHEQUE_MAX ? CHEQUE_MAX : value);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PortChequeCanChange(const CHARACTER* ch, int64_t delta)
|
||||||
|
{
|
||||||
|
return FN_cheque_pc(ch) && PortGoldCanChange(PortChequeGet(ch), delta, CHEQUE_MAX);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool PortChequeChange(CHARACTER* ch, int64_t delta)
|
||||||
|
{
|
||||||
|
if (!PortChequeCanChange(ch, delta))
|
||||||
|
return false;
|
||||||
|
const int updated = static_cast<int>(PortChequeGet(ch) + delta);
|
||||||
|
FN_cheque_pc(ch)->SetFlag("cheque.points", updated);
|
||||||
|
ch->SetPoint(POINT_CHEQUE, updated);
|
||||||
|
ch->PointChange(POINT_CHEQUE, 0);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PortChequeLoad(CHARACTER* ch)
|
||||||
|
{
|
||||||
|
if (!FN_cheque_pc(ch))
|
||||||
|
return;
|
||||||
|
ch->SetPoint(POINT_CHEQUE, PortChequeGet(ch));
|
||||||
|
ch->PointChange(POINT_CHEQUE, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// "/won_exchange sell N" turns N Won into N*100M yang, "buy N" the reverse (uiwonexchange.py).
|
||||||
|
ACMD(do_won_exchange)
|
||||||
|
{
|
||||||
|
if (!ch || !ch->IsPC() || !ch->GetDesc() || ch->IsWarping() || ch->IsDead())
|
||||||
|
return;
|
||||||
|
if (ch->GetExchange() || ch->GetMyShop() || ch->GetShopOwner() || ch->IsOpenSafebox() || ch->IsCubeOpen())
|
||||||
|
{
|
||||||
|
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Close the other windows first."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::istringstream input(argument);
|
||||||
|
std::string mode;
|
||||||
|
long long amount = 0;
|
||||||
|
if (!(input >> mode >> amount) || amount < 1 || amount > CHEQUE_MAX || (mode != "sell" && mode != "buy"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
const int64_t yang = amount * WON_EXCHANGE_YANG;
|
||||||
|
const int64_t won = mode == "sell" ? -amount : amount;
|
||||||
|
const int64_t gold = mode == "sell" ? yang : -yang;
|
||||||
|
|
||||||
|
if (!PortChequeCanChange(ch, won))
|
||||||
|
{
|
||||||
|
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT(won < 0 ? "You don't have enough Won." : "You can't carry more Won."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!PortGoldCanChange(ch->GetGold(), gold, GOLD_MAX_64))
|
||||||
|
{
|
||||||
|
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT(gold < 0 ? "You don't have enough Yang." : "You can't carry more Yang."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
PortChequeChange(ch, won);
|
||||||
|
ch->PointChange(POINT_GOLD, gold, true);
|
||||||
|
ch->Save();
|
||||||
|
|
||||||
|
char buf[64];
|
||||||
|
snprintf(buf, sizeof(buf), "%s %lld won %lld yang", mode.c_str(), amount, (long long)gold);
|
||||||
|
LogManager::instance().CharLog(ch, amount, "WON_EXCHANGE", buf);
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
// PORT: Won (cheque) currency. The balance lives in quest flag "cheque.points" (saved with the
|
||||||
|
// quest PC, like gem.points) and is mirrored into POINT_CHEQUE for the client.
|
||||||
|
enum EChequeConstants
|
||||||
|
{
|
||||||
|
CHEQUE_MAX = 999,
|
||||||
|
CHEQUE_MIN_CLIENT = 20261027,
|
||||||
|
};
|
||||||
|
|
||||||
|
static const int64_t WON_EXCHANGE_YANG = 100000000LL;
|
||||||
|
|
||||||
|
class CHARACTER;
|
||||||
|
|
||||||
|
// True when the client sends "mt<date>" with date >= minDate.
|
||||||
|
bool PortClientAtLeast(const CHARACTER* ch, int minDate);
|
||||||
|
bool PortChequeClientSupported(const CHARACTER* ch);
|
||||||
|
|
||||||
|
int PortChequeGet(const CHARACTER* ch);
|
||||||
|
bool PortChequeCanChange(const CHARACTER* ch, int64_t delta);
|
||||||
|
bool PortChequeChange(CHARACTER* ch, int64_t delta);
|
||||||
|
void PortChequeLoad(CHARACTER* ch);
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "locale_service.h"
|
#include "locale_service.h"
|
||||||
#include "unique_item.h"
|
#include "unique_item.h"
|
||||||
#include "port_battlepass_hooks.h"
|
#include "port_battlepass_hooks.h"
|
||||||
|
#include "port_cheque.h"
|
||||||
|
|
||||||
// MT: the sockets ITEM_MANAGER::CreateItem gives a new item of this vnum (its remaining time), sent
|
// MT: the sockets ITEM_MANAGER::CreateItem gives a new item of this vnum (its remaining time), sent
|
||||||
// with an NPC shop's items so the client tooltip shows how long a bought one lasts instead of 0.
|
// with an NPC shop's items so the client tooltip shows how long a bought one lasts instead of 0.
|
||||||
@@ -129,7 +130,7 @@ bool CShop::Create(DWORD dwVnum, DWORD dwNPCVnum, TShopItemTable * pTable)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CShop::SetShopItems(TShopItemTable * pTable, BYTE bItemCount)
|
void CShop::SetShopItems(TShopItemTable * pTable, BYTE bItemCount, const int32_t * pCheque)
|
||||||
{
|
{
|
||||||
if (bItemCount > SHOP_HOST_ITEM_MAX_NUM)
|
if (bItemCount > SHOP_HOST_ITEM_MAX_NUM)
|
||||||
return;
|
return;
|
||||||
@@ -141,6 +142,7 @@ void CShop::SetShopItems(TShopItemTable * pTable, BYTE bItemCount)
|
|||||||
|
|
||||||
for (int i = 0; i < bItemCount; ++i, ++pTable)
|
for (int i = 0; i < bItemCount; ++i, ++pTable)
|
||||||
{
|
{
|
||||||
|
const int32_t cheque = pCheque ? pCheque[i] : 0;
|
||||||
LPITEM pkItem = NULL;
|
LPITEM pkItem = NULL;
|
||||||
const TItemTable * item_table;
|
const TItemTable * item_table;
|
||||||
|
|
||||||
@@ -212,6 +214,7 @@ void CShop::SetShopItems(TShopItemTable * pTable, BYTE bItemCount)
|
|||||||
item.count = pkItem->GetCount(); // PC 샵의 경우 아이템 개수는 진짜 아이템의 개수여야 한다.
|
item.count = pkItem->GetCount(); // PC 샵의 경우 아이템 개수는 진짜 아이템의 개수여야 한다.
|
||||||
item.price = pTable->price; // 가격도 사용자가 정한대로..
|
item.price = pTable->price; // 가격도 사용자가 정한대로..
|
||||||
item.itemid = pkItem->GetID();
|
item.itemid = pkItem->GetID();
|
||||||
|
item.cheque = cheque;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -293,6 +296,17 @@ int CShop::Buy(LPCHARACTER ch, BYTE pos)
|
|||||||
return SHOP_SUBHEADER_GC_NOT_ENOUGH_MONEY;
|
return SHOP_SUBHEADER_GC_NOT_ENOUGH_MONEY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const int cheque = m_pkPC ? r_item.cheque : 0;
|
||||||
|
if (cheque < 0 || cheque > CHEQUE_MAX || (cheque > 0 && (!PortChequeClientSupported(ch) || m_pkPC == ch)))
|
||||||
|
return SHOP_SUBHEADER_GC_INVALID_POS;
|
||||||
|
if (cheque > 0 && PortChequeGet(ch) < cheque)
|
||||||
|
return SHOP_SUBHEADER_GC_NOT_ENOUGH_CHEQUE;
|
||||||
|
if (cheque > 0 && !PortChequeCanChange(m_pkPC, cheque))
|
||||||
|
{
|
||||||
|
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("The seller can't hold more Won."));
|
||||||
|
return SHOP_SUBHEADER_GC_INVALID_POS;
|
||||||
|
}
|
||||||
|
|
||||||
LPITEM item;
|
LPITEM item;
|
||||||
|
|
||||||
if (m_pkPC) // 피씨가 운영하는 샵은 피씨가 실제 아이템을 가지고있어야 한다.
|
if (m_pkPC) // 피씨가 운영하는 샵은 피씨가 실제 아이템을 가지고있어야 한다.
|
||||||
@@ -407,6 +421,15 @@ int CShop::Buy(LPCHARACTER ch, BYTE pos)
|
|||||||
|
|
||||||
m_pkPC->PointChange(POINT_GOLD, dwPrice, false);
|
m_pkPC->PointChange(POINT_GOLD, dwPrice, false);
|
||||||
|
|
||||||
|
if (cheque > 0)
|
||||||
|
{
|
||||||
|
PortChequeChange(ch, -cheque);
|
||||||
|
PortChequeChange(m_pkPC, cheque);
|
||||||
|
LogManager::instance().CharLog(ch, -cheque, "SHOP_BUY_CHEQUE", m_pkPC->GetName());
|
||||||
|
LogManager::instance().CharLog(m_pkPC, cheque, "SHOP_SELL_CHEQUE", ch->GetName());
|
||||||
|
m_pkPC->Save();
|
||||||
|
}
|
||||||
|
|
||||||
if (iVal > 0)
|
if (iVal > 0)
|
||||||
m_pkPC->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("판매금액의 %d %% 가 세금으로 나가게됩니다"), iVal);
|
m_pkPC->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("판매금액의 %d %% 가 세금으로 나가게됩니다"), iVal);
|
||||||
|
|
||||||
@@ -468,12 +491,17 @@ bool CShop::AddGuest(LPCHARACTER ch, DWORD owner_vid, bool bOtherEmpire)
|
|||||||
|
|
||||||
TPacketGCShop pack;
|
TPacketGCShop pack;
|
||||||
|
|
||||||
|
// PORT: PC shops tell Won-aware clients each item's Won price; older clients never see Won items.
|
||||||
|
const bool sendCheque = m_pkPC && PortChequeClientSupported(ch);
|
||||||
|
|
||||||
pack.header = HEADER_GC_SHOP;
|
pack.header = HEADER_GC_SHOP;
|
||||||
pack.subheader = SHOP_SUBHEADER_GC_START;
|
pack.subheader = sendCheque ? SHOP_SUBHEADER_GC_START_CHEQUE : SHOP_SUBHEADER_GC_START;
|
||||||
|
|
||||||
TPacketGCShopStart pack2;
|
TPacketGCShopStart pack2;
|
||||||
|
int32_t cheques[SHOP_HOST_ITEM_MAX_NUM];
|
||||||
|
|
||||||
memset(&pack2, 0, sizeof(pack2));
|
memset(&pack2, 0, sizeof(pack2));
|
||||||
|
memset(cheques, 0, sizeof(cheques));
|
||||||
pack2.owner_vid = owner_vid;
|
pack2.owner_vid = owner_vid;
|
||||||
|
|
||||||
for (DWORD i = 0; i < m_itemVector.size() && i < SHOP_HOST_ITEM_MAX_NUM; ++i)
|
for (DWORD i = 0; i < m_itemVector.size() && i < SHOP_HOST_ITEM_MAX_NUM; ++i)
|
||||||
@@ -493,11 +521,16 @@ bool CShop::AddGuest(LPCHARACTER ch, DWORD owner_vid, bool bOtherEmpire)
|
|||||||
if (m_pkPC && !item.pkItem)
|
if (m_pkPC && !item.pkItem)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (m_pkPC && item.cheque > 0 && !sendCheque)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
cheques[i] = m_pkPC ? item.cheque : 0;
|
||||||
pack2.items[i].vnum = item.vnum;
|
pack2.items[i].vnum = item.vnum;
|
||||||
|
|
||||||
if (!PortShopQuote(item.price, !IsPCShop() && bOtherEmpire, GOLD_MAX_64, pack2.items[i].price))
|
if (!PortShopQuote(item.price, !IsPCShop() && bOtherEmpire, GOLD_MAX_64, pack2.items[i].price))
|
||||||
{
|
{
|
||||||
memset(&pack2.items[i], 0, sizeof(pack2.items[i]));
|
memset(&pack2.items[i], 0, sizeof(pack2.items[i]));
|
||||||
|
cheques[i] = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -512,10 +545,16 @@ bool CShop::AddGuest(LPCHARACTER ch, DWORD owner_vid, bool bOtherEmpire)
|
|||||||
MT_GetNewItemSockets(item.vnum, pack2.items[i].alSockets);
|
MT_GetNewItemSockets(item.vnum, pack2.items[i].alSockets);
|
||||||
}
|
}
|
||||||
|
|
||||||
pack.size = sizeof(pack) + sizeof(pack2);
|
pack.size = sizeof(pack) + sizeof(pack2) + (sendCheque ? sizeof(cheques) : 0);
|
||||||
|
|
||||||
ch->GetDesc()->BufferedPacket(&pack, sizeof(TPacketGCShop));
|
ch->GetDesc()->BufferedPacket(&pack, sizeof(TPacketGCShop));
|
||||||
ch->GetDesc()->Packet(&pack2, sizeof(TPacketGCShopStart));
|
if (sendCheque)
|
||||||
|
{
|
||||||
|
ch->GetDesc()->BufferedPacket(&pack2, sizeof(TPacketGCShopStart));
|
||||||
|
ch->GetDesc()->Packet(cheques, sizeof(cheques));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
ch->GetDesc()->Packet(&pack2, sizeof(TPacketGCShopStart));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class CShop
|
|||||||
BYTE count; // 아이템 개수
|
BYTE count; // 아이템 개수
|
||||||
|
|
||||||
LPITEM pkItem;
|
LPITEM pkItem;
|
||||||
|
int cheque; // PORT: Won price (PC shops only)
|
||||||
int itemid; // 아이템 고유아이디
|
int itemid; // 아이템 고유아이디
|
||||||
|
|
||||||
shop_item()
|
shop_item()
|
||||||
@@ -27,6 +28,7 @@ class CShop
|
|||||||
price = 0;
|
price = 0;
|
||||||
count = 0;
|
count = 0;
|
||||||
itemid = 0;
|
itemid = 0;
|
||||||
|
cheque = 0;
|
||||||
pkItem = NULL;
|
pkItem = NULL;
|
||||||
}
|
}
|
||||||
} SHOP_ITEM;
|
} SHOP_ITEM;
|
||||||
@@ -35,7 +37,7 @@ class CShop
|
|||||||
~CShop();
|
~CShop();
|
||||||
|
|
||||||
bool Create(DWORD dwVnum, DWORD dwNPCVnum, TShopItemTable * pItemTable);
|
bool Create(DWORD dwVnum, DWORD dwNPCVnum, TShopItemTable * pItemTable);
|
||||||
void SetShopItems(TShopItemTable * pItemTable, BYTE bItemCount);
|
void SetShopItems(TShopItemTable * pItemTable, BYTE bItemCount, const int32_t * pCheque = NULL);
|
||||||
|
|
||||||
virtual void SetPCShop(LPCHARACTER ch);
|
virtual void SetPCShop(LPCHARACTER ch);
|
||||||
virtual bool IsPCShop() { return m_pkPC ? true : false; }
|
virtual bool IsPCShop() { return m_pkPC ? true : false; }
|
||||||
|
|||||||
@@ -164,14 +164,14 @@ LPSHOP CShopManager::FindPCShop(DWORD dwVID)
|
|||||||
return it->second;
|
return it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
LPSHOP CShopManager::CreatePCShop(LPCHARACTER ch, TShopItemTable * pTable, BYTE bItemCount)
|
LPSHOP CShopManager::CreatePCShop(LPCHARACTER ch, TShopItemTable * pTable, BYTE bItemCount, const int32_t * pCheque)
|
||||||
{
|
{
|
||||||
if (FindPCShop(ch->GetVID()))
|
if (FindPCShop(ch->GetVID()))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
LPSHOP pkShop = M2_NEW CShop;
|
LPSHOP pkShop = M2_NEW CShop;
|
||||||
pkShop->SetPCShop(ch);
|
pkShop->SetPCShop(ch);
|
||||||
pkShop->SetShopItems(pTable, bItemCount);
|
pkShop->SetShopItems(pTable, bItemCount, pCheque);
|
||||||
|
|
||||||
m_map_pkShopByPC.insert(TShopMap::value_type(ch->GetVID(), pkShop));
|
m_map_pkShopByPC.insert(TShopMap::value_type(ch->GetVID(), pkShop));
|
||||||
return pkShop;
|
return pkShop;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public:
|
|||||||
void Buy(LPCHARACTER ch, BYTE pos);
|
void Buy(LPCHARACTER ch, BYTE pos);
|
||||||
void Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount=0);
|
void Sell(LPCHARACTER ch, BYTE bCell, BYTE bCount=0);
|
||||||
|
|
||||||
LPSHOP CreatePCShop(LPCHARACTER ch, TShopItemTable * pTable, BYTE bItemCount);
|
LPSHOP CreatePCShop(LPCHARACTER ch, TShopItemTable * pTable, BYTE bItemCount, const int32_t * pCheque = NULL);
|
||||||
LPSHOP FindPCShop(DWORD dwVID);
|
LPSHOP FindPCShop(DWORD dwVID);
|
||||||
void DestroyPCShop(LPCHARACTER ch);
|
void DestroyPCShop(LPCHARACTER ch);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user