diff --git a/scripts/enum/magic.lua b/scripts/enum/magic.lua index 76951d86564..0989d097c5a 100644 --- a/scripts/enum/magic.lua +++ b/scripts/enum/magic.lua @@ -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, diff --git a/src/map/entities/trustentity.cpp b/src/map/entities/trustentity.cpp index 6b159228f60..a961c85e91f 100644 --- a/src/map/entities/trustentity.cpp +++ b/src/map/entities/trustentity.cpp @@ -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; @@ -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(); +} diff --git a/src/map/entities/trustentity.h b/src/map/entities/trustentity.h index ee97773a020..ac9671ca0b6 100644 --- a/src/map/entities/trustentity.h +++ b/src/map/entities/trustentity.h @@ -51,8 +51,11 @@ 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 isReleased = false; // Track trust releasing (see c2s 0x01A action) + bool isReleased = false; // Track trust releasing (see c2s 0x01A action) + bool m_isPassiveTrust = false; private: static constexpr int8 m_defaultShieldSize = 3; diff --git a/src/map/spell.h b/src/map/spell.h index 2d2c9876986..5e0cc9917f7 100644 --- a/src/map/spell.h +++ b/src/map/spell.h @@ -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 diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index 1960c4ede5f..ccccf7ac9cc 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -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 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 @@ -252,6 +264,11 @@ void BuildTrustData(uint32 TrustID) data->trustID = TrustID; + if (passiveTrustIDs.contains(static_cast(data->trustID))) + { + data->isPassiveTrust = true; + } + data->pool = rset->get("poolid"); data->name = rset->get("name"); data->packet_name = rset->get("packet_name"); @@ -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);