AVA2 unlock P4: sash (mt_sash windows/slot/tooltips, sash module, CHR_EQUIPPART_SASH, item_scale)
Client side of metin2-server FEATURE-AVA2-UNLOCK P4: HEADER_CG_SASH 211 / HEADER_GC_SASH 215, a fifth awPart WORD in the character packets (old servers break), the sash part attached by scale per job/sex, the combine and absorb windows in script mt_sash, and quest tools/server/sash on 20016. The ava2items pack keeps the four grade-4 sashes plus their effects, acce window images and item_scale.txt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
0d2a9ebe36
commit
4d7306792e
@@ -756,6 +756,7 @@ bool CInstanceBase::Create(const SCreateData& c_rkCreateData)
|
||||
{
|
||||
SetHair(c_rkCreateData.m_dwHair);
|
||||
SetWeapon(c_rkCreateData.m_dwWeapon);
|
||||
SetSash(c_rkCreateData.m_dwSash); // PORT: AVA2 sash
|
||||
}
|
||||
|
||||
__Create_SetName(c_rkCreateData);
|
||||
@@ -2592,6 +2593,80 @@ void CInstanceBase::SetHair(DWORD eHair)
|
||||
m_GraphicThingInstance.SetHair(eHair);
|
||||
}
|
||||
|
||||
// PORT: AVA2 InstanceBase.cpp SetSash/ChangeSash/ClearSashEffect (ENABLE_SASH_SYSTEM + ENABLE_OBJ_SCALLING).
|
||||
// Differences: part 0 detaches the model (AVA2 looked up item 85000 and returned early, leaving the old
|
||||
// sash on), and only the item_scale.txt scale is applied (its position columns never reached the deform).
|
||||
void CInstanceBase::SetSash(DWORD dwSash)
|
||||
{
|
||||
if (!IsPC() && GetRace() > 8)
|
||||
return;
|
||||
|
||||
if (IsPC() && IsPoly())
|
||||
return;
|
||||
|
||||
m_awPart[CRaceData::PART_SASH] = dwSash;
|
||||
|
||||
ClearSashEffect();
|
||||
m_GraphicThingInstance.ClearPartScale(CRaceData::PART_SASH);
|
||||
|
||||
if (!dwSash)
|
||||
{
|
||||
m_GraphicThingInstance.AttachSash(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
dwSash += 85000;
|
||||
|
||||
float fSpecular = 65.0f;
|
||||
if (dwSash > 86000)
|
||||
{
|
||||
fSpecular += 35;
|
||||
|
||||
m_dwSashEffect = EFFECT_REFINED + EFFECT_SASH;
|
||||
__EffectContainer_AttachEffect(m_dwSashEffect);
|
||||
}
|
||||
|
||||
fSpecular /= 100.0f;
|
||||
|
||||
CItemData * pItemData;
|
||||
if (!CItemManager::Instance().GetItemDataPointer(dwSash, &pItemData))
|
||||
{
|
||||
m_GraphicThingInstance.AttachSash(NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
m_GraphicThingInstance.AttachSash(pItemData, fSpecular);
|
||||
|
||||
DWORD dwRace = GetRace(), dwPos = RaceToJob(dwRace), dwSex = RaceToSex(dwRace);
|
||||
dwPos += 1;
|
||||
if (dwSex == 0)
|
||||
dwPos += 5;
|
||||
|
||||
float fScaleX, fScaleY, fScaleZ;
|
||||
if (pItemData->GetItemScale(dwPos, fScaleX, fScaleY, fScaleZ))
|
||||
m_GraphicThingInstance.SetPartScale(CRaceData::PART_SASH, fScaleX, fScaleY, fScaleZ);
|
||||
}
|
||||
|
||||
void CInstanceBase::ChangeSash(DWORD dwSash)
|
||||
{
|
||||
if (!IsPC() && GetRace() > 7)
|
||||
return;
|
||||
|
||||
if (GetPart(CRaceData::PART_SASH) == dwSash)
|
||||
return;
|
||||
|
||||
SetSash(dwSash);
|
||||
}
|
||||
|
||||
void CInstanceBase::ClearSashEffect()
|
||||
{
|
||||
if (!m_dwSashEffect)
|
||||
return;
|
||||
|
||||
__EffectContainer_DetachEffect(m_dwSashEffect);
|
||||
m_dwSashEffect = 0;
|
||||
}
|
||||
|
||||
void CInstanceBase::ChangeHair(DWORD eHair)
|
||||
{
|
||||
if (!HAIR_COLOR_ENABLE)
|
||||
@@ -2815,6 +2890,7 @@ bool CInstanceBase::ChangeArmor(DWORD dwArmor)
|
||||
DWORD dwVID = GetVirtualID();
|
||||
DWORD dwRace = GetRace();
|
||||
DWORD eHair = GetPart(CRaceData::PART_HAIR);
|
||||
DWORD dwSash = GetPart(CRaceData::PART_SASH); // PORT: AVA2 sash
|
||||
DWORD eWeapon = GetPart(CRaceData::PART_WEAPON);
|
||||
float fRot = GetRotation();
|
||||
float fAdvRot = GetAdvancingRotation();
|
||||
@@ -2835,6 +2911,7 @@ bool CInstanceBase::ChangeArmor(DWORD dwArmor)
|
||||
|
||||
SetArmor(dwArmor);
|
||||
SetHair(eHair);
|
||||
SetSash(dwSash); // PORT: AVA2 sash
|
||||
SetWeapon(eWeapon);
|
||||
|
||||
SetRotation(fRot);
|
||||
@@ -3102,6 +3179,7 @@ void CInstanceBase::__Initialize()
|
||||
m_swordRefineEffectRight = 0;
|
||||
m_swordRefineEffectLeft = 0;
|
||||
m_armorRefineEffect = 0;
|
||||
m_dwSashEffect = 0; // PORT: AVA2 sash
|
||||
|
||||
m_sAlignment = 0;
|
||||
m_byPKMode = 0;
|
||||
|
||||
Reference in New Issue
Block a user