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

Commit

Permalink
Merge pull request #419 from KnowOne134/charm
Browse files Browse the repository at this point in the history
make all NMs not charmable
  • Loading branch information
ibm2431 authored Mar 27, 2020
2 parents f4b1fbe + 33918de commit 5991d15
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
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

0 comments on commit 5991d15

Please sign in to comment.