Skip to content
Snippets Groups Projects
Commit cdd41772 authored by DarkGod's avatar DarkGod
Browse files

Change zone and Grant quest debug commands now handle correctly zones and quest provided by addons

Shoot can be added a cooldown with talent_cd_reduction
parent 1a13e766
No related branches found
No related tags found
No related merge requests found
......@@ -4573,6 +4573,7 @@ function _M:startTalentCooldown(t)
t = self:getTalentFromId(t)
if not t.cooldown then return end
self.talents_cd[t.id] = self:getTalentCooldown(t)
if self.talents_cd[t.id] <= 0 then self.talents_cd[t.id] = nil end
self.changed = true
end
......
......@@ -32,14 +32,18 @@ module(..., package.seeall, class.make)
function _M:archeryAcquireTargets(tg, params)
params = params or {}
local weapon, ammo, offweapon = self:hasArcheryWeapon()
-- Awesome, we can shoot from our offhand!
if self.can_offshoot and not weapon and offweapon then weapon, offweapon = offweapon, nil end
if not weapon then
game.logPlayer(self, "You must wield a bow or a sling (%s)!", ammo)
print("== no weapon")
return nil
end
local infinite = ammo.infinite or self:attr("infinite_ammo") or params.infinite
if not ammo or (ammo.combat.shots_left <= 0 and not infinite) then
game.logPlayer(self, "You do not have enough ammo left!")
print("== no ammo")
return nil
end
......@@ -51,6 +55,7 @@ function _M:archeryAcquireTargets(tg, params)
local val = self['get'..weapon.use_resource.kind:capitalize()](self)
if val < weapon.use_resource.value then
game.logPlayer(self, "You do not have enough %s left!", weapon.use_resource.kind)
print("== no ressource")
return nil
end
end
......@@ -590,6 +595,8 @@ end
function _M:hasDualArcheryWeapon(type)
local w, a, o = self:hasArcheryWeapon(type)
if self.can_solo_dual_archery and w and not o then w, o = w, w end
if self.can_solo_dual_archery and not w and o then w, o = o, o end
if w and a and o then return w, a, o end
return nil
end
......
......@@ -27,15 +27,15 @@ As for your probable many questions, they will stay unanswered. I may help, but
answers = {
{"Thank you. I will rest for a while."},
{"Thank you. I am ready to go back!",
cond=function() return game.level.source_level end,
cond=function() return game.level.source_level and not game.level.source_level.no_return_from_eidolon end,
action=function() game.level.data.eidolon_exit(false) end
},
{"Thank you, but I fear I will not survive anyway, can you send me back somewhere else please?",
cond=function() return game.level.source_level and (not game.level.source_level.data or not game.level.source_level.data.no_worldport) end,
cond=function() return game.level.source_level and not game.level.source_level.no_return_from_eidolon and (not game.level.source_level.data or not game.level.source_level.data.no_worldport) end,
action=function() game.level.data.eidolon_exit(true) end
},
{"Thank you, I am ready to go back!",
cond=function() return not game.level.source_level end,
cond=function() return not game.level.source_level or game.level.source_level.no_return_from_eidolon end,
jump="jump_error",
},
{"Thank you, but I am weary of this life, I wish no more, please let me go.", jump="die"},
......@@ -43,7 +43,7 @@ As for your probable many questions, they will stay unanswered. I may help, but
}
newChat{ id="jump_error",
text = [[It seems the threads of time have been disrupted...
text = [[It seems the threads of time and space have been disrupted...
I will try to send you to safety.]],
answers = {
{"Thanks.", action=function(npc, player) game:changeLevel(1, "wilderness") end},
......
......@@ -25,6 +25,7 @@ newTalent{
hide = true,
innate = true,
points = 1,
cooldown = 0,
range = archery_range,
message = "@Source@ shoots!",
requires_target = true,
......
......@@ -64,14 +64,14 @@ end
function _M:generateList()
local list = {}
local function parse(base, add)
local function parse(base, add, add_simple)
for i, dir in ipairs(fs.list(base.."/zones/")) do
local f = loadfile(base.."/zones/"..dir.."/zone.lua")
if f then
setfenv(f, setmetatable({}, {__index=_G}))
local ok, z = pcall(f)
if ok then
list[#list+1] = {name=z.name, zone=add..dir, min=1, max=z.max_level}
list[#list+1] = {name=z.name..(add_simple and " ["..add_simple.."]" or ""), zone=add..dir, min=1, max=z.max_level}
end
end
end
......@@ -81,7 +81,7 @@ function _M:generateList()
for i, dir in ipairs(fs.list("/")) do
local _, _, addon = dir:find("^data%-(.+)$")
if addon then
parse("/"..dir, addon.."+")
parse("/"..dir, addon.."+", addon)
end
end
......
......@@ -69,12 +69,23 @@ end
function _M:generateList()
local list = {}
for i, file in ipairs(fs.list("/data/quests/")) do
if file:find(".lua$") then
local n = file:gsub(".lua$", "")
list[#list+1] = {name=n, quest=n, hasit=game.player:hasQuest(n)}
local function parse(base, add, add_simple)
for i, file in ipairs(fs.list(base.."/quests/")) do
if file:find(".lua$") then
local n = file:gsub(".lua$", "")
list[#list+1] = {name=n..(add_simple and " ["..add_simple.."]" or ""), quest=add..n, hasit=game.player:hasQuest(n)}
end
end
end
parse("/data", "")
for i, dir in ipairs(fs.list("/")) do
local _, _, addon = dir:find("^data%-(.+)$")
if addon then
parse("/"..dir, addon.."+", addon)
end
end
table.sort(list, function(a,b) return a.name < b.name end)
local chars = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment