From c2f0514b95af5c9061108dd5f43b77e7bb9eb3c8 Mon Sep 17 00:00:00 2001 From: Flibe Date: Sun, 3 Dec 2023 20:48:03 -0500 Subject: [PATCH 1/2] AMK6: Added mechanic to drop KI orbs for cardians --- scripts/missions/amk/helpers.lua | 39 +++++++++++++++++++ .../mobs/Eight_of_Batons.lua | 1 + .../mobs/Eight_of_Coins.lua | 1 + .../mobs/Eight_of_Cups.lua | 1 + .../mobs/Eight_of_Swords.lua | 1 + .../mobs/Five_of_Batons.lua | 1 + .../mobs/Five_of_Coins.lua | 1 + .../mobs/Five_of_Cups.lua | 1 + .../mobs/Five_of_Swords.lua | 1 + .../mobs/Four_of_Batons.lua | 1 + .../mobs/Four_of_Coins.lua | 1 + .../mobs/Four_of_Cups.lua | 1 + .../mobs/Four_of_Swords.lua | 1 + .../mobs/Nine_of_Batons.lua | 1 + .../mobs/Nine_of_Coins.lua | 1 + .../mobs/Nine_of_Cups.lua | 1 + .../mobs/Nine_of_Swords.lua | 1 + .../mobs/Seven_of_Batons.lua | 1 + .../mobs/Seven_of_Coins.lua | 1 + .../mobs/Seven_of_Cups.lua | 1 + .../mobs/Seven_of_Swords.lua | 1 + .../mobs/Six_of_Batons.lua | 1 + .../mobs/Six_of_Coins.lua | 1 + .../Outer_Horutoto_Ruins/mobs/Six_of_Cups.lua | 1 + .../mobs/Six_of_Swords.lua | 1 + .../mobs/Ten_of_Batons.lua | 11 ++++++ .../mobs/Ten_of_Coins.lua | 11 ++++++ .../Outer_Horutoto_Ruins/mobs/Ten_of_Cups.lua | 11 ++++++ .../mobs/Ten_of_Swords.lua | 11 ++++++ .../mobs/Three_of_Batons.lua | 11 ++++++ .../mobs/Three_of_Coins.lua | 11 ++++++ .../mobs/Three_of_Cups.lua | 11 ++++++ .../mobs/Three_of_Swords.lua | 11 ++++++ .../mobs/Two_of_Batons.lua | 11 ++++++ .../mobs/Two_of_Coins.lua | 11 ++++++ .../Outer_Horutoto_Ruins/mobs/Two_of_Cups.lua | 11 ++++++ .../mobs/Two_of_Swords.lua | 11 ++++++ 37 files changed, 195 insertions(+) create mode 100644 scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Batons.lua create mode 100644 scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Coins.lua create mode 100644 scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Cups.lua create mode 100644 scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Swords.lua create mode 100644 scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Batons.lua create mode 100644 scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Coins.lua create mode 100644 scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Cups.lua create mode 100644 scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Swords.lua create mode 100644 scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Batons.lua create mode 100644 scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Coins.lua create mode 100644 scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Cups.lua create mode 100644 scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Swords.lua diff --git a/scripts/missions/amk/helpers.lua b/scripts/missions/amk/helpers.lua index 342c4c8cb6f..5459956c686 100644 --- a/scripts/missions/amk/helpers.lua +++ b/scripts/missions/amk/helpers.lua @@ -52,6 +52,45 @@ xi.amk.helpers.helmTrade = function(player, helmType, broke) end end +-- AMK 6 (index 5) - An Errand! The Professor's Price +-- Cardian orb KI logic: All or nothing drop of the orb is handled by +-- a local var that is set once by the first player is called by onMobDeath +-- The rest of the players in alliance get the same outcome as the first +xi.amk.helpers.cardianOrbDrop = function(mob, player, orb) + if + player:getCurrentMission(xi.mission.log_id.AMK) < xi.mission.id.amk.AN_ERRAND_THE_PROFESSORS_PRICE or + player == nil or + orb == nil + then + return + end + + -- Chance of drop increases both based on size of party and level of mob killed + if mob:getLocalVar('Mission[10][5]cardianOrbDrop') == 0 then + local partySize = 0 + for _, member in pairs(player:getAlliance()) do + if member:getZoneID() == xi.zone.OUTER_HORUTOTO_RUINS then + partySize = partySize + 1 + end + end + + -- Chance ranges from 4% to 25.8% (based on max mob lvl of 44) + local dropChance = (3 * mob:getMainLvl()) + (30 * utils.clamp(partySize, 1, 6)) - 10 + local roll = math.random(1000) + + if roll < dropChance then + mob:setLocalVar('Mission[10][5]cardianOrbDrop', 1) + else + mob:setLocalVar('Mission[10][5]cardianOrbDrop', 2) + end + end + + -- Give orb + if mob:getLocalVar('Mission[10][5]cardianOrbDrop') == 1 then + npcUtil.giveKeyItem(player, orb) + end +end + -- AMK 7 (index 6) - Select/lookup the digging zone local digZoneIds = { diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Batons.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Batons.lua index c1ee6739f5e..9dd9f1bc3a8 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Batons.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Batons.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_BATONS) xi.regime.checkRegime(player, mob, 667, 2, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Coins.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Coins.lua index 3f627f6eb96..3722d036f5f 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Coins.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Coins.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_COINS) xi.regime.checkRegime(player, mob, 667, 4, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Cups.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Cups.lua index c30f35e503e..dc64bbe6e56 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Cups.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Cups.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_CUPS) xi.regime.checkRegime(player, mob, 667, 1, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Swords.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Swords.lua index 6c2ccf9555d..7722e7630da 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Swords.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Eight_of_Swords.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_SWORDS) xi.regime.checkRegime(player, mob, 667, 3, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Batons.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Batons.lua index 649150323bb..41f7ca6b410 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Batons.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Batons.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_BATONS) xi.regime.checkRegime(player, mob, 664, 2, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Coins.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Coins.lua index 80396770670..0c5229eb264 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Coins.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Coins.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_COINS) xi.regime.checkRegime(player, mob, 664, 4, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Cups.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Cups.lua index 4a3bd4084df..6ba31bbf850 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Cups.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Cups.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_CUPS) xi.regime.checkRegime(player, mob, 664, 1, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Swords.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Swords.lua index 4b8190902bf..da7f2dcda9f 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Swords.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Five_of_Swords.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_SWORDS) xi.regime.checkRegime(player, mob, 664, 3, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Batons.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Batons.lua index ea7d8165cca..f111721970d 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Batons.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Batons.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_BATONS) xi.regime.checkRegime(player, mob, 663, 2, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Coins.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Coins.lua index 152d6cec866..7c91d0a2c61 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Coins.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Coins.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_COINS) xi.regime.checkRegime(player, mob, 663, 4, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Cups.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Cups.lua index e50ef442f48..970a65cb05a 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Cups.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Cups.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_CUPS) xi.regime.checkRegime(player, mob, 663, 1, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Swords.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Swords.lua index ec930fa90e4..24fcaf22e97 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Swords.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Four_of_Swords.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_SWORDS) xi.regime.checkRegime(player, mob, 663, 3, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Batons.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Batons.lua index e33fc17712d..a6ae2570400 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Batons.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Batons.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_BATONS) xi.regime.checkRegime(player, mob, 668, 2, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Coins.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Coins.lua index 78b7d1c4285..cdb61fb2cd6 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Coins.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Coins.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_COINS) xi.regime.checkRegime(player, mob, 668, 4, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Cups.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Cups.lua index 5ab96fb628a..dc703dc4b66 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Cups.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Cups.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_CUPS) xi.regime.checkRegime(player, mob, 668, 1, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Swords.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Swords.lua index 1d091c79e63..d136d0b2f12 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Swords.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Nine_of_Swords.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_SWORDS) xi.regime.checkRegime(player, mob, 668, 3, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Batons.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Batons.lua index cbb5109d367..521759c1772 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Batons.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Batons.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_BATONS) xi.regime.checkRegime(player, mob, 666, 2, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Coins.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Coins.lua index c35f53b4ca0..7c86e47b85d 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Coins.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Coins.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_COINS) xi.regime.checkRegime(player, mob, 666, 4, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Cups.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Cups.lua index 9bf195d31f5..44ebb332445 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Cups.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Cups.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_CUPS) xi.regime.checkRegime(player, mob, 666, 1, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Swords.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Swords.lua index 21e9ad9b52e..4402db986bd 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Swords.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Seven_of_Swords.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_SWORDS) xi.regime.checkRegime(player, mob, 666, 3, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Batons.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Batons.lua index 0eeb03a667b..ec348c6ea76 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Batons.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Batons.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_BATONS) xi.regime.checkRegime(player, mob, 665, 2, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Coins.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Coins.lua index 0f06e58b6a7..b774074dd69 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Coins.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Coins.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_COINS) xi.regime.checkRegime(player, mob, 665, 4, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Cups.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Cups.lua index 1d6c3de6e8e..df146c392f7 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Cups.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Cups.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_CUPS) xi.regime.checkRegime(player, mob, 665, 1, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Swords.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Swords.lua index 66fcdb7bdaa..cc6fb2565bb 100644 --- a/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Swords.lua +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Six_of_Swords.lua @@ -5,6 +5,7 @@ local entity = {} entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_SWORDS) xi.regime.checkRegime(player, mob, 665, 3, xi.regime.type.GROUNDS) end diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Batons.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Batons.lua new file mode 100644 index 00000000000..6fb578b6966 --- /dev/null +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Batons.lua @@ -0,0 +1,11 @@ +----------------------------------- +-- Area: Outer Horutoto Ruins +-- Mob: Ten of Batons +----------------------------------- +local entity = {} + +entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_BATONS) +end + +return entity diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Coins.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Coins.lua new file mode 100644 index 00000000000..a1c1535737d --- /dev/null +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Coins.lua @@ -0,0 +1,11 @@ +----------------------------------- +-- Area: Outer Horutoto Ruins +-- Mob: Ten of Coins +----------------------------------- +local entity = {} + +entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_COINS) +end + +return entity diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Cups.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Cups.lua new file mode 100644 index 00000000000..f0bd9109cd0 --- /dev/null +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Cups.lua @@ -0,0 +1,11 @@ +----------------------------------- +-- Area: Outer Horutoto Ruins +-- Mob: Ten of Cups +----------------------------------- +local entity = {} + +entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_CUPS) +end + +return entity diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Swords.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Swords.lua new file mode 100644 index 00000000000..6af9e9cbaa1 --- /dev/null +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Ten_of_Swords.lua @@ -0,0 +1,11 @@ +----------------------------------- +-- Area: Outer Horutoto Ruins +-- Mob: Ten of Swords +----------------------------------- +local entity = {} + +entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_SWORDS) +end + +return entity diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Batons.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Batons.lua new file mode 100644 index 00000000000..b7ee941c575 --- /dev/null +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Batons.lua @@ -0,0 +1,11 @@ +----------------------------------- +-- Area: Outer Horutoto Ruins +-- Mob: Three of Batons +----------------------------------- +local entity = {} + +entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_BATONS) +end + +return entity diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Coins.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Coins.lua new file mode 100644 index 00000000000..7b59569420d --- /dev/null +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Coins.lua @@ -0,0 +1,11 @@ +----------------------------------- +-- Area: Outer Horutoto Ruins +-- Mob: Three of Coins +----------------------------------- +local entity = {} + +entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_COINS) +end + +return entity diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Cups.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Cups.lua new file mode 100644 index 00000000000..7b58d49c643 --- /dev/null +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Cups.lua @@ -0,0 +1,11 @@ +----------------------------------- +-- Area: Outer Horutoto Ruins +-- Mob: Three of Cups +----------------------------------- +local entity = {} + +entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_CUPS) +end + +return entity diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Swords.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Swords.lua new file mode 100644 index 00000000000..38d5763201c --- /dev/null +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Swords.lua @@ -0,0 +1,11 @@ +----------------------------------- +-- Area: Outer Horutoto Ruins +-- Mob: Three of Swords +----------------------------------- +local entity = {} + +entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_SWORDS) +end + +return entity diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Batons.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Batons.lua new file mode 100644 index 00000000000..54dcf931673 --- /dev/null +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Batons.lua @@ -0,0 +1,11 @@ +----------------------------------- +-- Area: Outer Horutoto Ruins +-- Mob: Two of Batons +----------------------------------- +local entity = {} + +entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_BATONS) +end + +return entity diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Coins.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Coins.lua new file mode 100644 index 00000000000..239e5564933 --- /dev/null +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Coins.lua @@ -0,0 +1,11 @@ +----------------------------------- +-- Area: Outer Horutoto Ruins +-- Mob: Two of Coins +----------------------------------- +local entity = {} + +entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_COINS) +end + +return entity diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Cups.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Cups.lua new file mode 100644 index 00000000000..3ffae546928 --- /dev/null +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Cups.lua @@ -0,0 +1,11 @@ +----------------------------------- +-- Area: Outer Horutoto Ruins +-- Mob: Two of Cups +----------------------------------- +local entity = {} + +entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_CUPS) +end + +return entity diff --git a/scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Swords.lua b/scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Swords.lua new file mode 100644 index 00000000000..ff53c2c0e89 --- /dev/null +++ b/scripts/zones/Outer_Horutoto_Ruins/mobs/Two_of_Swords.lua @@ -0,0 +1,11 @@ +----------------------------------- +-- Area: Outer Horutoto Ruins +-- Mob: Two of Swords +----------------------------------- +local entity = {} + +entity.onMobDeath = function(mob, player, optParams) + xi.amk.helpers.cardianOrbDrop(mob, player, xi.ki.ORB_OF_SWORDS) +end + +return entity From be153c9c5014aea094f31169c9778c1bb8c25535 Mon Sep 17 00:00:00 2001 From: Flibe Date: Mon, 4 Dec 2023 21:20:06 -0500 Subject: [PATCH 2/2] Fixed null player check --- scripts/missions/amk/helpers.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/missions/amk/helpers.lua b/scripts/missions/amk/helpers.lua index 5459956c686..b0357a4cdb5 100644 --- a/scripts/missions/amk/helpers.lua +++ b/scripts/missions/amk/helpers.lua @@ -58,9 +58,8 @@ end -- The rest of the players in alliance get the same outcome as the first xi.amk.helpers.cardianOrbDrop = function(mob, player, orb) if - player:getCurrentMission(xi.mission.log_id.AMK) < xi.mission.id.amk.AN_ERRAND_THE_PROFESSORS_PRICE or player == nil or - orb == nil + player:getCurrentMission(xi.mission.log_id.AMK) < xi.mission.id.amk.AN_ERRAND_THE_PROFESSORS_PRICE then return end