AVA2 unlock P5: mount costume and mount skin

COSTUME_MOUNT=2 / COSTUME_MOUNT_SKIN=4, WEAR_COSTUME_MOUNT 25 / _SKIN 26.
port_mount.cpp summons/unsummons the horse on equip, skin overrides the
mount vnum in GetMyHorseVnum; costume subtypes no longer map onto the
armor attribute sets. db ProtoReader learns COSTUME_MOUNT_SKIN.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shenlei
2026-10-16 14:00:24 +09:00
co-authored by Claude Opus 5.5
parent c30258ef5e
commit fb066e7046
16 changed files with 235 additions and 4 deletions
+3 -1
View File
@@ -113,7 +113,9 @@ enum ECostumeSubTypes
{
COSTUME_BODY = ARMOR_BODY, // [중요!!] ECostumeSubTypes enum value는 종류별로 EArmorSubTypes의 그것과 같아야 함.
COSTUME_HAIR = ARMOR_HEAD, // 이는 코스츔 아이템에 추가 속성을 붙이겠다는 사업부의 요청에 따라서 기존 로직을 활용하기 위함임.
COSTUME_SASH = 3, // AVA2 sash (85001..85024); 2 = COSTUME_MOUNT
COSTUME_MOUNT = 2, // AVA2 mount costume (value0 = horse race)
COSTUME_SASH = 3, // AVA2 sash (85001..85024)
COSTUME_MOUNT_SKIN = 4, // AVA2 mount skin (value0 = horse race, needs COSTUME_MOUNT)
COSTUME_NUM_TYPES,
};
+2
View File
@@ -138,6 +138,8 @@ enum EWearPositions
WEAR_BELT, // 23 : 신규 벨트슬롯
WEAR_COSTUME_SASH, // 24 : AVA2 sash
WEAR_COSTUME_MOUNT, // 25 : AVA2 mount costume
WEAR_COSTUME_MOUNT_SKIN, // 26 : AVA2 mount skin
WEAR_MAX = 32 //
};
+1 -1
View File
@@ -122,7 +122,7 @@ int get_Item_SubType_Value(int type_value, string inputString)
"RESOURCE_STONE", "RESOURCE_METIN", "RESOURCE_ORE" };
static string arSub16[] = { "UNIQUE_NONE", "UNIQUE_BOOK", "UNIQUE_SPECIAL_RIDE", "UNIQUE_3", "UNIQUE_4", "UNIQUE_5",
"UNIQUE_6", "UNIQUE_7", "UNIQUE_8", "UNIQUE_9", "USE_SPECIAL"};
static string arSub28[] = { "COSTUME_BODY", "COSTUME_HAIR", "COSTUME_MOUNT", "COSTUME_SASH" };
static string arSub28[] = { "COSTUME_BODY", "COSTUME_HAIR", "COSTUME_MOUNT", "COSTUME_SASH", "COSTUME_MOUNT_SKIN" };
static string arSub29[] = { "DS_SLOT1", "DS_SLOT2", "DS_SLOT3", "DS_SLOT4", "DS_SLOT5", "DS_SLOT6" };
static string arSub31[] = { "EXTRACT_DRAGON_SOUL", "EXTRACT_DRAGON_HEART" };
+1 -1
View File
@@ -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 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 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\
+8
View File
@@ -2091,6 +2091,14 @@ class CHARACTER : public CEntity, public CFSM, public CHorseRider
void RemoveSashMaterial(BYTE bPos);
BYTE CanRefineSashMaterials();
void RefineSashMaterials();
// AVA2 mount costume / skin (port_mount.cpp)
public:
bool MountCostumeCanEquip(LPITEM item);
bool MountCostumeCanUnequip(LPITEM item);
void MountCostumeEquipped(LPITEM item);
void MountCostumeUnequipped(LPITEM item, bool bAlwaysSummon);
void MountCostumeOnLogin();
};
ESex GET_SEX(LPCHARACTER ch);
+9
View File
@@ -265,6 +265,15 @@ DWORD CHARACTER::GetMyHorseVnum() const
++delta;
}
// AVA2 ENABLE_MOUNT_SKIN / ENABLE_MOUNT_COSTUME_SYSTEM: the worn skin, else the worn mount, is the horse
LPITEM pkCostumeMountSkin = GetWear(WEAR_COSTUME_MOUNT_SKIN);
if (pkCostumeMountSkin)
return pkCostumeMountSkin->GetValue(0);
LPITEM pkCostumeMount = GetWear(WEAR_COSTUME_MOUNT);
if (pkCostumeMount)
return pkCostumeMount->GetValue(0);
return c_aHorseStat[GetHorseLevel()].iNPCRace + delta;
}
+13
View File
@@ -5697,6 +5697,9 @@ bool CHARACTER::MoveItem(TItemPos Cell, TItemPos DestCell, BYTE count)
snprintf(szBuf, sizeof(szBuf), "%u %u %u %u ", item2->GetID(), item2->GetCount(), item->GetCount(), item->GetCount() + item2->GetCount());
LogManager::instance().ItemLog(this, item, "ITEM_SPLIT", szBuf);
}
if (Cell.IsEquipPosition()) // AVA2 mount costume / skin taken off by drag
MountCostumeUnequipped(item, false);
}
return true;
@@ -6100,6 +6103,8 @@ bool CHARACTER::UnequipItem(LPITEM item)
else
item->AddToCharacter(this, TItemPos(INVENTORY, pos));
MountCostumeUnequipped(item, true); // AVA2 mount costume / skin
CheckMaximumPoints();
return true;
@@ -6272,6 +6277,8 @@ bool CHARACTER::EquipItem(LPITEM item, int iCandidateCell)
{
quest::CQuestManager::instance().UseItem(GetPlayerID(), item, false);
}
MountCostumeEquipped(item); // AVA2 mount costume / skin
}
return true;
@@ -7568,6 +7575,9 @@ bool CHARACTER::CanEquipNow(const LPITEM item, const TItemPos& srcCell, const TI
}
if (!MountCostumeCanEquip(item)) // AVA2 mount skin
return false;
return true;
}
@@ -7582,6 +7592,9 @@ bool CHARACTER::CanUnequipNow(const LPITEM item, const TItemPos& srcCell, const
if (IS_SET(item->GetFlag(), ITEM_FLAG_IRREMOVABLE))
return false;
if (!MountCostumeCanUnequip(item)) // AVA2 mount costume / skin
return false;
// 아이템 unequip시 인벤토리로 옮길 때 빈 자리가 있는 지 확인
{
int pos = -1;
+4
View File
@@ -104,6 +104,10 @@ ACMD(do_user_horse_back)
if (ch->GetHorse() != NULL)
{
ch->HorseSummon(false);
// AVA2 mount costume: sending the horse back also takes the costume off
LPITEM pkCostumeMount = ch->GetWear(WEAR_COSTUME_MOUNT);
if (pkCostumeMount)
ch->UnequipItem(pkCostumeMount);
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("말을 돌려보냈습니다."));
}
else if (ch->IsHorseRiding() == true)
+2
View File
@@ -634,6 +634,8 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
ch->SendGreetMessage();
_send_bonus_info(ch);
ch->MountCostumeOnLogin(); // AVA2 mount costume
for (int i = 0; i <= PREMIUM_MAX_NUM; ++i)
{
+14
View File
@@ -523,6 +523,10 @@ int CItem::FindEquipCell(LPCHARACTER ch, int iCandidateCell)
return WEAR_COSTUME_HAIR;
else if (GetSubType() == COSTUME_SASH)
return WEAR_COSTUME_SASH;
else if (GetSubType() == COSTUME_MOUNT)
return WEAR_COSTUME_MOUNT;
else if (GetSubType() == COSTUME_MOUNT_SKIN)
return WEAR_COSTUME_MOUNT_SKIN;
}
else if (GetType() == ITEM_RING)
{
@@ -1765,6 +1769,16 @@ bool CItem::IsRideItem()
return false;
}
bool CItem::IsCostumeMount()
{
return GetType() == ITEM_COSTUME && GetSubType() == COSTUME_MOUNT;
}
bool CItem::IsCostumeMountSkin()
{
return GetType() == ITEM_COSTUME && GetSubType() == COSTUME_MOUNT_SKIN;
}
bool CItem::IsRamadanRing()
{
if (GetVnum() == UNIQUE_ITEM_RAMADAN_RING)
+2
View File
@@ -234,6 +234,8 @@ class CItem : public CEntity
public:
bool IsRideItem();
bool IsCostumeMount(); // AVA2 mount costume
bool IsCostumeMountSkin();
bool IsRamadanRing();
void ClearMountAttributeAndAffect();
+4
View File
@@ -20,6 +20,10 @@ int CItem::GetAttributeSetIndex()
return ATTRIBUTE_SET_WEAPON;
}
// AVA2 costume sub types reuse ARMOR_SHIELD/WRIST/FOOTS numbers but take no random attributes
if (GetType() == ITEM_COSTUME && (GetSubType() == COSTUME_MOUNT || GetSubType() == COSTUME_SASH || GetSubType() == COSTUME_MOUNT_SKIN))
return -1;
if (GetType() == ITEM_ARMOR || GetType() == ITEM_COSTUME)
{
switch (GetSubType())
+97
View File
@@ -0,0 +1,97 @@
// AVA2 mount costume + mount skin (ENABLE_MOUNT_COSTUME_SYSTEM / ENABLE_MOUNT_SKIN), ported onto the
// 40250 horse: the worn costume (or its skin) only replaces the horse race in GetMyHorseVnum, so
// riding still needs horse level >= 1 and uses horse stamina, exactly as on AVA2.
// Messages go to the client as "MTMOUNT <code>" commands (rendered by the client's mt_mount script)
// instead of AVA2's numeric locale strings 334 / 1097 / 1098.
#include "stdafx.h"
#include "char.h"
#include "item.h"
// AVA2 CanEquipNow: a skin needs a worn mount and cannot be put on while riding.
bool CHARACTER::MountCostumeCanEquip(LPITEM item)
{
if (!item->IsCostumeMountSkin())
return true;
if (IsRiding())
{
ChatPacket(CHAT_TYPE_COMMAND, "MTMOUNT riding");
return false;
}
if (!GetWear(WEAR_COSTUME_MOUNT))
{
ChatPacket(CHAT_TYPE_COMMAND, "MTMOUNT need_mount");
return false;
}
return true;
}
// AVA2 CanUnequipNow: neither piece comes off while riding; the mount stays while a skin is worn.
bool CHARACTER::MountCostumeCanUnequip(LPITEM item)
{
if (!item->IsCostumeMount() && !item->IsCostumeMountSkin())
return true;
if (IsRiding())
{
ChatPacket(CHAT_TYPE_COMMAND, "MTMOUNT riding");
return false;
}
if (item->IsCostumeMount() && GetWear(WEAR_COSTUME_MOUNT_SKIN))
{
ChatPacket(CHAT_TYPE_COMMAND, "MTMOUNT has_skin");
return false;
}
return true;
}
// AVA2 EquipItem tail: re-summon so the horse takes the new race.
void CHARACTER::MountCostumeEquipped(LPITEM item)
{
if (!item->IsCostumeMount() && !item->IsCostumeMountSkin())
return;
if (GetHorseLevel() <= 0)
ChatPacket(CHAT_TYPE_COMMAND, "MTMOUNT need_horse");
if (GetHorse())
HorseSummon(false);
HorseSummon(true);
}
// AVA2 UnequipItem / MoveItem: taking the mount off sends the horse away, taking the skin off
// re-summons it with the mount's race (bAlwaysSummon: UnequipItem summons even without a horse out).
void CHARACTER::MountCostumeUnequipped(LPITEM item, bool bAlwaysSummon)
{
if (item->IsCostumeMount())
{
if (GetHorse())
HorseSummon(false);
}
else if (item->IsCostumeMountSkin())
{
if (GetHorse())
{
HorseSummon(false);
HorseSummon(true);
}
else if (bAlwaysSummon)
HorseSummon(true);
}
}
// AVA2 input_login: a worn mount comes out on login.
void CHARACTER::MountCostumeOnLogin()
{
if (!GetWear(WEAR_COSTUME_MOUNT))
return;
if (!IsRiding() && !GetHorse())
HorseSummon(true);
else
StopRiding();
}