Skip to content

Commit

Permalink
Merge pull request #5767 from hooksta4/A_question_of_faith
Browse files Browse the repository at this point in the history
[Quest]Implement A question of faith
  • Loading branch information
claywar authored May 31, 2024
2 parents 2d62c6b + d410e1b commit 1242529
Show file tree
Hide file tree
Showing 10 changed files with 173 additions and 7 deletions.
19 changes: 19 additions & 0 deletions scripts/actions/mobskills/bionic_boost.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-----------------------------------
-- Bionic Boost
-- Description:
-- Gives the user the effect of counterstance
-----------------------------------
local mobskillObject = {}

mobskillObject.onMobSkillCheck = function(target, mob, skill)
return 0
end

mobskillObject.onMobWeaponSkill = function(target, mob, skill)
local typeEffect = xi.effect.COUNTERSTANCE

skill:setMsg(xi.mobskills.mobBuffMove(mob, typeEffect, 1, 0, 60))
return typeEffect
end

return mobskillObject
121 changes: 121 additions & 0 deletions scripts/quests/bastok/A_Question_of_Faith.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
-----------------------------------
-- A Question of Faith
-----------------------------------
-- Area: Metalworks
-- NPC: Ayame !pos 132 -18 33 237
-- NPC: Virnage !pos 0.7 -0.0 49 234
-- NPC: Rakorok !pos 158 13 -42 11
-----------------------------------
local ID = zones[xi.zone.OLDTON_MOVALPOLOS]
-----------------------------------
local quest = Quest:new(xi.questLog.BASTOK, xi.quest.id.bastok.A_QUESTION_OF_FAITH)

quest.reward =
{
fame = 50,
fameArea = xi.fameArea.BASTOK,
gil = 3000,
}

quest.sections =
{
{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_AVAILABLE and
player:getFameLevel(xi.fameArea.BASTOK) >= 4 and
player:hasCompletedQuest(xi.questLog.BASTOK, xi.quest.id.bastok.OUT_OF_THE_DEPTHS)
end,

[xi.zone.METALWORKS] =
{
['Ayame'] = quest:progressEvent(875),

onEventFinish =
{
[875] = function(player, csid, option, npc)
quest:begin(player)
end,
},
},
},

{
check = function(player, status, vars)
return status == xi.questStatus.QUEST_ACCEPTED
end,

[xi.zone.BASTOK_MINES] =
{
['Virnage'] =
{
onTrigger = function(player, npc)
if
not player:hasKeyItem(xi.ki.DAWN_TALISMAN) and
quest:getVar(player, 'Prog') == 0
then
return quest:progressEvent(239, 0, xi.ki.DAWN_TALISMAN)
elseif player:hasKeyItem(xi.ki.DAWN_TALISMAN) then
return quest:event(242, 0, xi.ki.DAWN_TALISMAN)
elseif quest:getVar(player, 'Prog') == 1 then
return quest:progressEvent(241)
end
end,
},

onEventFinish =
{
[239] = function(player, csid, option, npc)
if option == 1 then
npcUtil.giveKeyItem(player, xi.ki.DAWN_TALISMAN)
end
end,

[241] = function(player, csid, option, npc)
quest:complete(player)
end,
},
},

[xi.zone.OLDTON_MOVALPOLOS] =
{
['Rakorok'] =
{
onTrigger = function(player, npc)
if
player:hasKeyItem(xi.ki.DAWN_TALISMAN) and
quest:getVar(player, 'Prog') == 0
then
if npcUtil.popFromQM(player, npc, ID.mob.BUGALLUG, { claim = true, hide = 0 }) then
player:messageSpecial(ID.text.ALTANA_DIE)
return quest:messageSpecial(ID.text.MONSTER_APPEARED)
end
elseif
quest:getVar(player, 'Prog') == 1 and
player:hasKeyItem(xi.ki.DAWN_TALISMAN)
then
return quest:progressEvent(6, 11, xi.ki.DAWN_TALISMAN)
end
end,
},

['Bugallug'] =
{
onMobDeath = function(mob, player, optParams)
if quest:getVar(player, 'Prog') == 0 then
quest:setVar(player, 'Prog', 1)
end
end,
},

onEventFinish =
{
[6] = function(player, csid, option, npc)
player:delKeyItem(xi.ki.DAWN_TALISMAN)
return quest:messageSpecial(ID.text.WAS_TAKEN_FROM_YOU, 0, xi.ki.DAWN_TALISMAN)
end,
},
},
},
}

return quest
5 changes: 5 additions & 0 deletions scripts/zones/Oldton_Movalpolos/DefaultActions.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
local ID = zones[xi.zone.OLDTON_MOVALPOLOS]

return {
['Rakorok'] = { text = ID.text.RAKOROK_DIALOGUE },
}
5 changes: 5 additions & 0 deletions scripts/zones/Oldton_Movalpolos/IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,25 @@ zones[xi.zone.OLDTON_MOVALPOLOS] =
ITEM_OBTAINED = 6390, -- Obtained: <item>.
GIL_OBTAINED = 6391, -- Obtained <number> gil.
KEYITEM_OBTAINED = 6393, -- Obtained key item: <keyitem>.
KEYITEM_LOST = 6394, -- Key item lost: <keyitem>.
FELLOW_MESSAGE_OFFSET = 6419, -- I'm ready. I suppose.
CARRIED_OVER_POINTS = 7001, -- You have carried over <number> login point[/s].
LOGIN_CAMPAIGN_UNDERWAY = 7002, -- The [/January/February/March/April/May/June/July/August/September/October/November/December] <number> Login Campaign is currently underway!
LOGIN_NUMBER = 7003, -- In celebration of your most recent login (login no. <number>), we have provided you with <number> points! You currently have a total of <number> points.
MEMBERS_LEVELS_ARE_RESTRICTED = 7023, -- Your party is unable to participate because certain members' levels are restricted.
CONQUEST_BASE = 7064, -- Tallying conquest results...
WAS_TAKEN_FROM_YOU = 7752, -- The Dawn Talisman was taken from you...
FISHING_MESSAGE_OFFSET = 7583, -- You can't fish here.
MINING_IS_POSSIBLE_HERE = 7714, -- Mining is possible here if you have <item>.
ALTANA_DIE = 7740, -- Aaaltaaanaaa...Diiieee!!!
RAKOROK_DIALOGUE = 7738, -- Nsy pipul. Gattohre! I bisynw!
MONSTER_APPEARED = 7753, -- A monster has appeared!
CHEST_UNLOCKED = 7762, -- You unlock the chest!
COMMON_SENSE_SURVIVAL = 8120, -- It appears that you have arrived at a new survival guide provided by the Adventurers' Mutual Aid Network. Common sense dictates that you should now be able to teleport here from similar tomes throughout the world.
},
mob =
{
BUGALLUG = GetFirstID('Bugallug'),
BUGBEAR_STRONGMAN = GetTableOfIDs('Bugbear_Strongman'),
GOBLIN_WOLFMAN = GetFirstID('Goblin_Wolfman'),
},
Expand Down
19 changes: 19 additions & 0 deletions scripts/zones/Oldton_Movalpolos/mobs/Bugallug.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-----------------------------------
-- Area: Oldton Movalpolos
-- Mob: Bugallug
-- Note: NM for quest: A Question of Faith
-----------------------------------
local entity = {}

entity.onMobSpawn = function(mob)
-- Immediately uses Bionic Boost and Heavy Whisk
mob:useMobAbility(359)
mob:queue(2000, function(mobArg)
mobArg:useMobAbility(358)
end)
end

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

return entity
3 changes: 0 additions & 3 deletions scripts/zones/Oldton_Movalpolos/npcs/Rakorok.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,12 @@
-- Area: Oldton Movalpolos
-- NPC: Rakorok
-----------------------------------
local ID = zones[xi.zone.OLDTON_MOVALPOLOS]
-----------------------------------
local entity = {}

entity.onTrade = function(player, npc, trade)
end

entity.onTrigger = function(player, npc)
npc:showText(npc, ID.text.RAKOROK_DIALOGUE)
end

entity.onEventUpdate = function(player, csid, option, npc)
Expand Down
2 changes: 1 addition & 1 deletion sql/mob_groups.sql
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ INSERT INTO `mob_groups` VALUES (31,566,11,'Bugbear_Strongman',0,32,378,4800,0,5
INSERT INTO `mob_groups` VALUES (32,1712,11,'Goblin_Shovelman',924,0,1157,0,0,42,44,0);
INSERT INTO `mob_groups` VALUES (33,1663,11,'Goblin_Freelance',924,0,1061,0,0,45,47,0);
INSERT INTO `mob_groups` VALUES (34,2685,11,'Moblin_Ashman',924,0,3078,0,0,45,45,0);
INSERT INTO `mob_groups` VALUES (35,556,11,'Bugallug',0,128,0,0,0,45,50,0);
INSERT INTO `mob_groups` VALUES (35,556,11,'Bugallug',0,128,0,6000,0,45,50,0);
INSERT INTO `mob_groups` VALUES (36,2696,11,'Moblin_Gurneyman',924,0,1711,0,0,46,47,0);
INSERT INTO `mob_groups` VALUES (37,1746,11,'Goblin_Wolfman',0,128,1189,7400,0,50,55,0);
INSERT INTO `mob_groups` VALUES (38,1703,11,'Goblin_Preceptor',0,128,0,0,0,45,49,0);
Expand Down
2 changes: 1 addition & 1 deletion sql/mob_pools.sql
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ INSERT INTO `mob_pools` VALUES (552,'Buburimboo','Buburimboo',197,0x00005C010000
INSERT INTO `mob_pools` VALUES (553,'Buffalo','Buffalo',57,0x00004D0500000000000000000000000000000000,1,1,7,360,100,0,1,0,0,0,0,0,452,131,0,0,0,0,0,57,57);
INSERT INTO `mob_pools` VALUES (554,'Buffrix_Eargone','Buffrix_Eargone',373,0x00003F0400000000000000000000000000000000,7,7,3,240,100,0,1,0,1,2,0,32,0,159,0,0,4,0,0,373,373);
INSERT INTO `mob_pools` VALUES (555,'Bugaboo','Bugaboo',121,0x0000700100000000000000000000000000000000,4,4,12,240,100,0,1,0,0,2,0,0,4859,131,0,0,28,0,0,121,121);
INSERT INTO `mob_pools` VALUES (556,'Bugallug','Bugallug',59,0x00004B0500000000000000000000000000000000,2,2,1,480,100,0,1,0,1,2,0,32,0,157,0,0,0,0,0,59,59);
INSERT INTO `mob_pools` VALUES (556,'Bugallug','Bugallug',59,0x00004B0500000000000000000000000000000000,2,2,1,480,100,0,1,0,1,2,2,32,0,157,0,0,0,0,0,59,59);
INSERT INTO `mob_pools` VALUES (557,'Bugard','Bugard',58,0x0000470500000000000000000000000000000000,1,1,3,300,100,0,1,0,0,0,0,0,1379,131,0,0,0,0,0,58,58);
INSERT INTO `mob_pools` VALUES (558,'Bugard-X','Bugard-X',58,0x0000470500000000000000000000000000000000,1,1,5,300,100,0,1,1,1,16,0,0,0,3,0,0,0,0,0,58,58);
INSERT INTO `mob_pools` VALUES (559,'Bugbby','Bugbby',59,0x00004B0500000000000000000000000000000000,1,1,5,240,100,0,1,0,1,18,1,32,4045,155,0,0,0,0,0,59,59);
Expand Down
2 changes: 1 addition & 1 deletion sql/mob_skills.sql
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ INSERT INTO `mob_skills` VALUES (355,99,'earth_pounder',1,15.0,2000,1500,4,0,0,0
INSERT INTO `mob_skills` VALUES (356,100,'sharp_strike',0,7.0,2000,1500,1,0,0,0,0,0,0);
INSERT INTO `mob_skills` VALUES (357,825,'heavy_blow',0,7.0,2000,1500,4,0,0,0,0,0,0);
INSERT INTO `mob_skills` VALUES (358,826,'heavy_whisk',0,7.0,2000,1500,4,0,0,2,0,0,0);
-- INSERT INTO `mob_skills` VALUES (359,103,'bionic_boost',0,7.0,2000,1500,4,0,0,0,0,0,0);
INSERT INTO `mob_skills` VALUES (359,827,'bionic_boost',0,7.0,2000,1500,1,0,0,0,0,0,0);
INSERT INTO `mob_skills` VALUES (360,828,'flying_hip_press',1,7.0,2000,1500,4,0,0,0,0,0,0);
INSERT INTO `mob_skills` VALUES (361,829,'earth_shock',1,10.0,2000,1500,4,0,0,0,0,0,0);
INSERT INTO `mob_skills` VALUES (362,830,'double_claw',0,7.0,2000,1500,4,0,0,0,0,0,0);
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 @@ -2478,7 +2478,7 @@ INSERT INTO `mob_spawn_points` VALUES (16822452,'Earth_Elemental','Earth Element
INSERT INTO `mob_spawn_points` VALUES (16822453,'Dark_Bats','Dark Bats',6,179.462,7.394,-92.602,62);
INSERT INTO `mob_spawn_points` VALUES (16822454,'Thunder_Elemental','Thunder Elemental',21,179.684,7.504,-97.948,63);
INSERT INTO `mob_spawn_points` VALUES (16822455,'Earth_Elemental','Earth Elemental',17,179.121,7.520,-103.613,69);
INSERT INTO `mob_spawn_points` VALUES (16822456,'Bugallug','Bugallug',35,161.234,13.473,-42.652,8);
INSERT INTO `mob_spawn_points` VALUES (16822456,'Bugallug','Bugallug',35,161.97,13.98,-42.19,142);
INSERT INTO `mob_spawn_points` VALUES (16822457,'Moblin_Gurneyman','Moblin Gurneyman',36,-30.020,7.399,98.798,131);
INSERT INTO `mob_spawn_points` VALUES (16822458,'Moblin_Gurneyman','Moblin Gurneyman',36,24.439,9.393,-87.126,132);
INSERT INTO `mob_spawn_points` VALUES (16822459,'Goblin_Wolfman','Goblin Wolfman',37,-150.910,7.499,-251.817,57);
Expand Down

0 comments on commit 1242529

Please sign in to comment.