Skip to content

Commit

Permalink
Core: Adds region check for Ionis and corrects conquest latent error …
Browse files Browse the repository at this point in the history
…message
  • Loading branch information
LoxleyXI committed Aug 16, 2024
1 parent c45e9a8 commit 407c8af
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/map/conquest_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ uint8 ConquestData::getRegionOwner(REGION_TYPE region) const
return regionControls[regionNum].current;
}

ShowError(fmt::format("Invalid conquest region passed to function ({})", regionNum));
// This can be called for Latent effects that work outside of conquest areas eg. Dynamis/Limbus
if (regionNum > (uint8)REGION_TYPE::LIMBUS)
{
ShowError(fmt::format("Invalid conquest region passed to function ({})", regionNum));
}

return 0;
}

Expand Down
18 changes: 17 additions & 1 deletion src/map/entities/mobentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,7 @@ void CMobEntity::DropItems(CCharEntity* PChar)
if (m_Element > 0)
{
REGION_TYPE regionID = PChar->loc.zone->GetRegionID();

switch (regionID)
{
// Sanction Regions
Expand All @@ -1006,6 +1007,7 @@ void CMobEntity::DropItems(CCharEntity* PChar)
case REGION_TYPE::ARRAPAGO:
effect = 2;
break;

// Sigil Regions
case REGION_TYPE::RONFAURE_FRONT:
case REGION_TYPE::NORVALLEN_FRONT:
Expand All @@ -1017,9 +1019,16 @@ void CMobEntity::DropItems(CCharEntity* PChar)
case REGION_TYPE::VALDEAUNIA_FRONT:
effect = 3;
break;

// Ionis Regions
case REGION_TYPE::ADOULIN_ISLANDS:
case REGION_TYPE::EAST_ULBUKA:
effect = 4;
break;

// Signet Regions
default:
effect = (conquest::GetRegionOwner(PChar->loc.zone->GetRegionID()) <= 2) ? 1 : 0;
effect = (regionID < REGION_TYPE::TAVNAZIA && conquest::GetRegionOwner(regionID) <= 2) ? 1 : 0;
break;
}
}
Expand Down Expand Up @@ -1050,6 +1059,13 @@ void CMobEntity::DropItems(CCharEntity* PChar)
crystalRolls++;
}
break;
case 4:
if (PMember->StatusEffectContainer->HasStatusEffect(EFFECT_IONIS) && PMember->getZone() == getZone() &&
distance(PMember->loc.p, loc.p) < 100)
{
crystalRolls++;
}
break;
default:
break;
}
Expand Down

0 comments on commit 407c8af

Please sign in to comment.