Skip to content
Open
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
182 changes: 91 additions & 91 deletions src/map/action/interrupts.cpp

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/map/ai/states/ability_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@ CAbilityState::CAbilityState(CBattleEntity* PEntity, uint16 targid, uint16 abili
.actiontype = ActionCategory::AbilityStart,
.targets = {
{
.actorId = PTarget->id,
.results = {
.actorId = PTarget->id,
.results = {
{
.animation = ActionAnimation::SkillStart,
.param = PAbility->getID(),
.messageID = MsgBasic::ReadiesSkill,
.animation = ActionAnimation::SkillStart,
.param = PAbility->getID(),
.messageID = MsgBasic::ReadiesSkill,
},
},
},
Expand Down
8 changes: 4 additions & 4 deletions src/map/ai/states/item_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ CItemState::CItemState(CCharEntity* PEntity, const uint16 targid, const uint8 lo
.actionid = static_cast<uint32_t>(FourCC::ItemUse),
.targets = {
{
.actorId = PTarget->id,
.results = {
.actorId = PTarget->id,
.results = {
{
.param = m_PItem->getID(),
.messageID = MsgBasic::ItemUse,
.param = m_PItem->getID(),
.messageID = MsgBasic::ItemUse,
},
},
},
Expand Down
8 changes: 4 additions & 4 deletions src/map/ai/states/magic_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ CMagicState::CMagicState(CBattleEntity* PEntity, uint16 targid, SpellID spellid,
.spellgroup = m_PSpell->getSpellGroup(),
.targets = {
{
.actorId = PTarget->id,
.results = {
.actorId = PTarget->id,
.results = {
{
.param = static_cast<int32_t>(m_PSpell->getID()),
.messageID = PEntity->objtype != TYPE_PC ? MsgBasic::StartsCastingSelf : MsgBasic::StartsCastingTarget,
.param = static_cast<int32_t>(m_PSpell->getID()),
.messageID = PEntity->objtype != TYPE_PC ? MsgBasic::StartsCastingSelf : MsgBasic::StartsCastingTarget,
},
},
},
Expand Down
8 changes: 4 additions & 4 deletions src/map/ai/states/mobskill_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ CMobSkillState::CMobSkillState(CBattleEntity* PEntity, uint16 targid, uint16 wsi
.actionid = static_cast<uint32_t>(FourCC::SkillUse),
.targets = {
{
.actorId = PActionTarget ? PActionTarget->id : m_PEntity->id,
.results = {
.actorId = PActionTarget ? PActionTarget->id : m_PEntity->id,
.results = {
{
.param = m_PSkill->getID(),
.messageID = m_PSkill->getFlag() & SKILLFLAG_NO_START_MSG ? MsgBasic::None : MsgBasic::ReadiesWeaponskill,
.param = m_PSkill->getID(),
.messageID = m_PSkill->getFlag() & SKILLFLAG_NO_START_MSG ? MsgBasic::None : MsgBasic::ReadiesWeaponskill,
},
},
},
Expand Down
8 changes: 4 additions & 4 deletions src/map/ai/states/petskill_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ CPetSkillState::CPetSkillState(CPetEntity* PEntity, uint16 targid, uint16 wsid)
.actionid = static_cast<uint32_t>(FourCC::SkillUse),
.targets = {
{
.actorId = PTarget->id,
.results = {
.actorId = PTarget->id,
.results = {
{
.param = m_PSkill->getMobSkillID() > 0 ? m_PSkill->getMobSkillID() : m_PSkill->getID(),
.messageID = m_PSkill->getMobSkillID() > 0 ? MsgBasic::ReadiesWeaponskill : MsgBasic::ReadiesSkill,
.param = m_PSkill->getMobSkillID() > 0 ? m_PSkill->getMobSkillID() : m_PSkill->getID(),
.messageID = m_PSkill->getMobSkillID() > 0 ? MsgBasic::ReadiesWeaponskill : MsgBasic::ReadiesSkill,
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions src/map/ai/states/range_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ CRangeState::CRangeState(CBattleEntity* PEntity, uint16 targid)
.actionid = static_cast<uint32_t>(FourCC::RangedStart),
.targets = {
{
.actorId = m_PEntity->id,
.results = {
.actorId = m_PEntity->id,
.results = {
{
// Empty result
},
Expand Down
8 changes: 4 additions & 4 deletions src/map/ai/states/weaponskill_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ CWeaponSkillState::CWeaponSkillState(CBattleEntity* PEntity, uint16 targid, uint
.actionid = static_cast<uint32_t>(FourCC::SkillUse),
.targets = {
{
.actorId = PTarget->id,
.results = {
.actorId = PTarget->id,
.results = {
{
.param = m_PSkill->getID(),
.messageID = MsgBasic::ReadiesWeaponskill,
.param = m_PSkill->getID(),
.messageID = MsgBasic::ReadiesWeaponskill,
},
},
},
Expand Down
6 changes: 3 additions & 3 deletions src/map/latent_effect_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,9 +832,9 @@ bool CLatentEffectContainer::ProcessLatentEffect(CLatentEffect& latentEffect, bo
{
CBattleEntity* PTarget = m_POwner->GetBattleTarget();
expression = PTarget != nullptr &&
m_POwner->GetMLevel() >= PTarget->GetMLevel() &&
m_POwner->loc.zone != nullptr &&
m_POwner->loc.zone->GetRegionID() < REGION_TYPE::WEST_AHT_URHGAN;
m_POwner->GetMLevel() >= PTarget->GetMLevel() &&
m_POwner->loc.zone != nullptr &&
m_POwner->loc.zone->GetRegionID() < REGION_TYPE::WEST_AHT_URHGAN;
break;
}
case LATENT::SANCTION_REGEN_BONUS:
Expand Down
24 changes: 12 additions & 12 deletions src/map/lua/lua_baseentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -958,14 +958,14 @@ void CLuaBaseEntity::injectActionPacket(const uint32 inTargetID, uint16 inCatego
.actionid = inActionParam,
.targets = {
{
.actorId = inTargetID,
.results = {
.actorId = inTargetID,
.results = {
{
.resolution = reaction,
.animation = static_cast<ActionAnimation>(inAnimationID),
.info = info,
.param = inParam,
.messageID = static_cast<MsgBasic>(inMessage),
.resolution = reaction,
.animation = static_cast<ActionAnimation>(inAnimationID),
.info = info,
.param = inParam,
.messageID = static_cast<MsgBasic>(inMessage),
},
},
},
Expand Down Expand Up @@ -19288,12 +19288,12 @@ void CLuaBaseEntity::restoreFromChest(CLuaBaseEntity* PLuaBaseEntity, uint32 res
.actiontype = ActionCategory::MobSkillFinish,
.targets = {
{
.actorId = PChar->id,
.results = {
.actorId = PChar->id,
.results = {
{
.animation = animationID,
.param = messageParam,
.messageID = messageID,
.animation = animationID,
.param = messageParam,
.messageID = messageID,
},
},
},
Expand Down
10 changes: 5 additions & 5 deletions src/map/lua/luautils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1109,8 +1109,8 @@ void PopulateIDLookups(uint16 zoneId, const std::string& zoneName)
const auto rset = db::preparedStmt("SELECT mobname, mobid FROM mob_spawn_points "
"WHERE mobid BETWEEN ? AND ? "
"ORDER BY mobid ASC",
idMin,
idMax);
idMin,
idMax);
FOR_DB_MULTIPLE_RESULTS(rset)
{
const auto name = rset->get<std::string>("mobname");
Expand All @@ -1127,8 +1127,8 @@ void PopulateIDLookups(uint16 zoneId, const std::string& zoneName)
const auto rset = db::preparedStmt("SELECT name, npcid FROM npc_list "
"WHERE npcid BETWEEN ? AND ? "
"ORDER BY npcid ASC",
idMin,
idMax);
idMin,
idMax);
FOR_DB_MULTIPLE_RESULTS(rset)
{
const auto name = rset->get<std::string>("name");
Expand Down Expand Up @@ -1706,7 +1706,7 @@ auto LoadLinkshellConciergeSlots(uint16 zoneId) -> sol::table
"FROM linkshell_concierge lc "
"JOIN linkshells ls ON ls.linkshellid = lc.linkshellid "
"WHERE lc.zone_id = ? AND ls.broken = 0",
zoneId);
zoneId);
if (!rset)
{
return result;
Expand Down
30 changes: 15 additions & 15 deletions src/map/mob_spell_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ Maybe<SpellID> CMobSpellContainer::GetAvailable(SpellID spellId)
{
auto* spell = spell::GetSpell(spellId);
bool enoughMP = spell->getMPCost() <= m_PMob->health.mp ||
spell->getSkillType() == SKILL_NINJUTSU ||
spell->getSkillType() == SKILL_SINGING ||
spell->getSkillType() == SKILL_WIND_INSTRUMENT ||
spell->getSkillType() == SKILL_STRING_INSTRUMENT ||
spell->getSkillType() == SKILL_GEOMANCY ||
m_PMob->StatusEffectContainer->HasStatusEffect(EFFECT_MANAFONT);
spell->getSkillType() == SKILL_NINJUTSU ||
spell->getSkillType() == SKILL_SINGING ||
spell->getSkillType() == SKILL_WIND_INSTRUMENT ||
spell->getSkillType() == SKILL_STRING_INSTRUMENT ||
spell->getSkillType() == SKILL_GEOMANCY ||
m_PMob->StatusEffectContainer->HasStatusEffect(EFFECT_MANAFONT);

bool isNotInRecast = !m_PMob->PRecastContainer->Has(RECAST_MAGIC, static_cast<Recast>(spellId));

Expand All @@ -150,15 +150,15 @@ Maybe<SpellID> CMobSpellContainer::GetBestAvailable(SPELLFAMILY family)
{
for (auto id : list)
{
auto* spell = spell::GetSpell(id);
bool sameFamily = (family == SPELLFAMILY_NONE) ? true : spell->getSpellFamily() == family;
bool enoughMP = spell->getMPCost() <= m_PMob->health.mp ||
spell->getSkillType() == SKILL_NINJUTSU ||
spell->getSkillType() == SKILL_SINGING ||
spell->getSkillType() == SKILL_WIND_INSTRUMENT ||
spell->getSkillType() == SKILL_STRING_INSTRUMENT ||
spell->getSkillType() == SKILL_GEOMANCY;
bool isNotInRecast = !m_PMob->PRecastContainer->Has(RECAST_MAGIC, static_cast<Recast>(id));
auto* spell = spell::GetSpell(id);
bool sameFamily = (family == SPELLFAMILY_NONE) ? true : spell->getSpellFamily() == family;
bool enoughMP = spell->getMPCost() <= m_PMob->health.mp ||
spell->getSkillType() == SKILL_NINJUTSU ||
spell->getSkillType() == SKILL_SINGING ||
spell->getSkillType() == SKILL_WIND_INSTRUMENT ||
spell->getSkillType() == SKILL_STRING_INSTRUMENT ||
spell->getSkillType() == SKILL_GEOMANCY;
bool isNotInRecast = !m_PMob->PRecastContainer->Has(RECAST_MAGIC, static_cast<Recast>(id));
if (sameFamily && enoughMP && isNotInRecast)
{
matches.emplace_back(id);
Expand Down
4 changes: 2 additions & 2 deletions src/map/navmesh/navmesh_builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ NavMeshBuilder::NavMeshBuilder(const IXiMesh& xiMesh)

const auto& rot = place.rotation;
const auto det = rot[0] * (rot[4] * rot[8] - rot[5] * rot[7]) -
rot[3] * (rot[1] * rot[8] - rot[2] * rot[7]) +
rot[6] * (rot[1] * rot[5] - rot[2] * rot[4]);
rot[3] * (rot[1] * rot[8] - rot[2] * rot[7]) +
rot[6] * (rot[1] * rot[5] - rot[2] * rot[4]);

auto ptb = PreTransformedBlock{
.worldVerts = std::vector<float>(block.vertices.size()),
Expand Down
6 changes: 3 additions & 3 deletions src/map/packets/c2s/0x05e_maprect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@ void GP_CLI_COMMAND_MAPRECT::process(MapSession* PSession, CCharEntity* PChar) c
auto destinationRegion = zoneutils::GetCurrentRegion(destinationZone);
auto moghouseExitRegions = { REGION_TYPE::SANDORIA, REGION_TYPE::BASTOK, REGION_TYPE::WINDURST, REGION_TYPE::JEUNO, REGION_TYPE::WEST_AHT_URHGAN, REGION_TYPE::ADOULIN_ISLANDS };
auto moghouseSameRegion = std::ranges::any_of(moghouseExitRegions,
[&destinationRegion](const REGION_TYPE acceptedReg)
{
[&destinationRegion](const REGION_TYPE acceptedReg)
{
return destinationRegion == acceptedReg;
});
});
auto moghouseQuestComplete = PChar->profile.mhflag & (this->MyRoomExitBit ? 0x01 << (this->MyRoomExitBit - 1) : 0);

if (startingRegion == REGION_TYPE::ADOULIN_ISLANDS)
Expand Down
6 changes: 3 additions & 3 deletions src/map/packets/s2c/0x08c_merit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ GP_SERV_COMMAND_MERIT::GP_SERV_COMMAND_MERIT(const CCharEntity* PChar, const MER

const Merit_t* PMerit = PChar->PMeritPoints->GetMerit(merit);
packet.merits[0] = {
.index = PMerit->id,
.next = PMerit->next,
.count = PMerit->count
.index = PMerit->id,
.next = PMerit->next,
.count = PMerit->count
};

// Set size for single merit update: header + count/padding + 2 merits (retail sends padding)
Expand Down
8 changes: 4 additions & 4 deletions src/map/utils/mobutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2040,11 +2040,11 @@ void WeaknessTrigger(CBaseEntity* PTarget, WeaknessType level)
.actiontype = ActionCategory::MobSkillFinish,
.targets = {
{
.actorId = PTarget->id,
.results = {
.actorId = PTarget->id,
.results = {
{
.animation = animationID,
.param = 2582,
.animation = animationID,
.param = 2582,
},
},
},
Expand Down
20 changes: 10 additions & 10 deletions src/map/ximesh/ximesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,11 @@ auto XiMesh::query(const float x, const float y, const float z) const -> std::op
{
const auto& meta = block.metas[triIdx];
best = CellHit{
.type = static_cast<TerrainType>(meta.material),
.mapId = place.mapId,
.roofed = place.roofed,
.barrier = meta.barrier != 0,
.y = triY,
.type = static_cast<TerrainType>(meta.material),
.mapId = place.mapId,
.roofed = place.roofed,
.barrier = meta.barrier != 0,
.y = triY,
};
}
}
Expand Down Expand Up @@ -879,11 +879,11 @@ auto XiMesh::rayIntersectCellHitInfo(const Vector3& start, const Vector3& end, c
{
const auto& meta = block.metas[triIdx];
closestHit = RayHitInfo{
.intersection = intersection,
.distanceSq = distanceSq,
.placement = &place,
.type = static_cast<TerrainType>(meta.material),
.barrier = meta.barrier != 0,
.intersection = intersection,
.distanceSq = distanceSq,
.placement = &place,
.type = static_cast<TerrainType>(meta.material),
.barrier = meta.barrier != 0,
};
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/search/data_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ void CDataLoader::ExpireAHItems(uint16 expireAgeInDays)
const auto cutoff = earth_time::timestamp() - static_cast<uint32>(expireAgeInDays) * 86400u;
const auto rset0 = db::preparedStmt("SELECT T0.id,T0.itemid,T1.stacksize, T0.stack, T0.seller FROM auction_house T0 INNER JOIN item_basic T1 ON "
"T0.itemid = T1.itemid WHERE T0.buyer_name IS NULL AND T0.date <= ?",
cutoff);
cutoff);

const auto expiredAuctions = rset0->rowsCount();

Expand Down
Loading
Loading