-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AMK][Lua] Cardian orb drop mechanic #4800
Merged
zach2good
merged 2 commits into
LandSandBoat:feature/amk_missions
from
Flibe-XI:cardian-orbs
Jan 3, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,44 @@ 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 == nil or | ||
player:getCurrentMission(xi.mission.log_id.AMK) < xi.mission.id.amk.AN_ERRAND_THE_PROFESSORS_PRICE | ||
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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
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 = | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
11 changes: 11 additions & 0 deletions
11
scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Batons.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
11 changes: 11 additions & 0 deletions
11
scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Coins.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
11 changes: 11 additions & 0 deletions
11
scripts/zones/Outer_Horutoto_Ruins/mobs/Three_of_Swords.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the conditions for cardians to drop this key item? Can the item drop forever if you've completed AMK? Or do they only drop during this mission and if you want repeat KIs then you have to buy them from squintox?
Either way, your most recent commit removed the mission check all together
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what happens when I try to rush something at work. I'll focus and fix it when I get home.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't, however, find any information about whether or not the key items can drop before flagging mission 6 from shantotto.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Easy to go get caps on retail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For now, this condition seems fine:
player:getCurrentMission(xi.mission.log_id.AMK) < xi.mission.id.amk.AN_ERRAND_THE_PROFESSORS_PRICE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a request in FFXI Captures discord. I don't have a retail account personally.