Skip to content
Draft
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
2 changes: 2 additions & 0 deletions scripts/enum/magic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,8 @@ xi.magic.spell =
YGNAS = 998,
MONBERAUX = 999,

CORNELIA = 1002,
MATSUI_P = 1003,
EXCENMILLE_S = 1004,
AYAME_UC = 1005,
MAAT_UC = 1006,
Expand Down
17 changes: 17 additions & 0 deletions src/map/entities/trustentity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,12 @@ void CTrustEntity::Spawn()

bool CTrustEntity::ValidTarget(CBattleEntity* PInitiator, uint16 targetFlags)
{
// Passive GEO trusts like Sakura etc are basically walking indicolures and cant be targeted
if (m_isPassiveTrust)
{
return false;
}

if (PInitiator->objtype == TYPE_TRUST && PMaster == PInitiator->PMaster)
{
return true;
Expand Down Expand Up @@ -291,3 +297,14 @@ void CTrustEntity::OnWeaponSkillFinished(CWeaponSkillState& state, action_t& act

this->processActionEffectFlags(action);
}

bool CTrustEntity::GetUntargetable() const
{
// Passive GEO trusts like Sakura etc are basically walking indicolures and cant be targeted
if (m_isPassiveTrust)
{
return true;
}

return CMobEntity::GetUntargetable();
}
3 changes: 3 additions & 0 deletions src/map/entities/trustentity.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ class CTrustEntity : public CMobEntity
void OnMobSkillFinished(CMobSkillState& state, action_t& action) override;
void OnWeaponSkillFinished(CWeaponSkillState& state, action_t& action) override;

bool GetUntargetable() const override;

uint32 m_TrustID{};
bool m_isPassiveTrust = false;

private:
static constexpr int8 m_defaultShieldSize = 3;
Expand Down
122 changes: 122 additions & 0 deletions src/map/spell.h
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,128 @@ enum class SpellID : uint16
Full_Cure = 893,
Refresh_III = 894,
Temper_II = 895,
Shantotto = 896,
Naji = 897,
Kupipi = 898,
Excenmille = 899,
Ayame = 900,
Nanaa_Mihgo = 901,
Curilla = 902,
Volker = 903,
Ajido_Marujido = 904,
Trion = 905,
Zeid = 906,
Lion = 907,
Tenzen = 908,
Mihli_Aliapoh = 909,
Valaineral = 910,
Joachim = 911,
Naja_Salaheem = 912,
Prishe = 913,
Ulmia = 914,
Shikaree_Z = 915,
Cherukiki = 916,
Iron_Eater = 917,
Gessho = 918,
Gadalar = 919,
Rainemard = 920,
Ingrid = 921,
Lehko_Habhoka = 922,
Nashmeira = 923,
Zazarg = 924,
Ovjang = 925,
Mnejing = 926,
Sakura = 927,
Luzaf = 928,
Najelith = 929,
Aldo = 930,
Moogle = 931,
Fablinix = 932,
Maat = 933,
Domina_Shantotto = 934,
Star_Sibyl = 935,
Karaha_Baruha = 936,
Cid = 937,
Gilgamesh = 938,
Areuhat = 939,
Semih_Lafihna = 940,
Elivira = 941,
Noillurie = 942,
Lhu_Mhakaracca = 943,
Ferreous_Coffin = 944,
Lilisette = 945,
Mumor = 946,
Uka_Totlihn = 947,
Klara = 948,
Romaa_Mihgo = 949,
Kuyin_Hathdenna = 950,
Rahal = 951,
Koru_Moru = 952,
Pieuje_UC = 953,
Invincible_Shield_UC = 954,
Apururu_UC = 955,
Jakoh_UC = 956,
Flaviria_UC = 957,
Babban = 958,
Abenzio = 959,
Rughadjeen = 960,
Kukki_Chebukki = 961,
Margret = 962,
Chacharoon = 963,
Lhe_Lhangavo = 964,
Arciela = 965,
Mayakov = 966,
Qultada = 967,
Adelheid = 968,
Amchuchu = 969,
Brygid = 970,
Mildaurion = 971,
Halver = 972,
Rongelouts = 973,
Leonoyne = 974,
Maximilian = 975,
Kayeel_Payeel = 976,
Robel_Akbel = 977,
Kupofried = 978,
Selhteus = 979,
Yoran_Oran_UC = 980,
Sylvie_UC = 981,
Abquhbah = 982,
Balamor = 983,
August = 984,
Rosulatia = 985,
Teodor = 986,
Ullegore = 987,
Makki_Chebukki = 988,
King_Of_Hearts = 989,
Morimar = 990,
Darrcuiln = 991,
Aahm = 992,
Aaev = 993,
Aamr = 994,
Aatt = 995,
Aagk = 996,
Iroha = 997,
Ygnas = 998,
Monberaux = 999,

Cornelia = 1002,
Matsui_P = 1003,
Excenmille_S = 1004,
Ayame_UC = 1005,
Maat_UC = 1006,
Aldo_UC = 1008,
Lion_II = 1009,
Zeid_II = 1010,
Prishe_II = 1011,
Nashmeira_II = 1012,
Lilisette_II = 1013,
Tenzen_II = 1014,
Mumor_II = 1015,
Ingrid_II = 1016,
Arciela_II = 1017,
Iroha_II = 1018,
Shantotto_II = 1019,
};
// clang-format on

Expand Down
28 changes: 23 additions & 5 deletions src/map/utils/trustutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,21 @@ void BuildTrustData(uint32 TrustID);
auto LoadTrust(CCharEntity* PMaster, uint32 TrustID) -> CTrustEntity*;
void LoadTrustStatsAndSkills(CTrustEntity* PTrust);

// List of trusts that are essentially walking GEO bubbles that should not be targetable
static std::unordered_set<SpellID> passiveTrustIDs = {
SpellID::Sakura,
SpellID::Moogle,
SpellID::Star_Sibyl,
SpellID::Kuyin_Hathdenna,
SpellID::Brygid,
SpellID::Kupofried,
SpellID::Cornelia,
};

struct TrustData
{
uint32 trustID{};
bool isPassiveTrust{};
uint32 pool{};
look_t look; // appearance data
std::string name; // script name string
Expand Down Expand Up @@ -252,6 +264,11 @@ void BuildTrustData(uint32 TrustID)

data->trustID = TrustID;

if (passiveTrustIDs.contains(static_cast<SpellID>(data->trustID)))
{
data->isPassiveTrust = true;
}

data->pool = rset->get<uint32>("poolid");
data->name = rset->get<std::string>("name");
data->packet_name = rset->get<std::string>("packet_name");
Expand Down Expand Up @@ -363,11 +380,12 @@ auto LoadTrust(CCharEntity* PMaster, uint32 TrustID) -> CTrustEntity*
PTrust->baseSpeed = trustData->baseSpeed;
PTrust->animationSpeed = trustData->animationSpeed;
PTrust->UpdateSpeed();
PTrust->m_TrustID = trustData->trustID;
PTrust->status = STATUS_TYPE::NORMAL;
PTrust->modelSize = trustData->modelSize;
PTrust->modelHitboxSize = trustData->modelHitboxSize;
PTrust->m_EcoSystem = trustData->EcoSystem;
PTrust->m_TrustID = trustData->trustID;
PTrust->m_isPassiveTrust = trustData->isPassiveTrust;
PTrust->status = STATUS_TYPE::NORMAL;
PTrust->modelSize = trustData->modelSize;
PTrust->modelHitboxSize = trustData->modelHitboxSize;
PTrust->m_EcoSystem = trustData->EcoSystem;

PTrust->SetMJob(trustData->mJob);
PTrust->SetSJob(trustData->sJob);
Expand Down
Loading