Patch 0.2
This commit is contained in:
@ -39,26 +39,6 @@
|
||||
// and add under, this:
|
||||
|
||||
#ifdef ENABLE_MOUNT_LIKE_HORSE
|
||||
RemoveAffect(AFFECT_MOUNT_BONUS);
|
||||
if (const auto pMountItem = GetWear(WEAR_COSTUME_MOUNT))
|
||||
{
|
||||
for (int i = 0; i < ITEM_APPLY_MAX_NUM; ++i) {
|
||||
if (pMountItem->GetProto()->aApplies[i].bType == APPLY_NONE || vnum == 0)
|
||||
continue;
|
||||
AddAffect(AFFECT_MOUNT_BONUS, aApplyInfo[pMountItem->GetProto()->aApplies[i].bType].bPointType, pMountItem->GetProto()->aApplies[i].lValue, AFF_NONE, INFINITE_AFFECT_DURATION, 0, false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// 3.) Add at the end of the file:
|
||||
|
||||
#ifdef ENABLE_MOUNT_LIKE_HORSE
|
||||
void CHARACTER::CheckEnterMount()
|
||||
{
|
||||
if (GetHorse()) // If is already summoned, do nothing
|
||||
return;
|
||||
|
||||
if (const auto pMountItem = GetWear(WEAR_COSTUME_MOUNT))
|
||||
HorseSummon(true, false, pMountItem->GetValue(1));
|
||||
}
|
||||
CalcBonusMount(pMountItem);
|
||||
#endif
|
||||
@ -9,6 +9,7 @@ ESex GET_SEX(LPCHARACTER ch);
|
||||
#ifdef ENABLE_MOUNT_LIKE_HORSE
|
||||
public:
|
||||
void CheckEnterMount();
|
||||
void CalcMountBonusBySeal(const LPITEM pMountItem);
|
||||
#endif
|
||||
|
||||
// like:
|
||||
@ -17,6 +18,7 @@ ESex GET_SEX(LPCHARACTER ch);
|
||||
#ifdef ENABLE_MOUNT_LIKE_HORSE
|
||||
public:
|
||||
void CheckEnterMount();
|
||||
void CalcMountBonusBySeal(const LPITEM pMountItem);
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@ -25,10 +25,8 @@
|
||||
if (m_chHorse)
|
||||
{
|
||||
#ifdef ENABLE_MOUNT_LIKE_HORSE
|
||||
if (GetMountVnum() != dwVnum) {
|
||||
HorseSummon(false);
|
||||
HorseSummon(true);
|
||||
}
|
||||
if (GetMountVnum() != dwVnum)
|
||||
m_chHorse->SetPolymorph(dwVnum);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@ -45,11 +43,9 @@ void CHARACTER::HorseSummon(bool bSummon, bool bFromFar, DWORD dwVnum, const cha
|
||||
// NOTE: If you summon and there is already a horse, it will do nothing.
|
||||
if (m_chHorse)
|
||||
{
|
||||
#ifdef ENABLE_MOUNT_LIKE_HORSE // try fix
|
||||
if (GetMountVnum() != dwVnum) {
|
||||
HorseSummon(false);
|
||||
HorseSummon(true);
|
||||
}
|
||||
#ifdef ENABLE_MOUNT_LIKE_HORSE
|
||||
if (GetMountVnum() != dwVnum)
|
||||
m_chHorse->SetPolymorph(dwVnum);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@ -121,3 +117,29 @@ void CHARACTER::HorseSummon(bool bSummon, bool bFromFar, DWORD dwVnum, const cha
|
||||
#endif
|
||||
}
|
||||
*/
|
||||
|
||||
/// 4.) Add at the end of the file:
|
||||
|
||||
#ifdef ENABLE_MOUNT_LIKE_HORSE
|
||||
void CHARACTER::CheckEnterMount()
|
||||
{
|
||||
if (GetHorse()) // If is already summoned, do nothing
|
||||
return;
|
||||
|
||||
if (const auto pMountItem = GetWear(WEAR_COSTUME_MOUNT))
|
||||
HorseSummon(true, false, pMountItem->GetValue(1));
|
||||
}
|
||||
|
||||
void CHARACTER::CalcMountBonusBySeal(const LPITEM pMountItem)
|
||||
{
|
||||
if (!GetMountVnum() || !pMountItem || !pMountItem->IsMount())
|
||||
return;
|
||||
|
||||
RemoveAffect(AFFECT_MOUNT_BONUS);
|
||||
for (int i = 0; i < ITEM_APPLY_MAX_NUM; ++i) {
|
||||
if (pMountItem->GetProto()->aApplies[i].bType == APPLY_NONE || pMountItem->GetValue(1) == 0)
|
||||
continue;
|
||||
AddAffect(AFFECT_MOUNT_BONUS, aApplyInfo[pMountItem->GetProto()->aApplies[i].bType].bPointType, pMountItem->GetProto()->aApplies[i].lValue, AFF_NONE, INFINITE_AFFECT_DURATION, 0, false);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -25,10 +25,8 @@
|
||||
// and add under, this:
|
||||
|
||||
#ifdef ENABLE_MOUNT_LIKE_HORSE
|
||||
if (item1->IsMount() && item2->IsMount() && destCell.IsEquipPosition()) {
|
||||
HorseSummon(false);
|
||||
if (item1->IsMount() && item2->IsMount() && destCell.IsEquipPosition())
|
||||
HorseSummon(true);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// 3.) Search in bool CHARACTER::UnequipItem(LPITEM item):
|
||||
@ -53,3 +51,12 @@
|
||||
if (item->IsMount())
|
||||
HorseSummon(true);
|
||||
#endif
|
||||
|
||||
/// 5.) in CHARACTER::SetWear(BYTE bCell, LPITEM item):
|
||||
|
||||
// at the end before the }, add:
|
||||
|
||||
#ifdef ENABLE_MOUNT_LIKE_HORSE
|
||||
if (item)
|
||||
CalcBonusMount(item);
|
||||
#endif
|
||||
51
Srcs-Server/game/src/item_manager.cpp
Normal file
51
Srcs-Server/game/src/item_manager.cpp
Normal file
@ -0,0 +1,51 @@
|
||||
/// 1.) Search in void ITEM_MANAGER::RemoveItem(LPITEM item, const char * c_pszReason)
|
||||
|
||||
}
|
||||
// END_OF_SAFEBOX_TIME_LIMIT_ITEM_BUG_FIX
|
||||
else
|
||||
{
|
||||
|
||||
// and add under, this:
|
||||
|
||||
#ifdef ENABLE_MOUNT_LIKE_HORSE
|
||||
if (o->GetWear(WEAR_COSTUME_MOUNT) && item == o->GetWear(WEAR_COSTUME_MOUNT)) {
|
||||
o->StopRiding();
|
||||
o->HorseSummon(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*Example:
|
||||
void ITEM_MANAGER::RemoveItem(LPITEM item, const char * c_pszReason)
|
||||
{
|
||||
LPCHARACTER o;
|
||||
|
||||
if ((o = item->GetOwner()))
|
||||
{
|
||||
char szHint[64]{};
|
||||
snprintf(szHint, sizeof(szHint), "%s %u ", item->GetName(), item->GetCount());
|
||||
LogManager::instance().ItemLog(o, item, c_pszReason ? c_pszReason : "REMOVE", szHint);
|
||||
|
||||
// SAFEBOX_TIME_LIMIT_ITEM_BUG_FIX
|
||||
if (item->GetWindow() == MALL || item->GetWindow() == SAFEBOX)
|
||||
{
|
||||
// If you have a timed item in your store, the server will go down when the time expires.
|
||||
if (const auto pSafebox = item->GetWindow() == MALL ? o->GetMall() : o->GetSafebox())
|
||||
pSafebox->Remove(item->GetCell());
|
||||
}
|
||||
// END_OF_SAFEBOX_TIME_LIMIT_ITEM_BUG_FIX
|
||||
else
|
||||
{
|
||||
#ifdef ENABLE_MOUNT_LIKE_HORSE
|
||||
if (o->GetWear(WEAR_COSTUME_MOUNT) && item == o->GetWear(WEAR_COSTUME_MOUNT)) {
|
||||
o->StopRiding();
|
||||
o->HorseSummon(false);
|
||||
}
|
||||
#endif
|
||||
o->SyncQuickslot(QUICKSLOT_TYPE_ITEM, item->GetCell(), 255);
|
||||
item->RemoveFromCharacter();
|
||||
}
|
||||
}
|
||||
|
||||
M2_DESTROY_ITEM(item);
|
||||
}
|
||||
*/
|
||||
Reference in New Issue
Block a user