Initial commit
This commit is contained in:
1
Srcs-Server/#undefined/README.txt
Normal file
1
Srcs-Server/#undefined/README.txt
Normal file
@ -0,0 +1 @@
|
||||
This is a change that required by the system but is not part of it, I just moved code
|
||||
22
Srcs-Server/#undefined/VnumHelper.h
Normal file
22
Srcs-Server/#undefined/VnumHelper.h
Normal 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 {
|
||||
12
Srcs-Server/#undefined/item.h
Normal file
12
Srcs-Server/#undefined/item.h
Normal 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
|
||||
48
Srcs-Server/#undefined/pvp.cpp
Normal file
48
Srcs-Server/#undefined/pvp.cpp
Normal 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.
|
||||
*/
|
||||
Reference in New Issue
Block a user