Initial commit

This commit is contained in:
Mitachi
2024-02-05 18:59:21 +01:00
commit 1a73ca484c
13 changed files with 364 additions and 0 deletions

View File

@ -0,0 +1 @@
This is a change that required by the system but is not part of it, I just moved code

View File

@ -0,0 +1,22 @@
// Search:
static bool IsPhoenix(DWORD vnum) { return 34001 == vnum; }
// add under, this:
static bool IsMount(DWORD vnum) {
switch (vnum) {
case 20030: case 20110: case 20111: case 20112: case 20113: case 20114: case 20115:
case 20116: case 20117: case 20118: case 20205: case 20206: case 20207: case 20208:
case 20209: case 20210: case 20211: case 20212: case 20119: case 20219: case 20220:
case 20221: case 20222: case 20120: case 20121: case 20122: case 20123: case 20124:
case 20125: case 20214: case 20215: case 20217: case 20218: case 20224: case 20225:
case 20226: case 20227:
return true;
default:
return false;
}
}
// If you are sick:
static constexpr bool IsMount(const DWORD& vnum) noexcept {

View File

@ -0,0 +1,12 @@
// Search:
DWORD GetSIGVnum() const
{
return m_dwSIGVnum;
}
// add under, this:
// #ifdef ENABLE_MOUNT_COSTUME
const bool IsMount() { return GetType() == ITEM_COSTUME && GetSubType() == COSTUME_MOUNT; }
// #endif

View File

@ -0,0 +1,48 @@
// Search:
#include "locale_service.h"
// add under, this:
#include "../../common/VnumHelper.h"
// Search:
if( true == pkChr->IsHorseRiding() )
{
if( pkChr->GetHorseLevel() > 0 && 1 == pkChr->GetHorseGrade() )
return false;
}
else
{
if(!g_bAllMountAttack)
{
switch( pkChr->GetMountVnum() )
{
case 0:
case 20030:
....
}
}
}
// and replace with:
if (pkChr->IsHorseRiding())
{
if (pkChr->GetHorseLevel() > 0 && 1 == pkChr->GetHorseGrade())
return false;
}
else {
const auto mountVnum = pkChr->GetMountVnum();
if (mountVnum != 0 && !CMobVnumHelper::IsMount(mountVnum))
return false;
}
/*
NOTE: Make sure that all the cases you had in the switch,
are present in the new IsMount method added in VnumHelper.h
Also: g_bAllMountAttack comes from novaline, however if you have mainline replace the if/else statement anyway.
*/