diff --git a/src/map/utils/mobutils.cpp b/src/map/utils/mobutils.cpp index d9da85d49b2..129e2d6c18e 100644 --- a/src/map/utils/mobutils.cpp +++ b/src/map/utils/mobutils.cpp @@ -788,6 +788,11 @@ namespace mobutils SetupNMMob(PMob); } + if (zoneType & ZONE_TYPE::INSTANCED) + { + SetupDungeonInstanceMob(PMob); + } + if (PMob->m_Type & MOBTYPE_EVENT) { SetupEventMob(PMob); @@ -1155,6 +1160,26 @@ namespace mobutils } } + void SetupDungeonInstanceMob(CMobEntity* PMob) + { + PMob->setMobMod(MOBMOD_GIL_MAX, 0); + PMob->setMobMod(MOBMOD_MUG_GIL, 0); + PMob->loc.p = PMob->m_SpawnPoint; + // never despawn + PMob->SetDespawnTime(0s); + PMob->setMobMod(MOBMOD_NO_DESPAWN, 1); + // Salvage and Nyzul + if (PMob->getZone() >= ZONE_ZHAYOLM_REMNANTS && PMob->getZone() <= ZONE_NYZUL_ISLE) + { + // Salvage and Nyzul mobs can not be charmed + PMob->setMobMod(MOBMOD_CHARMABLE, 0); + if (PMob->getZone() != ZONE_NYZUL_ISLE) + { + PMob->setMobMod(MOBMOD_CHECK_AS_NM, 1); + } + } + } + void RecalculateSpellContainer(CMobEntity* PMob) { // clear spell list diff --git a/src/map/utils/mobutils.h b/src/map/utils/mobutils.h index 811c862b1fa..f4562377869 100644 --- a/src/map/utils/mobutils.h +++ b/src/map/utils/mobutils.h @@ -62,6 +62,7 @@ namespace mobutils void SetupDungeonMob(CMobEntity* PMob); void SetupEventMob(CMobEntity* PMob); void SetupNMMob(CMobEntity* PMob); + void SetupDungeonInstanceMob(CMobEntity* PMob); void SetupPetSkills(CMobEntity* PMob); uint8 JobSkillRankToBaseEvaRank(JOBTYPE job);