AVA2 unlock P8: new rings (ITEM_NEW_RINGS, WEAR_RINGS_1/2)
Rings are socket accessories with AVA2's jewel per family and the item_attr_rings pool (port_rings.cpp); the 40250 switchers / adders accept them, the switchbot and rare attributes skip them. New ProtoReader type, so the db binary changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
f09ffd8a35
commit
e313d9ea85
@@ -76,6 +76,8 @@ enum EItemTypes
|
||||
ITEM_SECONDARY_COIN, //32 ?? 명도전??
|
||||
ITEM_RING, //33 반지
|
||||
ITEM_BELT, //34 벨트
|
||||
ITEM_SHINING, //35 AVA2 shining (not ported, keeps the AVA2 numbering)
|
||||
ITEM_NEW_RINGS, //36 AVA2 new rings (port_rings.cpp), worn in WEAR_RINGS_1/2
|
||||
};
|
||||
|
||||
enum EMetinSubTypes
|
||||
|
||||
@@ -141,6 +141,8 @@ enum EWearPositions
|
||||
WEAR_COSTUME_MOUNT, // 25 : AVA2 mount costume
|
||||
WEAR_COSTUME_MOUNT_SKIN, // 26 : AVA2 mount skin
|
||||
WEAR_PENDANT, // 27 : AVA2 talisman (ARMOR_PENDANT)
|
||||
WEAR_RINGS_1, // 28 : AVA2 new ring (ITEM_NEW_RINGS)
|
||||
WEAR_RINGS_2, // 29 : AVA2 new ring
|
||||
|
||||
WEAR_MAX = 32 //
|
||||
};
|
||||
|
||||
@@ -79,6 +79,7 @@ int get_Item_Type_Value(string inputString)
|
||||
|
||||
"ITEM_RING",
|
||||
"ITEM_BELT", //35개 (EItemTypes 값으로 치면 34)
|
||||
"ITEM_SHINING", "ITEM_NEW_RINGS", // AVA2 35 (not ported), 36 new rings
|
||||
};
|
||||
|
||||
|
||||
@@ -161,6 +162,8 @@ int get_Item_SubType_Value(int type_value, string inputString)
|
||||
0, //32
|
||||
0, //33 반지
|
||||
0, //34 벨트
|
||||
0, //35 ITEM_SHINING
|
||||
0, //36 ITEM_NEW_RINGS
|
||||
};
|
||||
static int arNumberOfSubtype[_countof(arSubType)] = {
|
||||
0,
|
||||
@@ -198,6 +201,8 @@ int get_Item_SubType_Value(int type_value, string inputString)
|
||||
0, // 32
|
||||
0, // 33 반지
|
||||
0, // 34 벨트
|
||||
0, // 35
|
||||
0, // 36
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ CPPFILE = BattleArena.cpp FSM.cpp MarkConvert.cpp MarkImage.cpp MarkManager.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\
|
||||
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 port_attr_lock.cpp port_sash.cpp port_mount.cpp port_costume_attr.cpp port_pendant.cpp input_teen.cpp input_udp.cpp ip_ban.cpp\
|
||||
input_login.cpp input_main.cpp input_p2p.cpp port_boss_track.cpp port_attr_lock.cpp port_sash.cpp port_mount.cpp port_costume_attr.cpp port_pendant.cpp port_rings.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\
|
||||
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\
|
||||
|
||||
@@ -1901,6 +1901,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
||||
case ITEM_ROD:
|
||||
case ITEM_RING: // 신규 반지 아이템
|
||||
case ITEM_BELT: // 신규 벨트 아이템
|
||||
case ITEM_NEW_RINGS: // AVA2 new rings
|
||||
// MINING
|
||||
case ITEM_PICK:
|
||||
// END_OF_MINING
|
||||
@@ -4564,7 +4565,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
||||
break;
|
||||
|
||||
case USE_CHANGE_ATTRIBUTE :
|
||||
if (item2->GetAttributeSetIndex() == -1)
|
||||
if (item2->GetAttributeSetIndex() == -1 && !item2->IsNewRing())
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("속성을 변경할 수 없는 아이템입니다."));
|
||||
return false;
|
||||
@@ -4669,7 +4670,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
||||
break;
|
||||
|
||||
case USE_ADD_ATTRIBUTE :
|
||||
if (item2->GetAttributeSetIndex() == -1)
|
||||
if (item2->GetAttributeSetIndex() == -1 && !item2->IsNewRing())
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("속성을 변경할 수 없는 아이템입니다."));
|
||||
return false;
|
||||
@@ -4741,7 +4742,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
|
||||
case USE_ADD_ATTRIBUTE2 :
|
||||
// 축복의 구슬
|
||||
// 재가비서를 통해 속성을 4개 추가 시킨 아이템에 대해서 하나의 속성을 더 붙여준다.
|
||||
if (item2->GetAttributeSetIndex() == -1)
|
||||
if (item2->GetAttributeSetIndex() == -1 && !item2->IsNewRing())
|
||||
{
|
||||
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("속성을 변경할 수 없는 아이템입니다."));
|
||||
return false;
|
||||
|
||||
@@ -492,7 +492,7 @@ int CItem::FindEquipCell(LPCHARACTER ch, int iCandidateCell)
|
||||
|
||||
// 코스츔 아이템(ITEM_COSTUME)은 WearFlag 없어도 됨. (sub type으로 착용위치 구분. 귀찮게 또 wear flag 줄 필요가 있나..)
|
||||
// 용혼석(ITEM_DS, ITEM_SPECIAL_DS)도 SUB_TYPE으로 구분. 신규 반지, 벨트는 ITEM_TYPE으로 구분 -_-
|
||||
if ((0 == GetWearFlag() || ITEM_TOTEM == GetType()) && ITEM_COSTUME != GetType() && ITEM_DS != GetType() && ITEM_SPECIAL_DS != GetType() && ITEM_RING != GetType() && ITEM_BELT != GetType())
|
||||
if ((0 == GetWearFlag() || ITEM_TOTEM == GetType()) && ITEM_COSTUME != GetType() && ITEM_DS != GetType() && ITEM_SPECIAL_DS != GetType() && ITEM_RING != GetType() && ITEM_BELT != GetType() && ITEM_NEW_RINGS != GetType())
|
||||
return -1;
|
||||
|
||||
// 용혼석 슬롯을 WEAR로 처리할 수가 없어서(WEAR는 최대 32개까지 가능한데 용혼석을 추가하면 32가 넘는다.)
|
||||
@@ -540,6 +540,13 @@ int CItem::FindEquipCell(LPCHARACTER ch, int iCandidateCell)
|
||||
}
|
||||
else if (GetType() == ITEM_BELT)
|
||||
return WEAR_BELT;
|
||||
else if (GetType() == ITEM_NEW_RINGS) // AVA2 new rings
|
||||
{
|
||||
if (ch->GetWear(WEAR_RINGS_1))
|
||||
return WEAR_RINGS_2;
|
||||
else
|
||||
return WEAR_RINGS_1;
|
||||
}
|
||||
else if (GetWearFlag() & WEARABLE_BODY)
|
||||
return WEAR_BODY;
|
||||
else if (GetWearFlag() & WEARABLE_HEAD)
|
||||
@@ -877,6 +884,7 @@ bool CItem::IsEquipable() const
|
||||
case ITEM_SPECIAL_DS:
|
||||
case ITEM_RING:
|
||||
case ITEM_BELT:
|
||||
case ITEM_NEW_RINGS:
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1650,7 +1658,7 @@ int CItem::GetSpecialGroup() const
|
||||
bool CItem::IsAccessoryForSocket()
|
||||
{
|
||||
return (m_pProto->bType == ITEM_ARMOR && (m_pProto->bSubType == ARMOR_WRIST || m_pProto->bSubType == ARMOR_NECK || m_pProto->bSubType == ARMOR_EAR)) ||
|
||||
(m_pProto->bType == ITEM_BELT); // 2013년 2월 새로 추가된 '벨트' 아이템의 경우 기획팀에서 악세서리 소켓 시스템을 그대로 이용하자고 함.
|
||||
(m_pProto->bType == ITEM_BELT) || (m_pProto->bType == ITEM_NEW_RINGS); // 2013년 2월 새로 추가된 '벨트' 아이템의 경우 기획팀에서 악세서리 소켓 시스템을 그대로 이용하자고 함.
|
||||
}
|
||||
|
||||
void CItem::SetAccessorySocketGrade(int iGrade)
|
||||
@@ -1867,6 +1875,10 @@ bool CItem::CanPutInto(LPITEM item)
|
||||
else if(item->GetType() == ITEM_RING)
|
||||
return CanPutIntoRing(item, this);
|
||||
|
||||
// AVA2 new rings take the jewel of the matching AVA2 accessory family (port_rings.cpp).
|
||||
else if (item->GetType() == ITEM_NEW_RINGS)
|
||||
return GetVnum() == GetNewRingJewelVnum(item->GetVnum());
|
||||
|
||||
else if (item->GetType() != ITEM_ARMOR)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -239,6 +239,8 @@ class CItem : public CEntity
|
||||
bool IsCostumeEnchant(); // AVA2 costume enchant (port_costume_attr.cpp)
|
||||
bool IsTalisman(); // AVA2 talisman (port_pendant.cpp)
|
||||
int GetPendantScrollKind();
|
||||
bool IsNewRing(); // AVA2 new rings (port_rings.cpp)
|
||||
void PutNewRingAttributeWithLevel(BYTE bLevel);
|
||||
bool IsRamadanRing();
|
||||
|
||||
void ClearMountAttributeAndAffect();
|
||||
@@ -336,4 +338,6 @@ EVENTINFO(item_vid_event_info)
|
||||
}
|
||||
};
|
||||
|
||||
DWORD GetNewRingJewelVnum(DWORD dwRingVnum); // port_rings.cpp, 0 = none
|
||||
|
||||
#endif
|
||||
|
||||
@@ -118,6 +118,12 @@ void CItem::AddAttr(BYTE bApply, BYTE bLevel)
|
||||
|
||||
void CItem::PutAttributeWithLevel(BYTE bLevel)
|
||||
{
|
||||
if (IsNewRing())
|
||||
{
|
||||
PutNewRingAttributeWithLevel(bLevel);
|
||||
return;
|
||||
}
|
||||
|
||||
int iAttributeSet = GetAttributeSetIndex();
|
||||
|
||||
if (iAttributeSet < 0)
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
// AVA2 new rings (ENABLE_NEW_RINGS): ITEM_NEW_RINGS (36), worn in WEAR_RINGS_1 / WEAR_RINGS_2 (item.cpp
|
||||
// FindEquipCell). They are socket accessories like the 40250 bracelets / necklaces / earrings (IsAccessoryForSocket):
|
||||
// drills add sockets, and each ring family takes the jewel of the matching AVA2 accessory family (CanPutInto).
|
||||
// Their random attributes come from AVA2's item_attr_rings table. As with the talismans (port_pendant.cpp), that
|
||||
// table is not added to 203's item_attr / ATTRIBUTE_SET_*, which would change the db -> game boot packet: the pool
|
||||
// lives here, GetAttributeSetIndex() stays -1 and PutAttributeWithLevel() branches to it, and the 40250 switchers /
|
||||
// adders accept rings (char_item.cpp). The switchbot and the rare (6th / 7th) attributes skip rings; AVA2's
|
||||
// item_attr_rare_rings is not ported. Rings drop without attributes (AlterToMagicItem only handles weapons / armor).
|
||||
#include "stdafx.h"
|
||||
#include "constants.h"
|
||||
#include "item.h"
|
||||
|
||||
namespace
|
||||
{
|
||||
struct RingAttr
|
||||
{
|
||||
BYTE bApply;
|
||||
DWORD dwProb;
|
||||
short asValues[ITEM_ATTRIBUTE_MAX_LEVEL];
|
||||
};
|
||||
|
||||
// AVA2 player.item_attr_rings (all with max level 5).
|
||||
const RingAttr s_aRingAttr[] =
|
||||
{
|
||||
{ APPLY_MAX_HP, 35, { 200, 300, 300, 500, 500 } },
|
||||
{ APPLY_MAX_SP, 35, { 200, 200, 200, 350, 350 } },
|
||||
{ APPLY_PENETRATE_PCT, 20, { 3, 3, 3, 5, 5 } },
|
||||
{ APPLY_REFLECT_MELEE, 15, { 2, 2, 2, 3, 3 } },
|
||||
{ APPLY_STEAL_SP, 15, { 2, 2, 2, 3, 3 } },
|
||||
{ APPLY_STEAL_HP, 15, { 2, 2, 2, 3, 3 } },
|
||||
{ APPLY_GOLD_DOUBLE_BONUS, 20, { 4, 4, 4, 8, 8 } },
|
||||
{ APPLY_POISON_REDUCE, 15, { 2, 2, 2, 3, 3 } },
|
||||
{ APPLY_RESIST_MAGIC, 15, { 2, 3, 3, 5, 5 } },
|
||||
{ APPLY_ATTBONUS_DEVIL, 20, { 4, 4, 4, 8, 8 } },
|
||||
{ APPLY_ATTBONUS_UNDEAD, 20, { 4, 4, 4, 8, 8 } },
|
||||
{ APPLY_ATTBONUS_MILGYO, 20, { 4, 4, 4, 8, 8 } },
|
||||
{ APPLY_ATTBONUS_ORC, 20, { 4, 4, 4, 8, 8 } },
|
||||
{ APPLY_ATTBONUS_ANIMAL, 20, { 4, 4, 4, 8, 8 } },
|
||||
{ APPLY_ATTBONUS_HUMAN, 15, { 3, 3, 3, 5, 5 } },
|
||||
{ APPLY_CRITICAL_PCT, 20, { 3, 3, 3, 5, 5 } },
|
||||
{ APPLY_HP_REGEN, 20, { 8, 8, 8, 12, 12 } },
|
||||
{ APPLY_SP_REGEN, 20, { 8, 8, 8, 12, 12 } },
|
||||
{ APPLY_POISON_PCT, 15, { 3, 3, 3, 5, 5 } },
|
||||
{ APPLY_SLOW_PCT, 15, { 3, 3, 3, 5, 5 } },
|
||||
};
|
||||
|
||||
// AVA2 CItem::CanPutInto / GetAccessorySocketVnumRings: ring family (vnum / 10 * 10) -> jewel.
|
||||
const struct { DWORD dwRing, dwJewel; } s_aRingJewel[] =
|
||||
{
|
||||
{ 19220, 50634 },
|
||||
{ 19500, 50635 },
|
||||
{ 19520, 50636 },
|
||||
{ 19540, 50637 },
|
||||
{ 19560, 50638 },
|
||||
};
|
||||
}
|
||||
|
||||
bool CItem::IsNewRing()
|
||||
{
|
||||
return GetType() == ITEM_NEW_RINGS;
|
||||
}
|
||||
|
||||
DWORD GetNewRingJewelVnum(DWORD dwRingVnum)
|
||||
{
|
||||
const DWORD dwFamily = dwRingVnum / 10 * 10;
|
||||
|
||||
for (size_t i = 0; i < sizeof(s_aRingJewel) / sizeof(s_aRingJewel[0]); ++i)
|
||||
if (s_aRingJewel[i].dwRing == dwFamily)
|
||||
return s_aRingJewel[i].dwJewel;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// CItem::PutAttributeWithLevel over the ring pool (bLevel 1..5).
|
||||
void CItem::PutNewRingAttributeWithLevel(BYTE bLevel)
|
||||
{
|
||||
if (bLevel < 1 || bLevel > ITEM_ATTRIBUTE_MAX_LEVEL)
|
||||
return;
|
||||
|
||||
DWORD dwTotal = 0;
|
||||
|
||||
for (size_t i = 0; i < sizeof(s_aRingAttr) / sizeof(s_aRingAttr[0]); ++i)
|
||||
if (!HasAttr(s_aRingAttr[i].bApply))
|
||||
dwTotal += s_aRingAttr[i].dwProb;
|
||||
|
||||
if (!dwTotal)
|
||||
return;
|
||||
|
||||
DWORD dwProb = number(1, dwTotal);
|
||||
|
||||
for (size_t i = 0; i < sizeof(s_aRingAttr) / sizeof(s_aRingAttr[0]); ++i)
|
||||
{
|
||||
const RingAttr & r = s_aRingAttr[i];
|
||||
|
||||
if (HasAttr(r.bApply))
|
||||
continue;
|
||||
|
||||
if (dwProb <= r.dwProb)
|
||||
{
|
||||
AddAttribute(r.bApply, r.asValues[bLevel - 1]);
|
||||
return;
|
||||
}
|
||||
|
||||
dwProb -= r.dwProb;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user