-
Notifications
You must be signed in to change notification settings - Fork 626
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1242529
commit 5aafb3f
Showing
8 changed files
with
272 additions
and
5 deletions.
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
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,163 @@ | ||
----------------------------------- | ||
-- Elderly Pursuits | ||
----------------------------------- | ||
-- Log ID: 4, Quest ID: 75 | ||
-- Despachiaire : !pos 108 -40 -83 26 | ||
-- Rouva : !pos -16 2 11 230 | ||
-- ??? : !pos -412 0 -362 2 | ||
----------------------------------- | ||
-- !addquest 4 75 | ||
----------------------------------- | ||
require('scripts/globals/npc_util') | ||
----------------------------------- | ||
local carpentersLandingID = zones[xi.zone.CARPENTERS_LANDING] | ||
----------------------------------- | ||
|
||
local quest = Quest:new(xi.quest.log_id.OTHER_AREAS, xi.quest.id.otherAreas.ELDERLY_PURSUITS) | ||
|
||
quest.reward = | ||
{ | ||
item = xi.item.ELEGANT_RIBBON, | ||
} | ||
|
||
local function AllParaDead() | ||
for i = 0, 4 do | ||
local mob = GetMobByID(carpentersLandingID.mob.PARA_OFFSET + i) | ||
if not mob:isDead() then | ||
return false | ||
end | ||
end | ||
|
||
return true | ||
end | ||
|
||
quest.sections = | ||
{ | ||
{ | ||
check = function(player, status, vars) | ||
return status == xi.questStatus.QUEST_AVAILABLE and | ||
player:hasCompletedQuest(xi.quest.log_id.OTHER_AREAS, xi.quest.id.otherAreas.SECRETS_OF_OVENS_LOST) | ||
end, | ||
|
||
[xi.zone.TAVNAZIAN_SAFEHOLD] = | ||
{ | ||
['Despachiaire'] = | ||
{ | ||
onTrigger = function(player, npc) | ||
return quest:progressEvent(517) | ||
end, | ||
}, | ||
|
||
onEventFinish = | ||
{ | ||
[517] = function(player, csid, option, npc) | ||
quest:begin(player) -- begin quest | ||
npcUtil.giveKeyItem(player, xi.ki.ANTIQUE_AMULET) | ||
end, | ||
}, | ||
}, | ||
}, | ||
|
||
{ | ||
check = function(player, status, vars) | ||
return status == xi.questStatus.QUEST_ACCEPTED | ||
end, | ||
|
||
[xi.zone.TAVNAZIAN_SAFEHOLD] = | ||
{ | ||
['Despachiaire'] = | ||
{ | ||
onTrigger = function(player, npc) | ||
if quest:getVar(player, 'Prog') == 3 then | ||
return quest:progressEvent(518) | ||
end | ||
end, | ||
}, | ||
|
||
onEventFinish = | ||
{ | ||
[518] = function(player, csid, option, npc) | ||
if quest:complete(player) then | ||
player:delKeyItem(xi.ki.CATHEDRAL_MEDALLION) | ||
end | ||
end, | ||
}, | ||
}, | ||
|
||
[xi.zone.SOUTHERN_SAN_DORIA] = | ||
{ | ||
['Rouva'] = | ||
{ | ||
onTrigger = function(player, npc) | ||
if | ||
quest:getVar(player, 'Prog') == 0 and | ||
player:hasKeyItem(xi.ki.ANTIQUE_AMULET) | ||
then | ||
return quest:progressEvent(747) | ||
elseif | ||
quest:getVar(player, 'Prog') == 2 and | ||
player:hasKeyItem(xi.ki.CATHEDRAL_MEDALLION) | ||
then | ||
return quest:progressEvent(748) | ||
end | ||
end, | ||
}, | ||
|
||
onEventFinish = | ||
{ | ||
[747] = function(player, csid, option, npc) | ||
quest:setVar(player, 'Prog', 1) | ||
end, | ||
|
||
[748] = function(player, csid, option, npc) | ||
quest:setVar(player, 'Prog', 3) | ||
end, | ||
}, | ||
}, | ||
|
||
[xi.zone.CARPENTERS_LANDING] = | ||
{ | ||
['qm_para'] = | ||
{ | ||
onTrigger = function(player, npc) | ||
if quest:getVar(player, 'Prog') == 1 then | ||
if quest:getLocalVar(player, 'ParaKilled') == 1 then | ||
player:messageSpecial(carpentersLandingID.text.POLISH, xi.ki.ANTIQUE_AMULET) | ||
player:delKeyItem(xi.ki.ANTIQUE_AMULET) | ||
quest:setVar(player, 'Prog', 2) | ||
quest:setLocalVar(player, 'ParaKilled', 0) | ||
return quest:keyItem(xi.ki.CATHEDRAL_MEDALLION) | ||
elseif | ||
GetNPCByID(carpentersLandingID.npc.QM_PARA):getLocalVar('engaged') < os.time() and | ||
GetNPCByID(carpentersLandingID.npc.QM_PARA):getLocalVar('engaged') ~= 1 and | ||
npcUtil.popFromQM(player, npc, { carpentersLandingID.mob.PARA_OFFSET }, { claim = true, hide = 0 }) | ||
then | ||
GetNPCByID(carpentersLandingID.npc.QM_PARA):setLocalVar('engaged', 1) | ||
GetNPCByID(carpentersLandingID.npc.QM_PARA):setLocalVar('nextMob', carpentersLandingID.mob.PARA_OFFSET + 1) | ||
return quest:messageSpecial(carpentersLandingID.text.STENCH_OF_DECAY) | ||
end | ||
end | ||
end, | ||
}, | ||
|
||
['Para'] = | ||
{ | ||
onMobDeath = function(mob, player, optParams) | ||
if AllParaDead() then | ||
quest:setLocalVar(player, 'ParaKilled', 1) | ||
GetNPCByID(carpentersLandingID.npc.QM_PARA):setLocalVar('nextMob', 0) | ||
end | ||
end, | ||
}, | ||
|
||
onZoneOut = | ||
{ | ||
function(player, prevZone) | ||
quest:setLocalVar(player, 'ParaKilled', 0) -- zoning resets kill progress | ||
end | ||
}, | ||
} | ||
}, | ||
} | ||
|
||
return quest |
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,81 @@ | ||
----------------------------------- | ||
-- Area: Carpenters Landing | ||
-- Mob: Para | ||
----------------------------------- | ||
local ID = zones[xi.zone.CARPENTERS_LANDING] | ||
----------------------------------- | ||
|
||
local function spawnNextMob(player) | ||
local mobId = GetNPCByID(ID.npc.QM_PARA):getLocalVar('nextMob') | ||
|
||
if mobId ~= 0 then | ||
GetMobByID(mobId):setSpawn(player:getXPos()-1, player:getYPos()-1, player:getZPos(), player:getRotPos() - 180) -- spawn facing by player | ||
SpawnMob(mobId):updateEnmity(player) | ||
|
||
if mobId < ID.mob.PARA_OFFSET + 4 then | ||
GetNPCByID(ID.npc.QM_PARA):setLocalVar('nextMob', mobId + 1) | ||
else | ||
GetNPCByID(ID.npc.QM_PARA):setLocalVar('nextMob', 0) | ||
end | ||
end | ||
end | ||
|
||
local function AllParaDead() | ||
for i = 0, 4 do | ||
local mob = GetMobByID(ID.mob.PARA_OFFSET + i) | ||
if not mob:isDead() then | ||
return false | ||
end | ||
end | ||
|
||
return true | ||
end | ||
|
||
local entity = {} | ||
|
||
entity.onMobInitialize = function(mob) | ||
mob:setMobMod(xi.mobMod.IDLE_DESPAWN, 180) -- 3 min despawn | ||
--mob:addImmunity(xi.immunity.LIGHT_SLEEP) TODO: Mob is immune to light based sleep, but not dark | ||
mob:setMod(xi.mod.UDMGMAGIC, -4000) | ||
mob:setLocalVar('spawn', 0) | ||
end | ||
|
||
entity.onMobFight = function(mob, target) | ||
if | ||
mob:getLocalVar('spawn') < os.time() and | ||
mob:getLocalVar('spawn') ~= 0 | ||
then | ||
spawnNextMob(target) | ||
mob:setLocalVar('spawn', 0) | ||
end | ||
end | ||
|
||
entity.onMobWeaponSkill = function(target, mob, skill) | ||
local triggerSkills = { 310, 311, 312 } | ||
local skillID = skill:getID() | ||
if utils.contains(skillID, triggerSkills) then | ||
if math.random(1, 100) <= 90 then | ||
mob:setLocalVar('spawn', os.time() + 3) -- ~90% chance of replicating on shroom skill, need larger sample to hone in on this number but it isn't guaranteed | ||
end | ||
end | ||
|
||
return target | ||
end | ||
|
||
entity.onMobDeath = function(mob, player, optParams) | ||
mob:setLocalVar('died', 1) | ||
if AllParaDead() then | ||
GetNPCByID(ID.npc.QM_PARA):setLocalVar('engaged', os.time()) -- no time gate after death | ||
end | ||
end | ||
|
||
entity.onMobDespawn = function(mob) | ||
if | ||
AllParaDead() and | ||
mob:getLocalVar('died') ~= 1 | ||
then | ||
GetNPCByID(ID.npc.QM_PARA):setLocalVar('engaged', os.time() + 180) -- time gate 3 min after despawn | ||
end | ||
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,17 @@ | ||
----------------------------------- | ||
-- Area: Carpenters' Landing (2) | ||
-- NPC: ??? | ||
-- Note: Used to spawn Para QNM | ||
-- !pos -405 0 -368 2 | ||
----------------------------------- | ||
require('scripts/globals/npc_util') | ||
----------------------------------- | ||
local entity = {} | ||
|
||
entity.onTrade = function(player, npc, trade) | ||
end | ||
|
||
entity.onTrigger = function(player, npc) | ||
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
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