Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

make all NMs not charmable #419

Merged
merged 2 commits into from
Mar 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/map/instance_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,14 @@ CInstance* CInstanceLoader::LoadInstance(CInstance* instance)

PMob->setMobMod(MOBMOD_CHARMABLE, Sql_GetUIntData(SqlInstanceHandle, 65));

// Overwrite base family charmables depending on mob type. Disallowed mobs which should be charmable
// can be set in mob_spawn_mods or in their onInitialize
if (PMob->m_Type & MOBTYPE_EVENT || PMob->m_Type & MOBTYPE_FISHED || PMob->m_Type & MOBTYPE_BATTLEFIELD ||
PMob->m_Type & MOBTYPE_NOTORIOUS)
{
PMob->setMobMod(MOBMOD_CHARMABLE, 0);
}

// must be here first to define mobmods
mobutils::InitializeMob(PMob, zone);
PMob->PInstance = instance;
Expand Down
6 changes: 0 additions & 6 deletions src/map/utils/mobutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,12 +561,6 @@ void CalculateStats(CMobEntity * PMob)
PMob->ResetGilPurse();
}

if(PMob->m_Type & MOBTYPE_EVENT || PMob->m_Type & MOBTYPE_FISHED || PMob->m_Type & MOBTYPE_BATTLEFIELD ||
zoneType == ZONETYPE_BATTLEFIELD || zoneType == ZONETYPE_DYNAMIS)
{
PMob->setMobMod(MOBMOD_CHARMABLE, 0);
}

// Check for possible miss-setups
if (PMob->getMobMod(MOBMOD_SPECIAL_SKILL) != 0 && PMob->getMobMod(MOBMOD_SPECIAL_COOL) == 0)
{
Expand Down
11 changes: 10 additions & 1 deletion src/map/utils/zoneutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,9 @@ void LoadMOBList()
while (Sql_NextRow(SqlHandle) == SQL_SUCCESS)
{
uint16 ZoneID = (uint16)Sql_GetUIntData(SqlHandle, 0);
ZONETYPE zoneType = GetZone(ZoneID)->GetType();

if (GetZone(ZoneID)->GetType() != ZONETYPE_DUNGEON_INSTANCED)
if (zoneType != ZONETYPE_DUNGEON_INSTANCED)
{
CMobEntity* PMob = new CMobEntity;

Expand Down Expand Up @@ -493,6 +494,14 @@ void LoadMOBList()

PMob->setMobMod(MOBMOD_CHARMABLE, Sql_GetUIntData(SqlHandle, 67));

// Overwrite base family charmables depending on mob type. Disallowed mobs which should be charmable
// can be set in mob_spawn_mods or in their onInitialize
if (PMob->m_Type & MOBTYPE_EVENT || PMob->m_Type & MOBTYPE_FISHED || PMob->m_Type & MOBTYPE_BATTLEFIELD ||
PMob->m_Type & MOBTYPE_NOTORIOUS || zoneType == ZONETYPE_BATTLEFIELD || zoneType == ZONETYPE_DYNAMIS)
{
PMob->setMobMod(MOBMOD_CHARMABLE, 0);
}

// must be here first to define mobmods
mobutils::InitializeMob(PMob, GetZone(ZoneID));

Expand Down