-
Notifications
You must be signed in to change notification settings - Fork 624
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
[AMK][Lua] Cardian orb drop mechanic #4800
Conversation
Well well well, the questions from my other PR comment are answered :D |
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.
As a note to passers-by, another way of doing this would have been to create and apply the cardian
family mixin to all these files - resulting in the same one-line-per-file change. These mobs aren't particularly special, so there's little difference in either approach. The meat is in the new helper.
scripts/missions/amk/helpers.lua
Outdated
-- 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 then |
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.
If the cardian dies from DoT, player will be nil - should be checking for that
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 comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
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) |
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.
Not seeing any regime pages that use Two of Swords
https://www.bg-wiki.com/ffxi/Grounds_of_Valor#Outer_Horutoto_Ruins
Watch what you copy and paste. Make sure the things you add actually belong in new mob scripts.
6869e35
to
c2f0514
Compare
Good to know thanks. Also, I spoke with Xaver about possibly creating different mob_family_system ids for each type of cardian, as they are supposed to drop different crystals, but they are all the same element currently. When they are all different families, the orb can be removed as an argument and the KI's can just be mapped to the family and determined by mob:getFamily() with the helpers function. Probably not worth the effort and is fine the way it is. |
scripts/missions/amk/helpers.lua
Outdated
player:getCurrentMission(xi.mission.log_id.AMK) < xi.mission.id.amk.AN_ERRAND_THE_PROFESSORS_PRICE or | ||
player == nil or | ||
orb == nil |
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 new change won't work, because you're checking the player's mission before you're checking if player is really there.
Lua properly has short-circuit logic, so you can just move the check for player or orb being nil before the mission check and you'll be fine.
https://www.tutorialspoint.com/execute_lua_online.php :
local player = nil
if player == nil or player:thisFunctionDoesntExist() == true then
print("Short circuit success")
end
Prints correctly.
if
player == nil or
player:getCurrentMission(xi.mission.log_id.AMK) < xi.mission.id.amk.AN_ERRAND_THE_PROFESSORS_PRICE or
You don't need to check whether or not orb is nil, because you're the one making the call and you know you've populated it
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.
D'oh! Understood, thanks. Will fix soon.
Don't worry about the family/crystal stuff, that's out of the scope of this PR |
@@ -57,11 +57,7 @@ end | |||
-- 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) |
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.
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.
ab8cfb9
to
f4d8d0d
Compare
f4d8d0d
to
be153c9
Compare
* AMK6: Added mechanic to drop KI orbs for cardians * Fixed null player check
* AMK6: Added mechanic to drop KI orbs for cardians * Fixed null player check
* AMK6: Added mechanic to drop KI orbs for cardians * Fixed null player check
I affirm:
What does this pull request do?
Adds a function to cardians in outer horutoto ruins that allows them to drop their respective key items "orb of sword/baton/coin/cup" for AMK mission 6.
Steps to test these changes
!addmission 10 5
Kill cardians in outer horutoto ruins until they cause the player to obtain their key items. If the player isn't on the right mission, or already has the orb, the orb won't drop and no error is caused.
The drop rate has very little information other than the level of the mob is involved, and the higher the level, the higher the droprate. Some sources say drop rate on lower level mobs is very poor, so the range is set it at is between 4 - 25.8%, which increases with size of the party as well.