From b14748b6aaca1311f51ceaa42d49837bf45776ac Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 25 Feb 2020 01:05:55 +0200 Subject: [PATCH 001/116] Add new bindings: getJobLevel & hasJob (#386) * Add getJobLevel() binding * Add hasJob binding --- src/map/lua/lua_baseentity.cpp | 48 ++++++++++++++++++++++++++++++++++ src/map/lua/lua_baseentity.h | 2 ++ 2 files changed, 50 insertions(+) diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index afe5889091a..4b367beea5c 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -5339,6 +5339,29 @@ inline int32 CLuaBaseEntity::unlockJob(lua_State *L) return 0; } +/************************************************************************ +* Function: hasJob() +* Purpose : Check to see if JOBTYPE is unlocked +* Example : player:hasJob(BRD) +* Notes : +************************************************************************/ + +inline int32 CLuaBaseEntity::hasJob(lua_State *L) +{ + TPZ_DEBUG_BREAK_IF(m_PBaseEntity == nullptr); + TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC); + TPZ_DEBUG_BREAK_IF(lua_isnil(L, 1) || !lua_isnumber(L, 1)); + + JOBTYPE JobID = (JOBTYPE)lua_tointeger(L, 1); + + TPZ_DEBUG_BREAK_IF(JobID > MAX_JOBTYPE || JobID < 0); + + CCharEntity* PChar = (CCharEntity*)m_PBaseEntity; + + lua_pushinteger(L, (PChar->jobs.unlocked >> JobID) & 1); + return 1; +} + /************************************************************************ * Function: getMainLvl() * Purpose : Returns the main level of entity's current job @@ -5371,6 +5394,29 @@ inline int32 CLuaBaseEntity::getSubLvl(lua_State *L) return 1; } +/************************************************************************ +* Function: getJobLevel() +* Purpose : Return the levle of job specified by JOBTYPE +* Example : player:getJobLevel(BRD) +* Notes : +************************************************************************/ + +inline int32 CLuaBaseEntity::getJobLevel(lua_State *L) +{ + TPZ_DEBUG_BREAK_IF(m_PBaseEntity == nullptr); + TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC); + TPZ_DEBUG_BREAK_IF(lua_isnil(L, 1) || !lua_isnumber(L, 1)); + + JOBTYPE JobID = (JOBTYPE)lua_tointeger(L, 1); + + TPZ_DEBUG_BREAK_IF(JobID > MAX_JOBTYPE || JobID < 0); + + CCharEntity* PChar = (CCharEntity*)m_PBaseEntity; + lua_pushinteger(L, PChar->jobs.job[JobID]); + + return 1; +} + /************************************************************************ * Function: setLevel() * Purpose : Updates the level of the entity's main job @@ -14202,9 +14248,11 @@ Lunar::Register_t CLuaBaseEntity::methods[] = LUNAR_DECLARE_METHOD(CLuaBaseEntity,changeJob), LUNAR_DECLARE_METHOD(CLuaBaseEntity,changesJob), LUNAR_DECLARE_METHOD(CLuaBaseEntity,unlockJob), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,hasJob), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getMainLvl), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getSubLvl), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,getJobLevel), LUNAR_DECLARE_METHOD(CLuaBaseEntity,setLevel), LUNAR_DECLARE_METHOD(CLuaBaseEntity,setsLevel), LUNAR_DECLARE_METHOD(CLuaBaseEntity,levelCap), diff --git a/src/map/lua/lua_baseentity.h b/src/map/lua/lua_baseentity.h index 9458caceb2e..0de7ed9ba01 100644 --- a/src/map/lua/lua_baseentity.h +++ b/src/map/lua/lua_baseentity.h @@ -268,9 +268,11 @@ class CLuaBaseEntity int32 changeJob(lua_State*); // changes the job of a char (testing only!) int32 changesJob(lua_State*); // changes the sub job of a char (testing only!) int32 unlockJob(lua_State*); // Unlocks a job for the entity, sets job level to 1 + int32 hasJob(lua_State*); // Check to see if JOBTYPE is unlocked for a character int32 getMainLvl(lua_State*); // Gets Entity Main Job Level int32 getSubLvl(lua_State*); // Get Entity Sub Job Level + int32 getJobLevel(lua_State*); // Gets character job level for specified JOBTYPE int32 setLevel(lua_State*); // sets the character's level int32 setsLevel(lua_State*); // sets the character's level int32 levelCap(lua_State*); // genkai From fa613df4fd0191d4de0860716b6cc3d92671b204 Mon Sep 17 00:00:00 2001 From: Omnione <10185476+Omnione@users.noreply.github.com> Date: Sun, 5 Jan 2020 11:21:44 +0000 Subject: [PATCH 002/116] Added the auto creation of a vector list of trust id's and QueryTrust to iterate through the list to generate a list of trust. Cleaned up some other bits and pieces. --- scripts/globals/spells/trust/Shantotto_II.lua | 2 +- scripts/globals/spells/trust/kupipi.lua | 16 ++ scripts/globals/spells/trust/naji.lua | 16 ++ scripts/globals/spells/trust/shantotto.lua | 4 +- scripts/globals/spells/trust/trion.lua | 16 ++ sql/mob_pools.sql | 18 +- sql/pet_list.sql | 4 +- src/map/ai/controllers/trust_controller.cpp | 67 ++++- src/map/ai/controllers/trust_controller.h | 14 +- src/map/entities/charentity.cpp | 23 +- src/map/entities/charentity.h | 25 +- src/map/entities/trustentity.h | 4 +- src/map/utils/petutils.cpp | 237 ++++++++++++++++-- src/map/utils/petutils.h | 9 +- 14 files changed, 393 insertions(+), 62 deletions(-) create mode 100644 scripts/globals/spells/trust/kupipi.lua create mode 100644 scripts/globals/spells/trust/naji.lua create mode 100644 scripts/globals/spells/trust/trion.lua diff --git a/scripts/globals/spells/trust/Shantotto_II.lua b/scripts/globals/spells/trust/Shantotto_II.lua index 232201ae021..e57cb9101e8 100644 --- a/scripts/globals/spells/trust/Shantotto_II.lua +++ b/scripts/globals/spells/trust/Shantotto_II.lua @@ -9,6 +9,6 @@ function onMagicCastingCheck(caster,target,spell) end function onSpellCast(caster,target,spell) - -- caster:spawnTrust(1019) + caster:spawnTrust(1019) return 0 end diff --git a/scripts/globals/spells/trust/kupipi.lua b/scripts/globals/spells/trust/kupipi.lua new file mode 100644 index 00000000000..7bc12778bfa --- /dev/null +++ b/scripts/globals/spells/trust/kupipi.lua @@ -0,0 +1,16 @@ +----------------------------------------- +-- Spell: Kupipi +----------------------------------------- +require("scripts/globals/trust"); +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + return 0 +end + +function onSpellCast(caster,target,spell) + -- Todo: put Trusts's spawn in dialog here or in entity script? + -- Todo: automate entity spawn in core for trust spells? + caster:spawnTrust(898) + return 0 +end diff --git a/scripts/globals/spells/trust/naji.lua b/scripts/globals/spells/trust/naji.lua new file mode 100644 index 00000000000..0a35f4127c4 --- /dev/null +++ b/scripts/globals/spells/trust/naji.lua @@ -0,0 +1,16 @@ +----------------------------------------- +-- Spell: Naji +----------------------------------------- +require("scripts/globals/trust"); +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + return 0 +end + +function onSpellCast(caster,target,spell) + -- Todo: put Trusts's spawn in dialog here or in entity script? + -- Todo: automate entity spawn in core for trust spells? + caster:spawnTrust(897) + return 0 +end diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index 848dac68b51..6205f0549b1 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -1,7 +1,7 @@ ----------------------------------------- -- Spell: Shantotto ----------------------------------------- --- require("scripts/globals/trust") +require("scripts/globals/trust"); ----------------------------------------- function onMagicCastingCheck(caster,target,spell) @@ -11,6 +11,6 @@ end function onSpellCast(caster,target,spell) -- Todo: put Trusts's spawn in dialog here or in entity script? -- Todo: automate entity spawn in core for trust spells? - caster:spawnTrust(75) -- see pet_list.sql, this should be 896 but the pet list won't let me do that + caster:spawnTrust(896) return 0 end diff --git a/scripts/globals/spells/trust/trion.lua b/scripts/globals/spells/trust/trion.lua new file mode 100644 index 00000000000..e578db446b0 --- /dev/null +++ b/scripts/globals/spells/trust/trion.lua @@ -0,0 +1,16 @@ +----------------------------------------- +-- Spell: Trion +----------------------------------------- +require("scripts/globals/trust"); +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + return 0 +end + +function onSpellCast(caster,target,spell) + -- Todo: put Trusts's spawn in dialog here or in entity script? + -- Todo: automate entity spawn in core for trust spells? + caster:spawnTrust(905) + return 0 +end diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index d53bc277147..2f492f7c59c 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5954,15 +5954,15 @@ INSERT INTO `mob_pools` VALUES (5893,'Gloombound_Lurker','Gloombound_Lurker',221 INSERT INTO `mob_pools` VALUES (5894,'Lesath','Lesath',217,0x00001C0100000000000000000000000000000000,1,1,7,280,100,0,1,0,1,2,7,0,238,141,0,0,0,1,0,370); INSERT INTO `mob_pools` VALUES (5895,'Donggu','Donggu',116,0x0000780100000000000000000000000000000000,1,1,11,240,100,0,0,0,1,2,7,0,0,3,0,0,0,1,0,116); INSERT INTO `mob_pools` VALUES (5896,'Shantotto','Shantotto',153,0x0000B80B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,276,1,0,750); --- INSERT INTO `mob_pools` VALUES (5897,'naji', --- INSERT INTO `mob_pools` VALUES (5898,'kupipi', --- INSERT INTO `mob_pools` VALUES (5899,'excenmille', --- INSERT INTO `mob_pools` VALUES (5900,'ayame', --- INSERT INTO `mob_pools` VALUES (5901,'nanaa_mihgo', --- INSERT INTO `mob_pools` VALUES (5902,'curilla', --- INSERT INTO `mob_pools` VALUES (5903,'volker', --- INSERT INTO `mob_pools` VALUES (5904,'ajido-marujido', --- INSERT INTO `mob_pools` VALUES (5905,'trion', +INSERT INTO `mob_pools` VALUES (5897,'Naji','Naji',149,0x0000B90B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,276,1,0,750); +INSERT INTO `mob_pools` VALUES (5898,'Kupipi','Kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,1,3,1,0,3); +INSERT INTO `mob_pools` VALUES (5899,'Excenmille','Excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,4,1,0,4); +INSERT INTO `mob_pools` VALUES (5900,'Ayame','Ayame',149,0x0000BC0B00000000000000000000000000000000,12,0,10,440,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,5); +INSERT INTO `mob_pools` VALUES (5901,'NanaaMihgo','Nanaa_Mihgo',152,0x0000BD0B00000000000000000000000000000000,6,0,2,190,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,6); +INSERT INTO `mob_pools` VALUES (5902,'Curilla','Curilla',145,0x0000BE0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,7,1,0,7); +INSERT INTO `mob_pools` VALUES (5903,'Volker','Volker',149,0x0000BF0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,8,1,0,8); +INSERT INTO `mob_pools` VALUES (5904,'Ajido-marujido','Ajido-Marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,1,9,1,0,0); +INSERT INTO `mob_pools` VALUES (5905,'Trion','Trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -- INSERT INTO `mob_pools` VALUES (5906,'zeid', -- INSERT INTO `mob_pools` VALUES (5907,'lion', -- INSERT INTO `mob_pools` VALUES (5908,'tenzen', diff --git a/sql/pet_list.sql b/sql/pet_list.sql index b6346d15d16..6efff963e5b 100644 --- a/sql/pet_list.sql +++ b/sql/pet_list.sql @@ -117,6 +117,4 @@ INSERT INTO `pet_list` VALUES (72, 'StormwakerFrame', 5127, 1, 99, 0, 0); -- INSERT INTO `pet_list` VALUES (73, 'AdventuringFellow', 0, 1, 99, 0, 0); -- 74 is Chocobo in the enum.. - --- trusts.. TODO: Make trusts not use petlist at all. -INSERT INTO `pet_list` VALUES (75, 'Shantotto', 5896, 1, 99, 0, 0); +-- INSERT INTO `pet_list` VALUES (75, 'Trust', 0, 1, 99, 0, 0); diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index 6e0f77656ff..a1c51fe3f88 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -23,11 +23,13 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "../ai_container.h" #include "../../status_effect_container.h" +#include "../../enmity_container.h" #include "../../ai/states/despawn_state.h" #include "../../entities/charentity.h" #include "../../entities/trustentity.h" #include "../../packets/char.h" #include "../../../common/utils.h" +#include "../../lua/lua_baseentity.h" CTrustController::CTrustController(CCharEntity* PChar, CTrustEntity* PTrust) : CController(PTrust) { @@ -49,17 +51,38 @@ void CTrustController::Despawn() if (POwner->PMaster) { POwner->PMaster = nullptr; + POwner->PAI->Internal_Despawn(); } - CController::Despawn(); + //CController::Despawn(); } void CTrustController::Tick(time_point tick) { m_Tick = tick; + if (!POwner->PMaster) + return; + if (POwner->PAI->IsEngaged()) { - DoCombatTick(tick); + auto PTarget{ POwner->GetBattleTarget() }; + + if (PTarget) + { + auto PMob = static_cast(PTarget); + + if (PMob->PEnmityContainer->GetHighestEnmity() != nullptr) + { + if (PMob->PEnmityContainer->HasID(POwner->PMaster->id)) + { + DoCombatTick(tick); + } + else if (!POwner->isDead()) + { + DoRoamTick(tick); + } + } + } } else if (!POwner->isDead()) { @@ -73,11 +96,14 @@ void CTrustController::DoCombatTick(time_point tick) { POwner->PAI->Internal_Disengage(); } + if (POwner->PMaster->GetBattleTargetID() != POwner->GetBattleTargetID()) { POwner->PAI->Internal_ChangeTarget(POwner->PMaster->GetBattleTargetID()); } + auto PTarget{ POwner->GetBattleTarget() }; + if (PTarget) { if (POwner->PAI->CanFollowPath()) @@ -103,17 +129,42 @@ void CTrustController::DoRoamTick(time_point tick) POwner->PAI->Internal_Engage(POwner->PMaster->GetBattleTargetID()); } - float currentDistance = distance(POwner->loc.p, POwner->PMaster->loc.p); + auto master = static_cast(POwner->PMaster); + auto PTrust = static_cast(POwner); + uint8 currentPartyPos = master->TrustPartyPosition(PTrust); + float currentDistance = 0; - if (currentDistance > RoamDistance) + if (currentPartyPos == 0) { - if (currentDistance < 35.0f && POwner->PAI->PathFind->PathAround(POwner->PMaster->loc.p, 2.0f, PATHFLAG_RUN | PATHFLAG_WALLHACK)) + currentDistance = distance(POwner->loc.p, POwner->PMaster->loc.p); + + if (currentDistance > RoamDistance) { - POwner->PAI->PathFind->FollowPath(); + if (currentDistance < 35.0f && PTrust->PAI->PathFind->PathTo(POwner->PMaster->loc.p, PATHFLAG_RUN | PATHFLAG_WALLHACK)) + { + PTrust->PAI->PathFind->FollowPath(); + } + else if (POwner->GetSpeed() > 0) + { + PTrust->PAI->PathFind->WarpTo(POwner->PMaster->loc.p, RoamDistance); + } } - else if (POwner->GetSpeed() > 0) + } + else if(currentPartyPos > 0) + { + CBattleEntity* PFollow = (CBattleEntity*)master->PTrusts.at(currentPartyPos - 1); + currentDistance = distance(PTrust->loc.p, PFollow->loc.p); + + if (currentDistance > 2.0f) { - POwner->PAI->PathFind->WarpTo(POwner->PMaster->loc.p, RoamDistance); + if (currentDistance < 35.0f && PTrust->PAI->PathFind->PathTo(PFollow->loc.p, PATHFLAG_RUN | PATHFLAG_WALLHACK)) + { + PTrust->PAI->PathFind->FollowPath(); + } + else if (POwner->GetSpeed() > 0) + { + PTrust->PAI->PathFind->WarpTo(PFollow->loc.p, RoamDistance); + } } } } diff --git a/src/map/ai/controllers/trust_controller.h b/src/map/ai/controllers/trust_controller.h index c2e5376e70f..5d63d8cc97d 100644 --- a/src/map/ai/controllers/trust_controller.h +++ b/src/map/ai/controllers/trust_controller.h @@ -30,22 +30,26 @@ class CTrustEntity; class CTrustController : public CController { public: + CTrustController(CCharEntity*, CTrustEntity*); + CBattleEntity* PTarget{ nullptr }; virtual ~CTrustController(); + static constexpr float RoamDistance{ 5.5f }; + virtual void DoCombatTick(time_point tick); + virtual void DoRoamTick(time_point tick); + +protected: virtual void Tick(time_point) override; virtual void Despawn() override; - virtual bool Cast(uint16 targid, SpellID spellid) override { return false; } virtual bool ChangeTarget(uint16 targid) override { return false; } virtual bool WeaponSkill(uint16 targid, uint16 wsid) override { return false; } - virtual bool Ability(uint16 targid, uint16 abilityid) override { return false; } private: - static constexpr float RoamDistance{ 2.1f }; - void DoCombatTick(time_point tick); - void DoRoamTick(time_point tick); + + }; #endif // _TRUSTCONTROLLER \ No newline at end of file diff --git a/src/map/entities/charentity.cpp b/src/map/entities/charentity.cpp index 60d41c5b5ee..d309d58cdb9 100644 --- a/src/map/entities/charentity.cpp +++ b/src/map/entities/charentity.cpp @@ -476,17 +476,38 @@ void CCharEntity::RemoveTrust(CTrustEntity* PTrust) return; auto trustIt = std::remove_if(PTrusts.begin(), PTrusts.end(), [PTrust](auto trust) { return PTrust == trust; }); + if (trustIt != PTrusts.end()) { PTrust->PAI->Despawn(); PTrusts.erase(trustIt); } + if (PParty != nullptr) { - PParty->ReloadParty(); + if (PTrusts.size() < 1 && PParty->members.size() == 1) + { + PParty->DisbandParty(); + } + else + { + PParty->ReloadParty(); + } } } +uint8 CCharEntity::TrustPartyPosition(CTrustEntity* PTrust) +{ + for (uint8 i = 0; i < PTrusts.size(); i++) + { + if (PTrusts.at(i)->id == PTrust->id) + { + return i; + } + } + return 0; +} + void CCharEntity::ClearTrusts() { if (PTrusts.size() == 0) diff --git a/src/map/entities/charentity.h b/src/map/entities/charentity.h index 407efc1c91f..51c39c09ae4 100644 --- a/src/map/entities/charentity.h +++ b/src/map/entities/charentity.h @@ -211,19 +211,20 @@ class CCharEntity : public CBattleEntity UnlockedAttachments_t m_unlockedAttachments; // Unlocked Automaton Attachments (1 bit per attachment) CAutomatonEntity* PAutomaton; // Automaton statistics + CTrustEntity* PTrust; // Trust statistics std::vector PTrusts; // Active trusts - // Эти миссии не нуждаются в списке пройденных, т.к. клиент автоматически - // отображает более ранние миссии выплненными + // These missions do not need a list of completed, because client automatically + // displays earlier missions completed - uint16 m_copCurrent; // текущая миссия Chains of Promathia - uint16 m_acpCurrent; // текущая миссия A Crystalline Prophecy - uint16 m_mkeCurrent; // текущая миссия A Moogle Kupo d'Etat - uint16 m_asaCurrent; // текущая миссия A Shantotto Ascension + uint16 m_copCurrent; // current mission of Chains of Promathia + uint16 m_acpCurrent; // current mission of A Crystalline Prophecy + uint16 m_mkeCurrent; // current mission of A Moogle Kupo d'Etat + uint16 m_asaCurrent; // current mission of A Shantotto Ascension - // TODO: половина этого массива должна храниться в char_vars, а не здесь, т.к. эта информация не отображается в интерфейсе клиента и сервер не проводит с ними никаких операций + // TODO: half of this array should be stored in char_vars, and not here, because this information is not displayed in the client interface and the server does not perform any operations with them //currency_t m_currency; // conquest points, imperial standing points etc Teleport_t teleport; // Outposts, Runic Portals, Homepoints, Survival Guides, Maws, etc @@ -258,10 +259,11 @@ class CCharEntity : public CBattleEntity CBaseEntity* PWideScanTarget; // wide scane цель - SpawnIDList_t SpawnPCList; // список видимых персонажей - SpawnIDList_t SpawnMOBList; // список видимых монстров - SpawnIDList_t SpawnPETList; // список видимых питомцев - SpawnIDList_t SpawnNPCList; // список видимых npc + SpawnIDList_t SpawnPCList; // list of visible characters + SpawnIDList_t SpawnMOBList; // list of visible monsters + SpawnIDList_t SpawnPETList; // list of visible pets + SpawnIDList_t SpawnTRUSTList; // list of visible trust + SpawnIDList_t SpawnNPCList; // list of visible npc's void SetName(int8* name); // устанавливаем имя персонажа (имя ограничивается 15-ю символами) @@ -326,6 +328,7 @@ class CCharEntity : public CBattleEntity bool ReloadParty(); void ClearTrusts(); void RemoveTrust(CTrustEntity*); + uint8 TrustPartyPosition(CTrustEntity* PTrust); virtual void Tick(time_point) override; void PostTick() override; diff --git a/src/map/entities/trustentity.h b/src/map/entities/trustentity.h index 05a5460b45b..f7a4e5a8b83 100644 --- a/src/map/entities/trustentity.h +++ b/src/map/entities/trustentity.h @@ -30,8 +30,8 @@ class CTrustEntity : public CMobEntity public: CTrustEntity(CCharEntity*); ~CTrustEntity(); - uint8 m_Element; - uint32 m_PetID; + uint32 m_TrustID; + uint16 m_PartyPosition; virtual void PostTick() override; virtual void FadeOut() override; diff --git a/src/map/utils/petutils.cpp b/src/map/utils/petutils.cpp index 7d0fa5aded9..425a4a333cd 100644 --- a/src/map/utils/petutils.cpp +++ b/src/map/utils/petutils.cpp @@ -57,6 +57,7 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "../packets/message_standard.h" #include "../packets/pet_sync.h" #include "../packets/trust_sync.h" +#include "../ai/controllers/trust_controller.h" struct Pet_t { @@ -126,6 +127,71 @@ struct Pet_t std::vector g_PPetList; +struct Trust_t +{ + uint16 trustID; + look_t look; // appearance data + string_t name; // name string + ECOSYSTEM EcoSystem; // ecosystem + + uint8 name_prefix; + uint8 size; // размер модели + uint16 m_Family; + + uint8 mJob; + uint8 sJob; + float HPscale; // HP boost percentage + float MPscale; // MP boost percentage + + uint16 cmbDelay; + uint8 speed; + // stat ranks + uint8 strRank; + uint8 dexRank; + uint8 vitRank; + uint8 agiRank; + uint8 intRank; + uint8 mndRank; + uint8 chrRank; + uint8 attRank; + uint8 defRank; + uint8 evaRank; + uint8 accRank; + + uint16 m_MobSkillList; + + // magic stuff + bool hasSpellScript; + uint16 spellList; + + // resists + int16 slashres; + int16 pierceres; + int16 hthres; + int16 impactres; + + int16 firedef; + int16 icedef; + int16 winddef; + int16 earthdef; + int16 thunderdef; + int16 waterdef; + int16 lightdef; + int16 darkdef; + + int16 fireres; + int16 iceres; + int16 windres; + int16 earthres; + int16 thunderres; + int16 waterres; + int16 lightres; + int16 darkres; +}; + +std::vector g_PTrustIDList; +std::vector g_PTrustList; + namespace petutils { @@ -244,6 +310,132 @@ namespace petutils } } + void LoadTrustList() + { + FreeTrustList(); + + const char* Query = + "SELECT \ + spell_list.spellid, mob_pools.poolid \ + FROM spell_list, mob_pools \ + WHERE spell_list.spellid >= 896 AND mob_pools.poolid = (spell_list.spellid+5000) ORDER BY spell_list.spellid"; + + if (Sql_Query(SqlHandle, Query) != SQL_ERROR && Sql_NumRows(SqlHandle) != 0) + { + while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) + { + uint32 TrustID = (uint16)Sql_GetIntData(SqlHandle, 0); + + g_PTrustIDList.push_back(TrustID); + } + } + + for each (uint32 id in g_PTrustIDList) + { + QueryTrust(id); + } + } + + void QueryTrust(uint32 TrustID) + { + const char* Query = + "SELECT \ + mob_pools.name,\ + modelid,\ + mobsize,\ + systemid,\ + mob_pools.familyid,\ + mob_pools.mJob,\ + mob_pools.sJob,\ + (mob_family_system.HP / 100), \ + (mob_family_system.MP / 100), \ + mob_family_system.speed, \ + mob_family_system.STR, \ + mob_family_system.DEX, \ + mob_family_system.VIT, \ + mob_family_system.AGI, \ + mob_family_system.INT, \ + mob_family_system.MND, \ + mob_family_system.CHR, \ + mob_family_system.DEF, \ + mob_family_system.ATT, \ + mob_family_system.ACC, \ + mob_family_system.EVA, \ + hasSpellScript, spellList, \ + Slash, Pierce, H2H, Impact, \ + Fire, Ice, Wind, Earth, Lightning, Water, Light, Dark, \ + cmbDelay, name_prefix, mob_pools.skill_list_id, \ + spell_list.spellid, mob_pools.behavior \ + FROM spell_list, mob_pools, mob_family_system WHERE spell_list.spellid = %u \ + AND (spell_list.spellid+5000) = mob_pools.poolid AND mob_pools.familyid = mob_family_system.familyid ORDER BY spell_list.spellid"; + + uint32 ret = Sql_Query(SqlHandle, Query, TrustID); + + if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) != 0) + { + while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) + { + Trust_t* trust = new Trust_t(); + + trust->trustID = TrustID; + trust->name.insert(0, (const char*)Sql_GetData(SqlHandle, 0)); + memcpy(&trust->look, Sql_GetData(SqlHandle, 1), 20); + + trust->size = Sql_GetUIntData(SqlHandle, 2); + trust->EcoSystem = (ECOSYSTEM)Sql_GetIntData(SqlHandle, 3); + trust->m_Family = (uint16)Sql_GetIntData(SqlHandle, 4); + trust->mJob = (uint8)Sql_GetIntData(SqlHandle, 5); + trust->sJob = (uint8)Sql_GetIntData(SqlHandle, 6); + trust->HPscale = Sql_GetFloatData(SqlHandle, 7); + trust->MPscale = Sql_GetFloatData(SqlHandle, 8); + trust->speed = (uint8)Sql_GetIntData(SqlHandle, 9); + trust->strRank = (uint8)Sql_GetIntData(SqlHandle, 10); + trust->dexRank = (uint8)Sql_GetIntData(SqlHandle, 11); + trust->vitRank = (uint8)Sql_GetIntData(SqlHandle, 12); + trust->agiRank = (uint8)Sql_GetIntData(SqlHandle, 13); + trust->intRank = (uint8)Sql_GetIntData(SqlHandle, 14); + trust->mndRank = (uint8)Sql_GetIntData(SqlHandle, 15); + trust->chrRank = (uint8)Sql_GetIntData(SqlHandle, 16); + trust->defRank = (uint8)Sql_GetIntData(SqlHandle, 17); + trust->attRank = (uint8)Sql_GetIntData(SqlHandle, 18); + trust->accRank = (uint8)Sql_GetIntData(SqlHandle, 19); + trust->evaRank = (uint8)Sql_GetIntData(SqlHandle, 20); + trust->hasSpellScript = (bool)Sql_GetIntData(SqlHandle, 21); + trust->spellList = (uint16)Sql_GetIntData(SqlHandle, 22); + + // resistances + trust->slashres = (uint16)(Sql_GetFloatData(SqlHandle, 23) * 1000); + trust->pierceres = (uint16)(Sql_GetFloatData(SqlHandle, 24) * 1000); + trust->hthres = (uint16)(Sql_GetFloatData(SqlHandle, 25) * 1000); + trust->impactres = (uint16)(Sql_GetFloatData(SqlHandle, 26) * 1000); + + trust->firedef = 0; + trust->icedef = 0; + trust->winddef = 0; + trust->earthdef = 0; + trust->thunderdef = 0; + trust->waterdef = 0; + trust->lightdef = 0; + trust->darkdef = 0; + + trust->fireres = (uint16)((Sql_GetFloatData(SqlHandle, 27) - 1) * -100); + trust->iceres = (uint16)((Sql_GetFloatData(SqlHandle, 28) - 1) * -100); + trust->windres = (uint16)((Sql_GetFloatData(SqlHandle, 29) - 1) * -100); + trust->earthres = (uint16)((Sql_GetFloatData(SqlHandle, 30) - 1) * -100); + trust->thunderres = (uint16)((Sql_GetFloatData(SqlHandle, 31) - 1) * -100); + trust->waterres = (uint16)((Sql_GetFloatData(SqlHandle, 32) - 1) * -100); + trust->lightres = (uint16)((Sql_GetFloatData(SqlHandle, 33) - 1) * -100); + trust->darkres = (uint16)((Sql_GetFloatData(SqlHandle, 34) - 1) * -100); + + trust->cmbDelay = (uint16)Sql_GetIntData(SqlHandle, 35); + trust->name_prefix = (uint8)Sql_GetUIntData(SqlHandle, 36); + trust->m_MobSkillList = (uint16)Sql_GetUIntData(SqlHandle, 37); + + g_PTrustList.push_back(trust); + } + } + } + /************************************************************************ * * * Освобождаем список прототипов питомцев * @@ -259,6 +451,11 @@ namespace petutils } } + void FreeTrustList() + { + g_PTrustIDList.clear(); + } + void AttackTarget(CBattleEntity* PMaster, CBattleEntity* PTarget) { TPZ_DEBUG_BREAK_IF(PMaster->PPet == nullptr); @@ -1073,7 +1270,7 @@ namespace petutils // It'd probably be "good enough" to use the name as a heuristic, looking for "II" (this catches 99% of them). for (auto PTrust : PMaster->PTrusts) { - if (PTrust->m_PetID == TrustID) + if (PTrust->m_TrustID == TrustID) { PMaster->pushPacket(new CMessageStandardPacket(PMaster, 0, MsgStd::TrustSame)); return; @@ -1088,7 +1285,7 @@ namespace petutils } CTrustEntity* PTrust = LoadTrust(PMaster, TrustID); - PMaster->PTrusts.insert(PMaster->PTrusts.begin(), PTrust); + PMaster->PTrusts.insert(PMaster->PTrusts.end(), PTrust); PMaster->StatusEffectContainer->CopyConfrontationEffect(PTrust); PMaster->loc.zone->InsertPET(PTrust); PMaster->PParty->ReloadParty(); @@ -1724,25 +1921,35 @@ namespace petutils { TPZ_DEBUG_BREAK_IF(TrustID >= g_PPetList.size()); CTrustEntity* PTrust = new CTrustEntity(PMaster); + + auto index = 0; + for (size_t i = 0; i < g_PTrustList.size(); i++) + { + if (g_PTrustList.at(i)->trustID == TrustID) + { + index = i; + } + } + + Trust_t* trustData = g_PTrustList.at(index); + PTrust->loc = PMaster->loc; PTrust->m_OwnerID.id = PMaster->id; PTrust->m_OwnerID.targid = PMaster->targid; // spawn me randomly around master - PTrust->loc.p = nearPosition(PMaster->loc.p, CPetController::PetRoamDistance, (float)M_PI); - Pet_t* trust = g_PPetList.at(TrustID); - PTrust->look = trust->look; - PTrust->name = trust->name; - PTrust->m_name_prefix = trust->name_prefix; - PTrust->m_Family = trust->m_Family; - PTrust->m_MobSkillList = trust->m_MobSkillList; - PTrust->SetMJob(trust->mJob); - PTrust->SetSJob(trust->mJob); // TODO: This may not be true for some trusts - PTrust->m_Element = trust->m_Element; - PTrust->m_PetID = TrustID; + PTrust->loc.p = nearPosition(PMaster->loc.p, CTrustController::RoamDistance, (float)M_PI); + PTrust->look = trustData->look; + PTrust->name = trustData->name; + PTrust->m_name_prefix = trustData->name_prefix; + PTrust->m_Family = trustData->m_Family; + PTrust->m_MobSkillList = trustData->m_MobSkillList; + PTrust->SetMJob(trustData->mJob); + PTrust->SetSJob(trustData->sJob); // TODO: This may not be true for some trusts + PTrust->m_TrustID = TrustID; PTrust->status = STATUS_NORMAL; - PTrust->m_ModelSize = trust->size; - PTrust->m_EcoSystem = trust->EcoSystem; + PTrust->m_ModelSize = trustData->size; + PTrust->m_EcoSystem = trustData->EcoSystem; // assume level matches master PTrust->SetMLevel(PMaster->GetMLevel()); diff --git a/src/map/utils/petutils.h b/src/map/utils/petutils.h index 5e066fe45ac..ae939e073bd 100644 --- a/src/map/utils/petutils.h +++ b/src/map/utils/petutils.h @@ -56,11 +56,7 @@ enum PETID PETID_STORMWAKERFRAME = 72, PETID_ADVENTURING_FELLOW = 73, PETID_CHOCOBO = 74, - - // Trusts are 896 and above - // PETID_SHANTOTTO = 896 - PETID_SHANTOTTO = 75 - // Todo: change how this works so trusts don't need PetID at all.. + PETID_TRUST = 75 }; @@ -72,6 +68,8 @@ namespace petutils { void LoadPetList(); void FreePetList(); + void LoadTrustList(); + void FreeTrustList(); void SpawnPet(CBattleEntity* PMaster, uint32 PetID, bool spawningFromZone); void SpawnMobPet(CBattleEntity* PMaster, uint32 PetID); @@ -86,6 +84,7 @@ namespace petutils void LoadWyvernStatistics(CBattleEntity* PMaster, CPetEntity* PPet, bool finalize); void FinalizePetStatistics(CBattleEntity* PMaster, CPetEntity* PPet); bool CheckPetModType(CBattleEntity* PPet, PetModType petmod); + void QueryTrust(uint32 TrustID); CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID); }; From bc229d58c144e762414169ad9b75cdaaa09ebb95 Mon Sep 17 00:00:00 2001 From: Omnione <10185476+Omnione@users.noreply.github.com> Date: Sun, 5 Jan 2020 11:38:46 +0000 Subject: [PATCH 003/116] style fixes, (not mine lol) --- src/map/utils/petutils.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/map/utils/petutils.h b/src/map/utils/petutils.h index ae939e073bd..f074683c1a4 100644 --- a/src/map/utils/petutils.h +++ b/src/map/utils/petutils.h @@ -66,12 +66,12 @@ class CTrustEntity; namespace petutils { - void LoadPetList(); - void FreePetList(); + void LoadPetList(); + void FreePetList(); void LoadTrustList(); void FreeTrustList(); - void SpawnPet(CBattleEntity* PMaster, uint32 PetID, bool spawningFromZone); + void SpawnPet(CBattleEntity* PMaster, uint32 PetID, bool spawningFromZone); void SpawnMobPet(CBattleEntity* PMaster, uint32 PetID); void SpawnTrust(CCharEntity * PMaster, uint32 TrustID); void DetachPet(CBattleEntity* PMaster); From 9cd8d39ff3cb8a4799a5ff440a2110655d941f10 Mon Sep 17 00:00:00 2001 From: Omnione <10185476+Omnione@users.noreply.github.com> Date: Sun, 5 Jan 2020 12:29:14 +0000 Subject: [PATCH 004/116] Changed iteration method of trust id's to query trust. --- src/map/utils/petutils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map/utils/petutils.cpp b/src/map/utils/petutils.cpp index 425a4a333cd..1862ebc2063 100644 --- a/src/map/utils/petutils.cpp +++ b/src/map/utils/petutils.cpp @@ -330,9 +330,9 @@ namespace petutils } } - for each (uint32 id in g_PTrustIDList) + for (size_t i = 0; i < g_PTrustIDList.size(); i++) { - QueryTrust(id); + QueryTrust(g_PTrustIDList.at(i)); } } From 3d34a94f1d60a067b01f93f1a6ea75d3b2acdb0a Mon Sep 17 00:00:00 2001 From: Omnione <10185476+Omnione@users.noreply.github.com> Date: Sun, 5 Jan 2020 13:43:21 +0000 Subject: [PATCH 005/116] new iteration and struct for spellid + capitalised names --- sql/mob_pools.sql | 22 +++++++++++----------- src/map/utils/petutils.cpp | 18 +++++++++++++----- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index 2f492f7c59c..cd9246267b7 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5953,16 +5953,16 @@ INSERT INTO `mob_pools` VALUES (5892,'Euryale','Euryale',171,0x06007106000000000 INSERT INTO `mob_pools` VALUES (5893,'Gloombound_Lurker','Gloombound_Lurker',221,0x0000230200000000000000000000000000000000,6,6,5,360,100,0,1,0,1,2,7,0,0,155,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5894,'Lesath','Lesath',217,0x00001C0100000000000000000000000000000000,1,1,7,280,100,0,1,0,1,2,7,0,238,141,0,0,0,1,0,370); INSERT INTO `mob_pools` VALUES (5895,'Donggu','Donggu',116,0x0000780100000000000000000000000000000000,1,1,11,240,100,0,0,0,1,2,7,0,0,3,0,0,0,1,0,116); -INSERT INTO `mob_pools` VALUES (5896,'Shantotto','Shantotto',153,0x0000B80B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,276,1,0,750); -INSERT INTO `mob_pools` VALUES (5897,'Naji','Naji',149,0x0000B90B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,276,1,0,750); -INSERT INTO `mob_pools` VALUES (5898,'Kupipi','Kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,1,3,1,0,3); -INSERT INTO `mob_pools` VALUES (5899,'Excenmille','Excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,4,1,0,4); -INSERT INTO `mob_pools` VALUES (5900,'Ayame','Ayame',149,0x0000BC0B00000000000000000000000000000000,12,0,10,440,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,5); -INSERT INTO `mob_pools` VALUES (5901,'NanaaMihgo','Nanaa_Mihgo',152,0x0000BD0B00000000000000000000000000000000,6,0,2,190,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,6); -INSERT INTO `mob_pools` VALUES (5902,'Curilla','Curilla',145,0x0000BE0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,7,1,0,7); -INSERT INTO `mob_pools` VALUES (5903,'Volker','Volker',149,0x0000BF0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,8,1,0,8); -INSERT INTO `mob_pools` VALUES (5904,'Ajido-marujido','Ajido-Marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,1,9,1,0,0); -INSERT INTO `mob_pools` VALUES (5905,'Trion','Trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5896,'Shantotto','shantotto',153,0x0000B80B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,276,1,0,750); +INSERT INTO `mob_pools` VALUES (5897,'Naji','naji',149,0x0000B90B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,276,1,0,750); +INSERT INTO `mob_pools` VALUES (5898,'Kupipi','kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,1,3,1,0,3); +INSERT INTO `mob_pools` VALUES (5899,'Excenmille','excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,4,1,0,4); +INSERT INTO `mob_pools` VALUES (5900,'Ayame','ayame',149,0x0000BC0B00000000000000000000000000000000,12,0,10,440,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,5); +INSERT INTO `mob_pools` VALUES (5901,'Nanaa Mihgo','nanaa_mihgo',152,0x0000BD0B00000000000000000000000000000000,6,0,2,190,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,6); +INSERT INTO `mob_pools` VALUES (5902,'Curilla','curilla',145,0x0000BE0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,7,1,0,7); +INSERT INTO `mob_pools` VALUES (5903,'Volker','volker',149,0x0000BF0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,8,1,0,8); +INSERT INTO `mob_pools` VALUES (5904,'Ajido-marujido','ajido-marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,1,9,1,0,0); +INSERT INTO `mob_pools` VALUES (5905,'Trion','trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -- INSERT INTO `mob_pools` VALUES (5906,'zeid', -- INSERT INTO `mob_pools` VALUES (5907,'lion', -- INSERT INTO `mob_pools` VALUES (5908,'tenzen', @@ -6076,7 +6076,7 @@ INSERT INTO `mob_pools` VALUES (5905,'Trion','Trion',145,0x0000C10B0000000000000 -- INSERT INTO `mob_pools` VALUES (6016,'ingrid_ii', -- INSERT INTO `mob_pools` VALUES (6017,'arciela_ii', -- INSERT INTO `mob_pools` VALUES (6018,'iroha_ii', -INSERT INTO `mob_pools` VALUES (6019,'shantotto_ii','shantotto_ii',153,0x0000260C00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,276,1,0,750); +INSERT INTO `mob_pools` VALUES (6019,'Shantotto II','shantotto_ii',153,0x0000260C00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,276,1,0,750); -- Reserved for future Trust 6020 -- Reserved for future Trust 6021 -- Reserved for future Trust 6022 diff --git a/src/map/utils/petutils.cpp b/src/map/utils/petutils.cpp index 1862ebc2063..0b16c675948 100644 --- a/src/map/utils/petutils.cpp +++ b/src/map/utils/petutils.cpp @@ -127,6 +127,13 @@ struct Pet_t std::vector g_PPetList; +struct TrustSpell_ID +{ + uint16 spellID; +}; + +std::vector g_PTrustIDList; + struct Trust_t { uint16 trustID; @@ -189,7 +196,6 @@ struct Trust_t int16 darkres; }; -std::vector g_PTrustIDList; std::vector g_PTrustList; namespace petutils @@ -324,15 +330,17 @@ namespace petutils { while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) { - uint32 TrustID = (uint16)Sql_GetIntData(SqlHandle, 0); + TrustSpell_ID* trustID = new TrustSpell_ID(); + + trustID->spellID = (uint16)Sql_GetIntData(SqlHandle, 0); - g_PTrustIDList.push_back(TrustID); + g_PTrustIDList.push_back(trustID); } } - for (size_t i = 0; i < g_PTrustIDList.size(); i++) + for (size_t i = 0; i < g_PTrustIDList.size(); ++i) { - QueryTrust(g_PTrustIDList.at(i)); + QueryTrust(g_PTrustIDList.at(i)->spellID); } } From 29675060c1d5a507ef337fda0e415edc8b1b85b8 Mon Sep 17 00:00:00 2001 From: Omnione <10185476+Omnione@users.noreply.github.com> Date: Sun, 5 Jan 2020 14:28:43 +0000 Subject: [PATCH 006/116] try again for AppVeyor --- src/map/utils/petutils.cpp | 63 +++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/src/map/utils/petutils.cpp b/src/map/utils/petutils.cpp index 0b16c675948..22ba416db9c 100644 --- a/src/map/utils/petutils.cpp +++ b/src/map/utils/petutils.cpp @@ -61,25 +61,25 @@ along with this program. If not, see http://www.gnu.org/licenses/ struct Pet_t { - look_t look; // внешний вид - string_t name; // имя - ECOSYSTEM EcoSystem; // эко-система + look_t look; // внешний вид + string_t name; // имя + ECOSYSTEM EcoSystem; // эко-система - uint8 minLevel; // минимально-возможный уровень - uint8 maxLevel; // максимально-возможный уровень + uint8 minLevel; // минимально-возможный уровень + uint8 maxLevel; // максимально-возможный уровень uint8 name_prefix; - uint8 size; // размер модели - uint16 m_Family; - uint32 time; // время существования (будет использоваться для задания длительности статус эффекта) + uint8 size; // размер модели + uint16 m_Family; + uint32 time; // время существования (будет использоваться для задания длительности статус эффекта) - uint8 mJob; - uint8 m_Element; + uint8 mJob; + uint8 m_Element; float HPscale; // HP boost percentage float MPscale; // MP boost percentage uint16 cmbDelay; - uint8 speed; + uint8 speed; // stat ranks uint8 strRank; uint8 dexRank; @@ -129,26 +129,26 @@ std::vector g_PPetList; struct TrustSpell_ID { - uint16 spellID; + uint32 spellID; }; std::vector g_PTrustIDList; struct Trust_t { - uint16 trustID; - look_t look; // appearance data - string_t name; // name string - ECOSYSTEM EcoSystem; // ecosystem + uint32 trustID; + look_t look; // appearance data + string_t name; // name string + ECOSYSTEM EcoSystem; // ecosystem uint8 name_prefix; - uint8 size; // размер модели - uint16 m_Family; + uint8 size; // размер модели + uint16 m_Family; - uint8 mJob; - uint8 sJob; - float HPscale; // HP boost percentage - float MPscale; // MP boost percentage + uint8 mJob; + uint8 sJob; + float HPscale; // HP boost percentage + float MPscale; // MP boost percentage uint16 cmbDelay; uint8 speed; @@ -332,15 +332,16 @@ namespace petutils { TrustSpell_ID* trustID = new TrustSpell_ID(); - trustID->spellID = (uint16)Sql_GetIntData(SqlHandle, 0); + trustID->spellID = (uint32)Sql_GetIntData(SqlHandle, 0); g_PTrustIDList.push_back(trustID); } } - for (size_t i = 0; i < g_PTrustIDList.size(); ++i) + uint32 index = 0; + for (index; index < g_PTrustIDList.size(); index++) { - QueryTrust(g_PTrustIDList.at(i)->spellID); + QueryTrust(g_PTrustIDList.at(index)->spellID); } } @@ -1929,18 +1930,18 @@ namespace petutils { TPZ_DEBUG_BREAK_IF(TrustID >= g_PPetList.size()); CTrustEntity* PTrust = new CTrustEntity(PMaster); + Trust_t* trustData = new Trust_t(); - auto index = 0; - for (size_t i = 0; i < g_PTrustList.size(); i++) + uint32 index = 0; + for (index; index < g_PTrustList.size(); index++) { - if (g_PTrustList.at(i)->trustID == TrustID) + if (g_PTrustList.at(index)->trustID == TrustID) { - index = i; + trustData = g_PTrustList.at(index); + break; } } - Trust_t* trustData = g_PTrustList.at(index); - PTrust->loc = PMaster->loc; PTrust->m_OwnerID.id = PMaster->id; PTrust->m_OwnerID.targid = PMaster->targid; From f87bf5fcc00c60f4c121fd1465aa5b2ec32b13b4 Mon Sep 17 00:00:00 2001 From: Omnione <10185476+Omnione@users.noreply.github.com> Date: Sun, 5 Jan 2020 21:53:01 +0000 Subject: [PATCH 007/116] Bring in line with trust master --- scripts/globals/spells/trust/Shantotto_II.lua | 2 +- scripts/globals/spells/trust/kupipi.lua | 6 ++---- scripts/globals/spells/trust/naji.lua | 6 ++---- scripts/globals/spells/trust/shantotto.lua | 6 ++---- scripts/globals/spells/trust/trion.lua | 6 ++---- scripts/globals/trust.lua | 7 +++++++ src/map/entities/charentity.h | 2 -- src/map/map.cpp | 1 + 8 files changed, 17 insertions(+), 19 deletions(-) create mode 100644 scripts/globals/trust.lua diff --git a/scripts/globals/spells/trust/Shantotto_II.lua b/scripts/globals/spells/trust/Shantotto_II.lua index e57cb9101e8..f6ab49f18c2 100644 --- a/scripts/globals/spells/trust/Shantotto_II.lua +++ b/scripts/globals/spells/trust/Shantotto_II.lua @@ -1,7 +1,7 @@ ----------------------------------------- -- Trust: Shantotto II ----------------------------------------- --- require("scripts/globals/trust") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) diff --git a/scripts/globals/spells/trust/kupipi.lua b/scripts/globals/spells/trust/kupipi.lua index 7bc12778bfa..9ec714b4ca9 100644 --- a/scripts/globals/spells/trust/kupipi.lua +++ b/scripts/globals/spells/trust/kupipi.lua @@ -1,7 +1,7 @@ ----------------------------------------- --- Spell: Kupipi +-- Trust: Kupipi ----------------------------------------- -require("scripts/globals/trust"); +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) @@ -9,8 +9,6 @@ function onMagicCastingCheck(caster,target,spell) end function onSpellCast(caster,target,spell) - -- Todo: put Trusts's spawn in dialog here or in entity script? - -- Todo: automate entity spawn in core for trust spells? caster:spawnTrust(898) return 0 end diff --git a/scripts/globals/spells/trust/naji.lua b/scripts/globals/spells/trust/naji.lua index 0a35f4127c4..cad675aceb2 100644 --- a/scripts/globals/spells/trust/naji.lua +++ b/scripts/globals/spells/trust/naji.lua @@ -1,7 +1,7 @@ ----------------------------------------- --- Spell: Naji +-- Trust: Naji ----------------------------------------- -require("scripts/globals/trust"); +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) @@ -9,8 +9,6 @@ function onMagicCastingCheck(caster,target,spell) end function onSpellCast(caster,target,spell) - -- Todo: put Trusts's spawn in dialog here or in entity script? - -- Todo: automate entity spawn in core for trust spells? caster:spawnTrust(897) return 0 end diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index 6205f0549b1..95de65632c2 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -1,7 +1,7 @@ ----------------------------------------- --- Spell: Shantotto +-- Trust: Shantotto ----------------------------------------- -require("scripts/globals/trust"); +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) @@ -9,8 +9,6 @@ function onMagicCastingCheck(caster,target,spell) end function onSpellCast(caster,target,spell) - -- Todo: put Trusts's spawn in dialog here or in entity script? - -- Todo: automate entity spawn in core for trust spells? caster:spawnTrust(896) return 0 end diff --git a/scripts/globals/spells/trust/trion.lua b/scripts/globals/spells/trust/trion.lua index e578db446b0..270962e7dee 100644 --- a/scripts/globals/spells/trust/trion.lua +++ b/scripts/globals/spells/trust/trion.lua @@ -1,7 +1,7 @@ ----------------------------------------- --- Spell: Trion +-- Trust: Trion ----------------------------------------- -require("scripts/globals/trust"); +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) @@ -9,8 +9,6 @@ function onMagicCastingCheck(caster,target,spell) end function onSpellCast(caster,target,spell) - -- Todo: put Trusts's spawn in dialog here or in entity script? - -- Todo: automate entity spawn in core for trust spells? caster:spawnTrust(905) return 0 end diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua new file mode 100644 index 00000000000..328b163e6d1 --- /dev/null +++ b/scripts/globals/trust.lua @@ -0,0 +1,7 @@ +--------------------------------------------------------- +-- Trust +--------------------------------------------------------- +require("scripts/globals/settings") +require("scripts/globals/status") +require("scripts/globals/magic") +require("scripts/globals/msg") \ No newline at end of file diff --git a/src/map/entities/charentity.h b/src/map/entities/charentity.h index 51c39c09ae4..0ddcedd53ea 100644 --- a/src/map/entities/charentity.h +++ b/src/map/entities/charentity.h @@ -224,8 +224,6 @@ class CCharEntity : public CBattleEntity uint16 m_mkeCurrent; // current mission of A Moogle Kupo d'Etat uint16 m_asaCurrent; // current mission of A Shantotto Ascension - // TODO: half of this array should be stored in char_vars, and not here, because this information is not displayed in the client interface and the server does not perform any operations with them - //currency_t m_currency; // conquest points, imperial standing points etc Teleport_t teleport; // Outposts, Runic Portals, Homepoints, Survival Guides, Maws, etc diff --git a/src/map/map.cpp b/src/map/map.cpp index bb467747d56..f2e4e7d36b5 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -217,6 +217,7 @@ int32 do_init(int32 argc, char** argv) battleutils::LoadMobSkillsList(); battleutils::LoadSkillChainDamageModifiers(); petutils::LoadPetList(); + petutils::LoadTrustList(); mobutils::LoadCustomMods(); ShowStatus("do_init: loading zones"); From e7fae401ec5edbac8b98afc4b9e1f6cce3f5395e Mon Sep 17 00:00:00 2001 From: Omnione <10185476+Omnione@users.noreply.github.com> Date: Mon, 10 Feb 2020 22:51:45 +0000 Subject: [PATCH 008/116] =?UTF-8?q?=E2=80=A2=20Added=20most=20trust=20scri?= =?UTF-8?q?pts.=20=E2=80=A2=20Adjusted=20spawn=20radius=20for=20trust.=20?= =?UTF-8?q?=E2=80=A2=20Can=20target=20trust=20and=20heal=20them.=20?= =?UTF-8?q?=E2=80=A2=20Trust=20will=20follow=20each=20other=20in=20party?= =?UTF-8?q?=20order=20rather=20than=20the=20player.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/globals/spells/trust/Shantotto_II.lua | 8 +- .../globals/spells/trust/ajido-marujido.lua | 20 ++ scripts/globals/spells/trust/aldo.lua | 20 ++ scripts/globals/spells/trust/areuhat.lua | 20 ++ scripts/globals/spells/trust/ayame.lua | 20 ++ scripts/globals/spells/trust/cherukiki.lua | 20 ++ scripts/globals/spells/trust/cid.lua | 20 ++ scripts/globals/spells/trust/curilla.lua | 20 ++ scripts/globals/spells/trust/d_shantotto.lua | 20 ++ scripts/globals/spells/trust/elivira.lua | 20 ++ scripts/globals/spells/trust/excenmille.lua | 20 ++ scripts/globals/spells/trust/fablinix.lua | 20 ++ .../globals/spells/trust/ferreous_coffin.lua | 20 ++ scripts/globals/spells/trust/gadalar.lua | 20 ++ scripts/globals/spells/trust/gessho.lua | 20 ++ scripts/globals/spells/trust/gilgamesh.lua | 20 ++ scripts/globals/spells/trust/ingrid.lua | 20 ++ scripts/globals/spells/trust/iron_eater.lua | 20 ++ scripts/globals/spells/trust/joachim.lua | 20 ++ .../globals/spells/trust/karaha-baruha.lua | 20 ++ scripts/globals/spells/trust/kupipi.lua | 8 +- .../globals/spells/trust/lehko_habhoka.lua | 20 ++ .../globals/spells/trust/lhu_mhakaracca.lua | 20 ++ scripts/globals/spells/trust/lilisette.lua | 20 ++ scripts/globals/spells/trust/lion.lua | 20 ++ scripts/globals/spells/trust/luzaf.lua | 20 ++ scripts/globals/spells/trust/maat.lua | 20 ++ .../globals/spells/trust/mihli_aliapoh.lua | 20 ++ scripts/globals/spells/trust/mnejing.lua | 20 ++ scripts/globals/spells/trust/moogle.lua | 20 ++ scripts/globals/spells/trust/mumor.lua | 20 ++ .../globals/spells/trust/naja_salaheem.lua | 20 ++ scripts/globals/spells/trust/najelith.lua | 20 ++ scripts/globals/spells/trust/naji.lua | 8 +- scripts/globals/spells/trust/nanaa_mihgo.lua | 20 ++ scripts/globals/spells/trust/nashmeira.lua | 20 ++ scripts/globals/spells/trust/noillurie.lua | 20 ++ scripts/globals/spells/trust/ovjang.lua | 20 ++ scripts/globals/spells/trust/prishe.lua | 20 ++ scripts/globals/spells/trust/rainemard.lua | 20 ++ scripts/globals/spells/trust/sakura.lua | 20 ++ .../globals/spells/trust/semih_lafihna.lua | 20 ++ scripts/globals/spells/trust/shantotto.lua | 8 +- scripts/globals/spells/trust/shikaree_z.lua | 20 ++ scripts/globals/spells/trust/star_sibyl.lua | 20 ++ scripts/globals/spells/trust/tenzen.lua | 20 ++ scripts/globals/spells/trust/trion.lua | 8 +- scripts/globals/spells/trust/ulmia.lua | 20 ++ scripts/globals/spells/trust/valaineral.lua | 20 ++ scripts/globals/spells/trust/volker.lua | 20 ++ scripts/globals/spells/trust/zazarg.lua | 20 ++ scripts/globals/spells/trust/zeid.lua | 20 ++ scripts/globals/trust.lua | 19 +- scripts/globals/trust/Kupipi.lua | 40 +++ scripts/globals/trust/Trion.lua | 52 ++++ sql/mob_pools.sql | 233 +++++++++--------- sql/mob_spell_lists.sql | 56 +++++ src/map/ai/controllers/trust_controller.cpp | 4 +- src/map/ai/controllers/trust_controller.h | 16 +- src/map/ai/helpers/targetfind.cpp | 27 +- src/map/battlefield.cpp | 2 +- src/map/entities/battleentity.cpp | 2 +- src/map/entities/charentity.cpp | 1 - src/map/lua/lua_baseentity.cpp | 100 +++++++- src/map/lua/lua_baseentity.h | 2 + src/map/map.cpp | 1 + src/map/packet_system.cpp | 5 + src/map/status_effect_container.cpp | 9 +- src/map/utils/petutils.cpp | 85 +++---- src/map/utils/petutils.h | 1 + src/map/zone.cpp | 21 ++ src/map/zone.h | 4 + src/map/zone_entities.cpp | 163 +++++++++++- src/map/zone_entities.h | 4 + src/map/zone_instance.cpp | 24 ++ src/map/zone_instance.h | 3 + 76 files changed, 1654 insertions(+), 200 deletions(-) create mode 100644 scripts/globals/spells/trust/ajido-marujido.lua create mode 100644 scripts/globals/spells/trust/aldo.lua create mode 100644 scripts/globals/spells/trust/areuhat.lua create mode 100644 scripts/globals/spells/trust/ayame.lua create mode 100644 scripts/globals/spells/trust/cherukiki.lua create mode 100644 scripts/globals/spells/trust/cid.lua create mode 100644 scripts/globals/spells/trust/curilla.lua create mode 100644 scripts/globals/spells/trust/d_shantotto.lua create mode 100644 scripts/globals/spells/trust/elivira.lua create mode 100644 scripts/globals/spells/trust/excenmille.lua create mode 100644 scripts/globals/spells/trust/fablinix.lua create mode 100644 scripts/globals/spells/trust/ferreous_coffin.lua create mode 100644 scripts/globals/spells/trust/gadalar.lua create mode 100644 scripts/globals/spells/trust/gessho.lua create mode 100644 scripts/globals/spells/trust/gilgamesh.lua create mode 100644 scripts/globals/spells/trust/ingrid.lua create mode 100644 scripts/globals/spells/trust/iron_eater.lua create mode 100644 scripts/globals/spells/trust/joachim.lua create mode 100644 scripts/globals/spells/trust/karaha-baruha.lua create mode 100644 scripts/globals/spells/trust/lehko_habhoka.lua create mode 100644 scripts/globals/spells/trust/lhu_mhakaracca.lua create mode 100644 scripts/globals/spells/trust/lilisette.lua create mode 100644 scripts/globals/spells/trust/lion.lua create mode 100644 scripts/globals/spells/trust/luzaf.lua create mode 100644 scripts/globals/spells/trust/maat.lua create mode 100644 scripts/globals/spells/trust/mihli_aliapoh.lua create mode 100644 scripts/globals/spells/trust/mnejing.lua create mode 100644 scripts/globals/spells/trust/moogle.lua create mode 100644 scripts/globals/spells/trust/mumor.lua create mode 100644 scripts/globals/spells/trust/naja_salaheem.lua create mode 100644 scripts/globals/spells/trust/najelith.lua create mode 100644 scripts/globals/spells/trust/nanaa_mihgo.lua create mode 100644 scripts/globals/spells/trust/nashmeira.lua create mode 100644 scripts/globals/spells/trust/noillurie.lua create mode 100644 scripts/globals/spells/trust/ovjang.lua create mode 100644 scripts/globals/spells/trust/prishe.lua create mode 100644 scripts/globals/spells/trust/rainemard.lua create mode 100644 scripts/globals/spells/trust/sakura.lua create mode 100644 scripts/globals/spells/trust/semih_lafihna.lua create mode 100644 scripts/globals/spells/trust/shikaree_z.lua create mode 100644 scripts/globals/spells/trust/star_sibyl.lua create mode 100644 scripts/globals/spells/trust/tenzen.lua create mode 100644 scripts/globals/spells/trust/ulmia.lua create mode 100644 scripts/globals/spells/trust/valaineral.lua create mode 100644 scripts/globals/spells/trust/volker.lua create mode 100644 scripts/globals/spells/trust/zazarg.lua create mode 100644 scripts/globals/spells/trust/zeid.lua create mode 100644 scripts/globals/trust/Kupipi.lua create mode 100644 scripts/globals/trust/Trion.lua diff --git a/scripts/globals/spells/trust/Shantotto_II.lua b/scripts/globals/spells/trust/Shantotto_II.lua index f6ab49f18c2..3d2acf902a7 100644 --- a/scripts/globals/spells/trust/Shantotto_II.lua +++ b/scripts/globals/spells/trust/Shantotto_II.lua @@ -1,10 +1,16 @@ ----------------------------------------- -- Trust: Shantotto II ----------------------------------------- -require("scripts/globals/trust") +require("scripts/globals/status") +require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end return 0 end diff --git a/scripts/globals/spells/trust/ajido-marujido.lua b/scripts/globals/spells/trust/ajido-marujido.lua new file mode 100644 index 00000000000..7cafe266f7d --- /dev/null +++ b/scripts/globals/spells/trust/ajido-marujido.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Ajido-Marujido +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(904) + return 0 +end diff --git a/scripts/globals/spells/trust/aldo.lua b/scripts/globals/spells/trust/aldo.lua new file mode 100644 index 00000000000..b3ede93f1a2 --- /dev/null +++ b/scripts/globals/spells/trust/aldo.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Aldo +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(930) + return 0 +end diff --git a/scripts/globals/spells/trust/areuhat.lua b/scripts/globals/spells/trust/areuhat.lua new file mode 100644 index 00000000000..181e24b8dfd --- /dev/null +++ b/scripts/globals/spells/trust/areuhat.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Areuhat +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(939) + return 0 +end diff --git a/scripts/globals/spells/trust/ayame.lua b/scripts/globals/spells/trust/ayame.lua new file mode 100644 index 00000000000..5b5015bbda4 --- /dev/null +++ b/scripts/globals/spells/trust/ayame.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Ayame +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(900) + return 0 +end diff --git a/scripts/globals/spells/trust/cherukiki.lua b/scripts/globals/spells/trust/cherukiki.lua new file mode 100644 index 00000000000..d715a9a5b2d --- /dev/null +++ b/scripts/globals/spells/trust/cherukiki.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Cherukiki +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(916) + return 0 +end diff --git a/scripts/globals/spells/trust/cid.lua b/scripts/globals/spells/trust/cid.lua new file mode 100644 index 00000000000..eebd02b8229 --- /dev/null +++ b/scripts/globals/spells/trust/cid.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Cid +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(937) + return 0 +end diff --git a/scripts/globals/spells/trust/curilla.lua b/scripts/globals/spells/trust/curilla.lua new file mode 100644 index 00000000000..f1500dfd7eb --- /dev/null +++ b/scripts/globals/spells/trust/curilla.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Curilla +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(902) + return 0 +end diff --git a/scripts/globals/spells/trust/d_shantotto.lua b/scripts/globals/spells/trust/d_shantotto.lua new file mode 100644 index 00000000000..70208899626 --- /dev/null +++ b/scripts/globals/spells/trust/d_shantotto.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: D Shantotto +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(934) + return 0 +end diff --git a/scripts/globals/spells/trust/elivira.lua b/scripts/globals/spells/trust/elivira.lua new file mode 100644 index 00000000000..6cdea8e2c92 --- /dev/null +++ b/scripts/globals/spells/trust/elivira.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Elivira +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(941) + return 0 +end diff --git a/scripts/globals/spells/trust/excenmille.lua b/scripts/globals/spells/trust/excenmille.lua new file mode 100644 index 00000000000..f835159b93c --- /dev/null +++ b/scripts/globals/spells/trust/excenmille.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Excenmille +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(899) + return 0 +end diff --git a/scripts/globals/spells/trust/fablinix.lua b/scripts/globals/spells/trust/fablinix.lua new file mode 100644 index 00000000000..81110163993 --- /dev/null +++ b/scripts/globals/spells/trust/fablinix.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Fablinix +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(932) + return 0 +end diff --git a/scripts/globals/spells/trust/ferreous_coffin.lua b/scripts/globals/spells/trust/ferreous_coffin.lua new file mode 100644 index 00000000000..e2b42314907 --- /dev/null +++ b/scripts/globals/spells/trust/ferreous_coffin.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Ferreous Coffin +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(944) + return 0 +end diff --git a/scripts/globals/spells/trust/gadalar.lua b/scripts/globals/spells/trust/gadalar.lua new file mode 100644 index 00000000000..b7c51f78b52 --- /dev/null +++ b/scripts/globals/spells/trust/gadalar.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Gadalar +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(919) + return 0 +end diff --git a/scripts/globals/spells/trust/gessho.lua b/scripts/globals/spells/trust/gessho.lua new file mode 100644 index 00000000000..a24908e86ac --- /dev/null +++ b/scripts/globals/spells/trust/gessho.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Gessho +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(918) + return 0 +end diff --git a/scripts/globals/spells/trust/gilgamesh.lua b/scripts/globals/spells/trust/gilgamesh.lua new file mode 100644 index 00000000000..5515f93be57 --- /dev/null +++ b/scripts/globals/spells/trust/gilgamesh.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Gilgamesh +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(938) + return 0 +end diff --git a/scripts/globals/spells/trust/ingrid.lua b/scripts/globals/spells/trust/ingrid.lua new file mode 100644 index 00000000000..0109008b628 --- /dev/null +++ b/scripts/globals/spells/trust/ingrid.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Ingrid +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(921) + return 0 +end diff --git a/scripts/globals/spells/trust/iron_eater.lua b/scripts/globals/spells/trust/iron_eater.lua new file mode 100644 index 00000000000..555372849bd --- /dev/null +++ b/scripts/globals/spells/trust/iron_eater.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Iron Eater +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(917) + return 0 +end diff --git a/scripts/globals/spells/trust/joachim.lua b/scripts/globals/spells/trust/joachim.lua new file mode 100644 index 00000000000..e8e398d6798 --- /dev/null +++ b/scripts/globals/spells/trust/joachim.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Joachim +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(911) + return 0 +end diff --git a/scripts/globals/spells/trust/karaha-baruha.lua b/scripts/globals/spells/trust/karaha-baruha.lua new file mode 100644 index 00000000000..e043d217cd8 --- /dev/null +++ b/scripts/globals/spells/trust/karaha-baruha.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Karaha-Baruha +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(936) + return 0 +end diff --git a/scripts/globals/spells/trust/kupipi.lua b/scripts/globals/spells/trust/kupipi.lua index 9ec714b4ca9..7457337d8ac 100644 --- a/scripts/globals/spells/trust/kupipi.lua +++ b/scripts/globals/spells/trust/kupipi.lua @@ -1,10 +1,16 @@ ----------------------------------------- -- Trust: Kupipi ----------------------------------------- -require("scripts/globals/trust") +require("scripts/globals/status") +require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end return 0 end diff --git a/scripts/globals/spells/trust/lehko_habhoka.lua b/scripts/globals/spells/trust/lehko_habhoka.lua new file mode 100644 index 00000000000..9fa852dd73a --- /dev/null +++ b/scripts/globals/spells/trust/lehko_habhoka.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Lehko Habhoka +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(922) + return 0 +end diff --git a/scripts/globals/spells/trust/lhu_mhakaracca.lua b/scripts/globals/spells/trust/lhu_mhakaracca.lua new file mode 100644 index 00000000000..590c0def6af --- /dev/null +++ b/scripts/globals/spells/trust/lhu_mhakaracca.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Lhu Mhakaracca +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(943) + return 0 +end diff --git a/scripts/globals/spells/trust/lilisette.lua b/scripts/globals/spells/trust/lilisette.lua new file mode 100644 index 00000000000..a7182e6edee --- /dev/null +++ b/scripts/globals/spells/trust/lilisette.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: lilisette +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(945) + return 0 +end diff --git a/scripts/globals/spells/trust/lion.lua b/scripts/globals/spells/trust/lion.lua new file mode 100644 index 00000000000..0c8eed34b09 --- /dev/null +++ b/scripts/globals/spells/trust/lion.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Lion +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(907) + return 0 +end diff --git a/scripts/globals/spells/trust/luzaf.lua b/scripts/globals/spells/trust/luzaf.lua new file mode 100644 index 00000000000..9bd9a837386 --- /dev/null +++ b/scripts/globals/spells/trust/luzaf.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Luzaf +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(928) + return 0 +end diff --git a/scripts/globals/spells/trust/maat.lua b/scripts/globals/spells/trust/maat.lua new file mode 100644 index 00000000000..f9fe7db869e --- /dev/null +++ b/scripts/globals/spells/trust/maat.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Maat +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(933) + return 0 +end diff --git a/scripts/globals/spells/trust/mihli_aliapoh.lua b/scripts/globals/spells/trust/mihli_aliapoh.lua new file mode 100644 index 00000000000..a4daf367f7c --- /dev/null +++ b/scripts/globals/spells/trust/mihli_aliapoh.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Mihli Aliapoh +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(909) + return 0 +end diff --git a/scripts/globals/spells/trust/mnejing.lua b/scripts/globals/spells/trust/mnejing.lua new file mode 100644 index 00000000000..2798fac1055 --- /dev/null +++ b/scripts/globals/spells/trust/mnejing.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Mnejing +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(926) + return 0 +end diff --git a/scripts/globals/spells/trust/moogle.lua b/scripts/globals/spells/trust/moogle.lua new file mode 100644 index 00000000000..6c580ed97e0 --- /dev/null +++ b/scripts/globals/spells/trust/moogle.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Moogle +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(931) + return 0 +end diff --git a/scripts/globals/spells/trust/mumor.lua b/scripts/globals/spells/trust/mumor.lua new file mode 100644 index 00000000000..28ab43224c4 --- /dev/null +++ b/scripts/globals/spells/trust/mumor.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Mumor +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(946) + return 0 +end diff --git a/scripts/globals/spells/trust/naja_salaheem.lua b/scripts/globals/spells/trust/naja_salaheem.lua new file mode 100644 index 00000000000..e0bec3a92da --- /dev/null +++ b/scripts/globals/spells/trust/naja_salaheem.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Naja Salaheem +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(912) + return 0 +end diff --git a/scripts/globals/spells/trust/najelith.lua b/scripts/globals/spells/trust/najelith.lua new file mode 100644 index 00000000000..18b0f3b220a --- /dev/null +++ b/scripts/globals/spells/trust/najelith.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Najelith +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(929) + return 0 +end diff --git a/scripts/globals/spells/trust/naji.lua b/scripts/globals/spells/trust/naji.lua index cad675aceb2..7c686f115e3 100644 --- a/scripts/globals/spells/trust/naji.lua +++ b/scripts/globals/spells/trust/naji.lua @@ -1,10 +1,16 @@ ----------------------------------------- -- Trust: Naji ----------------------------------------- -require("scripts/globals/trust") +require("scripts/globals/status") +require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end return 0 end diff --git a/scripts/globals/spells/trust/nanaa_mihgo.lua b/scripts/globals/spells/trust/nanaa_mihgo.lua new file mode 100644 index 00000000000..2802f13506a --- /dev/null +++ b/scripts/globals/spells/trust/nanaa_mihgo.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Nanaa Mihgo +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(901) + return 0 +end diff --git a/scripts/globals/spells/trust/nashmeira.lua b/scripts/globals/spells/trust/nashmeira.lua new file mode 100644 index 00000000000..779249f89a5 --- /dev/null +++ b/scripts/globals/spells/trust/nashmeira.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Nashmeira +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(923) + return 0 +end diff --git a/scripts/globals/spells/trust/noillurie.lua b/scripts/globals/spells/trust/noillurie.lua new file mode 100644 index 00000000000..213591940f5 --- /dev/null +++ b/scripts/globals/spells/trust/noillurie.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Noillurie +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(942) + return 0 +end diff --git a/scripts/globals/spells/trust/ovjang.lua b/scripts/globals/spells/trust/ovjang.lua new file mode 100644 index 00000000000..c35619be7af --- /dev/null +++ b/scripts/globals/spells/trust/ovjang.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Ovjang +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(925) + return 0 +end diff --git a/scripts/globals/spells/trust/prishe.lua b/scripts/globals/spells/trust/prishe.lua new file mode 100644 index 00000000000..f58842beae6 --- /dev/null +++ b/scripts/globals/spells/trust/prishe.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Prishe +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(913) + return 0 +end diff --git a/scripts/globals/spells/trust/rainemard.lua b/scripts/globals/spells/trust/rainemard.lua new file mode 100644 index 00000000000..5573882c1c3 --- /dev/null +++ b/scripts/globals/spells/trust/rainemard.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Rainemard +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(920) + return 0 +end diff --git a/scripts/globals/spells/trust/sakura.lua b/scripts/globals/spells/trust/sakura.lua new file mode 100644 index 00000000000..da604557382 --- /dev/null +++ b/scripts/globals/spells/trust/sakura.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Sakura +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(927) + return 0 +end diff --git a/scripts/globals/spells/trust/semih_lafihna.lua b/scripts/globals/spells/trust/semih_lafihna.lua new file mode 100644 index 00000000000..cc9ccde0bee --- /dev/null +++ b/scripts/globals/spells/trust/semih_lafihna.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Semih Lafihna +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(940) + return 0 +end diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index 95de65632c2..21357841671 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -1,10 +1,16 @@ ----------------------------------------- -- Trust: Shantotto ----------------------------------------- -require("scripts/globals/trust") +require("scripts/globals/status") +require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end return 0 end diff --git a/scripts/globals/spells/trust/shikaree_z.lua b/scripts/globals/spells/trust/shikaree_z.lua new file mode 100644 index 00000000000..0998bec6e4f --- /dev/null +++ b/scripts/globals/spells/trust/shikaree_z.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Shikaree Z +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(915) + return 0 +end diff --git a/scripts/globals/spells/trust/star_sibyl.lua b/scripts/globals/spells/trust/star_sibyl.lua new file mode 100644 index 00000000000..0ec9bce8813 --- /dev/null +++ b/scripts/globals/spells/trust/star_sibyl.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Star Sibyl +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(935) + return 0 +end diff --git a/scripts/globals/spells/trust/tenzen.lua b/scripts/globals/spells/trust/tenzen.lua new file mode 100644 index 00000000000..9210239fcc2 --- /dev/null +++ b/scripts/globals/spells/trust/tenzen.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Tenzen +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(908) + return 0 +end diff --git a/scripts/globals/spells/trust/trion.lua b/scripts/globals/spells/trust/trion.lua index 270962e7dee..1915e2f40a9 100644 --- a/scripts/globals/spells/trust/trion.lua +++ b/scripts/globals/spells/trust/trion.lua @@ -1,10 +1,16 @@ ----------------------------------------- -- Trust: Trion ----------------------------------------- -require("scripts/globals/trust") +require("scripts/globals/status") +require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end return 0 end diff --git a/scripts/globals/spells/trust/ulmia.lua b/scripts/globals/spells/trust/ulmia.lua new file mode 100644 index 00000000000..32f6698167a --- /dev/null +++ b/scripts/globals/spells/trust/ulmia.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Ulmia +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(914) + return 0 +end diff --git a/scripts/globals/spells/trust/valaineral.lua b/scripts/globals/spells/trust/valaineral.lua new file mode 100644 index 00000000000..8d3734e2a7f --- /dev/null +++ b/scripts/globals/spells/trust/valaineral.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Valaineral +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(910) + return 0 +end diff --git a/scripts/globals/spells/trust/volker.lua b/scripts/globals/spells/trust/volker.lua new file mode 100644 index 00000000000..060a554006b --- /dev/null +++ b/scripts/globals/spells/trust/volker.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Volker +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(903) + return 0 +end diff --git a/scripts/globals/spells/trust/zazarg.lua b/scripts/globals/spells/trust/zazarg.lua new file mode 100644 index 00000000000..21ddd824c4c --- /dev/null +++ b/scripts/globals/spells/trust/zazarg.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Zazarg +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(924) + return 0 +end diff --git a/scripts/globals/spells/trust/zeid.lua b/scripts/globals/spells/trust/zeid.lua new file mode 100644 index 00000000000..6d2eee4454e --- /dev/null +++ b/scripts/globals/spells/trust/zeid.lua @@ -0,0 +1,20 @@ +----------------------------------------- +-- Trust: Zeid +----------------------------------------- +require("scripts/globals/status") +require("scripts/globals/msg") +----------------------------------------- + +function onMagicCastingCheck(caster,target,spell) + if (not caster:canUseMisc(dsp.zoneMisc.PET)) then + return dsp.msg.basic.CANT_BE_USED_IN_AREA + elseif (not caster:canCastTrust(spell:getID())) then + return + end + return 0 +end + +function onSpellCast(caster,target,spell) + caster:spawnTrust(906) + return 0 +end diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index 328b163e6d1..85304fc48ba 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -3,5 +3,20 @@ --------------------------------------------------------- require("scripts/globals/settings") require("scripts/globals/status") -require("scripts/globals/magic") -require("scripts/globals/msg") \ No newline at end of file +require("scripts/globals/msg") + +dsp = dsp or {} +dsp.trust = dsp.trust or {} + +dsp.trust.messageParty = function(mob, messageString) + local party = {} + local master = mob:getMaster() + + party = master:getAlliance() + + for _,member in ipairs(party) do + if member:getZoneID() == mob:getZoneID() and member:isPC() then + member:PrintToPlayer(messageString,4) + end + end +end \ No newline at end of file diff --git a/scripts/globals/trust/Kupipi.lua b/scripts/globals/trust/Kupipi.lua new file mode 100644 index 00000000000..0c2eb6862a4 --- /dev/null +++ b/scripts/globals/trust/Kupipi.lua @@ -0,0 +1,40 @@ +----------------------------------- +-- Trust: Kupipi +-- Spellid: 898 +----------------------------------- +require("scripts/globals/trust") +----------------------------------- + +function onMobSpawn(mob) + --local party = {} + local master = mob:getMaster() + local text = "You can entrust e~verything to the meticulous Kupipi!" + + --party = master:getAlliance() + master:PrintToPlayer(text,15) + --for _,member in ipairs(party) do + -- if member:getZoneID() == mob:getZoneID() and member:isPC() then + -- member:PrintToPlayer(text,4) + -- end + --end +end + +function onMobFight(mob,target) + local master = mob:getMaster() + + if master:getHPP() < 50 then + print("my masters hp is low") + mob:castSpell(1,master) + end +end + +function onMobDeath(mob, player, isKiller) + +end + +function onMobDespawn(mob) + +end + +local function messageParty(mob, messageString) +end \ No newline at end of file diff --git a/scripts/globals/trust/Trion.lua b/scripts/globals/trust/Trion.lua new file mode 100644 index 00000000000..c6f8f6b5f63 --- /dev/null +++ b/scripts/globals/trust/Trion.lua @@ -0,0 +1,52 @@ +----------------------------------- +-- Trust: Tion +-- Spellid: 905 +----------------------------------- +require("scripts/globals/trust") +----------------------------------- + +function onMobSpawn(mob) + --local party = {} + print("working") + local master = mob:getMaster() + local text = "I am Trion, prince of San d'Oria. May my blade lead us to victory this day!" + + --party = master:getAlliance() + master:PrintToPlayer(text,15) + --for _,member in ipairs(party) do + -- if member:getZoneID() == mob:getZoneID() and member:isPC() then + -- member:PrintToPlayer(text,4) + -- end + --end +end + +function onMobFight(mob,target) +end + +function onMobDeath(mob, player, isKiller) + print("Trying to kill Trion!") + end + +function onMobDespawn(mob) + print("Trying to despawn Trion!") +end + +function onMonsterMagicPrepare(mob,target) + -- casts Water IV, Waterga III, Flood, Drown + local rnd = math.random(); + + if rnd < 0.5 then + return 43 + elseif rnd < 0.7 then + return 1 + elseif rnd < 0.9 then + return 48 + else + return 1 + end + +end + +local function messageParty(mob, messageString) + print("passing through to messageParty ok!") +end \ No newline at end of file diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index cd9246267b7..5806ad8bf6b 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5953,130 +5953,131 @@ INSERT INTO `mob_pools` VALUES (5892,'Euryale','Euryale',171,0x06007106000000000 INSERT INTO `mob_pools` VALUES (5893,'Gloombound_Lurker','Gloombound_Lurker',221,0x0000230200000000000000000000000000000000,6,6,5,360,100,0,1,0,1,2,7,0,0,155,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5894,'Lesath','Lesath',217,0x00001C0100000000000000000000000000000000,1,1,7,280,100,0,1,0,1,2,7,0,238,141,0,0,0,1,0,370); INSERT INTO `mob_pools` VALUES (5895,'Donggu','Donggu',116,0x0000780100000000000000000000000000000000,1,1,11,240,100,0,0,0,1,2,7,0,0,3,0,0,0,1,0,116); -INSERT INTO `mob_pools` VALUES (5896,'Shantotto','shantotto',153,0x0000B80B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,276,1,0,750); -INSERT INTO `mob_pools` VALUES (5897,'Naji','naji',149,0x0000B90B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,276,1,0,750); -INSERT INTO `mob_pools` VALUES (5898,'Kupipi','kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,1,3,1,0,3); -INSERT INTO `mob_pools` VALUES (5899,'Excenmille','excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,4,1,0,4); + +INSERT INTO `mob_pools` VALUES (5896,'Shantotto','shantotto',153,0x0000B80B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,308,1,0,750); +INSERT INTO `mob_pools` VALUES (5897,'Naji','naji',149,0x0000B90B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,0,1,0,750); +INSERT INTO `mob_pools` VALUES (5898,'Kupipi','kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,1,309,1,0,3); +INSERT INTO `mob_pools` VALUES (5899,'Excenmille','excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,310,1,0,4); INSERT INTO `mob_pools` VALUES (5900,'Ayame','ayame',149,0x0000BC0B00000000000000000000000000000000,12,0,10,440,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,5); -INSERT INTO `mob_pools` VALUES (5901,'Nanaa Mihgo','nanaa_mihgo',152,0x0000BD0B00000000000000000000000000000000,6,0,2,190,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,6); +INSERT INTO `mob_pools` VALUES (5901,'NanaaMihgo','nanaa_mihgo',152,0x0000BD0B00000000000000000000000000000000,6,0,2,190,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,6); INSERT INTO `mob_pools` VALUES (5902,'Curilla','curilla',145,0x0000BE0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,7,1,0,7); INSERT INTO `mob_pools` VALUES (5903,'Volker','volker',149,0x0000BF0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,8,1,0,8); -INSERT INTO `mob_pools` VALUES (5904,'Ajido-marujido','ajido-marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,1,9,1,0,0); +INSERT INTO `mob_pools` VALUES (5904,'Ajido-Marujido','ajido-marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,1,9,1,0,0); INSERT INTO `mob_pools` VALUES (5905,'Trion','trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); --- INSERT INTO `mob_pools` VALUES (5906,'zeid', --- INSERT INTO `mob_pools` VALUES (5907,'lion', --- INSERT INTO `mob_pools` VALUES (5908,'tenzen', --- INSERT INTO `mob_pools` VALUES (5909,'mihli_aliapoh', --- INSERT INTO `mob_pools` VALUES (5910,'valaineral', --- INSERT INTO `mob_pools` VALUES (5911,'joachim', --- INSERT INTO `mob_pools` VALUES (5912,'naja_salaheem', --- INSERT INTO `mob_pools` VALUES (5913,'prishe', --- INSERT INTO `mob_pools` VALUES (5914,'ulmia', --- INSERT INTO `mob_pools` VALUES (5915,'shikaree_z', --- INSERT INTO `mob_pools` VALUES (5916,'cherukiki', --- INSERT INTO `mob_pools` VALUES (5917,'iron_eater', --- INSERT INTO `mob_pools` VALUES (5918,'gessho', --- INSERT INTO `mob_pools` VALUES (5919,'gadalar', --- INSERT INTO `mob_pools` VALUES (5920,'rainemard', --- INSERT INTO `mob_pools` VALUES (5921,'ingrid', --- INSERT INTO `mob_pools` VALUES (5922,'lehko_habhoka', --- INSERT INTO `mob_pools` VALUES (5923,'nashmeira', --- INSERT INTO `mob_pools` VALUES (5924,'zazarg', --- INSERT INTO `mob_pools` VALUES (5925,'ovjang', --- INSERT INTO `mob_pools` VALUES (5926,'mnejing', --- INSERT INTO `mob_pools` VALUES (5927,'sakura', --- INSERT INTO `mob_pools` VALUES (5928,'luzaf', --- INSERT INTO `mob_pools` VALUES (5929,'najelith', --- INSERT INTO `mob_pools` VALUES (5930,'aldo', --- INSERT INTO `mob_pools` VALUES (5931,'moogle', --- INSERT INTO `mob_pools` VALUES (5932,'fablinix', --- INSERT INTO `mob_pools` VALUES (5933,'maat', --- INSERT INTO `mob_pools` VALUES (5934,'d_shantotto', --- INSERT INTO `mob_pools` VALUES (5935,'star_sibyl', --- INSERT INTO `mob_pools` VALUES (5936,'karaha-baruha', --- INSERT INTO `mob_pools` VALUES (5937,'cid', --- INSERT INTO `mob_pools` VALUES (5938,'gilgamesh', --- INSERT INTO `mob_pools` VALUES (5939,'areuhat', --- INSERT INTO `mob_pools` VALUES (5940,'semih_lafihna', --- INSERT INTO `mob_pools` VALUES (5941,'elivira', --- INSERT INTO `mob_pools` VALUES (5942,'noillurie', --- INSERT INTO `mob_pools` VALUES (5943,'lhu_mhakaracca', --- INSERT INTO `mob_pools` VALUES (5944,'ferreous_coffin', --- INSERT INTO `mob_pools` VALUES (5945,'lilisette', --- INSERT INTO `mob_pools` VALUES (5946,'mumor', --- INSERT INTO `mob_pools` VALUES (5947,'uka_totlihn', --- INSERT INTO `mob_pools` VALUES (5948,'klara', --- INSERT INTO `mob_pools` VALUES (5949,'romaa_mihgo', --- INSERT INTO `mob_pools` VALUES (5950,'kuyin_hathdenna', --- INSERT INTO `mob_pools` VALUES (5951,'rahal', --- INSERT INTO `mob_pools` VALUES (5952,'koru-moru', --- INSERT INTO `mob_pools` VALUES (5953,'pieuje_uc', --- INSERT INTO `mob_pools` VALUES (5954,'i_shield_uc', --- INSERT INTO `mob_pools` VALUES (5955,'apururu_uc', --- INSERT INTO `mob_pools` VALUES (5956,'jakoh_uc', --- INSERT INTO `mob_pools` VALUES (5957,'flaviria_uc', --- INSERT INTO `mob_pools` VALUES (5958,'babban', --- INSERT INTO `mob_pools` VALUES (5959,'abenzio', --- INSERT INTO `mob_pools` VALUES (5960,'rughadjeen', --- INSERT INTO `mob_pools` VALUES (5961,'kukki-chebukki', --- INSERT INTO `mob_pools` VALUES (5962,'margret', --- INSERT INTO `mob_pools` VALUES (5963,'chacharoon', --- INSERT INTO `mob_pools` VALUES (5964,'lhe_lhangavo', --- INSERT INTO `mob_pools` VALUES (5965,'arciela', --- INSERT INTO `mob_pools` VALUES (5966,'mayakov', --- INSERT INTO `mob_pools` VALUES (5967,'qultada', --- INSERT INTO `mob_pools` VALUES (5968,'adelheid', --- INSERT INTO `mob_pools` VALUES (5969,'amchuchu', --- INSERT INTO `mob_pools` VALUES (5970,'brygid', --- INSERT INTO `mob_pools` VALUES (5971,'mildaurion', --- INSERT INTO `mob_pools` VALUES (5972,'halver', --- INSERT INTO `mob_pools` VALUES (5973,'rongelouts', --- INSERT INTO `mob_pools` VALUES (5974,'leonoyne', --- INSERT INTO `mob_pools` VALUES (5975,'maximilian', --- INSERT INTO `mob_pools` VALUES (5976,'kayeel-payeel', --- INSERT INTO `mob_pools` VALUES (5977,'robel-akbel', --- INSERT INTO `mob_pools` VALUES (5978,'kupofried', --- INSERT INTO `mob_pools` VALUES (5979,'selh_teus', --- INSERT INTO `mob_pools` VALUES (5980,'yoran-oran_uc', --- INSERT INTO `mob_pools` VALUES (5981,'sylvie_uc', --- INSERT INTO `mob_pools` VALUES (5982,'abquhbah', --- INSERT INTO `mob_pools` VALUES (5983,'balamor', --- INSERT INTO `mob_pools` VALUES (5984,'august', --- INSERT INTO `mob_pools` VALUES (5985,'rosulatia', --- INSERT INTO `mob_pools` VALUES (5986,'teodor', --- INSERT INTO `mob_pools` VALUES (5987,'ullegore', --- INSERT INTO `mob_pools` VALUES (5988,'makki-chebukki', --- INSERT INTO `mob_pools` VALUES (5989,'king_of_hearts', --- INSERT INTO `mob_pools` VALUES (5990,'morimar', --- INSERT INTO `mob_pools` VALUES (5991,'darrcuiln', --- INSERT INTO `mob_pools` VALUES (5992,'aahm', --- INSERT INTO `mob_pools` VALUES (5993,'aaev', --- INSERT INTO `mob_pools` VALUES (5994,'aamr', --- INSERT INTO `mob_pools` VALUES (5995,'aatt', --- INSERT INTO `mob_pools` VALUES (5996,'aagk', --- INSERT INTO `mob_pools` VALUES (5997,'iroha', --- INSERT INTO `mob_pools` VALUES (5998,'ygnas', +INSERT INTO `mob_pools` VALUES (5906,'Zeid','zeid',145,0x0000C20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5907,'Lion','lion',145,0x0000C30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5908,'Tenzen','tenzen',145,0x0000C40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5909,'MihliAliapoh','mihli_aliapoh',145,0x0000C50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5910,'Valaineral','valaineral',145,0x0000C60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5911,'Joachim','joachim',145,0x0000C70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5912,'NajaSalaheem','naja_salaheem',145,0x0000C80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5913,'Prishe','prishe',145,0x0000C90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5914,'Ulmia','ulmia',145,0x0000CA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5915,'ShikareeZ','shikaree_z',145,0x0000CB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5916,'Cherukiki','cherukiki',145,0x0000CC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5917,'IronEater','iron_eater',145,0x0000CD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5918,'Gessho','gessho',145,0x0000CE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5919,'Gadalar','gadalar',145,0x0000CF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5920,'Rainemard','rainemard',145,0x0000D00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5921,'Ingrid','ingrid',145,0x0000D10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5922,'LehkoHabhoka','lehko_habhoka',145,0x0000D20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5923,'Nashmeira','nashmeira',145,0x0000D30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5924,'Zazarg','zazarg',145,0x0000D40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5925,'Ovjang','ovjang',145,0x0000D50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5926,'Mnejing','mnejing',145,0x0000D60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5927,'Sakura','sakura',145,0x0000D70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5928,'Luzaf','luzaf',145,0x0000D80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5929,'Najelith','najelith',145,0x0000D90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5930,'Aldo','aldo',145,0x0000DA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5931,'Moogle','moogle',145,0x0000DB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5932,'Fablinix','fablinix',145,0x0000DC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5933,'Maat','maat',145,0x0000DD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5934,'D.Shantotto','d_shantotto',145,0x0000DE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5935,'StarSibyl','star_sibyl',145,0x0000DF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5936,'Karaha-Baruha','karaha-baruha',145,0x0000E00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5937,'Cid','cid',145,0x0000E10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5938,'Gilgamesh','gilgamesh',145,0x0000E20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5939,'Areuhat','areuhat',145,0x0000E30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5940,'SemihLafihna','semih_lafihna',145,0x0000E40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5941,'Elivira','elivira',145,0x0000E50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5942,'Noillurie','noillurie',145,0x0000E60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5943,'LhuMhakaracca','lhu_mhakaracca',145,0x0000E70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5944,'FerreousCoffin','ferreous_coffin',145,0x0000E80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5945,'Lilisette','lilisette',145,0x0000E90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5946,'Mumor','mumor',145,0x0000EA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5947,'UkaTotlihn','uka_totlihn',145,0x0000EB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5948,'Klara','klara',145,0x0000ED0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5949,'RomaaMihgo','romaa_mihgo',145,0x0000EE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5950,'KuyinHathdenna','kuyin_hathdenna',145,0x0000EF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5951,'Rahal','rahal',145,0x0000F00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5952,'Koru-Moru','koru-moru',145,0x0000F10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5953,'Pieuje','pieuje_uc',145,0x0000F20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5954,'InvincibleShld','i_shield_uc',145,0x0000F40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5955,'Apururu','apururu_uc',145,0x0000F50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5956,'JakohWahcondalo','jakoh_uc',145,0x0000F60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5957,'Flaviria','flaviria_uc',145,0x0000F30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5958,'Babban','babban',145,0x0000FB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5959,'Abenzio','abenzio',145,0x0000FC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5960,'Rughadjeen','rughadjeen',145,0x0000FD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5961,'Kukki-Chebukki','kukki-chebukki',145,0x0000FE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5962,'Margret','margret',145,0x0000FF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5963,'Chacharoon','chacharoon',145,0x0000000C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5964,'LheLhangavo','lhe_lhangavo',145,0x0000010C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5965,'Arciela','arciela',145,0x0000020C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5966,'Mayakov','mayakov',145,0x0000030C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5967,'Qultada','qultada',145,0x0000040C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5968,'Adelheid','adelheid',145,0x0000050C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5969,'Amchuchu','amchuchu',145,0x0000060C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5970,'Brygid','brygid',145,0x0000070C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5971,'Mildaurion','mildaurion',145,0x0000080C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5972,'Halver','halver',145,0x00000F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5973,'Rongelouts','rongelouts',145,0x0000100C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5974,'Leonoyne','leonoyne',145,0x0000110C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5975,'Maximilian','maximilian',145,0x0000120C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5976,'Kayeel-Payeel','kayeel-payeel',145,0x0000130C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5977,'Robel-Akbel','robel-akbel',145,0x0000140C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5978,'Kupofried','kupofried',145,0x0000150C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5979,'Selh\'teus','selh_teus',145,0x0000160C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5980,'Yoran-Oran','yoran-oran_uc',145,0x0000170C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5981,'Sylvie','sylvie_uc',145,0x0000180C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5982,'Abquhbah','abquhbah',145,0x00001A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5983,'Balamor','balamor',145,0x00001B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5984,'August','august',145,0x00001C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5985,'Rosulatia','rosulatia',145,0x00001D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5986,'Teodor','teodor',145,0x00001F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5987,'Ullegore','ullegore',145,0x0000210C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5988,'Makki-Chebukki','makki-chebukki',145,0x0000220C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5989,'KingOfHearts','king_of_hearts',145,0x0000230C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5990,'Morimar','morimar',145,0x0000240C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5991,'Darrcuiln','darrcuiln',145,0x0000250C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5992,'ArkHM','aahm',145,0x0000290C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5993,'ArkEV','aaev',145,0x00002A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5994,'ArkMR','aamr',145,0x00002B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5995,'ArkTT','aatt',145,0x00002C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5996,'ArkGK','aagk',145,0x00002D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5997,'Iroha','iroha',145,0x0000270C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (5998,'Ygnas','ygnas',145,0x00002E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -- Reserved for future Trust 5999 -- Reserved for future Trust 6000 -- Reserved for future Trust 6001 -- Reserved for future Trust 6002 --- INSERT INTO `mob_pools` VALUES (6003,'cornelia', --- INSERT INTO `mob_pools` VALUES (6004,'excenmille_s', --- INSERT INTO `mob_pools` VALUES (6005,'ayame_uc', --- INSERT INTO `mob_pools` VALUES (6006,'maat_uc', --- INSERT INTO `mob_pools` VALUES (6007,'aldo_uc', --- INSERT INTO `mob_pools` VALUES (6008,'naja_uc', --- INSERT INTO `mob_pools` VALUES (6009,'lion_ii', --- INSERT INTO `mob_pools` VALUES (6010,'zeid_ii', --- INSERT INTO `mob_pools` VALUES (6011,'prishe_ii', --- INSERT INTO `mob_pools` VALUES (6012,'nashmeira_ii', --- INSERT INTO `mob_pools` VALUES (6013,'lilisette_ii', --- INSERT INTO `mob_pools` VALUES (6014,'tenzen_ii', --- INSERT INTO `mob_pools` VALUES (6015,'mumor_ii', --- INSERT INTO `mob_pools` VALUES (6016,'ingrid_ii', --- INSERT INTO `mob_pools` VALUES (6017,'arciela_ii', --- INSERT INTO `mob_pools` VALUES (6018,'iroha_ii', -INSERT INTO `mob_pools` VALUES (6019,'Shantotto II','shantotto_ii',153,0x0000260C00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,276,1,0,750); +INSERT INTO `mob_pools` VALUES (6003,'Cornelia','cornelia',145,0x00002F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6004,'Excenmille','excenmille_s',145,0x0000EC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6005,'Ayame','ayame_uc',145,0x0000F70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6006,'Maat','maat_uc',145,0x0000F80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6007,'Aldo','aldo_uc',145,0x0000F90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6008,'NajaSalaheem','naja_uc',145,0x0000FA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6009,'Lion','lion_ii',145,0x0000090C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6010,'Zeid','zeid_ii',145,0x00000E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6011,'Prishe','prishe_ii',145,0x00000A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6012,'Nashmeira','nashmeira_ii',145,0x00000B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6013,'Lilisette','lilisette_ii',145,0x00000C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6014,'Tenzen','tenzen_ii',145,0x0000190C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6015,'Mumor','mumor_ii',145,0x0000200C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6016,'Ingrid','ingrid_ii',145,0x00001E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6017,'Arciela','arciela_ii',145,0x00000D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6018,'Iroha','iroha_ii',145,0x0000280C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); +INSERT INTO `mob_pools` VALUES (6019,'Shantotto','shantotto_ii',153,0x0000260C00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,276,1,0,750); -- Reserved for future Trust 6020 -- Reserved for future Trust 6021 -- Reserved for future Trust 6022 diff --git a/sql/mob_spell_lists.sql b/sql/mob_spell_lists.sql index cdde37c532e..1687a63b4c1 100644 --- a/sql/mob_spell_lists.sql +++ b/sql/mob_spell_lists.sql @@ -2515,6 +2515,62 @@ INSERT INTO `mob_spell_lists` VALUES ('Ghul-I-Beaban_BLM',305,174,1,255); -- fir INSERT INTO `mob_spell_lists` VALUES ('Ghul-I-Beaban_BLM',305,179,1,255); -- blizzaga INSERT INTO `mob_spell_lists` VALUES ('Saa_Doyi_the_Fervid',306,320,1,255); -- katon_ichi INSERT INTO `mob_spell_lists` VALUES ('Frost_Flambeau',307,180,1,255); -- blizzaga_ii +-- Trust +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,159,1,255); -- Stone +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,160,26,255); -- Stone II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,161,51,255); -- Stone III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,162,68,255); -- Stone IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,163,77,255); -- Stone V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,169,5,255); -- Water +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,170,30,255); -- Water II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,171,55,255); -- Water III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,172,70,255); -- Water IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,173,80,255); -- Water V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,154,9,255); -- Aero +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,155,34,255); -- Aero II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,156,59,255); -- Aero III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,157,72,255); -- Aero IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,158,83,255); -- Aero V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,144,9,255); -- Fire +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,145,34,255); -- Fire II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,146,59,255); -- Fire III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,147,72,255); -- Fire IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,148,83,255); -- Fire V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,149,9,255); -- Blizzard +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,150,34,255); -- Blizzard II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,151,59,255); -- Blizzard III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,152,72,255); -- Blizzard IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,153,83,255); -- Blizzard V + +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,1,1,255); -- Cure +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,2,11,255); -- Cure II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,3,21,255); -- Cure III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,4,41,255); -- Cure IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,5,61,255); -- Cure V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,6,80,255); -- Cure VI +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,125,7,255); -- Protectra +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,126,27,255); -- Protectra II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,127,47,255); -- Protectra III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,128,63,255); -- Protectra IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,129,75,255); -- Protectra V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,130,17,255); -- Shellra +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,131,37,255); -- Shellra II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,132,57,255); -- Shellra III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,133,68,255); -- Shellra IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,134,75,255); -- Shellra V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,143,32,255); -- Erase +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,58,6,255); -- Paralyze +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,56,13,255); -- Slow +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,112,45,255); -- Flash + +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Excenmille',310,1,5,255); -- Cure +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Excenmille',310,2,17,255); -- Cure II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Excenmille',310,3,30,255); -- Cure III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Excenmille',310,4,55,255); -- Cure IV + + + + /*!40000 ALTER TABLE `mob_spell_lists` ENABLE KEYS */; UNLOCK TABLES; diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index a1c51fe3f88..a81ac5b88c4 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -51,9 +51,9 @@ void CTrustController::Despawn() if (POwner->PMaster) { POwner->PMaster = nullptr; - POwner->PAI->Internal_Despawn(); + //POwner->PAI->Internal_Despawn(); } - //CController::Despawn(); + CController::Despawn(); } void CTrustController::Tick(time_point tick) diff --git a/src/map/ai/controllers/trust_controller.h b/src/map/ai/controllers/trust_controller.h index 5d63d8cc97d..96a6f0c6629 100644 --- a/src/map/ai/controllers/trust_controller.h +++ b/src/map/ai/controllers/trust_controller.h @@ -34,22 +34,22 @@ class CTrustController : public CController CTrustController(CCharEntity*, CTrustEntity*); CBattleEntity* PTarget{ nullptr }; virtual ~CTrustController(); - static constexpr float RoamDistance{ 5.5f }; - virtual void DoCombatTick(time_point tick); - virtual void DoRoamTick(time_point tick); - -protected: - + virtual void Tick(time_point) override; virtual void Despawn() override; + virtual bool Cast(uint16 targid, SpellID spellid) override { return false; } virtual bool ChangeTarget(uint16 targid) override { return false; } virtual bool WeaponSkill(uint16 targid, uint16 wsid) override { return false; } - virtual bool Ability(uint16 targid, uint16 abilityid) override { return false; } -private: + virtual bool Ability(uint16 targid, uint16 abilityid) override { return false; } + static constexpr float RoamDistance{ 5.5f }; + static constexpr float SpawnDistance{ 12.5f }; +private: + void DoCombatTick(time_point tick); + void DoRoamTick(time_point tick); }; #endif // _TRUSTCONTROLLER \ No newline at end of file diff --git a/src/map/ai/helpers/targetfind.cpp b/src/map/ai/helpers/targetfind.cpp index 22ed559018e..43775df9d33 100644 --- a/src/map/ai/helpers/targetfind.cpp +++ b/src/map/ai/helpers/targetfind.cpp @@ -24,6 +24,7 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include #include "../../entities/charentity.h" #include "../../entities/mobentity.h" +#include "../../entities/trustentity.h" #include "../../packets/action.h" #include "../../alliance.h" #include "../../../common/mmo.h" @@ -244,6 +245,24 @@ void CTargetFind::addAllInParty(CBattleEntity* PTarget, bool withPet) PTarget->ForParty([this, withPet](CBattleEntity* PMember) { + + // add my Trust too because why not? + if (PMember->objtype == TYPE_PC) + { + CCharEntity* PChar = (CCharEntity*)PMember; + + if (PChar->PTrusts.size() > 0) + { + uint32 index = 0; + for (index; index < PChar->PTrusts.size(); index++) + { + CTrustEntity* trust = PChar->PTrusts.at(index); + CBattleEntity* PTrust = static_cast(trust); + m_targets.push_back(PTrust); + } + } + } + addEntity(PMember, withPet); }); @@ -278,7 +297,6 @@ void CTargetFind::addEntity(CBattleEntity* PTarget, bool withPet) { m_targets.push_back(PTarget->PPet); } - } CBattleEntity* CTargetFind::findMaster(CBattleEntity* PTarget) @@ -463,7 +481,7 @@ bool CTargetFind::canSee(position_t* point) CBattleEntity* CTargetFind::getValidTarget(uint16 actionTargetID, uint16 validTargetFlags) { - CBattleEntity* PTarget = (CBattleEntity*)m_PBattleEntity->GetEntity(actionTargetID, TYPE_MOB | TYPE_PC | TYPE_PET); + CBattleEntity* PTarget = (CBattleEntity*)m_PBattleEntity->GetEntity(actionTargetID, TYPE_MOB | TYPE_PC | TYPE_PET | TYPE_TRUST); if (PTarget == nullptr) { @@ -475,6 +493,11 @@ CBattleEntity* CTargetFind::getValidTarget(uint16 actionTargetID, uint16 validTa return m_PBattleEntity->PPet; } + if (PTarget->objtype == TYPE_TRUST) + { + return PTarget; + } + if (PTarget->ValidTarget(m_PBattleEntity, validTargetFlags)) { return PTarget; diff --git a/src/map/battlefield.cpp b/src/map/battlefield.cpp index 2f870d9be1e..bd6e0700702 100644 --- a/src/map/battlefield.cpp +++ b/src/map/battlefield.cpp @@ -454,7 +454,7 @@ bool CBattlefield::RemoveEntity(CBaseEntity* PEntity, uint8 leavecode) PEntity->loc.zone->PushPacket(PEntity, CHAR_INRANGE, new CEntityUpdatePacket(PEntity, ENTITY_DESPAWN, UPDATE_ALL_MOB)); m_NpcList.erase(std::remove_if(m_NpcList.begin(), m_NpcList.end(), check), m_NpcList.end()); } - else if (PEntity->objtype == TYPE_MOB || PEntity->objtype == TYPE_PET) + else if (PEntity->objtype == TYPE_MOB || PEntity->objtype == TYPE_PET || PEntity->objtype == TYPE_TRUST) { // todo: probably need to check allegiance too cause besieged will prolly use > 0x700 too // allies targid >= 0x700 diff --git a/src/map/entities/battleentity.cpp b/src/map/entities/battleentity.cpp index 13b266f8ac2..cb503a8973a 100644 --- a/src/map/entities/battleentity.cpp +++ b/src/map/entities/battleentity.cpp @@ -1180,7 +1180,7 @@ void CBattleEntity::Spawn() void CBattleEntity::Die() { - if (CBaseEntity* PKiller = GetEntity(m_OwnerID.targid)) + if (CBaseEntity * PKiller = GetEntity(m_OwnerID.targid)) PAI->EventHandler.triggerListener("DEATH", this, PKiller); else PAI->EventHandler.triggerListener("DEATH", this); diff --git a/src/map/entities/charentity.cpp b/src/map/entities/charentity.cpp index d309d58cdb9..dc1818cf826 100644 --- a/src/map/entities/charentity.cpp +++ b/src/map/entities/charentity.cpp @@ -476,7 +476,6 @@ void CCharEntity::RemoveTrust(CTrustEntity* PTrust) return; auto trustIt = std::remove_if(PTrusts.begin(), PTrusts.end(), [PTrust](auto trust) { return PTrust == trust; }); - if (trustIt != PTrusts.end()) { PTrust->PAI->Despawn(); diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index 4b367beea5c..7104b8824f4 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -79,6 +79,7 @@ #include "../entities/mobentity.h" #include "../entities/npcentity.h" #include "../entities/petentity.h" +#include "../entities/trustentity.h" #include "../packets/action.h" #include "../packets/auction_house.h" @@ -11933,6 +11934,100 @@ inline int32 CLuaBaseEntity::spawnPet(lua_State *L) return 0; } +/************************************************************************ +* Function: canCastTrust() +* Purpose : checks if player can cast trust +* Example : +* Notes : +************************************************************************/ + +inline int32 CLuaBaseEntity::canCastTrust(lua_State* L) +{ + DSP_DEBUG_BREAK_IF(m_PBaseEntity == nullptr); + DSP_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC); + + // TODO: You can only spawn trusts in battle areas, similar to pets. See MSGBASIC_TRUST_NOT_HERE + // TODO: There is an expandable limit of trusts you can summon, based on key items. + + if (!lua_isnil(L, 1) && lua_isstring(L, 1)) + { + size_t maxTrusts = 5; + uint16 trustId = (uint16)lua_tointeger(L, 1); + CCharEntity* PChar = (CCharEntity*)m_PBaseEntity; + + // If you're in a party, you can only spawn trusts if: + // * You're the party leader + // * The party isn't full + // * The party isn't part of an alliance + if (PChar->PParty != nullptr) + { + CBattleEntity* PLeader = PChar->PParty->GetLeader(); + if (PLeader == nullptr || PLeader->id != PChar->id) + { + PChar->pushPacket(new CMessageStandardPacket(PChar, 0, MsgStd::TrustSoloOrLeader)); + lua_pushboolean(L, false); + return 1; + } + if (PChar->PParty->members.size() >= 6) + { + PChar->pushPacket(new CMessageStandardPacket(PChar, 0, MsgStd::TrustLimit)); + lua_pushboolean(L, false); + return 1; + } + if (PChar->PParty->m_PAlliance != nullptr) + { + PChar->pushPacket(new CMessageStandardPacket(PChar, 0, MsgStd::TrustSoloOrLeader)); + lua_pushboolean(L, false); + return 1; + } + + // Reduce the max number of summonable trusts + maxTrusts = 6 - PChar->PParty->members.size(); + } + + if (PChar->PTrusts.size() >= maxTrusts) + { + PChar->pushPacket(new CMessageStandardPacket(PChar, 0, MsgStd::TrustLimit)); + lua_pushboolean(L, false); + return 1; + } + + // You can't spawn the same trust twice + // TODO: This includes otherwise distinct trusts, e.g. Shantotto and Shantotto II, only 1 can be called. + // It'd probably be "good enough" to use the name as a heuristic, looking for "II" (this catches 99% of them). + + + if (PChar->PTrusts.size() > 0) + { + for (auto PTrust : PChar->PTrusts) + { + if (PTrust->m_TrustID == trustId) + { + PChar->pushPacket(new CMessageStandardPacket(PChar, 0, MsgStd::TrustSame)); + lua_pushboolean(L, false); + return 1; + } + } + + uint32 index = 0; + for (index; index < PChar->PTrusts.size(); index++) + { + if (petutils::CheckTrustName(PChar->PTrusts.at(index)->name.c_str(), trustId) == true) + { + PChar->pushPacket(new CMessageStandardPacket(PChar, 0, MsgStd::TrustSame)); + lua_pushboolean(L, false); + return 1; + } + } + } + + + lua_pushboolean(L, true); + return 1; + } + return 0; +} + /************************************************************************ * Function: spawnTrust() * Purpose : Spawns a Trust if a few correct conditions are met @@ -14594,8 +14689,9 @@ Lunar::Register_t CLuaBaseEntity::methods[] = LUNAR_DECLARE_METHOD(CLuaBaseEntity,removeOldestManeuver), LUNAR_DECLARE_METHOD(CLuaBaseEntity,removeAllManeuvers), LUNAR_DECLARE_METHOD(CLuaBaseEntity,updateAttachments), - - LUNAR_DECLARE_METHOD(CLuaBaseEntity, spawnTrust), + + LUNAR_DECLARE_METHOD(CLuaBaseEntity,canCastTrust), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,spawnTrust), // Mob Entity-Specific LUNAR_DECLARE_METHOD(CLuaBaseEntity,setMobLevel), diff --git a/src/map/lua/lua_baseentity.h b/src/map/lua/lua_baseentity.h index 0de7ed9ba01..70cd99d76e1 100644 --- a/src/map/lua/lua_baseentity.h +++ b/src/map/lua/lua_baseentity.h @@ -579,6 +579,8 @@ class CLuaBaseEntity // Pets and Automations int32 spawnPet(lua_State*); // Calls Pet int32 despawnPet(lua_State*); // Despawns Pet + + int32 canCastTrust(lua_State* L); int32 spawnTrust(lua_State*); // Spawns trust int32 isJugPet(lua_State*); // If the entity has a pet, test if it is a jug pet. diff --git a/src/map/map.cpp b/src/map/map.cpp index f2e4e7d36b5..5badd7518ad 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -264,6 +264,7 @@ void do_final(int code) battleutils::FreeMobSkillList(); petutils::FreePetList(); + petutils::FreeTrustList(); zoneutils::FreeZoneList(); luautils::free(); message::close(); diff --git a/src/map/packet_system.cpp b/src/map/packet_system.cpp index 72bfe6bc227..e7ff6d83993 100644 --- a/src/map/packet_system.cpp +++ b/src/map/packet_system.cpp @@ -643,8 +643,13 @@ void SmallPacket0x01A(map_session_data_t* session, CCharEntity* PChar, CBasicPac CBaseEntity* PTrust = PChar->GetEntity(TargID, TYPE_TRUST); if (PTrust != nullptr) { + printf("PTrust not null"); PChar->RemoveTrust((CTrustEntity*)PTrust); } + else + { + printf("PTrust is null"); + } if (PChar->m_event.EventID == -1) { diff --git a/src/map/status_effect_container.cpp b/src/map/status_effect_container.cpp index 68515ee524b..19a34b795ac 100644 --- a/src/map/status_effect_container.cpp +++ b/src/map/status_effect_container.cpp @@ -1236,11 +1236,16 @@ void CStatusEffectContainer::SetEffectParams(CStatusEffect* StatusEffect) if (m_POwner->isAlive()) { // this should actually go into a char charm AI - if (m_POwner->PPet != nullptr && m_POwner->objtype == TYPE_PC) + if (m_POwner->objtype == TYPE_PC) { + auto PChar = (CCharEntity*)m_POwner; + if (effect == EFFECT_CHARM || effect == EFFECT_CHARM_II) { - petutils::DespawnPet(m_POwner); + if (m_POwner->PPet != nullptr) + { + petutils::DespawnPet(m_POwner); + } } } diff --git a/src/map/utils/petutils.cpp b/src/map/utils/petutils.cpp index 22ba416db9c..c2885842950 100644 --- a/src/map/utils/petutils.cpp +++ b/src/map/utils/petutils.cpp @@ -1235,59 +1235,6 @@ namespace petutils void SpawnTrust(CCharEntity* PMaster, uint32 TrustID) { - // TODO: You can only spawn trusts in battle areas, similar to pets. See MSGBASIC_TRUST_NOT_HERE - - // TODO: There is an expandable limit of trusts you can summon, based on key items. - size_t maxTrusts = 5; - - // TODO: These checks should be done at before spellcast time!! - // If you're in a party, you can only spawn trusts if: - // * You're the party leader - // * The party isn't full - // * The party isn't part of an alliance - if (PMaster->PParty != nullptr) - { - CBattleEntity* PLeader = PMaster->PParty->GetLeader(); - if (PLeader == nullptr || PLeader->id != PMaster->id) - { - PMaster->pushPacket(new CMessageStandardPacket(PMaster, 0, MsgStd::TrustSoloOrLeader)); - return; - } - if (PMaster->PParty->members.size() >= 6) - { - PMaster->pushPacket(new CMessageStandardPacket(PMaster, 0, MsgStd::TrustLimit)); - return; - } - if (PMaster->PParty->m_PAlliance != nullptr) - { - PMaster->pushPacket(new CMessageStandardPacket(PMaster, 0, MsgStd::TrustSoloOrLeader)); - return; - } - - // Reduce the max number of summonable trusts - maxTrusts = 6 - PMaster->PParty->members.size(); - } - - if (PMaster->PTrusts.size() >= maxTrusts) - { - PMaster->pushPacket(new CMessageStandardPacket(PMaster, 0, MsgStd::TrustLimit)); - return; - } - - // You can't spawn the same trust twice - // TODO: This includes otherwise distinct trusts, e.g. Shantotto and Shantotto II, only 1 can be called. - // It'd probably be "good enough" to use the name as a heuristic, looking for "II" (this catches 99% of them). - for (auto PTrust : PMaster->PTrusts) - { - if (PTrust->m_TrustID == TrustID) - { - PMaster->pushPacket(new CMessageStandardPacket(PMaster, 0, MsgStd::TrustSame)); - return; - } - } - - // Make a new party if we weren't in one. - // TODO: It's actually not a real party: /sea shows your name as grey not yellow, but it shows as a party on the GUI. if (PMaster->PParty == nullptr) { PMaster->PParty = new CParty(PMaster); @@ -1296,7 +1243,7 @@ namespace petutils CTrustEntity* PTrust = LoadTrust(PMaster, TrustID); PMaster->PTrusts.insert(PMaster->PTrusts.end(), PTrust); PMaster->StatusEffectContainer->CopyConfrontationEffect(PTrust); - PMaster->loc.zone->InsertPET(PTrust); + PMaster->loc.zone->InsertTRUST(PTrust); PMaster->PParty->ReloadParty(); } @@ -1947,7 +1894,7 @@ namespace petutils PTrust->m_OwnerID.targid = PMaster->targid; // spawn me randomly around master - PTrust->loc.p = nearPosition(PMaster->loc.p, CTrustController::RoamDistance, (float)M_PI); + PTrust->loc.p = nearPosition(PMaster->loc.p, CTrustController::SpawnDistance, (float)M_PI); PTrust->look = trustData->look; PTrust->name = trustData->name; PTrust->m_name_prefix = trustData->name_prefix; @@ -2062,4 +2009,32 @@ namespace petutils } return false; } + + bool CheckTrustName(const char* name, uint32 trustID) + { + printf("Trusts name = %s", name); + + const char* Query = + "SELECT \ + mob_pools.name \ + FROM mob_pools \ + WHERE mob_pools.poolid = %u"; + + uint32 ret = Sql_Query(SqlHandle, Query, trustID +5000); + + if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) != 0) + { + while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) + { + const char* sqlName = (const char*)Sql_GetData(SqlHandle, 0); + + if (name == sqlName) + { + printf("sqlName name is the same as %s, should not spawn this trust!", sqlName); + return true; + } + } + } + return false; + } }; // namespace petutils diff --git a/src/map/utils/petutils.h b/src/map/utils/petutils.h index f074683c1a4..52c8bc24db8 100644 --- a/src/map/utils/petutils.h +++ b/src/map/utils/petutils.h @@ -84,6 +84,7 @@ namespace petutils void LoadWyvernStatistics(CBattleEntity* PMaster, CPetEntity* PPet, bool finalize); void FinalizePetStatistics(CBattleEntity* PMaster, CPetEntity* PPet); bool CheckPetModType(CBattleEntity* PPet, PetModType petmod); + bool CheckTrustName(const char* name, uint32 trustID); void QueryTrust(uint32 TrustID); CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID); }; diff --git a/src/map/zone.cpp b/src/map/zone.cpp index 2f6332fb8e9..7a70665613c 100644 --- a/src/map/zone.cpp +++ b/src/map/zone.cpp @@ -439,6 +439,22 @@ void CZone::InsertPET(CBaseEntity* PPet) m_zoneEntities->InsertPET(PPet); } +/************************************************************************ +* * +* Add a trust to the zone * +* * +************************************************************************/ + +void CZone::InsertTRUST(CBaseEntity* PTrust) +{ + m_zoneEntities->InsertTRUST(PTrust); +} + +void CZone::DeleteTRUST(CBaseEntity* PTrust) +{ + m_zoneEntities->DeleteTRUST(PTrust); +} + /************************************************************************ * * * Добавляем в зону активную область * @@ -652,6 +668,11 @@ void CZone::SpawnPETs(CCharEntity* PChar) m_zoneEntities->SpawnPETs(PChar); } +void CZone::SpawnTRUSTs(CCharEntity* PChar) +{ + m_zoneEntities->SpawnTRUSTs(PChar); +} + /************************************************************************ * * * Проверка видимости NPCs персонажем. * diff --git a/src/map/zone.h b/src/map/zone.h index ef500b561cc..90c0f75c05d 100644 --- a/src/map/zone.h +++ b/src/map/zone.h @@ -555,6 +555,7 @@ class CZone virtual void SpawnMOBs(CCharEntity* PChar); // отображаем MOBs в зоне virtual void SpawnPETs(CCharEntity* PChar); // отображаем PETs в зоне virtual void SpawnNPCs(CCharEntity* PChar); // отображаем NPCs в зоне + virtual void SpawnTRUSTs(CCharEntity* PChar); // отображаем TRUSTs в зоне virtual void SpawnMoogle(CCharEntity* PChar); // отображаем Moogle в MogHouse virtual void SpawnTransport(CCharEntity* PChar); // отображаем транспорт void SavePlayTime(); @@ -567,7 +568,10 @@ class CZone virtual void InsertNPC(CBaseEntity* PNpc); // добавляем в зону npc virtual void InsertMOB(CBaseEntity* PMob); // добавляем в зону mob virtual void InsertPET(CBaseEntity* PPet); // добавляем в зону pet + virtual void InsertTRUST(CBaseEntity* PTrust); // Add a trust to the zone + virtual void DeletePET(CBaseEntity* PPet); // derefs the pet's ID from this zone + virtual void DeleteTRUST(CBaseEntity* PTrust); virtual void FindPartyForMob(CBaseEntity* PEntity); // ищем группу для монстра virtual void TransportDepart(uint16 boundary, uint16 zone); // транспотр отправляется, необходимо собрать пассажиров diff --git a/src/map/zone_entities.cpp b/src/map/zone_entities.cpp index 2a0aea4d02f..dcbb5f40d8f 100644 --- a/src/map/zone_entities.cpp +++ b/src/map/zone_entities.cpp @@ -34,11 +34,13 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "ai/ai_container.h" #include "ai/controllers/mob_controller.h" +#include "entities/trustentity.h" #include "entities/mobentity.h" #include "entities/npcentity.h" #include "packets/char.h" #include "packets/char_sync.h" +#include "packets/trust_sync.h" #include "packets/entity_update.h" #include "packets/entity_visual.h" #include "packets/wide_scan.h" @@ -162,6 +164,57 @@ void CZoneEntities::InsertPET(CBaseEntity* PPet) ShowError(CL_RED"CZone::InsertPET : entity is null\n" CL_RESET); } +void CZoneEntities::InsertTRUST(CBaseEntity* PTrust) +{ + if (PTrust != nullptr) + { + CTrustEntity* trust = (CTrustEntity*)PTrust; + CCharEntity* master = (CCharEntity*)trust->PMaster; + uint16 targid = 0x800; + + for (EntityList_t::const_iterator it = m_trustList.begin(); it != m_trustList.end(); ++it) + { + if (targid != it->first) + { + break; + } + targid++; + } + if (targid >= 0x900) + { + ShowError(CL_RED"CZone::InsertTRUST : targid is high (03hX)\n" CL_RESET, targid); + return; + } + PTrust->id = 0x1000000 + (m_zone->GetID() << 12) + targid; + PTrust->targid = targid; + PTrust->loc.zone = m_zone; + m_trustList[PTrust->targid] = PTrust; + + for (EntityList_t::const_iterator it = m_charList.begin(); it != m_charList.end(); ++it) + { + CCharEntity* PCurrentChar = (CCharEntity*)it->second; + + if (distance(PTrust->loc.p, PCurrentChar->loc.p) < 50) + { + if (PCurrentChar->targid == ((CBattleEntity*)PTrust)->PMaster->targid) + { + PCurrentChar->SpawnTRUSTList[PTrust->id] = PTrust; + } + PCurrentChar->pushPacket(new CEntityUpdatePacket(PTrust, ENTITY_SPAWN, UPDATE_ALL_MOB)); + } + } + return; + } +} + +void CZoneEntities::DeleteTRUST(CBaseEntity* PTrust) +{ + if (PTrust != nullptr) + { + m_trustList.erase(PTrust->id); + } +} + void CZoneEntities::FindPartyForMob(CBaseEntity* PEntity) { TPZ_DEBUG_BREAK_IF(PEntity == nullptr); @@ -316,6 +369,26 @@ void CZoneEntities::DecreaseZoneCounter(CCharEntity* PChar) } PChar->PPet = nullptr; } + + //remove trust + if (PChar->PTrusts.size() > 0) + { + for each (auto trust in PChar->PTrusts) + { + trust->PAI->Disengage(); + //trust->status = STATUS_DISAPPEAR; + + + for (EntityList_t::const_iterator it = m_charList.begin(); it != m_charList.end(); ++it) + { + //inform other players of the pets removal + CCharEntity* PCurrentChar = (CCharEntity*)it->second; + PCurrentChar->pushPacket(new CEntityUpdatePacket(trust, ENTITY_DESPAWN, UPDATE_NONE)); + } + } + PChar->ClearTrusts(); + PChar->SpawnTRUSTList.clear(); + } } if (m_zone->m_BattlefieldHandler) @@ -486,6 +559,35 @@ void CZoneEntities::SpawnNPCs(CCharEntity* PChar) } } +void CZoneEntities::SpawnTRUSTs(CCharEntity* PChar) +{ + for (EntityList_t::const_iterator it = m_trustList.begin(); it != m_trustList.end(); ++it) + { + CTrustEntity* PCurrentTrust = (CTrustEntity*)it->second; + CCharEntity* master = (CCharEntity*)PCurrentTrust->PMaster; + SpawnIDList_t::iterator TRUST = PChar->SpawnTRUSTList.lower_bound(PCurrentTrust->id); + + if (PCurrentTrust->status == STATUS_NORMAL && + distance(PChar->loc.p, PCurrentTrust->loc.p) < 50) + { + if (TRUST == PChar->SpawnTRUSTList.end() || PChar->SpawnTRUSTList.key_comp()(PCurrentTrust->id, TRUST->first)) + { + PChar->SpawnTRUSTList.insert(TRUST, SpawnIDList_t::value_type(PCurrentTrust->id, PCurrentTrust)); + PChar->pushPacket(new CEntityUpdatePacket(PCurrentTrust, ENTITY_SPAWN, UPDATE_ALL_MOB)); + PChar->pushPacket(new CTrustSyncPacket(master, PCurrentTrust)); + } + } + else { + if (TRUST != PChar->SpawnTRUSTList.end() && + !(PChar->SpawnTRUSTList.key_comp()(PCurrentTrust->id, TRUST->first))) + { + PChar->SpawnTRUSTList.erase(TRUST); + PChar->pushPacket(new CEntityUpdatePacket(PCurrentTrust, ENTITY_DESPAWN, UPDATE_NONE)); + } + } + } +} + void CZoneEntities::SpawnPCs(CCharEntity* PChar) { for (EntityList_t::const_iterator it = m_charList.begin(); it != m_charList.end(); ++it) @@ -609,7 +711,7 @@ CBaseEntity* CZoneEntities::GetEntity(uint16 targid, uint8 filter) } else if (targid < 0x800) { - if (filter & TYPE_PET || filter & TYPE_TRUST) + if (filter & TYPE_PET) { EntityList_t::const_iterator it = m_petList.find(targid); if (it != m_petList.end()) @@ -618,6 +720,17 @@ CBaseEntity* CZoneEntities::GetEntity(uint16 targid, uint8 filter) } } } + else if (targid < 0x900) + { + if (filter & TYPE_TRUST) + { + EntityList_t::const_iterator it = m_trustList.find(targid); + if (it != m_trustList.end()) + { + return it->second; + } + } + } return nullptr; } @@ -818,10 +931,14 @@ void CZoneEntities::PushPacket(CBaseEntity* PEntity, GLOBAL_MESSAGE_TYPE message spawnlist = PCurrentChar->SpawnNPCList; } } - else if (entity->targid >= 0x700) + else if (entity->targid < 0x800) { spawnlist = PCurrentChar->SpawnPETList; } + else if (entity->targid < 0x900) + { + spawnlist = PCurrentChar->SpawnTRUSTList; + } else { entity = nullptr; @@ -962,7 +1079,7 @@ void CZoneEntities::ZoneServer(time_point tick, bool check_regions) CMobEntity* PCurrentMob = (CMobEntity*)PMobIt.second; PCurrentMob->PEnmityContainer->Clear(PPet->id); } - if (PPet->getPetType() != PETTYPE_AUTOMATON || !PPet->PMaster) + if (!PPet->PMaster || PPet->objtype == TYPE_TRUST || PPet->getPetType() != PETTYPE_AUTOMATON) { delete pit->second; } @@ -973,6 +1090,46 @@ void CZoneEntities::ZoneServer(time_point tick, bool check_regions) } } + EntityList_t::const_iterator trustit = m_trustList.begin(); + while (trustit != m_trustList.end()) + { + CTrustEntity* PTrust = (CTrustEntity*)trustit->second; + PTrust->PRecastContainer->Check(); + PTrust->StatusEffectContainer->CheckEffectsExpiry(tick); + if (tick > m_EffectCheckTime) + { + PTrust->StatusEffectContainer->TickRegen(tick); + PTrust->StatusEffectContainer->TickEffects(tick); + } + PTrust->PAI->Tick(tick); + if (PTrust->status == STATUS_DISAPPEAR) + { + for (auto PMobIt : m_mobList) + { + CMobEntity* PCurrentMob = (CMobEntity*)PMobIt.second; + PCurrentMob->PEnmityContainer->Clear(PTrust->id); + } + for (EntityList_t::const_iterator it = m_charList.begin(); it != m_charList.end(); ++it) + { + CCharEntity* PChar = (CCharEntity*)it->second; + if (distance(PChar->loc.p, PTrust->loc.p) < 50) + { + PChar->SpawnTRUSTList.erase(PTrust->id); + PChar->ReloadPartyInc(); + } + } + + if (!PTrust->PMaster || PTrust->objtype == TYPE_TRUST) + { + delete trustit->second; + } + m_trustList.erase(trustit++); + } + else { + ++trustit; + } + } + for (EntityList_t::const_iterator it = m_charList.begin(); it != m_charList.end(); ++it) { CCharEntity* PChar = (CCharEntity*)it->second; diff --git a/src/map/zone_entities.h b/src/map/zone_entities.h index aff6a48cf97..3309979b672 100644 --- a/src/map/zone_entities.h +++ b/src/map/zone_entities.h @@ -38,6 +38,7 @@ class CZoneEntities void SpawnMOBs(CCharEntity* PChar); // отображаем MOBs в зоне void SpawnPETs(CCharEntity* PChar); // отображаем PETs в зоне void SpawnNPCs(CCharEntity* PChar); // отображаем NPCs в зоне + void SpawnTRUSTs(CCharEntity* PChar); void SpawnMoogle(CCharEntity* PChar); // отображаем Moogle в MogHouse void SpawnTransport(CCharEntity* PChar); // отображаем транспорт void DespawnPC(CCharEntity* PChar); @@ -52,7 +53,9 @@ class CZoneEntities void InsertNPC(CBaseEntity* PNpc); // добавляем в зону npc void InsertMOB(CBaseEntity* PMob); // добавляем в зону mob void InsertPET(CBaseEntity* PPet); // добавляем в зону pet + void InsertTRUST(CBaseEntity* PTrust); void DeletePET(CBaseEntity* PPet); // derefs the pet's ID from this zone + void DeleteTRUST(CBaseEntity* PTrust); void FindPartyForMob(CBaseEntity* PEntity); // ищем группу для монстра void TransportDepart(uint16 boundary, uint16 zone); // транспотр отправляется, необходимо собрать пассажиров @@ -72,6 +75,7 @@ class CZoneEntities EntityList_t m_allyList; EntityList_t m_mobList; // список всех MOBs в зоне EntityList_t m_petList; // список всех PETs в зоне + EntityList_t m_trustList; EntityList_t m_npcList; // список всех NPCs в зоне EntityList_t m_charList; // список всех PCs в зоне diff --git a/src/map/zone_instance.cpp b/src/map/zone_instance.cpp index a2d8a2d588e..20e8dce539a 100644 --- a/src/map/zone_instance.cpp +++ b/src/map/zone_instance.cpp @@ -110,6 +110,22 @@ void CZoneInstance::InsertPET(CBaseEntity* PPet) } } +void CZoneInstance::InsertTRUST(CBaseEntity* PTrust) +{ + if (PTrust->PInstance) + { + PTrust->PInstance->InsertTRUST(PTrust); + } +} + +void CZoneInstance::DeleteTRUST(CBaseEntity* PTrust) +{ + if (PTrust->PInstance) + { + PTrust->PInstance->DeleteTRUST(PTrust); + } +} + void CZoneInstance::FindPartyForMob(CBaseEntity* PEntity) { if (PEntity->PInstance) @@ -241,6 +257,14 @@ void CZoneInstance::SpawnPETs(CCharEntity* PChar) } } +void CZoneInstance::SpawnTRUSTs(CCharEntity* PChar) +{ + if (PChar->PInstance) + { + PChar->PInstance->SpawnTRUSTs(PChar); + } +} + void CZoneInstance::SpawnNPCs(CCharEntity* PChar) { if (PChar->PInstance) diff --git a/src/map/zone_instance.h b/src/map/zone_instance.h index d892bef7e3c..c4da5bea1c7 100644 --- a/src/map/zone_instance.h +++ b/src/map/zone_instance.h @@ -38,6 +38,7 @@ class CZoneInstance : public CZone virtual void SpawnPCs(CCharEntity* PChar) override; // отображаем персонажей в зоне virtual void SpawnMOBs(CCharEntity* PChar) override; // отображаем MOBs в зоне virtual void SpawnPETs(CCharEntity* PChar) override; // отображаем PETs в зоне + virtual void SpawnTRUSTs(CCharEntity* PChar) override; virtual void SpawnNPCs(CCharEntity* PChar) override; // отображаем NPCs в зоне virtual void SpawnMoogle(CCharEntity* PChar) override; // отображаем Moogle в MogHouse virtual void SpawnTransport(CCharEntity* PChar) override; // отображаем транспорт @@ -50,6 +51,8 @@ class CZoneInstance : public CZone virtual void InsertNPC(CBaseEntity* PNpc) override; // добавляем в зону npc virtual void InsertMOB(CBaseEntity* PMob) override; // добавляем в зону mob virtual void InsertPET(CBaseEntity* PPet) override; // добавляем в зону pet + virtual void InsertTRUST(CBaseEntity* PTrust) override; + virtual void DeleteTRUST(CBaseEntity* PTrust) override; virtual void DeletePET(CBaseEntity* PPet) override; // derefs the pet's ID from this zone virtual void FindPartyForMob(CBaseEntity* PEntity) override; // ищем группу для монстра From ad904fbd581c0565bfe9430ee4b1eb3d7ca4082c Mon Sep 17 00:00:00 2001 From: TeoTwawki Date: Tue, 11 Feb 2020 13:34:37 -0500 Subject: [PATCH 009/116] Remove unused include and format --- scripts/globals/spells/trust/Shantotto_II.lua | 5 ++--- scripts/globals/spells/trust/ajido-marujido.lua | 5 ++--- scripts/globals/spells/trust/aldo.lua | 5 ++--- scripts/globals/spells/trust/areuhat.lua | 5 ++--- scripts/globals/spells/trust/ayame.lua | 5 ++--- scripts/globals/spells/trust/cherukiki.lua | 5 ++--- scripts/globals/spells/trust/cid.lua | 5 ++--- scripts/globals/spells/trust/curilla.lua | 5 ++--- scripts/globals/spells/trust/d_shantotto.lua | 5 ++--- scripts/globals/spells/trust/elivira.lua | 5 ++--- scripts/globals/spells/trust/excenmille.lua | 5 ++--- scripts/globals/spells/trust/fablinix.lua | 5 ++--- scripts/globals/spells/trust/ferreous_coffin.lua | 5 ++--- scripts/globals/spells/trust/gadalar.lua | 5 ++--- scripts/globals/spells/trust/gessho.lua | 5 ++--- scripts/globals/spells/trust/gilgamesh.lua | 5 ++--- scripts/globals/spells/trust/ingrid.lua | 5 ++--- scripts/globals/spells/trust/iron_eater.lua | 5 ++--- scripts/globals/spells/trust/joachim.lua | 5 ++--- scripts/globals/spells/trust/karaha-baruha.lua | 5 ++--- scripts/globals/spells/trust/kupipi.lua | 5 ++--- scripts/globals/spells/trust/lehko_habhoka.lua | 5 ++--- scripts/globals/spells/trust/lhu_mhakaracca.lua | 5 ++--- scripts/globals/spells/trust/lilisette.lua | 5 ++--- scripts/globals/spells/trust/lion.lua | 5 ++--- scripts/globals/spells/trust/luzaf.lua | 1 - scripts/globals/spells/trust/maat.lua | 5 ++--- scripts/globals/spells/trust/mihli_aliapoh.lua | 5 ++--- scripts/globals/spells/trust/mnejing.lua | 5 ++--- scripts/globals/spells/trust/moogle.lua | 5 ++--- scripts/globals/spells/trust/mumor.lua | 5 ++--- scripts/globals/spells/trust/naja_salaheem.lua | 5 ++--- scripts/globals/spells/trust/najelith.lua | 5 ++--- scripts/globals/spells/trust/naji.lua | 1 - scripts/globals/spells/trust/nanaa_mihgo.lua | 5 ++--- scripts/globals/spells/trust/nashmeira.lua | 5 ++--- scripts/globals/spells/trust/noillurie.lua | 5 ++--- scripts/globals/spells/trust/ovjang.lua | 5 ++--- scripts/globals/spells/trust/prishe.lua | 5 ++--- scripts/globals/spells/trust/rainemard.lua | 5 ++--- scripts/globals/spells/trust/sakura.lua | 5 ++--- scripts/globals/spells/trust/semih_lafihna.lua | 5 ++--- scripts/globals/spells/trust/shantotto.lua | 5 ++--- scripts/globals/spells/trust/shikaree_z.lua | 5 ++--- scripts/globals/spells/trust/star_sibyl.lua | 5 ++--- scripts/globals/spells/trust/tenzen.lua | 5 ++--- scripts/globals/spells/trust/trion.lua | 5 ++--- scripts/globals/spells/trust/ulmia.lua | 5 ++--- scripts/globals/spells/trust/valaineral.lua | 5 ++--- scripts/globals/spells/trust/volker.lua | 5 ++--- scripts/globals/spells/trust/zazarg.lua | 5 ++--- scripts/globals/spells/trust/zeid.lua | 5 ++--- 52 files changed, 100 insertions(+), 152 deletions(-) diff --git a/scripts/globals/spells/trust/Shantotto_II.lua b/scripts/globals/spells/trust/Shantotto_II.lua index 3d2acf902a7..0ce2e770f83 100644 --- a/scripts/globals/spells/trust/Shantotto_II.lua +++ b/scripts/globals/spells/trust/Shantotto_II.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Shantotto II ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(1019) return 0 end diff --git a/scripts/globals/spells/trust/ajido-marujido.lua b/scripts/globals/spells/trust/ajido-marujido.lua index 7cafe266f7d..a3254e38d74 100644 --- a/scripts/globals/spells/trust/ajido-marujido.lua +++ b/scripts/globals/spells/trust/ajido-marujido.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Ajido-Marujido ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(904) return 0 end diff --git a/scripts/globals/spells/trust/aldo.lua b/scripts/globals/spells/trust/aldo.lua index b3ede93f1a2..3b05285e43b 100644 --- a/scripts/globals/spells/trust/aldo.lua +++ b/scripts/globals/spells/trust/aldo.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Aldo ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(930) return 0 end diff --git a/scripts/globals/spells/trust/areuhat.lua b/scripts/globals/spells/trust/areuhat.lua index 181e24b8dfd..6bb5a618ac2 100644 --- a/scripts/globals/spells/trust/areuhat.lua +++ b/scripts/globals/spells/trust/areuhat.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Areuhat ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(939) return 0 end diff --git a/scripts/globals/spells/trust/ayame.lua b/scripts/globals/spells/trust/ayame.lua index 5b5015bbda4..fe08c013249 100644 --- a/scripts/globals/spells/trust/ayame.lua +++ b/scripts/globals/spells/trust/ayame.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Ayame ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(900) return 0 end diff --git a/scripts/globals/spells/trust/cherukiki.lua b/scripts/globals/spells/trust/cherukiki.lua index d715a9a5b2d..cf9278cbb7d 100644 --- a/scripts/globals/spells/trust/cherukiki.lua +++ b/scripts/globals/spells/trust/cherukiki.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Cherukiki ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(916) return 0 end diff --git a/scripts/globals/spells/trust/cid.lua b/scripts/globals/spells/trust/cid.lua index eebd02b8229..3a22bbdcf31 100644 --- a/scripts/globals/spells/trust/cid.lua +++ b/scripts/globals/spells/trust/cid.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Cid ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(937) return 0 end diff --git a/scripts/globals/spells/trust/curilla.lua b/scripts/globals/spells/trust/curilla.lua index f1500dfd7eb..b7165a134e1 100644 --- a/scripts/globals/spells/trust/curilla.lua +++ b/scripts/globals/spells/trust/curilla.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Curilla ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(902) return 0 end diff --git a/scripts/globals/spells/trust/d_shantotto.lua b/scripts/globals/spells/trust/d_shantotto.lua index 70208899626..5d5210b2f5a 100644 --- a/scripts/globals/spells/trust/d_shantotto.lua +++ b/scripts/globals/spells/trust/d_shantotto.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: D Shantotto ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(934) return 0 end diff --git a/scripts/globals/spells/trust/elivira.lua b/scripts/globals/spells/trust/elivira.lua index 6cdea8e2c92..5a1095edf13 100644 --- a/scripts/globals/spells/trust/elivira.lua +++ b/scripts/globals/spells/trust/elivira.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Elivira ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(941) return 0 end diff --git a/scripts/globals/spells/trust/excenmille.lua b/scripts/globals/spells/trust/excenmille.lua index f835159b93c..d5000d8e24a 100644 --- a/scripts/globals/spells/trust/excenmille.lua +++ b/scripts/globals/spells/trust/excenmille.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Excenmille ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(899) return 0 end diff --git a/scripts/globals/spells/trust/fablinix.lua b/scripts/globals/spells/trust/fablinix.lua index 81110163993..c5213ea36e1 100644 --- a/scripts/globals/spells/trust/fablinix.lua +++ b/scripts/globals/spells/trust/fablinix.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Fablinix ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(932) return 0 end diff --git a/scripts/globals/spells/trust/ferreous_coffin.lua b/scripts/globals/spells/trust/ferreous_coffin.lua index e2b42314907..ac6bc247a7c 100644 --- a/scripts/globals/spells/trust/ferreous_coffin.lua +++ b/scripts/globals/spells/trust/ferreous_coffin.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Ferreous Coffin ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(944) return 0 end diff --git a/scripts/globals/spells/trust/gadalar.lua b/scripts/globals/spells/trust/gadalar.lua index b7c51f78b52..80b281617a5 100644 --- a/scripts/globals/spells/trust/gadalar.lua +++ b/scripts/globals/spells/trust/gadalar.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Gadalar ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(919) return 0 end diff --git a/scripts/globals/spells/trust/gessho.lua b/scripts/globals/spells/trust/gessho.lua index a24908e86ac..3294aa77962 100644 --- a/scripts/globals/spells/trust/gessho.lua +++ b/scripts/globals/spells/trust/gessho.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Gessho ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(918) return 0 end diff --git a/scripts/globals/spells/trust/gilgamesh.lua b/scripts/globals/spells/trust/gilgamesh.lua index 5515f93be57..6b9fb0e745f 100644 --- a/scripts/globals/spells/trust/gilgamesh.lua +++ b/scripts/globals/spells/trust/gilgamesh.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Gilgamesh ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(938) return 0 end diff --git a/scripts/globals/spells/trust/ingrid.lua b/scripts/globals/spells/trust/ingrid.lua index 0109008b628..8485dd8e4aa 100644 --- a/scripts/globals/spells/trust/ingrid.lua +++ b/scripts/globals/spells/trust/ingrid.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Ingrid ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(921) return 0 end diff --git a/scripts/globals/spells/trust/iron_eater.lua b/scripts/globals/spells/trust/iron_eater.lua index 555372849bd..1838f22b267 100644 --- a/scripts/globals/spells/trust/iron_eater.lua +++ b/scripts/globals/spells/trust/iron_eater.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Iron Eater ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(917) return 0 end diff --git a/scripts/globals/spells/trust/joachim.lua b/scripts/globals/spells/trust/joachim.lua index e8e398d6798..0426aee01d2 100644 --- a/scripts/globals/spells/trust/joachim.lua +++ b/scripts/globals/spells/trust/joachim.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Joachim ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(911) return 0 end diff --git a/scripts/globals/spells/trust/karaha-baruha.lua b/scripts/globals/spells/trust/karaha-baruha.lua index e043d217cd8..8023a21b6e9 100644 --- a/scripts/globals/spells/trust/karaha-baruha.lua +++ b/scripts/globals/spells/trust/karaha-baruha.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Karaha-Baruha ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(936) return 0 end diff --git a/scripts/globals/spells/trust/kupipi.lua b/scripts/globals/spells/trust/kupipi.lua index 7457337d8ac..f58e7051806 100644 --- a/scripts/globals/spells/trust/kupipi.lua +++ b/scripts/globals/spells/trust/kupipi.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Kupipi ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(898) return 0 end diff --git a/scripts/globals/spells/trust/lehko_habhoka.lua b/scripts/globals/spells/trust/lehko_habhoka.lua index 9fa852dd73a..66cd824a2e1 100644 --- a/scripts/globals/spells/trust/lehko_habhoka.lua +++ b/scripts/globals/spells/trust/lehko_habhoka.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Lehko Habhoka ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(922) return 0 end diff --git a/scripts/globals/spells/trust/lhu_mhakaracca.lua b/scripts/globals/spells/trust/lhu_mhakaracca.lua index 590c0def6af..788cf528c95 100644 --- a/scripts/globals/spells/trust/lhu_mhakaracca.lua +++ b/scripts/globals/spells/trust/lhu_mhakaracca.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Lhu Mhakaracca ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(943) return 0 end diff --git a/scripts/globals/spells/trust/lilisette.lua b/scripts/globals/spells/trust/lilisette.lua index a7182e6edee..157a1b80253 100644 --- a/scripts/globals/spells/trust/lilisette.lua +++ b/scripts/globals/spells/trust/lilisette.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: lilisette ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(945) return 0 end diff --git a/scripts/globals/spells/trust/lion.lua b/scripts/globals/spells/trust/lion.lua index 0c8eed34b09..60718252617 100644 --- a/scripts/globals/spells/trust/lion.lua +++ b/scripts/globals/spells/trust/lion.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Lion ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(907) return 0 end diff --git a/scripts/globals/spells/trust/luzaf.lua b/scripts/globals/spells/trust/luzaf.lua index 9bd9a837386..087c0d9ea95 100644 --- a/scripts/globals/spells/trust/luzaf.lua +++ b/scripts/globals/spells/trust/luzaf.lua @@ -1,7 +1,6 @@ ----------------------------------------- -- Trust: Luzaf ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- diff --git a/scripts/globals/spells/trust/maat.lua b/scripts/globals/spells/trust/maat.lua index f9fe7db869e..83e6262d078 100644 --- a/scripts/globals/spells/trust/maat.lua +++ b/scripts/globals/spells/trust/maat.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Maat ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(933) return 0 end diff --git a/scripts/globals/spells/trust/mihli_aliapoh.lua b/scripts/globals/spells/trust/mihli_aliapoh.lua index a4daf367f7c..2eea318719a 100644 --- a/scripts/globals/spells/trust/mihli_aliapoh.lua +++ b/scripts/globals/spells/trust/mihli_aliapoh.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Mihli Aliapoh ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(909) return 0 end diff --git a/scripts/globals/spells/trust/mnejing.lua b/scripts/globals/spells/trust/mnejing.lua index 2798fac1055..f5e9467cb5b 100644 --- a/scripts/globals/spells/trust/mnejing.lua +++ b/scripts/globals/spells/trust/mnejing.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Mnejing ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(926) return 0 end diff --git a/scripts/globals/spells/trust/moogle.lua b/scripts/globals/spells/trust/moogle.lua index 6c580ed97e0..80ac90bdec7 100644 --- a/scripts/globals/spells/trust/moogle.lua +++ b/scripts/globals/spells/trust/moogle.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Moogle ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(931) return 0 end diff --git a/scripts/globals/spells/trust/mumor.lua b/scripts/globals/spells/trust/mumor.lua index 28ab43224c4..0fdded5c2ba 100644 --- a/scripts/globals/spells/trust/mumor.lua +++ b/scripts/globals/spells/trust/mumor.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Mumor ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(946) return 0 end diff --git a/scripts/globals/spells/trust/naja_salaheem.lua b/scripts/globals/spells/trust/naja_salaheem.lua index e0bec3a92da..06fe3f954c3 100644 --- a/scripts/globals/spells/trust/naja_salaheem.lua +++ b/scripts/globals/spells/trust/naja_salaheem.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Naja Salaheem ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(912) return 0 end diff --git a/scripts/globals/spells/trust/najelith.lua b/scripts/globals/spells/trust/najelith.lua index 18b0f3b220a..94124252301 100644 --- a/scripts/globals/spells/trust/najelith.lua +++ b/scripts/globals/spells/trust/najelith.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Najelith ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(929) return 0 end diff --git a/scripts/globals/spells/trust/naji.lua b/scripts/globals/spells/trust/naji.lua index 7c686f115e3..fc6a5b23bfe 100644 --- a/scripts/globals/spells/trust/naji.lua +++ b/scripts/globals/spells/trust/naji.lua @@ -1,7 +1,6 @@ ----------------------------------------- -- Trust: Naji ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- diff --git a/scripts/globals/spells/trust/nanaa_mihgo.lua b/scripts/globals/spells/trust/nanaa_mihgo.lua index 2802f13506a..d3bd78423ce 100644 --- a/scripts/globals/spells/trust/nanaa_mihgo.lua +++ b/scripts/globals/spells/trust/nanaa_mihgo.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Nanaa Mihgo ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(901) return 0 end diff --git a/scripts/globals/spells/trust/nashmeira.lua b/scripts/globals/spells/trust/nashmeira.lua index 779249f89a5..ec71edc3f38 100644 --- a/scripts/globals/spells/trust/nashmeira.lua +++ b/scripts/globals/spells/trust/nashmeira.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Nashmeira ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(923) return 0 end diff --git a/scripts/globals/spells/trust/noillurie.lua b/scripts/globals/spells/trust/noillurie.lua index 213591940f5..67ebf78c864 100644 --- a/scripts/globals/spells/trust/noillurie.lua +++ b/scripts/globals/spells/trust/noillurie.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Noillurie ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(942) return 0 end diff --git a/scripts/globals/spells/trust/ovjang.lua b/scripts/globals/spells/trust/ovjang.lua index c35619be7af..319f07735ad 100644 --- a/scripts/globals/spells/trust/ovjang.lua +++ b/scripts/globals/spells/trust/ovjang.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Ovjang ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(925) return 0 end diff --git a/scripts/globals/spells/trust/prishe.lua b/scripts/globals/spells/trust/prishe.lua index f58842beae6..65860bab03c 100644 --- a/scripts/globals/spells/trust/prishe.lua +++ b/scripts/globals/spells/trust/prishe.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Prishe ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(913) return 0 end diff --git a/scripts/globals/spells/trust/rainemard.lua b/scripts/globals/spells/trust/rainemard.lua index 5573882c1c3..a4e9e2d88e5 100644 --- a/scripts/globals/spells/trust/rainemard.lua +++ b/scripts/globals/spells/trust/rainemard.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Rainemard ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(920) return 0 end diff --git a/scripts/globals/spells/trust/sakura.lua b/scripts/globals/spells/trust/sakura.lua index da604557382..592a29ea3cc 100644 --- a/scripts/globals/spells/trust/sakura.lua +++ b/scripts/globals/spells/trust/sakura.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Sakura ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(927) return 0 end diff --git a/scripts/globals/spells/trust/semih_lafihna.lua b/scripts/globals/spells/trust/semih_lafihna.lua index cc9ccde0bee..60f27afc105 100644 --- a/scripts/globals/spells/trust/semih_lafihna.lua +++ b/scripts/globals/spells/trust/semih_lafihna.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Semih Lafihna ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(940) return 0 end diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index 21357841671..831a7315ee6 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Shantotto ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(896) return 0 end diff --git a/scripts/globals/spells/trust/shikaree_z.lua b/scripts/globals/spells/trust/shikaree_z.lua index 0998bec6e4f..bf8e38ee4de 100644 --- a/scripts/globals/spells/trust/shikaree_z.lua +++ b/scripts/globals/spells/trust/shikaree_z.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Shikaree Z ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(915) return 0 end diff --git a/scripts/globals/spells/trust/star_sibyl.lua b/scripts/globals/spells/trust/star_sibyl.lua index 0ec9bce8813..82dce205d3c 100644 --- a/scripts/globals/spells/trust/star_sibyl.lua +++ b/scripts/globals/spells/trust/star_sibyl.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Star Sibyl ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(935) return 0 end diff --git a/scripts/globals/spells/trust/tenzen.lua b/scripts/globals/spells/trust/tenzen.lua index 9210239fcc2..1775b4e4e29 100644 --- a/scripts/globals/spells/trust/tenzen.lua +++ b/scripts/globals/spells/trust/tenzen.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Tenzen ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(908) return 0 end diff --git a/scripts/globals/spells/trust/trion.lua b/scripts/globals/spells/trust/trion.lua index 1915e2f40a9..b6081909f4e 100644 --- a/scripts/globals/spells/trust/trion.lua +++ b/scripts/globals/spells/trust/trion.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Trion ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(905) return 0 end diff --git a/scripts/globals/spells/trust/ulmia.lua b/scripts/globals/spells/trust/ulmia.lua index 32f6698167a..1541e9d76e9 100644 --- a/scripts/globals/spells/trust/ulmia.lua +++ b/scripts/globals/spells/trust/ulmia.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Ulmia ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(914) return 0 end diff --git a/scripts/globals/spells/trust/valaineral.lua b/scripts/globals/spells/trust/valaineral.lua index 8d3734e2a7f..ce8211da9fd 100644 --- a/scripts/globals/spells/trust/valaineral.lua +++ b/scripts/globals/spells/trust/valaineral.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Valaineral ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(910) return 0 end diff --git a/scripts/globals/spells/trust/volker.lua b/scripts/globals/spells/trust/volker.lua index 060a554006b..be473f25f52 100644 --- a/scripts/globals/spells/trust/volker.lua +++ b/scripts/globals/spells/trust/volker.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Volker ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(903) return 0 end diff --git a/scripts/globals/spells/trust/zazarg.lua b/scripts/globals/spells/trust/zazarg.lua index 21ddd824c4c..161ab4e0a70 100644 --- a/scripts/globals/spells/trust/zazarg.lua +++ b/scripts/globals/spells/trust/zazarg.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Zazarg ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(924) return 0 end diff --git a/scripts/globals/spells/trust/zeid.lua b/scripts/globals/spells/trust/zeid.lua index 6d2eee4454e..9cfe0a34080 100644 --- a/scripts/globals/spells/trust/zeid.lua +++ b/scripts/globals/spells/trust/zeid.lua @@ -1,11 +1,10 @@ ----------------------------------------- -- Trust: Zeid ----------------------------------------- -require("scripts/globals/status") require("scripts/globals/msg") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) +function onMagicCastingCheck(caster, target, spell) if (not caster:canUseMisc(dsp.zoneMisc.PET)) then return dsp.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then @@ -14,7 +13,7 @@ function onMagicCastingCheck(caster,target,spell) return 0 end -function onSpellCast(caster,target,spell) +function onSpellCast(caster, target, spell) caster:spawnTrust(906) return 0 end From 293ea9ac4b5561b9658bc763354fa01198383025 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 20 Feb 2020 18:06:24 +0200 Subject: [PATCH 010/116] Style change --- scripts/globals/trust.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index 85304fc48ba..da306ce0682 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -2,8 +2,8 @@ -- Trust --------------------------------------------------------- require("scripts/globals/settings") -require("scripts/globals/status") require("scripts/globals/msg") +--------------------------------------------------------- dsp = dsp or {} dsp.trust = dsp.trust or {} @@ -14,9 +14,9 @@ dsp.trust.messageParty = function(mob, messageString) party = master:getAlliance() - for _,member in ipairs(party) do + for _, member in ipairs(party) do if member:getZoneID() == mob:getZoneID() and member:isPC() then - member:PrintToPlayer(messageString,4) + member:PrintToPlayer(messageString, 4) end end -end \ No newline at end of file +end From f7a0fc76988674b042055343c233bfc4e1adbc1a Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 20 Feb 2020 19:00:03 +0200 Subject: [PATCH 011/116] Rebrand debug breaks --- src/map/lua/lua_baseentity.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index 7104b8824f4..ce3c5593cf1 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -11943,8 +11943,8 @@ inline int32 CLuaBaseEntity::spawnPet(lua_State *L) inline int32 CLuaBaseEntity::canCastTrust(lua_State* L) { - DSP_DEBUG_BREAK_IF(m_PBaseEntity == nullptr); - DSP_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC); + TPZ_DEBUG_BREAK_IF(m_PBaseEntity == nullptr); + TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC); // TODO: You can only spawn trusts in battle areas, similar to pets. See MSGBASIC_TRUST_NOT_HERE // TODO: There is an expandable limit of trusts you can summon, based on key items. From 128561c76033df86f882ff31af6f98eb531804b7 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 20 Feb 2020 19:46:34 +0200 Subject: [PATCH 012/116] Scripts branding --- scripts/globals/spells/trust/Shantotto_II.lua | 4 ++-- scripts/globals/spells/trust/ajido-marujido.lua | 4 ++-- scripts/globals/spells/trust/aldo.lua | 4 ++-- scripts/globals/spells/trust/areuhat.lua | 4 ++-- scripts/globals/spells/trust/ayame.lua | 4 ++-- scripts/globals/spells/trust/cherukiki.lua | 4 ++-- scripts/globals/spells/trust/cid.lua | 4 ++-- scripts/globals/spells/trust/curilla.lua | 4 ++-- scripts/globals/spells/trust/d_shantotto.lua | 4 ++-- scripts/globals/spells/trust/elivira.lua | 4 ++-- scripts/globals/spells/trust/excenmille.lua | 4 ++-- scripts/globals/spells/trust/fablinix.lua | 4 ++-- scripts/globals/spells/trust/ferreous_coffin.lua | 4 ++-- scripts/globals/spells/trust/gadalar.lua | 4 ++-- scripts/globals/spells/trust/gessho.lua | 4 ++-- scripts/globals/spells/trust/gilgamesh.lua | 4 ++-- scripts/globals/spells/trust/ingrid.lua | 4 ++-- scripts/globals/spells/trust/iron_eater.lua | 4 ++-- scripts/globals/spells/trust/joachim.lua | 4 ++-- scripts/globals/spells/trust/karaha-baruha.lua | 4 ++-- scripts/globals/spells/trust/kupipi.lua | 4 ++-- scripts/globals/spells/trust/lehko_habhoka.lua | 4 ++-- scripts/globals/spells/trust/lhu_mhakaracca.lua | 4 ++-- scripts/globals/spells/trust/lilisette.lua | 4 ++-- scripts/globals/spells/trust/lion.lua | 4 ++-- scripts/globals/spells/trust/luzaf.lua | 4 ++-- scripts/globals/spells/trust/maat.lua | 4 ++-- scripts/globals/spells/trust/mihli_aliapoh.lua | 4 ++-- scripts/globals/spells/trust/mnejing.lua | 4 ++-- scripts/globals/spells/trust/moogle.lua | 4 ++-- scripts/globals/spells/trust/mumor.lua | 4 ++-- scripts/globals/spells/trust/naja_salaheem.lua | 4 ++-- scripts/globals/spells/trust/najelith.lua | 4 ++-- scripts/globals/spells/trust/naji.lua | 4 ++-- scripts/globals/spells/trust/nanaa_mihgo.lua | 4 ++-- scripts/globals/spells/trust/nashmeira.lua | 4 ++-- scripts/globals/spells/trust/noillurie.lua | 4 ++-- scripts/globals/spells/trust/ovjang.lua | 4 ++-- scripts/globals/spells/trust/prishe.lua | 4 ++-- scripts/globals/spells/trust/rainemard.lua | 4 ++-- scripts/globals/spells/trust/sakura.lua | 4 ++-- scripts/globals/spells/trust/semih_lafihna.lua | 4 ++-- scripts/globals/spells/trust/shantotto.lua | 4 ++-- scripts/globals/spells/trust/shikaree_z.lua | 4 ++-- scripts/globals/spells/trust/star_sibyl.lua | 4 ++-- scripts/globals/spells/trust/tenzen.lua | 4 ++-- scripts/globals/spells/trust/trion.lua | 4 ++-- scripts/globals/spells/trust/ulmia.lua | 4 ++-- scripts/globals/spells/trust/valaineral.lua | 4 ++-- scripts/globals/spells/trust/volker.lua | 4 ++-- scripts/globals/spells/trust/zazarg.lua | 4 ++-- scripts/globals/spells/trust/zeid.lua | 4 ++-- scripts/globals/trust.lua | 6 +++--- 53 files changed, 107 insertions(+), 107 deletions(-) diff --git a/scripts/globals/spells/trust/Shantotto_II.lua b/scripts/globals/spells/trust/Shantotto_II.lua index 0ce2e770f83..1fc878a50f9 100644 --- a/scripts/globals/spells/trust/Shantotto_II.lua +++ b/scripts/globals/spells/trust/Shantotto_II.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/ajido-marujido.lua b/scripts/globals/spells/trust/ajido-marujido.lua index a3254e38d74..93fab3c84f8 100644 --- a/scripts/globals/spells/trust/ajido-marujido.lua +++ b/scripts/globals/spells/trust/ajido-marujido.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/aldo.lua b/scripts/globals/spells/trust/aldo.lua index 3b05285e43b..ae5506cb83c 100644 --- a/scripts/globals/spells/trust/aldo.lua +++ b/scripts/globals/spells/trust/aldo.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/areuhat.lua b/scripts/globals/spells/trust/areuhat.lua index 6bb5a618ac2..724b66a931f 100644 --- a/scripts/globals/spells/trust/areuhat.lua +++ b/scripts/globals/spells/trust/areuhat.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/ayame.lua b/scripts/globals/spells/trust/ayame.lua index fe08c013249..c2726362232 100644 --- a/scripts/globals/spells/trust/ayame.lua +++ b/scripts/globals/spells/trust/ayame.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/cherukiki.lua b/scripts/globals/spells/trust/cherukiki.lua index cf9278cbb7d..aeb5128dc47 100644 --- a/scripts/globals/spells/trust/cherukiki.lua +++ b/scripts/globals/spells/trust/cherukiki.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/cid.lua b/scripts/globals/spells/trust/cid.lua index 3a22bbdcf31..3af1cac9680 100644 --- a/scripts/globals/spells/trust/cid.lua +++ b/scripts/globals/spells/trust/cid.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/curilla.lua b/scripts/globals/spells/trust/curilla.lua index b7165a134e1..0415467ea9d 100644 --- a/scripts/globals/spells/trust/curilla.lua +++ b/scripts/globals/spells/trust/curilla.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/d_shantotto.lua b/scripts/globals/spells/trust/d_shantotto.lua index 5d5210b2f5a..e7917c2bb53 100644 --- a/scripts/globals/spells/trust/d_shantotto.lua +++ b/scripts/globals/spells/trust/d_shantotto.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/elivira.lua b/scripts/globals/spells/trust/elivira.lua index 5a1095edf13..b691e6fbe62 100644 --- a/scripts/globals/spells/trust/elivira.lua +++ b/scripts/globals/spells/trust/elivira.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/excenmille.lua b/scripts/globals/spells/trust/excenmille.lua index d5000d8e24a..dc3f3a17ab9 100644 --- a/scripts/globals/spells/trust/excenmille.lua +++ b/scripts/globals/spells/trust/excenmille.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/fablinix.lua b/scripts/globals/spells/trust/fablinix.lua index c5213ea36e1..39b10c03a89 100644 --- a/scripts/globals/spells/trust/fablinix.lua +++ b/scripts/globals/spells/trust/fablinix.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/ferreous_coffin.lua b/scripts/globals/spells/trust/ferreous_coffin.lua index ac6bc247a7c..c91dffe6e81 100644 --- a/scripts/globals/spells/trust/ferreous_coffin.lua +++ b/scripts/globals/spells/trust/ferreous_coffin.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/gadalar.lua b/scripts/globals/spells/trust/gadalar.lua index 80b281617a5..4fc82c107d1 100644 --- a/scripts/globals/spells/trust/gadalar.lua +++ b/scripts/globals/spells/trust/gadalar.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/gessho.lua b/scripts/globals/spells/trust/gessho.lua index 3294aa77962..31c8cbbc8a3 100644 --- a/scripts/globals/spells/trust/gessho.lua +++ b/scripts/globals/spells/trust/gessho.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/gilgamesh.lua b/scripts/globals/spells/trust/gilgamesh.lua index 6b9fb0e745f..80d736e9e87 100644 --- a/scripts/globals/spells/trust/gilgamesh.lua +++ b/scripts/globals/spells/trust/gilgamesh.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/ingrid.lua b/scripts/globals/spells/trust/ingrid.lua index 8485dd8e4aa..35a431de764 100644 --- a/scripts/globals/spells/trust/ingrid.lua +++ b/scripts/globals/spells/trust/ingrid.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/iron_eater.lua b/scripts/globals/spells/trust/iron_eater.lua index 1838f22b267..137583b117e 100644 --- a/scripts/globals/spells/trust/iron_eater.lua +++ b/scripts/globals/spells/trust/iron_eater.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/joachim.lua b/scripts/globals/spells/trust/joachim.lua index 0426aee01d2..a22b4ac80ad 100644 --- a/scripts/globals/spells/trust/joachim.lua +++ b/scripts/globals/spells/trust/joachim.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/karaha-baruha.lua b/scripts/globals/spells/trust/karaha-baruha.lua index 8023a21b6e9..c4b2aeb70f7 100644 --- a/scripts/globals/spells/trust/karaha-baruha.lua +++ b/scripts/globals/spells/trust/karaha-baruha.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/kupipi.lua b/scripts/globals/spells/trust/kupipi.lua index f58e7051806..6522602f13e 100644 --- a/scripts/globals/spells/trust/kupipi.lua +++ b/scripts/globals/spells/trust/kupipi.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/lehko_habhoka.lua b/scripts/globals/spells/trust/lehko_habhoka.lua index 66cd824a2e1..e35777be4f7 100644 --- a/scripts/globals/spells/trust/lehko_habhoka.lua +++ b/scripts/globals/spells/trust/lehko_habhoka.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/lhu_mhakaracca.lua b/scripts/globals/spells/trust/lhu_mhakaracca.lua index 788cf528c95..5a0c71a2f27 100644 --- a/scripts/globals/spells/trust/lhu_mhakaracca.lua +++ b/scripts/globals/spells/trust/lhu_mhakaracca.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/lilisette.lua b/scripts/globals/spells/trust/lilisette.lua index 157a1b80253..b4f5dd119e1 100644 --- a/scripts/globals/spells/trust/lilisette.lua +++ b/scripts/globals/spells/trust/lilisette.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/lion.lua b/scripts/globals/spells/trust/lion.lua index 60718252617..c12424c6643 100644 --- a/scripts/globals/spells/trust/lion.lua +++ b/scripts/globals/spells/trust/lion.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/luzaf.lua b/scripts/globals/spells/trust/luzaf.lua index 087c0d9ea95..c2c811419bf 100644 --- a/scripts/globals/spells/trust/luzaf.lua +++ b/scripts/globals/spells/trust/luzaf.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/maat.lua b/scripts/globals/spells/trust/maat.lua index 83e6262d078..384dcd9533b 100644 --- a/scripts/globals/spells/trust/maat.lua +++ b/scripts/globals/spells/trust/maat.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/mihli_aliapoh.lua b/scripts/globals/spells/trust/mihli_aliapoh.lua index 2eea318719a..107f27cf3c2 100644 --- a/scripts/globals/spells/trust/mihli_aliapoh.lua +++ b/scripts/globals/spells/trust/mihli_aliapoh.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/mnejing.lua b/scripts/globals/spells/trust/mnejing.lua index f5e9467cb5b..70216d96ca1 100644 --- a/scripts/globals/spells/trust/mnejing.lua +++ b/scripts/globals/spells/trust/mnejing.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/moogle.lua b/scripts/globals/spells/trust/moogle.lua index 80ac90bdec7..b112ebfb158 100644 --- a/scripts/globals/spells/trust/moogle.lua +++ b/scripts/globals/spells/trust/moogle.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/mumor.lua b/scripts/globals/spells/trust/mumor.lua index 0fdded5c2ba..5cb7fc8d940 100644 --- a/scripts/globals/spells/trust/mumor.lua +++ b/scripts/globals/spells/trust/mumor.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/naja_salaheem.lua b/scripts/globals/spells/trust/naja_salaheem.lua index 06fe3f954c3..c7c61e30402 100644 --- a/scripts/globals/spells/trust/naja_salaheem.lua +++ b/scripts/globals/spells/trust/naja_salaheem.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/najelith.lua b/scripts/globals/spells/trust/najelith.lua index 94124252301..33d4634580d 100644 --- a/scripts/globals/spells/trust/najelith.lua +++ b/scripts/globals/spells/trust/najelith.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/naji.lua b/scripts/globals/spells/trust/naji.lua index fc6a5b23bfe..86fe20edd08 100644 --- a/scripts/globals/spells/trust/naji.lua +++ b/scripts/globals/spells/trust/naji.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster,target,spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/nanaa_mihgo.lua b/scripts/globals/spells/trust/nanaa_mihgo.lua index d3bd78423ce..576611b0d83 100644 --- a/scripts/globals/spells/trust/nanaa_mihgo.lua +++ b/scripts/globals/spells/trust/nanaa_mihgo.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/nashmeira.lua b/scripts/globals/spells/trust/nashmeira.lua index ec71edc3f38..a0b692b8f69 100644 --- a/scripts/globals/spells/trust/nashmeira.lua +++ b/scripts/globals/spells/trust/nashmeira.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/noillurie.lua b/scripts/globals/spells/trust/noillurie.lua index 67ebf78c864..f0a57dcc7e1 100644 --- a/scripts/globals/spells/trust/noillurie.lua +++ b/scripts/globals/spells/trust/noillurie.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/ovjang.lua b/scripts/globals/spells/trust/ovjang.lua index 319f07735ad..1a0d97387d0 100644 --- a/scripts/globals/spells/trust/ovjang.lua +++ b/scripts/globals/spells/trust/ovjang.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/prishe.lua b/scripts/globals/spells/trust/prishe.lua index 65860bab03c..38ce60e6c58 100644 --- a/scripts/globals/spells/trust/prishe.lua +++ b/scripts/globals/spells/trust/prishe.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/rainemard.lua b/scripts/globals/spells/trust/rainemard.lua index a4e9e2d88e5..ae7c603f50f 100644 --- a/scripts/globals/spells/trust/rainemard.lua +++ b/scripts/globals/spells/trust/rainemard.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/sakura.lua b/scripts/globals/spells/trust/sakura.lua index 592a29ea3cc..d4be5bdccf6 100644 --- a/scripts/globals/spells/trust/sakura.lua +++ b/scripts/globals/spells/trust/sakura.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/semih_lafihna.lua b/scripts/globals/spells/trust/semih_lafihna.lua index 60f27afc105..2d2885fa1a4 100644 --- a/scripts/globals/spells/trust/semih_lafihna.lua +++ b/scripts/globals/spells/trust/semih_lafihna.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index 831a7315ee6..a13d8eb28df 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/shikaree_z.lua b/scripts/globals/spells/trust/shikaree_z.lua index bf8e38ee4de..ca4f372c245 100644 --- a/scripts/globals/spells/trust/shikaree_z.lua +++ b/scripts/globals/spells/trust/shikaree_z.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/star_sibyl.lua b/scripts/globals/spells/trust/star_sibyl.lua index 82dce205d3c..5dd417cb4e2 100644 --- a/scripts/globals/spells/trust/star_sibyl.lua +++ b/scripts/globals/spells/trust/star_sibyl.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/tenzen.lua b/scripts/globals/spells/trust/tenzen.lua index 1775b4e4e29..8421664b387 100644 --- a/scripts/globals/spells/trust/tenzen.lua +++ b/scripts/globals/spells/trust/tenzen.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/trion.lua b/scripts/globals/spells/trust/trion.lua index b6081909f4e..5f8513f53a2 100644 --- a/scripts/globals/spells/trust/trion.lua +++ b/scripts/globals/spells/trust/trion.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/ulmia.lua b/scripts/globals/spells/trust/ulmia.lua index 1541e9d76e9..ac3cb2041f6 100644 --- a/scripts/globals/spells/trust/ulmia.lua +++ b/scripts/globals/spells/trust/ulmia.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/valaineral.lua b/scripts/globals/spells/trust/valaineral.lua index ce8211da9fd..a443857bac5 100644 --- a/scripts/globals/spells/trust/valaineral.lua +++ b/scripts/globals/spells/trust/valaineral.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/volker.lua b/scripts/globals/spells/trust/volker.lua index be473f25f52..5475882454b 100644 --- a/scripts/globals/spells/trust/volker.lua +++ b/scripts/globals/spells/trust/volker.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/zazarg.lua b/scripts/globals/spells/trust/zazarg.lua index 161ab4e0a70..ce2efaacd3d 100644 --- a/scripts/globals/spells/trust/zazarg.lua +++ b/scripts/globals/spells/trust/zazarg.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/spells/trust/zeid.lua b/scripts/globals/spells/trust/zeid.lua index 9cfe0a34080..2c9ad635719 100644 --- a/scripts/globals/spells/trust/zeid.lua +++ b/scripts/globals/spells/trust/zeid.lua @@ -5,8 +5,8 @@ require("scripts/globals/msg") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(dsp.zoneMisc.PET)) then - return dsp.msg.basic.CANT_BE_USED_IN_AREA + if (not caster:canUseMisc(tpz.zoneMisc.PET)) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA elseif (not caster:canCastTrust(spell:getID())) then return end diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index da306ce0682..34acc271023 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -5,10 +5,10 @@ require("scripts/globals/settings") require("scripts/globals/msg") --------------------------------------------------------- -dsp = dsp or {} -dsp.trust = dsp.trust or {} +tpz = tpz or {} +tpz.trust = tpz.trust or {} -dsp.trust.messageParty = function(mob, messageString) +tpz.trust.messageParty = function(mob, messageString) local party = {} local master = mob:getMaster() From 3167fba19646ab9b5c8d59ac7e2a6b7778602f89 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 20 Feb 2020 19:49:54 +0200 Subject: [PATCH 013/116] Cleanup --- scripts/globals/trust/Kupipi.lua | 24 ++------------------- scripts/globals/trust/Trion.lua | 36 ++------------------------------ 2 files changed, 4 insertions(+), 56 deletions(-) diff --git a/scripts/globals/trust/Kupipi.lua b/scripts/globals/trust/Kupipi.lua index 0c2eb6862a4..32e6a59e5fe 100644 --- a/scripts/globals/trust/Kupipi.lua +++ b/scripts/globals/trust/Kupipi.lua @@ -1,40 +1,20 @@ ----------------------------------- -- Trust: Kupipi --- Spellid: 898 ----------------------------------- require("scripts/globals/trust") ----------------------------------- function onMobSpawn(mob) - --local party = {} - local master = mob:getMaster() - local text = "You can entrust e~verything to the meticulous Kupipi!" - - --party = master:getAlliance() - master:PrintToPlayer(text,15) - --for _,member in ipairs(party) do - -- if member:getZoneID() == mob:getZoneID() and member:isPC() then - -- member:PrintToPlayer(text,4) - -- end - --end end function onMobFight(mob,target) - local master = mob:getMaster() - - if master:getHPP() < 50 then - print("my masters hp is low") - mob:castSpell(1,master) - end end function onMobDeath(mob, player, isKiller) - end function onMobDespawn(mob) - end -local function messageParty(mob, messageString) -end \ No newline at end of file +function onMonsterMagicPrepare(mob,target) +end diff --git a/scripts/globals/trust/Trion.lua b/scripts/globals/trust/Trion.lua index c6f8f6b5f63..cd8a2e8a5a7 100644 --- a/scripts/globals/trust/Trion.lua +++ b/scripts/globals/trust/Trion.lua @@ -1,52 +1,20 @@ ----------------------------------- --- Trust: Tion --- Spellid: 905 +-- Trust: Trion ----------------------------------- require("scripts/globals/trust") ----------------------------------- function onMobSpawn(mob) - --local party = {} - print("working") - local master = mob:getMaster() - local text = "I am Trion, prince of San d'Oria. May my blade lead us to victory this day!" - - --party = master:getAlliance() - master:PrintToPlayer(text,15) - --for _,member in ipairs(party) do - -- if member:getZoneID() == mob:getZoneID() and member:isPC() then - -- member:PrintToPlayer(text,4) - -- end - --end end function onMobFight(mob,target) end function onMobDeath(mob, player, isKiller) - print("Trying to kill Trion!") - end +end function onMobDespawn(mob) - print("Trying to despawn Trion!") end function onMonsterMagicPrepare(mob,target) - -- casts Water IV, Waterga III, Flood, Drown - local rnd = math.random(); - - if rnd < 0.5 then - return 43 - elseif rnd < 0.7 then - return 1 - elseif rnd < 0.9 then - return 48 - else - return 1 - end - end - -local function messageParty(mob, messageString) - print("passing through to messageParty ok!") -end \ No newline at end of file From 6b27e2284dfa7b1418690c5683dec1373211fa84 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 20 Feb 2020 20:28:04 +0200 Subject: [PATCH 014/116] Remove behaviour scripts --- scripts/globals/trust/Kupipi.lua | 20 -------------------- scripts/globals/trust/Trion.lua | 20 -------------------- 2 files changed, 40 deletions(-) delete mode 100644 scripts/globals/trust/Kupipi.lua delete mode 100644 scripts/globals/trust/Trion.lua diff --git a/scripts/globals/trust/Kupipi.lua b/scripts/globals/trust/Kupipi.lua deleted file mode 100644 index 32e6a59e5fe..00000000000 --- a/scripts/globals/trust/Kupipi.lua +++ /dev/null @@ -1,20 +0,0 @@ ------------------------------------ --- Trust: Kupipi ------------------------------------ -require("scripts/globals/trust") ------------------------------------ - -function onMobSpawn(mob) -end - -function onMobFight(mob,target) -end - -function onMobDeath(mob, player, isKiller) -end - -function onMobDespawn(mob) -end - -function onMonsterMagicPrepare(mob,target) -end diff --git a/scripts/globals/trust/Trion.lua b/scripts/globals/trust/Trion.lua deleted file mode 100644 index cd8a2e8a5a7..00000000000 --- a/scripts/globals/trust/Trion.lua +++ /dev/null @@ -1,20 +0,0 @@ ------------------------------------ --- Trust: Trion ------------------------------------ -require("scripts/globals/trust") ------------------------------------ - -function onMobSpawn(mob) -end - -function onMobFight(mob,target) -end - -function onMobDeath(mob, player, isKiller) -end - -function onMobDespawn(mob) -end - -function onMonsterMagicPrepare(mob,target) -end From f09b9c270df1fbe4db4aac66ed11a16427665ebd Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 20 Feb 2020 20:47:50 +0200 Subject: [PATCH 015/116] Remove MSCV macro for each loops --- src/map/entities/charentity.cpp | 2 +- src/map/zone_entities.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map/entities/charentity.cpp b/src/map/entities/charentity.cpp index dc1818cf826..bcf0370cb12 100644 --- a/src/map/entities/charentity.cpp +++ b/src/map/entities/charentity.cpp @@ -514,7 +514,7 @@ void CCharEntity::ClearTrusts() return; } - for (auto trust : PTrusts) + for (auto& trust : PTrusts) { trust->PAI->Despawn(); } diff --git a/src/map/zone_entities.cpp b/src/map/zone_entities.cpp index dcbb5f40d8f..5001c2b68d5 100644 --- a/src/map/zone_entities.cpp +++ b/src/map/zone_entities.cpp @@ -373,7 +373,7 @@ void CZoneEntities::DecreaseZoneCounter(CCharEntity* PChar) //remove trust if (PChar->PTrusts.size() > 0) { - for each (auto trust in PChar->PTrusts) + for (auto& trust : PChar->PTrusts) { trust->PAI->Disengage(); //trust->status = STATUS_DISAPPEAR; From 94a09d121cceeac6490c5eea423b06b5250d98fc Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 21 Feb 2020 10:49:19 +0200 Subject: [PATCH 016/116] Add some trust handling code to targetfind --- src/map/ai/helpers/targetfind.cpp | 39 ++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/src/map/ai/helpers/targetfind.cpp b/src/map/ai/helpers/targetfind.cpp index 43775df9d33..23c6e819195 100644 --- a/src/map/ai/helpers/targetfind.cpp +++ b/src/map/ai/helpers/targetfind.cpp @@ -94,9 +94,9 @@ void CTargetFind::findWithinArea(CBattleEntity* PTarget, AOERADIUS radiusType, f m_PTarget = PTarget; isPlayer = checkIsPlayer(m_PBattleEntity); - if (isPlayer){ + if (isPlayer || m_PTarget->objtype == TYPE_TRUST) + { // handle this as a player - if (m_PMasterTarget->objtype == TYPE_PC) { @@ -115,23 +115,37 @@ void CTargetFind::findWithinArea(CBattleEntity* PTarget, AOERADIUS radiusType, f // add party members addAllInParty(m_PMasterTarget, withPet); } + + // add my trust too, if its allowed + if (((CCharEntity*)m_PMasterTarget)->PTrusts.size() > 0) + { + for (auto& trust : ((CCharEntity*)m_PMasterTarget)->PTrusts) + { + if (validEntity((CBattleEntity*)trust)) + { + m_targets.push_back((CBattleEntity*)trust); + } + } + } } - else { + else + { // just add myself addEntity(m_PMasterTarget, withPet); } } - else { + else + { m_findType = FIND_PLAYER_MONSTER; // special case to add all mobs in range addAllInMobList(m_PMasterTarget, false); } } - else { + else + { // handle this as a mob - if (m_PMasterTarget->objtype == TYPE_PC || m_PBattleEntity->allegiance == ALLEGIANCE_PLAYER){ m_findType = FIND_MONSTER_PLAYER; } @@ -386,6 +400,10 @@ bool CTargetFind::validEntity(CBattleEntity* PTarget) } else if (m_findType == FIND_MONSTER_MONSTER || m_findType == FIND_PLAYER_PLAYER){ + if (PTarget->objtype == TYPE_TRUST) + { + return true; + } return false; } } @@ -481,7 +499,7 @@ bool CTargetFind::canSee(position_t* point) CBattleEntity* CTargetFind::getValidTarget(uint16 actionTargetID, uint16 validTargetFlags) { - CBattleEntity* PTarget = (CBattleEntity*)m_PBattleEntity->GetEntity(actionTargetID, TYPE_MOB | TYPE_PC | TYPE_PET | TYPE_TRUST); + CBattleEntity* PTarget = (CBattleEntity*)m_PBattleEntity->GetEntity(actionTargetID, TYPE_TRUST | TYPE_MOB | TYPE_PC | TYPE_PET); if (PTarget == nullptr) { @@ -493,9 +511,12 @@ CBattleEntity* CTargetFind::getValidTarget(uint16 actionTargetID, uint16 validTa return m_PBattleEntity->PPet; } - if (PTarget->objtype == TYPE_TRUST) + if (validTargetFlags & TARGET_PLAYER_PARTY) { - return PTarget; + if (PTarget->objtype == TYPE_TRUST) + { + return PTarget; + } } if (PTarget->ValidTarget(m_PBattleEntity, validTargetFlags)) From db854bcce07bce816a1421fc7f06a025133dba55 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 25 Feb 2020 16:31:37 +0200 Subject: [PATCH 017/116] Rename spell Shantotto_II -> shantotto_ii --- .../globals/spells/trust/{Shantotto_II.lua => shantotto_ii.lua} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/globals/spells/trust/{Shantotto_II.lua => shantotto_ii.lua} (100%) diff --git a/scripts/globals/spells/trust/Shantotto_II.lua b/scripts/globals/spells/trust/shantotto_ii.lua similarity index 100% rename from scripts/globals/spells/trust/Shantotto_II.lua rename to scripts/globals/spells/trust/shantotto_ii.lua From 2acbfc807393c39e9be9e662fb4b92e3664cdaa5 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 25 Feb 2020 21:51:48 +0200 Subject: [PATCH 018/116] General cleanup --- src/map/ai/controllers/trust_controller.cpp | 94 ++++++--------------- src/map/ai/controllers/trust_controller.h | 12 +-- src/map/ai/helpers/targetfind.cpp | 3 +- src/map/entities/baseentity.h | 2 +- src/map/entities/charentity.h | 1 - src/map/utils/petutils.cpp | 3 +- 6 files changed, 34 insertions(+), 81 deletions(-) diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index a81ac5b88c4..6af11dfc6e8 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -31,9 +31,8 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "../../../common/utils.h" #include "../../lua/lua_baseentity.h" -CTrustController::CTrustController(CCharEntity* PChar, CTrustEntity* PTrust) : CController(PTrust) +CTrustController::CTrustController(CCharEntity* PChar, CTrustEntity* PTrust) : CMobController(PTrust) { - POwner->PAI->PathFind = std::make_unique(PTrust); } CTrustController::~CTrustController() @@ -51,8 +50,8 @@ void CTrustController::Despawn() if (POwner->PMaster) { POwner->PMaster = nullptr; - //POwner->PAI->Internal_Despawn(); } + POwner->animation = ANIMATION_DESPAWN; CController::Despawn(); } @@ -60,29 +59,9 @@ void CTrustController::Tick(time_point tick) { m_Tick = tick; - if (!POwner->PMaster) - return; - if (POwner->PAI->IsEngaged()) { - auto PTarget{ POwner->GetBattleTarget() }; - - if (PTarget) - { - auto PMob = static_cast(PTarget); - - if (PMob->PEnmityContainer->GetHighestEnmity() != nullptr) - { - if (PMob->PEnmityContainer->HasID(POwner->PMaster->id)) - { - DoCombatTick(tick); - } - else if (!POwner->isDead()) - { - DoRoamTick(tick); - } - } - } + DoCombatTick(tick); } else if (!POwner->isDead()) { @@ -92,18 +71,14 @@ void CTrustController::Tick(time_point tick) void CTrustController::DoCombatTick(time_point tick) { - if (!POwner->PMaster->PAI->IsEngaged()) + if ((POwner->PMaster == nullptr || POwner->PMaster->isMounted() || + POwner->PMaster->isDead()) && POwner->isAlive()) { - POwner->PAI->Internal_Disengage(); - } - - if (POwner->PMaster->GetBattleTargetID() != POwner->GetBattleTargetID()) - { - POwner->PAI->Internal_ChangeTarget(POwner->PMaster->GetBattleTargetID()); + POwner->Die(); + return; } auto PTarget{ POwner->GetBattleTarget() }; - if (PTarget) { if (POwner->PAI->CanFollowPath()) @@ -114,57 +89,44 @@ void CTrustController::DoCombatTick(time_point tick) { if (POwner->speed > 0) { - POwner->PAI->PathFind->PathAround(PTarget->loc.p, 2.0f, PATHFLAG_WALLHACK | PATHFLAG_RUN); + POwner->PAI->PathFind->PathAround(PTarget->loc.p, 3.0f, PATHFLAG_WALLHACK | PATHFLAG_RUN); POwner->PAI->PathFind->FollowPath(); } } } + POwner->PAI->EventHandler.triggerListener("COMBAT_TICK", POwner, POwner->PMaster, PTarget); } } void CTrustController::DoRoamTick(time_point tick) { - if (POwner->PMaster->PAI->IsEngaged()) + if ((POwner->PMaster == nullptr || POwner->PMaster->isMounted() || + POwner->PMaster->isDead()) && POwner->isAlive()) { - POwner->PAI->Internal_Engage(POwner->PMaster->GetBattleTargetID()); + POwner->Die(); + return; } - auto master = static_cast(POwner->PMaster); - auto PTrust = static_cast(POwner); - uint8 currentPartyPos = master->TrustPartyPosition(PTrust); - float currentDistance = 0; + float currentDistance = distance(POwner->loc.p, POwner->PMaster->loc.p); - if (currentPartyPos == 0) + if (currentDistance > RoamDistance) { - currentDistance = distance(POwner->loc.p, POwner->PMaster->loc.p); - - if (currentDistance > RoamDistance) + if (currentDistance < 6.0f && POwner->PAI->PathFind->PathAround(POwner->PMaster->loc.p, 3.0f, PATHFLAG_RUN | PATHFLAG_WALLHACK)) { - if (currentDistance < 35.0f && PTrust->PAI->PathFind->PathTo(POwner->PMaster->loc.p, PATHFLAG_RUN | PATHFLAG_WALLHACK)) - { - PTrust->PAI->PathFind->FollowPath(); - } - else if (POwner->GetSpeed() > 0) - { - PTrust->PAI->PathFind->WarpTo(POwner->PMaster->loc.p, RoamDistance); - } + POwner->PAI->PathFind->FollowPath(); } - } - else if(currentPartyPos > 0) - { - CBattleEntity* PFollow = (CBattleEntity*)master->PTrusts.at(currentPartyPos - 1); - currentDistance = distance(PTrust->loc.p, PFollow->loc.p); - - if (currentDistance > 2.0f) + else if (POwner->GetSpeed() > 0) { - if (currentDistance < 35.0f && PTrust->PAI->PathFind->PathTo(PFollow->loc.p, PATHFLAG_RUN | PATHFLAG_WALLHACK)) - { - PTrust->PAI->PathFind->FollowPath(); - } - else if (POwner->GetSpeed() > 0) - { - PTrust->PAI->PathFind->WarpTo(PFollow->loc.p, RoamDistance); - } + POwner->PAI->PathFind->StepTo(POwner->PMaster->loc.p, RoamDistance); } } } + +bool CTrustController::Ability(uint16 targid, uint16 abilityid) +{ + if (POwner->PAI->CanChangeState()) + { + return POwner->PAI->Internal_Ability(targid, abilityid); + } + return false; +} \ No newline at end of file diff --git a/src/map/ai/controllers/trust_controller.h b/src/map/ai/controllers/trust_controller.h index 96a6f0c6629..8be4dfa287a 100644 --- a/src/map/ai/controllers/trust_controller.h +++ b/src/map/ai/controllers/trust_controller.h @@ -22,27 +22,21 @@ along with this program. If not, see http://www.gnu.org/licenses/ #ifndef _TRUSTCONTROLLER_H #define _TRUSTCONTROLLER_H -#include "controller.h" +#include "mob_controller.h" class CCharEntity; class CTrustEntity; -class CTrustController : public CController +class CTrustController : public CMobController { public: - CTrustController(CCharEntity*, CTrustEntity*); - CBattleEntity* PTarget{ nullptr }; virtual ~CTrustController(); virtual void Tick(time_point) override; virtual void Despawn() override; - virtual bool Cast(uint16 targid, SpellID spellid) override { return false; } - virtual bool ChangeTarget(uint16 targid) override { return false; } - virtual bool WeaponSkill(uint16 targid, uint16 wsid) override { return false; } - - virtual bool Ability(uint16 targid, uint16 abilityid) override { return false; } + virtual bool Ability(uint16 targid, uint16 abilityid) override; static constexpr float RoamDistance{ 5.5f }; static constexpr float SpawnDistance{ 12.5f }; diff --git a/src/map/ai/helpers/targetfind.cpp b/src/map/ai/helpers/targetfind.cpp index 23c6e819195..29b95f48dad 100644 --- a/src/map/ai/helpers/targetfind.cpp +++ b/src/map/ai/helpers/targetfind.cpp @@ -99,7 +99,6 @@ void CTargetFind::findWithinArea(CBattleEntity* PTarget, AOERADIUS radiusType, f // handle this as a player if (m_PMasterTarget->objtype == TYPE_PC) { - // players will never need to add whole alliance m_findType = FIND_PLAYER_PLAYER; @@ -499,7 +498,7 @@ bool CTargetFind::canSee(position_t* point) CBattleEntity* CTargetFind::getValidTarget(uint16 actionTargetID, uint16 validTargetFlags) { - CBattleEntity* PTarget = (CBattleEntity*)m_PBattleEntity->GetEntity(actionTargetID, TYPE_TRUST | TYPE_MOB | TYPE_PC | TYPE_PET); + CBattleEntity* PTarget = (CBattleEntity*)m_PBattleEntity->GetEntity(actionTargetID, TYPE_MOB | TYPE_PC | TYPE_PET | TYPE_TRUST); if (PTarget == nullptr) { diff --git a/src/map/entities/baseentity.h b/src/map/entities/baseentity.h index cef73ba6b0d..174b2cce527 100644 --- a/src/map/entities/baseentity.h +++ b/src/map/entities/baseentity.h @@ -56,7 +56,7 @@ enum ANIMATIONTYPE { ANIMATION_NONE = 0, ANIMATION_ATTACK = 1, - // Death = 2, + ANIMATION_DESPAWN = 2, ANIMATION_DEATH = 3, ANIMATION_EVENT = 4, ANIMATION_CHOCOBO = 5, diff --git a/src/map/entities/charentity.h b/src/map/entities/charentity.h index 0ddcedd53ea..3262b99815f 100644 --- a/src/map/entities/charentity.h +++ b/src/map/entities/charentity.h @@ -211,7 +211,6 @@ class CCharEntity : public CBattleEntity UnlockedAttachments_t m_unlockedAttachments; // Unlocked Automaton Attachments (1 bit per attachment) CAutomatonEntity* PAutomaton; // Automaton statistics - CTrustEntity* PTrust; // Trust statistics std::vector PTrusts; // Active trusts diff --git a/src/map/utils/petutils.cpp b/src/map/utils/petutils.cpp index c2885842950..c7a425122c8 100644 --- a/src/map/utils/petutils.cpp +++ b/src/map/utils/petutils.cpp @@ -1875,7 +1875,6 @@ namespace petutils CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID) { - TPZ_DEBUG_BREAK_IF(TrustID >= g_PPetList.size()); CTrustEntity* PTrust = new CTrustEntity(PMaster); Trust_t* trustData = new Trust_t(); @@ -1902,7 +1901,7 @@ namespace petutils PTrust->m_MobSkillList = trustData->m_MobSkillList; PTrust->SetMJob(trustData->mJob); PTrust->SetSJob(trustData->sJob); // TODO: This may not be true for some trusts - PTrust->m_TrustID = TrustID; + PTrust->m_TrustID = trustData->trustID; PTrust->status = STATUS_NORMAL; PTrust->m_ModelSize = trustData->size; PTrust->m_EcoSystem = trustData->EcoSystem; From 84af91824deb158e2fa7d5d5ca1088724ab7c0a2 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Wed, 26 Feb 2020 09:45:39 +0200 Subject: [PATCH 019/116] Revert "Add new bindings: getJobLevel & hasJob (#386)" This reverts commit b14748b6aaca1311f51ceaa42d49837bf45776ac. --- src/map/lua/lua_baseentity.cpp | 48 ---------------------------------- src/map/lua/lua_baseentity.h | 2 -- 2 files changed, 50 deletions(-) diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index ce3c5593cf1..e25431e7d62 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -5340,29 +5340,6 @@ inline int32 CLuaBaseEntity::unlockJob(lua_State *L) return 0; } -/************************************************************************ -* Function: hasJob() -* Purpose : Check to see if JOBTYPE is unlocked -* Example : player:hasJob(BRD) -* Notes : -************************************************************************/ - -inline int32 CLuaBaseEntity::hasJob(lua_State *L) -{ - TPZ_DEBUG_BREAK_IF(m_PBaseEntity == nullptr); - TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC); - TPZ_DEBUG_BREAK_IF(lua_isnil(L, 1) || !lua_isnumber(L, 1)); - - JOBTYPE JobID = (JOBTYPE)lua_tointeger(L, 1); - - TPZ_DEBUG_BREAK_IF(JobID > MAX_JOBTYPE || JobID < 0); - - CCharEntity* PChar = (CCharEntity*)m_PBaseEntity; - - lua_pushinteger(L, (PChar->jobs.unlocked >> JobID) & 1); - return 1; -} - /************************************************************************ * Function: getMainLvl() * Purpose : Returns the main level of entity's current job @@ -5395,29 +5372,6 @@ inline int32 CLuaBaseEntity::getSubLvl(lua_State *L) return 1; } -/************************************************************************ -* Function: getJobLevel() -* Purpose : Return the levle of job specified by JOBTYPE -* Example : player:getJobLevel(BRD) -* Notes : -************************************************************************/ - -inline int32 CLuaBaseEntity::getJobLevel(lua_State *L) -{ - TPZ_DEBUG_BREAK_IF(m_PBaseEntity == nullptr); - TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC); - TPZ_DEBUG_BREAK_IF(lua_isnil(L, 1) || !lua_isnumber(L, 1)); - - JOBTYPE JobID = (JOBTYPE)lua_tointeger(L, 1); - - TPZ_DEBUG_BREAK_IF(JobID > MAX_JOBTYPE || JobID < 0); - - CCharEntity* PChar = (CCharEntity*)m_PBaseEntity; - lua_pushinteger(L, PChar->jobs.job[JobID]); - - return 1; -} - /************************************************************************ * Function: setLevel() * Purpose : Updates the level of the entity's main job @@ -14343,11 +14297,9 @@ Lunar::Register_t CLuaBaseEntity::methods[] = LUNAR_DECLARE_METHOD(CLuaBaseEntity,changeJob), LUNAR_DECLARE_METHOD(CLuaBaseEntity,changesJob), LUNAR_DECLARE_METHOD(CLuaBaseEntity,unlockJob), - LUNAR_DECLARE_METHOD(CLuaBaseEntity,hasJob), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getMainLvl), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getSubLvl), - LUNAR_DECLARE_METHOD(CLuaBaseEntity,getJobLevel), LUNAR_DECLARE_METHOD(CLuaBaseEntity,setLevel), LUNAR_DECLARE_METHOD(CLuaBaseEntity,setsLevel), LUNAR_DECLARE_METHOD(CLuaBaseEntity,levelCap), diff --git a/src/map/lua/lua_baseentity.h b/src/map/lua/lua_baseentity.h index 70cd99d76e1..c2c0e5dd9b4 100644 --- a/src/map/lua/lua_baseentity.h +++ b/src/map/lua/lua_baseentity.h @@ -268,11 +268,9 @@ class CLuaBaseEntity int32 changeJob(lua_State*); // changes the job of a char (testing only!) int32 changesJob(lua_State*); // changes the sub job of a char (testing only!) int32 unlockJob(lua_State*); // Unlocks a job for the entity, sets job level to 1 - int32 hasJob(lua_State*); // Check to see if JOBTYPE is unlocked for a character int32 getMainLvl(lua_State*); // Gets Entity Main Job Level int32 getSubLvl(lua_State*); // Get Entity Sub Job Level - int32 getJobLevel(lua_State*); // Gets character job level for specified JOBTYPE int32 setLevel(lua_State*); // sets the character's level int32 setsLevel(lua_State*); // sets the character's level int32 levelCap(lua_State*); // genkai From aa998f6aa97c78f5a247c9b998df6c975774bfac Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Wed, 26 Feb 2020 09:45:58 +0200 Subject: [PATCH 020/116] Pointer formatting --- src/map/entities/battleentity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/entities/battleentity.cpp b/src/map/entities/battleentity.cpp index cb503a8973a..13b266f8ac2 100644 --- a/src/map/entities/battleentity.cpp +++ b/src/map/entities/battleentity.cpp @@ -1180,7 +1180,7 @@ void CBattleEntity::Spawn() void CBattleEntity::Die() { - if (CBaseEntity * PKiller = GetEntity(m_OwnerID.targid)) + if (CBaseEntity* PKiller = GetEntity(m_OwnerID.targid)) PAI->EventHandler.triggerListener("DEATH", this, PKiller); else PAI->EventHandler.triggerListener("DEATH", this); From c5571a006e3dc919f82c8e1cbdaa03dc42662357 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Wed, 26 Feb 2020 11:15:33 +0200 Subject: [PATCH 021/116] Clean up some warnings --- src/map/ai/controllers/trust_controller.h | 12 ++++++------ src/map/utils/petutils.cpp | 6 ++---- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/map/ai/controllers/trust_controller.h b/src/map/ai/controllers/trust_controller.h index 8be4dfa287a..309151fc7e4 100644 --- a/src/map/ai/controllers/trust_controller.h +++ b/src/map/ai/controllers/trust_controller.h @@ -31,19 +31,19 @@ class CTrustController : public CMobController { public: CTrustController(CCharEntity*, CTrustEntity*); - virtual ~CTrustController(); + ~CTrustController() override; - virtual void Tick(time_point) override; - virtual void Despawn() override; + void Tick(time_point) override; + void Despawn() override; - virtual bool Ability(uint16 targid, uint16 abilityid) override; + bool Ability(uint16 targid, uint16 abilityid) override; static constexpr float RoamDistance{ 5.5f }; static constexpr float SpawnDistance{ 12.5f }; private: - void DoCombatTick(time_point tick); - void DoRoamTick(time_point tick); + void DoCombatTick(time_point tick) override; + void DoRoamTick(time_point tick) override; }; #endif // _TRUSTCONTROLLER \ No newline at end of file diff --git a/src/map/utils/petutils.cpp b/src/map/utils/petutils.cpp index c7a425122c8..0a6b6a7db6f 100644 --- a/src/map/utils/petutils.cpp +++ b/src/map/utils/petutils.cpp @@ -338,8 +338,7 @@ namespace petutils } } - uint32 index = 0; - for (index; index < g_PTrustIDList.size(); index++) + for (uint32 index = 0; index < g_PTrustIDList.size(); index++) { QueryTrust(g_PTrustIDList.at(index)->spellID); } @@ -1878,8 +1877,7 @@ namespace petutils CTrustEntity* PTrust = new CTrustEntity(PMaster); Trust_t* trustData = new Trust_t(); - uint32 index = 0; - for (index; index < g_PTrustList.size(); index++) + for (uint32 index = 0; index < g_PTrustList.size(); index++) { if (g_PTrustList.at(index)->trustID == TrustID) { From 203b659f18ee92277de102e57a567d8d8d394984 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Wed, 26 Feb 2020 11:27:05 +0200 Subject: [PATCH 022/116] More cleanup --- src/map/ai/controllers/trust_controller.cpp | 4 +--- src/map/ai/helpers/targetfind.cpp | 17 ++++------------- src/map/entities/trustentity.cpp | 14 +------------- src/map/entities/trustentity.h | 21 +++++++++++---------- 4 files changed, 17 insertions(+), 39 deletions(-) diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index 6af11dfc6e8..aae5552279f 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -28,8 +28,6 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "../../entities/charentity.h" #include "../../entities/trustentity.h" #include "../../packets/char.h" -#include "../../../common/utils.h" -#include "../../lua/lua_baseentity.h" CTrustController::CTrustController(CCharEntity* PChar, CTrustEntity* PTrust) : CMobController(PTrust) { @@ -52,7 +50,7 @@ void CTrustController::Despawn() POwner->PMaster = nullptr; } POwner->animation = ANIMATION_DESPAWN; - CController::Despawn(); + CMobController::Despawn(); } void CTrustController::Tick(time_point tick) diff --git a/src/map/ai/helpers/targetfind.cpp b/src/map/ai/helpers/targetfind.cpp index 29b95f48dad..d145411e4ea 100644 --- a/src/map/ai/helpers/targetfind.cpp +++ b/src/map/ai/helpers/targetfind.cpp @@ -255,30 +255,21 @@ void CTargetFind::addAllInAlliance(CBattleEntity* PTarget, bool withPet) void CTargetFind::addAllInParty(CBattleEntity* PTarget, bool withPet) { - PTarget->ForParty([this, withPet](CBattleEntity* PMember) { - // add my Trust too because why not? if (PMember->objtype == TYPE_PC) { - CCharEntity* PChar = (CCharEntity*)PMember; - - if (PChar->PTrusts.size() > 0) + auto* PChar = (CCharEntity*)PMember; + for (auto trust : PChar->PTrusts) { - uint32 index = 0; - for (index; index < PChar->PTrusts.size(); index++) - { - CTrustEntity* trust = PChar->PTrusts.at(index); - CBattleEntity* PTrust = static_cast(trust); - m_targets.push_back(PTrust); - } + CBattleEntity* PTrust = static_cast(trust); + m_targets.push_back(PTrust); } } addEntity(PMember, withPet); }); - } void CTargetFind::addAllInEnmityList() diff --git a/src/map/entities/trustentity.cpp b/src/map/entities/trustentity.cpp index 2ba30a64bb2..b11d0932637 100644 --- a/src/map/entities/trustentity.cpp +++ b/src/map/entities/trustentity.cpp @@ -19,8 +19,6 @@ along with this program. If not, see http://www.gnu.org/licenses/ =========================================================================== */ -#include - #include "trustentity.h" #include "../mob_spell_container.h" #include "../mob_spell_list.h" @@ -33,10 +31,6 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "../ai/helpers/targetfind.h" #include "../ai/states/ability_state.h" #include "../utils/battleutils.h" -#include "../utils/petutils.h" -#include "../utils/mobutils.h" -#include "../../common/utils.h" -#include "../mob_modifier.h" CTrustEntity::CTrustEntity(CCharEntity* PChar) { @@ -48,10 +42,6 @@ CTrustEntity::CTrustEntity(CCharEntity* PChar) PAI = std::make_unique(this, std::make_unique(this), std::make_unique(PChar, this), std::make_unique(this)); } -CTrustEntity::~CTrustEntity() -{ -} - void CTrustEntity::PostTick() { CBattleEntity::PostTick(); @@ -94,11 +84,10 @@ void CTrustEntity::Die() { PAI->ClearStateStack(); PAI->Internal_Die(0s); - luautils::OnMobDeath(this, nullptr); CBattleEntity::Die(); if (PMaster->objtype == TYPE_PC) { - CCharEntity* PChar = (CCharEntity*)PMaster; + auto* PChar = (CCharEntity*)PMaster; PChar->RemoveTrust(this); } } @@ -108,7 +97,6 @@ void CTrustEntity::Spawn() //we need to skip CMobEntity's spawn because it calculates stats (and our stats are already calculated) CBattleEntity::Spawn(); ((CCharEntity*)PMaster)->pushPacket(new CTrustSyncPacket((CCharEntity*)PMaster, this)); - luautils::OnMobSpawn(this); } bool CTrustEntity::ValidTarget(CBattleEntity* PInitiator, uint16 targetFlags) diff --git a/src/map/entities/trustentity.h b/src/map/entities/trustentity.h index f7a4e5a8b83..d464e32a955 100644 --- a/src/map/entities/trustentity.h +++ b/src/map/entities/trustentity.h @@ -28,16 +28,17 @@ class CCharEntity; class CTrustEntity : public CMobEntity { public: - CTrustEntity(CCharEntity*); - ~CTrustEntity(); - uint32 m_TrustID; - uint16 m_PartyPosition; - - virtual void PostTick() override; - virtual void FadeOut() override; - virtual void Die() override; - virtual void Spawn() override; - virtual bool ValidTarget(CBattleEntity* PInitiator, uint16 targetFlags) override; + explicit CTrustEntity(CCharEntity*); + ~CTrustEntity() override = default; + + void PostTick() override; + void FadeOut() override; + void Die() override; + void Spawn() override; + bool ValidTarget(CBattleEntity* PInitiator, uint16 targetFlags) override; + + uint32 m_TrustID{}; + uint16 m_PartyPosition{}; }; #endif From d673054cab6681ddb79e7ad0483f1af9ece67a3f Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Wed, 26 Feb 2020 11:59:18 +0200 Subject: [PATCH 023/116] Stealing from various other branches --- src/map/ai/helpers/targetfind.cpp | 9 ++-- src/map/packet_system.cpp | 5 -- src/map/packets/entity_update.cpp | 48 ++++++++++++++--- src/map/packets/party_define.cpp | 69 ++++++++++++++++++++----- src/map/packets/party_define.h | 3 +- src/map/packets/party_member_update.cpp | 1 + src/map/packets/trust_sync.cpp | 24 +++++++-- src/map/party.cpp | 10 +++- 8 files changed, 133 insertions(+), 36 deletions(-) diff --git a/src/map/ai/helpers/targetfind.cpp b/src/map/ai/helpers/targetfind.cpp index d145411e4ea..8f7feac7511 100644 --- a/src/map/ai/helpers/targetfind.cpp +++ b/src/map/ai/helpers/targetfind.cpp @@ -116,14 +116,11 @@ void CTargetFind::findWithinArea(CBattleEntity* PTarget, AOERADIUS radiusType, f } // add my trust too, if its allowed - if (((CCharEntity*)m_PMasterTarget)->PTrusts.size() > 0) + for (auto* trust : ((CCharEntity*)m_PMasterTarget)->PTrusts) { - for (auto& trust : ((CCharEntity*)m_PMasterTarget)->PTrusts) + if (validEntity((CBattleEntity*)trust)) { - if (validEntity((CBattleEntity*)trust)) - { - m_targets.push_back((CBattleEntity*)trust); - } + m_targets.push_back((CBattleEntity*)trust); } } } diff --git a/src/map/packet_system.cpp b/src/map/packet_system.cpp index e7ff6d83993..72bfe6bc227 100644 --- a/src/map/packet_system.cpp +++ b/src/map/packet_system.cpp @@ -643,13 +643,8 @@ void SmallPacket0x01A(map_session_data_t* session, CCharEntity* PChar, CBasicPac CBaseEntity* PTrust = PChar->GetEntity(TargID, TYPE_TRUST); if (PTrust != nullptr) { - printf("PTrust not null"); PChar->RemoveTrust((CTrustEntity*)PTrust); } - else - { - printf("PTrust is null"); - } if (PChar->m_event.EventID == -1) { diff --git a/src/map/packets/entity_update.cpp b/src/map/packets/entity_update.cpp index e9187a3498a..6f601defbf2 100644 --- a/src/map/packets/entity_update.cpp +++ b/src/map/packets/entity_update.cpp @@ -28,6 +28,7 @@ #include "../entities/baseentity.h" #include "../entities/mobentity.h" +#include "../entities/trustentity.h" #include "../entities/npcentity.h" #include "../entities/petentity.h" #include "../status_effect_container.h" @@ -109,7 +110,6 @@ CEntityUpdatePacket::CEntityUpdatePacket(CBaseEntity* PEntity, ENTITYUPDATE type break; case TYPE_MOB: case TYPE_PET: - case TYPE_TRUST: { CMobEntity* PMob = (CMobEntity*)PEntity; @@ -157,6 +157,42 @@ CEntityUpdatePacket::CEntityUpdatePacket(CBaseEntity* PEntity, ENTITYUPDATE type } } break; + case TYPE_TRUST: + { + CTrustEntity* PMob = (CTrustEntity*)PEntity; + { + if (updatemask & UPDATE_HP) + { + ref(0x1E) = PMob->GetHPP(); + ref(0x1F) = PEntity->animation; + ref(0x2A) |= PEntity->animationsub; + ref(0x25) = PMob->health.hp > 0 ? 0x08 : 0; + ref(0x27) = PMob->m_name_prefix; + if (PMob->PMaster != nullptr && PMob->PMaster->objtype == TYPE_PC) + ref(0x27) |= 0x08; + ref(0x28) |= (PMob->StatusEffectContainer->HasStatusEffect(EFFECT_TERROR) ? 0x10 : 0x00); + ref(0x28) |= PMob->health.hp > 0 && PMob->animation == ANIMATION_DEATH ? 0x08 : 0; + ref(0x29) = PEntity->allegiance; + ref(0x2B) = PEntity->namevis; + } + if (updatemask & UPDATE_STATUS) + { + ref(0x2C) = PMob->m_OwnerID.id; + } + } + if (updatemask & UPDATE_NAME) + { + //depending on size of name, this can be 0x20, 0x22, or 0x24 + this->size = 0x24; + if (PMob->packetName.empty()) + { + memcpy(data + (0x34), PEntity->GetName(), std::min(PEntity->name.size(), PacketNameLength)); + } + else + memcpy(data + (0x34), PMob->packetName.c_str(), std::min(PMob->packetName.size(), PacketNameLength)); + } + } + break; default: { break; @@ -166,11 +202,11 @@ CEntityUpdatePacket::CEntityUpdatePacket(CBaseEntity* PEntity, ENTITYUPDATE type // TODO: Read from the trust model itself if (PEntity->objtype == TYPE_TRUST) { - ref(0x21) = 0x21b; - ref(0x2B) = 0x06; - ref(0x2A) = 0x08; - ref(0x25) = 0x0f; - ref(0x27) = 0x28; + //ref(0x21) = 0x21b; + //ref(0x2B) = 0x06; + //ref(0x2A) = 0x08; + //ref(0x25) = 0x0f; + //ref(0x27) = 0x28; ref(0x28) = 0x45; } diff --git a/src/map/packets/party_define.cpp b/src/map/packets/party_define.cpp index b63558fbe03..020158c1eef 100644 --- a/src/map/packets/party_define.cpp +++ b/src/map/packets/party_define.cpp @@ -25,10 +25,11 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "../entities/charentity.h" #include "../entities/trustentity.h" -#include "../party.h" -#include "../alliance.h" #include "../utils/zoneutils.h" +const char* msg = "SELECT chars.charid, partyflag, pos_zone, pos_prevzone FROM accounts_parties \ + LEFT JOIN chars ON accounts_parties.charid = chars.charid WHERE \ + IF (allianceid <> 0, allianceid = %d, partyid = %d) ORDER BY partyflag & %u, timestamp;"; CPartyDefinePacket::CPartyDefinePacket(CParty* PParty) { @@ -45,10 +46,8 @@ CPartyDefinePacket::CPartyDefinePacket(CParty* PParty) uint8 i = 0; - int ret = Sql_Query(SqlHandle, "SELECT chars.charid, partyflag, pos_zone, pos_prevzone FROM accounts_parties \ - LEFT JOIN chars ON accounts_parties.charid = chars.charid WHERE \ - IF (allianceid <> 0, allianceid = %d, partyid = %d) ORDER BY partyflag & %u, timestamp;", - allianceid, PParty->GetPartyID(), PARTY_SECOND | PARTY_THIRD); + int ret = Sql_Query(SqlHandle, msg, allianceid, PParty->GetPartyID(), PARTY_SECOND | PARTY_THIRD); + if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) > 0) { while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) @@ -63,18 +62,62 @@ CPartyDefinePacket::CPartyDefinePacket(CParty* PParty) i++; } } + } +} + +CPartyDefinePacket::CPartyDefinePacket(CParty* PParty, bool loadTrust) +{ + this->type = 0xC8; + this->size = 0x7C; + + if (PParty) + { + uint32 allianceid = 0; + if (PParty->m_PAlliance) + { + allianceid = PParty->m_PAlliance->m_AllianceID; + } - if (PParty->GetLeader() != nullptr && PParty->GetLeader()->objtype == TYPE_PC) + uint8 i = 0; + + int ret = Sql_Query(SqlHandle, msg, allianceid, PParty->GetPartyID(), PARTY_SECOND | PARTY_THIRD); + + if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) > 0) { - CCharEntity* PLeader = (CCharEntity*)PParty->GetLeader(); - for (auto PTrust : PLeader->PTrusts) + while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) { - ref(12 * i + (0x08)) = PTrust->id; - ref(12 * i + (0x0C)) = PTrust->targid; - ref(12 * i + (0x0E)) = 0; - ref(12 * i + (0x10)) = PTrust->getZone(); + uint16 targid = 0; + CCharEntity* PChar = zoneutils::GetChar(Sql_GetUIntData(SqlHandle, 0)); + if (PChar) targid = PChar->targid; + ref(12 * i + 0x08) = Sql_GetUIntData(SqlHandle, 0); + ref(12 * i + 0x0C) = targid; + ref(12 * i + 0x0E) = Sql_GetUIntData(SqlHandle, 1); + ref(12 * i + 0x10) = Sql_GetUIntData(SqlHandle, 2) ? Sql_GetUIntData(SqlHandle, 2) : Sql_GetUIntData(SqlHandle, 3); i++; } } + + ret = Sql_Query(SqlHandle, msg, allianceid, PParty->GetPartyID(), PARTY_SECOND | PARTY_THIRD); + + if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) > 0) + { + while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) + { + CCharEntity* PChar = zoneutils::GetChar(Sql_GetUIntData(SqlHandle, 0)); + CCharEntity* PLeader = (CCharEntity*)PParty->GetLeader(); + + if (PParty->GetLeader() != nullptr && PParty->GetLeader()->objtype == TYPE_PC) + { + for (auto PTrust : PLeader->PTrusts) + { + ref(12 * i + (0x08)) = PTrust->id; + ref(12 * i + (0x0C)) = PTrust->targid; + ref(12 * i + (0x0E)) = 0; + ref(12 * i + (0x10)) = PTrust->getZone(); + i++; + } + } + } + } } } \ No newline at end of file diff --git a/src/map/packets/party_define.h b/src/map/packets/party_define.h index 737f6313718..d8468263933 100644 --- a/src/map/packets/party_define.h +++ b/src/map/packets/party_define.h @@ -38,7 +38,8 @@ class CPartyDefinePacket : public CBasicPacket { public: - CPartyDefinePacket(CParty* PParty); + CPartyDefinePacket(CParty* PParty); + CPartyDefinePacket(CParty* PParty, bool loadTrust); }; #endif \ No newline at end of file diff --git a/src/map/packets/party_member_update.cpp b/src/map/packets/party_member_update.cpp index dc9334dab55..c80b271e611 100644 --- a/src/map/packets/party_member_update.cpp +++ b/src/map/packets/party_member_update.cpp @@ -92,6 +92,7 @@ CPartyMemberUpdatePacket::CPartyMemberUpdatePacket(CTrustEntity* PTrust, uint8 M memcpy(data + (0x26), PTrust->GetName(), PTrust->name.size()); } + CPartyMemberUpdatePacket::CPartyMemberUpdatePacket(uint32 id, const int8* name, uint16 memberFlags, uint8 MemberNumber, uint16 ZoneID) { diff --git a/src/map/packets/trust_sync.cpp b/src/map/packets/trust_sync.cpp index f46f3fd7efc..fcfa0282e8c 100644 --- a/src/map/packets/trust_sync.cpp +++ b/src/map/packets/trust_sync.cpp @@ -19,6 +19,7 @@ along with this program. If not, see http://www.gnu.org/licenses/ =========================================================================== */ #include "../../common/socket.h" +#include "../../common/utils.h" #include "trust_sync.h" @@ -36,13 +37,28 @@ CTrustSyncPacket::CTrustSyncPacket(CCharEntity* PChar, CTrustEntity* PTrust) // 67 0C 58 00 03 05 F4 07 F4 28 08 01 00 04 00 00 // 04 00 00 00 00 00 00 00 - ref(0x04) = 0x03; - ref(0x05) = 0x05; + if (PTrust->PMaster && PTrust->PMaster->id == PChar->id) + { + ref(0x04) = 0x03; + ref(0x05) = 0x05; + } ref(0x06) = PTrust->targid; ref(0x08) = PTrust->id; - ref(0x0C) = PChar->targid; + + if (PTrust) + { + this->size = 0x16; + packBitsBE(data + (0x04), (0x18) + PTrust->name.size(), 0, 6, 10); // Message Size + + if(PChar) + { + ref(0x0C) = PChar->targid; + } + + memcpy(data + (0x18), PTrust->GetName(), PTrust->name.size()); + } // Unknown - ref(0x10) = 0x04; + //ref(0x10) = 0x04; } diff --git a/src/map/party.cpp b/src/map/party.cpp index 7de1a60a0e5..2db25bf59a9 100644 --- a/src/map/party.cpp +++ b/src/map/party.cpp @@ -733,6 +733,7 @@ void CParty::ReloadParty() else { RefreshFlags(info); + CBattleEntity* PLeader = GetLeader(); //regular party for (uint8 i = 0; i < members.size(); ++i) { @@ -742,7 +743,14 @@ void CParty::ReloadParty() PChar->PLatentEffectContainer->CheckLatentsPartyMembers(members.size()); PChar->PLatentEffectContainer->CheckLatentsPartyAvatar(); PChar->ReloadPartyDec(); - PChar->pushPacket(new CPartyDefinePacket(this)); + if (PChar->loc.zone->GetID() == PLeader->loc.zone->GetID()) + { + PChar->pushPacket(new CPartyDefinePacket(this, true)); + } + else + { + PChar->pushPacket(new CPartyDefinePacket(this)); + } //auto effects = std::make_unique(); uint8 j = 0; for (auto&& memberinfo : info) From 59d314619e884171a59a624cd38d8cd6a34b461a Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 28 Feb 2020 11:17:03 +0200 Subject: [PATCH 024/116] Shrink entity update --- src/map/packets/entity_update.cpp | 50 +------------------------------ src/map/zone.cpp | 1 + 2 files changed, 2 insertions(+), 49 deletions(-) diff --git a/src/map/packets/entity_update.cpp b/src/map/packets/entity_update.cpp index 6f601defbf2..7418db112e4 100644 --- a/src/map/packets/entity_update.cpp +++ b/src/map/packets/entity_update.cpp @@ -110,21 +110,9 @@ CEntityUpdatePacket::CEntityUpdatePacket(CBaseEntity* PEntity, ENTITYUPDATE type break; case TYPE_MOB: case TYPE_PET: + case TYPE_TRUST: { CMobEntity* PMob = (CMobEntity*)PEntity; - - //if(PMob->PMaster != nullptr && PMob->PMaster->objtype == TYPE_PC && - // PMob->PBattleAI->GetCurrentAction() == ACTION_FALL) - //{ - // ref(data,(0x21)) = 0x99; - // //ref (data,(0x27)) = 0x28; - // ref(data,(0x1E)) = 0x00; //0% HP - // ref(data,(0x1F)) = ANIMATION_DEATH; //death anim - // ref(data,(0x20)) = STATUS_NORMAL; - // ref(data,(0x29)) = PEntity->allegiance; - // ref(data,(0x2B)) = PEntity->namevis; - //} - //else { if (updatemask & UPDATE_HP) { @@ -157,42 +145,6 @@ CEntityUpdatePacket::CEntityUpdatePacket(CBaseEntity* PEntity, ENTITYUPDATE type } } break; - case TYPE_TRUST: - { - CTrustEntity* PMob = (CTrustEntity*)PEntity; - { - if (updatemask & UPDATE_HP) - { - ref(0x1E) = PMob->GetHPP(); - ref(0x1F) = PEntity->animation; - ref(0x2A) |= PEntity->animationsub; - ref(0x25) = PMob->health.hp > 0 ? 0x08 : 0; - ref(0x27) = PMob->m_name_prefix; - if (PMob->PMaster != nullptr && PMob->PMaster->objtype == TYPE_PC) - ref(0x27) |= 0x08; - ref(0x28) |= (PMob->StatusEffectContainer->HasStatusEffect(EFFECT_TERROR) ? 0x10 : 0x00); - ref(0x28) |= PMob->health.hp > 0 && PMob->animation == ANIMATION_DEATH ? 0x08 : 0; - ref(0x29) = PEntity->allegiance; - ref(0x2B) = PEntity->namevis; - } - if (updatemask & UPDATE_STATUS) - { - ref(0x2C) = PMob->m_OwnerID.id; - } - } - if (updatemask & UPDATE_NAME) - { - //depending on size of name, this can be 0x20, 0x22, or 0x24 - this->size = 0x24; - if (PMob->packetName.empty()) - { - memcpy(data + (0x34), PEntity->GetName(), std::min(PEntity->name.size(), PacketNameLength)); - } - else - memcpy(data + (0x34), PMob->packetName.c_str(), std::min(PMob->packetName.size(), PacketNameLength)); - } - } - break; default: { break; diff --git a/src/map/zone.cpp b/src/map/zone.cpp index 7a70665613c..031937df335 100644 --- a/src/map/zone.cpp +++ b/src/map/zone.cpp @@ -983,6 +983,7 @@ void CZone::CharZoneOut(CCharEntity* PChar) PChar->SpawnNPCList.clear(); PChar->SpawnMOBList.clear(); PChar->SpawnPETList.clear(); + PChar->SpawnTRUSTList.clear(); if (PChar->PParty && PChar->loc.destination != 0 && PChar->m_moghouseID == 0) { From a0a81ed1a4e96e90b52fa30afc42d4a5029b932f Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 28 Feb 2020 23:32:21 +0200 Subject: [PATCH 025/116] More trust related items --- scripts/globals/spells/cure.lua | 2 +- scripts/globals/status.lua | 1 + src/map/ai/controllers/mob_controller.cpp | 2 +- src/map/ai/states/magic_state.cpp | 2 +- src/map/packet_system.cpp | 9 ++++++++- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/globals/spells/cure.lua b/scripts/globals/spells/cure.lua index 53d3b05ac3f..3604bf3f07a 100644 --- a/scripts/globals/spells/cure.lua +++ b/scripts/globals/spells/cure.lua @@ -62,7 +62,7 @@ function onSpellCast(caster,target,spell) end end - if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == tpz.objType.PC or target:getObjType() == tpz.objType.MOB)) then + if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == tpz.objType.PC or target:getObjType() == tpz.objType.MOB or target:getObjType() == tpz.objType.TRUST)) then if (USE_OLD_CURE_FORMULA == true) then basecure = getBaseCureOld(power,divisor,constant) else diff --git a/scripts/globals/status.lua b/scripts/globals/status.lua index 783cd9334c9..6bafa827ad7 100644 --- a/scripts/globals/status.lua +++ b/scripts/globals/status.lua @@ -2107,6 +2107,7 @@ tpz.objType = MOB = 0x04, PET = 0x08, SHIP = 0x10, + TRUST = 0x20, } ---------------------------------- diff --git a/src/map/ai/controllers/mob_controller.cpp b/src/map/ai/controllers/mob_controller.cpp index 163879d1443..b692ebdbb00 100644 --- a/src/map/ai/controllers/mob_controller.cpp +++ b/src/map/ai/controllers/mob_controller.cpp @@ -675,7 +675,7 @@ void CMobController::DoRoamTick(time_point tick) else if (PMob->m_OwnerID.id != 0 && !(PMob->m_roamFlags & ROAMFLAG_IGNORE)) { // i'm claimed by someone and need hate towards this person - PTarget = (CBattleEntity*)PMob->GetEntity(PMob->m_OwnerID.targid, TYPE_PC | TYPE_MOB | TYPE_PET); + PTarget = (CBattleEntity*)PMob->GetEntity(PMob->m_OwnerID.targid, TYPE_PC | TYPE_MOB | TYPE_PET | TYPE_TRUST); PMob->PEnmityContainer->AddBaseEnmity(PTarget); diff --git a/src/map/ai/states/magic_state.cpp b/src/map/ai/states/magic_state.cpp index ee1c539d984..70b9a1260cc 100644 --- a/src/map/ai/states/magic_state.cpp +++ b/src/map/ai/states/magic_state.cpp @@ -96,7 +96,7 @@ bool CMagicState::Update(time_point tick) action_t action; - if (!PTarget || m_errorMsg || (HasMoved() && (m_PEntity->objtype != TYPE_PET || + if (!PTarget || m_errorMsg || (HasMoved() && (m_PEntity->objtype != TYPE_PET || m_PEntity->objtype != TYPE_TRUST || static_cast(m_PEntity)->getPetType() != PETTYPE_AUTOMATON)) || !CanCastSpell(PTarget)) { m_interrupted = true; diff --git a/src/map/packet_system.cpp b/src/map/packet_system.cpp index 72bfe6bc227..b6edd735cbe 100644 --- a/src/map/packet_system.cpp +++ b/src/map/packet_system.cpp @@ -374,6 +374,11 @@ void SmallPacket0x00D(map_session_data_t* session, CCharEntity* PChar, CBasicPac PChar->updatemask |= UPDATE_HP; } + if (!PChar->PTrusts.empty()) + { + PChar->ClearTrusts(); + } + if (PChar->status == STATUS_SHUTDOWN) { if (PChar->PParty != nullptr) @@ -540,6 +545,7 @@ void SmallPacket0x015(map_session_data_t* session, CCharEntity* PChar, CBasicPac PChar->loc.zone->SpawnMOBs(PChar); PChar->loc.zone->SpawnPETs(PChar); + PChar->loc.zone->SpawnTRUSTs(PChar); if (PChar->PWideScanTarget != nullptr) { @@ -809,6 +815,7 @@ void SmallPacket0x01A(map_session_data_t* session, CCharEntity* PChar, CBasicPac PChar->loc.zone->SpawnPCs(PChar); PChar->loc.zone->SpawnNPCs(PChar); PChar->loc.zone->SpawnMOBs(PChar); + PChar->loc.zone->SpawnTRUSTs(PChar); } } break; @@ -3553,7 +3560,7 @@ void SmallPacket0x076(map_session_data_t* session, CCharEntity* PChar, CBasicPac else { //previous CPartyDefine was dropped or otherwise didn't work? - PChar->pushPacket(new CPartyDefinePacket(nullptr)); + PChar->pushPacket(new CPartyDefinePacket(nullptr, false)); } return; } From 374fb9ea33f0f9117cda1929995852bc8d7ab015 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 29 Feb 2020 12:23:37 +0200 Subject: [PATCH 026/116] Another tweak --- src/map/ai/helpers/targetfind.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/map/ai/helpers/targetfind.cpp b/src/map/ai/helpers/targetfind.cpp index 8f7feac7511..62064a672b8 100644 --- a/src/map/ai/helpers/targetfind.cpp +++ b/src/map/ai/helpers/targetfind.cpp @@ -498,6 +498,11 @@ CBattleEntity* CTargetFind::getValidTarget(uint16 actionTargetID, uint16 validTa return m_PBattleEntity->PPet; } + if (PTarget->objtype == TYPE_TRUST) + { + return PTarget; + } + if (validTargetFlags & TARGET_PLAYER_PARTY) { if (PTarget->objtype == TYPE_TRUST) From 95e40f8693b246445ca06436b55997324b5e4998 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 14 Mar 2020 19:27:51 +0200 Subject: [PATCH 027/116] Review: Move all trust onMagicCastingCheck and onSpellCast logic to trust global, clean out trust spell scripts --- .../globals/spells/trust/ajido-marujido.lua | 12 +--- scripts/globals/spells/trust/aldo.lua | 12 +--- scripts/globals/spells/trust/areuhat.lua | 12 +--- scripts/globals/spells/trust/ayame.lua | 12 +--- scripts/globals/spells/trust/cherukiki.lua | 12 +--- scripts/globals/spells/trust/cid.lua | 12 +--- scripts/globals/spells/trust/curilla.lua | 12 +--- scripts/globals/spells/trust/d_shantotto.lua | 12 +--- scripts/globals/spells/trust/elivira.lua | 12 +--- scripts/globals/spells/trust/excenmille.lua | 12 +--- scripts/globals/spells/trust/fablinix.lua | 12 +--- .../globals/spells/trust/ferreous_coffin.lua | 12 +--- scripts/globals/spells/trust/gadalar.lua | 12 +--- scripts/globals/spells/trust/gessho.lua | 12 +--- scripts/globals/spells/trust/gilgamesh.lua | 12 +--- scripts/globals/spells/trust/ingrid.lua | 12 +--- scripts/globals/spells/trust/iron_eater.lua | 12 +--- scripts/globals/spells/trust/joachim.lua | 12 +--- .../globals/spells/trust/karaha-baruha.lua | 12 +--- scripts/globals/spells/trust/kupipi.lua | 12 +--- .../globals/spells/trust/lehko_habhoka.lua | 12 +--- .../globals/spells/trust/lhu_mhakaracca.lua | 12 +--- scripts/globals/spells/trust/lilisette.lua | 12 +--- scripts/globals/spells/trust/lion.lua | 12 +--- scripts/globals/spells/trust/luzaf.lua | 16 ++--- scripts/globals/spells/trust/maat.lua | 12 +--- .../globals/spells/trust/mihli_aliapoh.lua | 12 +--- scripts/globals/spells/trust/mnejing.lua | 12 +--- scripts/globals/spells/trust/moogle.lua | 12 +--- scripts/globals/spells/trust/mumor.lua | 12 +--- .../globals/spells/trust/naja_salaheem.lua | 12 +--- scripts/globals/spells/trust/najelith.lua | 12 +--- scripts/globals/spells/trust/naji.lua | 16 ++--- scripts/globals/spells/trust/nanaa_mihgo.lua | 12 +--- scripts/globals/spells/trust/nashmeira.lua | 12 +--- scripts/globals/spells/trust/noillurie.lua | 12 +--- scripts/globals/spells/trust/ovjang.lua | 12 +--- scripts/globals/spells/trust/prishe.lua | 12 +--- scripts/globals/spells/trust/rainemard.lua | 12 +--- scripts/globals/spells/trust/sakura.lua | 12 +--- .../globals/spells/trust/semih_lafihna.lua | 12 +--- scripts/globals/spells/trust/shantotto.lua | 12 +--- scripts/globals/spells/trust/shantotto_ii.lua | 12 +--- scripts/globals/spells/trust/shikaree_z.lua | 12 +--- scripts/globals/spells/trust/star_sibyl.lua | 12 +--- scripts/globals/spells/trust/tenzen.lua | 12 +--- scripts/globals/spells/trust/trion.lua | 12 +--- scripts/globals/spells/trust/ulmia.lua | 12 +--- scripts/globals/spells/trust/valaineral.lua | 12 +--- scripts/globals/spells/trust/volker.lua | 12 +--- scripts/globals/spells/trust/zazarg.lua | 12 +--- scripts/globals/spells/trust/zeid.lua | 12 +--- scripts/globals/trust.lua | 62 ++++++++++++++++++- 53 files changed, 221 insertions(+), 473 deletions(-) diff --git a/scripts/globals/spells/trust/ajido-marujido.lua b/scripts/globals/spells/trust/ajido-marujido.lua index 93fab3c84f8..96f36b2fab5 100644 --- a/scripts/globals/spells/trust/ajido-marujido.lua +++ b/scripts/globals/spells/trust/ajido-marujido.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Ajido-Marujido ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(904) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/aldo.lua b/scripts/globals/spells/trust/aldo.lua index ae5506cb83c..25348f2c236 100644 --- a/scripts/globals/spells/trust/aldo.lua +++ b/scripts/globals/spells/trust/aldo.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Aldo ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(930) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/areuhat.lua b/scripts/globals/spells/trust/areuhat.lua index 724b66a931f..b2021778fbd 100644 --- a/scripts/globals/spells/trust/areuhat.lua +++ b/scripts/globals/spells/trust/areuhat.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Areuhat ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(939) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/ayame.lua b/scripts/globals/spells/trust/ayame.lua index c2726362232..ca13b853100 100644 --- a/scripts/globals/spells/trust/ayame.lua +++ b/scripts/globals/spells/trust/ayame.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Ayame ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(900) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/cherukiki.lua b/scripts/globals/spells/trust/cherukiki.lua index aeb5128dc47..f186caf3149 100644 --- a/scripts/globals/spells/trust/cherukiki.lua +++ b/scripts/globals/spells/trust/cherukiki.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Cherukiki ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(916) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/cid.lua b/scripts/globals/spells/trust/cid.lua index 3af1cac9680..7300b1b9313 100644 --- a/scripts/globals/spells/trust/cid.lua +++ b/scripts/globals/spells/trust/cid.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Cid ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(937) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/curilla.lua b/scripts/globals/spells/trust/curilla.lua index 0415467ea9d..db1eaf1c7f7 100644 --- a/scripts/globals/spells/trust/curilla.lua +++ b/scripts/globals/spells/trust/curilla.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Curilla ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(902) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/d_shantotto.lua b/scripts/globals/spells/trust/d_shantotto.lua index e7917c2bb53..749f905a3ac 100644 --- a/scripts/globals/spells/trust/d_shantotto.lua +++ b/scripts/globals/spells/trust/d_shantotto.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: D Shantotto ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell, {896, 1019}) end function onSpellCast(caster, target, spell) - caster:spawnTrust(934) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/elivira.lua b/scripts/globals/spells/trust/elivira.lua index b691e6fbe62..9525040780b 100644 --- a/scripts/globals/spells/trust/elivira.lua +++ b/scripts/globals/spells/trust/elivira.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Elivira ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(941) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/excenmille.lua b/scripts/globals/spells/trust/excenmille.lua index dc3f3a17ab9..638e53ee679 100644 --- a/scripts/globals/spells/trust/excenmille.lua +++ b/scripts/globals/spells/trust/excenmille.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Excenmille ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(899) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/fablinix.lua b/scripts/globals/spells/trust/fablinix.lua index 39b10c03a89..f4439f064d9 100644 --- a/scripts/globals/spells/trust/fablinix.lua +++ b/scripts/globals/spells/trust/fablinix.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Fablinix ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(932) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/ferreous_coffin.lua b/scripts/globals/spells/trust/ferreous_coffin.lua index c91dffe6e81..9bcb9c8b06f 100644 --- a/scripts/globals/spells/trust/ferreous_coffin.lua +++ b/scripts/globals/spells/trust/ferreous_coffin.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Ferreous Coffin ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(944) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/gadalar.lua b/scripts/globals/spells/trust/gadalar.lua index 4fc82c107d1..7f4c01616ec 100644 --- a/scripts/globals/spells/trust/gadalar.lua +++ b/scripts/globals/spells/trust/gadalar.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Gadalar ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(919) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/gessho.lua b/scripts/globals/spells/trust/gessho.lua index 31c8cbbc8a3..461987dfae8 100644 --- a/scripts/globals/spells/trust/gessho.lua +++ b/scripts/globals/spells/trust/gessho.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Gessho ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(918) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/gilgamesh.lua b/scripts/globals/spells/trust/gilgamesh.lua index 80d736e9e87..b902251e16b 100644 --- a/scripts/globals/spells/trust/gilgamesh.lua +++ b/scripts/globals/spells/trust/gilgamesh.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Gilgamesh ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(938) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/ingrid.lua b/scripts/globals/spells/trust/ingrid.lua index 35a431de764..090bc061dfe 100644 --- a/scripts/globals/spells/trust/ingrid.lua +++ b/scripts/globals/spells/trust/ingrid.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Ingrid ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(921) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/iron_eater.lua b/scripts/globals/spells/trust/iron_eater.lua index 137583b117e..a659ce63c16 100644 --- a/scripts/globals/spells/trust/iron_eater.lua +++ b/scripts/globals/spells/trust/iron_eater.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Iron Eater ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(917) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/joachim.lua b/scripts/globals/spells/trust/joachim.lua index a22b4ac80ad..9e8060be9f4 100644 --- a/scripts/globals/spells/trust/joachim.lua +++ b/scripts/globals/spells/trust/joachim.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Joachim ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(911) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/karaha-baruha.lua b/scripts/globals/spells/trust/karaha-baruha.lua index c4b2aeb70f7..d92d80e22a5 100644 --- a/scripts/globals/spells/trust/karaha-baruha.lua +++ b/scripts/globals/spells/trust/karaha-baruha.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Karaha-Baruha ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(936) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/kupipi.lua b/scripts/globals/spells/trust/kupipi.lua index 6522602f13e..d594dcca01b 100644 --- a/scripts/globals/spells/trust/kupipi.lua +++ b/scripts/globals/spells/trust/kupipi.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Kupipi ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(898) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/lehko_habhoka.lua b/scripts/globals/spells/trust/lehko_habhoka.lua index e35777be4f7..1cabfb9867b 100644 --- a/scripts/globals/spells/trust/lehko_habhoka.lua +++ b/scripts/globals/spells/trust/lehko_habhoka.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Lehko Habhoka ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(922) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/lhu_mhakaracca.lua b/scripts/globals/spells/trust/lhu_mhakaracca.lua index 5a0c71a2f27..2b50270a730 100644 --- a/scripts/globals/spells/trust/lhu_mhakaracca.lua +++ b/scripts/globals/spells/trust/lhu_mhakaracca.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Lhu Mhakaracca ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(943) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/lilisette.lua b/scripts/globals/spells/trust/lilisette.lua index b4f5dd119e1..107919797c5 100644 --- a/scripts/globals/spells/trust/lilisette.lua +++ b/scripts/globals/spells/trust/lilisette.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: lilisette ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(945) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/lion.lua b/scripts/globals/spells/trust/lion.lua index c12424c6643..1d51e7b792e 100644 --- a/scripts/globals/spells/trust/lion.lua +++ b/scripts/globals/spells/trust/lion.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Lion ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(907) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/luzaf.lua b/scripts/globals/spells/trust/luzaf.lua index c2c811419bf..0b17f0a7008 100644 --- a/scripts/globals/spells/trust/luzaf.lua +++ b/scripts/globals/spells/trust/luzaf.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Luzaf ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 +function onMagicCastingCheck(caster, target, spell) + tpz.trust.canCast(caster, spell) end -function onSpellCast(caster,target,spell) - caster:spawnTrust(928) - return 0 +function onSpellCast(caster, target, spell) + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/maat.lua b/scripts/globals/spells/trust/maat.lua index 384dcd9533b..40ffa7733be 100644 --- a/scripts/globals/spells/trust/maat.lua +++ b/scripts/globals/spells/trust/maat.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Maat ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(933) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/mihli_aliapoh.lua b/scripts/globals/spells/trust/mihli_aliapoh.lua index 107f27cf3c2..257cfafa22c 100644 --- a/scripts/globals/spells/trust/mihli_aliapoh.lua +++ b/scripts/globals/spells/trust/mihli_aliapoh.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Mihli Aliapoh ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(909) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/mnejing.lua b/scripts/globals/spells/trust/mnejing.lua index 70216d96ca1..061f82c4e27 100644 --- a/scripts/globals/spells/trust/mnejing.lua +++ b/scripts/globals/spells/trust/mnejing.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Mnejing ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(926) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/moogle.lua b/scripts/globals/spells/trust/moogle.lua index b112ebfb158..5c79b0ec77a 100644 --- a/scripts/globals/spells/trust/moogle.lua +++ b/scripts/globals/spells/trust/moogle.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Moogle ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(931) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/mumor.lua b/scripts/globals/spells/trust/mumor.lua index 5cb7fc8d940..a1ea27cbc7c 100644 --- a/scripts/globals/spells/trust/mumor.lua +++ b/scripts/globals/spells/trust/mumor.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Mumor ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(946) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/naja_salaheem.lua b/scripts/globals/spells/trust/naja_salaheem.lua index c7c61e30402..1fd9951db64 100644 --- a/scripts/globals/spells/trust/naja_salaheem.lua +++ b/scripts/globals/spells/trust/naja_salaheem.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Naja Salaheem ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(912) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/najelith.lua b/scripts/globals/spells/trust/najelith.lua index 33d4634580d..311a39caa4c 100644 --- a/scripts/globals/spells/trust/najelith.lua +++ b/scripts/globals/spells/trust/najelith.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Najelith ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(929) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/naji.lua b/scripts/globals/spells/trust/naji.lua index 86fe20edd08..b20e1afccb0 100644 --- a/scripts/globals/spells/trust/naji.lua +++ b/scripts/globals/spells/trust/naji.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Naji ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- -function onMagicCastingCheck(caster,target,spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 +function onMagicCastingCheck(caster, target, spell) + tpz.trust.canCast(caster, spell) end -function onSpellCast(caster,target,spell) - caster:spawnTrust(897) - return 0 +function onSpellCast(caster, target, spell) + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/nanaa_mihgo.lua b/scripts/globals/spells/trust/nanaa_mihgo.lua index 576611b0d83..147ad81385e 100644 --- a/scripts/globals/spells/trust/nanaa_mihgo.lua +++ b/scripts/globals/spells/trust/nanaa_mihgo.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Nanaa Mihgo ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(901) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/nashmeira.lua b/scripts/globals/spells/trust/nashmeira.lua index a0b692b8f69..23f7363de63 100644 --- a/scripts/globals/spells/trust/nashmeira.lua +++ b/scripts/globals/spells/trust/nashmeira.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Nashmeira ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(923) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/noillurie.lua b/scripts/globals/spells/trust/noillurie.lua index f0a57dcc7e1..a9a00024cd3 100644 --- a/scripts/globals/spells/trust/noillurie.lua +++ b/scripts/globals/spells/trust/noillurie.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Noillurie ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(942) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/ovjang.lua b/scripts/globals/spells/trust/ovjang.lua index 1a0d97387d0..73905e89966 100644 --- a/scripts/globals/spells/trust/ovjang.lua +++ b/scripts/globals/spells/trust/ovjang.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Ovjang ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(925) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/prishe.lua b/scripts/globals/spells/trust/prishe.lua index 38ce60e6c58..488ddf7cd9a 100644 --- a/scripts/globals/spells/trust/prishe.lua +++ b/scripts/globals/spells/trust/prishe.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Prishe ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(913) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/rainemard.lua b/scripts/globals/spells/trust/rainemard.lua index ae7c603f50f..2880826a698 100644 --- a/scripts/globals/spells/trust/rainemard.lua +++ b/scripts/globals/spells/trust/rainemard.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Rainemard ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(920) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/sakura.lua b/scripts/globals/spells/trust/sakura.lua index d4be5bdccf6..e091afd105a 100644 --- a/scripts/globals/spells/trust/sakura.lua +++ b/scripts/globals/spells/trust/sakura.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Sakura ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(927) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/semih_lafihna.lua b/scripts/globals/spells/trust/semih_lafihna.lua index 2d2885fa1a4..52beee9d65f 100644 --- a/scripts/globals/spells/trust/semih_lafihna.lua +++ b/scripts/globals/spells/trust/semih_lafihna.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Semih Lafihna ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(940) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index a13d8eb28df..8698fb8cc70 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Shantotto ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell, {934, 1019}) end function onSpellCast(caster, target, spell) - caster:spawnTrust(896) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/shantotto_ii.lua b/scripts/globals/spells/trust/shantotto_ii.lua index 1fc878a50f9..14f6b09cba2 100644 --- a/scripts/globals/spells/trust/shantotto_ii.lua +++ b/scripts/globals/spells/trust/shantotto_ii.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Shantotto II ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell, {896, 934}) end function onSpellCast(caster, target, spell) - caster:spawnTrust(1019) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/shikaree_z.lua b/scripts/globals/spells/trust/shikaree_z.lua index ca4f372c245..34aea3c9b0f 100644 --- a/scripts/globals/spells/trust/shikaree_z.lua +++ b/scripts/globals/spells/trust/shikaree_z.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Shikaree Z ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(915) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/star_sibyl.lua b/scripts/globals/spells/trust/star_sibyl.lua index 5dd417cb4e2..4688cd65c86 100644 --- a/scripts/globals/spells/trust/star_sibyl.lua +++ b/scripts/globals/spells/trust/star_sibyl.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Star Sibyl ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(935) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/tenzen.lua b/scripts/globals/spells/trust/tenzen.lua index 8421664b387..79454791ebe 100644 --- a/scripts/globals/spells/trust/tenzen.lua +++ b/scripts/globals/spells/trust/tenzen.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Tenzen ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(908) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/trion.lua b/scripts/globals/spells/trust/trion.lua index 5f8513f53a2..e1b667c6fc4 100644 --- a/scripts/globals/spells/trust/trion.lua +++ b/scripts/globals/spells/trust/trion.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Trion ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(905) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/ulmia.lua b/scripts/globals/spells/trust/ulmia.lua index ac3cb2041f6..f614542d424 100644 --- a/scripts/globals/spells/trust/ulmia.lua +++ b/scripts/globals/spells/trust/ulmia.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Ulmia ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(914) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/valaineral.lua b/scripts/globals/spells/trust/valaineral.lua index a443857bac5..67e1bf02b2d 100644 --- a/scripts/globals/spells/trust/valaineral.lua +++ b/scripts/globals/spells/trust/valaineral.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Valaineral ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(910) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/volker.lua b/scripts/globals/spells/trust/volker.lua index 5475882454b..e760bcd278d 100644 --- a/scripts/globals/spells/trust/volker.lua +++ b/scripts/globals/spells/trust/volker.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Volker ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(903) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/zazarg.lua b/scripts/globals/spells/trust/zazarg.lua index ce2efaacd3d..6bc578b90f3 100644 --- a/scripts/globals/spells/trust/zazarg.lua +++ b/scripts/globals/spells/trust/zazarg.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Zazarg ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(924) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/zeid.lua b/scripts/globals/spells/trust/zeid.lua index 2c9ad635719..4f5e5f394ca 100644 --- a/scripts/globals/spells/trust/zeid.lua +++ b/scripts/globals/spells/trust/zeid.lua @@ -1,19 +1,13 @@ ----------------------------------------- -- Trust: Zeid ----------------------------------------- -require("scripts/globals/msg") +require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - if (not caster:canUseMisc(tpz.zoneMisc.PET)) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif (not caster:canCastTrust(spell:getID())) then - return - end - return 0 + tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - caster:spawnTrust(906) - return 0 + tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index 34acc271023..2f54480580f 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -1,8 +1,10 @@ --------------------------------------------------------- -- Trust --------------------------------------------------------- -require("scripts/globals/settings") +require("scripts/globals/keyitems") require("scripts/globals/msg") +require("scripts/globals/settings") +require("scripts/globals/status") --------------------------------------------------------- tpz = tpz or {} @@ -20,3 +22,61 @@ tpz.trust.messageParty = function(mob, messageString) end end end + +tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) + if not caster:canUseMisc(tpz.zoneMisc.TRUST) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA + end + + if caster:getID() ~= caster:getPartyLeader():getID() then + return tpz.msg.basic.CANT_BE_USED_IN_AREA + end + + -- Check duplicates (Shantotto I vs Shantotto II) + if not_allowed_trust_ids ~= nil then + if type(not_allowed_trust_ids) == "number" then + if spell:getID() == not_allowed_trust_ids then + return tpz.msg.basic.CANT_BE_USED_IN_AREA + end + elseif type(not_allowed_trust_ids) == "table" then + for _, v in pairs(not_allowed_trust_ids) do + if type(v) == "number" then + if spell:getID() == v then + return tpz.msg.basic.CANT_BE_USED_IN_AREA + end + end + end + end + end + + -- Check for same trust in party + local num_pt = 0 + local num_trusts = 0 + local party = caster:getParty() + for _, member in ipairs(party) do + if member:getObjType() == tpz.objType.TRUST then + if member:getTrustID() == spell:getID() then + return tpz.msg.basic.CANT_BE_USED_IN_AREA + else + num_trusts = num_trusts + 1 + end + end + num_pt = num_pt + 1 + end + + -- Max party size + if num_pt >= 6 then + return tpz.msg.basic.CANT_BE_USED_IN_AREA + end + + -- Limits set by ROV Key Items + if num_trusts >= 4 and not player:hasKeyItem(tpz.ki.RHAPSODY_IN_WHITE) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA + elseif num_trust >= 5 and not player:hasKeyItem(tpz.ki.RHAPSODY_IN_CRIMSON) then + return tpz.msg.basic.CANT_BE_USED_IN_AREA + end +end + +tpz.trust.spawn = function(caster, spell) + caster:spawnTrust(spell:getID()) +end \ No newline at end of file From 04f29edb0e77601bc083087ee14fd1d645a7b558 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 14 Mar 2020 19:36:28 +0200 Subject: [PATCH 028/116] Review: Remove canCastTrust core binding --- src/map/lua/lua_baseentity.cpp | 97 +--------------------------------- src/map/lua/lua_baseentity.h | 1 - 2 files changed, 1 insertion(+), 97 deletions(-) diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index e25431e7d62..4d2e785bbcd 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -11888,100 +11888,6 @@ inline int32 CLuaBaseEntity::spawnPet(lua_State *L) return 0; } -/************************************************************************ -* Function: canCastTrust() -* Purpose : checks if player can cast trust -* Example : -* Notes : -************************************************************************/ - -inline int32 CLuaBaseEntity::canCastTrust(lua_State* L) -{ - TPZ_DEBUG_BREAK_IF(m_PBaseEntity == nullptr); - TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC); - - // TODO: You can only spawn trusts in battle areas, similar to pets. See MSGBASIC_TRUST_NOT_HERE - // TODO: There is an expandable limit of trusts you can summon, based on key items. - - if (!lua_isnil(L, 1) && lua_isstring(L, 1)) - { - size_t maxTrusts = 5; - uint16 trustId = (uint16)lua_tointeger(L, 1); - CCharEntity* PChar = (CCharEntity*)m_PBaseEntity; - - // If you're in a party, you can only spawn trusts if: - // * You're the party leader - // * The party isn't full - // * The party isn't part of an alliance - if (PChar->PParty != nullptr) - { - CBattleEntity* PLeader = PChar->PParty->GetLeader(); - if (PLeader == nullptr || PLeader->id != PChar->id) - { - PChar->pushPacket(new CMessageStandardPacket(PChar, 0, MsgStd::TrustSoloOrLeader)); - lua_pushboolean(L, false); - return 1; - } - if (PChar->PParty->members.size() >= 6) - { - PChar->pushPacket(new CMessageStandardPacket(PChar, 0, MsgStd::TrustLimit)); - lua_pushboolean(L, false); - return 1; - } - if (PChar->PParty->m_PAlliance != nullptr) - { - PChar->pushPacket(new CMessageStandardPacket(PChar, 0, MsgStd::TrustSoloOrLeader)); - lua_pushboolean(L, false); - return 1; - } - - // Reduce the max number of summonable trusts - maxTrusts = 6 - PChar->PParty->members.size(); - } - - if (PChar->PTrusts.size() >= maxTrusts) - { - PChar->pushPacket(new CMessageStandardPacket(PChar, 0, MsgStd::TrustLimit)); - lua_pushboolean(L, false); - return 1; - } - - // You can't spawn the same trust twice - // TODO: This includes otherwise distinct trusts, e.g. Shantotto and Shantotto II, only 1 can be called. - // It'd probably be "good enough" to use the name as a heuristic, looking for "II" (this catches 99% of them). - - - if (PChar->PTrusts.size() > 0) - { - for (auto PTrust : PChar->PTrusts) - { - if (PTrust->m_TrustID == trustId) - { - PChar->pushPacket(new CMessageStandardPacket(PChar, 0, MsgStd::TrustSame)); - lua_pushboolean(L, false); - return 1; - } - } - - uint32 index = 0; - for (index; index < PChar->PTrusts.size(); index++) - { - if (petutils::CheckTrustName(PChar->PTrusts.at(index)->name.c_str(), trustId) == true) - { - PChar->pushPacket(new CMessageStandardPacket(PChar, 0, MsgStd::TrustSame)); - lua_pushboolean(L, false); - return 1; - } - } - } - - - lua_pushboolean(L, true); - return 1; - } - return 0; -} - /************************************************************************ * Function: spawnTrust() * Purpose : Spawns a Trust if a few correct conditions are met @@ -14641,8 +14547,7 @@ Lunar::Register_t CLuaBaseEntity::methods[] = LUNAR_DECLARE_METHOD(CLuaBaseEntity,removeOldestManeuver), LUNAR_DECLARE_METHOD(CLuaBaseEntity,removeAllManeuvers), LUNAR_DECLARE_METHOD(CLuaBaseEntity,updateAttachments), - - LUNAR_DECLARE_METHOD(CLuaBaseEntity,canCastTrust), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,spawnTrust), // Mob Entity-Specific diff --git a/src/map/lua/lua_baseentity.h b/src/map/lua/lua_baseentity.h index c2c0e5dd9b4..f489cb6b58b 100644 --- a/src/map/lua/lua_baseentity.h +++ b/src/map/lua/lua_baseentity.h @@ -578,7 +578,6 @@ class CLuaBaseEntity int32 spawnPet(lua_State*); // Calls Pet int32 despawnPet(lua_State*); // Despawns Pet - int32 canCastTrust(lua_State* L); int32 spawnTrust(lua_State*); // Spawns trust int32 isJugPet(lua_State*); // If the entity has a pet, test if it is a jug pet. From 0eb8848df0fc0e03fd7097551241f44890df53c8 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 14 Mar 2020 19:44:20 +0200 Subject: [PATCH 029/116] Return the things! --- scripts/globals/spells/trust/ajido-marujido.lua | 4 ++-- scripts/globals/spells/trust/aldo.lua | 5 +++-- scripts/globals/spells/trust/areuhat.lua | 5 +++-- scripts/globals/spells/trust/ayame.lua | 4 ++-- scripts/globals/spells/trust/cherukiki.lua | 4 ++-- scripts/globals/spells/trust/cid.lua | 4 ++-- scripts/globals/spells/trust/curilla.lua | 4 ++-- scripts/globals/spells/trust/d_shantotto.lua | 4 ++-- scripts/globals/spells/trust/elivira.lua | 4 ++-- scripts/globals/spells/trust/excenmille.lua | 4 ++-- scripts/globals/spells/trust/fablinix.lua | 4 ++-- scripts/globals/spells/trust/ferreous_coffin.lua | 4 ++-- scripts/globals/spells/trust/gadalar.lua | 4 ++-- scripts/globals/spells/trust/gessho.lua | 4 ++-- scripts/globals/spells/trust/gilgamesh.lua | 4 ++-- scripts/globals/spells/trust/ingrid.lua | 4 ++-- scripts/globals/spells/trust/iron_eater.lua | 4 ++-- scripts/globals/spells/trust/joachim.lua | 4 ++-- scripts/globals/spells/trust/karaha-baruha.lua | 4 ++-- scripts/globals/spells/trust/kupipi.lua | 4 ++-- scripts/globals/spells/trust/lehko_habhoka.lua | 4 ++-- scripts/globals/spells/trust/lhu_mhakaracca.lua | 4 ++-- scripts/globals/spells/trust/lilisette.lua | 4 ++-- scripts/globals/spells/trust/lion.lua | 4 ++-- scripts/globals/spells/trust/luzaf.lua | 4 ++-- scripts/globals/spells/trust/maat.lua | 4 ++-- scripts/globals/spells/trust/mihli_aliapoh.lua | 4 ++-- scripts/globals/spells/trust/mnejing.lua | 4 ++-- scripts/globals/spells/trust/moogle.lua | 4 ++-- scripts/globals/spells/trust/mumor.lua | 4 ++-- scripts/globals/spells/trust/naja_salaheem.lua | 4 ++-- scripts/globals/spells/trust/najelith.lua | 4 ++-- scripts/globals/spells/trust/naji.lua | 4 ++-- scripts/globals/spells/trust/nanaa_mihgo.lua | 4 ++-- scripts/globals/spells/trust/nashmeira.lua | 4 ++-- scripts/globals/spells/trust/noillurie.lua | 4 ++-- scripts/globals/spells/trust/ovjang.lua | 4 ++-- scripts/globals/spells/trust/prishe.lua | 4 ++-- scripts/globals/spells/trust/rainemard.lua | 4 ++-- scripts/globals/spells/trust/sakura.lua | 4 ++-- scripts/globals/spells/trust/semih_lafihna.lua | 4 ++-- scripts/globals/spells/trust/shantotto.lua | 4 ++-- scripts/globals/spells/trust/shantotto_ii.lua | 4 ++-- scripts/globals/spells/trust/shikaree_z.lua | 4 ++-- scripts/globals/spells/trust/star_sibyl.lua | 4 ++-- scripts/globals/spells/trust/tenzen.lua | 4 ++-- scripts/globals/spells/trust/trion.lua | 4 ++-- scripts/globals/spells/trust/ulmia.lua | 4 ++-- scripts/globals/spells/trust/valaineral.lua | 4 ++-- scripts/globals/spells/trust/volker.lua | 4 ++-- scripts/globals/spells/trust/zazarg.lua | 4 ++-- scripts/globals/spells/trust/zeid.lua | 4 ++-- scripts/globals/trust.lua | 4 ++++ 53 files changed, 110 insertions(+), 104 deletions(-) diff --git a/scripts/globals/spells/trust/ajido-marujido.lua b/scripts/globals/spells/trust/ajido-marujido.lua index 96f36b2fab5..3dd40d73f53 100644 --- a/scripts/globals/spells/trust/ajido-marujido.lua +++ b/scripts/globals/spells/trust/ajido-marujido.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/aldo.lua b/scripts/globals/spells/trust/aldo.lua index 25348f2c236..00e0dfec4e4 100644 --- a/scripts/globals/spells/trust/aldo.lua +++ b/scripts/globals/spells/trust/aldo.lua @@ -5,9 +5,10 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end + diff --git a/scripts/globals/spells/trust/areuhat.lua b/scripts/globals/spells/trust/areuhat.lua index b2021778fbd..fe51ad1fa5a 100644 --- a/scripts/globals/spells/trust/areuhat.lua +++ b/scripts/globals/spells/trust/areuhat.lua @@ -5,9 +5,10 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end + diff --git a/scripts/globals/spells/trust/ayame.lua b/scripts/globals/spells/trust/ayame.lua index ca13b853100..aacbf93b4bf 100644 --- a/scripts/globals/spells/trust/ayame.lua +++ b/scripts/globals/spells/trust/ayame.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/cherukiki.lua b/scripts/globals/spells/trust/cherukiki.lua index f186caf3149..a3ad7478dc1 100644 --- a/scripts/globals/spells/trust/cherukiki.lua +++ b/scripts/globals/spells/trust/cherukiki.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/cid.lua b/scripts/globals/spells/trust/cid.lua index 7300b1b9313..38b437c3cca 100644 --- a/scripts/globals/spells/trust/cid.lua +++ b/scripts/globals/spells/trust/cid.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/curilla.lua b/scripts/globals/spells/trust/curilla.lua index db1eaf1c7f7..b231bedf880 100644 --- a/scripts/globals/spells/trust/curilla.lua +++ b/scripts/globals/spells/trust/curilla.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/d_shantotto.lua b/scripts/globals/spells/trust/d_shantotto.lua index 749f905a3ac..4cd9de038f3 100644 --- a/scripts/globals/spells/trust/d_shantotto.lua +++ b/scripts/globals/spells/trust/d_shantotto.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell, {896, 1019}) + return tpz.trust.canCast(caster, spell, {896, 1019}) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/elivira.lua b/scripts/globals/spells/trust/elivira.lua index 9525040780b..278e8ea7f45 100644 --- a/scripts/globals/spells/trust/elivira.lua +++ b/scripts/globals/spells/trust/elivira.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/excenmille.lua b/scripts/globals/spells/trust/excenmille.lua index 638e53ee679..a658c7b1ffd 100644 --- a/scripts/globals/spells/trust/excenmille.lua +++ b/scripts/globals/spells/trust/excenmille.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/fablinix.lua b/scripts/globals/spells/trust/fablinix.lua index f4439f064d9..bc19dc7f772 100644 --- a/scripts/globals/spells/trust/fablinix.lua +++ b/scripts/globals/spells/trust/fablinix.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/ferreous_coffin.lua b/scripts/globals/spells/trust/ferreous_coffin.lua index 9bcb9c8b06f..38f0de6c788 100644 --- a/scripts/globals/spells/trust/ferreous_coffin.lua +++ b/scripts/globals/spells/trust/ferreous_coffin.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/gadalar.lua b/scripts/globals/spells/trust/gadalar.lua index 7f4c01616ec..4e2a3e6e8f2 100644 --- a/scripts/globals/spells/trust/gadalar.lua +++ b/scripts/globals/spells/trust/gadalar.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/gessho.lua b/scripts/globals/spells/trust/gessho.lua index 461987dfae8..401292a5043 100644 --- a/scripts/globals/spells/trust/gessho.lua +++ b/scripts/globals/spells/trust/gessho.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/gilgamesh.lua b/scripts/globals/spells/trust/gilgamesh.lua index b902251e16b..d2bce4ce8d5 100644 --- a/scripts/globals/spells/trust/gilgamesh.lua +++ b/scripts/globals/spells/trust/gilgamesh.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/ingrid.lua b/scripts/globals/spells/trust/ingrid.lua index 090bc061dfe..725b9c073ef 100644 --- a/scripts/globals/spells/trust/ingrid.lua +++ b/scripts/globals/spells/trust/ingrid.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/iron_eater.lua b/scripts/globals/spells/trust/iron_eater.lua index a659ce63c16..9593bfafacb 100644 --- a/scripts/globals/spells/trust/iron_eater.lua +++ b/scripts/globals/spells/trust/iron_eater.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/joachim.lua b/scripts/globals/spells/trust/joachim.lua index 9e8060be9f4..956352cf7a1 100644 --- a/scripts/globals/spells/trust/joachim.lua +++ b/scripts/globals/spells/trust/joachim.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/karaha-baruha.lua b/scripts/globals/spells/trust/karaha-baruha.lua index d92d80e22a5..446615ab6ef 100644 --- a/scripts/globals/spells/trust/karaha-baruha.lua +++ b/scripts/globals/spells/trust/karaha-baruha.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/kupipi.lua b/scripts/globals/spells/trust/kupipi.lua index d594dcca01b..311a63e4072 100644 --- a/scripts/globals/spells/trust/kupipi.lua +++ b/scripts/globals/spells/trust/kupipi.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/lehko_habhoka.lua b/scripts/globals/spells/trust/lehko_habhoka.lua index 1cabfb9867b..12d4b0a6c5e 100644 --- a/scripts/globals/spells/trust/lehko_habhoka.lua +++ b/scripts/globals/spells/trust/lehko_habhoka.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/lhu_mhakaracca.lua b/scripts/globals/spells/trust/lhu_mhakaracca.lua index 2b50270a730..5e655724330 100644 --- a/scripts/globals/spells/trust/lhu_mhakaracca.lua +++ b/scripts/globals/spells/trust/lhu_mhakaracca.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/lilisette.lua b/scripts/globals/spells/trust/lilisette.lua index 107919797c5..db6605f6470 100644 --- a/scripts/globals/spells/trust/lilisette.lua +++ b/scripts/globals/spells/trust/lilisette.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/lion.lua b/scripts/globals/spells/trust/lion.lua index 1d51e7b792e..d602639b0cb 100644 --- a/scripts/globals/spells/trust/lion.lua +++ b/scripts/globals/spells/trust/lion.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/luzaf.lua b/scripts/globals/spells/trust/luzaf.lua index 0b17f0a7008..3b58210ced0 100644 --- a/scripts/globals/spells/trust/luzaf.lua +++ b/scripts/globals/spells/trust/luzaf.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/maat.lua b/scripts/globals/spells/trust/maat.lua index 40ffa7733be..1e00ba1c626 100644 --- a/scripts/globals/spells/trust/maat.lua +++ b/scripts/globals/spells/trust/maat.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/mihli_aliapoh.lua b/scripts/globals/spells/trust/mihli_aliapoh.lua index 257cfafa22c..caecc6a6550 100644 --- a/scripts/globals/spells/trust/mihli_aliapoh.lua +++ b/scripts/globals/spells/trust/mihli_aliapoh.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/mnejing.lua b/scripts/globals/spells/trust/mnejing.lua index 061f82c4e27..0515932eb2d 100644 --- a/scripts/globals/spells/trust/mnejing.lua +++ b/scripts/globals/spells/trust/mnejing.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/moogle.lua b/scripts/globals/spells/trust/moogle.lua index 5c79b0ec77a..2e9dbdfd847 100644 --- a/scripts/globals/spells/trust/moogle.lua +++ b/scripts/globals/spells/trust/moogle.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/mumor.lua b/scripts/globals/spells/trust/mumor.lua index a1ea27cbc7c..d8cc8f09536 100644 --- a/scripts/globals/spells/trust/mumor.lua +++ b/scripts/globals/spells/trust/mumor.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/naja_salaheem.lua b/scripts/globals/spells/trust/naja_salaheem.lua index 1fd9951db64..b3c20302164 100644 --- a/scripts/globals/spells/trust/naja_salaheem.lua +++ b/scripts/globals/spells/trust/naja_salaheem.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/najelith.lua b/scripts/globals/spells/trust/najelith.lua index 311a39caa4c..8383d81ba57 100644 --- a/scripts/globals/spells/trust/najelith.lua +++ b/scripts/globals/spells/trust/najelith.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/naji.lua b/scripts/globals/spells/trust/naji.lua index b20e1afccb0..a9b6672a67a 100644 --- a/scripts/globals/spells/trust/naji.lua +++ b/scripts/globals/spells/trust/naji.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/nanaa_mihgo.lua b/scripts/globals/spells/trust/nanaa_mihgo.lua index 147ad81385e..8075680ee17 100644 --- a/scripts/globals/spells/trust/nanaa_mihgo.lua +++ b/scripts/globals/spells/trust/nanaa_mihgo.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/nashmeira.lua b/scripts/globals/spells/trust/nashmeira.lua index 23f7363de63..eda2297fb22 100644 --- a/scripts/globals/spells/trust/nashmeira.lua +++ b/scripts/globals/spells/trust/nashmeira.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/noillurie.lua b/scripts/globals/spells/trust/noillurie.lua index a9a00024cd3..f8b5341171f 100644 --- a/scripts/globals/spells/trust/noillurie.lua +++ b/scripts/globals/spells/trust/noillurie.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/ovjang.lua b/scripts/globals/spells/trust/ovjang.lua index 73905e89966..9f5e12105d6 100644 --- a/scripts/globals/spells/trust/ovjang.lua +++ b/scripts/globals/spells/trust/ovjang.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/prishe.lua b/scripts/globals/spells/trust/prishe.lua index 488ddf7cd9a..7c0a7056c8b 100644 --- a/scripts/globals/spells/trust/prishe.lua +++ b/scripts/globals/spells/trust/prishe.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/rainemard.lua b/scripts/globals/spells/trust/rainemard.lua index 2880826a698..fa85871e900 100644 --- a/scripts/globals/spells/trust/rainemard.lua +++ b/scripts/globals/spells/trust/rainemard.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/sakura.lua b/scripts/globals/spells/trust/sakura.lua index e091afd105a..bcdd27235ed 100644 --- a/scripts/globals/spells/trust/sakura.lua +++ b/scripts/globals/spells/trust/sakura.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/semih_lafihna.lua b/scripts/globals/spells/trust/semih_lafihna.lua index 52beee9d65f..e5dba67918a 100644 --- a/scripts/globals/spells/trust/semih_lafihna.lua +++ b/scripts/globals/spells/trust/semih_lafihna.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index 8698fb8cc70..59dcf72ada0 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell, {934, 1019}) + return tpz.trust.canCast(caster, spell, {934, 1019}) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/shantotto_ii.lua b/scripts/globals/spells/trust/shantotto_ii.lua index 14f6b09cba2..e569daeeefc 100644 --- a/scripts/globals/spells/trust/shantotto_ii.lua +++ b/scripts/globals/spells/trust/shantotto_ii.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell, {896, 934}) + return tpz.trust.canCast(caster, spell, {896, 934}) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/shikaree_z.lua b/scripts/globals/spells/trust/shikaree_z.lua index 34aea3c9b0f..a8c545c72cb 100644 --- a/scripts/globals/spells/trust/shikaree_z.lua +++ b/scripts/globals/spells/trust/shikaree_z.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/star_sibyl.lua b/scripts/globals/spells/trust/star_sibyl.lua index 4688cd65c86..511b8cc58c9 100644 --- a/scripts/globals/spells/trust/star_sibyl.lua +++ b/scripts/globals/spells/trust/star_sibyl.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/tenzen.lua b/scripts/globals/spells/trust/tenzen.lua index 79454791ebe..6d36893f573 100644 --- a/scripts/globals/spells/trust/tenzen.lua +++ b/scripts/globals/spells/trust/tenzen.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/trion.lua b/scripts/globals/spells/trust/trion.lua index e1b667c6fc4..b324e6630b8 100644 --- a/scripts/globals/spells/trust/trion.lua +++ b/scripts/globals/spells/trust/trion.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/ulmia.lua b/scripts/globals/spells/trust/ulmia.lua index f614542d424..4aad48a8bc6 100644 --- a/scripts/globals/spells/trust/ulmia.lua +++ b/scripts/globals/spells/trust/ulmia.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/valaineral.lua b/scripts/globals/spells/trust/valaineral.lua index 67e1bf02b2d..2627d0fdbf9 100644 --- a/scripts/globals/spells/trust/valaineral.lua +++ b/scripts/globals/spells/trust/valaineral.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/volker.lua b/scripts/globals/spells/trust/volker.lua index e760bcd278d..368b1f6a5ce 100644 --- a/scripts/globals/spells/trust/volker.lua +++ b/scripts/globals/spells/trust/volker.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/zazarg.lua b/scripts/globals/spells/trust/zazarg.lua index 6bc578b90f3..f5fa9d62138 100644 --- a/scripts/globals/spells/trust/zazarg.lua +++ b/scripts/globals/spells/trust/zazarg.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/spells/trust/zeid.lua b/scripts/globals/spells/trust/zeid.lua index 4f5e5f394ca..e2a87e73a2f 100644 --- a/scripts/globals/spells/trust/zeid.lua +++ b/scripts/globals/spells/trust/zeid.lua @@ -5,9 +5,9 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) - tpz.trust.spawn(caster, spell) + return tpz.trust.spawn(caster, spell) end diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index 2f54480580f..be0f3bfb9f1 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -75,8 +75,12 @@ tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) elseif num_trust >= 5 and not player:hasKeyItem(tpz.ki.RHAPSODY_IN_CRIMSON) then return tpz.msg.basic.CANT_BE_USED_IN_AREA end + + return 0 end tpz.trust.spawn = function(caster, spell) caster:spawnTrust(spell:getID()) + + return 0 end \ No newline at end of file From 3e0ab135fd4af590edfd24db5b88d52cc13897ed Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 14 Mar 2020 19:48:36 +0200 Subject: [PATCH 030/116] Remove currently unused trust party message helper --- scripts/globals/trust.lua | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index be0f3bfb9f1..c0fa3976dd6 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -10,19 +10,6 @@ require("scripts/globals/status") tpz = tpz or {} tpz.trust = tpz.trust or {} -tpz.trust.messageParty = function(mob, messageString) - local party = {} - local master = mob:getMaster() - - party = master:getAlliance() - - for _, member in ipairs(party) do - if member:getZoneID() == mob:getZoneID() and member:isPC() then - member:PrintToPlayer(messageString, 4) - end - end -end - tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) if not caster:canUseMisc(tpz.zoneMisc.TRUST) then return tpz.msg.basic.CANT_BE_USED_IN_AREA From e413ad41646740e3cd7839ea1e2517d86b61138c Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 14 Mar 2020 20:24:38 +0200 Subject: [PATCH 031/116] Some debugging of trust.canCast --- scripts/globals/trust.lua | 43 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index c0fa3976dd6..e96489274a6 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -12,38 +12,37 @@ tpz.trust = tpz.trust or {} tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) if not caster:canUseMisc(tpz.zoneMisc.TRUST) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - end - - if caster:getID() ~= caster:getPartyLeader():getID() then - return tpz.msg.basic.CANT_BE_USED_IN_AREA + -- TODO: Update area flags + --return tpz.msg.basic.CANT_BE_USED_IN_AREA end - -- Check duplicates (Shantotto I vs Shantotto II) - if not_allowed_trust_ids ~= nil then - if type(not_allowed_trust_ids) == "number" then - if spell:getID() == not_allowed_trust_ids then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - end - elseif type(not_allowed_trust_ids) == "table" then - for _, v in pairs(not_allowed_trust_ids) do - if type(v) == "number" then - if spell:getID() == v then - return tpz.msg.basic.CANT_BE_USED_IN_AREA - end - end - end - end + if caster:getID() ~= caster:getPartyLeader():getID() then + print("You are not the party leader!") + return tpz.msg.basic.CANT_BE_USED_IN_AREA end - -- Check for same trust in party + -- Check party for trusts local num_pt = 0 local num_trusts = 0 local party = caster:getParty() for _, member in ipairs(party) do if member:getObjType() == tpz.objType.TRUST then + -- Check for same trust if member:getTrustID() == spell:getID() then return tpz.msg.basic.CANT_BE_USED_IN_AREA + -- Check not allowed trust combinations (Shantotto I vs Shantotto II) + elseif type(not_allowed_trust_ids) == "number" then + if spell:getID() == not_allowed_trust_ids then + return tpz.msg.basic.CANT_BE_USED_IN_AREA + end + elseif type(not_allowed_trust_ids) == "table" then + for _, v in pairs(not_allowed_trust_ids) do + if type(v) == "number" then + if spell:getID() == v then + return tpz.msg.basic.CANT_BE_USED_IN_AREA + end + end + end else num_trusts = num_trusts + 1 end @@ -59,7 +58,7 @@ tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) -- Limits set by ROV Key Items if num_trusts >= 4 and not player:hasKeyItem(tpz.ki.RHAPSODY_IN_WHITE) then return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif num_trust >= 5 and not player:hasKeyItem(tpz.ki.RHAPSODY_IN_CRIMSON) then + elseif num_trusts >= 5 and not player:hasKeyItem(tpz.ki.RHAPSODY_IN_CRIMSON) then return tpz.msg.basic.CANT_BE_USED_IN_AREA end From a0752af929a35b70fdd59e77bc2479854bfe93e2 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 14 Mar 2020 21:27:42 +0200 Subject: [PATCH 032/116] Misc fixes --- scripts/globals/trust.lua | 4 ++-- src/map/ai/helpers/targetfind.cpp | 8 -------- src/map/zone.h | 2 +- src/map/zone_entities.cpp | 28 +++++++++------------------- 4 files changed, 12 insertions(+), 30 deletions(-) diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index e96489274a6..f769cbc66aa 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -16,8 +16,8 @@ tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) --return tpz.msg.basic.CANT_BE_USED_IN_AREA end - if caster:getID() ~= caster:getPartyLeader():getID() then - print("You are not the party leader!") + local leader = caster:getPartyLeader() + if leader and caster:getID() ~= caster:getPartyLeader():getID() then return tpz.msg.basic.CANT_BE_USED_IN_AREA end diff --git a/src/map/ai/helpers/targetfind.cpp b/src/map/ai/helpers/targetfind.cpp index 62064a672b8..23038e351ea 100644 --- a/src/map/ai/helpers/targetfind.cpp +++ b/src/map/ai/helpers/targetfind.cpp @@ -503,14 +503,6 @@ CBattleEntity* CTargetFind::getValidTarget(uint16 actionTargetID, uint16 validTa return PTarget; } - if (validTargetFlags & TARGET_PLAYER_PARTY) - { - if (PTarget->objtype == TYPE_TRUST) - { - return PTarget; - } - } - if (PTarget->ValidTarget(m_PBattleEntity, validTargetFlags)) { return PTarget; diff --git a/src/map/zone.h b/src/map/zone.h index 90c0f75c05d..e56d271ecf8 100644 --- a/src/map/zone.h +++ b/src/map/zone.h @@ -555,7 +555,7 @@ class CZone virtual void SpawnMOBs(CCharEntity* PChar); // отображаем MOBs в зоне virtual void SpawnPETs(CCharEntity* PChar); // отображаем PETs в зоне virtual void SpawnNPCs(CCharEntity* PChar); // отображаем NPCs в зоне - virtual void SpawnTRUSTs(CCharEntity* PChar); // отображаем TRUSTs в зоне + virtual void SpawnTRUSTs(CCharEntity* PChar); // Display TRUSTs in zone virtual void SpawnMoogle(CCharEntity* PChar); // отображаем Moogle в MogHouse virtual void SpawnTransport(CCharEntity* PChar); // отображаем транспорт void SavePlayTime(); diff --git a/src/map/zone_entities.cpp b/src/map/zone_entities.cpp index 5001c2b68d5..9a6b7f0e7f7 100644 --- a/src/map/zone_entities.cpp +++ b/src/map/zone_entities.cpp @@ -371,24 +371,17 @@ void CZoneEntities::DecreaseZoneCounter(CCharEntity* PChar) } //remove trust - if (PChar->PTrusts.size() > 0) + for (auto& trust : PChar->PTrusts) { - for (auto& trust : PChar->PTrusts) + for (EntityList_t::const_iterator it = m_charList.begin(); it != m_charList.end(); ++it) { - trust->PAI->Disengage(); - //trust->status = STATUS_DISAPPEAR; - - - for (EntityList_t::const_iterator it = m_charList.begin(); it != m_charList.end(); ++it) - { - //inform other players of the pets removal - CCharEntity* PCurrentChar = (CCharEntity*)it->second; - PCurrentChar->pushPacket(new CEntityUpdatePacket(trust, ENTITY_DESPAWN, UPDATE_NONE)); - } + //inform other players of the pets removal + CCharEntity* PCurrentChar = (CCharEntity*)it->second; + PCurrentChar->pushPacket(new CEntityUpdatePacket(trust, ENTITY_DESPAWN, UPDATE_NONE)); } - PChar->ClearTrusts(); - PChar->SpawnTRUSTList.clear(); } + PChar->ClearTrusts(); + PChar->SpawnTRUSTList.clear(); } if (m_zone->m_BattlefieldHandler) @@ -1079,7 +1072,7 @@ void CZoneEntities::ZoneServer(time_point tick, bool check_regions) CMobEntity* PCurrentMob = (CMobEntity*)PMobIt.second; PCurrentMob->PEnmityContainer->Clear(PPet->id); } - if (!PPet->PMaster || PPet->objtype == TYPE_TRUST || PPet->getPetType() != PETTYPE_AUTOMATON) + if (PPet->getPetType() != PETTYPE_AUTOMATON || !PPet->PMaster) { delete pit->second; } @@ -1119,10 +1112,7 @@ void CZoneEntities::ZoneServer(time_point tick, bool check_regions) } } - if (!PTrust->PMaster || PTrust->objtype == TYPE_TRUST) - { - delete trustit->second; - } + delete trustit->second; m_trustList.erase(trustit++); } else { From 188a64e0ba5df0cea048278df5e3bceed8004fe4 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 14 Mar 2020 22:08:32 +0200 Subject: [PATCH 033/116] TRUST lua zone status --- scripts/globals/status.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/globals/status.lua b/scripts/globals/status.lua index 6bafa827ad7..df7369e5608 100644 --- a/scripts/globals/status.lua +++ b/scripts/globals/status.lua @@ -24,6 +24,7 @@ tpz.zoneMisc = TREASURE = 0x0100, -- Presence in the global zone TreasurePool AH = 0x0200, -- Ability to use the auction house YELL = 0x0400, -- Send and receive /yell commands + TRUST = 0x0800, -- Ability to cast trust magic } ------------------------------------ From 3274345a0c971e04565a7e09e18112d0fc0a8bdd Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 14 Mar 2020 22:08:52 +0200 Subject: [PATCH 034/116] Misc party cleanup --- src/map/party.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/map/party.cpp b/src/map/party.cpp index 2db25bf59a9..9b436210d89 100644 --- a/src/map/party.cpp +++ b/src/map/party.cpp @@ -238,10 +238,11 @@ void CParty::RemoveMember(CBattleEntity* PEntity) if (m_PLeader == PEntity) { + RemovePartyLeader(PEntity); + // Remove their trusts CCharEntity* PChar = (CCharEntity*)PEntity; PChar->ClearTrusts(); - RemovePartyLeader(PEntity); } else { @@ -780,13 +781,9 @@ void CParty::ReloadParty() PChar->pushPacket(new CPartyMemberUpdatePacket( memberinfo.id, (const int8*)memberinfo.name.c_str(), memberinfo.flags, j, zoneid)); - //effects->AddMemberEffects(memberinfo.id); } j++; } - - - //PChar->pushPacket(effects.release()); } } } From 13964befa994589cd581de22668adcba22bb8f16 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 14 Mar 2020 22:44:36 +0200 Subject: [PATCH 035/116] Little tidy --- scripts/globals/trust.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index f769cbc66aa..7f61bd4f843 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -17,7 +17,7 @@ tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) end local leader = caster:getPartyLeader() - if leader and caster:getID() ~= caster:getPartyLeader():getID() then + if leader and caster:getID() ~= leader:getID() then return tpz.msg.basic.CANT_BE_USED_IN_AREA end From 994cbf1731d7cecd2218df1562fdf40f915dfcb8 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 14 Mar 2020 23:09:51 +0200 Subject: [PATCH 036/116] Fill out Shantotto spell list --- sql/mob_spell_lists.sql | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/sql/mob_spell_lists.sql b/sql/mob_spell_lists.sql index 1687a63b4c1..0f1139b4976 100644 --- a/sql/mob_spell_lists.sql +++ b/sql/mob_spell_lists.sql @@ -2516,21 +2516,6 @@ INSERT INTO `mob_spell_lists` VALUES ('Ghul-I-Beaban_BLM',305,179,1,255); -- bli INSERT INTO `mob_spell_lists` VALUES ('Saa_Doyi_the_Fervid',306,320,1,255); -- katon_ichi INSERT INTO `mob_spell_lists` VALUES ('Frost_Flambeau',307,180,1,255); -- blizzaga_ii -- Trust -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,159,1,255); -- Stone -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,160,26,255); -- Stone II -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,161,51,255); -- Stone III -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,162,68,255); -- Stone IV -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,163,77,255); -- Stone V -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,169,5,255); -- Water -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,170,30,255); -- Water II -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,171,55,255); -- Water III -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,172,70,255); -- Water IV -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,173,80,255); -- Water V -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,154,9,255); -- Aero -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,155,34,255); -- Aero II -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,156,59,255); -- Aero III -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,157,72,255); -- Aero IV -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,158,83,255); -- Aero V INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,144,9,255); -- Fire INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,145,34,255); -- Fire II INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,146,59,255); -- Fire III @@ -2541,6 +2526,26 @@ INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,150,34,255); -- Bliz INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,151,59,255); -- Blizzard III INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,152,72,255); -- Blizzard IV INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,153,83,255); -- Blizzard V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,154,9,255); -- Aero +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,155,34,255); -- Aero II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,156,59,255); -- Aero III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,157,72,255); -- Aero IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,158,83,255); -- Aero V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,159,1,255); -- Stone +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,160,26,255); -- Stone II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,161,51,255); -- Stone III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,162,68,255); -- Stone IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,163,77,255); -- Stone V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,164,5,255); -- Thunder +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,165,30,255); -- Thunder II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,166,55,255); -- Thunder III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,167,70,255); -- Thunder IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,168,80,255); -- Thunder V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,169,5,255); -- Water +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,170,30,255); -- Water II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,171,55,255); -- Water III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,172,70,255); -- Water IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,173,80,255); -- Water V INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,1,1,255); -- Cure INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,2,11,255); -- Cure II From 91a74c5cfdbbeeb3a6d8a65a89e66839914abdf7 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 14 Mar 2020 23:11:35 +0200 Subject: [PATCH 037/116] Revert trust change in ai magic state --- src/map/ai/states/magic_state.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/ai/states/magic_state.cpp b/src/map/ai/states/magic_state.cpp index 70b9a1260cc..ee1c539d984 100644 --- a/src/map/ai/states/magic_state.cpp +++ b/src/map/ai/states/magic_state.cpp @@ -96,7 +96,7 @@ bool CMagicState::Update(time_point tick) action_t action; - if (!PTarget || m_errorMsg || (HasMoved() && (m_PEntity->objtype != TYPE_PET || m_PEntity->objtype != TYPE_TRUST || + if (!PTarget || m_errorMsg || (HasMoved() && (m_PEntity->objtype != TYPE_PET || static_cast(m_PEntity)->getPetType() != PETTYPE_AUTOMATON)) || !CanCastSpell(PTarget)) { m_interrupted = true; From 8dab21741889d5df949ed4a7ff1de840e5736fb5 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 14 Mar 2020 23:15:03 +0200 Subject: [PATCH 038/116] Clean up trust related utils --- src/map/utils/petutils.cpp | 32 ++------------------------------ src/map/utils/petutils.h | 3 +-- 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/src/map/utils/petutils.cpp b/src/map/utils/petutils.cpp index 0a6b6a7db6f..d8b56a88be7 100644 --- a/src/map/utils/petutils.cpp +++ b/src/map/utils/petutils.cpp @@ -340,11 +340,11 @@ namespace petutils for (uint32 index = 0; index < g_PTrustIDList.size(); index++) { - QueryTrust(g_PTrustIDList.at(index)->spellID); + BuildTrust(g_PTrustIDList.at(index)->spellID); } } - void QueryTrust(uint32 TrustID) + void BuildTrust(uint32 TrustID) { const char* Query = "SELECT \ @@ -2006,32 +2006,4 @@ namespace petutils } return false; } - - bool CheckTrustName(const char* name, uint32 trustID) - { - printf("Trusts name = %s", name); - - const char* Query = - "SELECT \ - mob_pools.name \ - FROM mob_pools \ - WHERE mob_pools.poolid = %u"; - - uint32 ret = Sql_Query(SqlHandle, Query, trustID +5000); - - if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) != 0) - { - while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) - { - const char* sqlName = (const char*)Sql_GetData(SqlHandle, 0); - - if (name == sqlName) - { - printf("sqlName name is the same as %s, should not spawn this trust!", sqlName); - return true; - } - } - } - return false; - } }; // namespace petutils diff --git a/src/map/utils/petutils.h b/src/map/utils/petutils.h index 52c8bc24db8..0b58fedf636 100644 --- a/src/map/utils/petutils.h +++ b/src/map/utils/petutils.h @@ -84,8 +84,7 @@ namespace petutils void LoadWyvernStatistics(CBattleEntity* PMaster, CPetEntity* PPet, bool finalize); void FinalizePetStatistics(CBattleEntity* PMaster, CPetEntity* PPet); bool CheckPetModType(CBattleEntity* PPet, PetModType petmod); - bool CheckTrustName(const char* name, uint32 trustID); - void QueryTrust(uint32 TrustID); + void BuildTrust(uint32 TrustID); CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID); }; From 1829430277078430595a544a895ccab2f64fb17c Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 15 Mar 2020 15:40:13 +0200 Subject: [PATCH 039/116] Audit starting trusts spell lists and zero off spell/skill lists for all other trusts (and add placeholder Monberaux entry) --- sql/mob_pools.sql | 236 ++++++++++++++++++++-------------------- sql/mob_spell_lists.sql | 162 ++++++++++++++++----------- 2 files changed, 219 insertions(+), 179 deletions(-) diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index 5806ad8bf6b..8411c089888 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5953,131 +5953,131 @@ INSERT INTO `mob_pools` VALUES (5892,'Euryale','Euryale',171,0x06007106000000000 INSERT INTO `mob_pools` VALUES (5893,'Gloombound_Lurker','Gloombound_Lurker',221,0x0000230200000000000000000000000000000000,6,6,5,360,100,0,1,0,1,2,7,0,0,155,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5894,'Lesath','Lesath',217,0x00001C0100000000000000000000000000000000,1,1,7,280,100,0,1,0,1,2,7,0,238,141,0,0,0,1,0,370); INSERT INTO `mob_pools` VALUES (5895,'Donggu','Donggu',116,0x0000780100000000000000000000000000000000,1,1,11,240,100,0,0,0,1,2,7,0,0,3,0,0,0,1,0,116); - -INSERT INTO `mob_pools` VALUES (5896,'Shantotto','shantotto',153,0x0000B80B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,308,1,0,750); +-- Trusts +INSERT INTO `mob_pools` VALUES (5896,'Shantotto','shantotto',153,0x0000B80B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,750); INSERT INTO `mob_pools` VALUES (5897,'Naji','naji',149,0x0000B90B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,0,1,0,750); -INSERT INTO `mob_pools` VALUES (5898,'Kupipi','kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,1,309,1,0,3); -INSERT INTO `mob_pools` VALUES (5899,'Excenmille','excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,310,1,0,4); +INSERT INTO `mob_pools` VALUES (5898,'Kupipi','kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,1,312,1,0,3); +INSERT INTO `mob_pools` VALUES (5899,'Excenmille','excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,309,1,0,4); INSERT INTO `mob_pools` VALUES (5900,'Ayame','ayame',149,0x0000BC0B00000000000000000000000000000000,12,0,10,440,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,5); INSERT INTO `mob_pools` VALUES (5901,'NanaaMihgo','nanaa_mihgo',152,0x0000BD0B00000000000000000000000000000000,6,0,2,190,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,6); -INSERT INTO `mob_pools` VALUES (5902,'Curilla','curilla',145,0x0000BE0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,7,1,0,7); +INSERT INTO `mob_pools` VALUES (5902,'Curilla','curilla',145,0x0000BE0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,308,1,0,7); INSERT INTO `mob_pools` VALUES (5903,'Volker','volker',149,0x0000BF0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,8,1,0,8); -INSERT INTO `mob_pools` VALUES (5904,'Ajido-Marujido','ajido-marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,1,9,1,0,0); -INSERT INTO `mob_pools` VALUES (5905,'Trion','trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5906,'Zeid','zeid',145,0x0000C20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5907,'Lion','lion',145,0x0000C30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5908,'Tenzen','tenzen',145,0x0000C40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5909,'MihliAliapoh','mihli_aliapoh',145,0x0000C50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5910,'Valaineral','valaineral',145,0x0000C60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5911,'Joachim','joachim',145,0x0000C70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5912,'NajaSalaheem','naja_salaheem',145,0x0000C80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5913,'Prishe','prishe',145,0x0000C90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5914,'Ulmia','ulmia',145,0x0000CA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5915,'ShikareeZ','shikaree_z',145,0x0000CB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5916,'Cherukiki','cherukiki',145,0x0000CC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5917,'IronEater','iron_eater',145,0x0000CD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5918,'Gessho','gessho',145,0x0000CE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5919,'Gadalar','gadalar',145,0x0000CF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5920,'Rainemard','rainemard',145,0x0000D00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5921,'Ingrid','ingrid',145,0x0000D10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5922,'LehkoHabhoka','lehko_habhoka',145,0x0000D20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5923,'Nashmeira','nashmeira',145,0x0000D30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5924,'Zazarg','zazarg',145,0x0000D40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5925,'Ovjang','ovjang',145,0x0000D50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5926,'Mnejing','mnejing',145,0x0000D60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5927,'Sakura','sakura',145,0x0000D70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5928,'Luzaf','luzaf',145,0x0000D80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5929,'Najelith','najelith',145,0x0000D90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5930,'Aldo','aldo',145,0x0000DA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5931,'Moogle','moogle',145,0x0000DB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5932,'Fablinix','fablinix',145,0x0000DC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5933,'Maat','maat',145,0x0000DD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5934,'D.Shantotto','d_shantotto',145,0x0000DE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5935,'StarSibyl','star_sibyl',145,0x0000DF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5936,'Karaha-Baruha','karaha-baruha',145,0x0000E00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5937,'Cid','cid',145,0x0000E10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5938,'Gilgamesh','gilgamesh',145,0x0000E20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5939,'Areuhat','areuhat',145,0x0000E30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5940,'SemihLafihna','semih_lafihna',145,0x0000E40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5941,'Elivira','elivira',145,0x0000E50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5942,'Noillurie','noillurie',145,0x0000E60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5943,'LhuMhakaracca','lhu_mhakaracca',145,0x0000E70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5944,'FerreousCoffin','ferreous_coffin',145,0x0000E80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5945,'Lilisette','lilisette',145,0x0000E90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5946,'Mumor','mumor',145,0x0000EA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5947,'UkaTotlihn','uka_totlihn',145,0x0000EB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5948,'Klara','klara',145,0x0000ED0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5949,'RomaaMihgo','romaa_mihgo',145,0x0000EE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5950,'KuyinHathdenna','kuyin_hathdenna',145,0x0000EF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5951,'Rahal','rahal',145,0x0000F00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5952,'Koru-Moru','koru-moru',145,0x0000F10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5953,'Pieuje','pieuje_uc',145,0x0000F20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5954,'InvincibleShld','i_shield_uc',145,0x0000F40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5955,'Apururu','apururu_uc',145,0x0000F50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5956,'JakohWahcondalo','jakoh_uc',145,0x0000F60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5957,'Flaviria','flaviria_uc',145,0x0000F30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5958,'Babban','babban',145,0x0000FB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5959,'Abenzio','abenzio',145,0x0000FC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5960,'Rughadjeen','rughadjeen',145,0x0000FD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5961,'Kukki-Chebukki','kukki-chebukki',145,0x0000FE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5962,'Margret','margret',145,0x0000FF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5963,'Chacharoon','chacharoon',145,0x0000000C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5964,'LheLhangavo','lhe_lhangavo',145,0x0000010C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5965,'Arciela','arciela',145,0x0000020C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5966,'Mayakov','mayakov',145,0x0000030C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5967,'Qultada','qultada',145,0x0000040C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5968,'Adelheid','adelheid',145,0x0000050C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5969,'Amchuchu','amchuchu',145,0x0000060C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5970,'Brygid','brygid',145,0x0000070C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5971,'Mildaurion','mildaurion',145,0x0000080C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5972,'Halver','halver',145,0x00000F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5973,'Rongelouts','rongelouts',145,0x0000100C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5974,'Leonoyne','leonoyne',145,0x0000110C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5975,'Maximilian','maximilian',145,0x0000120C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5976,'Kayeel-Payeel','kayeel-payeel',145,0x0000130C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5977,'Robel-Akbel','robel-akbel',145,0x0000140C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5978,'Kupofried','kupofried',145,0x0000150C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5979,'Selh\'teus','selh_teus',145,0x0000160C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5980,'Yoran-Oran','yoran-oran_uc',145,0x0000170C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5981,'Sylvie','sylvie_uc',145,0x0000180C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5982,'Abquhbah','abquhbah',145,0x00001A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5983,'Balamor','balamor',145,0x00001B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5984,'August','august',145,0x00001C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5985,'Rosulatia','rosulatia',145,0x00001D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5986,'Teodor','teodor',145,0x00001F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5987,'Ullegore','ullegore',145,0x0000210C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5988,'Makki-Chebukki','makki-chebukki',145,0x0000220C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5989,'KingOfHearts','king_of_hearts',145,0x0000230C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5990,'Morimar','morimar',145,0x0000240C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5991,'Darrcuiln','darrcuiln',145,0x0000250C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5992,'ArkHM','aahm',145,0x0000290C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5993,'ArkEV','aaev',145,0x00002A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5994,'ArkMR','aamr',145,0x00002B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5995,'ArkTT','aatt',145,0x00002C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5996,'ArkGK','aagk',145,0x00002D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5997,'Iroha','iroha',145,0x0000270C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (5998,'Ygnas','ygnas',145,0x00002E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); --- Reserved for future Trust 5999 +INSERT INTO `mob_pools` VALUES (5904,'Ajido-Marujido','ajido-marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,1,311,1,0,0); +INSERT INTO `mob_pools` VALUES (5905,'Trion','trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,310,1,0,10); +INSERT INTO `mob_pools` VALUES (5906,'Zeid','zeid',145,0x0000C20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5907,'Lion','lion',145,0x0000C30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5908,'Tenzen','tenzen',145,0x0000C40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5909,'MihliAliapoh','mihli_aliapoh',145,0x0000C50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5910,'Valaineral','valaineral',145,0x0000C60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5911,'Joachim','joachim',145,0x0000C70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5912,'NajaSalaheem','naja_salaheem',145,0x0000C80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5913,'Prishe','prishe',145,0x0000C90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5914,'Ulmia','ulmia',145,0x0000CA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5915,'ShikareeZ','shikaree_z',145,0x0000CB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5916,'Cherukiki','cherukiki',145,0x0000CC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5917,'IronEater','iron_eater',145,0x0000CD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5918,'Gessho','gessho',145,0x0000CE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5919,'Gadalar','gadalar',145,0x0000CF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5920,'Rainemard','rainemard',145,0x0000D00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5921,'Ingrid','ingrid',145,0x0000D10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5922,'LehkoHabhoka','lehko_habhoka',145,0x0000D20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5923,'Nashmeira','nashmeira',145,0x0000D30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5924,'Zazarg','zazarg',145,0x0000D40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5925,'Ovjang','ovjang',145,0x0000D50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5926,'Mnejing','mnejing',145,0x0000D60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5927,'Sakura','sakura',145,0x0000D70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5928,'Luzaf','luzaf',145,0x0000D80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5929,'Najelith','najelith',145,0x0000D90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5930,'Aldo','aldo',145,0x0000DA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5931,'Moogle','moogle',145,0x0000DB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5932,'Fablinix','fablinix',145,0x0000DC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5933,'Maat','maat',145,0x0000DD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5934,'D.Shantotto','d_shantotto',145,0x0000DE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5935,'StarSibyl','star_sibyl',145,0x0000DF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5936,'Karaha-Baruha','karaha-baruha',145,0x0000E00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5937,'Cid','cid',145,0x0000E10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5938,'Gilgamesh','gilgamesh',145,0x0000E20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5939,'Areuhat','areuhat',145,0x0000E30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5940,'SemihLafihna','semih_lafihna',145,0x0000E40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5941,'Elivira','elivira',145,0x0000E50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5942,'Noillurie','noillurie',145,0x0000E60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5943,'LhuMhakaracca','lhu_mhakaracca',145,0x0000E70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5944,'FerreousCoffin','ferreous_coffin',145,0x0000E80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5945,'Lilisette','lilisette',145,0x0000E90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5946,'Mumor','mumor',145,0x0000EA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5947,'UkaTotlihn','uka_totlihn',145,0x0000EB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5948,'Klara','klara',145,0x0000ED0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5949,'RomaaMihgo','romaa_mihgo',145,0x0000EE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5950,'KuyinHathdenna','kuyin_hathdenna',145,0x0000EF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5951,'Rahal','rahal',145,0x0000F00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5952,'Koru-Moru','koru-moru',145,0x0000F10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5953,'Pieuje','pieuje_uc',145,0x0000F20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5954,'InvincibleShld','i_shield_uc',145,0x0000F40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5955,'Apururu','apururu_uc',145,0x0000F50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5956,'JakohWahcondalo','jakoh_uc',145,0x0000F60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5957,'Flaviria','flaviria_uc',145,0x0000F30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5958,'Babban','babban',145,0x0000FB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5959,'Abenzio','abenzio',145,0x0000FC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5960,'Rughadjeen','rughadjeen',145,0x0000FD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5961,'Kukki-Chebukki','kukki-chebukki',145,0x0000FE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5962,'Margret','margret',145,0x0000FF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5963,'Chacharoon','chacharoon',145,0x0000000C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5964,'LheLhangavo','lhe_lhangavo',145,0x0000010C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5965,'Arciela','arciela',145,0x0000020C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5966,'Mayakov','mayakov',145,0x0000030C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5967,'Qultada','qultada',145,0x0000040C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5968,'Adelheid','adelheid',145,0x0000050C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5969,'Amchuchu','amchuchu',145,0x0000060C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5970,'Brygid','brygid',145,0x0000070C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5971,'Mildaurion','mildaurion',145,0x0000080C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5972,'Halver','halver',145,0x00000F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5973,'Rongelouts','rongelouts',145,0x0000100C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5974,'Leonoyne','leonoyne',145,0x0000110C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5975,'Maximilian','maximilian',145,0x0000120C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5976,'Kayeel-Payeel','kayeel-payeel',145,0x0000130C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5977,'Robel-Akbel','robel-akbel',145,0x0000140C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5978,'Kupofried','kupofried',145,0x0000150C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5979,'Selh\'teus','selh_teus',145,0x0000160C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5980,'Yoran-Oran','yoran-oran_uc',145,0x0000170C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5981,'Sylvie','sylvie_uc',145,0x0000180C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5982,'Abquhbah','abquhbah',145,0x00001A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5983,'Balamor','balamor',145,0x00001B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5984,'August','august',145,0x00001C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5985,'Rosulatia','rosulatia',145,0x00001D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5986,'Teodor','teodor',145,0x00001F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5987,'Ullegore','ullegore',145,0x0000210C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5988,'Makki-Chebukki','makki-chebukki',145,0x0000220C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5989,'KingOfHearts','king_of_hearts',145,0x0000230C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5990,'Morimar','morimar',145,0x0000240C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5991,'Darrcuiln','darrcuiln',145,0x0000250C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5992,'ArkHM','aahm',145,0x0000290C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5993,'ArkEV','aaev',145,0x00002A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5994,'ArkMR','aamr',145,0x00002B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5995,'ArkTT','aatt',145,0x00002C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5996,'ArkGK','aagk',145,0x00002D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5997,'Iroha','iroha',145,0x0000270C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5998,'Ygnas','ygnas',145,0x00002E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5999,'Monberaux','monberaux',145,0x00002E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -- Reserved for future Trust 6000 -- Reserved for future Trust 6001 -- Reserved for future Trust 6002 -INSERT INTO `mob_pools` VALUES (6003,'Cornelia','cornelia',145,0x00002F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6004,'Excenmille','excenmille_s',145,0x0000EC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6005,'Ayame','ayame_uc',145,0x0000F70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6006,'Maat','maat_uc',145,0x0000F80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6007,'Aldo','aldo_uc',145,0x0000F90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6008,'NajaSalaheem','naja_uc',145,0x0000FA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6009,'Lion','lion_ii',145,0x0000090C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6010,'Zeid','zeid_ii',145,0x00000E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6011,'Prishe','prishe_ii',145,0x00000A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6012,'Nashmeira','nashmeira_ii',145,0x00000B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6013,'Lilisette','lilisette_ii',145,0x00000C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6014,'Tenzen','tenzen_ii',145,0x0000190C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6015,'Mumor','mumor_ii',145,0x0000200C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6016,'Ingrid','ingrid_ii',145,0x00001E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6017,'Arciela','arciela_ii',145,0x00000D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6018,'Iroha','iroha_ii',145,0x0000280C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,10,1,0,10); -INSERT INTO `mob_pools` VALUES (6019,'Shantotto','shantotto_ii',153,0x0000260C00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,276,1,0,750); +INSERT INTO `mob_pools` VALUES (6003,'Cornelia','cornelia',145,0x00002F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6004,'Excenmille','excenmille_s',145,0x0000EC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6005,'Ayame','ayame_uc',145,0x0000F70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6006,'Maat','maat_uc',145,0x0000F80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6007,'Aldo','aldo_uc',145,0x0000F90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6008,'NajaSalaheem','naja_uc',145,0x0000FA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6009,'Lion','lion_ii',145,0x0000090C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6010,'Zeid','zeid_ii',145,0x00000E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6011,'Prishe','prishe_ii',145,0x00000A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6012,'Nashmeira','nashmeira_ii',145,0x00000B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6013,'Lilisette','lilisette_ii',145,0x00000C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6014,'Tenzen','tenzen_ii',145,0x0000190C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6015,'Mumor','mumor_ii',145,0x0000200C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6016,'Ingrid','ingrid_ii',145,0x00001E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6017,'Arciela','arciela_ii',145,0x00000D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6018,'Iroha','iroha_ii',145,0x0000280C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6019,'Shantotto','shantotto_ii',153,0x0000260C00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); -- Reserved for future Trust 6020 -- Reserved for future Trust 6021 -- Reserved for future Trust 6022 diff --git a/sql/mob_spell_lists.sql b/sql/mob_spell_lists.sql index 0f1139b4976..e934071070a 100644 --- a/sql/mob_spell_lists.sql +++ b/sql/mob_spell_lists.sql @@ -2515,67 +2515,107 @@ INSERT INTO `mob_spell_lists` VALUES ('Ghul-I-Beaban_BLM',305,174,1,255); -- fir INSERT INTO `mob_spell_lists` VALUES ('Ghul-I-Beaban_BLM',305,179,1,255); -- blizzaga INSERT INTO `mob_spell_lists` VALUES ('Saa_Doyi_the_Fervid',306,320,1,255); -- katon_ichi INSERT INTO `mob_spell_lists` VALUES ('Frost_Flambeau',307,180,1,255); -- blizzaga_ii --- Trust -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,144,9,255); -- Fire -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,145,34,255); -- Fire II -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,146,59,255); -- Fire III -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,147,72,255); -- Fire IV -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,148,83,255); -- Fire V -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,149,9,255); -- Blizzard -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,150,34,255); -- Blizzard II -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,151,59,255); -- Blizzard III -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,152,72,255); -- Blizzard IV -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,153,83,255); -- Blizzard V -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,154,9,255); -- Aero -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,155,34,255); -- Aero II -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,156,59,255); -- Aero III -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,157,72,255); -- Aero IV -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,158,83,255); -- Aero V -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,159,1,255); -- Stone -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,160,26,255); -- Stone II -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,161,51,255); -- Stone III -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,162,68,255); -- Stone IV -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,163,77,255); -- Stone V -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,164,5,255); -- Thunder -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,165,30,255); -- Thunder II -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,166,55,255); -- Thunder III -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,167,70,255); -- Thunder IV -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,168,80,255); -- Thunder V -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,169,5,255); -- Water -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,170,30,255); -- Water II -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,171,55,255); -- Water III -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,172,70,255); -- Water IV -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',308,173,80,255); -- Water V - -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,1,1,255); -- Cure -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,2,11,255); -- Cure II -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,3,21,255); -- Cure III -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,4,41,255); -- Cure IV -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,5,61,255); -- Cure V -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,6,80,255); -- Cure VI -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,125,7,255); -- Protectra -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,126,27,255); -- Protectra II -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,127,47,255); -- Protectra III -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,128,63,255); -- Protectra IV -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,129,75,255); -- Protectra V -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,130,17,255); -- Shellra -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,131,37,255); -- Shellra II -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,132,57,255); -- Shellra III -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,133,68,255); -- Shellra IV -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,134,75,255); -- Shellra V -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,143,32,255); -- Erase -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,58,6,255); -- Paralyze -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,56,13,255); -- Slow -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',309,112,45,255); -- Flash - -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Excenmille',310,1,5,255); -- Cure -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Excenmille',310,2,17,255); -- Cure II -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Excenmille',310,3,30,255); -- Cure III -INSERT INTO `mob_spell_lists` VALUES ('TRUST_Excenmille',310,4,55,255); -- Cure IV - - - - +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Curilla',308,1,5,255); -- Cure +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Curilla',308,2,17,255); -- Cure II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Curilla',308,3,30,255); -- Cure III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Curilla',308,4,55,255); -- Cure IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Curilla',308,112,37,255); -- Flash +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Excenmille',309,1,5,255); -- Cure +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Excenmille',309,2,17,255); -- Cure II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Excenmille',309,3,30,255); -- Cure III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Excenmille',309,4,55,255); -- Cure IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Excenmille',309,112,37,255); -- Flash +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Trion',310,1,5,255); -- Cure +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Trion',310,2,17,255); -- Cure II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Trion',310,3,30,255); -- Cure III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Trion',310,4,55,255); -- Cure IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Trion',310,112,37,255); -- Flash +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,1,3,255); -- Cure +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,2,14,255); -- Cure II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,3,26,255); -- Cure III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,4,48,255); -- Cure IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,56,13,255); -- Slow +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,144,13,255); -- Fire +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,145,38,255); -- Fire II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,146,62,255); -- Fire III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,147,73,255); -- Fire IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,148,86,255); -- Fire V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,149,17,255); -- Blizzard +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,150,42,255); -- Blizzard II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,151,64,255); -- Blizzard III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,152,74,255); -- Blizzard IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,153,89,255); -- Blizzard V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,154,9,255); -- Aero +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,155,34,255); -- Aero II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,156,59,255); -- Aero III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,157,72,255); -- Aero IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,158,83,255); -- Aero V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,159,1,255); -- Stone +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,160,26,255); -- Stone II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,161,51,255); -- Stone III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,162,68,255); -- Stone IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,163,77,255); -- Stone V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,164,21,255); -- Thunder +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,165,46,255); -- Thunder II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,166,66,255); -- Thunder III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,167,75,255); -- Thunder IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,168,92,255); -- Thunder V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,169,5,255); -- Water +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,170,30,255); -- Water II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,171,55,255); -- Water III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,172,70,255); -- Water IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,173,80,255); -- Water V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Ajido-Marujido',311,260,32,255); -- Dispel +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,1,1,255); -- Cure +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,2,11,255); -- Cure II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,3,21,255); -- Cure III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,4,41,255); -- Cure IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,5,61,255); -- Cure V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,6,80,255); -- Cure VI +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,125,7,255); -- Protectra +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,126,27,255); -- Protectra II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,127,47,255); -- Protectra III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,128,63,255); -- Protectra IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,129,75,255); -- Protectra V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,130,17,255); -- Shellra +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,131,37,255); -- Shellra II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,132,57,255); -- Shellra III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,133,68,255); -- Shellra IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,134,75,255); -- Shellra V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,143,32,255); -- Erase +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,58,4,255); -- Paralyze +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,56,13,255); -- Slow +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Kupipi',312,112,45,255); -- Flash +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,144,13,255); -- Fire +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,145,38,255); -- Fire II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,146,62,255); -- Fire III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,147,73,255); -- Fire IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,148,86,255); -- Fire V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,149,17,255); -- Blizzard +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,150,42,255); -- Blizzard II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,151,64,255); -- Blizzard III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,152,74,255); -- Blizzard IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,153,89,255); -- Blizzard V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,154,9,255); -- Aero +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,155,34,255); -- Aero II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,156,59,255); -- Aero III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,157,72,255); -- Aero IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,158,83,255); -- Aero V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,159,1,255); -- Stone +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,160,26,255); -- Stone II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,161,51,255); -- Stone III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,162,68,255); -- Stone IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,163,77,255); -- Stone V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,164,21,255); -- Thunder +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,165,46,255); -- Thunder II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,166,66,255); -- Thunder III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,167,75,255); -- Thunder IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,168,92,255); -- Thunder V +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,169,5,255); -- Water +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,170,30,255); -- Water II +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,171,55,255); -- Water III +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,172,70,255); -- Water IV +INSERT INTO `mob_spell_lists` VALUES ('TRUST_Shantotto',313,173,80,255); -- Water V /*!40000 ALTER TABLE `mob_spell_lists` ENABLE KEYS */; UNLOCK TABLES; From b662b39ef035c71ced0386d2c8fdf9efdd0e4cb3 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 15 Mar 2020 15:45:43 +0200 Subject: [PATCH 040/116] Zero out skill lists too until theres a plan --- sql/mob_pools.sql | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index 8411c089888..1fe8fffbbfe 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5954,16 +5954,16 @@ INSERT INTO `mob_pools` VALUES (5893,'Gloombound_Lurker','Gloombound_Lurker',221 INSERT INTO `mob_pools` VALUES (5894,'Lesath','Lesath',217,0x00001C0100000000000000000000000000000000,1,1,7,280,100,0,1,0,1,2,7,0,238,141,0,0,0,1,0,370); INSERT INTO `mob_pools` VALUES (5895,'Donggu','Donggu',116,0x0000780100000000000000000000000000000000,1,1,11,240,100,0,0,0,1,2,7,0,0,3,0,0,0,1,0,116); -- Trusts -INSERT INTO `mob_pools` VALUES (5896,'Shantotto','shantotto',153,0x0000B80B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,750); -INSERT INTO `mob_pools` VALUES (5897,'Naji','naji',149,0x0000B90B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,0,1,0,750); -INSERT INTO `mob_pools` VALUES (5898,'Kupipi','kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,1,312,1,0,3); -INSERT INTO `mob_pools` VALUES (5899,'Excenmille','excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,309,1,0,4); -INSERT INTO `mob_pools` VALUES (5900,'Ayame','ayame',149,0x0000BC0B00000000000000000000000000000000,12,0,10,440,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,5); -INSERT INTO `mob_pools` VALUES (5901,'NanaaMihgo','nanaa_mihgo',152,0x0000BD0B00000000000000000000000000000000,6,0,2,190,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,6); -INSERT INTO `mob_pools` VALUES (5902,'Curilla','curilla',145,0x0000BE0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,308,1,0,7); -INSERT INTO `mob_pools` VALUES (5903,'Volker','volker',149,0x0000BF0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,8,1,0,8); +INSERT INTO `mob_pools` VALUES (5896,'Shantotto','shantotto',153,0x0000B80B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); +INSERT INTO `mob_pools` VALUES (5897,'Naji','naji',149,0x0000B90B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5898,'Kupipi','kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,1,312,1,0,0); +INSERT INTO `mob_pools` VALUES (5899,'Excenmille','excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,309,1,0,0); +INSERT INTO `mob_pools` VALUES (5900,'Ayame','ayame',149,0x0000BC0B00000000000000000000000000000000,12,0,10,440,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5901,'NanaaMihgo','nanaa_mihgo',152,0x0000BD0B00000000000000000000000000000000,6,0,2,190,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5902,'Curilla','curilla',145,0x0000BE0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,308,1,0,0); +INSERT INTO `mob_pools` VALUES (5903,'Volker','volker',149,0x0000BF0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,8,1,0,0); INSERT INTO `mob_pools` VALUES (5904,'Ajido-Marujido','ajido-marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,1,311,1,0,0); -INSERT INTO `mob_pools` VALUES (5905,'Trion','trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,310,1,0,10); +INSERT INTO `mob_pools` VALUES (5905,'Trion','trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,310,1,0,0); INSERT INTO `mob_pools` VALUES (5906,'Zeid','zeid',145,0x0000C20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5907,'Lion','lion',145,0x0000C30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5908,'Tenzen','tenzen',145,0x0000C40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); From 6c553dfde5075f5eafdcf14779e15f8880cc3929 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 15 Mar 2020 15:47:03 +0200 Subject: [PATCH 041/116] Shantotto spell lists are the same for now --- sql/mob_pools.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index 1fe8fffbbfe..49b0a7165d4 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5992,7 +5992,7 @@ INSERT INTO `mob_pools` VALUES (5930,'Aldo','aldo',145,0x0000DA0B000000000000000 INSERT INTO `mob_pools` VALUES (5931,'Moogle','moogle',145,0x0000DB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5932,'Fablinix','fablinix',145,0x0000DC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5933,'Maat','maat',145,0x0000DD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5934,'D.Shantotto','d_shantotto',145,0x0000DE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5934,'D.Shantotto','d_shantotto',145,0x0000DE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,313,1,0,0); INSERT INTO `mob_pools` VALUES (5935,'StarSibyl','star_sibyl',145,0x0000DF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5936,'Karaha-Baruha','karaha-baruha',145,0x0000E00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5937,'Cid','cid',145,0x0000E10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); From 71d7dda87357e292a715a9df9d961bd51112c7fc Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 15 Mar 2020 16:26:56 +0200 Subject: [PATCH 042/116] Add isValidHealTarget(caster, target) helper --- scripts/globals/magic.lua | 8 ++++++++ scripts/globals/spells/cure.lua | 2 +- scripts/globals/spells/cure_ii.lua | 2 +- scripts/globals/spells/cure_iii.lua | 2 +- scripts/globals/spells/cure_iv.lua | 2 +- scripts/globals/spells/cure_v.lua | 2 +- scripts/globals/spells/cure_vi.lua | 2 +- scripts/globals/status.lua | 13 +++++++------ 8 files changed, 21 insertions(+), 12 deletions(-) diff --git a/scripts/globals/magic.lua b/scripts/globals/magic.lua index 10161b8b7f6..a10eefd4ead 100644 --- a/scripts/globals/magic.lua +++ b/scripts/globals/magic.lua @@ -309,6 +309,14 @@ function getCureAsNukeFinal(caster,spell,power,divisor,constant,basepower) return getCureFinal(caster,spell,power,divisor,constant,basepower) end +function isValidHealTarget(caster, target) + return target:getAllegiance() == caster:getAllegiance() and + (target:getObjType() == tpz.objType.PC or + target:getObjType() == tpz.objType.MOB or + target:getObjType() == tpz.objType.TRUST or + target:getObjType() == tpz.objType.FELLOW) +end + ----------------------------------- -- Returns the staff bonus for the caster and spell. ----------------------------------- diff --git a/scripts/globals/spells/cure.lua b/scripts/globals/spells/cure.lua index 3604bf3f07a..f220abb69ce 100644 --- a/scripts/globals/spells/cure.lua +++ b/scripts/globals/spells/cure.lua @@ -62,7 +62,7 @@ function onSpellCast(caster,target,spell) end end - if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == tpz.objType.PC or target:getObjType() == tpz.objType.MOB or target:getObjType() == tpz.objType.TRUST)) then + if isValidHealTarget(caster, target) then if (USE_OLD_CURE_FORMULA == true) then basecure = getBaseCureOld(power,divisor,constant) else diff --git a/scripts/globals/spells/cure_ii.lua b/scripts/globals/spells/cure_ii.lua index 0d7f19c4be1..49511816eb5 100644 --- a/scripts/globals/spells/cure_ii.lua +++ b/scripts/globals/spells/cure_ii.lua @@ -62,7 +62,7 @@ function onSpellCast(caster,target,spell) end end - if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == tpz.objType.PC or target:getObjType() == tpz.objType.MOB)) then + if isValidHealTarget(caster, target) then if (USE_OLD_CURE_FORMULA == true) then basecure = getBaseCureOld(power,divisor,constant) else diff --git a/scripts/globals/spells/cure_iii.lua b/scripts/globals/spells/cure_iii.lua index 865c8d5aa98..d36ab92b104 100644 --- a/scripts/globals/spells/cure_iii.lua +++ b/scripts/globals/spells/cure_iii.lua @@ -58,7 +58,7 @@ function onSpellCast(caster,target,spell) end end - if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == tpz.objType.PC or target:getObjType() == tpz.objType.MOB)) then + if isValidHealTarget(caster, target) then if (USE_OLD_CURE_FORMULA == true) then basecure = getBaseCureOld(power,divisor,constant) else diff --git a/scripts/globals/spells/cure_iv.lua b/scripts/globals/spells/cure_iv.lua index a88af166bdb..1b2a690b456 100644 --- a/scripts/globals/spells/cure_iv.lua +++ b/scripts/globals/spells/cure_iv.lua @@ -56,7 +56,7 @@ function onSpellCast(caster,target,spell) basepower = 0 end end - if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == tpz.objType.PC or target:getObjType() == tpz.objType.MOB)) then + if isValidHealTarget(caster, target) then if (USE_OLD_CURE_FORMULA == true) then basecure = getBaseCureOld(power,divisor,constant) else diff --git a/scripts/globals/spells/cure_v.lua b/scripts/globals/spells/cure_v.lua index 131e29afb7e..67adac66cc1 100644 --- a/scripts/globals/spells/cure_v.lua +++ b/scripts/globals/spells/cure_v.lua @@ -66,7 +66,7 @@ function onSpellCast(caster,target,spell) end end - if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == tpz.objType.PC or target:getObjType() == tpz.objType.MOB)) then -- e.g. is a PC and not a monster (?) + if isValidHealTarget(caster, target) then -- e.g. is a PC and not a monster (?) if (USE_OLD_CURE_FORMULA == true) then basecure = getBaseCureOld(power,divisor,constant) else diff --git a/scripts/globals/spells/cure_vi.lua b/scripts/globals/spells/cure_vi.lua index 7b0af012801..4bd414f45fb 100644 --- a/scripts/globals/spells/cure_vi.lua +++ b/scripts/globals/spells/cure_vi.lua @@ -49,7 +49,7 @@ function onSpellCast(caster,target,spell) basepower = 0 end - if (target:getAllegiance() == caster:getAllegiance() and (target:getObjType() == tpz.objType.PC or target:getObjType() == tpz.objType.MOB)) then + if isValidHealTarget(caster, target) then basecure = getBaseCure(power,divisor,constant,basepower) final = getCureFinal(caster,spell,basecure,minCure,false) if (caster:hasStatusEffect(tpz.effect.AFFLATUS_SOLACE) and target:hasStatusEffect(tpz.effect.STONESKIN) == false) then diff --git a/scripts/globals/status.lua b/scripts/globals/status.lua index df7369e5608..e44e8df2bb2 100644 --- a/scripts/globals/status.lua +++ b/scripts/globals/status.lua @@ -2103,12 +2103,13 @@ tpz.MAX_SLOTID = 15 tpz.objType = { - PC = 0x01, - NPC = 0x02, - MOB = 0x04, - PET = 0x08, - SHIP = 0x10, - TRUST = 0x20, + PC = 0x01, + NPC = 0x02, + MOB = 0x04, + PET = 0x08, + SHIP = 0x10, + TRUST = 0x20, + FELLOW = 0x40, } ---------------------------------- From aea9b9a94d18f00be2344128aa9da1bdbcbb53bf Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 15 Mar 2020 16:28:05 +0200 Subject: [PATCH 043/116] Add ForEachTrust and ForEachTrustInstance --- src/map/ai/helpers/targetfind.cpp | 7 ++++++- src/map/entities/baseentity.h | 15 ++++++++------- src/map/zone.cpp | 16 ++++++++++++++++ src/map/zone.h | 3 +++ 4 files changed, 33 insertions(+), 8 deletions(-) diff --git a/src/map/ai/helpers/targetfind.cpp b/src/map/ai/helpers/targetfind.cpp index 23038e351ea..43b448763e1 100644 --- a/src/map/ai/helpers/targetfind.cpp +++ b/src/map/ai/helpers/targetfind.cpp @@ -240,6 +240,11 @@ void CTargetFind::addAllInZone(CBattleEntity* PTarget, bool withPet) addEntity(PMob, withPet); } }); + zoneutils::GetZone(PTarget->getZone())->ForEachTrustInstance(PTarget, [&](CTrustEntity* PTrust){ + if (PTrust){ + addEntity(PTrust, withPet); + } + }); } void CTargetFind::addAllInAlliance(CBattleEntity* PTarget, bool withPet) @@ -254,7 +259,7 @@ void CTargetFind::addAllInParty(CBattleEntity* PTarget, bool withPet) { PTarget->ForParty([this, withPet](CBattleEntity* PMember) { - // add my Trust too because why not? + // Add Trust if (PMember->objtype == TYPE_PC) { auto* PChar = (CCharEntity*)PMember; diff --git a/src/map/entities/baseentity.h b/src/map/entities/baseentity.h index 174b2cce527..8803fa6f620 100644 --- a/src/map/entities/baseentity.h +++ b/src/map/entities/baseentity.h @@ -30,13 +30,14 @@ enum ENTITYTYPE { - TYPE_NONE = 0x00, - TYPE_PC = 0x01, - TYPE_NPC = 0x02, - TYPE_MOB = 0x04, - TYPE_PET = 0x08, - TYPE_SHIP = 0x10, - TYPE_TRUST = 0x20 + TYPE_NONE = 0x00, + TYPE_PC = 0x01, + TYPE_NPC = 0x02, + TYPE_MOB = 0x04, + TYPE_PET = 0x08, + TYPE_SHIP = 0x10, + TYPE_TRUST = 0x20, + TYPE_FELLOW = 0x40 }; enum STATUSTYPE diff --git a/src/map/zone.cpp b/src/map/zone.cpp index 031937df335..318646d62c0 100644 --- a/src/map/zone.cpp +++ b/src/map/zone.cpp @@ -836,6 +836,22 @@ void CZone::ForEachMobInstance(CBaseEntity* PEntity, std::function func) +{ + for (auto PTrust : m_zoneEntities->m_trustList) + { + func((CTrustEntity*)PTrust.second); + } +} + +void CZone::ForEachTrustInstance(CBaseEntity* PEntity, std::function func) +{ + for (auto PTrust : m_zoneEntities->m_trustList) + { + func((CTrustEntity*)PTrust.second); + } +} + void CZone::ForEachNpc(std::function func) { for (auto PNpc : m_zoneEntities->m_npcList) diff --git a/src/map/zone.h b/src/map/zone.h index e56d271ecf8..72f443b9f6d 100644 --- a/src/map/zone.h +++ b/src/map/zone.h @@ -509,6 +509,7 @@ class CBaseEntity; class CCharEntity; class CNpcEntity; class CBattleEntity; +class CTrustEntity; class CTreasurePool; class CZoneEntities; @@ -591,6 +592,8 @@ class CZone virtual void ForEachCharInstance(CBaseEntity* PEntity, std::function func); virtual void ForEachMob(std::function func); virtual void ForEachMobInstance(CBaseEntity* PEntity, std::function func); + virtual void ForEachTrust(std::function func); + virtual void ForEachTrustInstance(CBaseEntity* PEntity, std::function func); virtual void ForEachNpc(std::function func); CZone(ZONEID ZoneID, REGIONTYPE RegionID, CONTINENTTYPE ContinentID); From 60834ffb26842ab6e65180b68e4e1824dd9a9f5f Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 15 Mar 2020 16:28:26 +0200 Subject: [PATCH 044/116] Revert trust_sync packet until I understand how it works --- src/map/packets/trust_sync.cpp | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/src/map/packets/trust_sync.cpp b/src/map/packets/trust_sync.cpp index fcfa0282e8c..1746407fcb7 100644 --- a/src/map/packets/trust_sync.cpp +++ b/src/map/packets/trust_sync.cpp @@ -31,34 +31,22 @@ CTrustSyncPacket::CTrustSyncPacket(CCharEntity* PChar, CTrustEntity* PTrust) // The purpose of this packet is to make the client aware that this pet is a trust, and hence // to show trust options in the menu (like "Release"). this->type = 0x67; - this->size = 0x0C; + this->size = 0x16; // Sample packet: // 67 0C 58 00 03 05 F4 07 F4 28 08 01 00 04 00 00 // 04 00 00 00 00 00 00 00 - if (PTrust->PMaster && PTrust->PMaster->id == PChar->id) - { - ref(0x04) = 0x03; - ref(0x05) = 0x05; - } + ref(0x04) = 0x03; + ref(0x05) = 0x05; ref(0x06) = PTrust->targid; ref(0x08) = PTrust->id; + ref(0x0C) = PChar->targid; - if (PTrust) - { - this->size = 0x16; - packBitsBE(data + (0x04), (0x18) + PTrust->name.size(), 0, 6, 10); // Message Size - - if(PChar) - { - ref(0x0C) = PChar->targid; - } - - memcpy(data + (0x18), PTrust->GetName(), PTrust->name.size()); - } + packBitsBE(data + (0x04), (0x18) + PTrust->name.size(), 0, 6, 10); // Message Size + memcpy(data + (0x18), PTrust->GetName(), PTrust->name.size()); // Unknown - //ref(0x10) = 0x04; + ref(0x10) = 0x04; } From 827d6c2263c985db7c23547e14154f80f1e847d0 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 15 Mar 2020 16:31:38 +0200 Subject: [PATCH 045/116] Stop trusts despawning when a mount is present --- src/map/ai/controllers/trust_controller.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index aae5552279f..e717c84fef5 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -69,8 +69,7 @@ void CTrustController::Tick(time_point tick) void CTrustController::DoCombatTick(time_point tick) { - if ((POwner->PMaster == nullptr || POwner->PMaster->isMounted() || - POwner->PMaster->isDead()) && POwner->isAlive()) + if (POwner->PMaster == nullptr || (POwner->PMaster->isDead() && POwner->isAlive())) { POwner->Die(); return; From 402bc0758ad909330d553e196463c75451064b8a Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 15 Mar 2020 17:10:21 +0200 Subject: [PATCH 046/116] Reject trusts in an alliance by default --- scripts/globals/trust.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index 7f61bd4f843..c2c600040e5 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -11,13 +11,21 @@ tpz = tpz or {} tpz.trust = tpz.trust or {} tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) + + -- Trusts not allowed in an alliance + if caster:checkSoloPartyAlliance() == 2 then + return tpz.msg.basic.CANT_BE_USED_IN_AREA + end + + -- Trusts only allowed in certain zones if not caster:canUseMisc(tpz.zoneMisc.TRUST) then -- TODO: Update area flags --return tpz.msg.basic.CANT_BE_USED_IN_AREA end + -- You can only summon trusts if you are the party leader or solo local leader = caster:getPartyLeader() - if leader and caster:getID() ~= leader:getID() then + if caster:checkSoloPartyAlliance() == 0 or (leader and caster:getID() ~= leader:getID()) then return tpz.msg.basic.CANT_BE_USED_IN_AREA end From be83ea63f4f4edc776ed6caa8d2557951c31f409 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 15 Mar 2020 17:35:36 +0200 Subject: [PATCH 047/116] Move trust core logic to trustutils --- scripts/globals/trust.lua | 2 +- src/map/lua/lua_baseentity.cpp | 3 +- src/map/map.cpp | 5 +- src/map/utils/petutils.cpp | 460 ------------------- src/map/utils/petutils.h | 6 - src/map/utils/trustutils.cpp | 534 +++++++++++++++++++++++ src/map/utils/trustutils.h | 20 + win32/vcxproj/topaz_game.vcxproj | 2 + win32/vcxproj/topaz_game.vcxproj.filters | 6 + 9 files changed, 568 insertions(+), 470 deletions(-) create mode 100644 src/map/utils/trustutils.cpp create mode 100644 src/map/utils/trustutils.h diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index c2c600040e5..79ba6e81d3f 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -25,7 +25,7 @@ tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) -- You can only summon trusts if you are the party leader or solo local leader = caster:getPartyLeader() - if caster:checkSoloPartyAlliance() == 0 or (leader and caster:getID() ~= leader:getID()) then + if leader and caster:getID() ~= leader:getID() then return tpz.msg.basic.CANT_BE_USED_IN_AREA end diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index 4d2e785bbcd..bc8685faaca 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -142,6 +142,7 @@ #include "../utils/mobutils.h" #include "../utils/petutils.h" #include "../utils/puppetutils.h" +#include "../utils/trustutils.h" #include "../utils/zoneutils.h" CLuaBaseEntity::CLuaBaseEntity(lua_State* L) @@ -11902,7 +11903,7 @@ inline int32 CLuaBaseEntity::spawnTrust(lua_State *L) if (!lua_isnil(L, 1) && lua_isstring(L, 1)) { uint16 trustId = (uint16)lua_tointeger(L, 1); - petutils::SpawnTrust((CCharEntity*)m_PBaseEntity, trustId); + trustutils::SpawnTrust((CCharEntity*)m_PBaseEntity, trustId); } else { diff --git a/src/map/map.cpp b/src/map/map.cpp index 5badd7518ad..91f1918a3d0 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -47,6 +47,7 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "packet_system.h" #include "party.h" #include "utils/petutils.h" +#include "utils/trustutils.h" #include "spell.h" #include "time_server.h" #include "transport.h" @@ -217,7 +218,7 @@ int32 do_init(int32 argc, char** argv) battleutils::LoadMobSkillsList(); battleutils::LoadSkillChainDamageModifiers(); petutils::LoadPetList(); - petutils::LoadTrustList(); + trustutils::LoadTrustList(); mobutils::LoadCustomMods(); ShowStatus("do_init: loading zones"); @@ -264,7 +265,7 @@ void do_final(int code) battleutils::FreeMobSkillList(); petutils::FreePetList(); - petutils::FreeTrustList(); + trustutils::FreeTrustList(); zoneutils::FreeZoneList(); luautils::free(); message::close(); diff --git a/src/map/utils/petutils.cpp b/src/map/utils/petutils.cpp index d8b56a88be7..e233a934ac9 100644 --- a/src/map/utils/petutils.cpp +++ b/src/map/utils/petutils.cpp @@ -34,7 +34,6 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "petutils.h" #include "zoneutils.h" #include "../entities/mobentity.h" -#include "../entities/trustentity.h" #include "../entities/automatonentity.h" #include "../ability.h" #include "../status_effect_container.h" @@ -56,8 +55,6 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "../packets/entity_update.h" #include "../packets/message_standard.h" #include "../packets/pet_sync.h" -#include "../packets/trust_sync.h" -#include "../ai/controllers/trust_controller.h" struct Pet_t { @@ -127,77 +124,6 @@ struct Pet_t std::vector g_PPetList; -struct TrustSpell_ID -{ - uint32 spellID; -}; - -std::vector g_PTrustIDList; - -struct Trust_t -{ - uint32 trustID; - look_t look; // appearance data - string_t name; // name string - ECOSYSTEM EcoSystem; // ecosystem - - uint8 name_prefix; - uint8 size; // размер модели - uint16 m_Family; - - uint8 mJob; - uint8 sJob; - float HPscale; // HP boost percentage - float MPscale; // MP boost percentage - - uint16 cmbDelay; - uint8 speed; - // stat ranks - uint8 strRank; - uint8 dexRank; - uint8 vitRank; - uint8 agiRank; - uint8 intRank; - uint8 mndRank; - uint8 chrRank; - uint8 attRank; - uint8 defRank; - uint8 evaRank; - uint8 accRank; - - uint16 m_MobSkillList; - - // magic stuff - bool hasSpellScript; - uint16 spellList; - - // resists - int16 slashres; - int16 pierceres; - int16 hthres; - int16 impactres; - - int16 firedef; - int16 icedef; - int16 winddef; - int16 earthdef; - int16 thunderdef; - int16 waterdef; - int16 lightdef; - int16 darkdef; - - int16 fireres; - int16 iceres; - int16 windres; - int16 earthres; - int16 thunderres; - int16 waterres; - int16 lightres; - int16 darkres; -}; - -std::vector g_PTrustList; - namespace petutils { @@ -316,134 +242,6 @@ namespace petutils } } - void LoadTrustList() - { - FreeTrustList(); - - const char* Query = - "SELECT \ - spell_list.spellid, mob_pools.poolid \ - FROM spell_list, mob_pools \ - WHERE spell_list.spellid >= 896 AND mob_pools.poolid = (spell_list.spellid+5000) ORDER BY spell_list.spellid"; - - if (Sql_Query(SqlHandle, Query) != SQL_ERROR && Sql_NumRows(SqlHandle) != 0) - { - while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) - { - TrustSpell_ID* trustID = new TrustSpell_ID(); - - trustID->spellID = (uint32)Sql_GetIntData(SqlHandle, 0); - - g_PTrustIDList.push_back(trustID); - } - } - - for (uint32 index = 0; index < g_PTrustIDList.size(); index++) - { - BuildTrust(g_PTrustIDList.at(index)->spellID); - } - } - - void BuildTrust(uint32 TrustID) - { - const char* Query = - "SELECT \ - mob_pools.name,\ - modelid,\ - mobsize,\ - systemid,\ - mob_pools.familyid,\ - mob_pools.mJob,\ - mob_pools.sJob,\ - (mob_family_system.HP / 100), \ - (mob_family_system.MP / 100), \ - mob_family_system.speed, \ - mob_family_system.STR, \ - mob_family_system.DEX, \ - mob_family_system.VIT, \ - mob_family_system.AGI, \ - mob_family_system.INT, \ - mob_family_system.MND, \ - mob_family_system.CHR, \ - mob_family_system.DEF, \ - mob_family_system.ATT, \ - mob_family_system.ACC, \ - mob_family_system.EVA, \ - hasSpellScript, spellList, \ - Slash, Pierce, H2H, Impact, \ - Fire, Ice, Wind, Earth, Lightning, Water, Light, Dark, \ - cmbDelay, name_prefix, mob_pools.skill_list_id, \ - spell_list.spellid, mob_pools.behavior \ - FROM spell_list, mob_pools, mob_family_system WHERE spell_list.spellid = %u \ - AND (spell_list.spellid+5000) = mob_pools.poolid AND mob_pools.familyid = mob_family_system.familyid ORDER BY spell_list.spellid"; - - uint32 ret = Sql_Query(SqlHandle, Query, TrustID); - - if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) != 0) - { - while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) - { - Trust_t* trust = new Trust_t(); - - trust->trustID = TrustID; - trust->name.insert(0, (const char*)Sql_GetData(SqlHandle, 0)); - memcpy(&trust->look, Sql_GetData(SqlHandle, 1), 20); - - trust->size = Sql_GetUIntData(SqlHandle, 2); - trust->EcoSystem = (ECOSYSTEM)Sql_GetIntData(SqlHandle, 3); - trust->m_Family = (uint16)Sql_GetIntData(SqlHandle, 4); - trust->mJob = (uint8)Sql_GetIntData(SqlHandle, 5); - trust->sJob = (uint8)Sql_GetIntData(SqlHandle, 6); - trust->HPscale = Sql_GetFloatData(SqlHandle, 7); - trust->MPscale = Sql_GetFloatData(SqlHandle, 8); - trust->speed = (uint8)Sql_GetIntData(SqlHandle, 9); - trust->strRank = (uint8)Sql_GetIntData(SqlHandle, 10); - trust->dexRank = (uint8)Sql_GetIntData(SqlHandle, 11); - trust->vitRank = (uint8)Sql_GetIntData(SqlHandle, 12); - trust->agiRank = (uint8)Sql_GetIntData(SqlHandle, 13); - trust->intRank = (uint8)Sql_GetIntData(SqlHandle, 14); - trust->mndRank = (uint8)Sql_GetIntData(SqlHandle, 15); - trust->chrRank = (uint8)Sql_GetIntData(SqlHandle, 16); - trust->defRank = (uint8)Sql_GetIntData(SqlHandle, 17); - trust->attRank = (uint8)Sql_GetIntData(SqlHandle, 18); - trust->accRank = (uint8)Sql_GetIntData(SqlHandle, 19); - trust->evaRank = (uint8)Sql_GetIntData(SqlHandle, 20); - trust->hasSpellScript = (bool)Sql_GetIntData(SqlHandle, 21); - trust->spellList = (uint16)Sql_GetIntData(SqlHandle, 22); - - // resistances - trust->slashres = (uint16)(Sql_GetFloatData(SqlHandle, 23) * 1000); - trust->pierceres = (uint16)(Sql_GetFloatData(SqlHandle, 24) * 1000); - trust->hthres = (uint16)(Sql_GetFloatData(SqlHandle, 25) * 1000); - trust->impactres = (uint16)(Sql_GetFloatData(SqlHandle, 26) * 1000); - - trust->firedef = 0; - trust->icedef = 0; - trust->winddef = 0; - trust->earthdef = 0; - trust->thunderdef = 0; - trust->waterdef = 0; - trust->lightdef = 0; - trust->darkdef = 0; - - trust->fireres = (uint16)((Sql_GetFloatData(SqlHandle, 27) - 1) * -100); - trust->iceres = (uint16)((Sql_GetFloatData(SqlHandle, 28) - 1) * -100); - trust->windres = (uint16)((Sql_GetFloatData(SqlHandle, 29) - 1) * -100); - trust->earthres = (uint16)((Sql_GetFloatData(SqlHandle, 30) - 1) * -100); - trust->thunderres = (uint16)((Sql_GetFloatData(SqlHandle, 31) - 1) * -100); - trust->waterres = (uint16)((Sql_GetFloatData(SqlHandle, 32) - 1) * -100); - trust->lightres = (uint16)((Sql_GetFloatData(SqlHandle, 33) - 1) * -100); - trust->darkres = (uint16)((Sql_GetFloatData(SqlHandle, 34) - 1) * -100); - - trust->cmbDelay = (uint16)Sql_GetIntData(SqlHandle, 35); - trust->name_prefix = (uint8)Sql_GetUIntData(SqlHandle, 36); - trust->m_MobSkillList = (uint16)Sql_GetUIntData(SqlHandle, 37); - - g_PTrustList.push_back(trust); - } - } - } - /************************************************************************ * * * Освобождаем список прототипов питомцев * @@ -459,11 +257,6 @@ namespace petutils } } - void FreeTrustList() - { - g_PTrustIDList.clear(); - } - void AttackTarget(CBattleEntity* PMaster, CBattleEntity* PTarget) { TPZ_DEBUG_BREAK_IF(PMaster->PPet == nullptr); @@ -839,190 +632,6 @@ namespace petutils } } - void LoadTrustStats(CTrustEntity* PTrust) - { - // Cargo cult of PC calculations. - - float raceStat = 0; // конечное число HP для уровня на основе расы. - float jobStat = 0; // конечное число HP для уровня на основе первичной профессии. - float sJobStat = 0; // коенчное число HP для уровня на основе вторичной профессии. - int32 bonusStat = 0; // бонусное число HP которое добавляется при соблюдении некоторых условий. - - int32 baseValueColumn = 0; // номер колонки с базовым количеством HP - int32 scaleTo60Column = 1; // номер колонки с модификатором до 60 уровня - int32 scaleOver30Column = 2; // номер колонки с модификатором после 30 уровня - int32 scaleOver60Column = 3; // номер колонки с модификатором после 60 уровня - int32 scaleOver75Column = 4; // номер колонки с модификатором после 75 уровня - int32 scaleOver60 = 2; // номер колонки с модификатором для расчета MP после 60 уровня - int32 scaleOver75 = 3; // номер колонки с модификатором для расчета Статов после 75-го уровня - - uint8 grade; - - uint8 mlvl = PTrust->GetMLevel(); - uint8 slvl = PTrust->GetSLevel(); - JOBTYPE mjob = PTrust->GetMJob(); - JOBTYPE sjob = PTrust->GetSJob(); - - uint8 race = 0; //Human - - switch (PTrust->look.race) - { - case 3: - case 4: race = 1; break; //Elvaan - case 5: - case 6: race = 2; break; //Tarutaru - case 7: race = 3; break; //Mithra - case 8: race = 4; break; //Galka - } - - // Расчет прироста HP от main job - - int32 mainLevelOver30 = std::clamp(mlvl - 30, 0, 30); // Расчет условия +1HP каждый лвл после 30 уровня - int32 mainLevelUpTo60 = (mlvl < 60 ? mlvl - 1 : 59); // Первый режим рассчета до 60 уровня (Используется так же и для MP) - int32 mainLevelOver60To75 = std::clamp(mlvl - 60, 0, 15); // Второй режим расчета после 60 уровня - int32 mainLevelOver75 = (mlvl < 75 ? 0 : mlvl - 75); // Третий режим расчета после 75 уровня - - //Расчет бонусного количества HP - - int32 mainLevelOver10 = (mlvl < 10 ? 0 : mlvl - 10); // +2HP на каждом уровне после 10 - int32 mainLevelOver50andUnder60 = std::clamp(mlvl - 50, 0, 10); // +2HP на каждом уровне в промежутке от 50 до 60 уровня - int32 mainLevelOver60 = (mlvl < 60 ? 0 : mlvl - 60); - - // Расчет прироста HP от дополнительной профессии - - int32 subLevelOver10 = std::clamp(slvl - 10, 0, 20); // +1HP на каждый уровень после 10 (/2) - int32 subLevelOver30 = (slvl < 30 ? 0 : slvl - 30); // +1HP на каждый уровень после 30 - - // Расчет raceStat jobStat bonusStat sJobStat - // Расчет по расе - - grade = grade::GetRaceGrades(race, 0); - - raceStat = grade::GetHPScale(grade, baseValueColumn) + - (grade::GetHPScale(grade, scaleTo60Column) * mainLevelUpTo60) + - (grade::GetHPScale(grade, scaleOver30Column) * mainLevelOver30) + - (grade::GetHPScale(grade, scaleOver60Column) * mainLevelOver60To75) + - (grade::GetHPScale(grade, scaleOver75Column) * mainLevelOver75); - - // raceStat = (int32)(statScale[grade][baseValueColumn] + statScale[grade][scaleTo60Column] * (mlvl - 1)); - - // Расчет по main job - grade = grade::GetJobGrade(mjob, 0); - - jobStat = grade::GetHPScale(grade, baseValueColumn) + - (grade::GetHPScale(grade, scaleTo60Column) * mainLevelUpTo60) + - (grade::GetHPScale(grade, scaleOver30Column) * mainLevelOver30) + - (grade::GetHPScale(grade, scaleOver60Column) * mainLevelOver60To75) + - (grade::GetHPScale(grade, scaleOver75Column) * mainLevelOver75); - - // Расчет бонусных HP - bonusStat = (mainLevelOver10 + mainLevelOver50andUnder60) * 2; - - // Расчет по support job - if (slvl > 0) - { - grade = grade::GetJobGrade(sjob, 0); - - sJobStat = grade::GetHPScale(grade, baseValueColumn) + - (grade::GetHPScale(grade, scaleTo60Column) * (slvl - 1)) + - (grade::GetHPScale(grade, scaleOver30Column) * subLevelOver30) + - subLevelOver30 + subLevelOver10; - sJobStat = sJobStat / 2; - } - - - PTrust->health.maxhp = (int16)(map_config.player_hp_multiplier * (raceStat + jobStat + bonusStat + sJobStat)); - - //Начало расчера MP - - raceStat = 0; - jobStat = 0; - sJobStat = 0; - - // Расчет MP расе. - grade = grade::GetRaceGrades(race, 1); - - //Если у main job нет МП рейтинга, расчитиваем расовый бонус на основе уровня subjob уровня(при условии, что у него есть МП рейтинг) - if (grade::GetJobGrade(mjob, 1) == 0) - { - if (grade::GetJobGrade(sjob, 1) != 0 && slvl > 0) // В этом выражении ошибка - { - raceStat = (grade::GetMPScale(grade, 0) + grade::GetMPScale(grade, scaleTo60Column) * (slvl - 1)) / map_config.sj_mp_divisor; // Вот здесь ошибка - } - } - else { - //Расчет нормального расового бонуса - raceStat = grade::GetMPScale(grade, 0) + - grade::GetMPScale(grade, scaleTo60Column) * mainLevelUpTo60 + - grade::GetMPScale(grade, scaleOver60) * mainLevelOver60; - } - - //Для главной профессии - grade = grade::GetJobGrade(mjob, 1); - if (grade > 0) - { - jobStat = grade::GetMPScale(grade, 0) + - grade::GetMPScale(grade, scaleTo60Column) * mainLevelUpTo60 + - grade::GetMPScale(grade, scaleOver60) * mainLevelOver60; - } - - //Для дополнительной профессии - if (slvl > 0) - { - grade = grade::GetJobGrade(sjob, 1); - sJobStat = (grade::GetMPScale(grade, 0) + grade::GetMPScale(grade, scaleTo60Column) * (slvl - 1)) / map_config.sj_mp_divisor; - } - - PTrust->health.maxmp = (int16)(map_config.player_mp_multiplier * (raceStat + jobStat + sJobStat)); // результат расчета MP - - uint8 counter = 0; - - for (uint8 StatIndex = 2; StatIndex <= 8; ++StatIndex) - { - // расчет по расе - grade = grade::GetRaceGrades(race, StatIndex); - raceStat = grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * mainLevelUpTo60; - - if (mainLevelOver60 > 0) - { - raceStat += grade::GetStatScale(grade, scaleOver60) * mainLevelOver60; - - if (mainLevelOver75 > 0) - { - raceStat += grade::GetStatScale(grade, scaleOver75) * mainLevelOver75 - (mlvl >= 75 ? 0.01f : 0); - } - } - - // расчет по профессии - grade = grade::GetJobGrade(mjob, StatIndex); - jobStat = grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * mainLevelUpTo60; - - if (mainLevelOver60 > 0) - { - jobStat += grade::GetStatScale(grade, scaleOver60) * mainLevelOver60; - - if (mainLevelOver75 > 0) - { - jobStat += grade::GetStatScale(grade, scaleOver75) * mainLevelOver75 - (mlvl >= 75 ? 0.01f : 0); - } - } - - // расчет по дополнительной профессии - if (slvl > 0) - { - grade = grade::GetJobGrade(sjob, StatIndex); - sJobStat = (grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * (slvl - 1)) / 2; - } - else { - sJobStat = 0; - } - - // Вывод значения - ref(&PTrust->stats, counter) = (uint16)((raceStat + jobStat + sJobStat)); - counter += 2; - } - } - void LoadAvatarStats(CPetEntity* PPet) { // Объявление переменных, нужных для рассчета. @@ -1232,20 +841,6 @@ namespace petutils } } - void SpawnTrust(CCharEntity* PMaster, uint32 TrustID) - { - if (PMaster->PParty == nullptr) - { - PMaster->PParty = new CParty(PMaster); - } - - CTrustEntity* PTrust = LoadTrust(PMaster, TrustID); - PMaster->PTrusts.insert(PMaster->PTrusts.end(), PTrust); - PMaster->StatusEffectContainer->CopyConfrontationEffect(PTrust); - PMaster->loc.zone->InsertTRUST(PTrust); - PMaster->PParty->ReloadParty(); - } - void SpawnMobPet(CBattleEntity* PMaster, uint32 PetID) { // this is ONLY used for mob smn elementals / avatars @@ -1872,61 +1467,6 @@ namespace petutils PMaster->PPet = PPet; } - CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID) - { - CTrustEntity* PTrust = new CTrustEntity(PMaster); - Trust_t* trustData = new Trust_t(); - - for (uint32 index = 0; index < g_PTrustList.size(); index++) - { - if (g_PTrustList.at(index)->trustID == TrustID) - { - trustData = g_PTrustList.at(index); - break; - } - } - - PTrust->loc = PMaster->loc; - PTrust->m_OwnerID.id = PMaster->id; - PTrust->m_OwnerID.targid = PMaster->targid; - - // spawn me randomly around master - PTrust->loc.p = nearPosition(PMaster->loc.p, CTrustController::SpawnDistance, (float)M_PI); - PTrust->look = trustData->look; - PTrust->name = trustData->name; - PTrust->m_name_prefix = trustData->name_prefix; - PTrust->m_Family = trustData->m_Family; - PTrust->m_MobSkillList = trustData->m_MobSkillList; - PTrust->SetMJob(trustData->mJob); - PTrust->SetSJob(trustData->sJob); // TODO: This may not be true for some trusts - PTrust->m_TrustID = trustData->trustID; - PTrust->status = STATUS_NORMAL; - PTrust->m_ModelSize = trustData->size; - PTrust->m_EcoSystem = trustData->EcoSystem; - - // assume level matches master - PTrust->SetMLevel(PMaster->GetMLevel()); - PTrust->SetSLevel(PMaster->GetSLevel()); - - // TODO: Proper stats per trust - PTrust->setModifier(Mod::ATT, battleutils::GetMaxSkill(SKILL_CLUB, JOB_WHM, PTrust->GetMLevel())); - PTrust->setModifier(Mod::ACC, battleutils::GetMaxSkill(SKILL_CLUB, JOB_WHM, PTrust->GetMLevel())); - PTrust->setModifier(Mod::EVA, battleutils::GetMaxSkill(SKILL_THROWING, JOB_WHM, PTrust->GetMLevel())); // Throwing?? - PTrust->setModifier(Mod::DEF, battleutils::GetMaxSkill(SKILL_THROWING, JOB_WHM, PTrust->GetMLevel())); - //set C magic evasion - PTrust->setModifier(Mod::MEVA, battleutils::GetMaxSkill(SKILL_ELEMENTAL_MAGIC, JOB_RDM, PTrust->GetMLevel())); - // HP/MP STR/DEX/etc.. - LoadTrustStats(PTrust); - - PTrust->health.tp = 0; - PTrust->UpdateHealth(); - PTrust->health.hp = PTrust->GetMaxHP(); - PTrust->health.mp = PTrust->GetMaxMP(); - - // TODO: Load stats from script - return PTrust; - } - void LoadWyvernStatistics(CBattleEntity* PMaster, CPetEntity* PPet, bool finalize) { //set the wyvern job based on master's SJ diff --git a/src/map/utils/petutils.h b/src/map/utils/petutils.h index 0b58fedf636..daa32038a64 100644 --- a/src/map/utils/petutils.h +++ b/src/map/utils/petutils.h @@ -62,18 +62,14 @@ enum PETID class CBattleEntity; class CPetEntity; -class CTrustEntity; namespace petutils { void LoadPetList(); void FreePetList(); - void LoadTrustList(); - void FreeTrustList(); void SpawnPet(CBattleEntity* PMaster, uint32 PetID, bool spawningFromZone); void SpawnMobPet(CBattleEntity* PMaster, uint32 PetID); - void SpawnTrust(CCharEntity * PMaster, uint32 TrustID); void DetachPet(CBattleEntity* PMaster); void DespawnPet(CBattleEntity* PMaster); void AttackTarget(CBattleEntity* PMaster, CBattleEntity* PTarget); @@ -84,8 +80,6 @@ namespace petutils void LoadWyvernStatistics(CBattleEntity* PMaster, CPetEntity* PPet, bool finalize); void FinalizePetStatistics(CBattleEntity* PMaster, CPetEntity* PPet); bool CheckPetModType(CBattleEntity* PPet, PetModType petmod); - void BuildTrust(uint32 TrustID); - CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID); }; #endif diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp new file mode 100644 index 00000000000..d8f8e63fae8 --- /dev/null +++ b/src/map/utils/trustutils.cpp @@ -0,0 +1,534 @@ +/* +=========================================================================== + +Copyright (c) 2010-2015 Darkstar Dev Teams + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see http://www.gnu.org/licenses/ + +=========================================================================== +*/ + +#include "../../common/timer.h" +#include "../../common/utils.h" + +#include +#include +#include + +#include "battleutils.h" +#include "charutils.h" +#include "puppetutils.h" +#include "../grades.h" +#include "../map.h" +#include "trustutils.h" +#include "zoneutils.h" +#include "../entities/mobentity.h" +#include "../entities/trustentity.h" +#include "../entities/automatonentity.h" +#include "../ability.h" +#include "../status_effect_container.h" +#include "../latent_effect_container.h" +#include "../mob_spell_list.h" +#include "../enmity_container.h" +#include "../items/item_weapon.h" +#include "../zone_instance.h" + +#include "../ai/ai_container.h" +#include "../ai/controllers/mob_controller.h" +#include "../ai/controllers/pet_controller.h" +#include "../ai/controllers/automaton_controller.h" +#include "../ai/states/ability_state.h" + +#include "../packets/char_abilities.h" +#include "../packets/char_sync.h" +#include "../packets/char_update.h" +#include "../packets/entity_update.h" +#include "../packets/message_standard.h" +#include "../packets/pet_sync.h" +#include "../packets/trust_sync.h" +#include "../ai/controllers/trust_controller.h" + +struct TrustSpell_ID +{ + uint32 spellID; +}; + +std::vector g_PTrustIDList; + +struct Trust_t +{ + uint32 trustID; + look_t look; // appearance data + string_t name; // name string + ECOSYSTEM EcoSystem; // ecosystem + + uint8 name_prefix; + uint8 size; // размер модели + uint16 m_Family; + + uint8 mJob; + uint8 sJob; + float HPscale; // HP boost percentage + float MPscale; // MP boost percentage + + uint16 cmbDelay; + uint8 speed; + // stat ranks + uint8 strRank; + uint8 dexRank; + uint8 vitRank; + uint8 agiRank; + uint8 intRank; + uint8 mndRank; + uint8 chrRank; + uint8 attRank; + uint8 defRank; + uint8 evaRank; + uint8 accRank; + + uint16 m_MobSkillList; + + // magic stuff + bool hasSpellScript; + uint16 spellList; + + // resists + int16 slashres; + int16 pierceres; + int16 hthres; + int16 impactres; + + int16 firedef; + int16 icedef; + int16 winddef; + int16 earthdef; + int16 thunderdef; + int16 waterdef; + int16 lightdef; + int16 darkdef; + + int16 fireres; + int16 iceres; + int16 windres; + int16 earthres; + int16 thunderres; + int16 waterres; + int16 lightres; + int16 darkres; +}; + +std::vector g_PTrustList; + +namespace trustutils +{ + + /************************************************************************ + * * + * * + * * + ************************************************************************/ + + void LoadTrustList() + { + FreeTrustList(); + + const char* Query = + "SELECT \ + spell_list.spellid, mob_pools.poolid \ + FROM spell_list, mob_pools \ + WHERE spell_list.spellid >= 896 AND mob_pools.poolid = (spell_list.spellid+5000) ORDER BY spell_list.spellid"; + + if (Sql_Query(SqlHandle, Query) != SQL_ERROR && Sql_NumRows(SqlHandle) != 0) + { + while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) + { + TrustSpell_ID* trustID = new TrustSpell_ID(); + + trustID->spellID = (uint32)Sql_GetIntData(SqlHandle, 0); + + g_PTrustIDList.push_back(trustID); + } + } + + for (uint32 index = 0; index < g_PTrustIDList.size(); index++) + { + BuildTrust(g_PTrustIDList.at(index)->spellID); + } + } + + void BuildTrust(uint32 TrustID) + { + const char* Query = + "SELECT \ + mob_pools.name,\ + modelid,\ + mobsize,\ + systemid,\ + mob_pools.familyid,\ + mob_pools.mJob,\ + mob_pools.sJob,\ + (mob_family_system.HP / 100), \ + (mob_family_system.MP / 100), \ + mob_family_system.speed, \ + mob_family_system.STR, \ + mob_family_system.DEX, \ + mob_family_system.VIT, \ + mob_family_system.AGI, \ + mob_family_system.INT, \ + mob_family_system.MND, \ + mob_family_system.CHR, \ + mob_family_system.DEF, \ + mob_family_system.ATT, \ + mob_family_system.ACC, \ + mob_family_system.EVA, \ + hasSpellScript, spellList, \ + Slash, Pierce, H2H, Impact, \ + Fire, Ice, Wind, Earth, Lightning, Water, Light, Dark, \ + cmbDelay, name_prefix, mob_pools.skill_list_id, \ + spell_list.spellid, mob_pools.behavior \ + FROM spell_list, mob_pools, mob_family_system WHERE spell_list.spellid = %u \ + AND (spell_list.spellid+5000) = mob_pools.poolid AND mob_pools.familyid = mob_family_system.familyid ORDER BY spell_list.spellid"; + + uint32 ret = Sql_Query(SqlHandle, Query, TrustID); + + if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) != 0) + { + while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) + { + Trust_t* trust = new Trust_t(); + + trust->trustID = TrustID; + trust->name.insert(0, (const char*)Sql_GetData(SqlHandle, 0)); + memcpy(&trust->look, Sql_GetData(SqlHandle, 1), 20); + + trust->size = Sql_GetUIntData(SqlHandle, 2); + trust->EcoSystem = (ECOSYSTEM)Sql_GetIntData(SqlHandle, 3); + trust->m_Family = (uint16)Sql_GetIntData(SqlHandle, 4); + trust->mJob = (uint8)Sql_GetIntData(SqlHandle, 5); + trust->sJob = (uint8)Sql_GetIntData(SqlHandle, 6); + trust->HPscale = Sql_GetFloatData(SqlHandle, 7); + trust->MPscale = Sql_GetFloatData(SqlHandle, 8); + trust->speed = (uint8)Sql_GetIntData(SqlHandle, 9); + trust->strRank = (uint8)Sql_GetIntData(SqlHandle, 10); + trust->dexRank = (uint8)Sql_GetIntData(SqlHandle, 11); + trust->vitRank = (uint8)Sql_GetIntData(SqlHandle, 12); + trust->agiRank = (uint8)Sql_GetIntData(SqlHandle, 13); + trust->intRank = (uint8)Sql_GetIntData(SqlHandle, 14); + trust->mndRank = (uint8)Sql_GetIntData(SqlHandle, 15); + trust->chrRank = (uint8)Sql_GetIntData(SqlHandle, 16); + trust->defRank = (uint8)Sql_GetIntData(SqlHandle, 17); + trust->attRank = (uint8)Sql_GetIntData(SqlHandle, 18); + trust->accRank = (uint8)Sql_GetIntData(SqlHandle, 19); + trust->evaRank = (uint8)Sql_GetIntData(SqlHandle, 20); + trust->hasSpellScript = (bool)Sql_GetIntData(SqlHandle, 21); + trust->spellList = (uint16)Sql_GetIntData(SqlHandle, 22); + + // resistances + trust->slashres = (uint16)(Sql_GetFloatData(SqlHandle, 23) * 1000); + trust->pierceres = (uint16)(Sql_GetFloatData(SqlHandle, 24) * 1000); + trust->hthres = (uint16)(Sql_GetFloatData(SqlHandle, 25) * 1000); + trust->impactres = (uint16)(Sql_GetFloatData(SqlHandle, 26) * 1000); + + trust->firedef = 0; + trust->icedef = 0; + trust->winddef = 0; + trust->earthdef = 0; + trust->thunderdef = 0; + trust->waterdef = 0; + trust->lightdef = 0; + trust->darkdef = 0; + + trust->fireres = (uint16)((Sql_GetFloatData(SqlHandle, 27) - 1) * -100); + trust->iceres = (uint16)((Sql_GetFloatData(SqlHandle, 28) - 1) * -100); + trust->windres = (uint16)((Sql_GetFloatData(SqlHandle, 29) - 1) * -100); + trust->earthres = (uint16)((Sql_GetFloatData(SqlHandle, 30) - 1) * -100); + trust->thunderres = (uint16)((Sql_GetFloatData(SqlHandle, 31) - 1) * -100); + trust->waterres = (uint16)((Sql_GetFloatData(SqlHandle, 32) - 1) * -100); + trust->lightres = (uint16)((Sql_GetFloatData(SqlHandle, 33) - 1) * -100); + trust->darkres = (uint16)((Sql_GetFloatData(SqlHandle, 34) - 1) * -100); + + trust->cmbDelay = (uint16)Sql_GetIntData(SqlHandle, 35); + trust->name_prefix = (uint8)Sql_GetUIntData(SqlHandle, 36); + trust->m_MobSkillList = (uint16)Sql_GetUIntData(SqlHandle, 37); + + g_PTrustList.push_back(trust); + } + } + } + + /************************************************************************ + * * + * Освобождаем список прототипов питомцев * + * * + ************************************************************************/ + + void FreeTrustList() + { + g_PTrustIDList.clear(); + } + + void LoadTrustStats(CTrustEntity* PTrust) + { + // Cargo cult of PC calculations. + + float raceStat = 0; // конечное число HP для уровня на основе расы. + float jobStat = 0; // конечное число HP для уровня на основе первичной профессии. + float sJobStat = 0; // коенчное число HP для уровня на основе вторичной профессии. + int32 bonusStat = 0; // бонусное число HP которое добавляется при соблюдении некоторых условий. + + int32 baseValueColumn = 0; // номер колонки с базовым количеством HP + int32 scaleTo60Column = 1; // номер колонки с модификатором до 60 уровня + int32 scaleOver30Column = 2; // номер колонки с модификатором после 30 уровня + int32 scaleOver60Column = 3; // номер колонки с модификатором после 60 уровня + int32 scaleOver75Column = 4; // номер колонки с модификатором после 75 уровня + int32 scaleOver60 = 2; // номер колонки с модификатором для расчета MP после 60 уровня + int32 scaleOver75 = 3; // номер колонки с модификатором для расчета Статов после 75-го уровня + + uint8 grade; + + uint8 mlvl = PTrust->GetMLevel(); + uint8 slvl = PTrust->GetSLevel(); + JOBTYPE mjob = PTrust->GetMJob(); + JOBTYPE sjob = PTrust->GetSJob(); + + uint8 race = 0; //Human + + switch (PTrust->look.race) + { + case 3: + case 4: race = 1; break; //Elvaan + case 5: + case 6: race = 2; break; //Tarutaru + case 7: race = 3; break; //Mithra + case 8: race = 4; break; //Galka + } + + // Расчет прироста HP от main job + + int32 mainLevelOver30 = std::clamp(mlvl - 30, 0, 30); // Расчет условия +1HP каждый лвл после 30 уровня + int32 mainLevelUpTo60 = (mlvl < 60 ? mlvl - 1 : 59); // Первый режим рассчета до 60 уровня (Используется так же и для MP) + int32 mainLevelOver60To75 = std::clamp(mlvl - 60, 0, 15); // Второй режим расчета после 60 уровня + int32 mainLevelOver75 = (mlvl < 75 ? 0 : mlvl - 75); // Третий режим расчета после 75 уровня + + //Расчет бонусного количества HP + + int32 mainLevelOver10 = (mlvl < 10 ? 0 : mlvl - 10); // +2HP на каждом уровне после 10 + int32 mainLevelOver50andUnder60 = std::clamp(mlvl - 50, 0, 10); // +2HP на каждом уровне в промежутке от 50 до 60 уровня + int32 mainLevelOver60 = (mlvl < 60 ? 0 : mlvl - 60); + + // Расчет прироста HP от дополнительной профессии + + int32 subLevelOver10 = std::clamp(slvl - 10, 0, 20); // +1HP на каждый уровень после 10 (/2) + int32 subLevelOver30 = (slvl < 30 ? 0 : slvl - 30); // +1HP на каждый уровень после 30 + + // Расчет raceStat jobStat bonusStat sJobStat + // Расчет по расе + + grade = grade::GetRaceGrades(race, 0); + + raceStat = grade::GetHPScale(grade, baseValueColumn) + + (grade::GetHPScale(grade, scaleTo60Column) * mainLevelUpTo60) + + (grade::GetHPScale(grade, scaleOver30Column) * mainLevelOver30) + + (grade::GetHPScale(grade, scaleOver60Column) * mainLevelOver60To75) + + (grade::GetHPScale(grade, scaleOver75Column) * mainLevelOver75); + + // raceStat = (int32)(statScale[grade][baseValueColumn] + statScale[grade][scaleTo60Column] * (mlvl - 1)); + + // Расчет по main job + grade = grade::GetJobGrade(mjob, 0); + + jobStat = grade::GetHPScale(grade, baseValueColumn) + + (grade::GetHPScale(grade, scaleTo60Column) * mainLevelUpTo60) + + (grade::GetHPScale(grade, scaleOver30Column) * mainLevelOver30) + + (grade::GetHPScale(grade, scaleOver60Column) * mainLevelOver60To75) + + (grade::GetHPScale(grade, scaleOver75Column) * mainLevelOver75); + + // Расчет бонусных HP + bonusStat = (mainLevelOver10 + mainLevelOver50andUnder60) * 2; + + // Расчет по support job + if (slvl > 0) + { + grade = grade::GetJobGrade(sjob, 0); + + sJobStat = grade::GetHPScale(grade, baseValueColumn) + + (grade::GetHPScale(grade, scaleTo60Column) * (slvl - 1)) + + (grade::GetHPScale(grade, scaleOver30Column) * subLevelOver30) + + subLevelOver30 + subLevelOver10; + sJobStat = sJobStat / 2; + } + + + PTrust->health.maxhp = (int16)(map_config.player_hp_multiplier * (raceStat + jobStat + bonusStat + sJobStat)); + + //Начало расчера MP + + raceStat = 0; + jobStat = 0; + sJobStat = 0; + + // Расчет MP расе. + grade = grade::GetRaceGrades(race, 1); + + //Если у main job нет МП рейтинга, расчитиваем расовый бонус на основе уровня subjob уровня(при условии, что у него есть МП рейтинг) + if (grade::GetJobGrade(mjob, 1) == 0) + { + if (grade::GetJobGrade(sjob, 1) != 0 && slvl > 0) // В этом выражении ошибка + { + raceStat = (grade::GetMPScale(grade, 0) + grade::GetMPScale(grade, scaleTo60Column) * (slvl - 1)) / map_config.sj_mp_divisor; // Вот здесь ошибка + } + } + else { + //Расчет нормального расового бонуса + raceStat = grade::GetMPScale(grade, 0) + + grade::GetMPScale(grade, scaleTo60Column) * mainLevelUpTo60 + + grade::GetMPScale(grade, scaleOver60) * mainLevelOver60; + } + + //Для главной профессии + grade = grade::GetJobGrade(mjob, 1); + if (grade > 0) + { + jobStat = grade::GetMPScale(grade, 0) + + grade::GetMPScale(grade, scaleTo60Column) * mainLevelUpTo60 + + grade::GetMPScale(grade, scaleOver60) * mainLevelOver60; + } + + //Для дополнительной профессии + if (slvl > 0) + { + grade = grade::GetJobGrade(sjob, 1); + sJobStat = (grade::GetMPScale(grade, 0) + grade::GetMPScale(grade, scaleTo60Column) * (slvl - 1)) / map_config.sj_mp_divisor; + } + + PTrust->health.maxmp = (int16)(map_config.player_mp_multiplier * (raceStat + jobStat + sJobStat)); // результат расчета MP + + uint8 counter = 0; + + for (uint8 StatIndex = 2; StatIndex <= 8; ++StatIndex) + { + // расчет по расе + grade = grade::GetRaceGrades(race, StatIndex); + raceStat = grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * mainLevelUpTo60; + + if (mainLevelOver60 > 0) + { + raceStat += grade::GetStatScale(grade, scaleOver60) * mainLevelOver60; + + if (mainLevelOver75 > 0) + { + raceStat += grade::GetStatScale(grade, scaleOver75) * mainLevelOver75 - (mlvl >= 75 ? 0.01f : 0); + } + } + + // расчет по профессии + grade = grade::GetJobGrade(mjob, StatIndex); + jobStat = grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * mainLevelUpTo60; + + if (mainLevelOver60 > 0) + { + jobStat += grade::GetStatScale(grade, scaleOver60) * mainLevelOver60; + + if (mainLevelOver75 > 0) + { + jobStat += grade::GetStatScale(grade, scaleOver75) * mainLevelOver75 - (mlvl >= 75 ? 0.01f : 0); + } + } + + // расчет по дополнительной профессии + if (slvl > 0) + { + grade = grade::GetJobGrade(sjob, StatIndex); + sJobStat = (grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * (slvl - 1)) / 2; + } + else { + sJobStat = 0; + } + + // Вывод значения + ref(&PTrust->stats, counter) = (uint16)((raceStat + jobStat + sJobStat)); + counter += 2; + } + } + + void SpawnTrust(CCharEntity* PMaster, uint32 TrustID) + { + if (PMaster->PParty == nullptr) + { + PMaster->PParty = new CParty(PMaster); + } + + CTrustEntity* PTrust = LoadTrust(PMaster, TrustID); + PMaster->PTrusts.insert(PMaster->PTrusts.end(), PTrust); + PMaster->StatusEffectContainer->CopyConfrontationEffect(PTrust); + PMaster->loc.zone->InsertTRUST(PTrust); + PMaster->PParty->ReloadParty(); + } + + CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID) + { + CTrustEntity* PTrust = new CTrustEntity(PMaster); + Trust_t* trustData = new Trust_t(); + + for (uint32 index = 0; index < g_PTrustList.size(); index++) + { + if (g_PTrustList.at(index)->trustID == TrustID) + { + trustData = g_PTrustList.at(index); + break; + } + } + + PTrust->loc = PMaster->loc; + PTrust->m_OwnerID.id = PMaster->id; + PTrust->m_OwnerID.targid = PMaster->targid; + + // spawn me randomly around master + PTrust->loc.p = nearPosition(PMaster->loc.p, CTrustController::SpawnDistance, (float)M_PI); + PTrust->look = trustData->look; + PTrust->name = trustData->name; + PTrust->m_name_prefix = trustData->name_prefix; + PTrust->m_Family = trustData->m_Family; + PTrust->m_MobSkillList = trustData->m_MobSkillList; + PTrust->SetMJob(trustData->mJob); + PTrust->SetSJob(trustData->sJob); // TODO: This may not be true for some trusts + PTrust->m_TrustID = trustData->trustID; + PTrust->status = STATUS_NORMAL; + PTrust->m_ModelSize = trustData->size; + PTrust->m_EcoSystem = trustData->EcoSystem; + + // assume level matches master + PTrust->SetMLevel(PMaster->GetMLevel()); + PTrust->SetSLevel(PMaster->GetSLevel()); + + // TODO: Proper stats per trust + PTrust->setModifier(Mod::ATT, battleutils::GetMaxSkill(SKILL_CLUB, JOB_WHM, PTrust->GetMLevel())); + PTrust->setModifier(Mod::ACC, battleutils::GetMaxSkill(SKILL_CLUB, JOB_WHM, PTrust->GetMLevel())); + PTrust->setModifier(Mod::EVA, battleutils::GetMaxSkill(SKILL_THROWING, JOB_WHM, PTrust->GetMLevel())); // Throwing?? + PTrust->setModifier(Mod::DEF, battleutils::GetMaxSkill(SKILL_THROWING, JOB_WHM, PTrust->GetMLevel())); + //set C magic evasion + PTrust->setModifier(Mod::MEVA, battleutils::GetMaxSkill(SKILL_ELEMENTAL_MAGIC, JOB_RDM, PTrust->GetMLevel())); + // HP/MP STR/DEX/etc.. + LoadTrustStats(PTrust); + + PTrust->health.tp = 0; + PTrust->UpdateHealth(); + PTrust->health.hp = PTrust->GetMaxHP(); + PTrust->health.mp = PTrust->GetMaxMP(); + + // TODO: Load stats from script + return PTrust; + } + +}; // namespace trustutils diff --git a/src/map/utils/trustutils.h b/src/map/utils/trustutils.h new file mode 100644 index 00000000000..2936fcbb1ed --- /dev/null +++ b/src/map/utils/trustutils.h @@ -0,0 +1,20 @@ +#ifndef _ITRUSTUTILS_H +#define _ITRUSTUTILS_H + +#include "../../common/cbasetypes.h" +#include "../../common/mmo.h" + +class CBattleEntity; +class CCharEntity; +class CTrustEntity; + +namespace trustutils +{ + void LoadTrustList(); + void FreeTrustList(); + void SpawnTrust(CCharEntity * PMaster, uint32 TrustID); + void BuildTrust(uint32 TrustID); + CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID); +}; + +#endif diff --git a/win32/vcxproj/topaz_game.vcxproj b/win32/vcxproj/topaz_game.vcxproj index 49016fddcdd..538dae6cd1b 100644 --- a/win32/vcxproj/topaz_game.vcxproj +++ b/win32/vcxproj/topaz_game.vcxproj @@ -457,6 +457,7 @@ + @@ -708,6 +709,7 @@ + diff --git a/win32/vcxproj/topaz_game.vcxproj.filters b/win32/vcxproj/topaz_game.vcxproj.filters index 2db07ec0a75..1a0f1504d46 100644 --- a/win32/vcxproj/topaz_game.vcxproj.filters +++ b/win32/vcxproj/topaz_game.vcxproj.filters @@ -677,6 +677,9 @@ Header Files\utils + + Header Files\utils + Header Files\utils @@ -1417,6 +1420,9 @@ Source Files\utils + + Source Files\utils + Source Files\utils From 8a14dcb7356116a246e3deb3350e38022c81c996 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 15 Mar 2020 18:06:46 +0200 Subject: [PATCH 048/116] Clean up trust loading SQL --- src/map/utils/trustutils.cpp | 96 +++++++++++++++++++----------------- src/map/utils/trustutils.h | 4 ++ 2 files changed, 54 insertions(+), 46 deletions(-) diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index d8f8e63fae8..c0568970175 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -172,12 +172,15 @@ namespace trustutils const char* Query = "SELECT \ mob_pools.name,\ - modelid,\ - mobsize,\ - systemid,\ + mob_pools.modelid,\ mob_pools.familyid,\ mob_pools.mJob,\ mob_pools.sJob,\ + mob_pools.hasSpellScript, mob_pools.spellList, \ + mob_pools.cmbDelay, mob_pools.name_prefix, \ + mob_pools.behavior, mob_pools.skill_list_id, \ + spell_list.spellid, \ + mob_family_system.mobsize, mob_family_system.systemid, \ (mob_family_system.HP / 100), \ (mob_family_system.MP / 100), \ mob_family_system.speed, \ @@ -192,11 +195,12 @@ namespace trustutils mob_family_system.ATT, \ mob_family_system.ACC, \ mob_family_system.EVA, \ - hasSpellScript, spellList, \ - Slash, Pierce, H2H, Impact, \ - Fire, Ice, Wind, Earth, Lightning, Water, Light, Dark, \ - cmbDelay, name_prefix, mob_pools.skill_list_id, \ - spell_list.spellid, mob_pools.behavior \ + mob_family_system.Slash, mob_family_system.Pierce, \ + mob_family_system.H2H, mob_family_system.Impact, \ + mob_family_system.Fire, mob_family_system.Ice, \ + mob_family_system.Wind, mob_family_system.Earth, \ + mob_family_system.Lightning, mob_family_system.Water, \ + mob_family_system.Light, mob_family_system.Dark \ FROM spell_list, mob_pools, mob_family_system WHERE spell_list.spellid = %u \ AND (spell_list.spellid+5000) = mob_pools.poolid AND mob_pools.familyid = mob_family_system.familyid ORDER BY spell_list.spellid"; @@ -211,34 +215,38 @@ namespace trustutils trust->trustID = TrustID; trust->name.insert(0, (const char*)Sql_GetData(SqlHandle, 0)); memcpy(&trust->look, Sql_GetData(SqlHandle, 1), 20); - - trust->size = Sql_GetUIntData(SqlHandle, 2); - trust->EcoSystem = (ECOSYSTEM)Sql_GetIntData(SqlHandle, 3); - trust->m_Family = (uint16)Sql_GetIntData(SqlHandle, 4); - trust->mJob = (uint8)Sql_GetIntData(SqlHandle, 5); - trust->sJob = (uint8)Sql_GetIntData(SqlHandle, 6); - trust->HPscale = Sql_GetFloatData(SqlHandle, 7); - trust->MPscale = Sql_GetFloatData(SqlHandle, 8); - trust->speed = (uint8)Sql_GetIntData(SqlHandle, 9); - trust->strRank = (uint8)Sql_GetIntData(SqlHandle, 10); - trust->dexRank = (uint8)Sql_GetIntData(SqlHandle, 11); - trust->vitRank = (uint8)Sql_GetIntData(SqlHandle, 12); - trust->agiRank = (uint8)Sql_GetIntData(SqlHandle, 13); - trust->intRank = (uint8)Sql_GetIntData(SqlHandle, 14); - trust->mndRank = (uint8)Sql_GetIntData(SqlHandle, 15); - trust->chrRank = (uint8)Sql_GetIntData(SqlHandle, 16); - trust->defRank = (uint8)Sql_GetIntData(SqlHandle, 17); - trust->attRank = (uint8)Sql_GetIntData(SqlHandle, 18); - trust->accRank = (uint8)Sql_GetIntData(SqlHandle, 19); - trust->evaRank = (uint8)Sql_GetIntData(SqlHandle, 20); - trust->hasSpellScript = (bool)Sql_GetIntData(SqlHandle, 21); - trust->spellList = (uint16)Sql_GetIntData(SqlHandle, 22); + trust->m_Family = (uint16)Sql_GetIntData(SqlHandle, 2); + trust->mJob = (uint8)Sql_GetIntData(SqlHandle, 3); + trust->sJob = (uint8)Sql_GetIntData(SqlHandle, 4); + trust->hasSpellScript = (bool)Sql_GetIntData(SqlHandle, 5); + trust->spellList = (uint16)Sql_GetIntData(SqlHandle, 6); + trust->cmbDelay = (uint16)Sql_GetIntData(SqlHandle, 7); + trust->name_prefix = (uint8)Sql_GetUIntData(SqlHandle, 8); + // Behaviour + trust->m_MobSkillList = (uint16)Sql_GetUIntData(SqlHandle, 10); + // SpellID + trust->size = Sql_GetUIntData(SqlHandle, 12); + trust->EcoSystem = (ECOSYSTEM)Sql_GetIntData(SqlHandle, 13); + trust->HPscale = Sql_GetFloatData(SqlHandle, 14); + trust->MPscale = Sql_GetFloatData(SqlHandle, 15); + trust->speed = (uint8)Sql_GetIntData(SqlHandle, 16); + trust->strRank = (uint8)Sql_GetIntData(SqlHandle, 17); + trust->dexRank = (uint8)Sql_GetIntData(SqlHandle, 18); + trust->vitRank = (uint8)Sql_GetIntData(SqlHandle, 19); + trust->agiRank = (uint8)Sql_GetIntData(SqlHandle, 20); + trust->intRank = (uint8)Sql_GetIntData(SqlHandle, 21); + trust->mndRank = (uint8)Sql_GetIntData(SqlHandle, 22); + trust->chrRank = (uint8)Sql_GetIntData(SqlHandle, 23); + trust->defRank = (uint8)Sql_GetIntData(SqlHandle, 24); + trust->attRank = (uint8)Sql_GetIntData(SqlHandle, 25); + trust->accRank = (uint8)Sql_GetIntData(SqlHandle, 26); + trust->evaRank = (uint8)Sql_GetIntData(SqlHandle, 27); // resistances - trust->slashres = (uint16)(Sql_GetFloatData(SqlHandle, 23) * 1000); - trust->pierceres = (uint16)(Sql_GetFloatData(SqlHandle, 24) * 1000); - trust->hthres = (uint16)(Sql_GetFloatData(SqlHandle, 25) * 1000); - trust->impactres = (uint16)(Sql_GetFloatData(SqlHandle, 26) * 1000); + trust->slashres = (uint16)(Sql_GetFloatData(SqlHandle, 28) * 1000); + trust->pierceres = (uint16)(Sql_GetFloatData(SqlHandle, 29) * 1000); + trust->hthres = (uint16)(Sql_GetFloatData(SqlHandle, 30) * 1000); + trust->impactres = (uint16)(Sql_GetFloatData(SqlHandle, 31) * 1000); trust->firedef = 0; trust->icedef = 0; @@ -249,18 +257,14 @@ namespace trustutils trust->lightdef = 0; trust->darkdef = 0; - trust->fireres = (uint16)((Sql_GetFloatData(SqlHandle, 27) - 1) * -100); - trust->iceres = (uint16)((Sql_GetFloatData(SqlHandle, 28) - 1) * -100); - trust->windres = (uint16)((Sql_GetFloatData(SqlHandle, 29) - 1) * -100); - trust->earthres = (uint16)((Sql_GetFloatData(SqlHandle, 30) - 1) * -100); - trust->thunderres = (uint16)((Sql_GetFloatData(SqlHandle, 31) - 1) * -100); - trust->waterres = (uint16)((Sql_GetFloatData(SqlHandle, 32) - 1) * -100); - trust->lightres = (uint16)((Sql_GetFloatData(SqlHandle, 33) - 1) * -100); - trust->darkres = (uint16)((Sql_GetFloatData(SqlHandle, 34) - 1) * -100); - - trust->cmbDelay = (uint16)Sql_GetIntData(SqlHandle, 35); - trust->name_prefix = (uint8)Sql_GetUIntData(SqlHandle, 36); - trust->m_MobSkillList = (uint16)Sql_GetUIntData(SqlHandle, 37); + trust->fireres = (uint16)((Sql_GetFloatData(SqlHandle, 32) - 1) * -100); + trust->iceres = (uint16)((Sql_GetFloatData(SqlHandle, 33) - 1) * -100); + trust->windres = (uint16)((Sql_GetFloatData(SqlHandle, 34) - 1) * -100); + trust->earthres = (uint16)((Sql_GetFloatData(SqlHandle, 35) - 1) * -100); + trust->thunderres = (uint16)((Sql_GetFloatData(SqlHandle, 36) - 1) * -100); + trust->waterres = (uint16)((Sql_GetFloatData(SqlHandle, 37) - 1) * -100); + trust->lightres = (uint16)((Sql_GetFloatData(SqlHandle, 38) - 1) * -100); + trust->darkres = (uint16)((Sql_GetFloatData(SqlHandle, 39) - 1) * -100); g_PTrustList.push_back(trust); } diff --git a/src/map/utils/trustutils.h b/src/map/utils/trustutils.h index 2936fcbb1ed..e9bb4743e4f 100644 --- a/src/map/utils/trustutils.h +++ b/src/map/utils/trustutils.h @@ -12,9 +12,13 @@ namespace trustutils { void LoadTrustList(); void FreeTrustList(); + void SpawnTrust(CCharEntity * PMaster, uint32 TrustID); + + // Internal void BuildTrust(uint32 TrustID); CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID); + void LoadTrustStats(CTrustEntity* PTrust); }; #endif From e3de2443dfad383d54b33010a4529db5972dd501 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 15 Mar 2020 18:07:11 +0200 Subject: [PATCH 049/116] TODOs for trust.lua --- scripts/globals/trust.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index 79ba6e81d3f..e149e6550d3 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -12,6 +12,8 @@ tpz.trust = tpz.trust or {} tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) + -- TODO: Correct messages for all of these... + -- Trusts not allowed in an alliance if caster:checkSoloPartyAlliance() == 2 then return tpz.msg.basic.CANT_BE_USED_IN_AREA @@ -32,6 +34,7 @@ tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) -- Check party for trusts local num_pt = 0 local num_trusts = 0 + -- TODO: Trusts don't appear here yet local party = caster:getParty() for _, member in ipairs(party) do if member:getObjType() == tpz.objType.TRUST then From 3c5276a52d0f4071167ec95ad2bbf597d58fd139 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 15 Mar 2020 18:33:13 +0200 Subject: [PATCH 050/116] Little cleanup --- src/map/utils/trustutils.cpp | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index c0568970175..6fbbb336d76 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -28,34 +28,20 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "battleutils.h" #include "charutils.h" -#include "puppetutils.h" #include "../grades.h" #include "../map.h" #include "trustutils.h" #include "zoneutils.h" #include "../entities/mobentity.h" #include "../entities/trustentity.h" -#include "../entities/automatonentity.h" -#include "../ability.h" #include "../status_effect_container.h" -#include "../latent_effect_container.h" -#include "../mob_spell_list.h" -#include "../enmity_container.h" -#include "../items/item_weapon.h" #include "../zone_instance.h" #include "../ai/ai_container.h" -#include "../ai/controllers/mob_controller.h" -#include "../ai/controllers/pet_controller.h" -#include "../ai/controllers/automaton_controller.h" -#include "../ai/states/ability_state.h" -#include "../packets/char_abilities.h" #include "../packets/char_sync.h" -#include "../packets/char_update.h" #include "../packets/entity_update.h" #include "../packets/message_standard.h" -#include "../packets/pet_sync.h" #include "../packets/trust_sync.h" #include "../ai/controllers/trust_controller.h" @@ -132,13 +118,6 @@ std::vector g_PTrustList; namespace trustutils { - - /************************************************************************ - * * - * * - * * - ************************************************************************/ - void LoadTrustList() { FreeTrustList(); @@ -271,12 +250,6 @@ namespace trustutils } } - /************************************************************************ - * * - * Освобождаем список прототипов питомцев * - * * - ************************************************************************/ - void FreeTrustList() { g_PTrustIDList.clear(); From be04a0371dc01b5defdd0e0d59c55835522f7d12 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 15 Mar 2020 18:39:27 +0200 Subject: [PATCH 051/116] Add Monberaux trust spell script, because why not --- scripts/globals/spells/trust/monberaux.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 scripts/globals/spells/trust/monberaux.lua diff --git a/scripts/globals/spells/trust/monberaux.lua b/scripts/globals/spells/trust/monberaux.lua new file mode 100644 index 00000000000..7dc96b8aba4 --- /dev/null +++ b/scripts/globals/spells/trust/monberaux.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Monberaux +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end From 0410d7f1a8b3544b07e97389b05bacc5d605dfe9 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Mon, 16 Mar 2020 13:33:56 +0200 Subject: [PATCH 052/116] Include Trusts in getParty() and test ROV item limits --- scripts/globals/trust.lua | 4 ++-- src/map/lua/lua_baseentity.cpp | 15 +++++++++++++++ src/map/party.cpp | 10 +++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index e149e6550d3..f371d393a35 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -67,9 +67,9 @@ tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) end -- Limits set by ROV Key Items - if num_trusts >= 4 and not player:hasKeyItem(tpz.ki.RHAPSODY_IN_WHITE) then + if num_trusts >= 3 and not caster:hasKeyItem(tpz.ki.RHAPSODY_IN_WHITE) then return tpz.msg.basic.CANT_BE_USED_IN_AREA - elseif num_trusts >= 5 and not player:hasKeyItem(tpz.ki.RHAPSODY_IN_CRIMSON) then + elseif num_trusts >= 4 and not caster:hasKeyItem(tpz.ki.RHAPSODY_IN_CRIMSON) then return tpz.msg.basic.CANT_BE_USED_IN_AREA end diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index bc8685faaca..cb27af149e9 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -8486,6 +8486,21 @@ inline int32 CLuaBaseEntity::getParty(lua_State* L) lua_pcall(L, 2, 1, 0); lua_rawseti(L, -2, i++); + + if (member->objtype == TYPE_PC && auto PChar = static_cast(member)) + { + for (auto PTrust : PChar->PTrusts) + { + lua_getglobal(L, CLuaBaseEntity::className); + lua_pushstring(L, "new"); + lua_gettable(L, -2); + lua_insert(L, -2); + lua_pushlightuserdata(L, (void*)PTrust); + lua_pcall(L, 2, 1, 0); + + lua_rawseti(L, -2, i++); + } + } }); return 1; diff --git a/src/map/party.cpp b/src/map/party.cpp index 9b436210d89..cefe94e6134 100644 --- a/src/map/party.cpp +++ b/src/map/party.cpp @@ -200,10 +200,18 @@ uint8 CParty::MemberCount(uint16 ZoneID) for (uint32 i = 0; i < members.size(); ++i) { - if (members.at(i)->getZone() == ZoneID) + auto* member = members.at(i); + if (member->getZone() == ZoneID) { count++; } + if (member->objtype == TYPE_PC) + { + for (auto* trust : static_cast(member)->PTrusts) + { + count++; + } + } } return count; } From a423914114fa0e3d5b03d8e4ad5ba65e32c327c7 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Mon, 16 Mar 2020 13:57:57 +0200 Subject: [PATCH 053/116] Re-add getTrustID binding and clean up getParty lua table building --- src/map/lua/lua_baseentity.cpp | 40 ++++++++++++++++++++++++---------- src/map/lua/lua_baseentity.h | 1 + 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index cb27af149e9..9bf13e20b80 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -8476,29 +8476,28 @@ inline int32 CLuaBaseEntity::getParty(lua_State* L) lua_createtable(L, size, 0); int i = 1; - ((CBattleEntity*)m_PBaseEntity)->ForParty([&L, &i](CBattleEntity* member) + + auto luaTableEntry = [&](void* entry) { lua_getglobal(L, CLuaBaseEntity::className); lua_pushstring(L, "new"); lua_gettable(L, -2); lua_insert(L, -2); - lua_pushlightuserdata(L, (void*)member); + lua_pushlightuserdata(L, entry); lua_pcall(L, 2, 1, 0); lua_rawseti(L, -2, i++); + }; + + ((CBattleEntity*)m_PBaseEntity)->ForParty([&L, &i, &luaTableEntry](CBattleEntity* member) + { + luaTableEntry(member); - if (member->objtype == TYPE_PC && auto PChar = static_cast(member)) + if (member->objtype == TYPE_PC) { - for (auto PTrust : PChar->PTrusts) + for (auto PTrust : static_cast(member)->PTrusts) { - lua_getglobal(L, CLuaBaseEntity::className); - lua_pushstring(L, "new"); - lua_gettable(L, -2); - lua_insert(L, -2); - lua_pushlightuserdata(L, (void*)PTrust); - lua_pcall(L, 2, 1, 0); - - lua_rawseti(L, -2, i++); + luaTableEntry(PTrust); } } }); @@ -11927,6 +11926,22 @@ inline int32 CLuaBaseEntity::spawnTrust(lua_State *L) return 0; } +/************************************************************************ +* Function: getTrustID() +* Purpose : +* Example : trust:getTrustID() +* Notes : +************************************************************************/ + +inline int32 CLuaBaseEntity::getTrustID(lua_State* L) +{ + TPZ_DEBUG_BREAK_IF(m_PBaseEntity == nullptr); + TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_TRUST); + + lua_pushinteger(L, ((CTrustEntity*)m_PBaseEntity)->m_TrustID); + return 1; +} + /************************************************************************ * Function: despawnPet() * Purpose : Despawns a Pet Entity @@ -14565,6 +14580,7 @@ Lunar::Register_t CLuaBaseEntity::methods[] = LUNAR_DECLARE_METHOD(CLuaBaseEntity,updateAttachments), LUNAR_DECLARE_METHOD(CLuaBaseEntity,spawnTrust), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,getTrustID), // Mob Entity-Specific LUNAR_DECLARE_METHOD(CLuaBaseEntity,setMobLevel), diff --git a/src/map/lua/lua_baseentity.h b/src/map/lua/lua_baseentity.h index f489cb6b58b..95743693e56 100644 --- a/src/map/lua/lua_baseentity.h +++ b/src/map/lua/lua_baseentity.h @@ -579,6 +579,7 @@ class CLuaBaseEntity int32 despawnPet(lua_State*); // Despawns Pet int32 spawnTrust(lua_State*); // Spawns trust + int32 getTrustID(lua_State*); int32 isJugPet(lua_State*); // If the entity has a pet, test if it is a jug pet. int32 hasValidJugPetItem(lua_State*); From 6159e2ffead581dea8cc5d65fdbb3254300c9f34 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Mon, 16 Mar 2020 13:58:40 +0200 Subject: [PATCH 054/116] Fix Shantotto vs D Shantotto vs Shantotto II trust exclusion --- scripts/globals/trust.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index f371d393a35..5a663bc56ab 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -34,7 +34,6 @@ tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) -- Check party for trusts local num_pt = 0 local num_trusts = 0 - -- TODO: Trusts don't appear here yet local party = caster:getParty() for _, member in ipairs(party) do if member:getObjType() == tpz.objType.TRUST then @@ -43,13 +42,13 @@ tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) return tpz.msg.basic.CANT_BE_USED_IN_AREA -- Check not allowed trust combinations (Shantotto I vs Shantotto II) elseif type(not_allowed_trust_ids) == "number" then - if spell:getID() == not_allowed_trust_ids then + if member:getTrustID() == not_allowed_trust_ids then return tpz.msg.basic.CANT_BE_USED_IN_AREA end elseif type(not_allowed_trust_ids) == "table" then for _, v in pairs(not_allowed_trust_ids) do if type(v) == "number" then - if spell:getID() == v then + if member:getTrustID() == v then return tpz.msg.basic.CANT_BE_USED_IN_AREA end end From 0caf9c042b6fd62b73a2a12e89ddce552afa594f Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Mon, 16 Mar 2020 19:20:18 +0200 Subject: [PATCH 055/116] Load packet_name of trust --- src/map/utils/trustutils.cpp | 84 +++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 40 deletions(-) diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index 6fbbb336d76..8b2f182913c 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -55,9 +55,10 @@ std::vector g_PTrustIDList; struct Trust_t { uint32 trustID; - look_t look; // appearance data - string_t name; // name string - ECOSYSTEM EcoSystem; // ecosystem + look_t look; // appearance data + string_t name; // script name string + string_t packet_name; // packet name string + ECOSYSTEM EcoSystem; // ecosystem uint8 name_prefix; uint8 size; // размер модели @@ -151,6 +152,7 @@ namespace trustutils const char* Query = "SELECT \ mob_pools.name,\ + mob_pools.packet_name,\ mob_pools.modelid,\ mob_pools.familyid,\ mob_pools.mJob,\ @@ -193,39 +195,40 @@ namespace trustutils trust->trustID = TrustID; trust->name.insert(0, (const char*)Sql_GetData(SqlHandle, 0)); - memcpy(&trust->look, Sql_GetData(SqlHandle, 1), 20); - trust->m_Family = (uint16)Sql_GetIntData(SqlHandle, 2); - trust->mJob = (uint8)Sql_GetIntData(SqlHandle, 3); - trust->sJob = (uint8)Sql_GetIntData(SqlHandle, 4); - trust->hasSpellScript = (bool)Sql_GetIntData(SqlHandle, 5); - trust->spellList = (uint16)Sql_GetIntData(SqlHandle, 6); - trust->cmbDelay = (uint16)Sql_GetIntData(SqlHandle, 7); - trust->name_prefix = (uint8)Sql_GetUIntData(SqlHandle, 8); + trust->packet_name.insert(0, (const char*)Sql_GetData(SqlHandle, 1)); + memcpy(&trust->look, Sql_GetData(SqlHandle, 2), 20); + trust->m_Family = (uint16)Sql_GetIntData(SqlHandle, 3); + trust->mJob = (uint8)Sql_GetIntData(SqlHandle, 4); + trust->sJob = (uint8)Sql_GetIntData(SqlHandle, 5); + trust->hasSpellScript = (bool)Sql_GetIntData(SqlHandle, 6); + trust->spellList = (uint16)Sql_GetIntData(SqlHandle, 7); + trust->cmbDelay = (uint16)Sql_GetIntData(SqlHandle, 8); + trust->name_prefix = (uint8)Sql_GetUIntData(SqlHandle, 9); // Behaviour - trust->m_MobSkillList = (uint16)Sql_GetUIntData(SqlHandle, 10); + trust->m_MobSkillList = (uint16)Sql_GetUIntData(SqlHandle, 11); // SpellID - trust->size = Sql_GetUIntData(SqlHandle, 12); - trust->EcoSystem = (ECOSYSTEM)Sql_GetIntData(SqlHandle, 13); - trust->HPscale = Sql_GetFloatData(SqlHandle, 14); - trust->MPscale = Sql_GetFloatData(SqlHandle, 15); - trust->speed = (uint8)Sql_GetIntData(SqlHandle, 16); - trust->strRank = (uint8)Sql_GetIntData(SqlHandle, 17); - trust->dexRank = (uint8)Sql_GetIntData(SqlHandle, 18); - trust->vitRank = (uint8)Sql_GetIntData(SqlHandle, 19); - trust->agiRank = (uint8)Sql_GetIntData(SqlHandle, 20); - trust->intRank = (uint8)Sql_GetIntData(SqlHandle, 21); - trust->mndRank = (uint8)Sql_GetIntData(SqlHandle, 22); - trust->chrRank = (uint8)Sql_GetIntData(SqlHandle, 23); - trust->defRank = (uint8)Sql_GetIntData(SqlHandle, 24); - trust->attRank = (uint8)Sql_GetIntData(SqlHandle, 25); - trust->accRank = (uint8)Sql_GetIntData(SqlHandle, 26); - trust->evaRank = (uint8)Sql_GetIntData(SqlHandle, 27); + trust->size = Sql_GetUIntData(SqlHandle, 13); + trust->EcoSystem = (ECOSYSTEM)Sql_GetIntData(SqlHandle, 14); + trust->HPscale = Sql_GetFloatData(SqlHandle, 15); + trust->MPscale = Sql_GetFloatData(SqlHandle, 16); + trust->speed = (uint8)Sql_GetIntData(SqlHandle, 17); + trust->strRank = (uint8)Sql_GetIntData(SqlHandle, 18); + trust->dexRank = (uint8)Sql_GetIntData(SqlHandle, 19); + trust->vitRank = (uint8)Sql_GetIntData(SqlHandle, 20); + trust->agiRank = (uint8)Sql_GetIntData(SqlHandle, 21); + trust->intRank = (uint8)Sql_GetIntData(SqlHandle, 22); + trust->mndRank = (uint8)Sql_GetIntData(SqlHandle, 23); + trust->chrRank = (uint8)Sql_GetIntData(SqlHandle, 24); + trust->defRank = (uint8)Sql_GetIntData(SqlHandle, 25); + trust->attRank = (uint8)Sql_GetIntData(SqlHandle, 26); + trust->accRank = (uint8)Sql_GetIntData(SqlHandle, 27); + trust->evaRank = (uint8)Sql_GetIntData(SqlHandle, 28); // resistances - trust->slashres = (uint16)(Sql_GetFloatData(SqlHandle, 28) * 1000); - trust->pierceres = (uint16)(Sql_GetFloatData(SqlHandle, 29) * 1000); - trust->hthres = (uint16)(Sql_GetFloatData(SqlHandle, 30) * 1000); - trust->impactres = (uint16)(Sql_GetFloatData(SqlHandle, 31) * 1000); + trust->slashres = (uint16)(Sql_GetFloatData(SqlHandle, 29) * 1000); + trust->pierceres = (uint16)(Sql_GetFloatData(SqlHandle, 30) * 1000); + trust->hthres = (uint16)(Sql_GetFloatData(SqlHandle, 31) * 1000); + trust->impactres = (uint16)(Sql_GetFloatData(SqlHandle, 32) * 1000); trust->firedef = 0; trust->icedef = 0; @@ -236,14 +239,14 @@ namespace trustutils trust->lightdef = 0; trust->darkdef = 0; - trust->fireres = (uint16)((Sql_GetFloatData(SqlHandle, 32) - 1) * -100); - trust->iceres = (uint16)((Sql_GetFloatData(SqlHandle, 33) - 1) * -100); - trust->windres = (uint16)((Sql_GetFloatData(SqlHandle, 34) - 1) * -100); - trust->earthres = (uint16)((Sql_GetFloatData(SqlHandle, 35) - 1) * -100); - trust->thunderres = (uint16)((Sql_GetFloatData(SqlHandle, 36) - 1) * -100); - trust->waterres = (uint16)((Sql_GetFloatData(SqlHandle, 37) - 1) * -100); - trust->lightres = (uint16)((Sql_GetFloatData(SqlHandle, 38) - 1) * -100); - trust->darkres = (uint16)((Sql_GetFloatData(SqlHandle, 39) - 1) * -100); + trust->fireres = (uint16)((Sql_GetFloatData(SqlHandle, 33) - 1) * -100); + trust->iceres = (uint16)((Sql_GetFloatData(SqlHandle, 34) - 1) * -100); + trust->windres = (uint16)((Sql_GetFloatData(SqlHandle, 35) - 1) * -100); + trust->earthres = (uint16)((Sql_GetFloatData(SqlHandle, 36) - 1) * -100); + trust->thunderres = (uint16)((Sql_GetFloatData(SqlHandle, 37) - 1) * -100); + trust->waterres = (uint16)((Sql_GetFloatData(SqlHandle, 38) - 1) * -100); + trust->lightres = (uint16)((Sql_GetFloatData(SqlHandle, 39) - 1) * -100); + trust->darkres = (uint16)((Sql_GetFloatData(SqlHandle, 40) - 1) * -100); g_PTrustList.push_back(trust); } @@ -475,6 +478,7 @@ namespace trustutils PTrust->loc.p = nearPosition(PMaster->loc.p, CTrustController::SpawnDistance, (float)M_PI); PTrust->look = trustData->look; PTrust->name = trustData->name; + PTrust->packetName = trustData->packet_name; PTrust->m_name_prefix = trustData->name_prefix; PTrust->m_Family = trustData->m_Family; PTrust->m_MobSkillList = trustData->m_MobSkillList; From 6dbfbefcb2aec8572743ab64181b70da2d64cc52 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Mon, 16 Mar 2020 21:00:33 +0200 Subject: [PATCH 056/116] Horrible bandaid over cast-on-trust-client-crash --- src/map/ai/states/magic_state.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/map/ai/states/magic_state.cpp b/src/map/ai/states/magic_state.cpp index ee1c539d984..87297300757 100644 --- a/src/map/ai/states/magic_state.cpp +++ b/src/map/ai/states/magic_state.cpp @@ -122,7 +122,13 @@ bool CMagicState::Update(time_point tick) m_PEntity->PAI->EventHandler.triggerListener("MAGIC_USE", m_PEntity, PTarget, m_PSpell.get(), &action); PTarget->PAI->EventHandler.triggerListener("MAGIC_TAKE", PTarget, m_PEntity, m_PSpell.get(), &action); } - m_PEntity->loc.zone->PushPacket(m_PEntity, CHAR_INRANGE_SELF, new CActionPacket(action)); + + // TODO: If you cast directly on a trust, the client crashes! + if (!(PTarget->objtype == TYPE_TRUST)) + { + m_PEntity->loc.zone->PushPacket(m_PEntity, CHAR_INRANGE_SELF, new CActionPacket(action)); + } + Complete(); } else if (IsCompleted() && tick > GetEntryTime() + m_castTime + std::chrono::milliseconds(m_PSpell->getAnimationTime())) From bf88a207fa94e47ce08175014720c02b923efa21 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Mon, 16 Mar 2020 21:49:44 +0200 Subject: [PATCH 057/116] The grand re-naming --- sql/mob_pools.sql | 242 +++++++++++++++++++++++----------------------- 1 file changed, 121 insertions(+), 121 deletions(-) diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index 49b0a7165d4..31358aff17f 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5954,130 +5954,130 @@ INSERT INTO `mob_pools` VALUES (5893,'Gloombound_Lurker','Gloombound_Lurker',221 INSERT INTO `mob_pools` VALUES (5894,'Lesath','Lesath',217,0x00001C0100000000000000000000000000000000,1,1,7,280,100,0,1,0,1,2,7,0,238,141,0,0,0,1,0,370); INSERT INTO `mob_pools` VALUES (5895,'Donggu','Donggu',116,0x0000780100000000000000000000000000000000,1,1,11,240,100,0,0,0,1,2,7,0,0,3,0,0,0,1,0,116); -- Trusts -INSERT INTO `mob_pools` VALUES (5896,'Shantotto','shantotto',153,0x0000B80B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); -INSERT INTO `mob_pools` VALUES (5897,'Naji','naji',149,0x0000B90B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5898,'Kupipi','kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,1,312,1,0,0); -INSERT INTO `mob_pools` VALUES (5899,'Excenmille','excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,309,1,0,0); -INSERT INTO `mob_pools` VALUES (5900,'Ayame','ayame',149,0x0000BC0B00000000000000000000000000000000,12,0,10,440,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5901,'NanaaMihgo','nanaa_mihgo',152,0x0000BD0B00000000000000000000000000000000,6,0,2,190,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5902,'Curilla','curilla',145,0x0000BE0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,308,1,0,0); -INSERT INTO `mob_pools` VALUES (5903,'Volker','volker',149,0x0000BF0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,8,1,0,0); -INSERT INTO `mob_pools` VALUES (5904,'Ajido-Marujido','ajido-marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,1,311,1,0,0); -INSERT INTO `mob_pools` VALUES (5905,'Trion','trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,310,1,0,0); -INSERT INTO `mob_pools` VALUES (5906,'Zeid','zeid',145,0x0000C20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5907,'Lion','lion',145,0x0000C30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5908,'Tenzen','tenzen',145,0x0000C40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5909,'MihliAliapoh','mihli_aliapoh',145,0x0000C50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5910,'Valaineral','valaineral',145,0x0000C60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5911,'Joachim','joachim',145,0x0000C70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5912,'NajaSalaheem','naja_salaheem',145,0x0000C80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5913,'Prishe','prishe',145,0x0000C90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5914,'Ulmia','ulmia',145,0x0000CA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5915,'ShikareeZ','shikaree_z',145,0x0000CB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5916,'Cherukiki','cherukiki',145,0x0000CC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5917,'IronEater','iron_eater',145,0x0000CD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5918,'Gessho','gessho',145,0x0000CE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5919,'Gadalar','gadalar',145,0x0000CF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5920,'Rainemard','rainemard',145,0x0000D00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5921,'Ingrid','ingrid',145,0x0000D10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5922,'LehkoHabhoka','lehko_habhoka',145,0x0000D20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5923,'Nashmeira','nashmeira',145,0x0000D30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5924,'Zazarg','zazarg',145,0x0000D40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5925,'Ovjang','ovjang',145,0x0000D50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5926,'Mnejing','mnejing',145,0x0000D60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5927,'Sakura','sakura',145,0x0000D70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5928,'Luzaf','luzaf',145,0x0000D80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5929,'Najelith','najelith',145,0x0000D90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5930,'Aldo','aldo',145,0x0000DA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5931,'Moogle','moogle',145,0x0000DB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5932,'Fablinix','fablinix',145,0x0000DC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5933,'Maat','maat',145,0x0000DD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5934,'D.Shantotto','d_shantotto',145,0x0000DE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,313,1,0,0); -INSERT INTO `mob_pools` VALUES (5935,'StarSibyl','star_sibyl',145,0x0000DF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5936,'Karaha-Baruha','karaha-baruha',145,0x0000E00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5937,'Cid','cid',145,0x0000E10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5938,'Gilgamesh','gilgamesh',145,0x0000E20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5939,'Areuhat','areuhat',145,0x0000E30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5940,'SemihLafihna','semih_lafihna',145,0x0000E40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5941,'Elivira','elivira',145,0x0000E50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5942,'Noillurie','noillurie',145,0x0000E60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5943,'LhuMhakaracca','lhu_mhakaracca',145,0x0000E70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5944,'FerreousCoffin','ferreous_coffin',145,0x0000E80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5945,'Lilisette','lilisette',145,0x0000E90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5946,'Mumor','mumor',145,0x0000EA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5947,'UkaTotlihn','uka_totlihn',145,0x0000EB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5948,'Klara','klara',145,0x0000ED0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5949,'RomaaMihgo','romaa_mihgo',145,0x0000EE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5950,'KuyinHathdenna','kuyin_hathdenna',145,0x0000EF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5951,'Rahal','rahal',145,0x0000F00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5952,'Koru-Moru','koru-moru',145,0x0000F10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5953,'Pieuje','pieuje_uc',145,0x0000F20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5954,'InvincibleShld','i_shield_uc',145,0x0000F40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5955,'Apururu','apururu_uc',145,0x0000F50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5956,'JakohWahcondalo','jakoh_uc',145,0x0000F60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5957,'Flaviria','flaviria_uc',145,0x0000F30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5958,'Babban','babban',145,0x0000FB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5959,'Abenzio','abenzio',145,0x0000FC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5960,'Rughadjeen','rughadjeen',145,0x0000FD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5961,'Kukki-Chebukki','kukki-chebukki',145,0x0000FE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5962,'Margret','margret',145,0x0000FF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5963,'Chacharoon','chacharoon',145,0x0000000C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5964,'LheLhangavo','lhe_lhangavo',145,0x0000010C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5965,'Arciela','arciela',145,0x0000020C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5966,'Mayakov','mayakov',145,0x0000030C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5967,'Qultada','qultada',145,0x0000040C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5968,'Adelheid','adelheid',145,0x0000050C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5969,'Amchuchu','amchuchu',145,0x0000060C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5970,'Brygid','brygid',145,0x0000070C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5971,'Mildaurion','mildaurion',145,0x0000080C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5972,'Halver','halver',145,0x00000F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5973,'Rongelouts','rongelouts',145,0x0000100C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5974,'Leonoyne','leonoyne',145,0x0000110C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5975,'Maximilian','maximilian',145,0x0000120C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5976,'Kayeel-Payeel','kayeel-payeel',145,0x0000130C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5977,'Robel-Akbel','robel-akbel',145,0x0000140C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5978,'Kupofried','kupofried',145,0x0000150C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5979,'Selh\'teus','selh_teus',145,0x0000160C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5980,'Yoran-Oran','yoran-oran_uc',145,0x0000170C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5981,'Sylvie','sylvie_uc',145,0x0000180C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5982,'Abquhbah','abquhbah',145,0x00001A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5983,'Balamor','balamor',145,0x00001B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5984,'August','august',145,0x00001C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5985,'Rosulatia','rosulatia',145,0x00001D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5986,'Teodor','teodor',145,0x00001F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5987,'Ullegore','ullegore',145,0x0000210C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5988,'Makki-Chebukki','makki-chebukki',145,0x0000220C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5989,'KingOfHearts','king_of_hearts',145,0x0000230C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5990,'Morimar','morimar',145,0x0000240C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5991,'Darrcuiln','darrcuiln',145,0x0000250C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5992,'ArkHM','aahm',145,0x0000290C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5993,'ArkEV','aaev',145,0x00002A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5994,'ArkMR','aamr',145,0x00002B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5995,'ArkTT','aatt',145,0x00002C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5996,'ArkGK','aagk',145,0x00002D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5997,'Iroha','iroha',145,0x0000270C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5998,'Ygnas','ygnas',145,0x00002E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5999,'Monberaux','monberaux',145,0x00002E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5896,'shantotto','Shantotto',153,0x0000B80B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); +INSERT INTO `mob_pools` VALUES (5897,'naji',Naji',149,0x0000B90B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5898,'kupipi','Kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,1,312,1,0,0); +INSERT INTO `mob_pools` VALUES (5899,'excenmille','Excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,309,1,0,0); +INSERT INTO `mob_pools` VALUES (5900,'ayame','Ayame',149,0x0000BC0B00000000000000000000000000000000,12,0,10,440,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5901,'nanaa_mihgo','NanaaMihgo',152,0x0000BD0B00000000000000000000000000000000,6,0,2,190,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5902,'curilla','Curilla',145,0x0000BE0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,308,1,0,0); +INSERT INTO `mob_pools` VALUES (5903,'volker','Volker',149,0x0000BF0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,8,1,0,0); +INSERT INTO `mob_pools` VALUES (5904,'ajido-marujido','Ajido-Marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,1,311,1,0,0); +INSERT INTO `mob_pools` VALUES (5905,'trion','Trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,310,1,0,0); +INSERT INTO `mob_pools` VALUES (5906,'zeid','Zeid',145,0x0000C20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5907,'lion','Lion',145,0x0000C30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5908,'tenzen','Tenzen',145,0x0000C40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5909,'mihli_aliapoh','MihliAliapoh',145,0x0000C50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5910,'valaineral','Valaineral',145,0x0000C60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5911,'joachim','Joachim',145,0x0000C70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5912,'naja_salaheem','NajaSalaheem',145,0x0000C80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5913,'prishe','Prishe',145,0x0000C90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5914,'ulmia','Ulmia',145,0x0000CA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5915,'shikaree_z','ShikareeZ',145,0x0000CB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5916,'cherukiki','Cherukiki',145,0x0000CC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5917,'iron_eater','IronEater',145,0x0000CD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5918,'gessho','Gessho',145,0x0000CE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5919,'gadalar','Gadalar',145,0x0000CF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5920,'rainemard','Rainemard',145,0x0000D00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5921,'ingrid','Ingrid',145,0x0000D10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5922,'lehko_habhoka','LehkoHabhoka',145,0x0000D20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5923,'nashmeira','Nashmeira',145,0x0000D30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5924,'zazarg','Zazarg',145,0x0000D40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5925,'ovjang','Ovjang',145,0x0000D50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5926,'mnejing','Mnejing',145,0x0000D60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5927,'sakura','Sakura',145,0x0000D70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5928,'luzaf','Luzaf',145,0x0000D80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5929,'najelith','Najelith',145,0x0000D90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5930,'aldo','Aldo',145,0x0000DA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5931,'moogle','Moogle',145,0x0000DB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5932,'fablinix','Fablinix',145,0x0000DC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5933,'maat','Maat',145,0x0000DD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5934,'d_shantotto','D.Shantotto',145,0x0000DE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,313,1,0,0); +INSERT INTO `mob_pools` VALUES (5935,'star_sibyl','StarSibyl',145,0x0000DF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5936,'karaha-baruha','Karaha-Baruha',145,0x0000E00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5937,'cid','Cid',145,0x0000E10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5938,'gilgamesh','Gilgamesh',145,0x0000E20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5939,'areuhat','Areuhat',145,0x0000E30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5940,'semih_lafihna','SemihLafihna',145,0x0000E40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5941,'elivira','Elivira',145,0x0000E50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5942,'noillurie','Noillurie',145,0x0000E60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5943,'lhu_mhakaracca','LhuMhakaracca',145,0x0000E70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5944,'ferreous_coffin','FerreousCoffin',145,0x0000E80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5945,'lilisette','Lilisette',145,0x0000E90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5946,'mumor','Mumor',145,0x0000EA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5947,'uka_totlihn','UkaTotlihn',145,0x0000EB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5948,'klara','Klara',145,0x0000ED0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5949,'romaa_mihgo','RomaaMihgo',145,0x0000EE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5950,'kuyin_hathdenna','KuyinHathdenna',145,0x0000EF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5951,'rahal','Rahal',145,0x0000F00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5952,'koru-moru','Koru-Moru',145,0x0000F10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5953,'pieuje_uc','Pieuje',145,0x0000F20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5954,'i_shield_uc','InvincibleShld',145,0x0000F40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5955,'apururu_uc','Apururu',145,0x0000F50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5956,'jakoh_uc','JakohWahcondalo',145,0x0000F60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5957,'flaviria_uc','Flaviria',145,0x0000F30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5958,'babban','Babban',145,0x0000FB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5959,'abenzio','Abenzio',145,0x0000FC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5960,'rughadjeen','Rughadjeen',145,0x0000FD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5961,'kukki-chebukki','Kukki-Chebukki',145,0x0000FE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5962,'margret','Margret',145,0x0000FF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5963,'chacharoon','Chacharoon',145,0x0000000C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5964,'lhe_lhangavo','LheLhangavo',145,0x0000010C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5965,'arciela','Arciela',145,0x0000020C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5966,'mayakov','Mayakov',145,0x0000030C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5967,'qultada','Qultada',145,0x0000040C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5968,'adelheid','Adelheid',145,0x0000050C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5969,'amchuchu','Amchuchu',145,0x0000060C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5970,'brygid','Brygid',145,0x0000070C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5971,'mildaurion','Mildaurion',145,0x0000080C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5972,'halver','Halver',145,0x00000F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5973,'rongelouts','Rongelouts',145,0x0000100C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5974,'leonoyne','Leonoyne',145,0x0000110C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5975,'maximilian','Maximilian',145,0x0000120C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5976,'kayeel-payeel','Kayeel-Payeel',145,0x0000130C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5977,'robel-akbel','Robel-Akbel',145,0x0000140C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5978,'kupofried','Kupofried',145,0x0000150C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5979,'selh_teus','Selh\'teus',145,0x0000160C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5980,'yoran-oran_uc','Yoran-Oran',145,0x0000170C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5981,'sylvie_uc','Sylvie',145,0x0000180C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5982,'abquhbah','Abquhbah',145,0x00001A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5983,'balamor','Balamor',145,0x00001B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5984,'august','August',145,0x00001C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5985,'rosulatia','Rosulatia',145,0x00001D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5986,'teodor','Teodor',145,0x00001F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5987,'ullegore','Ullegore',145,0x0000210C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5988,'makki-chebukki','Makki-Chebukki',145,0x0000220C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5989,'king_of_hearts','KingOfHearts',145,0x0000230C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5990,'morimar','Morimar',145,0x0000240C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5991,'darrcuiln','Darrcuiln',145,0x0000250C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5992,'aahm','ArkHM',145,0x0000290C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5993,'aaev','ArkEV',145,0x00002A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5994,'aamr','ArkMR',145,0x00002B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5995,'aatt','ArkTT',145,0x00002C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5996,'aagk','ArkGK',145,0x00002D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5997,'iroha','Iroha',145,0x0000270C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5998,'ygnas','Ygnas',145,0x00002E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +-- Reserved for future Trust 5999 -- Reserved for future Trust 6000 -- Reserved for future Trust 6001 -- Reserved for future Trust 6002 -INSERT INTO `mob_pools` VALUES (6003,'Cornelia','cornelia',145,0x00002F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6004,'Excenmille','excenmille_s',145,0x0000EC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6005,'Ayame','ayame_uc',145,0x0000F70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6006,'Maat','maat_uc',145,0x0000F80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6007,'Aldo','aldo_uc',145,0x0000F90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6008,'NajaSalaheem','naja_uc',145,0x0000FA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6009,'Lion','lion_ii',145,0x0000090C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6010,'Zeid','zeid_ii',145,0x00000E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6011,'Prishe','prishe_ii',145,0x00000A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6012,'Nashmeira','nashmeira_ii',145,0x00000B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6013,'Lilisette','lilisette_ii',145,0x00000C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6014,'Tenzen','tenzen_ii',145,0x0000190C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6015,'Mumor','mumor_ii',145,0x0000200C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6016,'Ingrid','ingrid_ii',145,0x00001E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6017,'Arciela','arciela_ii',145,0x00000D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6018,'Iroha','iroha_ii',145,0x0000280C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6019,'Shantotto','shantotto_ii',153,0x0000260C00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); +INSERT INTO `mob_pools` VALUES (6003,'cornelia','Cornelia',145,0x00002F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6004,'excenmille_s','Excenmille',145,0x0000EC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6005,'ayame_uc','Ayame',145,0x0000F70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6006,'maat_uc','Maat',145,0x0000F80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6007,'aldo_uc','Aldo',145,0x0000F90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6008,'naja_uc','NajaSalaheem',145,0x0000FA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6009,'lion_ii','Lion',145,0x0000090C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6010,'zeid_ii','Zeid',145,0x00000E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6011,'prishe_ii','Prishe',145,0x00000A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6012,'nashmeira_ii','Nashmeira',145,0x00000B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6013,'lilisette_ii','Lilisette',145,0x00000C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6014,'tenzen_ii','Tenzen',145,0x0000190C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6015,'mumor_ii','Mumor',145,0x0000200C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6016,'ingrid_ii','Ingrid',145,0x00001E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6017,'arciela_ii','Arciela',145,0x00000D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6018,'iroha_ii','Iroha',145,0x0000280C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6019,'shantotto_ii','Shantotto',153,0x0000260C00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); -- Reserved for future Trust 6020 -- Reserved for future Trust 6021 -- Reserved for future Trust 6022 From 9f229c2ed1f296f7d98322b0944f5212d75fa755 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Mon, 16 Mar 2020 21:52:09 +0200 Subject: [PATCH 058/116] Fix missing ' --- sql/mob_pools.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index 31358aff17f..c391a186ec7 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5955,7 +5955,7 @@ INSERT INTO `mob_pools` VALUES (5894,'Lesath','Lesath',217,0x00001C0100000000000 INSERT INTO `mob_pools` VALUES (5895,'Donggu','Donggu',116,0x0000780100000000000000000000000000000000,1,1,11,240,100,0,0,0,1,2,7,0,0,3,0,0,0,1,0,116); -- Trusts INSERT INTO `mob_pools` VALUES (5896,'shantotto','Shantotto',153,0x0000B80B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); -INSERT INTO `mob_pools` VALUES (5897,'naji',Naji',149,0x0000B90B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5897,'naji','Naji',149,0x0000B90B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5898,'kupipi','Kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,1,312,1,0,0); INSERT INTO `mob_pools` VALUES (5899,'excenmille','Excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,309,1,0,0); INSERT INTO `mob_pools` VALUES (5900,'ayame','Ayame',149,0x0000BC0B00000000000000000000000000000000,12,0,10,440,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); From c6f3b9644358cbe79d7c149d70694d6b554f0898 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Mon, 16 Mar 2020 22:33:32 +0200 Subject: [PATCH 059/116] Spawn trust after creation! --- src/map/utils/trustutils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index 8b2f182913c..5696f1eb7d7 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -453,6 +453,8 @@ namespace trustutils PMaster->PTrusts.insert(PMaster->PTrusts.end(), PTrust); PMaster->StatusEffectContainer->CopyConfrontationEffect(PTrust); PMaster->loc.zone->InsertTRUST(PTrust); + PTrust->Spawn(); + PMaster->PParty->ReloadParty(); } @@ -511,5 +513,4 @@ namespace trustutils // TODO: Load stats from script return PTrust; } - }; // namespace trustutils From d4fec8729ea3ee4ae6433ea65a47f8e88fe62b63 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Mon, 16 Mar 2020 22:35:26 +0200 Subject: [PATCH 060/116] OnMobSpawn/OnMobDespawn/OnMobDeath now support trusts --- scripts/globals/spells/trust/shantotto.lua | 12 +++++++ src/map/entities/trustentity.cpp | 4 +++ src/map/lua/luautils.cpp | 41 ++++++++++++++++++---- 3 files changed, 51 insertions(+), 6 deletions(-) diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index 59dcf72ada0..ad8d5977ad0 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -11,3 +11,15 @@ end function onSpellCast(caster, target, spell) return tpz.trust.spawn(caster, spell) end + +function onMobSpawn(mob) + print("Hello") +end + +function onMobDespawn(mob) + print("Goodbye For Now") +end + +function onMobDeath(mob) + print("Goodbye Forever!") +end \ No newline at end of file diff --git a/src/map/entities/trustentity.cpp b/src/map/entities/trustentity.cpp index b11d0932637..80561bf5aa8 100644 --- a/src/map/entities/trustentity.cpp +++ b/src/map/entities/trustentity.cpp @@ -31,6 +31,7 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "../ai/helpers/targetfind.h" #include "../ai/states/ability_state.h" #include "../utils/battleutils.h" +#include "../utils/trustutils.h" CTrustEntity::CTrustEntity(CCharEntity* PChar) { @@ -76,12 +77,14 @@ void CTrustEntity::PostTick() void CTrustEntity::FadeOut() { + luautils::OnMobDespawn(this); CMobEntity::FadeOut(); loc.zone->PushPacket(this, CHAR_INRANGE, new CEntityUpdatePacket(this, ENTITY_DESPAWN, UPDATE_NONE)); } void CTrustEntity::Die() { + luautils::OnMobDeath(this, nullptr); PAI->ClearStateStack(); PAI->Internal_Die(0s); CBattleEntity::Die(); @@ -96,6 +99,7 @@ void CTrustEntity::Spawn() { //we need to skip CMobEntity's spawn because it calculates stats (and our stats are already calculated) CBattleEntity::Spawn(); + luautils::OnMobSpawn(this); ((CCharEntity*)PMaster)->pushPacket(new CTrustSyncPacket((CCharEntity*)PMaster, this)); } diff --git a/src/map/lua/luautils.cpp b/src/map/lua/luautils.cpp index f58f4df7e98..ec30165b0d6 100644 --- a/src/map/lua/luautils.cpp +++ b/src/map/lua/luautils.cpp @@ -2885,9 +2885,18 @@ namespace luautils else { int8 File[255]; - memset(File, 0, sizeof(File)); - PMob->objtype == TYPE_PET ? snprintf((char*)File, sizeof(File), "scripts/globals/pets/%s.lua", static_cast(PMob)->GetScriptName().c_str()) : - snprintf((char*)File, sizeof(File), "scripts/zones/%s/mobs/%s.lua", PMob->loc.zone->GetName(), PMob->GetName());; + switch (PMob->objtype) + { + case TYPE_MOB: + snprintf((char*)File, sizeof(File), "scripts/zones/%s/mobs/%s.lua", PMob->loc.zone->GetName(), PMob->GetName()); + break; + case TYPE_PET: + snprintf((char*)File, sizeof(File), "scripts/globals/pets/%s.lua", static_cast(PMob)->GetScriptName().c_str()); + break; + case TYPE_TRUST: + snprintf((char*)File, sizeof(File), "scripts/globals/spells/trust/%s.lua", PMob->GetName()); + break; + } lua_pushnil(LuaHandle); lua_setglobal(LuaHandle, "onMobDeath"); @@ -2934,8 +2943,19 @@ namespace luautils TPZ_DEBUG_BREAK_IF(PMob == nullptr); int8 File[255]; - PMob->objtype == TYPE_PET ? snprintf((char*)File, sizeof(File), "scripts/globals/pets/%s.lua", static_cast(PMob)->GetScriptName().c_str()) : + switch (PMob->objtype) + { + case TYPE_MOB: snprintf((char*)File, sizeof(File), "scripts/zones/%s/mobs/%s.lua", PMob->loc.zone->GetName(), PMob->GetName()); + break; + case TYPE_PET: + snprintf((char*)File, sizeof(File), "scripts/globals/pets/%s.lua", static_cast(PMob)->GetScriptName().c_str()); + break; + case TYPE_TRUST: + snprintf((char*)File, sizeof(File), "scripts/globals/spells/trust/%s.lua", PMob->GetName()); + break; + } + if (prepFile(File, "onMobSpawn")) { return -1; @@ -2944,7 +2964,6 @@ namespace luautils CLuaBaseEntity LuaMobEntity(PMob); Lunar::push(LuaHandle, &LuaMobEntity); - if (lua_pcall(LuaHandle, 1, 0, 0)) { ShowError("luautils::onMobSpawn: %s\n", lua_tostring(LuaHandle, -1)); @@ -3021,8 +3040,18 @@ namespace luautils TPZ_DEBUG_BREAK_IF(PMob == nullptr); int8 File[255]; - PMob->objtype == TYPE_PET ? snprintf((char*)File, sizeof(File), "scripts/globals/pets/%s.lua", static_cast(PMob)->GetScriptName().c_str()) : + switch (PMob->objtype) + { + case TYPE_MOB: snprintf((char*)File, sizeof(File), "scripts/zones/%s/mobs/%s.lua", PMob->loc.zone->GetName(), PMob->GetName()); + break; + case TYPE_PET: + snprintf((char*)File, sizeof(File), "scripts/globals/pets/%s.lua", static_cast(PMob)->GetScriptName().c_str()); + break; + case TYPE_TRUST: + snprintf((char*)File, sizeof(File), "scripts/globals/spells/trust/%s.lua", PMob->GetName()); + break; + } if (prepFile(File, "onMobDespawn")) { From f4e801b5fc7081d47de072ea6faf9a08316660f7 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 17 Mar 2020 12:59:36 +0200 Subject: [PATCH 061/116] Add/fix/test some trust exclusions --- scripts/globals/spells/trust/d_shantotto.lua | 2 +- scripts/globals/spells/trust/excenmille.lua | 2 +- scripts/globals/spells/trust/excenmille_s.lua | 13 +++++++++++++ scripts/globals/spells/trust/maat.lua | 2 +- scripts/globals/spells/trust/maat_uc.lua | 13 +++++++++++++ scripts/globals/spells/trust/shantotto.lua | 2 +- scripts/globals/spells/trust/shantotto_ii.lua | 2 +- scripts/globals/spells/trust/zeid.lua | 2 +- scripts/globals/spells/trust/zeid_ii.lua | 13 +++++++++++++ 9 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 scripts/globals/spells/trust/excenmille_s.lua create mode 100644 scripts/globals/spells/trust/maat_uc.lua create mode 100644 scripts/globals/spells/trust/zeid_ii.lua diff --git a/scripts/globals/spells/trust/d_shantotto.lua b/scripts/globals/spells/trust/d_shantotto.lua index 4cd9de038f3..d424ce2bc59 100644 --- a/scripts/globals/spells/trust/d_shantotto.lua +++ b/scripts/globals/spells/trust/d_shantotto.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell, {896, 1019}) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/excenmille.lua b/scripts/globals/spells/trust/excenmille.lua index a658c7b1ffd..042418d1e59 100644 --- a/scripts/globals/spells/trust/excenmille.lua +++ b/scripts/globals/spells/trust/excenmille.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1004) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/excenmille_s.lua b/scripts/globals/spells/trust/excenmille_s.lua new file mode 100644 index 00000000000..d1904910bc1 --- /dev/null +++ b/scripts/globals/spells/trust/excenmille_s.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Excenmille S +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell, 899) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/maat.lua b/scripts/globals/spells/trust/maat.lua index 1e00ba1c626..6234b8b1cf6 100644 --- a/scripts/globals/spells/trust/maat.lua +++ b/scripts/globals/spells/trust/maat.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1006) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/maat_uc.lua b/scripts/globals/spells/trust/maat_uc.lua new file mode 100644 index 00000000000..3524ed20829 --- /dev/null +++ b/scripts/globals/spells/trust/maat_uc.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Maat UC +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell, 933) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index ad8d5977ad0..31838bcd2b8 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell, {934, 1019}) + return tpz.trust.canCast(caster, spell, 1019) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/shantotto_ii.lua b/scripts/globals/spells/trust/shantotto_ii.lua index e569daeeefc..d52c78536bf 100644 --- a/scripts/globals/spells/trust/shantotto_ii.lua +++ b/scripts/globals/spells/trust/shantotto_ii.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell, {896, 934}) + return tpz.trust.canCast(caster, spell, 896) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/zeid.lua b/scripts/globals/spells/trust/zeid.lua index e2a87e73a2f..ad8aa43c559 100644 --- a/scripts/globals/spells/trust/zeid.lua +++ b/scripts/globals/spells/trust/zeid.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1010) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/zeid_ii.lua b/scripts/globals/spells/trust/zeid_ii.lua new file mode 100644 index 00000000000..4fd04701236 --- /dev/null +++ b/scripts/globals/spells/trust/zeid_ii.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Zeid II +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell, 906) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end From d064bef3acaf6d0a90a6138fe9be2436b75b3d15 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 17 Mar 2020 13:52:03 +0200 Subject: [PATCH 062/116] Trusts now die correctly --- src/map/ai/controllers/trust_controller.cpp | 2 +- src/map/entities/trustentity.cpp | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index e717c84fef5..2680f1540c9 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -75,7 +75,7 @@ void CTrustController::DoCombatTick(time_point tick) return; } - auto PTarget{ POwner->GetBattleTarget() }; + auto PTarget = POwner->GetBattleTarget(); if (PTarget) { if (POwner->PAI->CanFollowPath()) diff --git a/src/map/entities/trustentity.cpp b/src/map/entities/trustentity.cpp index 80561bf5aa8..724587aec3c 100644 --- a/src/map/entities/trustentity.cpp +++ b/src/map/entities/trustentity.cpp @@ -49,17 +49,14 @@ void CTrustEntity::PostTick() if (loc.zone && updatemask && status != STATUS_DISAPPEAR) { loc.zone->PushPacket(this, CHAR_INRANGE, new CEntityUpdatePacket(this, ENTITY_UPDATE, updatemask)); - for (auto PTrust : ((CCharEntity*)PMaster)->PTrusts) + if (PMaster) { - if (PTrust == this) - { - ((CCharEntity*)PMaster)->pushPacket(new CTrustSyncPacket((CCharEntity*)PMaster, this)); - } + ((CCharEntity*)PMaster)->pushPacket(new CTrustSyncPacket((CCharEntity*)PMaster, this)); } if (updatemask & UPDATE_HP) { - if (PMaster->PParty != nullptr) + if (PMaster && PMaster->PParty != nullptr) { PMaster->ForParty([this](auto PMember) { From 1d97ec6208de6e287ce4866323b0751cfdb17e1c Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 17 Mar 2020 13:52:33 +0200 Subject: [PATCH 063/116] MobEntity cleanup --- src/map/entities/mobentity.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/map/entities/mobentity.h b/src/map/entities/mobentity.h index 7d1d8a09cd7..c13756ef398 100644 --- a/src/map/entities/mobentity.h +++ b/src/map/entities/mobentity.h @@ -169,7 +169,7 @@ class CMobEntity : public CBattleEntity virtual void OnCastFinished(CMagicState&, action_t&) override; virtual void OnDisengage(CAttackState&) override; - virtual void OnDeathTimer() override;public: + virtual void OnDeathTimer() override; virtual void OnDespawn(CDespawnState&) override; @@ -256,8 +256,6 @@ class CMobEntity : public CBattleEntity void DistributeRewards(); void DropItems(CCharEntity* PChar); - - private: time_point m_DespawnTimer {time_point::min()}; // Despawn Timer to despawn mob after set duration From 8604e66a59cce3ea607bebaae3625a694e8b626e Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 17 Mar 2020 17:07:08 +0200 Subject: [PATCH 064/116] Add trust messages to message_standard.h --- src/map/packets/message_standard.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/map/packets/message_standard.h b/src/map/packets/message_standard.h index d75e0b11ac6..054370997dc 100644 --- a/src/map/packets/message_standard.h +++ b/src/map/packets/message_standard.h @@ -87,6 +87,8 @@ enum class MsgStd PollProposalLinkshell2 = 289, // Player Name's proposal to the linkshell group (cast vote with command: "/vote ?"): CurrentPollResultsLinkshell2 = 290, // Player Name's proposal - Current poll results: FinalPollResultsLinkshell2 = 291, // Player Name's proposal - Final poll results: + TrustCannotJoinParty = 265, // You are unable to join a party whose leader currently has an alter ego present. + TrustCannotJoinAlliance = 266, // You are unable to join an alliance whose leader currently has an alter ego present. TrustCannotLFP = 296, // You cannot use Trust magic while seeking a party. WaitParty = 297, // While inviting a party member, you must wait a while before using Trust magic. TrustLimit = 298, // You have called forth your maximum number of alter egos. From 98c319dc65782f45cef7107227eff17366f7781f Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 17 Mar 2020 17:27:03 +0200 Subject: [PATCH 065/116] Add trust basic messages --- scripts/globals/msg.lua | 4 ++++ scripts/globals/trust.lua | 20 +++++++++----------- src/map/packets/message_basic.h | 3 +++ 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/scripts/globals/msg.lua b/scripts/globals/msg.lua index 61d072fbea4..f46192326ed 100644 --- a/scripts/globals/msg.lua +++ b/scripts/globals/msg.lua @@ -306,4 +306,8 @@ tpz.msg.basic = DESPOIL_EVA_DOWN = 597, -- ${actor} uses ${ability}.${lb}${actor} steals a ${item} from ${target}.${lb}Additional effect: ${target} is afflicted with Evasion Down. DESPOIL_ACC_DOWN = 598, -- ${actor} uses ${ability}.${lb}${actor} steals a ${item} from ${target}.${lb}Additional effect: ${target} is afflicted with Accuracy Down. DESPOIL_SLOW = 599, -- ${actor} uses ${ability}.${lb}${actor} steals a ${item} from ${target}.${lb}Additional effect: ${target} is afflicted with Slow. + + -- TRUST & ALTER EGO */ + TRUST_NO_CAST_TRUST = 700, -- You are unable to use Trust magic at this time. + TRUST_NO_CALL_AE = 717, -- You cannot call forth alter egos here. } \ No newline at end of file diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index 5a663bc56ab..67505bdc2b3 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -12,23 +12,21 @@ tpz.trust = tpz.trust or {} tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) - -- TODO: Correct messages for all of these... - -- Trusts not allowed in an alliance if caster:checkSoloPartyAlliance() == 2 then - return tpz.msg.basic.CANT_BE_USED_IN_AREA + return tpz.msg.basic.TRUST_NO_CAST_TRUST end -- Trusts only allowed in certain zones if not caster:canUseMisc(tpz.zoneMisc.TRUST) then -- TODO: Update area flags - --return tpz.msg.basic.CANT_BE_USED_IN_AREA + --return tpz.msg.basic.TRUST_NO_CALL_AE end -- You can only summon trusts if you are the party leader or solo local leader = caster:getPartyLeader() if leader and caster:getID() ~= leader:getID() then - return tpz.msg.basic.CANT_BE_USED_IN_AREA + return tpz.msg.basic.TRUST_NO_CAST_TRUST end -- Check party for trusts @@ -39,17 +37,17 @@ tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) if member:getObjType() == tpz.objType.TRUST then -- Check for same trust if member:getTrustID() == spell:getID() then - return tpz.msg.basic.CANT_BE_USED_IN_AREA + return tpz.msg.basic.TRUST_NO_CAST_TRUST -- Check not allowed trust combinations (Shantotto I vs Shantotto II) elseif type(not_allowed_trust_ids) == "number" then if member:getTrustID() == not_allowed_trust_ids then - return tpz.msg.basic.CANT_BE_USED_IN_AREA + return tpz.msg.basic.TRUST_NO_CAST_TRUST end elseif type(not_allowed_trust_ids) == "table" then for _, v in pairs(not_allowed_trust_ids) do if type(v) == "number" then if member:getTrustID() == v then - return tpz.msg.basic.CANT_BE_USED_IN_AREA + return tpz.msg.basic.TRUST_NO_CAST_TRUST end end end @@ -62,14 +60,14 @@ tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) -- Max party size if num_pt >= 6 then - return tpz.msg.basic.CANT_BE_USED_IN_AREA + return tpz.msg.basic.TRUST_NO_CAST_TRUST end -- Limits set by ROV Key Items if num_trusts >= 3 and not caster:hasKeyItem(tpz.ki.RHAPSODY_IN_WHITE) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA + return tpz.msg.basic.TRUST_NO_CAST_TRUST elseif num_trusts >= 4 and not caster:hasKeyItem(tpz.ki.RHAPSODY_IN_CRIMSON) then - return tpz.msg.basic.CANT_BE_USED_IN_AREA + return tpz.msg.basic.TRUST_NO_CAST_TRUST end return 0 diff --git a/src/map/packets/message_basic.h b/src/map/packets/message_basic.h index 12d93338e57..cf6e60d1acf 100644 --- a/src/map/packets/message_basic.h +++ b/src/map/packets/message_basic.h @@ -123,6 +123,9 @@ enum MSGBASIC_ID : uint16 MSGBASIC_TREASURE_HUNTER_UP = 603, /* Additional effect: Treasure Hunter effectiveness against increases to .. */ /* DNC */ MSGBASIC_NO_FINISHINGMOVES = 524, + /* TRUST & ALTER EGO */ + MSGBASIC_TRUST_NO_CAST_TRUST = 700, // You are unable to use Trust magic at this time. + MSGBASIC_TRUST_NO_CALL_AE = 717, // You cannot call forth alter egos here. /* DEBUG MESSAGES */ MSGBASIC_DEBUG_RESISTED_SPELL = 66, /* Debug: Resisted spell! */ From aa9aebe422f142e2b0637388d1d15d11b28fe6a9 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 09:38:17 +0200 Subject: [PATCH 066/116] Fix compilation --- src/map/packets/message_standard.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/map/packets/message_standard.h b/src/map/packets/message_standard.h index 054370997dc..0feb194af88 100644 --- a/src/map/packets/message_standard.h +++ b/src/map/packets/message_standard.h @@ -78,17 +78,15 @@ enum class MsgStd CannotHere = 256, // You cannot use that command in this area. HeadgearShow = 260, HeadgearHide = 261, + TrustCannotJoinParty = 265, // You are unable to join a party whose leader currently has an alter ego present. + TrustCannotJoinAlliance = 266, // You are unable to join an alliance whose leader currently has an alter ego present. StyleLockOn = 267, // Style lock mode enabled. StyleLockOff = 268, // Style lock mode disabled. StyleLockIsOn = 269, // Style lock mode is enabled. StyleLockIsOff = 270, // Style lock mode is disabled. - TrustCannotJoinParty = 265, // You are unable to join a party whose leader currently has an alter ego present. - TrustCannotJoinAlliance = 266, // You are unable to join an alliance whose leader currently has an alter ego present. PollProposalLinkshell2 = 289, // Player Name's proposal to the linkshell group (cast vote with command: "/vote ?"): CurrentPollResultsLinkshell2 = 290, // Player Name's proposal - Current poll results: FinalPollResultsLinkshell2 = 291, // Player Name's proposal - Final poll results: - TrustCannotJoinParty = 265, // You are unable to join a party whose leader currently has an alter ego present. - TrustCannotJoinAlliance = 266, // You are unable to join an alliance whose leader currently has an alter ego present. TrustCannotLFP = 296, // You cannot use Trust magic while seeking a party. WaitParty = 297, // While inviting a party member, you must wait a while before using Trust magic. TrustLimit = 298, // You have called forth your maximum number of alter egos. From d9170d25cbd9ea2c71d8a5d50d4e4acb00a4682d Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 10:29:11 +0200 Subject: [PATCH 067/116] FIX TRUST CASTING CRASH? WHAT?! --- src/map/ai/states/magic_state.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/map/ai/states/magic_state.cpp b/src/map/ai/states/magic_state.cpp index 87297300757..9bc28f4e236 100644 --- a/src/map/ai/states/magic_state.cpp +++ b/src/map/ai/states/magic_state.cpp @@ -123,8 +123,11 @@ bool CMagicState::Update(time_point tick) PTarget->PAI->EventHandler.triggerListener("MAGIC_TAKE", PTarget, m_PEntity, m_PSpell.get(), &action); } - // TODO: If you cast directly on a trust, the client crashes! - if (!(PTarget->objtype == TYPE_TRUST)) + if (PTarget->objtype == TYPE_TRUST) + { + PTarget->loc.zone->PushPacket(PTarget, CHAR_INRANGE_SELF, new CActionPacket(action)); + } + else { m_PEntity->loc.zone->PushPacket(m_PEntity, CHAR_INRANGE_SELF, new CActionPacket(action)); } From 7558b15974dcfbf27fcb6d39698f7c5db6c924d7 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 10:40:20 +0200 Subject: [PATCH 068/116] Upgrade !hp command to also use cursor target --- scripts/commands/hp.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/commands/hp.lua b/scripts/commands/hp.lua index 9b37f4de665..e09791145c3 100644 --- a/scripts/commands/hp.lua +++ b/scripts/commands/hp.lua @@ -26,7 +26,10 @@ function onTrigger(player, hp, target) -- validate target local targ - if (target == nil) then + local cursor_target = player:getCursorTarget() + if cursor_target ~= nil then + targ = cursor_target + elseif target == nil then targ = player else targ = GetPlayerByName(target) From 56acbe2dae184af7ee30336fe7ecc5e361fb4147 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 11:11:30 +0200 Subject: [PATCH 069/116] Add binding: getPartyTrusts --- src/map/lua/lua_baseentity.cpp | 42 ++++++++++++++++++++++++++++++++++ src/map/lua/lua_baseentity.h | 1 + 2 files changed, 43 insertions(+) diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index 9bf13e20b80..8ef67704a4b 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -11942,6 +11942,46 @@ inline int32 CLuaBaseEntity::getTrustID(lua_State* L) return 1; } +/************************************************************************ +* Function: getPartyTrusts() +* Purpose : get a table of the trusts in a party (if any) +* Example : target:getPartyTrusts() +* Notes : +************************************************************************/ + +inline int32 CLuaBaseEntity::getPartyTrusts(lua_State* L) +{ + TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC); + + int size = 0; + ((CBattleEntity*)m_PBaseEntity)->ForParty([&size](CBattleEntity* member) + { + for (auto* PTrust : static_cast(member)->PTrusts) + { + size++; + } + }); + + lua_createtable(L, size, 0); + int i = 1; + ((CBattleEntity*)m_PBaseEntity)->ForParty([&L, &i](CBattleEntity* member) + { + for (auto* PTrust : static_cast(member)->PTrusts) + { + lua_getglobal(L, CLuaBaseEntity::className); + lua_pushstring(L, "new"); + lua_gettable(L, -2); + lua_insert(L, -2); + lua_pushlightuserdata(L, (void*)PTrust); + lua_pcall(L, 2, 1, 0); + + lua_rawseti(L, -2, i++); + } + }); + + return 1; +} + /************************************************************************ * Function: despawnPet() * Purpose : Despawns a Pet Entity @@ -14579,8 +14619,10 @@ Lunar::Register_t CLuaBaseEntity::methods[] = LUNAR_DECLARE_METHOD(CLuaBaseEntity,removeAllManeuvers), LUNAR_DECLARE_METHOD(CLuaBaseEntity,updateAttachments), + // Trust related LUNAR_DECLARE_METHOD(CLuaBaseEntity,spawnTrust), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getTrustID), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,getPartyTrusts), // Mob Entity-Specific LUNAR_DECLARE_METHOD(CLuaBaseEntity,setMobLevel), diff --git a/src/map/lua/lua_baseentity.h b/src/map/lua/lua_baseentity.h index 95743693e56..4898f474317 100644 --- a/src/map/lua/lua_baseentity.h +++ b/src/map/lua/lua_baseentity.h @@ -580,6 +580,7 @@ class CLuaBaseEntity int32 spawnTrust(lua_State*); // Spawns trust int32 getTrustID(lua_State*); + int32 getPartyTrusts(lua_State*); int32 isJugPet(lua_State*); // If the entity has a pet, test if it is a jug pet. int32 hasValidJugPetItem(lua_State*); From 6f4b9763e9afac314671899f5181f7704ec1f7f7 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 11:12:03 +0200 Subject: [PATCH 070/116] return getParty to only returning a table of Players --- src/map/lua/lua_baseentity.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index 8ef67704a4b..0a3b59a021f 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -8476,30 +8476,16 @@ inline int32 CLuaBaseEntity::getParty(lua_State* L) lua_createtable(L, size, 0); int i = 1; - - auto luaTableEntry = [&](void* entry) + ((CBattleEntity*)m_PBaseEntity)->ForParty([&L, &i](CBattleEntity* member) { lua_getglobal(L, CLuaBaseEntity::className); lua_pushstring(L, "new"); lua_gettable(L, -2); lua_insert(L, -2); - lua_pushlightuserdata(L, entry); + lua_pushlightuserdata(L, (void*)member); lua_pcall(L, 2, 1, 0); lua_rawseti(L, -2, i++); - }; - - ((CBattleEntity*)m_PBaseEntity)->ForParty([&L, &i, &luaTableEntry](CBattleEntity* member) - { - luaTableEntry(member); - - if (member->objtype == TYPE_PC) - { - for (auto PTrust : static_cast(member)->PTrusts) - { - luaTableEntry(PTrust); - } - } }); return 1; From 9e3f60055dee7b4ecd2c14b42c7c1a3276746178 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 11:12:24 +0200 Subject: [PATCH 071/116] Make getPartySize usable --- src/map/lua/lua_baseentity.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index 0a3b59a021f..4721eb37b68 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -8494,7 +8494,7 @@ inline int32 CLuaBaseEntity::getParty(lua_State* L) /************************************************************************ * Function: getPartySize() * Purpose : Returns the count of members in the party -* Example : local count = getPartySize() +* Example : local count = player:getPartySize() * Notes : ************************************************************************/ @@ -8503,9 +8503,7 @@ inline int32 CLuaBaseEntity::getPartySize(lua_State* L) TPZ_DEBUG_BREAK_IF(m_PBaseEntity == nullptr); TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype == TYPE_NPC); - TPZ_DEBUG_BREAK_IF(lua_isnil(L, 1) || !lua_isnumber(L, 1)); - - uint8 allianceparty = (uint8)lua_tonumber(L, 1); + uint8 allianceparty = lua_isnil(L, 1) ? 0 : (uint8)lua_tonumber(L, 1); uint8 partysize = 1; if (((CBattleEntity*)m_PBaseEntity)->PParty != nullptr) From 179569ed398baf54100ea4d92ae2d9901406145f Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 11:12:55 +0200 Subject: [PATCH 072/116] Hook up trust.canCast with the last few binding changes --- scripts/globals/trust.lua | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index 67505bdc2b3..64df1294fed 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -30,36 +30,33 @@ tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) end -- Check party for trusts - local num_pt = 0 + local num_pt = caster:getPartySize() local num_trusts = 0 - local party = caster:getParty() - for _, member in ipairs(party) do - if member:getObjType() == tpz.objType.TRUST then - -- Check for same trust - if member:getTrustID() == spell:getID() then + local party_trusts = caster:getPartyTrusts() + for _, trust in ipairs(party_trusts) do + -- Check for same trust + if trust:getTrustID() == spell:getID() then + return tpz.msg.basic.TRUST_NO_CAST_TRUST + -- Check not allowed trust combinations (Shantotto I vs Shantotto II) + elseif type(not_allowed_trust_ids) == "number" then + if trust:getTrustID() == not_allowed_trust_ids then return tpz.msg.basic.TRUST_NO_CAST_TRUST - -- Check not allowed trust combinations (Shantotto I vs Shantotto II) - elseif type(not_allowed_trust_ids) == "number" then - if member:getTrustID() == not_allowed_trust_ids then - return tpz.msg.basic.TRUST_NO_CAST_TRUST - end - elseif type(not_allowed_trust_ids) == "table" then - for _, v in pairs(not_allowed_trust_ids) do - if type(v) == "number" then - if member:getTrustID() == v then - return tpz.msg.basic.TRUST_NO_CAST_TRUST - end + end + elseif type(not_allowed_trust_ids) == "table" then + for _, v in pairs(not_allowed_trust_ids) do + if type(v) == "number" then + if trust:getTrustID() == v then + return tpz.msg.basic.TRUST_NO_CAST_TRUST end end - else - num_trusts = num_trusts + 1 end + else + num_trusts = num_trusts + 1 end - num_pt = num_pt + 1 end -- Max party size - if num_pt >= 6 then + if num_trusts + num_pt >= 6 then return tpz.msg.basic.TRUST_NO_CAST_TRUST end From a7ee7fccc973bfae4d1b812609c65f2a3efe3c72 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 11:45:29 +0200 Subject: [PATCH 073/116] Use trust packet name in party entry --- src/map/packets/party_member_update.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/map/packets/party_member_update.cpp b/src/map/packets/party_member_update.cpp index c80b271e611..8a56d634ea9 100644 --- a/src/map/packets/party_member_update.cpp +++ b/src/map/packets/party_member_update.cpp @@ -90,7 +90,7 @@ CPartyMemberUpdatePacket::CPartyMemberUpdatePacket(CTrustEntity* PTrust, uint8 M ref(0x24) = PTrust->GetSJob(); ref(0x25) = PTrust->GetSLevel(); - memcpy(data + (0x26), PTrust->GetName(), PTrust->name.size()); + memcpy(data + (0x26), PTrust->packetName.c_str(), PTrust->packetName.size()); } CPartyMemberUpdatePacket::CPartyMemberUpdatePacket(uint32 id, const int8* name, uint16 memberFlags, uint8 MemberNumber, uint16 ZoneID) From 0cb99ba115e9167878433d31a6c7fa10357dbad2 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 13:10:56 +0200 Subject: [PATCH 074/116] Basic spellcasting from lists and stability --- src/map/ai/controllers/trust_controller.cpp | 28 ++++++++++----------- src/map/ai/states/magic_state.cpp | 2 +- src/map/utils/trustutils.cpp | 5 ++++ 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index 2680f1540c9..3c070c29e09 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -57,7 +57,13 @@ void CTrustController::Tick(time_point tick) { m_Tick = tick; - if (POwner->PAI->IsEngaged()) + if (POwner->PMaster == nullptr || (POwner->PMaster->isDead() && POwner->isAlive())) + { + POwner->Die(); + return; + } + + if (POwner->PMaster->PAI->IsEngaged()) { DoCombatTick(tick); } @@ -69,13 +75,9 @@ void CTrustController::Tick(time_point tick) void CTrustController::DoCombatTick(time_point tick) { - if (POwner->PMaster == nullptr || (POwner->PMaster->isDead() && POwner->isAlive())) - { - POwner->Die(); - return; - } + float currentDistance = distance(POwner->loc.p, POwner->PMaster->loc.p); + PTarget = POwner->PMaster->GetBattleTarget(); - auto PTarget = POwner->GetBattleTarget(); if (PTarget) { if (POwner->PAI->CanFollowPath()) @@ -92,18 +94,16 @@ void CTrustController::DoCombatTick(time_point tick) } } POwner->PAI->EventHandler.triggerListener("COMBAT_TICK", POwner, POwner->PMaster, PTarget); + + if (IsSpellReady(currentDistance) && TryCastSpell()) + { + return; + } } } void CTrustController::DoRoamTick(time_point tick) { - if ((POwner->PMaster == nullptr || POwner->PMaster->isMounted() || - POwner->PMaster->isDead()) && POwner->isAlive()) - { - POwner->Die(); - return; - } - float currentDistance = distance(POwner->loc.p, POwner->PMaster->loc.p); if (currentDistance > RoamDistance) diff --git a/src/map/ai/states/magic_state.cpp b/src/map/ai/states/magic_state.cpp index 9bc28f4e236..fb8f6cfae7e 100644 --- a/src/map/ai/states/magic_state.cpp +++ b/src/map/ai/states/magic_state.cpp @@ -123,7 +123,7 @@ bool CMagicState::Update(time_point tick) PTarget->PAI->EventHandler.triggerListener("MAGIC_TAKE", PTarget, m_PEntity, m_PSpell.get(), &action); } - if (PTarget->objtype == TYPE_TRUST) + if (PTarget && PTarget->objtype == TYPE_TRUST) { PTarget->loc.zone->PushPacket(PTarget, CHAR_INRANGE_SELF, new CActionPacket(action)); } diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index 5696f1eb7d7..895a2d71094 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -31,6 +31,7 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "../grades.h" #include "../map.h" #include "trustutils.h" +#include "mobutils.h" #include "zoneutils.h" #include "../entities/mobentity.h" #include "../entities/trustentity.h" @@ -480,12 +481,14 @@ namespace trustutils PTrust->loc.p = nearPosition(PMaster->loc.p, CTrustController::SpawnDistance, (float)M_PI); PTrust->look = trustData->look; PTrust->name = trustData->name; + PTrust->packetName = trustData->packet_name; PTrust->m_name_prefix = trustData->name_prefix; PTrust->m_Family = trustData->m_Family; PTrust->m_MobSkillList = trustData->m_MobSkillList; PTrust->SetMJob(trustData->mJob); PTrust->SetSJob(trustData->sJob); // TODO: This may not be true for some trusts + PTrust->m_HasSpellScript = trustData->hasSpellScript; PTrust->m_TrustID = trustData->trustID; PTrust->status = STATUS_NORMAL; PTrust->m_ModelSize = trustData->size; @@ -510,6 +513,8 @@ namespace trustutils PTrust->health.hp = PTrust->GetMaxHP(); PTrust->health.mp = PTrust->GetMaxMP(); + mobutils::SetSpellList(PTrust, trustData->spellList); + // TODO: Load stats from script return PTrust; } From fd5f02386f557d2ccc05139e5552b2541c8313d8 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 13:14:56 +0200 Subject: [PATCH 075/116] Let Kupipi and Ajido Marujido cast spells from their lists --- sql/mob_pools.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index c391a186ec7..ab162e622f2 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5956,13 +5956,13 @@ INSERT INTO `mob_pools` VALUES (5895,'Donggu','Donggu',116,0x0000780100000000000 -- Trusts INSERT INTO `mob_pools` VALUES (5896,'shantotto','Shantotto',153,0x0000B80B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); INSERT INTO `mob_pools` VALUES (5897,'naji','Naji',149,0x0000B90B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5898,'kupipi','Kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,1,312,1,0,0); +INSERT INTO `mob_pools` VALUES (5898,'kupipi','Kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,0,312,1,0,0); INSERT INTO `mob_pools` VALUES (5899,'excenmille','Excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,309,1,0,0); INSERT INTO `mob_pools` VALUES (5900,'ayame','Ayame',149,0x0000BC0B00000000000000000000000000000000,12,0,10,440,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5901,'nanaa_mihgo','NanaaMihgo',152,0x0000BD0B00000000000000000000000000000000,6,0,2,190,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5902,'curilla','Curilla',145,0x0000BE0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,308,1,0,0); INSERT INTO `mob_pools` VALUES (5903,'volker','Volker',149,0x0000BF0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,8,1,0,0); -INSERT INTO `mob_pools` VALUES (5904,'ajido-marujido','Ajido-Marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,1,311,1,0,0); +INSERT INTO `mob_pools` VALUES (5904,'ajido-marujido','Ajido-Marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,0,311,1,0,0); INSERT INTO `mob_pools` VALUES (5905,'trion','Trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,310,1,0,0); INSERT INTO `mob_pools` VALUES (5906,'zeid','Zeid',145,0x0000C20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5907,'lion','Lion',145,0x0000C30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); From 67ebbe1b5902e76a75662e141907279ee48d8194 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 13:19:25 +0200 Subject: [PATCH 076/116] Remove Shantotto chat for now --- scripts/globals/spells/trust/shantotto.lua | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index 31838bcd2b8..05da38650d4 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -11,15 +11,3 @@ end function onSpellCast(caster, target, spell) return tpz.trust.spawn(caster, spell) end - -function onMobSpawn(mob) - print("Hello") -end - -function onMobDespawn(mob) - print("Goodbye For Now") -end - -function onMobDeath(mob) - print("Goodbye Forever!") -end \ No newline at end of file From 09c7691bd0f9e60983030a5230b950609086c776 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 13:25:15 +0200 Subject: [PATCH 077/116] Formatting + branding --- src/map/utils/trustutils.cpp | 689 +++++++++++++++++------------------ src/map/utils/trustutils.h | 8 +- 2 files changed, 343 insertions(+), 354 deletions(-) diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index 895a2d71094..5bebb1bf70a 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -1,23 +1,4 @@ -/* -=========================================================================== - -Copyright (c) 2010-2015 Darkstar Dev Teams - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see http://www.gnu.org/licenses/ - -=========================================================================== -*/ +#include "trustutils.h" #include "../../common/timer.h" #include "../../common/utils.h" @@ -28,64 +9,63 @@ along with this program. If not, see http://www.gnu.org/licenses/ #include "battleutils.h" #include "charutils.h" -#include "../grades.h" -#include "../map.h" -#include "trustutils.h" #include "mobutils.h" #include "zoneutils.h" + +#include "../grades.h" +#include "../map.h" + #include "../entities/mobentity.h" #include "../entities/trustentity.h" #include "../status_effect_container.h" #include "../zone_instance.h" - #include "../ai/ai_container.h" - +#include "../ai/controllers/trust_controller.h" #include "../packets/char_sync.h" #include "../packets/entity_update.h" #include "../packets/message_standard.h" #include "../packets/trust_sync.h" -#include "../ai/controllers/trust_controller.h" struct TrustSpell_ID { uint32 spellID; }; -std::vector g_PTrustIDList; +std::vector g_PTrustIDList; struct Trust_t { - uint32 trustID; - look_t look; // appearance data - string_t name; // script name string - string_t packet_name; // packet name string - ECOSYSTEM EcoSystem; // ecosystem - - uint8 name_prefix; - uint8 size; // размер модели - uint16 m_Family; - - uint8 mJob; - uint8 sJob; - float HPscale; // HP boost percentage - float MPscale; // MP boost percentage - - uint16 cmbDelay; - uint8 speed; + uint32 trustID; + look_t look; // appearance data + string_t name; // script name string + string_t packet_name; // packet name string + ECOSYSTEM EcoSystem; // ecosystem + + uint8 name_prefix; + uint8 size; // размер модели + uint16 m_Family; + + uint8 mJob; + uint8 sJob; + float HPscale; // HP boost percentage + float MPscale; // MP boost percentage + + uint16 cmbDelay; + uint8 speed; // stat ranks - uint8 strRank; - uint8 dexRank; - uint8 vitRank; - uint8 agiRank; - uint8 intRank; - uint8 mndRank; - uint8 chrRank; - uint8 attRank; - uint8 defRank; - uint8 evaRank; - uint8 accRank; - - uint16 m_MobSkillList; + uint8 strRank; + uint8 dexRank; + uint8 vitRank; + uint8 agiRank; + uint8 intRank; + uint8 mndRank; + uint8 chrRank; + uint8 attRank; + uint8 defRank; + uint8 evaRank; + uint8 accRank; + + uint16 m_MobSkillList; // magic stuff bool hasSpellScript; @@ -116,42 +96,42 @@ struct Trust_t int16 darkres; }; -std::vector g_PTrustList; +std::vector g_PTrustList; namespace trustutils { - void LoadTrustList() - { - FreeTrustList(); +void LoadTrustList() +{ + FreeTrustList(); - const char* Query = - "SELECT \ + const char *Query = + "SELECT \ spell_list.spellid, mob_pools.poolid \ FROM spell_list, mob_pools \ WHERE spell_list.spellid >= 896 AND mob_pools.poolid = (spell_list.spellid+5000) ORDER BY spell_list.spellid"; - if (Sql_Query(SqlHandle, Query) != SQL_ERROR && Sql_NumRows(SqlHandle) != 0) + if (Sql_Query(SqlHandle, Query) != SQL_ERROR && Sql_NumRows(SqlHandle) != 0) + { + while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) { - while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) - { - TrustSpell_ID* trustID = new TrustSpell_ID(); - - trustID->spellID = (uint32)Sql_GetIntData(SqlHandle, 0); + TrustSpell_ID *trustID = new TrustSpell_ID(); - g_PTrustIDList.push_back(trustID); - } - } + trustID->spellID = (uint32)Sql_GetIntData(SqlHandle, 0); - for (uint32 index = 0; index < g_PTrustIDList.size(); index++) - { - BuildTrust(g_PTrustIDList.at(index)->spellID); + g_PTrustIDList.push_back(trustID); } } - void BuildTrust(uint32 TrustID) + for (uint32 index = 0; index < g_PTrustIDList.size(); index++) { - const char* Query = - "SELECT \ + BuildTrust(g_PTrustIDList.at(index)->spellID); + } +} + +void BuildTrust(uint32 TrustID) +{ + const char *Query = + "SELECT \ mob_pools.name,\ mob_pools.packet_name,\ mob_pools.modelid,\ @@ -186,336 +166,345 @@ namespace trustutils FROM spell_list, mob_pools, mob_family_system WHERE spell_list.spellid = %u \ AND (spell_list.spellid+5000) = mob_pools.poolid AND mob_pools.familyid = mob_family_system.familyid ORDER BY spell_list.spellid"; - uint32 ret = Sql_Query(SqlHandle, Query, TrustID); + uint32 ret = Sql_Query(SqlHandle, Query, TrustID); - if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) != 0) + if (ret != SQL_ERROR && Sql_NumRows(SqlHandle) != 0) + { + while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) { - while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) - { - Trust_t* trust = new Trust_t(); - - trust->trustID = TrustID; - trust->name.insert(0, (const char*)Sql_GetData(SqlHandle, 0)); - trust->packet_name.insert(0, (const char*)Sql_GetData(SqlHandle, 1)); - memcpy(&trust->look, Sql_GetData(SqlHandle, 2), 20); - trust->m_Family = (uint16)Sql_GetIntData(SqlHandle, 3); - trust->mJob = (uint8)Sql_GetIntData(SqlHandle, 4); - trust->sJob = (uint8)Sql_GetIntData(SqlHandle, 5); - trust->hasSpellScript = (bool)Sql_GetIntData(SqlHandle, 6); - trust->spellList = (uint16)Sql_GetIntData(SqlHandle, 7); - trust->cmbDelay = (uint16)Sql_GetIntData(SqlHandle, 8); - trust->name_prefix = (uint8)Sql_GetUIntData(SqlHandle, 9); - // Behaviour - trust->m_MobSkillList = (uint16)Sql_GetUIntData(SqlHandle, 11); - // SpellID - trust->size = Sql_GetUIntData(SqlHandle, 13); - trust->EcoSystem = (ECOSYSTEM)Sql_GetIntData(SqlHandle, 14); - trust->HPscale = Sql_GetFloatData(SqlHandle, 15); - trust->MPscale = Sql_GetFloatData(SqlHandle, 16); - trust->speed = (uint8)Sql_GetIntData(SqlHandle, 17); - trust->strRank = (uint8)Sql_GetIntData(SqlHandle, 18); - trust->dexRank = (uint8)Sql_GetIntData(SqlHandle, 19); - trust->vitRank = (uint8)Sql_GetIntData(SqlHandle, 20); - trust->agiRank = (uint8)Sql_GetIntData(SqlHandle, 21); - trust->intRank = (uint8)Sql_GetIntData(SqlHandle, 22); - trust->mndRank = (uint8)Sql_GetIntData(SqlHandle, 23); - trust->chrRank = (uint8)Sql_GetIntData(SqlHandle, 24); - trust->defRank = (uint8)Sql_GetIntData(SqlHandle, 25); - trust->attRank = (uint8)Sql_GetIntData(SqlHandle, 26); - trust->accRank = (uint8)Sql_GetIntData(SqlHandle, 27); - trust->evaRank = (uint8)Sql_GetIntData(SqlHandle, 28); - - // resistances - trust->slashres = (uint16)(Sql_GetFloatData(SqlHandle, 29) * 1000); - trust->pierceres = (uint16)(Sql_GetFloatData(SqlHandle, 30) * 1000); - trust->hthres = (uint16)(Sql_GetFloatData(SqlHandle, 31) * 1000); - trust->impactres = (uint16)(Sql_GetFloatData(SqlHandle, 32) * 1000); - - trust->firedef = 0; - trust->icedef = 0; - trust->winddef = 0; - trust->earthdef = 0; - trust->thunderdef = 0; - trust->waterdef = 0; - trust->lightdef = 0; - trust->darkdef = 0; - - trust->fireres = (uint16)((Sql_GetFloatData(SqlHandle, 33) - 1) * -100); - trust->iceres = (uint16)((Sql_GetFloatData(SqlHandle, 34) - 1) * -100); - trust->windres = (uint16)((Sql_GetFloatData(SqlHandle, 35) - 1) * -100); - trust->earthres = (uint16)((Sql_GetFloatData(SqlHandle, 36) - 1) * -100); - trust->thunderres = (uint16)((Sql_GetFloatData(SqlHandle, 37) - 1) * -100); - trust->waterres = (uint16)((Sql_GetFloatData(SqlHandle, 38) - 1) * -100); - trust->lightres = (uint16)((Sql_GetFloatData(SqlHandle, 39) - 1) * -100); - trust->darkres = (uint16)((Sql_GetFloatData(SqlHandle, 40) - 1) * -100); - - g_PTrustList.push_back(trust); - } + Trust_t *trust = new Trust_t(); + + trust->trustID = TrustID; + trust->name.insert(0, (const char *)Sql_GetData(SqlHandle, 0)); + trust->packet_name.insert(0, (const char *)Sql_GetData(SqlHandle, 1)); + memcpy(&trust->look, Sql_GetData(SqlHandle, 2), 20); + trust->m_Family = (uint16)Sql_GetIntData(SqlHandle, 3); + trust->mJob = (uint8)Sql_GetIntData(SqlHandle, 4); + trust->sJob = (uint8)Sql_GetIntData(SqlHandle, 5); + trust->hasSpellScript = (bool)Sql_GetIntData(SqlHandle, 6); + trust->spellList = (uint16)Sql_GetIntData(SqlHandle, 7); + trust->cmbDelay = (uint16)Sql_GetIntData(SqlHandle, 8); + trust->name_prefix = (uint8)Sql_GetUIntData(SqlHandle, 9); + // Behaviour + trust->m_MobSkillList = (uint16)Sql_GetUIntData(SqlHandle, 11); + // SpellID + trust->size = Sql_GetUIntData(SqlHandle, 13); + trust->EcoSystem = (ECOSYSTEM)Sql_GetIntData(SqlHandle, 14); + trust->HPscale = Sql_GetFloatData(SqlHandle, 15); + trust->MPscale = Sql_GetFloatData(SqlHandle, 16); + trust->speed = (uint8)Sql_GetIntData(SqlHandle, 17); + trust->strRank = (uint8)Sql_GetIntData(SqlHandle, 18); + trust->dexRank = (uint8)Sql_GetIntData(SqlHandle, 19); + trust->vitRank = (uint8)Sql_GetIntData(SqlHandle, 20); + trust->agiRank = (uint8)Sql_GetIntData(SqlHandle, 21); + trust->intRank = (uint8)Sql_GetIntData(SqlHandle, 22); + trust->mndRank = (uint8)Sql_GetIntData(SqlHandle, 23); + trust->chrRank = (uint8)Sql_GetIntData(SqlHandle, 24); + trust->defRank = (uint8)Sql_GetIntData(SqlHandle, 25); + trust->attRank = (uint8)Sql_GetIntData(SqlHandle, 26); + trust->accRank = (uint8)Sql_GetIntData(SqlHandle, 27); + trust->evaRank = (uint8)Sql_GetIntData(SqlHandle, 28); + + // resistances + trust->slashres = (uint16)(Sql_GetFloatData(SqlHandle, 29) * 1000); + trust->pierceres = (uint16)(Sql_GetFloatData(SqlHandle, 30) * 1000); + trust->hthres = (uint16)(Sql_GetFloatData(SqlHandle, 31) * 1000); + trust->impactres = (uint16)(Sql_GetFloatData(SqlHandle, 32) * 1000); + + trust->firedef = 0; + trust->icedef = 0; + trust->winddef = 0; + trust->earthdef = 0; + trust->thunderdef = 0; + trust->waterdef = 0; + trust->lightdef = 0; + trust->darkdef = 0; + + trust->fireres = (uint16)((Sql_GetFloatData(SqlHandle, 33) - 1) * -100); + trust->iceres = (uint16)((Sql_GetFloatData(SqlHandle, 34) - 1) * -100); + trust->windres = (uint16)((Sql_GetFloatData(SqlHandle, 35) - 1) * -100); + trust->earthres = (uint16)((Sql_GetFloatData(SqlHandle, 36) - 1) * -100); + trust->thunderres = (uint16)((Sql_GetFloatData(SqlHandle, 37) - 1) * -100); + trust->waterres = (uint16)((Sql_GetFloatData(SqlHandle, 38) - 1) * -100); + trust->lightres = (uint16)((Sql_GetFloatData(SqlHandle, 39) - 1) * -100); + trust->darkres = (uint16)((Sql_GetFloatData(SqlHandle, 40) - 1) * -100); + + g_PTrustList.push_back(trust); } } +} - void FreeTrustList() - { - g_PTrustIDList.clear(); - } - - void LoadTrustStats(CTrustEntity* PTrust) - { - // Cargo cult of PC calculations. +void FreeTrustList() +{ + g_PTrustIDList.clear(); +} - float raceStat = 0; // конечное число HP для уровня на основе расы. - float jobStat = 0; // конечное число HP для уровня на основе первичной профессии. - float sJobStat = 0; // коенчное число HP для уровня на основе вторичной профессии. - int32 bonusStat = 0; // бонусное число HP которое добавляется при соблюдении некоторых условий. +void LoadTrustStats(CTrustEntity *PTrust) +{ + // Cargo cult of PC calculations. - int32 baseValueColumn = 0; // номер колонки с базовым количеством HP - int32 scaleTo60Column = 1; // номер колонки с модификатором до 60 уровня - int32 scaleOver30Column = 2; // номер колонки с модификатором после 30 уровня - int32 scaleOver60Column = 3; // номер колонки с модификатором после 60 уровня - int32 scaleOver75Column = 4; // номер колонки с модификатором после 75 уровня - int32 scaleOver60 = 2; // номер колонки с модификатором для расчета MP после 60 уровня - int32 scaleOver75 = 3; // номер колонки с модификатором для расчета Статов после 75-го уровня + float raceStat = 0; // конечное число HP для уровня на основе расы. + float jobStat = 0; // конечное число HP для уровня на основе первичной профессии. + float sJobStat = 0; // коенчное число HP для уровня на основе вторичной профессии. + int32 bonusStat = 0; // бонусное число HP которое добавляется при соблюдении некоторых условий. - uint8 grade; + int32 baseValueColumn = 0; // номер колонки с базовым количеством HP + int32 scaleTo60Column = 1; // номер колонки с модификатором до 60 уровня + int32 scaleOver30Column = 2; // номер колонки с модификатором после 30 уровня + int32 scaleOver60Column = 3; // номер колонки с модификатором после 60 уровня + int32 scaleOver75Column = 4; // номер колонки с модификатором после 75 уровня + int32 scaleOver60 = 2; // номер колонки с модификатором для расчета MP после 60 уровня + int32 scaleOver75 = 3; // номер колонки с модификатором для расчета Статов после 75-го уровня - uint8 mlvl = PTrust->GetMLevel(); - uint8 slvl = PTrust->GetSLevel(); - JOBTYPE mjob = PTrust->GetMJob(); - JOBTYPE sjob = PTrust->GetSJob(); + uint8 grade; - uint8 race = 0; //Human + uint8 mlvl = PTrust->GetMLevel(); + uint8 slvl = PTrust->GetSLevel(); + JOBTYPE mjob = PTrust->GetMJob(); + JOBTYPE sjob = PTrust->GetSJob(); - switch (PTrust->look.race) - { - case 3: - case 4: race = 1; break; //Elvaan - case 5: - case 6: race = 2; break; //Tarutaru - case 7: race = 3; break; //Mithra - case 8: race = 4; break; //Galka - } + uint8 race = 0; //Human - // Расчет прироста HP от main job + switch (PTrust->look.race) + { + case 3: + case 4: + race = 1; + break; //Elvaan + case 5: + case 6: + race = 2; + break; //Tarutaru + case 7: + race = 3; + break; //Mithra + case 8: + race = 4; + break; //Galka + } - int32 mainLevelOver30 = std::clamp(mlvl - 30, 0, 30); // Расчет условия +1HP каждый лвл после 30 уровня - int32 mainLevelUpTo60 = (mlvl < 60 ? mlvl - 1 : 59); // Первый режим рассчета до 60 уровня (Используется так же и для MP) - int32 mainLevelOver60To75 = std::clamp(mlvl - 60, 0, 15); // Второй режим расчета после 60 уровня - int32 mainLevelOver75 = (mlvl < 75 ? 0 : mlvl - 75); // Третий режим расчета после 75 уровня + // Расчет прироста HP от main job - //Расчет бонусного количества HP + int32 mainLevelOver30 = std::clamp(mlvl - 30, 0, 30); // Расчет условия +1HP каждый лвл после 30 уровня + int32 mainLevelUpTo60 = (mlvl < 60 ? mlvl - 1 : 59); // Первый режим рассчета до 60 уровня (Используется так же и для MP) + int32 mainLevelOver60To75 = std::clamp(mlvl - 60, 0, 15); // Второй режим расчета после 60 уровня + int32 mainLevelOver75 = (mlvl < 75 ? 0 : mlvl - 75); // Третий режим расчета после 75 уровня - int32 mainLevelOver10 = (mlvl < 10 ? 0 : mlvl - 10); // +2HP на каждом уровне после 10 - int32 mainLevelOver50andUnder60 = std::clamp(mlvl - 50, 0, 10); // +2HP на каждом уровне в промежутке от 50 до 60 уровня - int32 mainLevelOver60 = (mlvl < 60 ? 0 : mlvl - 60); + //Расчет бонусного количества HP - // Расчет прироста HP от дополнительной профессии + int32 mainLevelOver10 = (mlvl < 10 ? 0 : mlvl - 10); // +2HP на каждом уровне после 10 + int32 mainLevelOver50andUnder60 = std::clamp(mlvl - 50, 0, 10); // +2HP на каждом уровне в промежутке от 50 до 60 уровня + int32 mainLevelOver60 = (mlvl < 60 ? 0 : mlvl - 60); - int32 subLevelOver10 = std::clamp(slvl - 10, 0, 20); // +1HP на каждый уровень после 10 (/2) - int32 subLevelOver30 = (slvl < 30 ? 0 : slvl - 30); // +1HP на каждый уровень после 30 + // Расчет прироста HP от дополнительной профессии - // Расчет raceStat jobStat bonusStat sJobStat - // Расчет по расе + int32 subLevelOver10 = std::clamp(slvl - 10, 0, 20); // +1HP на каждый уровень после 10 (/2) + int32 subLevelOver30 = (slvl < 30 ? 0 : slvl - 30); // +1HP на каждый уровень после 30 - grade = grade::GetRaceGrades(race, 0); + // Расчет raceStat jobStat bonusStat sJobStat + // Расчет по расе - raceStat = grade::GetHPScale(grade, baseValueColumn) + - (grade::GetHPScale(grade, scaleTo60Column) * mainLevelUpTo60) + - (grade::GetHPScale(grade, scaleOver30Column) * mainLevelOver30) + - (grade::GetHPScale(grade, scaleOver60Column) * mainLevelOver60To75) + - (grade::GetHPScale(grade, scaleOver75Column) * mainLevelOver75); + grade = grade::GetRaceGrades(race, 0); - // raceStat = (int32)(statScale[grade][baseValueColumn] + statScale[grade][scaleTo60Column] * (mlvl - 1)); + raceStat = grade::GetHPScale(grade, baseValueColumn) + + (grade::GetHPScale(grade, scaleTo60Column) * mainLevelUpTo60) + + (grade::GetHPScale(grade, scaleOver30Column) * mainLevelOver30) + + (grade::GetHPScale(grade, scaleOver60Column) * mainLevelOver60To75) + + (grade::GetHPScale(grade, scaleOver75Column) * mainLevelOver75); - // Расчет по main job - grade = grade::GetJobGrade(mjob, 0); + // raceStat = (int32)(statScale[grade][baseValueColumn] + statScale[grade][scaleTo60Column] * (mlvl - 1)); - jobStat = grade::GetHPScale(grade, baseValueColumn) + - (grade::GetHPScale(grade, scaleTo60Column) * mainLevelUpTo60) + - (grade::GetHPScale(grade, scaleOver30Column) * mainLevelOver30) + - (grade::GetHPScale(grade, scaleOver60Column) * mainLevelOver60To75) + - (grade::GetHPScale(grade, scaleOver75Column) * mainLevelOver75); + // Расчет по main job + grade = grade::GetJobGrade(mjob, 0); - // Расчет бонусных HP - bonusStat = (mainLevelOver10 + mainLevelOver50andUnder60) * 2; + jobStat = grade::GetHPScale(grade, baseValueColumn) + + (grade::GetHPScale(grade, scaleTo60Column) * mainLevelUpTo60) + + (grade::GetHPScale(grade, scaleOver30Column) * mainLevelOver30) + + (grade::GetHPScale(grade, scaleOver60Column) * mainLevelOver60To75) + + (grade::GetHPScale(grade, scaleOver75Column) * mainLevelOver75); - // Расчет по support job - if (slvl > 0) - { - grade = grade::GetJobGrade(sjob, 0); + // Расчет бонусных HP + bonusStat = (mainLevelOver10 + mainLevelOver50andUnder60) * 2; - sJobStat = grade::GetHPScale(grade, baseValueColumn) + - (grade::GetHPScale(grade, scaleTo60Column) * (slvl - 1)) + - (grade::GetHPScale(grade, scaleOver30Column) * subLevelOver30) + - subLevelOver30 + subLevelOver10; - sJobStat = sJobStat / 2; - } + // Расчет по support job + if (slvl > 0) + { + grade = grade::GetJobGrade(sjob, 0); + sJobStat = grade::GetHPScale(grade, baseValueColumn) + + (grade::GetHPScale(grade, scaleTo60Column) * (slvl - 1)) + + (grade::GetHPScale(grade, scaleOver30Column) * subLevelOver30) + + subLevelOver30 + subLevelOver10; + sJobStat = sJobStat / 2; + } - PTrust->health.maxhp = (int16)(map_config.player_hp_multiplier * (raceStat + jobStat + bonusStat + sJobStat)); + PTrust->health.maxhp = (int16)(map_config.player_hp_multiplier * (raceStat + jobStat + bonusStat + sJobStat)); - //Начало расчера MP + //Начало расчера MP - raceStat = 0; - jobStat = 0; - sJobStat = 0; + raceStat = 0; + jobStat = 0; + sJobStat = 0; - // Расчет MP расе. - grade = grade::GetRaceGrades(race, 1); + // Расчет MP расе. + grade = grade::GetRaceGrades(race, 1); - //Если у main job нет МП рейтинга, расчитиваем расовый бонус на основе уровня subjob уровня(при условии, что у него есть МП рейтинг) - if (grade::GetJobGrade(mjob, 1) == 0) + //Если у main job нет МП рейтинга, расчитиваем расовый бонус на основе уровня subjob уровня(при условии, что у него есть МП рейтинг) + if (grade::GetJobGrade(mjob, 1) == 0) + { + if (grade::GetJobGrade(sjob, 1) != 0 && slvl > 0) // В этом выражении ошибка { - if (grade::GetJobGrade(sjob, 1) != 0 && slvl > 0) // В этом выражении ошибка - { - raceStat = (grade::GetMPScale(grade, 0) + grade::GetMPScale(grade, scaleTo60Column) * (slvl - 1)) / map_config.sj_mp_divisor; // Вот здесь ошибка - } - } - else { - //Расчет нормального расового бонуса - raceStat = grade::GetMPScale(grade, 0) + - grade::GetMPScale(grade, scaleTo60Column) * mainLevelUpTo60 + - grade::GetMPScale(grade, scaleOver60) * mainLevelOver60; + raceStat = (grade::GetMPScale(grade, 0) + grade::GetMPScale(grade, scaleTo60Column) * (slvl - 1)) / map_config.sj_mp_divisor; // Вот здесь ошибка } + } + else + { + //Расчет нормального расового бонуса + raceStat = grade::GetMPScale(grade, 0) + + grade::GetMPScale(grade, scaleTo60Column) * mainLevelUpTo60 + + grade::GetMPScale(grade, scaleOver60) * mainLevelOver60; + } - //Для главной профессии - grade = grade::GetJobGrade(mjob, 1); - if (grade > 0) - { - jobStat = grade::GetMPScale(grade, 0) + - grade::GetMPScale(grade, scaleTo60Column) * mainLevelUpTo60 + - grade::GetMPScale(grade, scaleOver60) * mainLevelOver60; - } + //Для главной профессии + grade = grade::GetJobGrade(mjob, 1); + if (grade > 0) + { + jobStat = grade::GetMPScale(grade, 0) + + grade::GetMPScale(grade, scaleTo60Column) * mainLevelUpTo60 + + grade::GetMPScale(grade, scaleOver60) * mainLevelOver60; + } - //Для дополнительной профессии - if (slvl > 0) - { - grade = grade::GetJobGrade(sjob, 1); - sJobStat = (grade::GetMPScale(grade, 0) + grade::GetMPScale(grade, scaleTo60Column) * (slvl - 1)) / map_config.sj_mp_divisor; - } + //Для дополнительной профессии + if (slvl > 0) + { + grade = grade::GetJobGrade(sjob, 1); + sJobStat = (grade::GetMPScale(grade, 0) + grade::GetMPScale(grade, scaleTo60Column) * (slvl - 1)) / map_config.sj_mp_divisor; + } - PTrust->health.maxmp = (int16)(map_config.player_mp_multiplier * (raceStat + jobStat + sJobStat)); // результат расчета MP + PTrust->health.maxmp = (int16)(map_config.player_mp_multiplier * (raceStat + jobStat + sJobStat)); // результат расчета MP - uint8 counter = 0; + uint8 counter = 0; - for (uint8 StatIndex = 2; StatIndex <= 8; ++StatIndex) + for (uint8 StatIndex = 2; StatIndex <= 8; ++StatIndex) + { + // расчет по расе + grade = grade::GetRaceGrades(race, StatIndex); + raceStat = grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * mainLevelUpTo60; + + if (mainLevelOver60 > 0) { - // расчет по расе - grade = grade::GetRaceGrades(race, StatIndex); - raceStat = grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * mainLevelUpTo60; + raceStat += grade::GetStatScale(grade, scaleOver60) * mainLevelOver60; - if (mainLevelOver60 > 0) + if (mainLevelOver75 > 0) { - raceStat += grade::GetStatScale(grade, scaleOver60) * mainLevelOver60; - - if (mainLevelOver75 > 0) - { - raceStat += grade::GetStatScale(grade, scaleOver75) * mainLevelOver75 - (mlvl >= 75 ? 0.01f : 0); - } + raceStat += grade::GetStatScale(grade, scaleOver75) * mainLevelOver75 - (mlvl >= 75 ? 0.01f : 0); } + } - // расчет по профессии - grade = grade::GetJobGrade(mjob, StatIndex); - jobStat = grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * mainLevelUpTo60; - - if (mainLevelOver60 > 0) - { - jobStat += grade::GetStatScale(grade, scaleOver60) * mainLevelOver60; + // расчет по профессии + grade = grade::GetJobGrade(mjob, StatIndex); + jobStat = grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * mainLevelUpTo60; - if (mainLevelOver75 > 0) - { - jobStat += grade::GetStatScale(grade, scaleOver75) * mainLevelOver75 - (mlvl >= 75 ? 0.01f : 0); - } - } + if (mainLevelOver60 > 0) + { + jobStat += grade::GetStatScale(grade, scaleOver60) * mainLevelOver60; - // расчет по дополнительной профессии - if (slvl > 0) + if (mainLevelOver75 > 0) { - grade = grade::GetJobGrade(sjob, StatIndex); - sJobStat = (grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * (slvl - 1)) / 2; - } - else { - sJobStat = 0; + jobStat += grade::GetStatScale(grade, scaleOver75) * mainLevelOver75 - (mlvl >= 75 ? 0.01f : 0); } - - // Вывод значения - ref(&PTrust->stats, counter) = (uint16)((raceStat + jobStat + sJobStat)); - counter += 2; } - } - void SpawnTrust(CCharEntity* PMaster, uint32 TrustID) - { - if (PMaster->PParty == nullptr) + // расчет по дополнительной профессии + if (slvl > 0) { - PMaster->PParty = new CParty(PMaster); + grade = grade::GetJobGrade(sjob, StatIndex); + sJobStat = (grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * (slvl - 1)) / 2; + } + else + { + sJobStat = 0; } - CTrustEntity* PTrust = LoadTrust(PMaster, TrustID); - PMaster->PTrusts.insert(PMaster->PTrusts.end(), PTrust); - PMaster->StatusEffectContainer->CopyConfrontationEffect(PTrust); - PMaster->loc.zone->InsertTRUST(PTrust); - PTrust->Spawn(); - - PMaster->PParty->ReloadParty(); + // Вывод значения + ref(&PTrust->stats, counter) = (uint16)((raceStat + jobStat + sJobStat)); + counter += 2; } +} - CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID) +void SpawnTrust(CCharEntity *PMaster, uint32 TrustID) +{ + if (PMaster->PParty == nullptr) { - CTrustEntity* PTrust = new CTrustEntity(PMaster); - Trust_t* trustData = new Trust_t(); + PMaster->PParty = new CParty(PMaster); + } + + CTrustEntity *PTrust = LoadTrust(PMaster, TrustID); + PMaster->PTrusts.insert(PMaster->PTrusts.end(), PTrust); + PMaster->StatusEffectContainer->CopyConfrontationEffect(PTrust); + PMaster->loc.zone->InsertTRUST(PTrust); + PTrust->Spawn(); + + PMaster->PParty->ReloadParty(); +} + +CTrustEntity *LoadTrust(CCharEntity *PMaster, uint32 TrustID) +{ + CTrustEntity *PTrust = new CTrustEntity(PMaster); + Trust_t *trustData = new Trust_t(); - for (uint32 index = 0; index < g_PTrustList.size(); index++) + for (uint32 index = 0; index < g_PTrustList.size(); index++) + { + if (g_PTrustList.at(index)->trustID == TrustID) { - if (g_PTrustList.at(index)->trustID == TrustID) - { - trustData = g_PTrustList.at(index); - break; - } + trustData = g_PTrustList.at(index); + break; } - - PTrust->loc = PMaster->loc; - PTrust->m_OwnerID.id = PMaster->id; - PTrust->m_OwnerID.targid = PMaster->targid; - - // spawn me randomly around master - PTrust->loc.p = nearPosition(PMaster->loc.p, CTrustController::SpawnDistance, (float)M_PI); - PTrust->look = trustData->look; - PTrust->name = trustData->name; - - PTrust->packetName = trustData->packet_name; - PTrust->m_name_prefix = trustData->name_prefix; - PTrust->m_Family = trustData->m_Family; - PTrust->m_MobSkillList = trustData->m_MobSkillList; - PTrust->SetMJob(trustData->mJob); - PTrust->SetSJob(trustData->sJob); // TODO: This may not be true for some trusts - PTrust->m_HasSpellScript = trustData->hasSpellScript; - PTrust->m_TrustID = trustData->trustID; - PTrust->status = STATUS_NORMAL; - PTrust->m_ModelSize = trustData->size; - PTrust->m_EcoSystem = trustData->EcoSystem; - - // assume level matches master - PTrust->SetMLevel(PMaster->GetMLevel()); - PTrust->SetSLevel(PMaster->GetSLevel()); - - // TODO: Proper stats per trust - PTrust->setModifier(Mod::ATT, battleutils::GetMaxSkill(SKILL_CLUB, JOB_WHM, PTrust->GetMLevel())); - PTrust->setModifier(Mod::ACC, battleutils::GetMaxSkill(SKILL_CLUB, JOB_WHM, PTrust->GetMLevel())); - PTrust->setModifier(Mod::EVA, battleutils::GetMaxSkill(SKILL_THROWING, JOB_WHM, PTrust->GetMLevel())); // Throwing?? - PTrust->setModifier(Mod::DEF, battleutils::GetMaxSkill(SKILL_THROWING, JOB_WHM, PTrust->GetMLevel())); - //set C magic evasion - PTrust->setModifier(Mod::MEVA, battleutils::GetMaxSkill(SKILL_ELEMENTAL_MAGIC, JOB_RDM, PTrust->GetMLevel())); - // HP/MP STR/DEX/etc.. - LoadTrustStats(PTrust); - - PTrust->health.tp = 0; - PTrust->UpdateHealth(); - PTrust->health.hp = PTrust->GetMaxHP(); - PTrust->health.mp = PTrust->GetMaxMP(); - - mobutils::SetSpellList(PTrust, trustData->spellList); - - // TODO: Load stats from script - return PTrust; } + + PTrust->loc = PMaster->loc; + PTrust->m_OwnerID.id = PMaster->id; + PTrust->m_OwnerID.targid = PMaster->targid; + + // spawn me randomly around master + PTrust->loc.p = nearPosition(PMaster->loc.p, CTrustController::SpawnDistance, (float)M_PI); + PTrust->look = trustData->look; + PTrust->name = trustData->name; + + PTrust->packetName = trustData->packet_name; + PTrust->m_name_prefix = trustData->name_prefix; + PTrust->m_Family = trustData->m_Family; + PTrust->m_MobSkillList = trustData->m_MobSkillList; + PTrust->SetMJob(trustData->mJob); + PTrust->SetSJob(trustData->sJob); // TODO: This may not be true for some trusts + PTrust->m_HasSpellScript = trustData->hasSpellScript; + PTrust->m_TrustID = trustData->trustID; + PTrust->status = STATUS_NORMAL; + PTrust->m_ModelSize = trustData->size; + PTrust->m_EcoSystem = trustData->EcoSystem; + + // assume level matches master + PTrust->SetMLevel(PMaster->GetMLevel()); + PTrust->SetSLevel(PMaster->GetSLevel()); + + // TODO: Proper stats per trust + PTrust->setModifier(Mod::ATT, battleutils::GetMaxSkill(SKILL_CLUB, JOB_WHM, PTrust->GetMLevel())); + PTrust->setModifier(Mod::ACC, battleutils::GetMaxSkill(SKILL_CLUB, JOB_WHM, PTrust->GetMLevel())); + PTrust->setModifier(Mod::EVA, battleutils::GetMaxSkill(SKILL_THROWING, JOB_WHM, PTrust->GetMLevel())); // Throwing?? + PTrust->setModifier(Mod::DEF, battleutils::GetMaxSkill(SKILL_THROWING, JOB_WHM, PTrust->GetMLevel())); + //set C magic evasion + PTrust->setModifier(Mod::MEVA, battleutils::GetMaxSkill(SKILL_ELEMENTAL_MAGIC, JOB_RDM, PTrust->GetMLevel())); + // HP/MP STR/DEX/etc.. + LoadTrustStats(PTrust); + + PTrust->health.tp = 0; + PTrust->UpdateHealth(); + PTrust->health.hp = PTrust->GetMaxHP(); + PTrust->health.mp = PTrust->GetMaxMP(); + + mobutils::SetSpellList(PTrust, trustData->spellList); + + // TODO: Load stats from script + return PTrust; +} }; // namespace trustutils diff --git a/src/map/utils/trustutils.h b/src/map/utils/trustutils.h index e9bb4743e4f..02db76cf8c8 100644 --- a/src/map/utils/trustutils.h +++ b/src/map/utils/trustutils.h @@ -13,12 +13,12 @@ namespace trustutils void LoadTrustList(); void FreeTrustList(); - void SpawnTrust(CCharEntity * PMaster, uint32 TrustID); + void SpawnTrust(CCharEntity *PMaster, uint32 TrustID); // Internal void BuildTrust(uint32 TrustID); - CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID); - void LoadTrustStats(CTrustEntity* PTrust); -}; + CTrustEntity *LoadTrust(CCharEntity *PMaster, uint32 TrustID); + void LoadTrustStats(CTrustEntity *PTrust); +}; // namespace trustutils #endif From c084d5d836a34114e3aff1d7bb5392c0771e3e4a Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 13:49:35 +0200 Subject: [PATCH 078/116] Warp to owner when far away --- src/map/ai/controllers/trust_controller.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index 3c070c29e09..92d70113ca6 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -108,13 +108,13 @@ void CTrustController::DoRoamTick(time_point tick) if (currentDistance > RoamDistance) { - if (currentDistance < 6.0f && POwner->PAI->PathFind->PathAround(POwner->PMaster->loc.p, 3.0f, PATHFLAG_RUN | PATHFLAG_WALLHACK)) + if (currentDistance < 35.0f && POwner->PAI->PathFind->PathAround(POwner->PMaster->loc.p, 2.0f, PATHFLAG_RUN | PATHFLAG_WALLHACK)) { POwner->PAI->PathFind->FollowPath(); } else if (POwner->GetSpeed() > 0) { - POwner->PAI->PathFind->StepTo(POwner->PMaster->loc.p, RoamDistance); + POwner->PAI->PathFind->WarpTo(POwner->PMaster->loc.p, RoamDistance); } } } From d04c8d10538c223c96d6e49e7c4d3b0da721ef05 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 15:14:50 +0200 Subject: [PATCH 079/116] Add more mob-like stat and hp/mp calculation for trusts --- src/map/utils/trustutils.cpp | 277 ++++++++++++----------------------- src/map/utils/trustutils.h | 2 +- 2 files changed, 96 insertions(+), 183 deletions(-) diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index 5bebb1bf70a..82ecbfac5ae 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -21,6 +21,7 @@ #include "../zone_instance.h" #include "../ai/ai_container.h" #include "../ai/controllers/trust_controller.h" +#include "../items/item_weapon.h" #include "../packets/char_sync.h" #include "../packets/entity_update.h" #include "../packets/message_standard.h" @@ -239,197 +240,115 @@ void FreeTrustList() g_PTrustIDList.clear(); } -void LoadTrustStats(CTrustEntity *PTrust) +void LoadTrustStatsAndSkills(CTrustEntity* PTrust) { - // Cargo cult of PC calculations. - - float raceStat = 0; // конечное число HP для уровня на основе расы. - float jobStat = 0; // конечное число HP для уровня на основе первичной профессии. - float sJobStat = 0; // коенчное число HP для уровня на основе вторичной профессии. - int32 bonusStat = 0; // бонусное число HP которое добавляется при соблюдении некоторых условий. - - int32 baseValueColumn = 0; // номер колонки с базовым количеством HP - int32 scaleTo60Column = 1; // номер колонки с модификатором до 60 уровня - int32 scaleOver30Column = 2; // номер колонки с модификатором после 30 уровня - int32 scaleOver60Column = 3; // номер колонки с модификатором после 60 уровня - int32 scaleOver75Column = 4; // номер колонки с модификатором после 75 уровня - int32 scaleOver60 = 2; // номер колонки с модификатором для расчета MP после 60 уровня - int32 scaleOver75 = 3; // номер колонки с модификатором для расчета Статов после 75-го уровня - - uint8 grade; - - uint8 mlvl = PTrust->GetMLevel(); - uint8 slvl = PTrust->GetSLevel(); - JOBTYPE mjob = PTrust->GetMJob(); - JOBTYPE sjob = PTrust->GetSJob(); - - uint8 race = 0; //Human - - switch (PTrust->look.race) - { - case 3: - case 4: - race = 1; - break; //Elvaan - case 5: - case 6: - race = 2; - break; //Tarutaru - case 7: - race = 3; - break; //Mithra - case 8: - race = 4; - break; //Galka - } - - // Расчет прироста HP от main job - - int32 mainLevelOver30 = std::clamp(mlvl - 30, 0, 30); // Расчет условия +1HP каждый лвл после 30 уровня - int32 mainLevelUpTo60 = (mlvl < 60 ? mlvl - 1 : 59); // Первый режим рассчета до 60 уровня (Используется так же и для MP) - int32 mainLevelOver60To75 = std::clamp(mlvl - 60, 0, 15); // Второй режим расчета после 60 уровня - int32 mainLevelOver75 = (mlvl < 75 ? 0 : mlvl - 75); // Третий режим расчета после 75 уровня - - //Расчет бонусного количества HP - - int32 mainLevelOver10 = (mlvl < 10 ? 0 : mlvl - 10); // +2HP на каждом уровне после 10 - int32 mainLevelOver50andUnder60 = std::clamp(mlvl - 50, 0, 10); // +2HP на каждом уровне в промежутке от 50 до 60 уровня - int32 mainLevelOver60 = (mlvl < 60 ? 0 : mlvl - 60); - - // Расчет прироста HP от дополнительной профессии - - int32 subLevelOver10 = std::clamp(slvl - 10, 0, 20); // +1HP на каждый уровень после 10 (/2) - int32 subLevelOver30 = (slvl < 30 ? 0 : slvl - 30); // +1HP на каждый уровень после 30 - - // Расчет raceStat jobStat bonusStat sJobStat - // Расчет по расе - - grade = grade::GetRaceGrades(race, 0); - - raceStat = grade::GetHPScale(grade, baseValueColumn) + - (grade::GetHPScale(grade, scaleTo60Column) * mainLevelUpTo60) + - (grade::GetHPScale(grade, scaleOver30Column) * mainLevelOver30) + - (grade::GetHPScale(grade, scaleOver60Column) * mainLevelOver60To75) + - (grade::GetHPScale(grade, scaleOver75Column) * mainLevelOver75); - - // raceStat = (int32)(statScale[grade][baseValueColumn] + statScale[grade][scaleTo60Column] * (mlvl - 1)); - - // Расчет по main job - grade = grade::GetJobGrade(mjob, 0); - - jobStat = grade::GetHPScale(grade, baseValueColumn) + - (grade::GetHPScale(grade, scaleTo60Column) * mainLevelUpTo60) + - (grade::GetHPScale(grade, scaleOver30Column) * mainLevelOver30) + - (grade::GetHPScale(grade, scaleOver60Column) * mainLevelOver60To75) + - (grade::GetHPScale(grade, scaleOver75Column) * mainLevelOver75); - - // Расчет бонусных HP - bonusStat = (mainLevelOver10 + mainLevelOver50andUnder60) * 2; - - // Расчет по support job - if (slvl > 0) - { - grade = grade::GetJobGrade(sjob, 0); - - sJobStat = grade::GetHPScale(grade, baseValueColumn) + - (grade::GetHPScale(grade, scaleTo60Column) * (slvl - 1)) + - (grade::GetHPScale(grade, scaleOver30Column) * subLevelOver30) + - subLevelOver30 + subLevelOver10; - sJobStat = sJobStat / 2; - } - - PTrust->health.maxhp = (int16)(map_config.player_hp_multiplier * (raceStat + jobStat + bonusStat + sJobStat)); - - //Начало расчера MP - - raceStat = 0; - jobStat = 0; - sJobStat = 0; - - // Расчет MP расе. - grade = grade::GetRaceGrades(race, 1); - - //Если у main job нет МП рейтинга, расчитиваем расовый бонус на основе уровня subjob уровня(при условии, что у него есть МП рейтинг) - if (grade::GetJobGrade(mjob, 1) == 0) + JOBTYPE mJob = PTrust->GetMJob(); + JOBTYPE sJob = PTrust->GetSJob(); + uint8 mLvl = PTrust->GetMLevel(); + + float growth = 1.06f; + float base = 18.0f; + + PTrust->health.maxhp = (int16)(base * pow(mLvl, growth) * PTrust->HPscale); + PTrust->health.maxmp = (int16)(base * pow(mLvl, growth) * PTrust->MPscale); + + ((CItemWeapon*)PTrust->m_Weapons[SLOT_MAIN])->setDamage(mobutils::GetWeaponDamage(PTrust)); + + uint16 fSTR = mobutils::GetBaseToRank(PTrust->strRank, mLvl); + uint16 fDEX = mobutils::GetBaseToRank(PTrust->dexRank, mLvl); + uint16 fVIT = mobutils::GetBaseToRank(PTrust->vitRank, mLvl); + uint16 fAGI = mobutils::GetBaseToRank(PTrust->agiRank, mLvl); + uint16 fINT = mobutils::GetBaseToRank(PTrust->intRank, mLvl); + uint16 fMND = mobutils::GetBaseToRank(PTrust->mndRank, mLvl); + uint16 fCHR = mobutils::GetBaseToRank(PTrust->chrRank, mLvl); + + uint16 mSTR = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetMJob(), 2), mLvl); + uint16 mDEX = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetMJob(), 3), mLvl); + uint16 mVIT = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetMJob(), 4), mLvl); + uint16 mAGI = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetMJob(), 5), mLvl); + uint16 mINT = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetMJob(), 6), mLvl); + uint16 mMND = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetMJob(), 7), mLvl); + uint16 mCHR = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetMJob(), 8), mLvl); + + uint16 sSTR = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 2), PTrust->GetSLevel()); + uint16 sDEX = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 3), PTrust->GetSLevel()); + uint16 sVIT = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 4), PTrust->GetSLevel()); + uint16 sAGI = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 5), PTrust->GetSLevel()); + uint16 sINT = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 6), PTrust->GetSLevel()); + uint16 sMND = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 7), PTrust->GetSLevel()); + uint16 sCHR = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 8), PTrust->GetSLevel()); + + if (PTrust->GetSLevel() > 15) { - if (grade::GetJobGrade(sjob, 1) != 0 && slvl > 0) // В этом выражении ошибка - { - raceStat = (grade::GetMPScale(grade, 0) + grade::GetMPScale(grade, scaleTo60Column) * (slvl - 1)) / map_config.sj_mp_divisor; // Вот здесь ошибка - } + sSTR /= 2; + sDEX /= 2; + sAGI /= 2; + sINT /= 2; + sMND /= 2; + sCHR /= 2; + sVIT /= 2; } else { - //Расчет нормального расового бонуса - raceStat = grade::GetMPScale(grade, 0) + - grade::GetMPScale(grade, scaleTo60Column) * mainLevelUpTo60 + - grade::GetMPScale(grade, scaleOver60) * mainLevelOver60; - } - - //Для главной профессии - grade = grade::GetJobGrade(mjob, 1); - if (grade > 0) - { - jobStat = grade::GetMPScale(grade, 0) + - grade::GetMPScale(grade, scaleTo60Column) * mainLevelUpTo60 + - grade::GetMPScale(grade, scaleOver60) * mainLevelOver60; - } - - //Для дополнительной профессии - if (slvl > 0) - { - grade = grade::GetJobGrade(sjob, 1); - sJobStat = (grade::GetMPScale(grade, 0) + grade::GetMPScale(grade, scaleTo60Column) * (slvl - 1)) / map_config.sj_mp_divisor; + sSTR = 0; + sDEX = 0; + sAGI = 0; + sINT = 0; + sMND = 0; + sCHR = 0; + sVIT = 0; } - PTrust->health.maxmp = (int16)(map_config.player_mp_multiplier * (raceStat + jobStat + sJobStat)); // результат расчета MP + PTrust->stats.STR = fSTR + mSTR + sSTR; + PTrust->stats.DEX = fDEX + mDEX + sDEX; + PTrust->stats.VIT = fVIT + mVIT + sVIT; + PTrust->stats.AGI = fAGI + mAGI + sAGI; + PTrust->stats.INT = fINT + mINT + sINT; + PTrust->stats.MND = fMND + mMND + sMND; + PTrust->stats.CHR = fCHR + mCHR + sCHR; - uint8 counter = 0; - - for (uint8 StatIndex = 2; StatIndex <= 8; ++StatIndex) + // cap all stats for mLvl / job + for (int i = SKILL_DIVINE_MAGIC; i <= SKILL_BLUE_MAGIC; i++) { - // расчет по расе - grade = grade::GetRaceGrades(race, StatIndex); - raceStat = grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * mainLevelUpTo60; - - if (mainLevelOver60 > 0) + uint16 maxSkill = battleutils::GetMaxSkill((SKILLTYPE)i, PTrust->GetMJob(), mLvl > 99 ? 99 : mLvl); + if (maxSkill != 0) { - raceStat += grade::GetStatScale(grade, scaleOver60) * mainLevelOver60; - - if (mainLevelOver75 > 0) - { - raceStat += grade::GetStatScale(grade, scaleOver75) * mainLevelOver75 - (mlvl >= 75 ? 0.01f : 0); - } + PTrust->WorkingSkills.skill[i] = maxSkill; } - - // расчет по профессии - grade = grade::GetJobGrade(mjob, StatIndex); - jobStat = grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * mainLevelUpTo60; - - if (mainLevelOver60 > 0) + else //if the mob is WAR/BLM and can cast spell { - jobStat += grade::GetStatScale(grade, scaleOver60) * mainLevelOver60; + // set skill as high as main level, so their spells won't get resisted + uint16 maxSubSkill = battleutils::GetMaxSkill((SKILLTYPE)i, PTrust->GetSJob(), mLvl > 99 ? 99 : mLvl); - if (mainLevelOver75 > 0) + if (maxSubSkill != 0) { - jobStat += grade::GetStatScale(grade, scaleOver75) * mainLevelOver75 - (mlvl >= 75 ? 0.01f : 0); + PTrust->WorkingSkills.skill[i] = maxSubSkill; } } + } - // расчет по дополнительной профессии - if (slvl > 0) - { - grade = grade::GetJobGrade(sjob, StatIndex); - sJobStat = (grade::GetStatScale(grade, 0) + grade::GetStatScale(grade, scaleTo60Column) * (slvl - 1)) / 2; - } - else + for (int i = SKILL_HAND_TO_HAND; i <= SKILL_STAFF; i++) + { + uint16 maxSkill = battleutils::GetMaxSkill(3, mLvl > 99 ? 99 : mLvl); + if (maxSkill != 0) { - sJobStat = 0; + PTrust->WorkingSkills.skill[i] = maxSkill; } - - // Вывод значения - ref(&PTrust->stats, counter) = (uint16)((raceStat + jobStat + sJobStat)); - counter += 2; } + + PTrust->addModifier(Mod::DEF, mobutils::GetBase(PTrust, PTrust->defRank)); + PTrust->addModifier(Mod::EVA, mobutils::GetEvasion(PTrust)); + PTrust->addModifier(Mod::ATT, mobutils::GetBase(PTrust, PTrust->attRank)); + PTrust->addModifier(Mod::ACC, mobutils::GetBase(PTrust, PTrust->accRank)); + + //natural magic evasion + PTrust->addModifier(Mod::MEVA, mobutils::GetMagicEvasion(PTrust)); + + // add traits for sub and main + battleutils::AddTraits(PTrust, traits::GetTraits(mJob), mLvl); + battleutils::AddTraits(PTrust, traits::GetTraits(PTrust->GetSJob()), PTrust->GetSLevel()); + + mobutils::SetupJob(PTrust); } void SpawnTrust(CCharEntity *PMaster, uint32 TrustID) @@ -448,7 +367,7 @@ void SpawnTrust(CCharEntity *PMaster, uint32 TrustID) PMaster->PParty->ReloadParty(); } -CTrustEntity *LoadTrust(CCharEntity *PMaster, uint32 TrustID) +CTrustEntity* LoadTrust(CCharEntity *PMaster, uint32 TrustID) { CTrustEntity *PTrust = new CTrustEntity(PMaster); Trust_t *trustData = new Trust_t(); @@ -476,7 +395,9 @@ CTrustEntity *LoadTrust(CCharEntity *PMaster, uint32 TrustID) PTrust->m_Family = trustData->m_Family; PTrust->m_MobSkillList = trustData->m_MobSkillList; PTrust->SetMJob(trustData->mJob); - PTrust->SetSJob(trustData->sJob); // TODO: This may not be true for some trusts + PTrust->SetSJob(trustData->sJob); + PTrust->HPscale = trustData->HPscale; + PTrust->MPscale = trustData->MPscale; PTrust->m_HasSpellScript = trustData->hasSpellScript; PTrust->m_TrustID = trustData->trustID; PTrust->status = STATUS_NORMAL; @@ -487,15 +408,8 @@ CTrustEntity *LoadTrust(CCharEntity *PMaster, uint32 TrustID) PTrust->SetMLevel(PMaster->GetMLevel()); PTrust->SetSLevel(PMaster->GetSLevel()); - // TODO: Proper stats per trust - PTrust->setModifier(Mod::ATT, battleutils::GetMaxSkill(SKILL_CLUB, JOB_WHM, PTrust->GetMLevel())); - PTrust->setModifier(Mod::ACC, battleutils::GetMaxSkill(SKILL_CLUB, JOB_WHM, PTrust->GetMLevel())); - PTrust->setModifier(Mod::EVA, battleutils::GetMaxSkill(SKILL_THROWING, JOB_WHM, PTrust->GetMLevel())); // Throwing?? - PTrust->setModifier(Mod::DEF, battleutils::GetMaxSkill(SKILL_THROWING, JOB_WHM, PTrust->GetMLevel())); - //set C magic evasion - PTrust->setModifier(Mod::MEVA, battleutils::GetMaxSkill(SKILL_ELEMENTAL_MAGIC, JOB_RDM, PTrust->GetMLevel())); // HP/MP STR/DEX/etc.. - LoadTrustStats(PTrust); + LoadTrustStatsAndSkills(PTrust); PTrust->health.tp = 0; PTrust->UpdateHealth(); @@ -504,7 +418,6 @@ CTrustEntity *LoadTrust(CCharEntity *PMaster, uint32 TrustID) mobutils::SetSpellList(PTrust, trustData->spellList); - // TODO: Load stats from script return PTrust; } }; // namespace trustutils diff --git a/src/map/utils/trustutils.h b/src/map/utils/trustutils.h index 02db76cf8c8..cb1aef722b7 100644 --- a/src/map/utils/trustutils.h +++ b/src/map/utils/trustutils.h @@ -18,7 +18,7 @@ namespace trustutils // Internal void BuildTrust(uint32 TrustID); CTrustEntity *LoadTrust(CCharEntity *PMaster, uint32 TrustID); - void LoadTrustStats(CTrustEntity *PTrust); + void LoadTrustStatsAndSkills(CTrustEntity *PTrust); }; // namespace trustutils #endif From 105225b8bf822e81ce04fd557760281b53e4b65a Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 15:38:16 +0200 Subject: [PATCH 080/116] Job checking for MP --- src/map/utils/trustutils.cpp | 52 +++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index 82ecbfac5ae..2701b7a4dee 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -250,7 +250,47 @@ void LoadTrustStatsAndSkills(CTrustEntity* PTrust) float base = 18.0f; PTrust->health.maxhp = (int16)(base * pow(mLvl, growth) * PTrust->HPscale); - PTrust->health.maxmp = (int16)(base * pow(mLvl, growth) * PTrust->MPscale); + + bool hasMp = false; + switch (mJob) { + case JOB_PLD: + case JOB_WHM: + case JOB_BLM: + case JOB_RDM: + case JOB_DRK: + case JOB_BLU: + case JOB_SCH: + case JOB_SMN: + hasMp = true; + break; + default: + break; + } + + switch (sJob) { + case JOB_PLD: + case JOB_WHM: + case JOB_BLM: + case JOB_RDM: + case JOB_DRK: + case JOB_BLU: + case JOB_SCH: + case JOB_SMN: + hasMp = true; + break; + default: + break; + } + + if (hasMp) + { + PTrust->health.maxmp = (int16)(base * pow(mLvl, growth) * PTrust->MPscale); + } + + PTrust->health.tp = 0; + PTrust->UpdateHealth(); + PTrust->health.hp = PTrust->GetMaxHP(); + PTrust->health.mp = PTrust->GetMaxMP(); ((CItemWeapon*)PTrust->m_Weapons[SLOT_MAIN])->setDamage(mobutils::GetWeaponDamage(PTrust)); @@ -386,7 +426,7 @@ CTrustEntity* LoadTrust(CCharEntity *PMaster, uint32 TrustID) PTrust->m_OwnerID.targid = PMaster->targid; // spawn me randomly around master - PTrust->loc.p = nearPosition(PMaster->loc.p, CTrustController::SpawnDistance, (float)M_PI); + PTrust->loc.p = nearPosition(PMaster->loc.p, CTrustController::SpawnDistance, (float)M_PI * tpzrand::GetRandomNumber(2.0f)); PTrust->look = trustData->look; PTrust->name = trustData->name; @@ -398,6 +438,7 @@ CTrustEntity* LoadTrust(CCharEntity *PMaster, uint32 TrustID) PTrust->SetSJob(trustData->sJob); PTrust->HPscale = trustData->HPscale; PTrust->MPscale = trustData->MPscale; + PTrust->speed = trustData->speed; PTrust->m_HasSpellScript = trustData->hasSpellScript; PTrust->m_TrustID = trustData->trustID; PTrust->status = STATUS_NORMAL; @@ -408,14 +449,7 @@ CTrustEntity* LoadTrust(CCharEntity *PMaster, uint32 TrustID) PTrust->SetMLevel(PMaster->GetMLevel()); PTrust->SetSLevel(PMaster->GetSLevel()); - // HP/MP STR/DEX/etc.. LoadTrustStatsAndSkills(PTrust); - - PTrust->health.tp = 0; - PTrust->UpdateHealth(); - PTrust->health.hp = PTrust->GetMaxHP(); - PTrust->health.mp = PTrust->GetMaxMP(); - mobutils::SetSpellList(PTrust, trustData->spellList); return PTrust; From d8a76f482c0b116abddd58b3dbe7f12175c276df Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 15:38:34 +0200 Subject: [PATCH 081/116] Stability --- src/map/ai/controllers/trust_controller.cpp | 4 ---- src/map/entities/trustentity.cpp | 2 +- src/map/utils/mobutils.cpp | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index 92d70113ca6..68fa3a3c6d1 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -45,10 +45,6 @@ CTrustController::~CTrustController() void CTrustController::Despawn() { - if (POwner->PMaster) - { - POwner->PMaster = nullptr; - } POwner->animation = ANIMATION_DESPAWN; CMobController::Despawn(); } diff --git a/src/map/entities/trustentity.cpp b/src/map/entities/trustentity.cpp index 724587aec3c..62b7a89b532 100644 --- a/src/map/entities/trustentity.cpp +++ b/src/map/entities/trustentity.cpp @@ -85,7 +85,7 @@ void CTrustEntity::Die() PAI->ClearStateStack(); PAI->Internal_Die(0s); CBattleEntity::Die(); - if (PMaster->objtype == TYPE_PC) + if (PMaster && PMaster->objtype == TYPE_PC) { auto* PChar = (CCharEntity*)PMaster; PChar->RemoveTrust(this); diff --git a/src/map/utils/mobutils.cpp b/src/map/utils/mobutils.cpp index 9c3d666083d..065b579972d 100644 --- a/src/map/utils/mobutils.cpp +++ b/src/map/utils/mobutils.cpp @@ -899,7 +899,7 @@ void GetAvailableSpells(CMobEntity* PMob) { } // catch all non-defaulted spell chances - PMob->defaultMobMod(MOBMOD_MAGIC_COOL, 35); + PMob->defaultMobMod(MOBMOD_MAGIC_COOL, 35); PMob->defaultMobMod(MOBMOD_GA_CHANCE, 35); PMob->defaultMobMod(MOBMOD_NA_CHANCE, 40); PMob->defaultMobMod(MOBMOD_BUFF_CHANCE, 35); From 4a82db5aad720d934ace0a25bb300f3b1d9ac884 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 15:45:54 +0200 Subject: [PATCH 082/116] Audit a couple of trust jobs --- sql/mob_pools.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index ab162e622f2..ab38e10b618 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5954,8 +5954,8 @@ INSERT INTO `mob_pools` VALUES (5893,'Gloombound_Lurker','Gloombound_Lurker',221 INSERT INTO `mob_pools` VALUES (5894,'Lesath','Lesath',217,0x00001C0100000000000000000000000000000000,1,1,7,280,100,0,1,0,1,2,7,0,238,141,0,0,0,1,0,370); INSERT INTO `mob_pools` VALUES (5895,'Donggu','Donggu',116,0x0000780100000000000000000000000000000000,1,1,11,240,100,0,0,0,1,2,7,0,0,3,0,0,0,1,0,116); -- Trusts -INSERT INTO `mob_pools` VALUES (5896,'shantotto','Shantotto',153,0x0000B80B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); -INSERT INTO `mob_pools` VALUES (5897,'naji','Naji',149,0x0000B90B00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5896,'shantotto','Shantotto',153,0x0000B80B00000000000000000000000000000000,4,0,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); +INSERT INTO `mob_pools` VALUES (5897,'naji','Naji',149,0x0000B90B00000000000000000000000000000000,1,0,2,240,100,0,2,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5898,'kupipi','Kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,0,312,1,0,0); INSERT INTO `mob_pools` VALUES (5899,'excenmille','Excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,309,1,0,0); INSERT INTO `mob_pools` VALUES (5900,'ayame','Ayame',149,0x0000BC0B00000000000000000000000000000000,12,0,10,440,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); @@ -5964,9 +5964,9 @@ INSERT INTO `mob_pools` VALUES (5902,'curilla','Curilla',145,0x0000BE0B000000000 INSERT INTO `mob_pools` VALUES (5903,'volker','Volker',149,0x0000BF0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,8,1,0,0); INSERT INTO `mob_pools` VALUES (5904,'ajido-marujido','Ajido-Marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,0,311,1,0,0); INSERT INTO `mob_pools` VALUES (5905,'trion','Trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,310,1,0,0); -INSERT INTO `mob_pools` VALUES (5906,'zeid','Zeid',145,0x0000C20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5907,'lion','Lion',145,0x0000C30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5908,'tenzen','Tenzen',145,0x0000C40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5906,'zeid','Zeid',145,0x0000C20B00000000000000000000000000000000,8,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5907,'lion','Lion',145,0x0000C30B00000000000000000000000000000000,6,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5908,'tenzen','Tenzen',145,0x0000C40B00000000000000000000000000000000,12,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5909,'mihli_aliapoh','MihliAliapoh',145,0x0000C50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5910,'valaineral','Valaineral',145,0x0000C60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5911,'joachim','Joachim',145,0x0000C70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); From 5e1718f0d3dc809ca90c50395e7ce5b77cddf5dc Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 18:16:08 +0200 Subject: [PATCH 083/116] General cleanup and make things a little more robust --- scripts/globals/msg.lua | 2 +- scripts/globals/spells/trust/shantotto.lua | 12 ++++++ src/map/ai/controllers/trust_controller.cpp | 24 ++++++++++-- src/map/entities/charentity.cpp | 5 +-- src/map/entities/trustentity.cpp | 43 +++++++++++---------- src/map/entities/trustentity.h | 1 + src/map/zone_entities.cpp | 20 +++++----- 7 files changed, 69 insertions(+), 38 deletions(-) diff --git a/scripts/globals/msg.lua b/scripts/globals/msg.lua index f46192326ed..86d38b32ca1 100644 --- a/scripts/globals/msg.lua +++ b/scripts/globals/msg.lua @@ -307,7 +307,7 @@ tpz.msg.basic = DESPOIL_ACC_DOWN = 598, -- ${actor} uses ${ability}.${lb}${actor} steals a ${item} from ${target}.${lb}Additional effect: ${target} is afflicted with Accuracy Down. DESPOIL_SLOW = 599, -- ${actor} uses ${ability}.${lb}${actor} steals a ${item} from ${target}.${lb}Additional effect: ${target} is afflicted with Slow. - -- TRUST & ALTER EGO */ + -- TRUST & ALTER EGO TRUST_NO_CAST_TRUST = 700, -- You are unable to use Trust magic at this time. TRUST_NO_CALL_AE = 717, -- You cannot call forth alter egos here. } \ No newline at end of file diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index 05da38650d4..a8b8aff249c 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -11,3 +11,15 @@ end function onSpellCast(caster, target, spell) return tpz.trust.spawn(caster, spell) end + +function onMobSpawn(mob) + print(1) +end + +function onMobDespawn(mob) + print(2) +end + +function onMobDeath(mob) + print(3) +end diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index 68fa3a3c6d1..4f5c96fd01e 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -41,6 +41,7 @@ CTrustController::~CTrustController() } POwner->PAI->PathFind.reset(); POwner->allegiance = ALLEGIANCE_PLAYER; + POwner->PMaster = nullptr; } void CTrustController::Despawn() @@ -53,13 +54,12 @@ void CTrustController::Tick(time_point tick) { m_Tick = tick; - if (POwner->PMaster == nullptr || (POwner->PMaster->isDead() && POwner->isAlive())) + if (POwner->PMaster == nullptr) { - POwner->Die(); return; } - if (POwner->PMaster->PAI->IsEngaged()) + if (POwner->PAI->IsEngaged()) { DoCombatTick(tick); } @@ -71,8 +71,18 @@ void CTrustController::Tick(time_point tick) void CTrustController::DoCombatTick(time_point tick) { + if (!POwner->PMaster->PAI->IsEngaged()) + { + POwner->PAI->Internal_Disengage(); + } + + if (POwner->PMaster->GetBattleTargetID() != POwner->GetBattleTargetID()) + { + POwner->PAI->Internal_ChangeTarget(POwner->PMaster->GetBattleTargetID()); + } + float currentDistance = distance(POwner->loc.p, POwner->PMaster->loc.p); - PTarget = POwner->PMaster->GetBattleTarget(); + PTarget = POwner->GetBattleTarget(); if (PTarget) { @@ -89,6 +99,7 @@ void CTrustController::DoCombatTick(time_point tick) } } } + POwner->PAI->EventHandler.triggerListener("COMBAT_TICK", POwner, POwner->PMaster, PTarget); if (IsSpellReady(currentDistance) && TryCastSpell()) @@ -100,6 +111,11 @@ void CTrustController::DoCombatTick(time_point tick) void CTrustController::DoRoamTick(time_point tick) { + if (POwner->PMaster->PAI->IsEngaged()) + { + POwner->PAI->Internal_Engage(POwner->PMaster->GetBattleTargetID()); + } + float currentDistance = distance(POwner->loc.p, POwner->PMaster->loc.p); if (currentDistance > RoamDistance) diff --git a/src/map/entities/charentity.cpp b/src/map/entities/charentity.cpp index bcf0370cb12..1a9ca3db236 100644 --- a/src/map/entities/charentity.cpp +++ b/src/map/entities/charentity.cpp @@ -509,12 +509,11 @@ uint8 CCharEntity::TrustPartyPosition(CTrustEntity* PTrust) void CCharEntity::ClearTrusts() { - if (PTrusts.size() == 0) + if (PTrusts.empty()) { return; } - - for (auto& trust : PTrusts) + for (auto trust : PTrusts) { trust->PAI->Despawn(); } diff --git a/src/map/entities/trustentity.cpp b/src/map/entities/trustentity.cpp index 62b7a89b532..169eb42a673 100644 --- a/src/map/entities/trustentity.cpp +++ b/src/map/entities/trustentity.cpp @@ -49,47 +49,39 @@ void CTrustEntity::PostTick() if (loc.zone && updatemask && status != STATUS_DISAPPEAR) { loc.zone->PushPacket(this, CHAR_INRANGE, new CEntityUpdatePacket(this, ENTITY_UPDATE, updatemask)); - if (PMaster) - { - ((CCharEntity*)PMaster)->pushPacket(new CTrustSyncPacket((CCharEntity*)PMaster, this)); - } - if (updatemask & UPDATE_HP) + if (PMaster) { - if (PMaster && PMaster->PParty != nullptr) + if (updatemask & UPDATE_HP) { - PMaster->ForParty([this](auto PMember) + if (PMaster->PParty != nullptr) { - if (PMember->objtype == TYPE_PC) + PMaster->ForParty([this](auto PMember) { - static_cast(PMember)->pushPacket(new CCharHealthPacket(this)); - } - }); + if (PMember->objtype == TYPE_PC) + { + static_cast(PMember)->pushPacket(new CCharHealthPacket(this)); + } + }); + } } } - updatemask = 0; } } void CTrustEntity::FadeOut() { - luautils::OnMobDespawn(this); - CMobEntity::FadeOut(); + CBaseEntity::FadeOut(); loc.zone->PushPacket(this, CHAR_INRANGE, new CEntityUpdatePacket(this, ENTITY_DESPAWN, UPDATE_NONE)); } void CTrustEntity::Die() { luautils::OnMobDeath(this, nullptr); - PAI->ClearStateStack(); PAI->Internal_Die(0s); + ((CCharEntity*)PMaster)->RemoveTrust(this); CBattleEntity::Die(); - if (PMaster && PMaster->objtype == TYPE_PC) - { - auto* PChar = (CCharEntity*)PMaster; - PChar->RemoveTrust(this); - } } void CTrustEntity::Spawn() @@ -108,3 +100,14 @@ bool CTrustEntity::ValidTarget(CBattleEntity* PInitiator, uint16 targetFlags) } return CMobEntity::ValidTarget(PInitiator, targetFlags); } + +void CTrustEntity::OnDespawn(CDespawnState&) +{ + if (GetHPP()) + { + // Don't call this when despawning after being killed + luautils::OnMobDespawn(this); + } + FadeOut(); + PAI->EventHandler.triggerListener("DESPAWN", this); +} \ No newline at end of file diff --git a/src/map/entities/trustentity.h b/src/map/entities/trustentity.h index d464e32a955..fc8f13c792b 100644 --- a/src/map/entities/trustentity.h +++ b/src/map/entities/trustentity.h @@ -36,6 +36,7 @@ class CTrustEntity : public CMobEntity void Die() override; void Spawn() override; bool ValidTarget(CBattleEntity* PInitiator, uint16 targetFlags) override; + void OnDespawn(CDespawnState&) override; uint32 m_TrustID{}; uint16 m_PartyPosition{}; diff --git a/src/map/zone_entities.cpp b/src/map/zone_entities.cpp index 9a6b7f0e7f7..065bfcc6449 100644 --- a/src/map/zone_entities.cpp +++ b/src/map/zone_entities.cpp @@ -369,20 +369,20 @@ void CZoneEntities::DecreaseZoneCounter(CCharEntity* PChar) } PChar->PPet = nullptr; } + } - //remove trust - for (auto& trust : PChar->PTrusts) + //remove trusts + for (auto trust : PChar->PTrusts) + { + for (EntityList_t::const_iterator it = m_charList.begin(); it != m_charList.end(); ++it) { - for (EntityList_t::const_iterator it = m_charList.begin(); it != m_charList.end(); ++it) - { - //inform other players of the pets removal - CCharEntity* PCurrentChar = (CCharEntity*)it->second; - PCurrentChar->pushPacket(new CEntityUpdatePacket(trust, ENTITY_DESPAWN, UPDATE_NONE)); - } + //inform other players of the pets removal + CCharEntity* PCurrentChar = (CCharEntity*)it->second; + PCurrentChar->pushPacket(new CEntityUpdatePacket(trust, ENTITY_DESPAWN, UPDATE_NONE)); } - PChar->ClearTrusts(); - PChar->SpawnTRUSTList.clear(); } + PChar->ClearTrusts(); + PChar->SpawnTRUSTList.clear(); if (m_zone->m_BattlefieldHandler) m_zone->m_BattlefieldHandler->RemoveFromBattlefield(PChar, PChar->PBattlefield, BATTLEFIELD_LEAVE_CODE_WARPDC); From ef44c0acb39f24dd95587d1e1fff6f161b50df2d Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Fri, 20 Mar 2020 18:29:31 +0200 Subject: [PATCH 084/116] Yet more cleanup --- scripts/globals/spells/trust/shantotto.lua | 6 +++--- sql/mob_pools.sql | 10 +++++----- src/map/utils/trustutils.cpp | 23 +++++++++++----------- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index a8b8aff249c..91ab43d153c 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -13,13 +13,13 @@ function onSpellCast(caster, target, spell) end function onMobSpawn(mob) - print(1) + print("Trust:Shantotto:onMobSpawn") end function onMobDespawn(mob) - print(2) + print("Trust:Shantotto:onMobDespawn") end function onMobDeath(mob) - print(3) + print("Trust:Shantotto:onMobDeath") end diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index ab38e10b618..26b1ecfe1db 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5967,12 +5967,12 @@ INSERT INTO `mob_pools` VALUES (5905,'trion','Trion',145,0x0000C10B0000000000000 INSERT INTO `mob_pools` VALUES (5906,'zeid','Zeid',145,0x0000C20B00000000000000000000000000000000,8,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5907,'lion','Lion',145,0x0000C30B00000000000000000000000000000000,6,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5908,'tenzen','Tenzen',145,0x0000C40B00000000000000000000000000000000,12,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5909,'mihli_aliapoh','MihliAliapoh',145,0x0000C50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5909,'mihli_aliapoh','MihliAliapoh',145,0x0000C50B00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5910,'valaineral','Valaineral',145,0x0000C60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5911,'joachim','Joachim',145,0x0000C70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5912,'naja_salaheem','NajaSalaheem',145,0x0000C80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5913,'prishe','Prishe',145,0x0000C90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5914,'ulmia','Ulmia',145,0x0000CA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5911,'joachim','Joachim',145,0x0000C70B00000000000000000000000000000000,10,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5912,'naja_salaheem','NajaSalaheem',145,0x0000C80B00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5913,'prishe','Prishe',145,0x0000C90B00000000000000000000000000000000,2,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5914,'ulmia','Ulmia',145,0x0000CA0B00000000000000000000000000000000,10,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5915,'shikaree_z','ShikareeZ',145,0x0000CB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5916,'cherukiki','Cherukiki',145,0x0000CC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5917,'iron_eater','IronEater',145,0x0000CD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index 2701b7a4dee..51651c3fe32 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -245,6 +245,7 @@ void LoadTrustStatsAndSkills(CTrustEntity* PTrust) JOBTYPE mJob = PTrust->GetMJob(); JOBTYPE sJob = PTrust->GetSJob(); uint8 mLvl = PTrust->GetMLevel(); + uint8 sLvl = PTrust->GetSLevel(); float growth = 1.06f; float base = 18.0f; @@ -310,15 +311,15 @@ void LoadTrustStatsAndSkills(CTrustEntity* PTrust) uint16 mMND = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetMJob(), 7), mLvl); uint16 mCHR = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetMJob(), 8), mLvl); - uint16 sSTR = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 2), PTrust->GetSLevel()); - uint16 sDEX = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 3), PTrust->GetSLevel()); - uint16 sVIT = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 4), PTrust->GetSLevel()); - uint16 sAGI = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 5), PTrust->GetSLevel()); - uint16 sINT = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 6), PTrust->GetSLevel()); - uint16 sMND = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 7), PTrust->GetSLevel()); - uint16 sCHR = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 8), PTrust->GetSLevel()); + uint16 sSTR = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 2), sLvl); + uint16 sDEX = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 3), sLvl); + uint16 sVIT = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 4), sLvl); + uint16 sAGI = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 5), sLvl); + uint16 sINT = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 6), sLvl); + uint16 sMND = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 7), sLvl); + uint16 sCHR = mobutils::GetBaseToRank(grade::GetJobGrade(PTrust->GetSJob(), 8), sLvl); - if (PTrust->GetSLevel() > 15) + if (sLvl > 15) { sSTR /= 2; sDEX /= 2; @@ -350,7 +351,7 @@ void LoadTrustStatsAndSkills(CTrustEntity* PTrust) // cap all stats for mLvl / job for (int i = SKILL_DIVINE_MAGIC; i <= SKILL_BLUE_MAGIC; i++) { - uint16 maxSkill = battleutils::GetMaxSkill((SKILLTYPE)i, PTrust->GetMJob(), mLvl > 99 ? 99 : mLvl); + uint16 maxSkill = battleutils::GetMaxSkill((SKILLTYPE)i, mJob, mLvl > 99 ? 99 : mLvl); if (maxSkill != 0) { PTrust->WorkingSkills.skill[i] = maxSkill; @@ -358,7 +359,7 @@ void LoadTrustStatsAndSkills(CTrustEntity* PTrust) else //if the mob is WAR/BLM and can cast spell { // set skill as high as main level, so their spells won't get resisted - uint16 maxSubSkill = battleutils::GetMaxSkill((SKILLTYPE)i, PTrust->GetSJob(), mLvl > 99 ? 99 : mLvl); + uint16 maxSubSkill = battleutils::GetMaxSkill((SKILLTYPE)i, sJob, mLvl > 99 ? 99 : mLvl); if (maxSubSkill != 0) { @@ -386,7 +387,7 @@ void LoadTrustStatsAndSkills(CTrustEntity* PTrust) // add traits for sub and main battleutils::AddTraits(PTrust, traits::GetTraits(mJob), mLvl); - battleutils::AddTraits(PTrust, traits::GetTraits(PTrust->GetSJob()), PTrust->GetSLevel()); + battleutils::AddTraits(PTrust, traits::GetTraits(sJob), sLvl); mobutils::SetupJob(PTrust); } From 99571436b96b01df2b9a238fa2bd9391aa99d3fa Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 21 Mar 2020 11:12:54 +0200 Subject: [PATCH 085/116] messageParty placeholder --- scripts/globals/spells/trust/shantotto.lua | 13 ++++++++++--- scripts/globals/trust.lua | 16 +++++++++++++++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index 91ab43d153c..b47ec590d06 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -13,13 +13,20 @@ function onSpellCast(caster, target, spell) end function onMobSpawn(mob) - print("Trust:Shantotto:onMobSpawn") + local messages = { + "It's far too late for your foes to make amends, and with me at your side, they'll meet untimely ends!", + { 904, "Ajido-Marujido, tell me the truth. Are you following my teachings, or are your techniques still uncouth?" }, + { 952, "Ah, Koru-Moru, debtor extraordinaire. When it comes to running away, you've got a certain...flair." }, + { 935, "Ah, look who it is--a presence most divine. But when it comes to true power, I'm the most sublime!" }, + { 989, "Oh dearie me, this one will need an overhaul once we return to the Manustery..." }, + } + tpz.trust.messageParty(mob, messages) end function onMobDespawn(mob) - print("Trust:Shantotto:onMobDespawn") + tpz.trust.messageParty(mob, "I am hardly amazed at how well I've done, but I have to admit--it's been fun!") end function onMobDeath(mob) - print("Trust:Shantotto:onMobDeath") + tpz.trust.messageParty(mob, "I'd love to stay longer and enjoy this little party, but I've got a seminar to attend, and must not be tardy!") end diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index 64df1294fed..0aae03ef77f 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -74,4 +74,18 @@ tpz.trust.spawn = function(caster, spell) caster:spawnTrust(spell:getID()) return 0 -end \ No newline at end of file +end + +tpz.trust.messageParty = function(trust, message) + local party = {} + local master = trust:getMaster() + party = master:getAlliance() + + -- Pick message from message object + + for _, member in ipairs(party) do + if member:getZoneID() == trust:getZoneID() and member:isPC() then + -- member:PrintToPlayer(m, 4) + end + end +end From 1132d4912ab788bcdea0f12961117a88d82c409b Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 21 Mar 2020 14:35:04 +0200 Subject: [PATCH 086/116] Trust random message selection --- scripts/globals/spells/trust/shantotto.lua | 4 ++-- scripts/globals/trust.lua | 23 +++++++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index b47ec590d06..0f8f44f6c47 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -16,9 +16,9 @@ function onMobSpawn(mob) local messages = { "It's far too late for your foes to make amends, and with me at your side, they'll meet untimely ends!", { 904, "Ajido-Marujido, tell me the truth. Are you following my teachings, or are your techniques still uncouth?" }, - { 952, "Ah, Koru-Moru, debtor extraordinaire. When it comes to running away, you've got a certain...flair." }, { 935, "Ah, look who it is--a presence most divine. But when it comes to true power, I'm the most sublime!" }, - { 989, "Oh dearie me, this one will need an overhaul once we return to the Manustery..." }, + { 952, "Ah, Koru-Moru, debtor extraordinaire. When it comes to running away, you've got a certain...flair." }, + { 989, "Oh dearie me, this one will need an overhaul once we return to the Manustery..."}, } tpz.trust.messageParty(mob, messages) end diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index 0aae03ef77f..4e268886637 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -80,12 +80,33 @@ tpz.trust.messageParty = function(trust, message) local party = {} local master = trust:getMaster() party = master:getAlliance() + local pt_trusts = master:getPartyTrusts() -- Pick message from message object + local possible_messages = {} + if type(message) == "string" then + table.insert(possible_messages, message) + elseif type(message) == "table" then + for _, m in ipairs(message) do + if type(m) == "string" then + table.insert(possible_messages, m) + elseif type(m) == "table" then + local partner_trust_id = m[1] + local partner_trust_message = m[2] + for _, t in ipairs(pt_trusts) do + if t:getTrustID() == partner_trust_id then + table.insert(possible_messages, partner_trust_message) + end + end + end + end + end + + local final_message = possible_messages[math.random(#possible_messages)] for _, member in ipairs(party) do if member:getZoneID() == trust:getZoneID() and member:isPC() then - -- member:PrintToPlayer(m, 4) + member:PrintToPlayer(final_message, 4) end end end From b930787f296d822f18b0fdbb2288d7f78d4a6fb1 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 21 Mar 2020 14:39:20 +0200 Subject: [PATCH 087/116] Tidy tidy --- scripts/globals/trust.lua | 3 ++- src/map/ai/controllers/trust_controller.h | 2 +- src/map/entities/trustentity.h | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index 4e268886637..b93e885a0df 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -106,7 +106,8 @@ tpz.trust.messageParty = function(trust, message) for _, member in ipairs(party) do if member:getZoneID() == trust:getZoneID() and member:isPC() then - member:PrintToPlayer(final_message, 4) + -- TODO: Correct messaging + --member:PrintToPlayer(final_message, 4) end end end diff --git a/src/map/ai/controllers/trust_controller.h b/src/map/ai/controllers/trust_controller.h index 309151fc7e4..d0c9957a456 100644 --- a/src/map/ai/controllers/trust_controller.h +++ b/src/map/ai/controllers/trust_controller.h @@ -39,7 +39,7 @@ class CTrustController : public CMobController bool Ability(uint16 targid, uint16 abilityid) override; static constexpr float RoamDistance{ 5.5f }; - static constexpr float SpawnDistance{ 12.5f }; + static constexpr float SpawnDistance{ 5.5f }; private: void DoCombatTick(time_point tick) override; diff --git a/src/map/entities/trustentity.h b/src/map/entities/trustentity.h index fc8f13c792b..78862db9352 100644 --- a/src/map/entities/trustentity.h +++ b/src/map/entities/trustentity.h @@ -39,7 +39,6 @@ class CTrustEntity : public CMobEntity void OnDespawn(CDespawnState&) override; uint32 m_TrustID{}; - uint16 m_PartyPosition{}; }; #endif From fde02e0e5d035868ef8955036ac5e249ff841e96 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 21 Mar 2020 17:30:36 +0200 Subject: [PATCH 088/116] Audit all trust jobs --- sql/mob_pools.sql | 196 +++++++++++++++++++++++----------------------- 1 file changed, 98 insertions(+), 98 deletions(-) diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index 26b1ecfe1db..a6dfb26a240 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5973,111 +5973,111 @@ INSERT INTO `mob_pools` VALUES (5911,'joachim','Joachim',145,0x0000C70B000000000 INSERT INTO `mob_pools` VALUES (5912,'naja_salaheem','NajaSalaheem',145,0x0000C80B00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5913,'prishe','Prishe',145,0x0000C90B00000000000000000000000000000000,2,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5914,'ulmia','Ulmia',145,0x0000CA0B00000000000000000000000000000000,10,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5915,'shikaree_z','ShikareeZ',145,0x0000CB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5916,'cherukiki','Cherukiki',145,0x0000CC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5917,'iron_eater','IronEater',145,0x0000CD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5918,'gessho','Gessho',145,0x0000CE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5919,'gadalar','Gadalar',145,0x0000CF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5920,'rainemard','Rainemard',145,0x0000D00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5921,'ingrid','Ingrid',145,0x0000D10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5922,'lehko_habhoka','LehkoHabhoka',145,0x0000D20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5923,'nashmeira','Nashmeira',145,0x0000D30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5924,'zazarg','Zazarg',145,0x0000D40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5925,'ovjang','Ovjang',145,0x0000D50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5926,'mnejing','Mnejing',145,0x0000D60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5927,'sakura','Sakura',145,0x0000D70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5928,'luzaf','Luzaf',145,0x0000D80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5929,'najelith','Najelith',145,0x0000D90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5930,'aldo','Aldo',145,0x0000DA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5931,'moogle','Moogle',145,0x0000DB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5932,'fablinix','Fablinix',145,0x0000DC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5933,'maat','Maat',145,0x0000DD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5934,'d_shantotto','D.Shantotto',145,0x0000DE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,313,1,0,0); -INSERT INTO `mob_pools` VALUES (5935,'star_sibyl','StarSibyl',145,0x0000DF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5936,'karaha-baruha','Karaha-Baruha',145,0x0000E00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5937,'cid','Cid',145,0x0000E10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5938,'gilgamesh','Gilgamesh',145,0x0000E20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5939,'areuhat','Areuhat',145,0x0000E30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5940,'semih_lafihna','SemihLafihna',145,0x0000E40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5941,'elivira','Elivira',145,0x0000E50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5942,'noillurie','Noillurie',145,0x0000E60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5943,'lhu_mhakaracca','LhuMhakaracca',145,0x0000E70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5944,'ferreous_coffin','FerreousCoffin',145,0x0000E80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5945,'lilisette','Lilisette',145,0x0000E90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5946,'mumor','Mumor',145,0x0000EA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5947,'uka_totlihn','UkaTotlihn',145,0x0000EB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5948,'klara','Klara',145,0x0000ED0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5949,'romaa_mihgo','RomaaMihgo',145,0x0000EE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5950,'kuyin_hathdenna','KuyinHathdenna',145,0x0000EF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5915,'shikaree_z','ShikareeZ',145,0x0000CB0B00000000000000000000000000000000,14,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5916,'cherukiki','Cherukiki',145,0x0000CC0B00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5917,'iron_eater','IronEater',145,0x0000CD0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5918,'gessho','Gessho',145,0x0000CE0B00000000000000000000000000000000,13,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5919,'gadalar','Gadalar',145,0x0000CF0B00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5920,'rainemard','Rainemard',145,0x0000D00B00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5921,'ingrid','Ingrid',145,0x0000D10B00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5922,'lehko_habhoka','LehkoHabhoka',145,0x0000D20B00000000000000000000000000000000,6,4,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5923,'nashmeira','Nashmeira',145,0x0000D30B00000000000000000000000000000000,18,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5924,'zazarg','Zazarg',145,0x0000D40B00000000000000000000000000000000,2,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5925,'ovjang','Ovjang',145,0x0000D50B00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5926,'mnejing','Mnejing',145,0x0000D60B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5927,'sakura','Sakura',145,0x0000D70B00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5928,'luzaf','Luzaf',145,0x0000D80B00000000000000000000000000000000,17,13,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5929,'najelith','Najelith',145,0x0000D90B00000000000000000000000000000000,11,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5930,'aldo','Aldo',145,0x0000DA0B00000000000000000000000000000000,6,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5931,'moogle','Moogle',145,0x0000DB0B00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5932,'fablinix','Fablinix',145,0x0000DC0B00000000000000000000000000000000,6,4,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5933,'maat','Maat',145,0x0000DD0B00000000000000000000000000000000,2,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5934,'d_shantotto','D.Shantotto',145,0x0000DE0B00000000000000000000000000000000,4,8,3,240,100,0,0,0,0,0,0,32,0,3,0,0,313,1,0,0); +INSERT INTO `mob_pools` VALUES (5935,'star_sibyl','StarSibyl',145,0x0000DF0B00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5936,'karaha-baruha','Karaha-Baruha',145,0x0000E00B00000000000000000000000000000000,3,15,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5937,'cid','Cid',145,0x0000E10B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5938,'gilgamesh','Gilgamesh',145,0x0000E20B00000000000000000000000000000000,12,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5939,'areuhat','Areuhat',145,0x0000E30B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5940,'semih_lafihna','SemihLafihna',145,0x0000E40B00000000000000000000000000000000,11,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5941,'elivira','Elivira',145,0x0000E50B00000000000000000000000000000000,11,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5942,'noillurie','Noillurie',145,0x0000E60B00000000000000000000000000000000,12,7,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5943,'lhu_mhakaracca','LhuMhakaracca',145,0x0000E70B00000000000000000000000000000000,9,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5944,'ferreous_coffin','FerreousCoffin',145,0x0000E80B00000000000000000000000000000000,3,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5945,'lilisette','Lilisette',145,0x0000E90B00000000000000000000000000000000,19,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5946,'mumor','Mumor',145,0x0000EA0B00000000000000000000000000000000,19,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5947,'uka_totlihn','UkaTotlihn',145,0x0000EB0B00000000000000000000000000000000,19,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5948,'klara','Klara',145,0x0000ED0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5949,'romaa_mihgo','RomaaMihgo',145,0x0000EE0B00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5950,'kuyin_hathdenna','KuyinHathdenna',145,0x0000EF0B00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5951,'rahal','Rahal',145,0x0000F00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5952,'koru-moru','Koru-Moru',145,0x0000F10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5953,'pieuje_uc','Pieuje',145,0x0000F20B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5954,'i_shield_uc','InvincibleShld',145,0x0000F40B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5955,'apururu_uc','Apururu',145,0x0000F50B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5956,'jakoh_uc','JakohWahcondalo',145,0x0000F60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5957,'flaviria_uc','Flaviria',145,0x0000F30B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5958,'babban','Babban',145,0x0000FB0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5959,'abenzio','Abenzio',145,0x0000FC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5960,'rughadjeen','Rughadjeen',145,0x0000FD0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5961,'kukki-chebukki','Kukki-Chebukki',145,0x0000FE0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5962,'margret','Margret',145,0x0000FF0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5963,'chacharoon','Chacharoon',145,0x0000000C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5964,'lhe_lhangavo','LheLhangavo',145,0x0000010C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5965,'arciela','Arciela',145,0x0000020C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5966,'mayakov','Mayakov',145,0x0000030C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5967,'qultada','Qultada',145,0x0000040C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5968,'adelheid','Adelheid',145,0x0000050C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5969,'amchuchu','Amchuchu',145,0x0000060C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5970,'brygid','Brygid',145,0x0000070C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5971,'mildaurion','Mildaurion',145,0x0000080C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5952,'koru-moru','Koru-Moru',145,0x0000F10B00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5953,'pieuje_uc','Pieuje',145,0x0000F20B00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5954,'i_shield_uc','InvincibleShld',145,0x0000F40B00000000000000000000000000000000,1,2,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5955,'apururu_uc','Apururu',145,0x0000F50B00000000000000000000000000000000,3,5,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5956,'jakoh_uc','JakohWahcondalo',145,0x0000F60B00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5957,'flaviria_uc','Flaviria',145,0x0000F30B00000000000000000000000000000000,14,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5958,'babban','Babban',145,0x0000FB0B00000000000000000000000000000000,2,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5959,'abenzio','Abenzio',145,0x0000FC0B00000000000000000000000000000000,2,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5960,'rughadjeen','Rughadjeen',145,0x0000FD0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5961,'kukki-chebukki','Kukki-Chebukki',145,0x0000FE0B00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5962,'margret','Margret',145,0x0000FF0B00000000000000000000000000000000,11,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5963,'chacharoon','Chacharoon',145,0x0000000C00000000000000000000000000000000,6,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5964,'lhe_lhangavo','LheLhangavo',145,0x0000010C00000000000000000000000000000000,2,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5965,'arciela','Arciela',145,0x0000020C00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5966,'mayakov','Mayakov',145,0x0000030C00000000000000000000000000000000,19,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5967,'qultada','Qultada',145,0x0000040C00000000000000000000000000000000,17,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5968,'adelheid','Adelheid',145,0x0000050C00000000000000000000000000000000,20,4,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5969,'amchuchu','Amchuchu',145,0x0000060C00000000000000000000000000000000,22,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5970,'brygid','Brygid',145,0x0000070C00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5971,'mildaurion','Mildaurion',145,0x0000080C00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5972,'halver','Halver',145,0x00000F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5973,'rongelouts','Rongelouts',145,0x0000100C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5974,'leonoyne','Leonoyne',145,0x0000110C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5975,'maximilian','Maximilian',145,0x0000120C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5976,'kayeel-payeel','Kayeel-Payeel',145,0x0000130C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5977,'robel-akbel','Robel-Akbel',145,0x0000140C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5978,'kupofried','Kupofried',145,0x0000150C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5979,'selh_teus','Selh\'teus',145,0x0000160C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5980,'yoran-oran_uc','Yoran-Oran',145,0x0000170C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5981,'sylvie_uc','Sylvie',145,0x0000180C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5982,'abquhbah','Abquhbah',145,0x00001A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5983,'balamor','Balamor',145,0x00001B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5973,'rongelouts','Rongelouts',145,0x0000100C00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5974,'leonoyne','Leonoyne',145,0x0000110C00000000000000000000000000000000,4,8,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5975,'maximilian','Maximilian',145,0x0000120C00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5976,'kayeel-payeel','Kayeel-Payeel',145,0x0000130C00000000000000000000000000000000,4,15,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5977,'robel-akbel','Robel-Akbel',145,0x0000140C00000000000000000000000000000000,4,15,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5978,'kupofried','Kupofried',145,0x0000150C00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5979,'selh_teus','Selh\'teus',145,0x0000160C00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5980,'yoran-oran_uc','Yoran-Oran',145,0x0000170C00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5981,'sylvie_uc','Sylvie',145,0x0000180C00000000000000000000000000000000,21,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5982,'abquhbah','Abquhbah',145,0x00001A0C00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5983,'balamor','Balamor',145,0x00001B0C00000000000000000000000000000000,8,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5984,'august','August',145,0x00001C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5985,'rosulatia','Rosulatia',145,0x00001D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5986,'teodor','Teodor',145,0x00001F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5987,'ullegore','Ullegore',145,0x0000210C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5988,'makki-chebukki','Makki-Chebukki',145,0x0000220C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5989,'king_of_hearts','KingOfHearts',145,0x0000230C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5990,'morimar','Morimar',145,0x0000240C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5991,'darrcuiln','Darrcuiln',145,0x0000250C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5992,'aahm','ArkHM',145,0x0000290C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5993,'aaev','ArkEV',145,0x00002A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5994,'aamr','ArkMR',145,0x00002B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5995,'aatt','ArkTT',145,0x00002C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5996,'aagk','ArkGK',145,0x00002D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5997,'iroha','Iroha',145,0x0000270C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5998,'ygnas','Ygnas',145,0x00002E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5985,'rosulatia','Rosulatia',145,0x00001D0C00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5986,'teodor','Teodor',145,0x00001F0C00000000000000000000000000000000,4,6,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5987,'ullegore','Ullegore',145,0x0000210C00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5988,'makki-chebukki','Makki-Chebukki',145,0x0000220C00000000000000000000000000000000,11,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5989,'king_of_hearts','KingOfHearts',145,0x0000230C00000000000000000000000000000000,5,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5990,'morimar','Morimar',145,0x0000240C00000000000000000000000000000000,9,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5991,'darrcuiln','Darrcuiln',145,0x0000250C00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5992,'aahm','ArkHM',145,0x0000290C00000000000000000000000000000000,13,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5993,'aaev','ArkEV',145,0x00002A0C00000000000000000000000000000000,7,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5994,'aamr','ArkMR',145,0x00002B0C00000000000000000000000000000000,9,6,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5995,'aatt','ArkTT',145,0x00002C0C00000000000000000000000000000000,4,8,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5996,'aagk','ArkGK',145,0x00002D0C00000000000000000000000000000000,12,14,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5997,'iroha','Iroha',145,0x0000270C00000000000000000000000000000000,4,12,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5998,'ygnas','Ygnas',145,0x00002E0C00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -- Reserved for future Trust 5999 -- Reserved for future Trust 6000 -- Reserved for future Trust 6001 -- Reserved for future Trust 6002 -INSERT INTO `mob_pools` VALUES (6003,'cornelia','Cornelia',145,0x00002F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6004,'excenmille_s','Excenmille',145,0x0000EC0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6005,'ayame_uc','Ayame',145,0x0000F70B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6006,'maat_uc','Maat',145,0x0000F80B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6007,'aldo_uc','Aldo',145,0x0000F90B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6008,'naja_uc','NajaSalaheem',145,0x0000FA0B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6009,'lion_ii','Lion',145,0x0000090C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6010,'zeid_ii','Zeid',145,0x00000E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6011,'prishe_ii','Prishe',145,0x00000A0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6012,'nashmeira_ii','Nashmeira',145,0x00000B0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6013,'lilisette_ii','Lilisette',145,0x00000C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6014,'tenzen_ii','Tenzen',145,0x0000190C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6015,'mumor_ii','Mumor',145,0x0000200C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6016,'ingrid_ii','Ingrid',145,0x00001E0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6017,'arciela_ii','Arciela',145,0x00000D0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6018,'iroha_ii','Iroha',145,0x0000280C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6019,'shantotto_ii','Shantotto',153,0x0000260C00000000000000000000000000000000,4,5,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); +INSERT INTO `mob_pools` VALUES (6003,'cornelia','Cornelia',145,0x00002F0C00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6004,'excenmille_s','Excenmille',145,0x0000EC0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6005,'ayame_uc','Ayame',145,0x0000F70B00000000000000000000000000000000,12,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6006,'maat_uc','Maat',145,0x0000F80B00000000000000000000000000000000,2,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6007,'aldo_uc','Aldo',145,0x0000F90B00000000000000000000000000000000,6,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6008,'naja_uc','NajaSalaheem',145,0x0000FA0B00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6009,'lion_ii','Lion',145,0x0000090C00000000000000000000000000000000,6,13,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6010,'zeid_ii','Zeid',145,0x00000E0C00000000000000000000000000000000,8,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6011,'prishe_ii','Prishe',145,0x00000A0C00000000000000000000000000000000,2,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6012,'nashmeira_ii','Nashmeira',145,0x00000B0C00000000000000000000000000000000,18,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6013,'lilisette_ii','Lilisette',145,0x00000C0C00000000000000000000000000000000,19,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6014,'tenzen_ii','Tenzen',145,0x0000190C00000000000000000000000000000000,12,11,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6015,'mumor_ii','Mumor',145,0x0000200C00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6016,'ingrid_ii','Ingrid',145,0x00001E0C00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6017,'arciela_ii','Arciela',145,0x00000D0C00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6018,'iroha_ii','Iroha',145,0x0000280C00000000000000000000000000000000,3,12,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6019,'shantotto_ii','Shantotto',153,0x0000260C00000000000000000000000000000000,4,0,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); -- Reserved for future Trust 6020 -- Reserved for future Trust 6021 -- Reserved for future Trust 6022 From c1b9ce174b22a6f446bf22513c163cbf42267796 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sat, 21 Mar 2020 23:07:52 +0200 Subject: [PATCH 089/116] Hook up weapon speed --- src/map/utils/trustutils.cpp | 250 ++++++++++++++++++----------------- src/map/utils/trustutils.h | 6 +- 2 files changed, 130 insertions(+), 126 deletions(-) diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index 51651c3fe32..bc3765b1715 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -3,9 +3,9 @@ #include "../../common/timer.h" #include "../../common/utils.h" +#include #include #include -#include #include "battleutils.h" #include "charutils.h" @@ -15,24 +15,24 @@ #include "../grades.h" #include "../map.h" -#include "../entities/mobentity.h" -#include "../entities/trustentity.h" -#include "../status_effect_container.h" -#include "../zone_instance.h" #include "../ai/ai_container.h" #include "../ai/controllers/trust_controller.h" +#include "../entities/mobentity.h" +#include "../entities/trustentity.h" #include "../items/item_weapon.h" #include "../packets/char_sync.h" #include "../packets/entity_update.h" #include "../packets/message_standard.h" #include "../packets/trust_sync.h" +#include "../status_effect_container.h" +#include "../zone_instance.h" struct TrustSpell_ID { uint32 spellID; }; -std::vector g_PTrustIDList; +std::vector g_PTrustIDList; struct Trust_t { @@ -97,7 +97,7 @@ struct Trust_t int16 darkres; }; -std::vector g_PTrustList; +std::vector g_PTrustList; namespace trustutils { @@ -105,8 +105,7 @@ void LoadTrustList() { FreeTrustList(); - const char *Query = - "SELECT \ + const char* Query = "SELECT \ spell_list.spellid, mob_pools.poolid \ FROM spell_list, mob_pools \ WHERE spell_list.spellid >= 896 AND mob_pools.poolid = (spell_list.spellid+5000) ORDER BY spell_list.spellid"; @@ -115,7 +114,7 @@ void LoadTrustList() { while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) { - TrustSpell_ID *trustID = new TrustSpell_ID(); + TrustSpell_ID* trustID = new TrustSpell_ID(); trustID->spellID = (uint32)Sql_GetIntData(SqlHandle, 0); @@ -131,8 +130,7 @@ void LoadTrustList() void BuildTrust(uint32 TrustID) { - const char *Query = - "SELECT \ + const char* Query = "SELECT \ mob_pools.name,\ mob_pools.packet_name,\ mob_pools.modelid,\ @@ -173,62 +171,62 @@ void BuildTrust(uint32 TrustID) { while (Sql_NextRow(SqlHandle) == SQL_SUCCESS) { - Trust_t *trust = new Trust_t(); + Trust_t* trust = new Trust_t(); trust->trustID = TrustID; - trust->name.insert(0, (const char *)Sql_GetData(SqlHandle, 0)); - trust->packet_name.insert(0, (const char *)Sql_GetData(SqlHandle, 1)); + trust->name.insert(0, (const char*)Sql_GetData(SqlHandle, 0)); + trust->packet_name.insert(0, (const char*)Sql_GetData(SqlHandle, 1)); memcpy(&trust->look, Sql_GetData(SqlHandle, 2), 20); - trust->m_Family = (uint16)Sql_GetIntData(SqlHandle, 3); - trust->mJob = (uint8)Sql_GetIntData(SqlHandle, 4); - trust->sJob = (uint8)Sql_GetIntData(SqlHandle, 5); + trust->m_Family = (uint16)Sql_GetIntData(SqlHandle, 3); + trust->mJob = (uint8)Sql_GetIntData(SqlHandle, 4); + trust->sJob = (uint8)Sql_GetIntData(SqlHandle, 5); trust->hasSpellScript = (bool)Sql_GetIntData(SqlHandle, 6); - trust->spellList = (uint16)Sql_GetIntData(SqlHandle, 7); - trust->cmbDelay = (uint16)Sql_GetIntData(SqlHandle, 8); - trust->name_prefix = (uint8)Sql_GetUIntData(SqlHandle, 9); + trust->spellList = (uint16)Sql_GetIntData(SqlHandle, 7); + trust->cmbDelay = (uint16)Sql_GetIntData(SqlHandle, 8); + trust->name_prefix = (uint8)Sql_GetUIntData(SqlHandle, 9); // Behaviour trust->m_MobSkillList = (uint16)Sql_GetUIntData(SqlHandle, 11); // SpellID - trust->size = Sql_GetUIntData(SqlHandle, 13); + trust->size = Sql_GetUIntData(SqlHandle, 13); trust->EcoSystem = (ECOSYSTEM)Sql_GetIntData(SqlHandle, 14); - trust->HPscale = Sql_GetFloatData(SqlHandle, 15); - trust->MPscale = Sql_GetFloatData(SqlHandle, 16); - trust->speed = (uint8)Sql_GetIntData(SqlHandle, 17); - trust->strRank = (uint8)Sql_GetIntData(SqlHandle, 18); - trust->dexRank = (uint8)Sql_GetIntData(SqlHandle, 19); - trust->vitRank = (uint8)Sql_GetIntData(SqlHandle, 20); - trust->agiRank = (uint8)Sql_GetIntData(SqlHandle, 21); - trust->intRank = (uint8)Sql_GetIntData(SqlHandle, 22); - trust->mndRank = (uint8)Sql_GetIntData(SqlHandle, 23); - trust->chrRank = (uint8)Sql_GetIntData(SqlHandle, 24); - trust->defRank = (uint8)Sql_GetIntData(SqlHandle, 25); - trust->attRank = (uint8)Sql_GetIntData(SqlHandle, 26); - trust->accRank = (uint8)Sql_GetIntData(SqlHandle, 27); - trust->evaRank = (uint8)Sql_GetIntData(SqlHandle, 28); + trust->HPscale = Sql_GetFloatData(SqlHandle, 15); + trust->MPscale = Sql_GetFloatData(SqlHandle, 16); + trust->speed = (uint8)Sql_GetIntData(SqlHandle, 17); + trust->strRank = (uint8)Sql_GetIntData(SqlHandle, 18); + trust->dexRank = (uint8)Sql_GetIntData(SqlHandle, 19); + trust->vitRank = (uint8)Sql_GetIntData(SqlHandle, 20); + trust->agiRank = (uint8)Sql_GetIntData(SqlHandle, 21); + trust->intRank = (uint8)Sql_GetIntData(SqlHandle, 22); + trust->mndRank = (uint8)Sql_GetIntData(SqlHandle, 23); + trust->chrRank = (uint8)Sql_GetIntData(SqlHandle, 24); + trust->defRank = (uint8)Sql_GetIntData(SqlHandle, 25); + trust->attRank = (uint8)Sql_GetIntData(SqlHandle, 26); + trust->accRank = (uint8)Sql_GetIntData(SqlHandle, 27); + trust->evaRank = (uint8)Sql_GetIntData(SqlHandle, 28); // resistances - trust->slashres = (uint16)(Sql_GetFloatData(SqlHandle, 29) * 1000); + trust->slashres = (uint16)(Sql_GetFloatData(SqlHandle, 29) * 1000); trust->pierceres = (uint16)(Sql_GetFloatData(SqlHandle, 30) * 1000); - trust->hthres = (uint16)(Sql_GetFloatData(SqlHandle, 31) * 1000); + trust->hthres = (uint16)(Sql_GetFloatData(SqlHandle, 31) * 1000); trust->impactres = (uint16)(Sql_GetFloatData(SqlHandle, 32) * 1000); - trust->firedef = 0; - trust->icedef = 0; - trust->winddef = 0; - trust->earthdef = 0; + trust->firedef = 0; + trust->icedef = 0; + trust->winddef = 0; + trust->earthdef = 0; trust->thunderdef = 0; - trust->waterdef = 0; - trust->lightdef = 0; - trust->darkdef = 0; - - trust->fireres = (uint16)((Sql_GetFloatData(SqlHandle, 33) - 1) * -100); - trust->iceres = (uint16)((Sql_GetFloatData(SqlHandle, 34) - 1) * -100); - trust->windres = (uint16)((Sql_GetFloatData(SqlHandle, 35) - 1) * -100); - trust->earthres = (uint16)((Sql_GetFloatData(SqlHandle, 36) - 1) * -100); + trust->waterdef = 0; + trust->lightdef = 0; + trust->darkdef = 0; + + trust->fireres = (uint16)((Sql_GetFloatData(SqlHandle, 33) - 1) * -100); + trust->iceres = (uint16)((Sql_GetFloatData(SqlHandle, 34) - 1) * -100); + trust->windres = (uint16)((Sql_GetFloatData(SqlHandle, 35) - 1) * -100); + trust->earthres = (uint16)((Sql_GetFloatData(SqlHandle, 36) - 1) * -100); trust->thunderres = (uint16)((Sql_GetFloatData(SqlHandle, 37) - 1) * -100); - trust->waterres = (uint16)((Sql_GetFloatData(SqlHandle, 38) - 1) * -100); - trust->lightres = (uint16)((Sql_GetFloatData(SqlHandle, 39) - 1) * -100); - trust->darkres = (uint16)((Sql_GetFloatData(SqlHandle, 40) - 1) * -100); + trust->waterres = (uint16)((Sql_GetFloatData(SqlHandle, 38) - 1) * -100); + trust->lightres = (uint16)((Sql_GetFloatData(SqlHandle, 39) - 1) * -100); + trust->darkres = (uint16)((Sql_GetFloatData(SqlHandle, 40) - 1) * -100); g_PTrustList.push_back(trust); } @@ -240,20 +238,89 @@ void FreeTrustList() g_PTrustIDList.clear(); } +void SpawnTrust(CCharEntity* PMaster, uint32 TrustID) +{ + if (PMaster->PParty == nullptr) + { + PMaster->PParty = new CParty(PMaster); + } + + CTrustEntity* PTrust = LoadTrust(PMaster, TrustID); + PMaster->PTrusts.insert(PMaster->PTrusts.end(), PTrust); + PMaster->StatusEffectContainer->CopyConfrontationEffect(PTrust); + PMaster->loc.zone->InsertTRUST(PTrust); + PTrust->Spawn(); + + PMaster->PParty->ReloadParty(); +} + +CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID) +{ + CTrustEntity* PTrust = new CTrustEntity(PMaster); + Trust_t* trustData = new Trust_t(); + + for (uint32 index = 0; index < g_PTrustList.size(); index++) + { + if (g_PTrustList.at(index)->trustID == TrustID) + { + trustData = g_PTrustList.at(index); + break; + } + } + + PTrust->loc = PMaster->loc; + PTrust->m_OwnerID.id = PMaster->id; + PTrust->m_OwnerID.targid = PMaster->targid; + + // spawn me randomly around master + PTrust->loc.p = nearPosition(PMaster->loc.p, CTrustController::SpawnDistance, (float)M_PI * tpzrand::GetRandomNumber(2.0f)); + PTrust->look = trustData->look; + PTrust->name = trustData->name; + + PTrust->packetName = trustData->packet_name; + PTrust->m_name_prefix = trustData->name_prefix; + PTrust->m_Family = trustData->m_Family; + PTrust->m_MobSkillList = trustData->m_MobSkillList; + PTrust->HPscale = trustData->HPscale; + PTrust->MPscale = trustData->MPscale; + PTrust->speed = trustData->speed; + PTrust->m_HasSpellScript = trustData->hasSpellScript; + PTrust->m_TrustID = trustData->trustID; + PTrust->status = STATUS_NORMAL; + PTrust->m_ModelSize = trustData->size; + PTrust->m_EcoSystem = trustData->EcoSystem; + + PTrust->SetMJob(trustData->mJob); + PTrust->SetSJob(trustData->sJob); + + ((CItemWeapon*)PTrust->m_Weapons[SLOT_MAIN])->setDelay((trustData->cmbDelay * 1000) / 60); + ((CItemWeapon*)PTrust->m_Weapons[SLOT_MAIN])->setBaseDelay((trustData->cmbDelay * 1000) / 60); + + // assume level matches master + PTrust->SetMLevel(PMaster->GetMLevel()); + PTrust->SetSLevel(PMaster->GetSLevel()); + + LoadTrustStatsAndSkills(PTrust); + mobutils::SetSpellList(PTrust, trustData->spellList); + + return PTrust; +} + void LoadTrustStatsAndSkills(CTrustEntity* PTrust) { JOBTYPE mJob = PTrust->GetMJob(); JOBTYPE sJob = PTrust->GetSJob(); - uint8 mLvl = PTrust->GetMLevel(); - uint8 sLvl = PTrust->GetSLevel(); + uint8 mLvl = PTrust->GetMLevel(); + uint8 sLvl = PTrust->GetSLevel(); float growth = 1.06f; - float base = 18.0f; + float base = 18.0f; PTrust->health.maxhp = (int16)(base * pow(mLvl, growth) * PTrust->HPscale); bool hasMp = false; - switch (mJob) { + switch (mJob) + { case JOB_PLD: case JOB_WHM: case JOB_BLM: @@ -268,7 +335,8 @@ void LoadTrustStatsAndSkills(CTrustEntity* PTrust) break; } - switch (sJob) { + switch (sJob) + { case JOB_PLD: case JOB_WHM: case JOB_BLM: @@ -286,7 +354,7 @@ void LoadTrustStatsAndSkills(CTrustEntity* PTrust) if (hasMp) { PTrust->health.maxmp = (int16)(base * pow(mLvl, growth) * PTrust->MPscale); - } + } PTrust->health.tp = 0; PTrust->UpdateHealth(); @@ -391,68 +459,4 @@ void LoadTrustStatsAndSkills(CTrustEntity* PTrust) mobutils::SetupJob(PTrust); } - -void SpawnTrust(CCharEntity *PMaster, uint32 TrustID) -{ - if (PMaster->PParty == nullptr) - { - PMaster->PParty = new CParty(PMaster); - } - - CTrustEntity *PTrust = LoadTrust(PMaster, TrustID); - PMaster->PTrusts.insert(PMaster->PTrusts.end(), PTrust); - PMaster->StatusEffectContainer->CopyConfrontationEffect(PTrust); - PMaster->loc.zone->InsertTRUST(PTrust); - PTrust->Spawn(); - - PMaster->PParty->ReloadParty(); -} - -CTrustEntity* LoadTrust(CCharEntity *PMaster, uint32 TrustID) -{ - CTrustEntity *PTrust = new CTrustEntity(PMaster); - Trust_t *trustData = new Trust_t(); - - for (uint32 index = 0; index < g_PTrustList.size(); index++) - { - if (g_PTrustList.at(index)->trustID == TrustID) - { - trustData = g_PTrustList.at(index); - break; - } - } - - PTrust->loc = PMaster->loc; - PTrust->m_OwnerID.id = PMaster->id; - PTrust->m_OwnerID.targid = PMaster->targid; - - // spawn me randomly around master - PTrust->loc.p = nearPosition(PMaster->loc.p, CTrustController::SpawnDistance, (float)M_PI * tpzrand::GetRandomNumber(2.0f)); - PTrust->look = trustData->look; - PTrust->name = trustData->name; - - PTrust->packetName = trustData->packet_name; - PTrust->m_name_prefix = trustData->name_prefix; - PTrust->m_Family = trustData->m_Family; - PTrust->m_MobSkillList = trustData->m_MobSkillList; - PTrust->SetMJob(trustData->mJob); - PTrust->SetSJob(trustData->sJob); - PTrust->HPscale = trustData->HPscale; - PTrust->MPscale = trustData->MPscale; - PTrust->speed = trustData->speed; - PTrust->m_HasSpellScript = trustData->hasSpellScript; - PTrust->m_TrustID = trustData->trustID; - PTrust->status = STATUS_NORMAL; - PTrust->m_ModelSize = trustData->size; - PTrust->m_EcoSystem = trustData->EcoSystem; - - // assume level matches master - PTrust->SetMLevel(PMaster->GetMLevel()); - PTrust->SetSLevel(PMaster->GetSLevel()); - - LoadTrustStatsAndSkills(PTrust); - mobutils::SetSpellList(PTrust, trustData->spellList); - - return PTrust; -} }; // namespace trustutils diff --git a/src/map/utils/trustutils.h b/src/map/utils/trustutils.h index cb1aef722b7..d66985ec5f0 100644 --- a/src/map/utils/trustutils.h +++ b/src/map/utils/trustutils.h @@ -13,12 +13,12 @@ namespace trustutils void LoadTrustList(); void FreeTrustList(); - void SpawnTrust(CCharEntity *PMaster, uint32 TrustID); + void SpawnTrust(CCharEntity* PMaster, uint32 TrustID); // Internal void BuildTrust(uint32 TrustID); - CTrustEntity *LoadTrust(CCharEntity *PMaster, uint32 TrustID); - void LoadTrustStatsAndSkills(CTrustEntity *PTrust); + CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID); + void LoadTrustStatsAndSkills(CTrustEntity* PTrust); }; // namespace trustutils #endif From cfb014ba791884d24ba465fd59341bbbc43d2b85 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Sun, 22 Mar 2020 12:01:56 +0200 Subject: [PATCH 090/116] Remove fake party chat --- scripts/globals/spells/trust/shantotto.lua | 10 ------ scripts/globals/trust.lua | 36 ---------------------- 2 files changed, 46 deletions(-) diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index 0f8f44f6c47..a52614f567a 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -13,20 +13,10 @@ function onSpellCast(caster, target, spell) end function onMobSpawn(mob) - local messages = { - "It's far too late for your foes to make amends, and with me at your side, they'll meet untimely ends!", - { 904, "Ajido-Marujido, tell me the truth. Are you following my teachings, or are your techniques still uncouth?" }, - { 935, "Ah, look who it is--a presence most divine. But when it comes to true power, I'm the most sublime!" }, - { 952, "Ah, Koru-Moru, debtor extraordinaire. When it comes to running away, you've got a certain...flair." }, - { 989, "Oh dearie me, this one will need an overhaul once we return to the Manustery..."}, - } - tpz.trust.messageParty(mob, messages) end function onMobDespawn(mob) - tpz.trust.messageParty(mob, "I am hardly amazed at how well I've done, but I have to admit--it's been fun!") end function onMobDeath(mob) - tpz.trust.messageParty(mob, "I'd love to stay longer and enjoy this little party, but I've got a seminar to attend, and must not be tardy!") end diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index b93e885a0df..ae8aa3eeffc 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -75,39 +75,3 @@ tpz.trust.spawn = function(caster, spell) return 0 end - -tpz.trust.messageParty = function(trust, message) - local party = {} - local master = trust:getMaster() - party = master:getAlliance() - local pt_trusts = master:getPartyTrusts() - - -- Pick message from message object - local possible_messages = {} - if type(message) == "string" then - table.insert(possible_messages, message) - elseif type(message) == "table" then - for _, m in ipairs(message) do - if type(m) == "string" then - table.insert(possible_messages, m) - elseif type(m) == "table" then - local partner_trust_id = m[1] - local partner_trust_message = m[2] - for _, t in ipairs(pt_trusts) do - if t:getTrustID() == partner_trust_id then - table.insert(possible_messages, partner_trust_message) - end - end - end - end - end - - local final_message = possible_messages[math.random(#possible_messages)] - - for _, member in ipairs(party) do - if member:getZoneID() == trust:getZoneID() and member:isPC() then - -- TODO: Correct messaging - --member:PrintToPlayer(final_message, 4) - end - end -end From d8186884e424c714e62e21029edc8fab4bd437df Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Mon, 23 Mar 2020 17:03:11 +0200 Subject: [PATCH 091/116] Re-add Monberaux after confirming spell number from POLUtils --- sql/mob_pools.sql | 2 +- sql/spell_list.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index a6dfb26a240..fa587712652 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -6057,7 +6057,7 @@ INSERT INTO `mob_pools` VALUES (5995,'aatt','ArkTT',145,0x00002C0C00000000000000 INSERT INTO `mob_pools` VALUES (5996,'aagk','ArkGK',145,0x00002D0C00000000000000000000000000000000,12,14,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5997,'iroha','Iroha',145,0x0000270C00000000000000000000000000000000,4,12,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5998,'ygnas','Ygnas',145,0x00002E0C00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); --- Reserved for future Trust 5999 +INSERT INTO `mob_pools` VALUES (5999,'monberaux','Monberaux',145,0x0000260300000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -- Reserved for future Trust 6000 -- Reserved for future Trust 6001 -- Reserved for future Trust 6002 diff --git a/sql/spell_list.sql b/sql/spell_list.sql index 04a6eb8dee2..f9787f25557 100644 --- a/sql/spell_list.sql +++ b/sql/spell_list.sql @@ -964,7 +964,7 @@ INSERT INTO `spell_list` VALUES (995,'aatt',0x0101010101010101010101010101010101 INSERT INTO `spell_list` VALUES (996,'aagk',0x01010101010101010101010101010101010101010101,8,7,0,1,0,0,3000,24000,0,0,939,1500,0,0,1.00,0,0,0,0,NULL); INSERT INTO `spell_list` VALUES (997,'iroha',0x01010101010101010101010101010101010101010101,8,7,0,1,0,0,3000,24000,0,0,939,1500,0,0,1.00,0,0,0,0,NULL); INSERT INTO `spell_list` VALUES (998,'ygnas',0x01010101010101010101010101010101010101010101,8,7,0,1,0,0,3000,24000,0,0,939,1500,0,0,1.00,0,0,0,0,NULL); --- 999 +INSERT INTO `spell_list` VALUES (999,'monberaux',0x01010101010101010101010101010101010101010101,8,7,0,1,0,0,3000,24000,0,0,939,1500,0,0,1.00,0,0,0,0,NULL); -- 1000 -- 1001 -- 1002 From d9b607b629faee3b7dc69e5a140c3a6b62c3b237 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Mon, 23 Mar 2020 17:35:31 +0200 Subject: [PATCH 092/116] Add all remaining trust scripts --- scripts/globals/spells/trust/aaev.lua | 14 ++++++++++++++ scripts/globals/spells/trust/aagk.lua | 14 ++++++++++++++ scripts/globals/spells/trust/aahm.lua | 14 ++++++++++++++ scripts/globals/spells/trust/aamr.lua | 14 ++++++++++++++ scripts/globals/spells/trust/aatt.lua | 14 ++++++++++++++ scripts/globals/spells/trust/abenzio.lua | 14 ++++++++++++++ scripts/globals/spells/trust/abquhbah.lua | 14 ++++++++++++++ scripts/globals/spells/trust/adelheid.lua | 14 ++++++++++++++ scripts/globals/spells/trust/aldo_uc.lua | 14 ++++++++++++++ scripts/globals/spells/trust/amchuchu.lua | 14 ++++++++++++++ scripts/globals/spells/trust/apururu_uc.lua | 13 +++++++++++++ scripts/globals/spells/trust/arciela.lua | 13 +++++++++++++ scripts/globals/spells/trust/arciela_ii.lua | 13 +++++++++++++ scripts/globals/spells/trust/august.lua | 13 +++++++++++++ scripts/globals/spells/trust/ayame_uc.lua | 13 +++++++++++++ scripts/globals/spells/trust/babban.lua | 13 +++++++++++++ scripts/globals/spells/trust/balamor.lua | 13 +++++++++++++ scripts/globals/spells/trust/brygid.lua | 13 +++++++++++++ scripts/globals/spells/trust/chacharoon.lua | 13 +++++++++++++ scripts/globals/spells/trust/cornelia.lua | 13 +++++++++++++ scripts/globals/spells/trust/darrcuiln.lua | 13 +++++++++++++ scripts/globals/spells/trust/flaviria_uc.lua | 13 +++++++++++++ scripts/globals/spells/trust/halver.lua | 13 +++++++++++++ scripts/globals/spells/trust/i_shield_uc.lua | 13 +++++++++++++ scripts/globals/spells/trust/ingrid_ii.lua | 13 +++++++++++++ scripts/globals/spells/trust/iroha.lua | 13 +++++++++++++ scripts/globals/spells/trust/iroha_ii.lua | 13 +++++++++++++ scripts/globals/spells/trust/jakoh_uc.lua | 13 +++++++++++++ scripts/globals/spells/trust/kayeel-payeel.lua | 13 +++++++++++++ scripts/globals/spells/trust/king_of_hearts.lua | 13 +++++++++++++ scripts/globals/spells/trust/klara.lua | 13 +++++++++++++ scripts/globals/spells/trust/koru-moru.lua | 13 +++++++++++++ scripts/globals/spells/trust/kukki-chebukki.lua | 13 +++++++++++++ scripts/globals/spells/trust/kupofried.lua | 13 +++++++++++++ scripts/globals/spells/trust/kuyin_hathdenna.lua | 13 +++++++++++++ scripts/globals/spells/trust/leonoyne.lua | 13 +++++++++++++ scripts/globals/spells/trust/lhe_lhangavo.lua | 13 +++++++++++++ scripts/globals/spells/trust/lilisette.lua | 2 +- scripts/globals/spells/trust/lilisette_ii.lua | 13 +++++++++++++ scripts/globals/spells/trust/lion_ii.lua | 13 +++++++++++++ scripts/globals/spells/trust/makki-chebukki.lua | 13 +++++++++++++ scripts/globals/spells/trust/margret.lua | 13 +++++++++++++ scripts/globals/spells/trust/maximillian.lua | 13 +++++++++++++ scripts/globals/spells/trust/mayakov.lua | 13 +++++++++++++ scripts/globals/spells/trust/mildaurion.lua | 13 +++++++++++++ scripts/globals/spells/trust/morimar.lua | 13 +++++++++++++ scripts/globals/spells/trust/mumor_ii.lua | 13 +++++++++++++ scripts/globals/spells/trust/naja_uc.lua | 13 +++++++++++++ scripts/globals/spells/trust/nashmeira_ii.lua | 13 +++++++++++++ scripts/globals/spells/trust/pieuje_uc.lua | 13 +++++++++++++ scripts/globals/spells/trust/prishe_ii.lua | 13 +++++++++++++ scripts/globals/spells/trust/qultada.lua | 13 +++++++++++++ scripts/globals/spells/trust/rahal.lua | 13 +++++++++++++ scripts/globals/spells/trust/robel-akbel.lua | 13 +++++++++++++ scripts/globals/spells/trust/romaa_mihgo.lua | 13 +++++++++++++ scripts/globals/spells/trust/rongelouts.lua | 13 +++++++++++++ scripts/globals/spells/trust/rosulatia.lua | 13 +++++++++++++ scripts/globals/spells/trust/rughadjeen.lua | 13 +++++++++++++ scripts/globals/spells/trust/selh_teus.lua | 13 +++++++++++++ scripts/globals/spells/trust/sylvie_uc.lua | 13 +++++++++++++ scripts/globals/spells/trust/tenzen_ii.lua | 13 +++++++++++++ scripts/globals/spells/trust/teodor.lua | 13 +++++++++++++ scripts/globals/spells/trust/uka_totlihn.lua | 13 +++++++++++++ scripts/globals/spells/trust/ullegore.lua | 13 +++++++++++++ scripts/globals/spells/trust/ygnas.lua | 13 +++++++++++++ scripts/globals/spells/trust/yoran-oran_uc.lua | 13 +++++++++++++ 66 files changed, 856 insertions(+), 1 deletion(-) create mode 100644 scripts/globals/spells/trust/aaev.lua create mode 100644 scripts/globals/spells/trust/aagk.lua create mode 100644 scripts/globals/spells/trust/aahm.lua create mode 100644 scripts/globals/spells/trust/aamr.lua create mode 100644 scripts/globals/spells/trust/aatt.lua create mode 100644 scripts/globals/spells/trust/abenzio.lua create mode 100644 scripts/globals/spells/trust/abquhbah.lua create mode 100644 scripts/globals/spells/trust/adelheid.lua create mode 100644 scripts/globals/spells/trust/aldo_uc.lua create mode 100644 scripts/globals/spells/trust/amchuchu.lua create mode 100644 scripts/globals/spells/trust/apururu_uc.lua create mode 100644 scripts/globals/spells/trust/arciela.lua create mode 100644 scripts/globals/spells/trust/arciela_ii.lua create mode 100644 scripts/globals/spells/trust/august.lua create mode 100644 scripts/globals/spells/trust/ayame_uc.lua create mode 100644 scripts/globals/spells/trust/babban.lua create mode 100644 scripts/globals/spells/trust/balamor.lua create mode 100644 scripts/globals/spells/trust/brygid.lua create mode 100644 scripts/globals/spells/trust/chacharoon.lua create mode 100644 scripts/globals/spells/trust/cornelia.lua create mode 100644 scripts/globals/spells/trust/darrcuiln.lua create mode 100644 scripts/globals/spells/trust/flaviria_uc.lua create mode 100644 scripts/globals/spells/trust/halver.lua create mode 100644 scripts/globals/spells/trust/i_shield_uc.lua create mode 100644 scripts/globals/spells/trust/ingrid_ii.lua create mode 100644 scripts/globals/spells/trust/iroha.lua create mode 100644 scripts/globals/spells/trust/iroha_ii.lua create mode 100644 scripts/globals/spells/trust/jakoh_uc.lua create mode 100644 scripts/globals/spells/trust/kayeel-payeel.lua create mode 100644 scripts/globals/spells/trust/king_of_hearts.lua create mode 100644 scripts/globals/spells/trust/klara.lua create mode 100644 scripts/globals/spells/trust/koru-moru.lua create mode 100644 scripts/globals/spells/trust/kukki-chebukki.lua create mode 100644 scripts/globals/spells/trust/kupofried.lua create mode 100644 scripts/globals/spells/trust/kuyin_hathdenna.lua create mode 100644 scripts/globals/spells/trust/leonoyne.lua create mode 100644 scripts/globals/spells/trust/lhe_lhangavo.lua create mode 100644 scripts/globals/spells/trust/lilisette_ii.lua create mode 100644 scripts/globals/spells/trust/lion_ii.lua create mode 100644 scripts/globals/spells/trust/makki-chebukki.lua create mode 100644 scripts/globals/spells/trust/margret.lua create mode 100644 scripts/globals/spells/trust/maximillian.lua create mode 100644 scripts/globals/spells/trust/mayakov.lua create mode 100644 scripts/globals/spells/trust/mildaurion.lua create mode 100644 scripts/globals/spells/trust/morimar.lua create mode 100644 scripts/globals/spells/trust/mumor_ii.lua create mode 100644 scripts/globals/spells/trust/naja_uc.lua create mode 100644 scripts/globals/spells/trust/nashmeira_ii.lua create mode 100644 scripts/globals/spells/trust/pieuje_uc.lua create mode 100644 scripts/globals/spells/trust/prishe_ii.lua create mode 100644 scripts/globals/spells/trust/qultada.lua create mode 100644 scripts/globals/spells/trust/rahal.lua create mode 100644 scripts/globals/spells/trust/robel-akbel.lua create mode 100644 scripts/globals/spells/trust/romaa_mihgo.lua create mode 100644 scripts/globals/spells/trust/rongelouts.lua create mode 100644 scripts/globals/spells/trust/rosulatia.lua create mode 100644 scripts/globals/spells/trust/rughadjeen.lua create mode 100644 scripts/globals/spells/trust/selh_teus.lua create mode 100644 scripts/globals/spells/trust/sylvie_uc.lua create mode 100644 scripts/globals/spells/trust/tenzen_ii.lua create mode 100644 scripts/globals/spells/trust/teodor.lua create mode 100644 scripts/globals/spells/trust/uka_totlihn.lua create mode 100644 scripts/globals/spells/trust/ullegore.lua create mode 100644 scripts/globals/spells/trust/ygnas.lua create mode 100644 scripts/globals/spells/trust/yoran-oran_uc.lua diff --git a/scripts/globals/spells/trust/aaev.lua b/scripts/globals/spells/trust/aaev.lua new file mode 100644 index 00000000000..2b9ebe7286d --- /dev/null +++ b/scripts/globals/spells/trust/aaev.lua @@ -0,0 +1,14 @@ +----------------------------------------- +-- Trust: AAEV +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end + diff --git a/scripts/globals/spells/trust/aagk.lua b/scripts/globals/spells/trust/aagk.lua new file mode 100644 index 00000000000..cd8929bccaf --- /dev/null +++ b/scripts/globals/spells/trust/aagk.lua @@ -0,0 +1,14 @@ +----------------------------------------- +-- Trust: AAGK +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end + diff --git a/scripts/globals/spells/trust/aahm.lua b/scripts/globals/spells/trust/aahm.lua new file mode 100644 index 00000000000..18ec053a318 --- /dev/null +++ b/scripts/globals/spells/trust/aahm.lua @@ -0,0 +1,14 @@ +----------------------------------------- +-- Trust: AAHM +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end + diff --git a/scripts/globals/spells/trust/aamr.lua b/scripts/globals/spells/trust/aamr.lua new file mode 100644 index 00000000000..b0577c0459d --- /dev/null +++ b/scripts/globals/spells/trust/aamr.lua @@ -0,0 +1,14 @@ +----------------------------------------- +-- Trust: AAMR +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end + diff --git a/scripts/globals/spells/trust/aatt.lua b/scripts/globals/spells/trust/aatt.lua new file mode 100644 index 00000000000..aa04008a76d --- /dev/null +++ b/scripts/globals/spells/trust/aatt.lua @@ -0,0 +1,14 @@ +----------------------------------------- +-- Trust: AATT +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end + diff --git a/scripts/globals/spells/trust/abenzio.lua b/scripts/globals/spells/trust/abenzio.lua new file mode 100644 index 00000000000..eea37bd391a --- /dev/null +++ b/scripts/globals/spells/trust/abenzio.lua @@ -0,0 +1,14 @@ +----------------------------------------- +-- Trust: Abenzio +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end + diff --git a/scripts/globals/spells/trust/abquhbah.lua b/scripts/globals/spells/trust/abquhbah.lua new file mode 100644 index 00000000000..fefb2dc3d5c --- /dev/null +++ b/scripts/globals/spells/trust/abquhbah.lua @@ -0,0 +1,14 @@ +----------------------------------------- +-- Trust: Abquhbah +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end + diff --git a/scripts/globals/spells/trust/adelheid.lua b/scripts/globals/spells/trust/adelheid.lua new file mode 100644 index 00000000000..c7e695084c3 --- /dev/null +++ b/scripts/globals/spells/trust/adelheid.lua @@ -0,0 +1,14 @@ +----------------------------------------- +-- Trust: Adelheid +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end + diff --git a/scripts/globals/spells/trust/aldo_uc.lua b/scripts/globals/spells/trust/aldo_uc.lua new file mode 100644 index 00000000000..a3f50669564 --- /dev/null +++ b/scripts/globals/spells/trust/aldo_uc.lua @@ -0,0 +1,14 @@ +----------------------------------------- +-- Trust: Aldo UC +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end + diff --git a/scripts/globals/spells/trust/amchuchu.lua b/scripts/globals/spells/trust/amchuchu.lua new file mode 100644 index 00000000000..2e999032eb5 --- /dev/null +++ b/scripts/globals/spells/trust/amchuchu.lua @@ -0,0 +1,14 @@ +----------------------------------------- +-- Trust: Amchuchu +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end + diff --git a/scripts/globals/spells/trust/apururu_uc.lua b/scripts/globals/spells/trust/apururu_uc.lua new file mode 100644 index 00000000000..d7df2a90048 --- /dev/null +++ b/scripts/globals/spells/trust/apururu_uc.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Apururu UC +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/arciela.lua b/scripts/globals/spells/trust/arciela.lua new file mode 100644 index 00000000000..9b6102e2704 --- /dev/null +++ b/scripts/globals/spells/trust/arciela.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Arciela +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/arciela_ii.lua b/scripts/globals/spells/trust/arciela_ii.lua new file mode 100644 index 00000000000..a18b62a8e74 --- /dev/null +++ b/scripts/globals/spells/trust/arciela_ii.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Balamor +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/august.lua b/scripts/globals/spells/trust/august.lua new file mode 100644 index 00000000000..6cfd75267f7 --- /dev/null +++ b/scripts/globals/spells/trust/august.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: August +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/ayame_uc.lua b/scripts/globals/spells/trust/ayame_uc.lua new file mode 100644 index 00000000000..f9cbc692817 --- /dev/null +++ b/scripts/globals/spells/trust/ayame_uc.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Ayame UC +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/babban.lua b/scripts/globals/spells/trust/babban.lua new file mode 100644 index 00000000000..905b6d526ff --- /dev/null +++ b/scripts/globals/spells/trust/babban.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Babban +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/balamor.lua b/scripts/globals/spells/trust/balamor.lua new file mode 100644 index 00000000000..aacbf93b4bf --- /dev/null +++ b/scripts/globals/spells/trust/balamor.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Ayame +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/brygid.lua b/scripts/globals/spells/trust/brygid.lua new file mode 100644 index 00000000000..b2b7c73dc89 --- /dev/null +++ b/scripts/globals/spells/trust/brygid.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Brygid +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/chacharoon.lua b/scripts/globals/spells/trust/chacharoon.lua new file mode 100644 index 00000000000..79527e825df --- /dev/null +++ b/scripts/globals/spells/trust/chacharoon.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Chacharoon +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/cornelia.lua b/scripts/globals/spells/trust/cornelia.lua new file mode 100644 index 00000000000..e89562f1eee --- /dev/null +++ b/scripts/globals/spells/trust/cornelia.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Cornelia +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/darrcuiln.lua b/scripts/globals/spells/trust/darrcuiln.lua new file mode 100644 index 00000000000..9b4e6ae37b2 --- /dev/null +++ b/scripts/globals/spells/trust/darrcuiln.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Darrcuiln +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/flaviria_uc.lua b/scripts/globals/spells/trust/flaviria_uc.lua new file mode 100644 index 00000000000..12f7538b5c5 --- /dev/null +++ b/scripts/globals/spells/trust/flaviria_uc.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Flaviria UC +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/halver.lua b/scripts/globals/spells/trust/halver.lua new file mode 100644 index 00000000000..f2eaf9cd928 --- /dev/null +++ b/scripts/globals/spells/trust/halver.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Halver +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/i_shield_uc.lua b/scripts/globals/spells/trust/i_shield_uc.lua new file mode 100644 index 00000000000..57b2589ba1a --- /dev/null +++ b/scripts/globals/spells/trust/i_shield_uc.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Invincible Shield UC +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/ingrid_ii.lua b/scripts/globals/spells/trust/ingrid_ii.lua new file mode 100644 index 00000000000..7cab47507f7 --- /dev/null +++ b/scripts/globals/spells/trust/ingrid_ii.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Ingrid II +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/iroha.lua b/scripts/globals/spells/trust/iroha.lua new file mode 100644 index 00000000000..7811b451370 --- /dev/null +++ b/scripts/globals/spells/trust/iroha.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Iroha +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/iroha_ii.lua b/scripts/globals/spells/trust/iroha_ii.lua new file mode 100644 index 00000000000..57ce51af1a4 --- /dev/null +++ b/scripts/globals/spells/trust/iroha_ii.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Iroha II +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/jakoh_uc.lua b/scripts/globals/spells/trust/jakoh_uc.lua new file mode 100644 index 00000000000..6ea62417c47 --- /dev/null +++ b/scripts/globals/spells/trust/jakoh_uc.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Jakoh Wahcondalo UC +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/kayeel-payeel.lua b/scripts/globals/spells/trust/kayeel-payeel.lua new file mode 100644 index 00000000000..5f80adbd70c --- /dev/null +++ b/scripts/globals/spells/trust/kayeel-payeel.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Kayeel-Payeel +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/king_of_hearts.lua b/scripts/globals/spells/trust/king_of_hearts.lua new file mode 100644 index 00000000000..5fa496304a5 --- /dev/null +++ b/scripts/globals/spells/trust/king_of_hearts.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: King of Hearts +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/klara.lua b/scripts/globals/spells/trust/klara.lua new file mode 100644 index 00000000000..8c7d13207e0 --- /dev/null +++ b/scripts/globals/spells/trust/klara.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Klara +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/koru-moru.lua b/scripts/globals/spells/trust/koru-moru.lua new file mode 100644 index 00000000000..38d4584fa8f --- /dev/null +++ b/scripts/globals/spells/trust/koru-moru.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Koru-Moru +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/kukki-chebukki.lua b/scripts/globals/spells/trust/kukki-chebukki.lua new file mode 100644 index 00000000000..d662ca69344 --- /dev/null +++ b/scripts/globals/spells/trust/kukki-chebukki.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Kukki-Chebukki +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/kupofried.lua b/scripts/globals/spells/trust/kupofried.lua new file mode 100644 index 00000000000..dec80bb7ceb --- /dev/null +++ b/scripts/globals/spells/trust/kupofried.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Kupofried +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/kuyin_hathdenna.lua b/scripts/globals/spells/trust/kuyin_hathdenna.lua new file mode 100644 index 00000000000..dbfaa70c509 --- /dev/null +++ b/scripts/globals/spells/trust/kuyin_hathdenna.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Kutin Hathdenna +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/leonoyne.lua b/scripts/globals/spells/trust/leonoyne.lua new file mode 100644 index 00000000000..0af4d148752 --- /dev/null +++ b/scripts/globals/spells/trust/leonoyne.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Leonoyne +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/lhe_lhangavo.lua b/scripts/globals/spells/trust/lhe_lhangavo.lua new file mode 100644 index 00000000000..25418bc7e93 --- /dev/null +++ b/scripts/globals/spells/trust/lhe_lhangavo.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Lhe Lhangavo +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/lilisette.lua b/scripts/globals/spells/trust/lilisette.lua index db6605f6470..8b7837f583a 100644 --- a/scripts/globals/spells/trust/lilisette.lua +++ b/scripts/globals/spells/trust/lilisette.lua @@ -1,5 +1,5 @@ ----------------------------------------- --- Trust: lilisette +-- Trust: Lilisette ----------------------------------------- require("scripts/globals/trust") ----------------------------------------- diff --git a/scripts/globals/spells/trust/lilisette_ii.lua b/scripts/globals/spells/trust/lilisette_ii.lua new file mode 100644 index 00000000000..43a81d7afec --- /dev/null +++ b/scripts/globals/spells/trust/lilisette_ii.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Lilisette II +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/lion_ii.lua b/scripts/globals/spells/trust/lion_ii.lua new file mode 100644 index 00000000000..208790b4d89 --- /dev/null +++ b/scripts/globals/spells/trust/lion_ii.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Lion II +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/makki-chebukki.lua b/scripts/globals/spells/trust/makki-chebukki.lua new file mode 100644 index 00000000000..ab1e0b86892 --- /dev/null +++ b/scripts/globals/spells/trust/makki-chebukki.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Makki-Chebukki +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/margret.lua b/scripts/globals/spells/trust/margret.lua new file mode 100644 index 00000000000..29bfcace6ca --- /dev/null +++ b/scripts/globals/spells/trust/margret.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Margret +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/maximillian.lua b/scripts/globals/spells/trust/maximillian.lua new file mode 100644 index 00000000000..9efed4b8fa8 --- /dev/null +++ b/scripts/globals/spells/trust/maximillian.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Maximillian +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/mayakov.lua b/scripts/globals/spells/trust/mayakov.lua new file mode 100644 index 00000000000..aa9070d9b9d --- /dev/null +++ b/scripts/globals/spells/trust/mayakov.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Mayakov +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/mildaurion.lua b/scripts/globals/spells/trust/mildaurion.lua new file mode 100644 index 00000000000..555d937ed82 --- /dev/null +++ b/scripts/globals/spells/trust/mildaurion.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Mildaurion +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/morimar.lua b/scripts/globals/spells/trust/morimar.lua new file mode 100644 index 00000000000..653f9558e5c --- /dev/null +++ b/scripts/globals/spells/trust/morimar.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Morimar +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/mumor_ii.lua b/scripts/globals/spells/trust/mumor_ii.lua new file mode 100644 index 00000000000..8674c3a87ef --- /dev/null +++ b/scripts/globals/spells/trust/mumor_ii.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Mumor II +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/naja_uc.lua b/scripts/globals/spells/trust/naja_uc.lua new file mode 100644 index 00000000000..3623a9cf25a --- /dev/null +++ b/scripts/globals/spells/trust/naja_uc.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Naja Salaheem UC +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/nashmeira_ii.lua b/scripts/globals/spells/trust/nashmeira_ii.lua new file mode 100644 index 00000000000..c85431e65fc --- /dev/null +++ b/scripts/globals/spells/trust/nashmeira_ii.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Nashmeira II +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/pieuje_uc.lua b/scripts/globals/spells/trust/pieuje_uc.lua new file mode 100644 index 00000000000..f7c70e2e9dc --- /dev/null +++ b/scripts/globals/spells/trust/pieuje_uc.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Pieuje UC +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/prishe_ii.lua b/scripts/globals/spells/trust/prishe_ii.lua new file mode 100644 index 00000000000..cce118d3858 --- /dev/null +++ b/scripts/globals/spells/trust/prishe_ii.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Prishe II +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/qultada.lua b/scripts/globals/spells/trust/qultada.lua new file mode 100644 index 00000000000..e7a586c4492 --- /dev/null +++ b/scripts/globals/spells/trust/qultada.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Qultada +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/rahal.lua b/scripts/globals/spells/trust/rahal.lua new file mode 100644 index 00000000000..156b7bf189a --- /dev/null +++ b/scripts/globals/spells/trust/rahal.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Rahal +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/robel-akbel.lua b/scripts/globals/spells/trust/robel-akbel.lua new file mode 100644 index 00000000000..0a6ff40589b --- /dev/null +++ b/scripts/globals/spells/trust/robel-akbel.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Robel-Akbel +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/romaa_mihgo.lua b/scripts/globals/spells/trust/romaa_mihgo.lua new file mode 100644 index 00000000000..15f0b32efc2 --- /dev/null +++ b/scripts/globals/spells/trust/romaa_mihgo.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Romaa Mihgo +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/rongelouts.lua b/scripts/globals/spells/trust/rongelouts.lua new file mode 100644 index 00000000000..e3500e679b3 --- /dev/null +++ b/scripts/globals/spells/trust/rongelouts.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Rongelouts +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/rosulatia.lua b/scripts/globals/spells/trust/rosulatia.lua new file mode 100644 index 00000000000..97df95144f2 --- /dev/null +++ b/scripts/globals/spells/trust/rosulatia.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Rosulatia +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/rughadjeen.lua b/scripts/globals/spells/trust/rughadjeen.lua new file mode 100644 index 00000000000..8a7bed72e5c --- /dev/null +++ b/scripts/globals/spells/trust/rughadjeen.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Rughadjeen +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/selh_teus.lua b/scripts/globals/spells/trust/selh_teus.lua new file mode 100644 index 00000000000..0ce5092546a --- /dev/null +++ b/scripts/globals/spells/trust/selh_teus.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Selh'teus +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/sylvie_uc.lua b/scripts/globals/spells/trust/sylvie_uc.lua new file mode 100644 index 00000000000..1a433d07a12 --- /dev/null +++ b/scripts/globals/spells/trust/sylvie_uc.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Sylvie UC +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/tenzen_ii.lua b/scripts/globals/spells/trust/tenzen_ii.lua new file mode 100644 index 00000000000..109079bb071 --- /dev/null +++ b/scripts/globals/spells/trust/tenzen_ii.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Tenzen II +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/teodor.lua b/scripts/globals/spells/trust/teodor.lua new file mode 100644 index 00000000000..e446c62bda1 --- /dev/null +++ b/scripts/globals/spells/trust/teodor.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Teodor +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/uka_totlihn.lua b/scripts/globals/spells/trust/uka_totlihn.lua new file mode 100644 index 00000000000..0225c5edd33 --- /dev/null +++ b/scripts/globals/spells/trust/uka_totlihn.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Uka Totlihn +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/ullegore.lua b/scripts/globals/spells/trust/ullegore.lua new file mode 100644 index 00000000000..c604f76010d --- /dev/null +++ b/scripts/globals/spells/trust/ullegore.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Ullegore +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/ygnas.lua b/scripts/globals/spells/trust/ygnas.lua new file mode 100644 index 00000000000..1616fd29df5 --- /dev/null +++ b/scripts/globals/spells/trust/ygnas.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Ygnas +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell, 1010) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end diff --git a/scripts/globals/spells/trust/yoran-oran_uc.lua b/scripts/globals/spells/trust/yoran-oran_uc.lua new file mode 100644 index 00000000000..bb3a2f2c143 --- /dev/null +++ b/scripts/globals/spells/trust/yoran-oran_uc.lua @@ -0,0 +1,13 @@ +----------------------------------------- +-- Trust: Yoran-Oran UC +----------------------------------------- +require("scripts/globals/trust") +----------------------------------------- + +function onMagicCastingCheck(caster, target, spell) + return tpz.trust.canCast(caster, spell) +end + +function onSpellCast(caster, target, spell) + return tpz.trust.spawn(caster, spell) +end From b92b5ac5fafab89f9a8acc46ce0d4556fd3316d6 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Mon, 23 Mar 2020 17:55:09 +0200 Subject: [PATCH 093/116] Update scripts, rename --- scripts/commands/addalltrusts.lua | 6 +++--- .../spells/trust/{maximillian.lua => maximilian.lua} | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) rename scripts/globals/spells/trust/{maximillian.lua => maximilian.lua} (94%) diff --git a/scripts/commands/addalltrusts.lua b/scripts/commands/addalltrusts.lua index 62dc81ec364..eb937863dc2 100644 --- a/scripts/commands/addalltrusts.lua +++ b/scripts/commands/addalltrusts.lua @@ -20,8 +20,8 @@ function onTrigger(player, target) 896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920, 921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945, 946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970, - 971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,1004,1005,1006,1007,1008,1009, - 1010,1011,1012,1013,1014,1015,1016 + 971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995, + 996,997,998,999,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019 } -- validate target @@ -45,5 +45,5 @@ function onTrigger(player, target) end targ:addSpell(ValidSpells[i], silent, save) end - player:PrintToPlayer(string.format("%s now has all spells.", targ:getName())) + player:PrintToPlayer(string.format("%s now has all trusts.", targ:getName())) end diff --git a/scripts/globals/spells/trust/maximillian.lua b/scripts/globals/spells/trust/maximilian.lua similarity index 94% rename from scripts/globals/spells/trust/maximillian.lua rename to scripts/globals/spells/trust/maximilian.lua index 9efed4b8fa8..a990f31a0c0 100644 --- a/scripts/globals/spells/trust/maximillian.lua +++ b/scripts/globals/spells/trust/maximilian.lua @@ -1,5 +1,5 @@ ----------------------------------------- --- Trust: Maximillian +-- Trust: Maximilian ----------------------------------------- require("scripts/globals/trust") ----------------------------------------- From 62b2e98cf3861a0ca3e4eec1a624fd0611cb8d59 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Mon, 23 Mar 2020 18:15:11 +0200 Subject: [PATCH 094/116] Maybe fix extra spell --- scripts/commands/addalltrusts.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/commands/addalltrusts.lua b/scripts/commands/addalltrusts.lua index eb937863dc2..9437b892ed8 100644 --- a/scripts/commands/addalltrusts.lua +++ b/scripts/commands/addalltrusts.lua @@ -21,7 +21,7 @@ function onTrigger(player, target) 921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945, 946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970, 971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995, - 996,997,998,999,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019 + 996,997,998,999,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019, } -- validate target From 4a52f9fbf4e4900ef5a1f00650e8236930fd2988 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Mon, 23 Mar 2020 22:17:38 +0200 Subject: [PATCH 095/116] Remove Trust: Cornelia (1003) - she was removed May 2018 --- scripts/commands/addalltrusts.lua | 2 +- scripts/globals/spells/trust/cornelia.lua | 13 ------------- sql/mob_pools.sql | 2 +- sql/spell_list.sql | 2 +- 4 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 scripts/globals/spells/trust/cornelia.lua diff --git a/scripts/commands/addalltrusts.lua b/scripts/commands/addalltrusts.lua index 9437b892ed8..f5dcc5d8b49 100644 --- a/scripts/commands/addalltrusts.lua +++ b/scripts/commands/addalltrusts.lua @@ -21,7 +21,7 @@ function onTrigger(player, target) 921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945, 946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970, 971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995, - 996,997,998,999,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019, + 996,997,998,999,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019 } -- validate target diff --git a/scripts/globals/spells/trust/cornelia.lua b/scripts/globals/spells/trust/cornelia.lua deleted file mode 100644 index e89562f1eee..00000000000 --- a/scripts/globals/spells/trust/cornelia.lua +++ /dev/null @@ -1,13 +0,0 @@ ------------------------------------------ --- Trust: Cornelia ------------------------------------------ -require("scripts/globals/trust") ------------------------------------------ - -function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) -end - -function onSpellCast(caster, target, spell) - return tpz.trust.spawn(caster, spell) -end diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index fa587712652..15ed5809c91 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -6061,7 +6061,7 @@ INSERT INTO `mob_pools` VALUES (5999,'monberaux','Monberaux',145,0x0000260300000 -- Reserved for future Trust 6000 -- Reserved for future Trust 6001 -- Reserved for future Trust 6002 -INSERT INTO `mob_pools` VALUES (6003,'cornelia','Cornelia',145,0x00002F0C00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +-- INSERT INTO `mob_pools` VALUES (6003,'cornelia','Cornelia',145,0x00002F0C00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (6004,'excenmille_s','Excenmille',145,0x0000EC0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (6005,'ayame_uc','Ayame',145,0x0000F70B00000000000000000000000000000000,12,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (6006,'maat_uc','Maat',145,0x0000F80B00000000000000000000000000000000,2,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); diff --git a/sql/spell_list.sql b/sql/spell_list.sql index f9787f25557..2558bcbfbf7 100644 --- a/sql/spell_list.sql +++ b/sql/spell_list.sql @@ -968,7 +968,7 @@ INSERT INTO `spell_list` VALUES (999,'monberaux',0x01010101010101010101010101010 -- 1000 -- 1001 -- 1002 -INSERT INTO `spell_list` VALUES (1003,'cornelia',0x01010101010101010101010101010101010101010101,8,7,0,1,0,0,3000,24000,0,0,939,1500,0,0,1.00,0,0,0,0,NULL); +-- 1003 (Trust: Cornelia, has been removed May 2018) INSERT INTO `spell_list` VALUES (1004,'excenmille_s',0x01010101010101010101010101010101010101010101,8,7,0,1,0,0,3000,24000,0,0,939,1500,0,0,1.00,0,0,0,0,NULL); INSERT INTO `spell_list` VALUES (1005,'ayame_uc',0x01010101010101010101010101010101010101010101,8,7,0,1,0,0,3000,24000,0,0,939,1500,0,0,1.00,0,0,0,0,NULL); INSERT INTO `spell_list` VALUES (1006,'maat_uc',0x01010101010101010101010101010101010101010101,8,7,0,1,0,0,3000,24000,0,0,939,1500,0,0,1.00,0,0,0,0,NULL); From 4708c3205ac9509c971a9001d8327e82f327469a Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 24 Mar 2020 11:18:45 +0200 Subject: [PATCH 096/116] Clear trusts on death --- src/map/entities/charentity.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/map/entities/charentity.cpp b/src/map/entities/charentity.cpp index 1a9ca3db236..c27f8927a3b 100644 --- a/src/map/entities/charentity.cpp +++ b/src/map/entities/charentity.cpp @@ -509,10 +509,6 @@ uint8 CCharEntity::TrustPartyPosition(CTrustEntity* PTrust) void CCharEntity::ClearTrusts() { - if (PTrusts.empty()) - { - return; - } for (auto trust : PTrusts) { trust->PAI->Despawn(); @@ -1696,6 +1692,7 @@ void CCharEntity::Die(duration _duration) m_deathSyncTime = server_clock::now() + death_update_frequency; PAI->ClearStateStack(); PAI->Internal_Die(_duration); + this->ClearTrusts(); // reraise modifiers if (this->getMod(Mod::RERAISE_I) > 0) From 5d7455051ba0ba8ec7a869635badc6da36250d18 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 24 Mar 2020 11:58:52 +0200 Subject: [PATCH 097/116] Remove unused method --- src/map/entities/charentity.cpp | 12 ------------ src/map/entities/charentity.h | 1 - src/map/utils/trustutils.cpp | 2 ++ 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/map/entities/charentity.cpp b/src/map/entities/charentity.cpp index c27f8927a3b..0711461f769 100644 --- a/src/map/entities/charentity.cpp +++ b/src/map/entities/charentity.cpp @@ -495,18 +495,6 @@ void CCharEntity::RemoveTrust(CTrustEntity* PTrust) } } -uint8 CCharEntity::TrustPartyPosition(CTrustEntity* PTrust) -{ - for (uint8 i = 0; i < PTrusts.size(); i++) - { - if (PTrusts.at(i)->id == PTrust->id) - { - return i; - } - } - return 0; -} - void CCharEntity::ClearTrusts() { for (auto trust : PTrusts) diff --git a/src/map/entities/charentity.h b/src/map/entities/charentity.h index 3262b99815f..7cb375ae634 100644 --- a/src/map/entities/charentity.h +++ b/src/map/entities/charentity.h @@ -325,7 +325,6 @@ class CCharEntity : public CBattleEntity bool ReloadParty(); void ClearTrusts(); void RemoveTrust(CTrustEntity*); - uint8 TrustPartyPosition(CTrustEntity* PTrust); virtual void Tick(time_point) override; void PostTick() override; diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index bc3765b1715..02e62f3ce85 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -313,6 +313,8 @@ void LoadTrustStatsAndSkills(CTrustEntity* PTrust) uint8 mLvl = PTrust->GetMLevel(); uint8 sLvl = PTrust->GetSLevel(); + // TODO: HP/MP should take into account family, job, etc. + float growth = 1.06f; float base = 18.0f; From db0ce114d740ee3750f7b74c6b43f57ca7137e55 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 24 Mar 2020 12:31:58 +0200 Subject: [PATCH 098/116] Add and use MasterHasTopEnmity() --- src/map/ai/controllers/trust_controller.cpp | 17 +++++++++++++++-- src/map/ai/controllers/trust_controller.h | 2 ++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index 4f5c96fd01e..06f96099e29 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -111,7 +111,7 @@ void CTrustController::DoCombatTick(time_point tick) void CTrustController::DoRoamTick(time_point tick) { - if (POwner->PMaster->PAI->IsEngaged()) + if (POwner->PMaster->PAI->IsEngaged() && MasterHasTopEnmity()) { POwner->PAI->Internal_Engage(POwner->PMaster->GetBattleTargetID()); } @@ -138,4 +138,17 @@ bool CTrustController::Ability(uint16 targid, uint16 abilityid) return POwner->PAI->Internal_Ability(targid, abilityid); } return false; -} \ No newline at end of file +} + +bool CTrustController::MasterHasTopEnmity() +{ + auto PMob = dynamic_cast(POwner->PMaster->GetBattleTarget()); + if (PMob) + { + return PMob->PEnmityContainer->GetHighestEnmity() == POwner->PMaster; + } + else + { + return false; + } +} diff --git a/src/map/ai/controllers/trust_controller.h b/src/map/ai/controllers/trust_controller.h index d0c9957a456..1a1df3d32c0 100644 --- a/src/map/ai/controllers/trust_controller.h +++ b/src/map/ai/controllers/trust_controller.h @@ -44,6 +44,8 @@ class CTrustController : public CMobController private: void DoCombatTick(time_point tick) override; void DoRoamTick(time_point tick) override; + + bool MasterHasTopEnmity(); }; #endif // _TRUSTCONTROLLER \ No newline at end of file From 4f2506edc79c3526db54ebd8cdf271907079ad86 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 24 Mar 2020 16:28:05 +0200 Subject: [PATCH 099/116] Audit mob families of all trusts --- sql/mob_pools.sql | 180 +++++++++++++++++++++++----------------------- 1 file changed, 90 insertions(+), 90 deletions(-) diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index 15ed5809c91..e7d52f71194 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5959,124 +5959,124 @@ INSERT INTO `mob_pools` VALUES (5897,'naji','Naji',149,0x0000B90B000000000000000 INSERT INTO `mob_pools` VALUES (5898,'kupipi','Kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,0,312,1,0,0); INSERT INTO `mob_pools` VALUES (5899,'excenmille','Excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,309,1,0,0); INSERT INTO `mob_pools` VALUES (5900,'ayame','Ayame',149,0x0000BC0B00000000000000000000000000000000,12,0,10,440,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5901,'nanaa_mihgo','NanaaMihgo',152,0x0000BD0B00000000000000000000000000000000,6,0,2,190,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5901,'nanaa_mihgo','NanaaMihgo',151,0x0000BD0B00000000000000000000000000000000,6,0,2,190,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5902,'curilla','Curilla',145,0x0000BE0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,308,1,0,0); INSERT INTO `mob_pools` VALUES (5903,'volker','Volker',149,0x0000BF0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,8,1,0,0); INSERT INTO `mob_pools` VALUES (5904,'ajido-marujido','Ajido-Marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,0,311,1,0,0); INSERT INTO `mob_pools` VALUES (5905,'trion','Trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,310,1,0,0); -INSERT INTO `mob_pools` VALUES (5906,'zeid','Zeid',145,0x0000C20B00000000000000000000000000000000,8,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5907,'lion','Lion',145,0x0000C30B00000000000000000000000000000000,6,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5908,'tenzen','Tenzen',145,0x0000C40B00000000000000000000000000000000,12,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5909,'mihli_aliapoh','MihliAliapoh',145,0x0000C50B00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5906,'zeid','Zeid',146,0x0000C20B00000000000000000000000000000000,8,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5907,'lion','Lion',149,0x0000C30B00000000000000000000000000000000,6,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5908,'tenzen','Tenzen',149,0x0000C40B00000000000000000000000000000000,12,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5909,'mihli_aliapoh','MihliAliapoh',151,0x0000C50B00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5910,'valaineral','Valaineral',145,0x0000C60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5911,'joachim','Joachim',145,0x0000C70B00000000000000000000000000000000,10,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5912,'naja_salaheem','NajaSalaheem',145,0x0000C80B00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5911,'joachim','Joachim',149,0x0000C70B00000000000000000000000000000000,10,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5912,'naja_salaheem','NajaSalaheem',151,0x0000C80B00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5913,'prishe','Prishe',145,0x0000C90B00000000000000000000000000000000,2,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5914,'ulmia','Ulmia',145,0x0000CA0B00000000000000000000000000000000,10,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5915,'shikaree_z','ShikareeZ',145,0x0000CB0B00000000000000000000000000000000,14,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5916,'cherukiki','Cherukiki',145,0x0000CC0B00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5917,'iron_eater','IronEater',145,0x0000CD0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5918,'gessho','Gessho',145,0x0000CE0B00000000000000000000000000000000,13,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5919,'gadalar','Gadalar',145,0x0000CF0B00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5915,'shikaree_z','ShikareeZ',151,0x0000CB0B00000000000000000000000000000000,14,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5916,'cherukiki','Cherukiki',153,0x0000CC0B00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5917,'iron_eater','IronEater',146,0x0000CD0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5918,'gessho','Gessho',270,0x0000CE0B00000000000000000000000000000000,13,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5919,'gadalar','Gadalar',149,0x0000CF0B00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5920,'rainemard','Rainemard',145,0x0000D00B00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5921,'ingrid','Ingrid',145,0x0000D10B00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5922,'lehko_habhoka','LehkoHabhoka',145,0x0000D20B00000000000000000000000000000000,6,4,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5923,'nashmeira','Nashmeira',145,0x0000D30B00000000000000000000000000000000,18,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5924,'zazarg','Zazarg',145,0x0000D40B00000000000000000000000000000000,2,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5925,'ovjang','Ovjang',145,0x0000D50B00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5926,'mnejing','Mnejing',145,0x0000D60B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5927,'sakura','Sakura',145,0x0000D70B00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5921,'ingrid','Ingrid',149,0x0000D10B00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5922,'lehko_habhoka','LehkoHabhoka',151,0x0000D20B00000000000000000000000000000000,6,4,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5923,'nashmeira','Nashmeira',149,0x0000D30B00000000000000000000000000000000,18,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5924,'zazarg','Zazarg',146,0x0000D40B00000000000000000000000000000000,2,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5925,'ovjang','Ovjang',366,0x0000D50B00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5926,'mnejing','Mnejing',364,0x0000D60B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5927,'sakura','Sakura',55,0x0000D70B00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5928,'luzaf','Luzaf',145,0x0000D80B00000000000000000000000000000000,17,13,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5929,'najelith','Najelith',145,0x0000D90B00000000000000000000000000000000,11,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5930,'aldo','Aldo',145,0x0000DA0B00000000000000000000000000000000,6,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5931,'moogle','Moogle',145,0x0000DB0B00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5932,'fablinix','Fablinix',145,0x0000DC0B00000000000000000000000000000000,6,4,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5933,'maat','Maat',145,0x0000DD0B00000000000000000000000000000000,2,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5934,'d_shantotto','D.Shantotto',145,0x0000DE0B00000000000000000000000000000000,4,8,3,240,100,0,0,0,0,0,0,32,0,3,0,0,313,1,0,0); -INSERT INTO `mob_pools` VALUES (5935,'star_sibyl','StarSibyl',145,0x0000DF0B00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5936,'karaha-baruha','Karaha-Baruha',145,0x0000E00B00000000000000000000000000000000,3,15,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5937,'cid','Cid',145,0x0000E10B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5938,'gilgamesh','Gilgamesh',145,0x0000E20B00000000000000000000000000000000,12,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5929,'najelith','Najelith',149,0x0000D90B00000000000000000000000000000000,11,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5930,'aldo','Aldo',149,0x0000DA0B00000000000000000000000000000000,6,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5931,'moogle','Moogle',185,0x0000DB0B00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5932,'fablinix','Fablinix',327,0x0000DC0B00000000000000000000000000000000,6,4,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5933,'maat','Maat',149,0x0000DD0B00000000000000000000000000000000,2,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5934,'d_shantotto','D.Shantotto',153,0x0000DE0B00000000000000000000000000000000,4,8,3,240,100,0,0,0,0,0,0,32,0,3,0,0,313,1,0,0); +INSERT INTO `mob_pools` VALUES (5935,'star_sibyl','StarSibyl',153,0x0000DF0B00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5936,'karaha-baruha','Karaha-Baruha',153,0x0000E00B00000000000000000000000000000000,3,15,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5937,'cid','Cid',149,0x0000E10B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5938,'gilgamesh','Gilgamesh',149,0x0000E20B00000000000000000000000000000000,12,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5939,'areuhat','Areuhat',145,0x0000E30B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5940,'semih_lafihna','SemihLafihna',145,0x0000E40B00000000000000000000000000000000,11,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5941,'elivira','Elivira',145,0x0000E50B00000000000000000000000000000000,11,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5940,'semih_lafihna','SemihLafihna',151,0x0000E40B00000000000000000000000000000000,11,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5941,'elivira','Elivira',149,0x0000E50B00000000000000000000000000000000,11,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5942,'noillurie','Noillurie',145,0x0000E60B00000000000000000000000000000000,12,7,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5943,'lhu_mhakaracca','LhuMhakaracca',145,0x0000E70B00000000000000000000000000000000,9,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5944,'ferreous_coffin','FerreousCoffin',145,0x0000E80B00000000000000000000000000000000,3,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5945,'lilisette','Lilisette',145,0x0000E90B00000000000000000000000000000000,19,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5946,'mumor','Mumor',145,0x0000EA0B00000000000000000000000000000000,19,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5947,'uka_totlihn','UkaTotlihn',145,0x0000EB0B00000000000000000000000000000000,19,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5948,'klara','Klara',145,0x0000ED0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5949,'romaa_mihgo','RomaaMihgo',145,0x0000EE0B00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5950,'kuyin_hathdenna','KuyinHathdenna',145,0x0000EF0B00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5943,'lhu_mhakaracca','LhuMhakaracca',151,0x0000E70B00000000000000000000000000000000,9,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5944,'ferreous_coffin','FerreousCoffin',146,0x0000E80B00000000000000000000000000000000,3,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5945,'lilisette','Lilisette',484,0x0000E90B00000000000000000000000000000000,19,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5946,'mumor','Mumor',149,0x0000EA0B00000000000000000000000000000000,19,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5947,'uka_totlihn','UkaTotlihn',151,0x0000EB0B00000000000000000000000000000000,19,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5948,'klara','Klara',149,0x0000ED0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5949,'romaa_mihgo','RomaaMihgo',151,0x0000EE0B00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5950,'kuyin_hathdenna','KuyinHathdenna',151,0x0000EF0B00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5951,'rahal','Rahal',145,0x0000F00B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5952,'koru-moru','Koru-Moru',145,0x0000F10B00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5952,'koru-moru','Koru-Moru',153,0x0000F10B00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5953,'pieuje_uc','Pieuje',145,0x0000F20B00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5954,'i_shield_uc','InvincibleShld',145,0x0000F40B00000000000000000000000000000000,1,2,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5955,'apururu_uc','Apururu',145,0x0000F50B00000000000000000000000000000000,3,5,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5956,'jakoh_uc','JakohWahcondalo',145,0x0000F60B00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5954,'i_shield_uc','InvincibleShld',146,0x0000F40B00000000000000000000000000000000,1,2,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5955,'apururu_uc','Apururu',153,0x0000F50B00000000000000000000000000000000,3,5,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5956,'jakoh_uc','JakohWahcondalo',151,0x0000F60B00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5957,'flaviria_uc','Flaviria',145,0x0000F30B00000000000000000000000000000000,14,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5958,'babban','Babban',145,0x0000FB0B00000000000000000000000000000000,2,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5959,'abenzio','Abenzio',145,0x0000FC0B00000000000000000000000000000000,2,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5958,'babban','Babban',178,0x0000FB0B00000000000000000000000000000000,2,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5959,'abenzio','Abenzio',136,0x0000FC0B00000000000000000000000000000000,2,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5960,'rughadjeen','Rughadjeen',145,0x0000FD0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5961,'kukki-chebukki','Kukki-Chebukki',145,0x0000FE0B00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5962,'margret','Margret',145,0x0000FF0B00000000000000000000000000000000,11,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5963,'chacharoon','Chacharoon',145,0x0000000C00000000000000000000000000000000,6,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5961,'kukki-chebukki','Kukki-Chebukki',153,0x0000FE0B00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5962,'margret','Margret',149,0x0000FF0B00000000000000000000000000000000,11,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5963,'chacharoon','Chacharoon',199,0x0000000C00000000000000000000000000000000,6,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5964,'lhe_lhangavo','LheLhangavo',145,0x0000010C00000000000000000000000000000000,2,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5965,'arciela','Arciela',145,0x0000020C00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5966,'mayakov','Mayakov',145,0x0000030C00000000000000000000000000000000,19,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5965,'arciela','Arciela',149,0x0000020C00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5966,'mayakov','Mayakov',149,0x0000030C00000000000000000000000000000000,19,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5967,'qultada','Qultada',145,0x0000040C00000000000000000000000000000000,17,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5968,'adelheid','Adelheid',145,0x0000050C00000000000000000000000000000000,20,4,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5969,'amchuchu','Amchuchu',145,0x0000060C00000000000000000000000000000000,22,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5970,'brygid','Brygid',145,0x0000070C00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5971,'mildaurion','Mildaurion',145,0x0000080C00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5968,'adelheid','Adelheid',149,0x0000050C00000000000000000000000000000000,20,4,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5969,'amchuchu','Amchuchu',153,0x0000060C00000000000000000000000000000000,22,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5970,'brygid','Brygid',149,0x0000070C00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5971,'mildaurion','Mildaurion',149,0x0000080C00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5972,'halver','Halver',145,0x00000F0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5973,'rongelouts','Rongelouts',145,0x0000100C00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5974,'leonoyne','Leonoyne',145,0x0000110C00000000000000000000000000000000,4,8,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5975,'maximilian','Maximilian',145,0x0000120C00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5976,'kayeel-payeel','Kayeel-Payeel',145,0x0000130C00000000000000000000000000000000,4,15,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5977,'robel-akbel','Robel-Akbel',145,0x0000140C00000000000000000000000000000000,4,15,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5978,'kupofried','Kupofried',145,0x0000150C00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5979,'selh_teus','Selh\'teus',145,0x0000160C00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5980,'yoran-oran_uc','Yoran-Oran',145,0x0000170C00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5981,'sylvie_uc','Sylvie',145,0x0000180C00000000000000000000000000000000,21,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5982,'abquhbah','Abquhbah',145,0x00001A0C00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5983,'balamor','Balamor',145,0x00001B0C00000000000000000000000000000000,8,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5984,'august','August',145,0x00001C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5985,'rosulatia','Rosulatia',145,0x00001D0C00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5986,'teodor','Teodor',145,0x00001F0C00000000000000000000000000000000,4,6,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5987,'ullegore','Ullegore',145,0x0000210C00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5988,'makki-chebukki','Makki-Chebukki',145,0x0000220C00000000000000000000000000000000,11,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5989,'king_of_hearts','KingOfHearts',145,0x0000230C00000000000000000000000000000000,5,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5990,'morimar','Morimar',145,0x0000240C00000000000000000000000000000000,9,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5991,'darrcuiln','Darrcuiln',145,0x0000250C00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5992,'aahm','ArkHM',145,0x0000290C00000000000000000000000000000000,13,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5975,'maximilian','Maximilian',149,0x0000120C00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5976,'kayeel-payeel','Kayeel-Payeel',153,0x0000130C00000000000000000000000000000000,4,15,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5977,'robel-akbel','Robel-Akbel',153,0x0000140C00000000000000000000000000000000,4,15,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5978,'kupofried','Kupofried',185,0x0000150C00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5979,'selh_teus','Selh\'teus',477,0x0000160C00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5980,'yoran-oran_uc','Yoran-Oran',153,0x0000170C00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5981,'sylvie_uc','Sylvie',149,0x0000180C00000000000000000000000000000000,21,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5982,'abquhbah','Abquhbah',149,0x00001A0C00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5983,'balamor','Balamor',492,0x00001B0C00000000000000000000000000000000,8,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5984,'august','August',149,0x00001C0C00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5985,'rosulatia','Rosulatia',455,0x00001D0C00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5986,'teodor','Teodor',149,0x00001F0C00000000000000000000000000000000,4,6,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5987,'ullegore','Ullegore',74,0x0000210C00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5988,'makki-chebukki','Makki-Chebukki',153,0x0000220C00000000000000000000000000000000,11,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5989,'king_of_hearts','KingOfHearts',61,0x0000230C00000000000000000000000000000000,5,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5990,'morimar','Morimar',149,0x0000240C00000000000000000000000000000000,9,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5991,'darrcuiln','Darrcuiln',489,0x0000250C00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5992,'aahm','ArkHM',149,0x0000290C00000000000000000000000000000000,13,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5993,'aaev','ArkEV',145,0x00002A0C00000000000000000000000000000000,7,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5994,'aamr','ArkMR',145,0x00002B0C00000000000000000000000000000000,9,6,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5995,'aatt','ArkTT',145,0x00002C0C00000000000000000000000000000000,4,8,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5996,'aagk','ArkGK',145,0x00002D0C00000000000000000000000000000000,12,14,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5997,'iroha','Iroha',145,0x0000270C00000000000000000000000000000000,4,12,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5998,'ygnas','Ygnas',145,0x00002E0C00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5994,'aamr','ArkMR',151,0x00002B0C00000000000000000000000000000000,9,6,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5995,'aatt','ArkTT',153,0x00002C0C00000000000000000000000000000000,4,8,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5996,'aagk','ArkGK',146,0x00002D0C00000000000000000000000000000000,12,14,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5997,'iroha','Iroha',149,0x0000270C00000000000000000000000000000000,4,12,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5998,'ygnas','Ygnas',455,0x00002E0C00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5999,'monberaux','Monberaux',145,0x0000260300000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -- Reserved for future Trust 6000 -- Reserved for future Trust 6001 -- Reserved for future Trust 6002 -- INSERT INTO `mob_pools` VALUES (6003,'cornelia','Cornelia',145,0x00002F0C00000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (6004,'excenmille_s','Excenmille',145,0x0000EC0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6005,'ayame_uc','Ayame',145,0x0000F70B00000000000000000000000000000000,12,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6006,'maat_uc','Maat',145,0x0000F80B00000000000000000000000000000000,2,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6007,'aldo_uc','Aldo',145,0x0000F90B00000000000000000000000000000000,6,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6008,'naja_uc','NajaSalaheem',145,0x0000FA0B00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6009,'lion_ii','Lion',145,0x0000090C00000000000000000000000000000000,6,13,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6010,'zeid_ii','Zeid',145,0x00000E0C00000000000000000000000000000000,8,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6005,'ayame_uc','Ayame',149,0x0000F70B00000000000000000000000000000000,12,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6006,'maat_uc','Maat',149,0x0000F80B00000000000000000000000000000000,2,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6007,'aldo_uc','Aldo',149,0x0000F90B00000000000000000000000000000000,6,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6008,'naja_uc','NajaSalaheem',151,0x0000FA0B00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6009,'lion_ii','Lion',149,0x0000090C00000000000000000000000000000000,6,13,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6010,'zeid_ii','Zeid',146,0x00000E0C00000000000000000000000000000000,8,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (6011,'prishe_ii','Prishe',145,0x00000A0C00000000000000000000000000000000,2,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6012,'nashmeira_ii','Nashmeira',145,0x00000B0C00000000000000000000000000000000,18,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6013,'lilisette_ii','Lilisette',145,0x00000C0C00000000000000000000000000000000,19,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6014,'tenzen_ii','Tenzen',145,0x0000190C00000000000000000000000000000000,12,11,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6015,'mumor_ii','Mumor',145,0x0000200C00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6016,'ingrid_ii','Ingrid',145,0x00001E0C00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6017,'arciela_ii','Arciela',145,0x00000D0C00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6018,'iroha_ii','Iroha',145,0x0000280C00000000000000000000000000000000,3,12,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6012,'nashmeira_ii','Nashmeira',149,0x00000B0C00000000000000000000000000000000,18,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6013,'lilisette_ii','Lilisette',484,0x00000C0C00000000000000000000000000000000,19,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6014,'tenzen_ii','Tenzen',149,0x0000190C00000000000000000000000000000000,12,11,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6015,'mumor_ii','Mumor',149,0x0000200C00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6016,'ingrid_ii','Ingrid',149,0x00001E0C00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6017,'arciela_ii','Arciela',149,0x00000D0C00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6018,'iroha_ii','Iroha',149,0x0000280C00000000000000000000000000000000,3,12,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (6019,'shantotto_ii','Shantotto',153,0x0000260C00000000000000000000000000000000,4,0,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); -- Reserved for future Trust 6020 -- Reserved for future Trust 6021 From 1101736a94ea24674585877ce3d3acbd09fb7f3a Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 24 Mar 2020 18:09:16 +0200 Subject: [PATCH 100/116] Add somewhat-functional declumping --- src/map/ai/controllers/trust_controller.cpp | 30 +++++++++++++++++++-- src/map/ai/controllers/trust_controller.h | 1 + 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index 06f96099e29..d50bf6f9b92 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -94,7 +94,8 @@ void CTrustController::DoCombatTick(time_point tick) { if (POwner->speed > 0) { - POwner->PAI->PathFind->PathAround(PTarget->loc.p, 3.0f, PATHFLAG_WALLHACK | PATHFLAG_RUN); + auto new_position = GetDeclumpedPosition(PTarget->loc.p); + POwner->PAI->PathFind->PathAround(new_position, 2.0f, PATHFLAG_RUN | PATHFLAG_WALLHACK | PATHFLAG_SLIDE); POwner->PAI->PathFind->FollowPath(); } } @@ -120,7 +121,8 @@ void CTrustController::DoRoamTick(time_point tick) if (currentDistance > RoamDistance) { - if (currentDistance < 35.0f && POwner->PAI->PathFind->PathAround(POwner->PMaster->loc.p, 2.0f, PATHFLAG_RUN | PATHFLAG_WALLHACK)) + auto new_position = GetDeclumpedPosition(POwner->PMaster->loc.p); + if (currentDistance < 30.0f && POwner->PAI->PathFind->PathAround(new_position, 2.0f, PATHFLAG_RUN | PATHFLAG_WALLHACK | PATHFLAG_SLIDE)) { POwner->PAI->PathFind->FollowPath(); } @@ -152,3 +154,27 @@ bool CTrustController::MasterHasTopEnmity() return false; } } + +position_t CTrustController::GetDeclumpedPosition(position_t target_pos) +{ + auto getMiddle = [&](position_t a, position_t b) + { + position_t final_pos{ (a.x + b.x) / 2.0f, (a.y + b.y) / 2.0f, (a.z + b.z) / 2.0f, 0, 0 }; + return final_pos; + }; + + position_t final_pos = target_pos; + for (auto PTrust : static_cast(POwner->PMaster)->PTrusts) + { + if (POwner != PTrust && distance(POwner->loc.p, PTrust->loc.p) < 4.0f) + { + auto angle = getangle(POwner->loc.p, PTrust->loc.p); + position_t declumped_pos{ POwner->loc.p.x - (cosf(rotationToRadian(angle)) * 2.0f), + POwner->loc.p.y, POwner->loc.p.z + (sinf(rotationToRadian(angle)) * 2.0f), 0, 0 }; + + final_pos = getMiddle(final_pos, declumped_pos); + } + } + + return final_pos; +} diff --git a/src/map/ai/controllers/trust_controller.h b/src/map/ai/controllers/trust_controller.h index 1a1df3d32c0..cd10a047b42 100644 --- a/src/map/ai/controllers/trust_controller.h +++ b/src/map/ai/controllers/trust_controller.h @@ -46,6 +46,7 @@ class CTrustController : public CMobController void DoRoamTick(time_point tick) override; bool MasterHasTopEnmity(); + position_t GetDeclumpedPosition(position_t target_pos); }; #endif // _TRUSTCONTROLLER \ No newline at end of file From 36e1d268c2da20e65799f62cc6d4d30e2ab2f2a1 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 24 Mar 2020 18:48:22 +0200 Subject: [PATCH 101/116] lerp, lerp_position and experimenting with weights and distances --- src/map/ai/controllers/trust_controller.cpp | 22 +++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index d50bf6f9b92..7772f99b16a 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -95,7 +95,7 @@ void CTrustController::DoCombatTick(time_point tick) if (POwner->speed > 0) { auto new_position = GetDeclumpedPosition(PTarget->loc.p); - POwner->PAI->PathFind->PathAround(new_position, 2.0f, PATHFLAG_RUN | PATHFLAG_WALLHACK | PATHFLAG_SLIDE); + POwner->PAI->PathFind->PathAround(new_position, 3.0f, PATHFLAG_RUN | PATHFLAG_WALLHACK | PATHFLAG_SLIDE); POwner->PAI->PathFind->FollowPath(); } } @@ -157,24 +157,34 @@ bool CTrustController::MasterHasTopEnmity() position_t CTrustController::GetDeclumpedPosition(position_t target_pos) { - auto getMiddle = [&](position_t a, position_t b) + auto lerp = [](float a, float b, float f) { - position_t final_pos{ (a.x + b.x) / 2.0f, (a.y + b.y) / 2.0f, (a.z + b.z) / 2.0f, 0, 0 }; + return a + f * (b - a); + }; + + auto lerp_position = [&](position_t a, position_t b, float ratio) + { + float safe_ratio = std::clamp(ratio, 0.0f, 1.0f); + position_t final_pos{ + lerp(a.x, b.x, ratio), + lerp(a.y, b.y, ratio), + lerp(a.z, b.z, ratio), + 0, 0}; return final_pos; }; position_t final_pos = target_pos; for (auto PTrust : static_cast(POwner->PMaster)->PTrusts) { - if (POwner != PTrust && distance(POwner->loc.p, PTrust->loc.p) < 4.0f) + if (POwner != PTrust && distance(POwner->loc.p, PTrust->loc.p) < 5.0f) { auto angle = getangle(POwner->loc.p, PTrust->loc.p); position_t declumped_pos{ POwner->loc.p.x - (cosf(rotationToRadian(angle)) * 2.0f), POwner->loc.p.y, POwner->loc.p.z + (sinf(rotationToRadian(angle)) * 2.0f), 0, 0 }; - final_pos = getMiddle(final_pos, declumped_pos); + final_pos = lerp_position(final_pos, declumped_pos, 0.5f); } } - return final_pos; + return lerp_position(final_pos, target_pos, 0.1f); } From 4321461a422b3350bf99df4240c3f77935ce3d43 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 24 Mar 2020 22:01:18 +0200 Subject: [PATCH 102/116] Add basic Provoke mobskill --- scripts/globals/mobskills/provoke.lua | 13 +++++++++++++ sql/mob_skills.sql | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 scripts/globals/mobskills/provoke.lua diff --git a/scripts/globals/mobskills/provoke.lua b/scripts/globals/mobskills/provoke.lua new file mode 100644 index 00000000000..eaea3a71ab2 --- /dev/null +++ b/scripts/globals/mobskills/provoke.lua @@ -0,0 +1,13 @@ +--------------------------------------------- +-- Provoke +--------------------------------------------- +require("scripts/globals/status") +--------------------------------------------- + +function onMobSkillCheck(target,mob,skill) + return 0 +end + +function onMobWeaponSkill(target, mob, skill) + target:addEnmity(mob, 1, 1800) +end diff --git a/sql/mob_skills.sql b/sql/mob_skills.sql index 5730f633c16..4c13ff42f96 100644 --- a/sql/mob_skills.sql +++ b/sql/mob_skills.sql @@ -1765,7 +1765,7 @@ INSERT INTO `mob_skills` VALUES (1941,1305,'string_clipper',0,7.0,2000,1,4,0,0,0 INSERT INTO `mob_skills` VALUES (1942,1303,'arcuballista',0,15.0,2000,1,4,0,0,0,3,1,0); INSERT INTO `mob_skills` VALUES (1943,1306,'slapstick',0,7.0,2000,1,4,0,0,0,8,0,0); INSERT INTO `mob_skills` VALUES (1944,1307,'shield_bash',0,7.0,2000,0,4,4,0,0,0,0,0); -INSERT INTO `mob_skills` VALUES (1945,1219,'provoke',0,7.0,2000,0,4,4,0,0,0,0,0); +INSERT INTO `mob_skills` VALUES (1945,1218,'provoke',0,7.0,2000,0,4,4,0,0,0,0,0); INSERT INTO `mob_skills` VALUES (1946,435,'shock_absorber',0,7.0,2000,0,16,4,0,0,0,0,0); INSERT INTO `mob_skills` VALUES (1947,438,'flashbulb',0,7.0,2000,0,4,4,0,0,0,0,0); INSERT INTO `mob_skills` VALUES (1948,439,'mana_converter',0,7.0,2000,0,16,4,0,0,0,0,0); From 22df9fd4fed7e621d9e35d918f8c57954c232358 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Tue, 24 Mar 2020 23:11:43 +0200 Subject: [PATCH 103/116] Add super basic provoke to the starting tanks --- scripts/globals/mobskills/provoke.lua | 2 ++ scripts/globals/spells/trust/shantotto.lua | 6 ++++++ sql/mob_pools.sql | 8 +++---- sql/mob_skill_lists.sql | 1 + src/map/ai/controllers/trust_controller.cpp | 21 ++++++++++--------- src/map/ai/controllers/trust_controller.h | 2 +- src/map/lua/lua_baseentity.cpp | 23 ++++++++++----------- src/map/utils/trustutils.cpp | 4 ++++ 8 files changed, 40 insertions(+), 27 deletions(-) diff --git a/scripts/globals/mobskills/provoke.lua b/scripts/globals/mobskills/provoke.lua index eaea3a71ab2..c11067b3226 100644 --- a/scripts/globals/mobskills/provoke.lua +++ b/scripts/globals/mobskills/provoke.lua @@ -1,6 +1,7 @@ --------------------------------------------- -- Provoke --------------------------------------------- +require("scripts/globals/msg") require("scripts/globals/status") --------------------------------------------- @@ -10,4 +11,5 @@ end function onMobWeaponSkill(target, mob, skill) target:addEnmity(mob, 1, 1800) + skill:setMsg(tpz.msg.basic.NONE) end diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index a52614f567a..0e0a50abbd8 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -13,6 +13,12 @@ function onSpellCast(caster, target, spell) end function onMobSpawn(mob) + mob:addListener("COMBAT_TICK", "SHANTOTTO_TRUST_TICK", function(trust, master, target) + local party = master:getParty() + local pt_trusts = master:getPartyTrusts() + + -- Decision making here + end) end function onMobDespawn(mob) diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index e7d52f71194..9a45976dcc5 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5955,15 +5955,15 @@ INSERT INTO `mob_pools` VALUES (5894,'Lesath','Lesath',217,0x00001C0100000000000 INSERT INTO `mob_pools` VALUES (5895,'Donggu','Donggu',116,0x0000780100000000000000000000000000000000,1,1,11,240,100,0,0,0,1,2,7,0,0,3,0,0,0,1,0,116); -- Trusts INSERT INTO `mob_pools` VALUES (5896,'shantotto','Shantotto',153,0x0000B80B00000000000000000000000000000000,4,0,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); -INSERT INTO `mob_pools` VALUES (5897,'naji','Naji',149,0x0000B90B00000000000000000000000000000000,1,0,2,240,100,0,2,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5897,'naji','Naji',149,0x0000B90B00000000000000000000000000000000,1,0,2,240,100,0,2,0,0,0,0,32,0,3,0,0,0,1,0,1011); INSERT INTO `mob_pools` VALUES (5898,'kupipi','Kupipi',153,0x0000BA0B00000000000000000000000000000000,3,0,11,230,100,2,0,0,0,0,0,32,0,3,0,0,312,1,0,0); INSERT INTO `mob_pools` VALUES (5899,'excenmille','Excenmille',145,0x0000BB0B00000000000000000000000000000000,7,0,8,390,100,0,0,0,0,0,0,32,0,3,0,0,309,1,0,0); INSERT INTO `mob_pools` VALUES (5900,'ayame','Ayame',149,0x0000BC0B00000000000000000000000000000000,12,0,10,440,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5901,'nanaa_mihgo','NanaaMihgo',151,0x0000BD0B00000000000000000000000000000000,6,0,2,190,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5902,'curilla','Curilla',145,0x0000BE0B00000000000000000000000000000000,7,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,308,1,0,0); -INSERT INTO `mob_pools` VALUES (5903,'volker','Volker',149,0x0000BF0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,8,1,0,0); +INSERT INTO `mob_pools` VALUES (5903,'volker','Volker',149,0x0000BF0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,8,1,0,1011); INSERT INTO `mob_pools` VALUES (5904,'ajido-marujido','Ajido-Marujido',153,0x0000C00B00000000000000000000000000000000,4,5,1,400,100,0,0,0,0,0,0,32,0,3,0,0,311,1,0,0); -INSERT INTO `mob_pools` VALUES (5905,'trion','Trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,310,1,0,0); +INSERT INTO `mob_pools` VALUES (5905,'trion','Trion',145,0x0000C10B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,310,1,0,1011); INSERT INTO `mob_pools` VALUES (5906,'zeid','Zeid',146,0x0000C20B00000000000000000000000000000000,8,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5907,'lion','Lion',149,0x0000C30B00000000000000000000000000000000,6,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5908,'tenzen','Tenzen',149,0x0000C40B00000000000000000000000000000000,12,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); @@ -5975,7 +5975,7 @@ INSERT INTO `mob_pools` VALUES (5913,'prishe','Prishe',145,0x0000C90B00000000000 INSERT INTO `mob_pools` VALUES (5914,'ulmia','Ulmia',145,0x0000CA0B00000000000000000000000000000000,10,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5915,'shikaree_z','ShikareeZ',151,0x0000CB0B00000000000000000000000000000000,14,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5916,'cherukiki','Cherukiki',153,0x0000CC0B00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5917,'iron_eater','IronEater',146,0x0000CD0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5917,'iron_eater','IronEater',146,0x0000CD0B00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,1011); INSERT INTO `mob_pools` VALUES (5918,'gessho','Gessho',270,0x0000CE0B00000000000000000000000000000000,13,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5919,'gadalar','Gadalar',149,0x0000CF0B00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5920,'rainemard','Rainemard',145,0x0000D00B00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); diff --git a/sql/mob_skill_lists.sql b/sql/mob_skill_lists.sql index 0bf1552a835..43d6b397f61 100644 --- a/sql/mob_skill_lists.sql +++ b/sql/mob_skill_lists.sql @@ -3461,3 +3461,4 @@ INSERT INTO `mob_skill_lists` VALUES ('Siren',1010,3512); -- Sonic Buffet INSERT INTO `mob_skill_lists` VALUES ('Siren',1010,3513); -- Entice INSERT INTO `mob_skill_lists` VALUES ('Siren',1010,3514); -- Hysteric Assault INSERT INTO `mob_skill_lists` VALUES ('Siren',1010,3515); -- Clarsach Call +INSERT INTO `mob_skill_lists` VALUES ('TRUST_Trion',1011,1945); -- Provoke diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index 7772f99b16a..e804ff4f309 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -103,6 +103,14 @@ void CTrustController::DoCombatTick(time_point tick) POwner->PAI->EventHandler.triggerListener("COMBAT_TICK", POwner, POwner->PMaster, PTarget); + // TODO: This is temporary until a proper solution for decision making is chosen + // The only mob skill assigned any trust is Provoke + if (GetTopEnmity() != POwner) + { + MobSkill(); + return; + } + if (IsSpellReady(currentDistance) && TryCastSpell()) { return; @@ -112,7 +120,7 @@ void CTrustController::DoCombatTick(time_point tick) void CTrustController::DoRoamTick(time_point tick) { - if (POwner->PMaster->PAI->IsEngaged() && MasterHasTopEnmity()) + if (POwner->PMaster->PAI->IsEngaged() && GetTopEnmity() == POwner->PMaster) { POwner->PAI->Internal_Engage(POwner->PMaster->GetBattleTargetID()); } @@ -142,17 +150,10 @@ bool CTrustController::Ability(uint16 targid, uint16 abilityid) return false; } -bool CTrustController::MasterHasTopEnmity() +CBattleEntity* CTrustController::GetTopEnmity() { auto PMob = dynamic_cast(POwner->PMaster->GetBattleTarget()); - if (PMob) - { - return PMob->PEnmityContainer->GetHighestEnmity() == POwner->PMaster; - } - else - { - return false; - } + return PMob->PEnmityContainer->GetHighestEnmity(); } position_t CTrustController::GetDeclumpedPosition(position_t target_pos) diff --git a/src/map/ai/controllers/trust_controller.h b/src/map/ai/controllers/trust_controller.h index cd10a047b42..72455757805 100644 --- a/src/map/ai/controllers/trust_controller.h +++ b/src/map/ai/controllers/trust_controller.h @@ -45,7 +45,7 @@ class CTrustController : public CMobController void DoCombatTick(time_point tick) override; void DoRoamTick(time_point tick) override; - bool MasterHasTopEnmity(); + CBattleEntity* GetTopEnmity(); position_t GetDeclumpedPosition(position_t target_pos); }; diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index 4721eb37b68..1e86777c803 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -12131,20 +12131,19 @@ inline int32 CLuaBaseEntity::getMaster(lua_State* L) TPZ_DEBUG_BREAK_IF(m_PBaseEntity == nullptr); TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype == TYPE_NPC) - if (((CBattleEntity*)m_PBaseEntity)->PMaster != nullptr) - { - //uint32 petid = (uint32); + if (((CBattleEntity*)m_PBaseEntity)->PMaster != nullptr) + { + CBaseEntity* PMaster = ((CBattleEntity*)m_PBaseEntity)->PMaster; - CBaseEntity* PMaster = ((CBattleEntity*)m_PBaseEntity)->PMaster; + lua_getglobal(L, CLuaBaseEntity::className); + lua_pushstring(L, "new"); + lua_gettable(L, -2); + lua_insert(L, -2); + lua_pushlightuserdata(L, (void*)PMaster); + lua_pcall(L, 2, 1, 0); + return 1; + } - lua_getglobal(L, CLuaBaseEntity::className); - lua_pushstring(L, "new"); - lua_gettable(L, -2); - lua_insert(L, -2); - lua_pushlightuserdata(L, (void*)PMaster); - lua_pcall(L, 2, 1, 0); - return 1; - } lua_pushnil(L); return 1; } diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index 02e62f3ce85..e6601acc008 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -14,6 +14,7 @@ #include "../grades.h" #include "../map.h" +#include "../mob_modifier.h" #include "../ai/ai_container.h" #include "../ai/controllers/trust_controller.h" @@ -303,6 +304,9 @@ CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID) LoadTrustStatsAndSkills(PTrust); mobutils::SetSpellList(PTrust, trustData->spellList); + // TODO: This is temporary until a proper solution for decision making is chosen + PTrust->setMobMod(MOBMOD_SKILL_LIST, PTrust->m_MobSkillList); + return PTrust; } From 85ce5e32b94fbe37877c0cd3772882e42c874052 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Wed, 25 Mar 2020 09:10:49 +0200 Subject: [PATCH 104/116] Add listener for enmity changed --- scripts/globals/spells/trust/shantotto.lua | 9 +++++++- src/map/ai/controllers/trust_controller.cpp | 25 +++++++++++++-------- src/map/ai/controllers/trust_controller.h | 2 ++ 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index 0e0a50abbd8..68884f47063 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -13,7 +13,14 @@ function onSpellCast(caster, target, spell) end function onMobSpawn(mob) - mob:addListener("COMBAT_TICK", "SHANTOTTO_TRUST_TICK", function(trust, master, target) + mob:addListener("ENMITY_CHANGED", "SHANTOTTO_ENMITY_CHANGED", function(trust, master, target) + local party = master:getParty() + local pt_trusts = master:getPartyTrusts() + + -- Decision making here + end) + + mob:addListener("COMBAT_TICK", "SHANTOTTO_COMBAT_TICK", function(trust, master, target) local party = master:getParty() local pt_trusts = master:getPartyTrusts() diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index e804ff4f309..a5c2389a35e 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -42,6 +42,8 @@ CTrustController::~CTrustController() POwner->PAI->PathFind.reset(); POwner->allegiance = ALLEGIANCE_PLAYER; POwner->PMaster = nullptr; + + m_LastTopEntity = nullptr; } void CTrustController::Despawn() @@ -74,11 +76,13 @@ void CTrustController::DoCombatTick(time_point tick) if (!POwner->PMaster->PAI->IsEngaged()) { POwner->PAI->Internal_Disengage(); + m_LastTopEntity = nullptr; } if (POwner->PMaster->GetBattleTargetID() != POwner->GetBattleTargetID()) { POwner->PAI->Internal_ChangeTarget(POwner->PMaster->GetBattleTargetID()); + m_LastTopEntity = nullptr; } float currentDistance = distance(POwner->loc.p, POwner->PMaster->loc.p); @@ -101,20 +105,19 @@ void CTrustController::DoCombatTick(time_point tick) } } - POwner->PAI->EventHandler.triggerListener("COMBAT_TICK", POwner, POwner->PMaster, PTarget); - - // TODO: This is temporary until a proper solution for decision making is chosen - // The only mob skill assigned any trust is Provoke - if (GetTopEnmity() != POwner) + auto currentTopEnmity = GetTopEnmity(); + if (m_LastTopEntity != currentTopEnmity) { - MobSkill(); - return; + POwner->PAI->EventHandler.triggerListener("ENMITY_CHANGED", POwner, POwner->PMaster, currentTopEnmity); + m_LastTopEntity = currentTopEnmity; } if (IsSpellReady(currentDistance) && TryCastSpell()) { return; } + + POwner->PAI->EventHandler.triggerListener("COMBAT_TICK", POwner, POwner->PMaster, PTarget); } } @@ -152,8 +155,12 @@ bool CTrustController::Ability(uint16 targid, uint16 abilityid) CBattleEntity* CTrustController::GetTopEnmity() { - auto PMob = dynamic_cast(POwner->PMaster->GetBattleTarget()); - return PMob->PEnmityContainer->GetHighestEnmity(); + CBattleEntity* PEntity = nullptr; + if (auto PMob = dynamic_cast(POwner->PMaster->GetBattleTarget())) + { + return PMob->PEnmityContainer->GetHighestEnmity(); + } + return PEntity; } position_t CTrustController::GetDeclumpedPosition(position_t target_pos) diff --git a/src/map/ai/controllers/trust_controller.h b/src/map/ai/controllers/trust_controller.h index 72455757805..71f8e701cca 100644 --- a/src/map/ai/controllers/trust_controller.h +++ b/src/map/ai/controllers/trust_controller.h @@ -47,6 +47,8 @@ class CTrustController : public CMobController CBattleEntity* GetTopEnmity(); position_t GetDeclumpedPosition(position_t target_pos); + + CBattleEntity* m_LastTopEntity; }; #endif // _TRUSTCONTROLLER \ No newline at end of file From 0ae010ac47c9811b6074b3cb916564dd4bf55cf7 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Wed, 25 Mar 2020 12:21:23 +0200 Subject: [PATCH 105/116] Replace getPartyTrusts() with getPartyWithTrusts() --- scripts/globals/spells/trust/shantotto.lua | 6 +- scripts/globals/trust.lua | 39 +++++----- src/map/entities/battleentity.h | 17 +++++ src/map/lua/lua_baseentity.cpp | 82 +++++++++++----------- src/map/lua/lua_baseentity.h | 2 +- 5 files changed, 82 insertions(+), 64 deletions(-) diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index 68884f47063..3ffd9615283 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -14,15 +14,13 @@ end function onMobSpawn(mob) mob:addListener("ENMITY_CHANGED", "SHANTOTTO_ENMITY_CHANGED", function(trust, master, target) - local party = master:getParty() - local pt_trusts = master:getPartyTrusts() + local party = master:getPartyWithTrusts() -- Decision making here end) mob:addListener("COMBAT_TICK", "SHANTOTTO_COMBAT_TICK", function(trust, master, target) - local party = master:getParty() - local pt_trusts = master:getPartyTrusts() + local party = master:getPartyWithTrusts() -- Decision making here end) diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index ae8aa3eeffc..f6a84ffe532 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -30,33 +30,36 @@ tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) end -- Check party for trusts - local num_pt = caster:getPartySize() + local num_pt = 0 local num_trusts = 0 - local party_trusts = caster:getPartyTrusts() - for _, trust in ipairs(party_trusts) do - -- Check for same trust - if trust:getTrustID() == spell:getID() then - return tpz.msg.basic.TRUST_NO_CAST_TRUST - -- Check not allowed trust combinations (Shantotto I vs Shantotto II) - elseif type(not_allowed_trust_ids) == "number" then - if trust:getTrustID() == not_allowed_trust_ids then + local party = caster:getPartyWithTrusts() + for _, member in ipairs(party) do + if member:getObjType() == tpz.objType.TRUST then + -- Check for same trust + if member:getTrustID() == spell:getID() then return tpz.msg.basic.TRUST_NO_CAST_TRUST - end - elseif type(not_allowed_trust_ids) == "table" then - for _, v in pairs(not_allowed_trust_ids) do - if type(v) == "number" then - if trust:getTrustID() == v then - return tpz.msg.basic.TRUST_NO_CAST_TRUST + -- Check not allowed trust combinations (Shantotto I vs Shantotto II) + elseif type(not_allowed_trust_ids) == "number" then + if member:getTrustID() == not_allowed_trust_ids then + return tpz.msg.basic.TRUST_NO_CAST_TRUST + end + elseif type(not_allowed_trust_ids) == "table" then + for _, v in pairs(not_allowed_trust_ids) do + if type(v) == "number" then + if member:getTrustID() == v then + return tpz.msg.basic.TRUST_NO_CAST_TRUST + end end end + else + num_trusts = num_trusts + 1 end - else - num_trusts = num_trusts + 1 end + num_pt = num_pt + 1 end -- Max party size - if num_trusts + num_pt >= 6 then + if num_pt >= 6 then return tpz.msg.basic.TRUST_NO_CAST_TRUST end diff --git a/src/map/entities/battleentity.h b/src/map/entities/battleentity.h index a04f9607f3b..9ddb51cb1ff 100644 --- a/src/map/entities/battleentity.h +++ b/src/map/entities/battleentity.h @@ -580,6 +580,23 @@ class CBattleEntity : public CBaseEntity func(this, std::forward(args)...); } } + + template + void ForPartyWithTrusts(F func, Args&&... args) + { + if (PParty) { + for (auto PMember : PParty->members) { + func(PMember, std::forward(args)...); + for (auto PTrust : static_cast(PMember)->PTrusts) { + func(PTrust, std::forward(args)...); + } + } + } + else { + func(this, std::forward(args)...); + } + } + template void ForAlliance(F func, Args&&... args) { diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index 1e86777c803..453e36eeb18 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -8491,6 +8491,46 @@ inline int32 CLuaBaseEntity::getParty(lua_State* L) return 1; } +/************************************************************************ +* Function: getPartyWithTrusts() +* Purpose : Returns a Lua table of party member and trust Entity objects +* Example : local party = player:getPartyWithTrusts() +* Notes : +************************************************************************/ + +inline int32 CLuaBaseEntity::getPartyWithTrusts(lua_State* L) +{ + TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype == TYPE_NPC); + + CParty* party = ((CBattleEntity*)m_PBaseEntity)->PParty; + + int size = 0; + if (party) + { + size = party->MemberCount(m_PBaseEntity->getZone()); + } + else + { + size = 1; + } + + lua_createtable(L, size, 0); + int i = 1; + ((CBattleEntity*)m_PBaseEntity)->ForPartyWithTrusts([&L, &i](CBattleEntity* member) + { + lua_getglobal(L, CLuaBaseEntity::className); + lua_pushstring(L, "new"); + lua_gettable(L, -2); + lua_insert(L, -2); + lua_pushlightuserdata(L, (void*)member); + lua_pcall(L, 2, 1, 0); + + lua_rawseti(L, -2, i++); + }); + + return 1; +} + /************************************************************************ * Function: getPartySize() * Purpose : Returns the count of members in the party @@ -11926,46 +11966,6 @@ inline int32 CLuaBaseEntity::getTrustID(lua_State* L) return 1; } -/************************************************************************ -* Function: getPartyTrusts() -* Purpose : get a table of the trusts in a party (if any) -* Example : target:getPartyTrusts() -* Notes : -************************************************************************/ - -inline int32 CLuaBaseEntity::getPartyTrusts(lua_State* L) -{ - TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_PC); - - int size = 0; - ((CBattleEntity*)m_PBaseEntity)->ForParty([&size](CBattleEntity* member) - { - for (auto* PTrust : static_cast(member)->PTrusts) - { - size++; - } - }); - - lua_createtable(L, size, 0); - int i = 1; - ((CBattleEntity*)m_PBaseEntity)->ForParty([&L, &i](CBattleEntity* member) - { - for (auto* PTrust : static_cast(member)->PTrusts) - { - lua_getglobal(L, CLuaBaseEntity::className); - lua_pushstring(L, "new"); - lua_gettable(L, -2); - lua_insert(L, -2); - lua_pushlightuserdata(L, (void*)PTrust); - lua_pcall(L, 2, 1, 0); - - lua_rawseti(L, -2, i++); - } - }); - - return 1; -} - /************************************************************************ * Function: despawnPet() * Purpose : Despawns a Pet Entity @@ -14398,6 +14398,7 @@ Lunar::Register_t CLuaBaseEntity::methods[] = // Parties and Alliances LUNAR_DECLARE_METHOD(CLuaBaseEntity,getParty), + LUNAR_DECLARE_METHOD(CLuaBaseEntity,getPartyWithTrusts), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getPartySize), LUNAR_DECLARE_METHOD(CLuaBaseEntity,hasPartyJob), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getPartyMember), @@ -14605,7 +14606,6 @@ Lunar::Register_t CLuaBaseEntity::methods[] = // Trust related LUNAR_DECLARE_METHOD(CLuaBaseEntity,spawnTrust), LUNAR_DECLARE_METHOD(CLuaBaseEntity,getTrustID), - LUNAR_DECLARE_METHOD(CLuaBaseEntity,getPartyTrusts), // Mob Entity-Specific LUNAR_DECLARE_METHOD(CLuaBaseEntity,setMobLevel), diff --git a/src/map/lua/lua_baseentity.h b/src/map/lua/lua_baseentity.h index 4898f474317..41c6f5bdf65 100644 --- a/src/map/lua/lua_baseentity.h +++ b/src/map/lua/lua_baseentity.h @@ -408,6 +408,7 @@ class CLuaBaseEntity // Parties and Alliances int32 getParty(lua_State* L); + int32 getPartyWithTrusts(lua_State* L); int32 getPartySize(lua_State* L); // Get the size of a party in an entity's alliance int32 hasPartyJob(lua_State*); int32 getPartyMember(lua_State* L); // Get a character entity from another entity's party or alliance @@ -580,7 +581,6 @@ class CLuaBaseEntity int32 spawnTrust(lua_State*); // Spawns trust int32 getTrustID(lua_State*); - int32 getPartyTrusts(lua_State*); int32 isJugPet(lua_State*); // If the entity has a pet, test if it is a jug pet. int32 hasValidJugPetItem(lua_State*); From 347e070af0632783f46b5cd427ecc320f874adc6 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Wed, 25 Mar 2020 13:00:35 +0200 Subject: [PATCH 106/116] Cleaner listener based provoke for Naji --- scripts/globals/spells/trust/naji.lua | 25 +++++++++++++++++++++ src/map/ai/controllers/trust_controller.cpp | 2 +- src/map/lua/lua_baseentity.cpp | 2 +- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/scripts/globals/spells/trust/naji.lua b/scripts/globals/spells/trust/naji.lua index a9b6672a67a..9d50d07f7aa 100644 --- a/scripts/globals/spells/trust/naji.lua +++ b/scripts/globals/spells/trust/naji.lua @@ -11,3 +11,28 @@ end function onSpellCast(caster, target, spell) return tpz.trust.spawn(caster, spell) end + +function onMobSpawn(mob) + mob:addListener("ENMITY_CHANGED", "NAJI_ENMITY_CHANGED", function(trust, master, target) + if trust:getID() ~= target:getID() then + trust:setLocalVar("tryProvoke", 1) + end + end) + + mob:addListener("COMBAT_TICK", "NAJI_COMBAT_TICK", function(trust, master, target) + local tryProvoke = trust:getLocalVar("tryProvoke") + local provokeReadyTime = trust:getLocalVar("provokeReadyTime") + + if tryProvoke == 1 and os.time() >= provokeReadyTime then + trust:useMobAbility(1945, target) + trust:setLocalVar("tryProvoke", 0) + trust:setLocalVar("provokeReadyTime", os.time() + 30) + end + end) +end + +function onMobDespawn(mob) +end + +function onMobDeath(mob) +end diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index a5c2389a35e..22048faf490 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -108,7 +108,7 @@ void CTrustController::DoCombatTick(time_point tick) auto currentTopEnmity = GetTopEnmity(); if (m_LastTopEntity != currentTopEnmity) { - POwner->PAI->EventHandler.triggerListener("ENMITY_CHANGED", POwner, POwner->PMaster, currentTopEnmity); + POwner->PAI->EventHandler.triggerListener("ENMITY_CHANGED", POwner, POwner->PMaster, PTarget); m_LastTopEntity = currentTopEnmity; } diff --git a/src/map/lua/lua_baseentity.cpp b/src/map/lua/lua_baseentity.cpp index 453e36eeb18..1a37896b8d0 100644 --- a/src/map/lua/lua_baseentity.cpp +++ b/src/map/lua/lua_baseentity.cpp @@ -13686,7 +13686,7 @@ inline int32 CLuaBaseEntity::useJobAbility(lua_State* L) inline int32 CLuaBaseEntity::useMobAbility(lua_State* L) { TPZ_DEBUG_BREAK_IF(m_PBaseEntity == nullptr); - TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_MOB && m_PBaseEntity->objtype != TYPE_PET); + TPZ_DEBUG_BREAK_IF(m_PBaseEntity->objtype != TYPE_TRUST && m_PBaseEntity->objtype != TYPE_MOB && m_PBaseEntity->objtype != TYPE_PET); if (lua_isnumber(L, 1)) { From fe6fa4768882e8a3186c4a2efed992692eda3adc Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Wed, 25 Mar 2020 13:32:38 +0200 Subject: [PATCH 107/116] Add sentinel to curilla, basic WSs --- scripts/globals/mobskills/sentinel.lua | 15 ++++++++++ scripts/globals/spells/trust/curilla.lua | 31 +++++++++++++++++++++ scripts/globals/spells/trust/naji.lua | 6 ++++ sql/mob_skills.sql | 2 +- src/map/ai/controllers/trust_controller.cpp | 8 +++--- 5 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 scripts/globals/mobskills/sentinel.lua diff --git a/scripts/globals/mobskills/sentinel.lua b/scripts/globals/mobskills/sentinel.lua new file mode 100644 index 00000000000..0ddb19d8034 --- /dev/null +++ b/scripts/globals/mobskills/sentinel.lua @@ -0,0 +1,15 @@ +--------------------------------------------------- +-- Sentinel +--------------------------------------------------- +require("scripts/globals/msg") +require("scripts/globals/status") +--------------------------------------------------- + +function onMobSkillCheck(target,mob,skill) + return 0 +end + +function onMobWeaponSkill(target, mob, skill) + target:addEnmity(mob, 1, 1800) + skill:setMsg(tpz.msg.basic.NONE) +end diff --git a/scripts/globals/spells/trust/curilla.lua b/scripts/globals/spells/trust/curilla.lua index b231bedf880..fad68c8e61b 100644 --- a/scripts/globals/spells/trust/curilla.lua +++ b/scripts/globals/spells/trust/curilla.lua @@ -11,3 +11,34 @@ end function onSpellCast(caster, target, spell) return tpz.trust.spawn(caster, spell) end + +function onMobSpawn(mob) + mob:addListener("ENMITY_CHANGED", "CURILLA_ENMITY_CHANGED", function(trust, master, target) + if trust:getID() ~= target:getID() then + trust:setLocalVar("trySentinel", 1) + end + end) + + mob:addListener("COMBAT_TICK", "CURILLA_COMBAT_TICK", function(trust, master, target) + local trySentinel = trust:getLocalVar("trySentinel") + local sentinelReadyTime = trust:getLocalVar("sentinelReadyTime") + + if trySentinel == 1 and os.time() >= sentinelReadyTime then + trust:useMobAbility(707, target) + trust:setLocalVar("trySentinel", 0) + trust:setLocalVar("sentinelReadyTime", os.time() + 600) + end + + if trust:getTP() >= 1000 then + local weaponSkills = {34, 37, 41} + local ws = weaponSkills[math.random(1, #weaponSkills)] + trust:useMobAbility(ws, target) + end + end) +end + +function onMobDespawn(mob) +end + +function onMobDeath(mob) +end diff --git a/scripts/globals/spells/trust/naji.lua b/scripts/globals/spells/trust/naji.lua index 9d50d07f7aa..d4a4774e10c 100644 --- a/scripts/globals/spells/trust/naji.lua +++ b/scripts/globals/spells/trust/naji.lua @@ -28,6 +28,12 @@ function onMobSpawn(mob) trust:setLocalVar("tryProvoke", 0) trust:setLocalVar("provokeReadyTime", os.time() + 30) end + + if trust:getTP() >= 1000 then + local weaponSkills = {33, 34, 40} + local ws = weaponSkills[math.random(1, #weaponSkills)] + trust:useMobAbility(ws, target) + end end) end diff --git a/sql/mob_skills.sql b/sql/mob_skills.sql index 4c13ff42f96..f625e9182ec 100644 --- a/sql/mob_skills.sql +++ b/sql/mob_skills.sql @@ -527,7 +527,7 @@ INSERT INTO `mob_skills` VALUES (696,432,'soul_voice',0,7.0,2000,0,1,2,0,0,0,0,0 -- INSERT INTO `mob_skills` VALUES (704,448,'counterstance',0,7.0,2000,1500,4,0,0,0,0,0,0); -- INSERT INTO `mob_skills` VALUES (705,449,'hide',0,7.0,2000,1500,4,0,0,0,0,0,0); -- INSERT INTO `mob_skills` VALUES (706,450,'bash',0,7.0,2000,1500,4,0,0,0,0,0,0); --- INSERT INTO `mob_skills` VALUES (707,451,'sentinel',0,7.0,2000,1500,4,0,0,0,0,0,0); +INSERT INTO `mob_skills` VALUES (707,451,'sentinel',0,7.0,2000,1500,4,0,0,0,0,0,0); -- INSERT INTO `mob_skills` VALUES (708,452,'last_resort',0,7.0,2000,1500,4,0,0,0,0,0,0); -- INSERT INTO `mob_skills` VALUES (709,453,'souleater',0,7.0,2000,1500,4,0,0,0,0,0,0); INSERT INTO `mob_skills` VALUES (710,438,'charm',0,18.0,2000,0,4,0,0,0,0,0,0); diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index 22048faf490..323673e2560 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -112,12 +112,12 @@ void CTrustController::DoCombatTick(time_point tick) m_LastTopEntity = currentTopEnmity; } - if (IsSpellReady(currentDistance) && TryCastSpell()) + POwner->PAI->EventHandler.triggerListener("COMBAT_TICK", POwner, POwner->PMaster, PTarget); + + if (IsSpellReady(currentDistance)) { - return; + TryCastSpell(); } - - POwner->PAI->EventHandler.triggerListener("COMBAT_TICK", POwner, POwner->PMaster, PTarget); } } From 3dc313cf6f8430d7b76bd889d4155717bb21f4ac Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Wed, 25 Mar 2020 14:34:25 +0200 Subject: [PATCH 108/116] Remove mobstyle spell casting and add basic curing for Kupipi --- scripts/globals/spells/trust/kupipi.lua | 19 +++++++++++++++++++ scripts/globals/spells/trust/shantotto.lua | 10 +--------- src/map/ai/controllers/mob_controller.cpp | 6 +++++- src/map/ai/controllers/trust_controller.cpp | 5 ----- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/scripts/globals/spells/trust/kupipi.lua b/scripts/globals/spells/trust/kupipi.lua index 311a63e4072..5c8f3d5a7cf 100644 --- a/scripts/globals/spells/trust/kupipi.lua +++ b/scripts/globals/spells/trust/kupipi.lua @@ -2,6 +2,7 @@ -- Trust: Kupipi ----------------------------------------- require("scripts/globals/trust") +require("scripts/globals/utils") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) @@ -11,3 +12,21 @@ end function onSpellCast(caster, target, spell) return tpz.trust.spawn(caster, spell) end + +function onMobSpawn(mob) + mob:addListener("COMBAT_TICK", "KUPIPI_COMBAT_TICK", function(trust, master, target) + function round(x) + return x >= 0 and math.floor(x + 0.5) or math.ceil(x - 0.5) + end + + local party = master:getPartyWithTrusts() + local lvl = trust:getMainLvl() + local maxCure = utils.clamp(round(lvl/8), 1, 6) + + for _, member in ipairs(party) do + if member:getHPP() <= 75 then + trust:castSpell(maxCure, member) + end + end + end) +end diff --git a/scripts/globals/spells/trust/shantotto.lua b/scripts/globals/spells/trust/shantotto.lua index 3ffd9615283..b706db11dd8 100644 --- a/scripts/globals/spells/trust/shantotto.lua +++ b/scripts/globals/spells/trust/shantotto.lua @@ -13,16 +13,8 @@ function onSpellCast(caster, target, spell) end function onMobSpawn(mob) - mob:addListener("ENMITY_CHANGED", "SHANTOTTO_ENMITY_CHANGED", function(trust, master, target) - local party = master:getPartyWithTrusts() - - -- Decision making here - end) - mob:addListener("COMBAT_TICK", "SHANTOTTO_COMBAT_TICK", function(trust, master, target) - local party = master:getPartyWithTrusts() - - -- Decision making here + trust:castSpell() end) end diff --git a/src/map/ai/controllers/mob_controller.cpp b/src/map/ai/controllers/mob_controller.cpp index b692ebdbb00..8c0d38571ef 100644 --- a/src/map/ai/controllers/mob_controller.cpp +++ b/src/map/ai/controllers/mob_controller.cpp @@ -478,7 +478,11 @@ void CMobController::CastSpell(SpellID spellid) { PCastTarget = PTarget; } - Cast(PCastTarget->targid, spellid); + + if (PCastTarget) + { + Cast(PCastTarget->targid, spellid); + } } } diff --git a/src/map/ai/controllers/trust_controller.cpp b/src/map/ai/controllers/trust_controller.cpp index 323673e2560..461c2a648d5 100644 --- a/src/map/ai/controllers/trust_controller.cpp +++ b/src/map/ai/controllers/trust_controller.cpp @@ -113,11 +113,6 @@ void CTrustController::DoCombatTick(time_point tick) } POwner->PAI->EventHandler.triggerListener("COMBAT_TICK", POwner, POwner->PMaster, PTarget); - - if (IsSpellReady(currentDistance)) - { - TryCastSpell(); - } } } From 093516dcb2c3a853c6abf73f12bd02d2690db8e5 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 26 Mar 2020 10:41:14 +0200 Subject: [PATCH 109/116] Review: Add trust I/II exclusions, fix copy-paste errors and typos --- scripts/globals/spells/trust/aldo.lua | 2 +- scripts/globals/spells/trust/aldo_uc.lua | 2 +- scripts/globals/spells/trust/arciela.lua | 2 +- scripts/globals/spells/trust/arciela_ii.lua | 4 ++-- scripts/globals/spells/trust/ayame.lua | 2 +- scripts/globals/spells/trust/ayame_uc.lua | 2 +- scripts/globals/spells/trust/balamor.lua | 2 +- scripts/globals/spells/trust/ingrid.lua | 2 +- scripts/globals/spells/trust/ingrid_ii.lua | 2 +- scripts/globals/spells/trust/iroha.lua | 2 +- scripts/globals/spells/trust/iroha_ii.lua | 2 +- scripts/globals/spells/trust/kuyin_hathdenna.lua | 2 +- scripts/globals/spells/trust/lilisette.lua | 2 +- scripts/globals/spells/trust/lilisette_ii.lua | 2 +- scripts/globals/spells/trust/lion.lua | 2 +- scripts/globals/spells/trust/lion_ii.lua | 2 +- scripts/globals/spells/trust/mumor.lua | 2 +- scripts/globals/spells/trust/mumor_ii.lua | 2 +- scripts/globals/spells/trust/naja_salaheem.lua | 2 +- scripts/globals/spells/trust/naja_uc.lua | 2 +- scripts/globals/spells/trust/nashmeira.lua | 2 +- scripts/globals/spells/trust/nashmeira_ii.lua | 2 +- scripts/globals/spells/trust/prishe.lua | 2 +- scripts/globals/spells/trust/prishe_ii.lua | 2 +- scripts/globals/spells/trust/tenzen.lua | 2 +- scripts/globals/spells/trust/tenzen_ii.lua | 2 +- scripts/globals/spells/trust/ygnas.lua | 2 +- 27 files changed, 28 insertions(+), 28 deletions(-) diff --git a/scripts/globals/spells/trust/aldo.lua b/scripts/globals/spells/trust/aldo.lua index 00e0dfec4e4..41c7093a5bf 100644 --- a/scripts/globals/spells/trust/aldo.lua +++ b/scripts/globals/spells/trust/aldo.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1007) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/aldo_uc.lua b/scripts/globals/spells/trust/aldo_uc.lua index a3f50669564..82ff442dfce 100644 --- a/scripts/globals/spells/trust/aldo_uc.lua +++ b/scripts/globals/spells/trust/aldo_uc.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 930) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/arciela.lua b/scripts/globals/spells/trust/arciela.lua index 9b6102e2704..9e37c20b87e 100644 --- a/scripts/globals/spells/trust/arciela.lua +++ b/scripts/globals/spells/trust/arciela.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1017) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/arciela_ii.lua b/scripts/globals/spells/trust/arciela_ii.lua index a18b62a8e74..1826c6e33b2 100644 --- a/scripts/globals/spells/trust/arciela_ii.lua +++ b/scripts/globals/spells/trust/arciela_ii.lua @@ -1,11 +1,11 @@ ----------------------------------------- --- Trust: Balamor +-- Trust: Arciela II ----------------------------------------- require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 965) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/ayame.lua b/scripts/globals/spells/trust/ayame.lua index aacbf93b4bf..e4762aac5ea 100644 --- a/scripts/globals/spells/trust/ayame.lua +++ b/scripts/globals/spells/trust/ayame.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1005) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/ayame_uc.lua b/scripts/globals/spells/trust/ayame_uc.lua index f9cbc692817..883fcfb6e12 100644 --- a/scripts/globals/spells/trust/ayame_uc.lua +++ b/scripts/globals/spells/trust/ayame_uc.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 900) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/balamor.lua b/scripts/globals/spells/trust/balamor.lua index aacbf93b4bf..a18b62a8e74 100644 --- a/scripts/globals/spells/trust/balamor.lua +++ b/scripts/globals/spells/trust/balamor.lua @@ -1,5 +1,5 @@ ----------------------------------------- --- Trust: Ayame +-- Trust: Balamor ----------------------------------------- require("scripts/globals/trust") ----------------------------------------- diff --git a/scripts/globals/spells/trust/ingrid.lua b/scripts/globals/spells/trust/ingrid.lua index 725b9c073ef..0f286e3ce7d 100644 --- a/scripts/globals/spells/trust/ingrid.lua +++ b/scripts/globals/spells/trust/ingrid.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1016) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/ingrid_ii.lua b/scripts/globals/spells/trust/ingrid_ii.lua index 7cab47507f7..48210eb9cb3 100644 --- a/scripts/globals/spells/trust/ingrid_ii.lua +++ b/scripts/globals/spells/trust/ingrid_ii.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 921) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/iroha.lua b/scripts/globals/spells/trust/iroha.lua index 7811b451370..ccc23bea78e 100644 --- a/scripts/globals/spells/trust/iroha.lua +++ b/scripts/globals/spells/trust/iroha.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1018) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/iroha_ii.lua b/scripts/globals/spells/trust/iroha_ii.lua index 57ce51af1a4..73cacbed4aa 100644 --- a/scripts/globals/spells/trust/iroha_ii.lua +++ b/scripts/globals/spells/trust/iroha_ii.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 997) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/kuyin_hathdenna.lua b/scripts/globals/spells/trust/kuyin_hathdenna.lua index dbfaa70c509..5eab2c07b77 100644 --- a/scripts/globals/spells/trust/kuyin_hathdenna.lua +++ b/scripts/globals/spells/trust/kuyin_hathdenna.lua @@ -1,5 +1,5 @@ ----------------------------------------- --- Trust: Kutin Hathdenna +-- Trust: Kuyin Hathdenna ----------------------------------------- require("scripts/globals/trust") ----------------------------------------- diff --git a/scripts/globals/spells/trust/lilisette.lua b/scripts/globals/spells/trust/lilisette.lua index 8b7837f583a..a5a4b2bf1a8 100644 --- a/scripts/globals/spells/trust/lilisette.lua +++ b/scripts/globals/spells/trust/lilisette.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1013) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/lilisette_ii.lua b/scripts/globals/spells/trust/lilisette_ii.lua index 43a81d7afec..c25883c430e 100644 --- a/scripts/globals/spells/trust/lilisette_ii.lua +++ b/scripts/globals/spells/trust/lilisette_ii.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 945) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/lion.lua b/scripts/globals/spells/trust/lion.lua index d602639b0cb..1cd4a0b04eb 100644 --- a/scripts/globals/spells/trust/lion.lua +++ b/scripts/globals/spells/trust/lion.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1009) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/lion_ii.lua b/scripts/globals/spells/trust/lion_ii.lua index 208790b4d89..9366c056930 100644 --- a/scripts/globals/spells/trust/lion_ii.lua +++ b/scripts/globals/spells/trust/lion_ii.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 907) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/mumor.lua b/scripts/globals/spells/trust/mumor.lua index d8cc8f09536..cb018df46ce 100644 --- a/scripts/globals/spells/trust/mumor.lua +++ b/scripts/globals/spells/trust/mumor.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1015) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/mumor_ii.lua b/scripts/globals/spells/trust/mumor_ii.lua index 8674c3a87ef..2f457e3cd27 100644 --- a/scripts/globals/spells/trust/mumor_ii.lua +++ b/scripts/globals/spells/trust/mumor_ii.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 946) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/naja_salaheem.lua b/scripts/globals/spells/trust/naja_salaheem.lua index b3c20302164..a9737261487 100644 --- a/scripts/globals/spells/trust/naja_salaheem.lua +++ b/scripts/globals/spells/trust/naja_salaheem.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1008) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/naja_uc.lua b/scripts/globals/spells/trust/naja_uc.lua index 3623a9cf25a..065f7cfd87c 100644 --- a/scripts/globals/spells/trust/naja_uc.lua +++ b/scripts/globals/spells/trust/naja_uc.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 912) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/nashmeira.lua b/scripts/globals/spells/trust/nashmeira.lua index eda2297fb22..122db74a50d 100644 --- a/scripts/globals/spells/trust/nashmeira.lua +++ b/scripts/globals/spells/trust/nashmeira.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1012) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/nashmeira_ii.lua b/scripts/globals/spells/trust/nashmeira_ii.lua index c85431e65fc..4f0291cc11b 100644 --- a/scripts/globals/spells/trust/nashmeira_ii.lua +++ b/scripts/globals/spells/trust/nashmeira_ii.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 923) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/prishe.lua b/scripts/globals/spells/trust/prishe.lua index 7c0a7056c8b..5b46f9d8a90 100644 --- a/scripts/globals/spells/trust/prishe.lua +++ b/scripts/globals/spells/trust/prishe.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1011) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/prishe_ii.lua b/scripts/globals/spells/trust/prishe_ii.lua index cce118d3858..6a8e4b78469 100644 --- a/scripts/globals/spells/trust/prishe_ii.lua +++ b/scripts/globals/spells/trust/prishe_ii.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 913) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/tenzen.lua b/scripts/globals/spells/trust/tenzen.lua index 6d36893f573..9f53734984a 100644 --- a/scripts/globals/spells/trust/tenzen.lua +++ b/scripts/globals/spells/trust/tenzen.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 1014) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/tenzen_ii.lua b/scripts/globals/spells/trust/tenzen_ii.lua index 109079bb071..4f988da7f42 100644 --- a/scripts/globals/spells/trust/tenzen_ii.lua +++ b/scripts/globals/spells/trust/tenzen_ii.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell) + return tpz.trust.canCast(caster, spell, 908) end function onSpellCast(caster, target, spell) diff --git a/scripts/globals/spells/trust/ygnas.lua b/scripts/globals/spells/trust/ygnas.lua index 1616fd29df5..2189e578be0 100644 --- a/scripts/globals/spells/trust/ygnas.lua +++ b/scripts/globals/spells/trust/ygnas.lua @@ -5,7 +5,7 @@ require("scripts/globals/trust") ----------------------------------------- function onMagicCastingCheck(caster, target, spell) - return tpz.trust.canCast(caster, spell, 1010) + return tpz.trust.canCast(caster, spell) end function onSpellCast(caster, target, spell) From 8e271353e36e81309a6bdb99db51d59483d96e57 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 26 Mar 2020 10:53:56 +0200 Subject: [PATCH 110/116] Review: Lua TODOs --- scripts/globals/trust.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/globals/trust.lua b/scripts/globals/trust.lua index f6a84ffe532..43659dea1e0 100644 --- a/scripts/globals/trust.lua +++ b/scripts/globals/trust.lua @@ -12,6 +12,8 @@ tpz.trust = tpz.trust or {} tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) + -- TODO: Each of these scenarios has its own message + -- Trusts not allowed in an alliance if caster:checkSoloPartyAlliance() == 2 then return tpz.msg.basic.TRUST_NO_CAST_TRUST @@ -29,6 +31,8 @@ tpz.trust.canCast = function(caster, spell, not_allowed_trust_ids) return tpz.msg.basic.TRUST_NO_CAST_TRUST end + -- TODO: Block summoning trusts if someone recently joined party + -- Check party for trusts local num_pt = 0 local num_trusts = 0 From 92a174f6ed991d45cc3262d7cbe839a182f7eae7 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 26 Mar 2020 10:56:35 +0200 Subject: [PATCH 111/116] Review: Core quick fixes --- src/map/entities/trustentity.cpp | 16 +++++----------- src/map/utils/trustutils.cpp | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/map/entities/trustentity.cpp b/src/map/entities/trustentity.cpp index 169eb42a673..c02bd8bb47c 100644 --- a/src/map/entities/trustentity.cpp +++ b/src/map/entities/trustentity.cpp @@ -50,21 +50,15 @@ void CTrustEntity::PostTick() { loc.zone->PushPacket(this, CHAR_INRANGE, new CEntityUpdatePacket(this, ENTITY_UPDATE, updatemask)); - if (PMaster) + if (PMaster && PMaster->PParty && updatemask & UPDATE_HP) { - if (updatemask & UPDATE_HP) + PMaster->ForParty([this](auto PMember) { - if (PMaster->PParty != nullptr) + if (PMember->objtype == TYPE_PC) { - PMaster->ForParty([this](auto PMember) - { - if (PMember->objtype == TYPE_PC) - { - static_cast(PMember)->pushPacket(new CCharHealthPacket(this)); - } - }); + static_cast(PMember)->pushPacket(new CCharHealthPacket(this)); } - } + }); } updatemask = 0; } diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index e6601acc008..dcb2dd6563a 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -444,7 +444,7 @@ void LoadTrustStatsAndSkills(CTrustEntity* PTrust) for (int i = SKILL_HAND_TO_HAND; i <= SKILL_STAFF; i++) { - uint16 maxSkill = battleutils::GetMaxSkill(3, mLvl > 99 ? 99 : mLvl); + uint16 maxSkill = battleutils::GetMaxSkill((SKILLTYPE)i, mLvl > 99 ? 99 : mLvl); if (maxSkill != 0) { PTrust->WorkingSkills.skill[i] = maxSkill; From 1c1d51edc9b3ea7e16fefeb5630c3d0d4bbb024b Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 26 Mar 2020 11:05:20 +0200 Subject: [PATCH 112/116] Review: Audit trusts jobs SQL --- sql/mob_pools.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sql/mob_pools.sql b/sql/mob_pools.sql index 9a45976dcc5..3cd7481803f 100644 --- a/sql/mob_pools.sql +++ b/sql/mob_pools.sql @@ -5970,7 +5970,7 @@ INSERT INTO `mob_pools` VALUES (5908,'tenzen','Tenzen',149,0x0000C40B00000000000 INSERT INTO `mob_pools` VALUES (5909,'mihli_aliapoh','MihliAliapoh',151,0x0000C50B00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5910,'valaineral','Valaineral',145,0x0000C60B00000000000000000000000000000000,7,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5911,'joachim','Joachim',149,0x0000C70B00000000000000000000000000000000,10,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5912,'naja_salaheem','NajaSalaheem',151,0x0000C80B00000000000000000000000000000000,6,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5912,'naja_salaheem','NajaSalaheem',151,0x0000C80B00000000000000000000000000000000,2,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5913,'prishe','Prishe',145,0x0000C90B00000000000000000000000000000000,2,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5914,'ulmia','Ulmia',145,0x0000CA0B00000000000000000000000000000000,10,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5915,'shikaree_z','ShikareeZ',151,0x0000CB0B00000000000000000000000000000000,14,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); @@ -6050,12 +6050,12 @@ INSERT INTO `mob_pools` VALUES (5988,'makki-chebukki','Makki-Chebukki',153,0x000 INSERT INTO `mob_pools` VALUES (5989,'king_of_hearts','KingOfHearts',61,0x0000230C00000000000000000000000000000000,5,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5990,'morimar','Morimar',149,0x0000240C00000000000000000000000000000000,9,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5991,'darrcuiln','Darrcuiln',489,0x0000250C00000000000000000000000000000000,1,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5992,'aahm','ArkHM',149,0x0000290C00000000000000000000000000000000,13,1,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5992,'aahm','ArkHM',149,0x0000290C00000000000000000000000000000000,1,13,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5993,'aaev','ArkEV',145,0x00002A0C00000000000000000000000000000000,7,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5994,'aamr','ArkMR',151,0x00002B0C00000000000000000000000000000000,9,6,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5995,'aatt','ArkTT',153,0x00002C0C00000000000000000000000000000000,4,8,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5996,'aagk','ArkGK',146,0x00002D0C00000000000000000000000000000000,12,14,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (5997,'iroha','Iroha',149,0x0000270C00000000000000000000000000000000,4,12,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (5997,'iroha','Iroha',149,0x0000270C00000000000000000000000000000000,12,4,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5998,'ygnas','Ygnas',455,0x00002E0C00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (5999,'monberaux','Monberaux',145,0x0000260300000000000000000000000000000000,21,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -- Reserved for future Trust 6000 @@ -6074,9 +6074,9 @@ INSERT INTO `mob_pools` VALUES (6012,'nashmeira_ii','Nashmeira',149,0x00000B0C00 INSERT INTO `mob_pools` VALUES (6013,'lilisette_ii','Lilisette',484,0x00000C0C00000000000000000000000000000000,19,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (6014,'tenzen_ii','Tenzen',149,0x0000190C00000000000000000000000000000000,12,11,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (6015,'mumor_ii','Mumor',149,0x0000200C00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6016,'ingrid_ii','Ingrid',149,0x00001E0C00000000000000000000000000000000,4,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6016,'ingrid_ii','Ingrid',149,0x00001E0C00000000000000000000000000000000,3,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (6017,'arciela_ii','Arciela',149,0x00000D0C00000000000000000000000000000000,5,0,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); -INSERT INTO `mob_pools` VALUES (6018,'iroha_ii','Iroha',149,0x0000280C00000000000000000000000000000000,3,12,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); +INSERT INTO `mob_pools` VALUES (6018,'iroha_ii','Iroha',149,0x0000280C00000000000000000000000000000000,12,3,3,240,100,0,0,0,0,0,0,32,0,3,0,0,0,1,0,0); INSERT INTO `mob_pools` VALUES (6019,'shantotto_ii','Shantotto',153,0x0000260C00000000000000000000000000000000,4,0,2,240,100,0,2,0,0,0,0,32,0,3,0,0,313,1,0,0); -- Reserved for future Trust 6020 -- Reserved for future Trust 6021 From 997146af9d45604fa908a4c4c5d6583c831e7b07 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 26 Mar 2020 11:34:42 +0200 Subject: [PATCH 113/116] Clean up trustData search --- src/map/utils/trustutils.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/map/utils/trustutils.cpp b/src/map/utils/trustutils.cpp index dcb2dd6563a..3afeed1937b 100644 --- a/src/map/utils/trustutils.cpp +++ b/src/map/utils/trustutils.cpp @@ -260,14 +260,7 @@ CTrustEntity* LoadTrust(CCharEntity* PMaster, uint32 TrustID) CTrustEntity* PTrust = new CTrustEntity(PMaster); Trust_t* trustData = new Trust_t(); - for (uint32 index = 0; index < g_PTrustList.size(); index++) - { - if (g_PTrustList.at(index)->trustID == TrustID) - { - trustData = g_PTrustList.at(index); - break; - } - } + trustData = *std::find_if(g_PTrustList.begin(), g_PTrustList.end(), [TrustID](Trust_t* t) { return t->trustID == TrustID; }); PTrust->loc = PMaster->loc; PTrust->m_OwnerID.id = PMaster->id; From 1b7e74e988abc123396472c1ce7dc63ea840a935 Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 26 Mar 2020 11:47:59 +0200 Subject: [PATCH 114/116] More obvious usage of GetName() and packetName in packets --- src/map/entities/trustentity.cpp | 5 +++++ src/map/entities/trustentity.h | 5 +++++ src/map/packets/trust_sync.cpp | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/map/entities/trustentity.cpp b/src/map/entities/trustentity.cpp index c02bd8bb47c..90e8df9ee79 100644 --- a/src/map/entities/trustentity.cpp +++ b/src/map/entities/trustentity.cpp @@ -43,6 +43,11 @@ CTrustEntity::CTrustEntity(CCharEntity* PChar) PAI = std::make_unique(this, std::make_unique(this), std::make_unique(PChar, this), std::make_unique(this)); } +const int8* CTrustEntity::GetName() +{ + return (const int8*)packetName.c_str(); +} + void CTrustEntity::PostTick() { CBattleEntity::PostTick(); diff --git a/src/map/entities/trustentity.h b/src/map/entities/trustentity.h index 78862db9352..7e46682cb4c 100644 --- a/src/map/entities/trustentity.h +++ b/src/map/entities/trustentity.h @@ -31,6 +31,11 @@ class CTrustEntity : public CMobEntity explicit CTrustEntity(CCharEntity*); ~CTrustEntity() override = default; + // Note: The default name is the lowercase spell script name, so we override GetName() + // to return the packetName instead, which makes the behaviour consistant with other uses + // of GetName() + const int8* GetName() override; + void PostTick() override; void FadeOut() override; void Die() override; diff --git a/src/map/packets/trust_sync.cpp b/src/map/packets/trust_sync.cpp index 1746407fcb7..8ef08227c56 100644 --- a/src/map/packets/trust_sync.cpp +++ b/src/map/packets/trust_sync.cpp @@ -44,8 +44,8 @@ CTrustSyncPacket::CTrustSyncPacket(CCharEntity* PChar, CTrustEntity* PTrust) ref(0x08) = PTrust->id; ref(0x0C) = PChar->targid; - packBitsBE(data + (0x04), (0x18) + PTrust->name.size(), 0, 6, 10); // Message Size - memcpy(data + (0x18), PTrust->GetName(), PTrust->name.size()); + packBitsBE(data + (0x04), (0x18) + PTrust->packetName.size(), 0, 6, 10); // Message Size + memcpy(data + (0x18), PTrust->packetName.c_str(), PTrust->packetName.size()); // Unknown ref(0x10) = 0x04; From a9f6110ac580bc05465cf02589b4e01c52f7e45d Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 26 Mar 2020 12:04:17 +0200 Subject: [PATCH 115/116] Clear StateStack on Die() --- src/map/entities/trustentity.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/map/entities/trustentity.cpp b/src/map/entities/trustentity.cpp index 90e8df9ee79..b31d63ee80b 100644 --- a/src/map/entities/trustentity.cpp +++ b/src/map/entities/trustentity.cpp @@ -78,6 +78,7 @@ void CTrustEntity::FadeOut() void CTrustEntity::Die() { luautils::OnMobDeath(this, nullptr); + PAI->ClearStateStack(); PAI->Internal_Die(0s); ((CCharEntity*)PMaster)->RemoveTrust(this); CBattleEntity::Die(); From 6853f99b9f2052ab3c3ff7ac16363e4a14d116ce Mon Sep 17 00:00:00 2001 From: Zach Toogood Date: Thu, 26 Mar 2020 19:06:04 +0200 Subject: [PATCH 116/116] ForParty is guaranteed to only be CCharEntity types --- src/map/entities/trustentity.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/map/entities/trustentity.cpp b/src/map/entities/trustentity.cpp index b31d63ee80b..5284b135b3f 100644 --- a/src/map/entities/trustentity.cpp +++ b/src/map/entities/trustentity.cpp @@ -59,10 +59,7 @@ void CTrustEntity::PostTick() { PMaster->ForParty([this](auto PMember) { - if (PMember->objtype == TYPE_PC) - { - static_cast(PMember)->pushPacket(new CCharHealthPacket(this)); - } + static_cast(PMember)->pushPacket(new CCharHealthPacket(this)); }); } updatemask = 0;