Skip to content

Commit

Permalink
Merge pull request #6932 from KnowOne134/Quest-Die_Cast
Browse files Browse the repository at this point in the history
[Quest][lua][sql] The Die is Cast
  • Loading branch information
claywar authored Feb 6, 2025
2 parents 0fb4cfd + dfff3ab commit b9d52ab
Show file tree
Hide file tree
Showing 13 changed files with 240 additions and 12 deletions.
1 change: 1 addition & 0 deletions scripts/enum/item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5709,6 +5709,7 @@ xi.item =
EMPRESS_BAND = 15762,
EMPEROR_BAND = 15763,
OLDUUM_RING = 15769,
RANDOM_RING = 15770,
IMPERIAL_RING = 15773,
STORM_RING = 15774,
UNFETTERED_RING = 15775,
Expand Down
2 changes: 1 addition & 1 deletion scripts/globals/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ xi.quest.id =
SUCH_SWEET_SORROW = 13, -- + Converted
FEAR_OF_THE_DARK_II = 14, -- + Converted
COOK_A_ROON = 15, -- + Converted
THE_DIE_IS_CAST = 16,
THE_DIE_IS_CAST = 16, -- + Converted
TWO_HORN_THE_SAVAGE = 17,
TOTOROONS_TREASURE_HUNT = 18,
WHAT_FRIENDS_ARE_FOR = 19, -- + Converted
Expand Down
34 changes: 34 additions & 0 deletions scripts/items/random_ring.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
-----------------------------------
-- ID: 15770
-- Item: Random Ring
-- Item Effect: Enchantment Dex + math.random(1, 8)
-- Duration: 30 Mins
-----------------------------------
---@type TItem
local itemObject = {}

itemObject.onItemCheck = function(target, item, param, caster)
if target:getStatusEffectBySource(xi.effect.ENCHANTMENT, xi.effectSourceType.EQUIPPED_ITEM, xi.item.RANDOM_RING) ~= nil then
target:delStatusEffect(xi.effect.ENCHANTMENT, nil, xi.effectSourceType.EQUIPPED_ITEM, xi.item.RANDOM_RING)
end

return 0
end

itemObject.onItemUse = function(target)
if target:hasEquipped(xi.item.RANDOM_RING) then
local power = math.random(1, 8)

target:addStatusEffect(xi.effect.ENCHANTMENT, power, 0, 3600, 0, 0, 0, xi.effectSourceType.EQUIPPED_ITEM, xi.item.RANDOM_RING)
end
end

itemObject.onEffectGain = function(target, effect)
target:addMod(xi.mod.DEX, effect:getPower())
end

itemObject.onEffectLose = function(target, effect)
target:delMod(xi.mod.DEX, effect:getPower())
end

return itemObject
159 changes: 159 additions & 0 deletions scripts/quests/ahtUrhgan/The_Die_is_Cast.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
-----------------------------------
-- The Die is Cast
-- Random Ring
-----------------------------------
-- Log ID: 6, Quest ID: 16
-- Ratihb: !pos 75.225 -6.000 -137.203 50
-- Ekhu Pesshyadha: !pos -13.043 0.999 103.423 50
-- Jijiroon: !pos 15.913 0.000 -32.676 53
-- qm9: !pos 311.088 -3.674 170.124 54
-----------------------------------

local ID = zones[xi.zone.ARRAPAGO_REEF]
local quest = Quest:new(xi.questLog.AHT_URHGAN, xi.quest.id.ahtUrhgan.THE_DIE_IS_CAST)

quest.reward =
{
item = xi.item.RANDOM_RING,
}

quest.sections =
{
{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_AVAILABLE
end,

[xi.zone.AHT_URHGAN_WHITEGATE] =
{
['Ratihb'] = quest:progressEvent(591),

onEventFinish =
{
[591] = function(player, csid, option, npc)
quest:begin(player)
end,
},
},
},
{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_ACCEPTED and
vars.Prog == 0
end,

[xi.zone.AHT_URHGAN_WHITEGATE] =
{
['Ekhu_Pesshyadha'] = quest:progressEvent(592),

onEventFinish =
{
[592] = function(player, csid, option, npc)
quest:setVar(player, 'Prog', 1)
end,
},
},
},
{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_ACCEPTED and
vars.Prog == 1
end,

[xi.zone.NASHMAU] =
{
['Jijiroon'] = quest:progressEvent(245),

onEventFinish =
{
[245] = function(player, csid, option, npc)
quest:setVar(player, 'Prog', 2)
end,
},
},
},
{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_ACCEPTED and
vars.Prog == 2
end,

[xi.zone.ARRAPAGO_REEF] =
{
['qm9'] = quest:progressEvent(212),

onEventFinish =
{
[212] = function(player, csid, option, npc)
quest:setVar(player, 'Prog', 3)
end,
},
},
},
{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_ACCEPTED and
vars.Prog == 3
end,

[xi.zone.ARRAPAGO_REEF] =
{
['qm9'] =
{
onTrigger = function(player, npc)
if npcUtil.popFromQM(player, npc, ID.mob.BUKKI, { hide = 0 }) then
return quest:messageSpecial(ID.text.SPINE_CHILL)
end
end,
},

['Bukki'] =
{
onMobDeath = function(mob, player, optParams)
quest:setVar(player, 'Prog', 4)
end,
},
},
},
{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_ACCEPTED and
vars.Prog == 4
end,

[xi.zone.ARRAPAGO_REEF] =
{
['qm9'] = quest:progressEvent(213),

onEventFinish =
{
[213] = function(player, csid, option, npc)
quest:setVar(player, 'Prog', 5)
npcUtil.giveKeyItem(player, xi.ki.BAG_OF_GOLD_PIECES)
end,
},
},
},
{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_ACCEPTED and
vars.Prog == 5
end,

[xi.zone.AHT_URHGAN_WHITEGATE] =
{
['Ratihb'] = quest:progressEvent(593),

onEventFinish =
{
[593] = function(player, csid, option, npc)
if quest:complete(player) then
player:delKeyItem(xi.ki.BAG_OF_GOLD_PIECES)
end
end,
},
},
},
}

return quest
1 change: 1 addition & 0 deletions scripts/zones/Aht_Urhgan_Whitegate/DefaultActions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ return {
['Burnished_Bones'] = { event = 228 },
['Cacaroon'] = { event = 248 },
['Dhima_Polevhia'] = { event = 788 },
['Ekhu_Pesshyadha'] = { event = 532 },
['Esoteric_Hound'] = { event = 229 },
['Fari-Wari'] = { event = 831 },
['Furious_Boulder'] = { event = 230 },
Expand Down
11 changes: 6 additions & 5 deletions scripts/zones/Arrapago_Reef/DefaultActions.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
local ID = zones[xi.zone.ARRAPAGO_REEF]

return {
['qm1'] = { messageSpecial = ID.text.SLIMY_TOUCH },
['qm2'] = { messageSpecial = ID.text.GLITTERING_FRAGMENTS },
['qm3'] = { messageSpecial = ID.text.FLUTTERY_OBJECTS },
['qm4'] = { messageSpecial = ID.text.STIFLING_STENCH },
['qm10'] = { messageSpecial = ID.text.NOTHING_OUT_OF_ORDINARY },
['qm1'] = { special = ID.text.SLIMY_TOUCH },
['qm2'] = { special = ID.text.GLITTERING_FRAGMENTS },
['qm3'] = { special = ID.text.FLUTTERY_OBJECTS },
['qm4'] = { special = ID.text.STIFLING_STENCH },
['qm9'] = { special = ID.text.NOTHING_OUT_OF_ORDINARY },
['qm10'] = { special = ID.text.NOTHING_OUT_OF_ORDINARY },
}
2 changes: 2 additions & 0 deletions scripts/zones/Arrapago_Reef/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ zones[xi.zone.ARRAPAGO_REEF] =
THE_PARTY_WILL_BE_REMOVED = 7903, -- If all party members' HP are still zero after # minute[/s], the party will be removed from the battlefield.
YOU_NO_REQS = 7907, -- You do not meet the requirements to enter the battlefield with your party members. Access is denied.
YOUR_IMPERIAL_STANDING = 7923, -- Your Imperial Standing has increased!
SPINE_CHILL = 8391, -- You feel a chill run down your spine!
HAND_OVER_TO_IMMORTAL = 8449, -- You hand over the % to the Immortal.
CANNOT_ENTER = 8468, -- You cannot enter at this time. Please wait a while before trying again.
AREA_FULL = 8469, -- This area is fully occupied. You were unable to enter.
Expand All @@ -51,6 +52,7 @@ zones[xi.zone.ARRAPAGO_REEF] =
{
APKALLU_NPC = GetFirstID('Arrapago_Apkallu'),
BLOODY_BONES = GetFirstID('Bloody_Bones'),
BUKKI = GetFirstID('Bukki'),
MEDUSA = GetFirstID('Medusa'),
LIL_APKALLU = GetFirstID('Lil_Apkallu'),
VELIONIS = GetFirstID('Velionis'),
Expand Down
32 changes: 31 additions & 1 deletion scripts/zones/Arrapago_Reef/mobs/Bukki.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,41 @@
-- Area: Arrapago Reef
-- NM: Bukki
-----------------------------------
mixins = { require('scripts/mixins/families/imp') }
mixins =
{
require('scripts/mixins/job_special'),
require('scripts/mixins/families/imp'),
}
-----------------------------------
---@type TMobEntity
local entity = {}

entity.onMobSpawn = function(mob)
xi.mix.jobSpecial.config(mob, {
specials =
{
{ id = xi.jsa.MANAFONT, hpp = math.random(10, 50) },
},
})

mob:setTP(3000)
mob:setMobSkillAttack(0)
mob:setMagicCastingEnabled(true)
mob:setMobMod(xi.mobMod.IDLE_DESPAWN, 300)
mob:setMobMod(xi.mobMod.GIL_MAX, -1)
mob:setLocalVar('tp_spam', math.random(5, 15))
mob:addListener('COMBAT_TICK', 'BUKKI_TICK', function(mobArg)
if
mobArg:getHPP() <= mobArg:getLocalVar('tp_spam') and
mobArg:getLocalVar('tp_spam') > 0
then
mobArg:setLocalVar('tp_spam', 0)
mobArg:setMagicCastingEnabled(false)
mobArg:setMobSkillAttack(788)
end
end)
end

entity.onMobDeath = function(mob, player, optParams)
end

Expand Down
2 changes: 1 addition & 1 deletion sql/item_basic.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13172,7 +13172,7 @@ INSERT INTO `item_basic` VALUES (15761,0,'chariot_band','chariot_band',1,64576,@
INSERT INTO `item_basic` VALUES (15762,0,'empress_band','empress_band',1,64576,@NONE,1,0);
INSERT INTO `item_basic` VALUES (15763,0,'emperor_band','emperor_band',1,64576,@NONE,1,0);
INSERT INTO `item_basic` VALUES (15769,0,'olduum_ring','olduum_ring',1,64584,@NONE,1,0);
INSERT INTO `item_basic` VALUES (15770,0,'random_ring','random_ring',1,64596,@NONE,1,0);
INSERT INTO `item_basic` VALUES (15770,0,'random_ring','random_ring',1,65108,@NONE,1,0);
INSERT INTO `item_basic` VALUES (15771,0,'shining_ring','shining_ring',1,2084,@RINGS,0,4366);
INSERT INTO `item_basic` VALUES (15772,0,'scintillant_ring','scintillant_ring',1,2080,@RINGS,0,4366);
INSERT INTO `item_basic` VALUES (15773,0,'imperial_ring','imperial_ring',1,63572,@NONE,1,0);
Expand Down
2 changes: 1 addition & 1 deletion sql/item_equipment.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5518,7 +5518,7 @@ INSERT INTO `item_equipment` VALUES (15761,'chariot_band',1,0,4194303,0,0,0,2457
INSERT INTO `item_equipment` VALUES (15762,'empress_band',1,0,4194303,0,0,0,24576,0,0,0);
INSERT INTO `item_equipment` VALUES (15763,'emperor_band',1,0,4194303,0,0,0,24576,0,0,0);
INSERT INTO `item_equipment` VALUES (15769,'olduum_ring',60,0,4194303,0,0,0,24576,0,0,0);
INSERT INTO `item_equipment` VALUES (15770,'random_ring',60,0,4194303,0,0,0,24576,0,0,0);
INSERT INTO `item_equipment` VALUES (15770,'random_ring',60,0,4194303,0,0,5,24576,0,0,0);
INSERT INTO `item_equipment` VALUES (15771,'shining_ring',71,0,4194303,0,0,0,24576,0,0,0);
INSERT INTO `item_equipment` VALUES (15772,'scintillant_ring',71,0,4194303,0,0,0,24576,0,0,0);
INSERT INTO `item_equipment` VALUES (15773,'imperial_ring',50,0,4194303,0,0,0,24576,0,0,0);
Expand Down
2 changes: 1 addition & 1 deletion sql/mob_groups.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2765,7 +2765,7 @@ INSERT INTO `mob_groups` VALUES (73,5203,54,'Ephramadian_Shade_mnk',960,0,786,0,
INSERT INTO `mob_groups` VALUES (74,5202,54,'Ephramadian_Shade_rdm',960,0,786,0,0,68,70,0);
INSERT INTO `mob_groups` VALUES (75,5204,54,'Ephramadian_Shade_rng',960,0,786,0,0,68,70,0);
INSERT INTO `mob_groups` VALUES (76,5205,54,'Ephramadian_Shade_cor',960,0,786,0,0,68,70,0);
INSERT INTO `mob_groups` VALUES (77,573,54,'Bukki',0,128,0,0,0,70,70,0);
INSERT INTO `mob_groups` VALUES (77,573,54,'Bukki',0,128,0,7500,0,72,72,0);
INSERT INTO `mob_groups` VALUES (78,2339,54,'Lamia_No11',0,128,0,0,0,80,85,0);
INSERT INTO `mob_groups` VALUES (79,2348,54,'Lamia_No24',0,128,0,0,0,80,80,0);
INSERT INTO `mob_groups` VALUES (80,2344,54,'Lamia_No18',0,128,0,0,0,80,85,0);
Expand Down
2 changes: 1 addition & 1 deletion sql/mob_skill_lists.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2679,7 +2679,7 @@ INSERT INTO `mob_skill_lists` VALUES ('Alkonost',786,578); -- nihlity song
INSERT INTO `mob_skill_lists` VALUES ('Alkonost',786,1330); -- hoof volley
INSERT INTO `mob_skill_lists` VALUES ('Alkonost',786,2828); -- jettatura
-- 787: free
-- 788: free
INSERT INTO `mob_skill_lists` VALUES ('Bakka_LowHP',788,1711); -- frentic rip
INSERT INTO `mob_skill_lists` VALUES ('Bakka',789,1711); -- frentic rip
INSERT INTO `mob_skill_lists` VALUES ('Bakka',789,2003); -- grating tantra
INSERT INTO `mob_skill_lists` VALUES ('Bakka',789,2004); -- stifling tantra
Expand Down
2 changes: 1 addition & 1 deletion sql/mob_spawn_points.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12543,7 +12543,7 @@ INSERT INTO `mob_spawn_points` VALUES (16998830,'Ephramadian_Shade','Ephramadian
INSERT INTO `mob_spawn_points` VALUES (16998831,'Ephramadian_Shade','Ephramadian Shade',74,-428.033,-4.640,-379.461,29);
INSERT INTO `mob_spawn_points` VALUES (16998832,'Ephramadian_Shade','Ephramadian Shade',75,-456.876,-4.398,-350.909,79);
INSERT INTO `mob_spawn_points` VALUES (16998833,'Ephramadian_Shade','Ephramadian Shade',76,-443.369,-4.463,-343.948,121);
INSERT INTO `mob_spawn_points` VALUES (16998834,'Bukki','Bukki',77,0.000,0.000,0.000,0);
INSERT INTO `mob_spawn_points` VALUES (16998834,'Bukki','Bukki',77,311,-3.674,170.124,0);

-- Lamia Reprisal
INSERT INTO `mob_spawn_points` VALUES (16998835,'Lamia_No11','Lamia No.11',78,0.000,0.000,0.000,0);
Expand Down

0 comments on commit b9d52ab

Please sign in to comment.