feat: add point currency and stage extended shop items
Rename shop currency and vouchers to points, synchronize the wiki catalogue, and display point rewards. Add wear40 item metadata transport and pet identity accessors; stage sixteen timed mounts and appearance items with AVA2 model registration. Include build and sbtest acceptance evidence. Remaining shop systems are unfinished and are not enabled or deployed. Wear40 requires the matching server migration and mt20261022 client.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include "../GameLib/ItemData.h"
|
||||
#include "../common/PortItemExtra.h"
|
||||
|
||||
struct SAffects
|
||||
{
|
||||
@@ -111,12 +112,19 @@ enum EDragonSoulStepTypes
|
||||
const DWORD c_Equipment_Pendant = c_Equipment_Start + 27; // PORT: AVA2 talisman, server WEAR_PENDANT
|
||||
const DWORD c_Equipment_Rings1 = c_Equipment_Start + 28; // PORT: AVA2 new rings, server WEAR_RINGS_1/2
|
||||
const DWORD c_Equipment_Rings2 = c_Equipment_Start + 29;
|
||||
const DWORD c_Costume_Slot_Weapon = c_Equipment_Start + 30;
|
||||
const DWORD c_Costume_Slot_Pet = c_Equipment_Start + 31;
|
||||
const DWORD c_Pet_Slot = c_Equipment_Start + 32;
|
||||
const DWORD c_Costume_Slot_NewSash = c_Equipment_Start + 33;
|
||||
const DWORD c_Shining_Slot_Weapon = c_Equipment_Start + 34;
|
||||
const DWORD c_Shining_Slot_Armor = c_Equipment_Start + 35;
|
||||
const DWORD c_Shining_Slot_Special = c_Equipment_Start + 36;
|
||||
|
||||
|
||||
// [주의] 숫자(32) 하드코딩 주의. 현재 서버에서 용혼석 슬롯은 32부터임.
|
||||
// 서버 common/length.h 파일의 EWearPositions 열거형이 32까지 확장될 것을 염두하고(32 이상은 확장 하기 힘들게 되어있음.),
|
||||
// 그 이후부터를 용혼석 장착 슬롯으로 사용.
|
||||
const DWORD c_Wear_Max = 32;
|
||||
const DWORD c_Wear_Max = 40; // PORT: shop costume, pet and shining equipment.
|
||||
const DWORD c_DragonSoul_Equip_Start = c_ItemSlot_Count + c_Wear_Max;
|
||||
const DWORD c_DragonSoul_Equip_Slot_Max = 6;
|
||||
const DWORD c_DragonSoul_Equip_End = c_DragonSoul_Equip_Start + c_DragonSoul_Equip_Slot_Max * DS_DECK_MAX_NUM;
|
||||
@@ -361,6 +369,8 @@ typedef struct packet_item
|
||||
DWORD anti_flags;
|
||||
LONG alSockets[ITEM_SOCKET_SLOT_MAX_NUM]; // PORT: LONG, the 32-bit Win32 long
|
||||
TPlayerItemAttribute aAttr[ITEM_ATTRIBUTE_SLOT_MAX_NUM];
|
||||
DWORD portId = 0; // PORT: owning item identity for pet operations.
|
||||
PortItemExtra extra{};
|
||||
} TItemData;
|
||||
|
||||
typedef struct packet_shop_item
|
||||
|
||||
@@ -494,6 +494,19 @@ PyObject * chrmgrSetShapeModel(PyObject* poSelf, PyObject* poArgs)
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
// PORT: register AVA2 hair definitions after the classic race file is loaded.
|
||||
PyObject* chrmgrSetHairSkin(PyObject*,PyObject* args)
|
||||
{
|
||||
int hair,part;char *model,*source,*target;
|
||||
if(!PyTuple_GetInteger(args,0,&hair) || !PyTuple_GetInteger(args,1,&part) ||
|
||||
!PyTuple_GetString(args,2,&model) || !PyTuple_GetString(args,3,&source) ||
|
||||
!PyTuple_GetString(args,4,&target))return Py_BadArgument();
|
||||
auto race=CRaceManager::Instance().GetSelectedRaceDataPointer();
|
||||
if(!race)return Py_BuildException("RaceData has not selected!");
|
||||
race->SetHairSkin(hair,part,model,source,target);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * chrmgrAppendShapeSkin(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
int eShape;
|
||||
@@ -722,6 +735,7 @@ void initchrmgr()
|
||||
{ "GetVIDInfo", chrmgrGetVIDInfo, METH_VARARGS },
|
||||
{ "GetPickedVID", chrmgrGetPickedVID, METH_VARARGS },
|
||||
{ "SetShapeModel", chrmgrSetShapeModel, METH_VARARGS },
|
||||
{ "SetHairSkin", chrmgrSetHairSkin, METH_VARARGS },
|
||||
{ "AppendShapeSkin", chrmgrAppendShapeSkin, METH_VARARGS },
|
||||
{ "SetPathName", chrmgrSetPathName, METH_VARARGS },
|
||||
{ "LoadRaceData", chrmgrLoadRaceData, METH_VARARGS },
|
||||
|
||||
@@ -4220,8 +4220,8 @@ bool CPythonNetworkStream::SendClientVersionPacket()
|
||||
TPacketCGClientVersion2 kVersionPacket;
|
||||
kVersionPacket.header = HEADER_CG_CLIENT_VERSION2;
|
||||
strncpy(kVersionPacket.filename, filename.c_str(), sizeof(kVersionPacket.filename)-1);
|
||||
// PORT: revision mt20261020 adds native itemshop; preserve the numeric prefix for atoi version checks.
|
||||
strncpy(kVersionPacket.timestamp, "1215955205 mt20261020", sizeof(kVersionPacket.timestamp)-1); // # python time.time 앞자리
|
||||
// PORT: revision mt20261022 adds native itemshop; preserve the numeric prefix for atoi version checks.
|
||||
strncpy(kVersionPacket.timestamp, "1215955205 mt20261022", sizeof(kVersionPacket.timestamp)-1); // # python time.time 앞자리
|
||||
//strncpy(kVersionPacket.timestamp, __TIMESTAMP__, sizeof(kVersionPacket.timestamp)-1); // old_string_ver
|
||||
//strncpy(kVersionPacket.timestamp, "1218055205", sizeof(kVersionPacket.timestamp)-1); // new_future
|
||||
//strncpy(kVersionPacket.timestamp, "1214055205", sizeof(kVersionPacket.timestamp)-1); // old_past
|
||||
@@ -4234,8 +4234,8 @@ bool CPythonNetworkStream::SendClientVersionPacket()
|
||||
TPacketCGClientVersion kVersionPacket;
|
||||
kVersionPacket.header = HEADER_CG_CLIENT_VERSION;
|
||||
strncpy(kVersionPacket.filename, filename.c_str(), sizeof(kVersionPacket.filename)-1);
|
||||
// PORT: native itemshop requires mt20261020; older AVA2 services retain their own revision gates.
|
||||
strncpy(kVersionPacket.timestamp, "mt20261020", sizeof(kVersionPacket.timestamp)-1);
|
||||
// PORT: native itemshop requires mt20261022; older AVA2 services retain their own revision gates.
|
||||
strncpy(kVersionPacket.timestamp, "mt20261022", sizeof(kVersionPacket.timestamp)-1);
|
||||
|
||||
if (!Send(sizeof(kVersionPacket), &kVersionPacket))
|
||||
Tracef("SendClientReportPacket Error");
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include "PythonNetworkStream.h"
|
||||
#include "Ava2QueryPackets.h"
|
||||
#include <vector>
|
||||
#include "PythonPlayer.h"
|
||||
#include "PythonSafeBox.h"
|
||||
|
||||
bool CPythonNetworkStream::SendAva2DropQuery(BYTE subheader,LONG vnum) {
|
||||
if (!PORT_IsGamePhase() || (subheader!=0 && subheader!=1 && subheader!=6 && subheader!=7 && subheader!=8 && subheader!=9 && subheader!=10) || vnum<0)return false;
|
||||
@@ -30,6 +32,24 @@ bool CPythonNetworkStream::RecvAva2ItemShop() {
|
||||
if (!Recv(sizeof(p),&p) || p.size<sizeof(p)+1 || p.size>32768)return false;
|
||||
std::vector<char> data(p.size-sizeof(p));
|
||||
if (!Recv(data.size(),data.data()))return false;
|
||||
if(uint8_t(data[0])==10) {
|
||||
#pragma pack(push,1)
|
||||
struct Extra {uint8_t op,window;uint16_t cell;uint32_t vnum,id;PortItemExtra extra;};
|
||||
#pragma pack(pop)
|
||||
if(data.size()!=sizeof(Extra))return false;
|
||||
Extra extra;memcpy(&extra,data.data(),sizeof(extra));extra.extra.name[24]=0;
|
||||
TItemData* target=nullptr;
|
||||
if(extra.window==SAFEBOX){if(!CPythonSafeBox::Instance().GetItemDataPtr(extra.cell,&target))return false;}
|
||||
else if(extra.window==MALL){if(!CPythonSafeBox::Instance().GetMallItemDataPtr(extra.cell,&target))return false;}
|
||||
else {
|
||||
TItemPos pos(extra.window,extra.cell);
|
||||
if(!pos.IsValidCell())return false;
|
||||
target=const_cast<TItemData*>(CPythonPlayer::Instance().GetItemData(pos));
|
||||
}
|
||||
if(!target || target->vnum!=extra.vnum)return true;
|
||||
target->portId=extra.id;target->extra=extra.extra;
|
||||
return true;
|
||||
}
|
||||
PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME],"BINARY_Ava2ItemShop",Py_BuildValue("(s#)",data.data(),int(data.size())));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -668,13 +668,25 @@ DWORD CPythonPlayer::GetItemCountByVnum(DWORD dwVnum)
|
||||
return dwCount;
|
||||
}
|
||||
|
||||
DWORD CPythonPlayer::GetItemID(TItemPos Cell)
|
||||
{
|
||||
const auto item=Cell.IsValidCell() ? GetItemData(Cell) : nullptr;
|
||||
return item ? item->portId : 0;
|
||||
}
|
||||
|
||||
const char* CPythonPlayer::GetItemNewName(TItemPos Cell)
|
||||
{
|
||||
const auto item=Cell.IsValidCell() ? GetItemData(Cell) : nullptr;
|
||||
return item ? item->extra.name : "";
|
||||
}
|
||||
|
||||
DWORD CPythonPlayer::GetItemMetinSocket(TItemPos Cell, DWORD dwMetinSocketIndex)
|
||||
{
|
||||
if (!Cell.IsValidCell())
|
||||
return 0;
|
||||
|
||||
if (dwMetinSocketIndex >= ITEM_SOCKET_SLOT_MAX_NUM)
|
||||
return 0;
|
||||
return dwMetinSocketIndex<8 ? GetItemData(Cell)->extra.sockets[dwMetinSocketIndex-3] : 0;
|
||||
|
||||
return GetItemData(Cell)->alSockets[dwMetinSocketIndex];
|
||||
}
|
||||
@@ -688,7 +700,10 @@ void CPythonPlayer::GetItemAttribute(TItemPos Cell, DWORD dwAttrSlotIndex, BYTE
|
||||
return;
|
||||
|
||||
if (dwAttrSlotIndex >= ITEM_ATTRIBUTE_SLOT_MAX_NUM)
|
||||
{
|
||||
if(dwAttrSlotIndex<15){*pbyType=GetItemData(Cell)->extra.types[dwAttrSlotIndex-7];*psValue=GetItemData(Cell)->extra.values[dwAttrSlotIndex-7];}
|
||||
return;
|
||||
}
|
||||
|
||||
*pbyType = GetItemData(Cell)->aAttr[dwAttrSlotIndex].bType;
|
||||
*psValue = GetItemData(Cell)->aAttr[dwAttrSlotIndex].sValue;
|
||||
|
||||
@@ -292,6 +292,8 @@ class CPythonPlayer : public CSingleton<CPythonPlayer>, public IAbstractPlayer
|
||||
DWORD GetItemCount(TItemPos Cell);
|
||||
DWORD GetItemCountByVnum(DWORD dwVnum);
|
||||
DWORD GetItemMetinSocket(TItemPos Cell, DWORD dwMetinSocketIndex);
|
||||
DWORD GetItemID(TItemPos Cell);
|
||||
const char* GetItemNewName(TItemPos Cell);
|
||||
void GetItemAttribute(TItemPos Cell, DWORD dwAttrSlotIndex, BYTE * pbyType, short * psValue);
|
||||
void SendClickItemPacket(DWORD dwIID);
|
||||
|
||||
|
||||
@@ -943,6 +943,24 @@ PyObject * playerGetItemCountByVnum(PyObject* poSelf, PyObject* poArgs)
|
||||
return Py_BuildValue("i", ItemNum);
|
||||
}
|
||||
|
||||
// PORT: AVA2 pet dialogs identify the saved item and display its custom name.
|
||||
static bool PortItemPosition(PyObject* args,TItemPos& cell)
|
||||
{
|
||||
if(PyTuple_Size(args)==1)return PyTuple_GetInteger(args,0,&cell.cell);
|
||||
if(PyTuple_Size(args)==2)return PyTuple_GetByte(args,0,&cell.window_type) && PyTuple_GetInteger(args,1,&cell.cell);
|
||||
return false;
|
||||
}
|
||||
PyObject* playerGetItemID(PyObject*,PyObject* args)
|
||||
{
|
||||
TItemPos cell;if(!PortItemPosition(args,cell))return Py_BuildException();
|
||||
return Py_BuildValue("I",CPythonPlayer::Instance().GetItemID(cell));
|
||||
}
|
||||
PyObject* playerGetItemNewName(PyObject*,PyObject* args)
|
||||
{
|
||||
TItemPos cell;if(!PortItemPosition(args,cell))return Py_BuildException();
|
||||
return Py_BuildValue("s",CPythonPlayer::Instance().GetItemNewName(cell));
|
||||
}
|
||||
|
||||
PyObject * playerGetItemMetinSocket(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
TItemPos Cell;
|
||||
@@ -2364,6 +2382,8 @@ void initPlayer()
|
||||
{ "GetItemCount", playerGetItemCount, METH_VARARGS },
|
||||
{ "GetItemCountByVnum", playerGetItemCountByVnum, METH_VARARGS },
|
||||
{ "GetItemMetinSocket", playerGetItemMetinSocket, METH_VARARGS },
|
||||
{ "GetItemID", playerGetItemID, METH_VARARGS },
|
||||
{ "GetItemNewName", playerGetItemNewName, METH_VARARGS },
|
||||
{ "GetItemAttribute", playerGetItemAttribute, METH_VARARGS },
|
||||
#if defined(GAIDEN)
|
||||
{ "GetItemUnbindTime", playerGetItemUnbindTime, METH_VARARGS },
|
||||
|
||||
@@ -206,14 +206,14 @@ PyObject * safeboxGetItemMetinSocket(PyObject * poSelf, PyObject * poArgs)
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iSocketIndex))
|
||||
return Py_BadArgument();
|
||||
|
||||
if (iSocketIndex >= ITEM_SOCKET_SLOT_MAX_NUM)
|
||||
if (iSocketIndex < 0 || iSocketIndex >= 8)
|
||||
return Py_BuildException();
|
||||
|
||||
TItemData * pItemData;
|
||||
if (!CPythonSafeBox::Instance().GetItemDataPtr(iSlotIndex, &pItemData))
|
||||
return Py_BuildException();
|
||||
|
||||
return Py_BuildValue("i", pItemData->alSockets[iSocketIndex]);
|
||||
return Py_BuildValue("i", iSocketIndex<3?pItemData->alSockets[iSocketIndex]:pItemData->extra.sockets[iSocketIndex-3]);
|
||||
}
|
||||
|
||||
PyObject * safeboxGetItemAttribute(PyObject * poSelf, PyObject * poArgs)
|
||||
@@ -225,11 +225,11 @@ PyObject * safeboxGetItemAttribute(PyObject * poSelf, PyObject * poArgs)
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iAttrSlotIndex))
|
||||
return Py_BuildException();
|
||||
|
||||
if (iAttrSlotIndex >= 0 && iAttrSlotIndex < ITEM_ATTRIBUTE_SLOT_MAX_NUM)
|
||||
if (iAttrSlotIndex >= 0 && iAttrSlotIndex < 15)
|
||||
{
|
||||
TItemData * pItemData;
|
||||
if (CPythonSafeBox::Instance().GetItemDataPtr(iSlotIndex, &pItemData))
|
||||
return Py_BuildValue("ii", pItemData->aAttr[iAttrSlotIndex].bType, pItemData->aAttr[iAttrSlotIndex].sValue);
|
||||
return Py_BuildValue("ii", iAttrSlotIndex<7?pItemData->aAttr[iAttrSlotIndex].bType:pItemData->extra.types[iAttrSlotIndex-7], iAttrSlotIndex<7?pItemData->aAttr[iAttrSlotIndex].sValue:pItemData->extra.values[iAttrSlotIndex-7]);
|
||||
}
|
||||
|
||||
return Py_BuildValue("ii", 0, 0);
|
||||
@@ -275,14 +275,14 @@ PyObject * safeboxGetMallItemMetinSocket(PyObject * poSelf, PyObject * poArgs)
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iSocketIndex))
|
||||
return Py_BadArgument();
|
||||
|
||||
if (iSocketIndex >= ITEM_SOCKET_SLOT_MAX_NUM)
|
||||
if (iSocketIndex < 0 || iSocketIndex >= 8)
|
||||
return Py_BuildException();
|
||||
|
||||
TItemData * pItemData;
|
||||
if (!CPythonSafeBox::Instance().GetMallItemDataPtr(iSlotIndex, &pItemData))
|
||||
return Py_BuildException();
|
||||
|
||||
return Py_BuildValue("i", pItemData->alSockets[iSocketIndex]);
|
||||
return Py_BuildValue("i", iSocketIndex<3?pItemData->alSockets[iSocketIndex]:pItemData->extra.sockets[iSocketIndex-3]);
|
||||
}
|
||||
|
||||
PyObject * safeboxGetMallItemAttribute(PyObject * poSelf, PyObject * poArgs)
|
||||
@@ -294,11 +294,11 @@ PyObject * safeboxGetMallItemAttribute(PyObject * poSelf, PyObject * poArgs)
|
||||
if (!PyTuple_GetInteger(poArgs, 1, &iAttrSlotIndex))
|
||||
return Py_BuildException();
|
||||
|
||||
if (iAttrSlotIndex >= 0 && iAttrSlotIndex < ITEM_ATTRIBUTE_SLOT_MAX_NUM)
|
||||
if (iAttrSlotIndex >= 0 && iAttrSlotIndex < 15)
|
||||
{
|
||||
TItemData * pItemData;
|
||||
if (CPythonSafeBox::Instance().GetMallItemDataPtr(iSlotIndex, &pItemData))
|
||||
return Py_BuildValue("ii", pItemData->aAttr[iAttrSlotIndex].bType, pItemData->aAttr[iAttrSlotIndex].sValue);
|
||||
return Py_BuildValue("ii", iAttrSlotIndex<7?pItemData->aAttr[iAttrSlotIndex].bType:pItemData->extra.types[iAttrSlotIndex-7], iAttrSlotIndex<7?pItemData->aAttr[iAttrSlotIndex].sValue:pItemData->extra.values[iAttrSlotIndex-7]);
|
||||
}
|
||||
|
||||
return Py_BuildValue("ii", 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user