Skip to content
Snippets Groups Projects
Commit a9fa3714 authored by dg's avatar dg
Browse files

New town: Zigur, the home of the Ziguranth, who oppose magic. Not available to magic wielders

Antiamgic quest can now be taken from Zigur.


git-svn-id: http://svn.net-core.org/repos/t-engine4@1786 51575b47-30f0-44d4-a5cc-537603b46e54
parent 7fd0a35e
No related branches found
No related tags found
No related merge requests found
......@@ -1253,7 +1253,7 @@ function _M:postUseTalent(ab, ret)
-- Count talents that count as spells
if ab.is_spell then
self:attr("casted_spells", 1)
if self:hasQuest("antimagic") and not self:hasQuest("antimagic"):isEnded() then self:setQuestStatus("antimagic", engine.Quest.FAILED) end -- Fail antimagic quest
self:antimagicBackslash(4 + self:getTalentLevelRaw(ab))
end
......
......@@ -642,7 +642,7 @@ function _M:playerUseItem(object, item, inven)
if ret and ret == "destroy" then
-- Count magic devices
if o.is_magic_device then
self:attr("used_magic_devices", 1)
if self:hasQuest("antimagic") and not self:hasQuest("antimagic"):isEnded() then self:setQuestStatus("antimagic", engine.Quest.FAILED) end -- Fail antimagic quest
self:antimagicBackslash(4 + (o.material_level or 1))
end
......
......@@ -24,7 +24,7 @@ if game.player:hasQuest("antimagic") then
newChat{ id="welcome",
text = [[Welcome back ]]..sex..[[.]],
answers = {
{"I am ready for the test", jump="test"},
{"I am ready for the test", jump="test", cond=function(npc, player) return player:hasQuest("antimagic"):ten_levels_ok(player) end},
{"I have got to go."},
}
}
......@@ -45,8 +45,7 @@ Return to us when your power has grown ten times without using any spells, scrol
end
newChat{ id="ok",
text = [[#LIGHT_GREEN#*The fighter hands you a map. It shows a location to the south of the Thaloren forest.*#WHITE#
Excellent. When you feel ready, come seek us for your training. I look forward to it!]],
text = [[Excellent. Come back soon!]],
answers = {
{"I will, thank you.", action=function(npc, player) player:grantQuest("antimagic") end},
}
......
......@@ -150,28 +150,6 @@ newEntity{
end,
}
newEntity{
name = "Antimagic Quest",
type = "harmless", subtype = "special", unique = true,
level_range = {15, 25},
rarity = 7,
special_filter = function(self)
local p = game.player
if p.level < 15 then return false end
if p:attr("casted_spells") then return false end
if p:attr("used_magic_devices") then return false end
if p:knowTalent(p.T_TELEPORT_ANGOLWEN) then return false end
if p:attr("angolwen_access") then return false end
return true
end,
on_encounter = function(self, who)
local Chat = require "engine.Chat"
local chat = Chat.new("antimagic-encounter", {name="Grim-looking fighter"}, who)
chat:invoke()
return true
end,
}
--[[
newEntity{
name = "Departing Elves",
......
......@@ -44,6 +44,17 @@ starty = 49
endx = 24
endy = 49
-- addSpot section
addSpot({32, 7}, "portal", "portal")
addSpot({39, 8}, "portal", "portal")
addSpot({38, 15}, "portal", "portal")
addSpot({32, 15}, "portal", "portal")
addSpot({35, 11}, "quest", "arena")
addSpot({28, 12}, "quest", "outside-arena")
-- addZone section
-- ASCII map section
return [[
~~~~~~~~~~~~~~~~~~~~~~~~~ttttttttttttttttttttttttt
~~~~~~~~~~~~~~~~~~~~~~~~~ttttttttttt..tttttttttttt
......
......@@ -34,13 +34,13 @@ on_status_change = function(self, who, status, sub)
who:setQuestStatus(self.id, engine.Quest.DONE)
world:gainAchievement("ANTIMAGIC", game.player)
game.player:learnTalentType("wild-gift/antimagic", true)
local stair = game.zone:makeEntityByName(game.level, "terrain", "UP_WILDERNESS")
game.zone:addEntity(game.level, stair, "terrain", game.player.x, game.player.y)
end
end
ten_levels_ok = function(self, who)
if who.level >= self.start_level + 10 then return true end
if not self:isEnded() then
if who.level >= self.start_level + 10 then return true end
end
end
-- Start the event, summon the first challenger
......@@ -48,10 +48,6 @@ start_event = function(self)
local spot = game.level:pickSpot{type="quest", subtype="arena"}
game.player:move(spot.x, spot.y, true)
local Chat = require "engine.Chat"
local chat = Chat.new("antimagic-start", {name="Grim-looking fighter"}, game.player)
chat:invoke()
self.wave = 1
self:add_foe(true, true, 1)
end
......@@ -70,15 +66,18 @@ next_combat = function(self)
local spot = game.level:pickSpot{type="quest", subtype="outside-arena"}
game.player:move(spot.x, spot.y, true)
local Chat = require "engine.Chat"
local chat = Chat.new("antimagic-end", {name="Grim-looking fighter"}, game.player)
chat:invoke()
if not self:isEnded() then
local Chat = require "engine.Chat"
local chat = Chat.new("antimagic-end", {name="Grim-looking fighter"}, game.player)
chat:invoke()
end
end
end
add_foe = function(self, next_wave, first, foe_idx)
local spot = game.level:pickSpot{type="portal"}
while not spot do spot = game.level:pickSpot{type="portal"} end
local spot = game.level:pickSpot{type="portal", subtype="portal"}
while not spot do spot = game.level:pickSpot{type="portal", subtype="portal"} end
print("==================== spot", spot.x, spot.y)
local foes = {
[1] = {
......@@ -114,7 +113,7 @@ add_foe = function(self, next_wave, first, foe_idx)
end
end
-- Tone down the corruptor
if foe_idx == 4 then m.inc_damage.all = -50 end
if foe_idx == 4 then m.inc_damage.all = -30 end
m:setTarget(game.player)
game.zone:addEntity(game.level, m, "actor", x, y)
if first then game.logSeen(m, "#VIOLET#A foe is summoned to the arena!")
......
......@@ -103,6 +103,8 @@ can_offer_kor = function(self, who)
end
access_angolwen = function(self, player)
if player:hasQuest("antimagic") and not player:hasQuest("antimagic"):isEnded() then player:setQuestStatus("antimagic", engine.Quest.FAILED) end -- Fail antimagic quest
local g = mod.class.Grid.new{
show_tooltip=true, always_remember = true,
name="Angolwen, the hidden city of magic",
......@@ -134,6 +136,8 @@ access_angolwen = function(self, player)
end
ring_gift = function(self, player)
if player:hasQuest("antimagic") and not player:hasQuest("antimagic"):isEnded() then player:setQuestStatus("antimagic", engine.Quest.FAILED) end -- Fail antimagic quest
local o = game.zone:makeEntity(game.level, "object", {type="jewelry", subtype="ring", force_ego={"RING_ARCANE_POWER","RING_BURNING","RING_FREEZING","RING_SHOCK","RING_MAGIC"}}, player.level + 3, true)
if o then
o:identify(true)
......
......@@ -132,38 +132,38 @@
<objectgroup name="addSpot" width="50" height="50">
<object name="portal" x="1030" y="230" width="18" height="18">
<properties>
<property name="subtype" value="portal"/>
<property name="type" value="portal"/>
<property name="subtype" value="&quot;portal&quot;"/>
<property name="type" value="&quot;portal&quot;"/>
</properties>
</object>
<object name="portal" x="1253" y="262" width="18" height="18">
<properties>
<property name="subtype" value="portal"/>
<property name="type" value="portal"/>
<property name="subtype" value="&quot;portal&quot;"/>
<property name="type" value="&quot;portal&quot;"/>
</properties>
</object>
<object name="portal" x="1223" y="486" width="18" height="18">
<properties>
<property name="subtype" value="portal"/>
<property name="type" value="portal"/>
<property name="subtype" value="&quot;portal&quot;"/>
<property name="type" value="&quot;portal&quot;"/>
</properties>
</object>
<object name="portal" x="1031" y="485" width="18" height="18">
<properties>
<property name="subtype" value="portal"/>
<property name="type" value="portal"/>
<property name="subtype" value="&quot;portal&quot;"/>
<property name="type" value="&quot;portal&quot;"/>
</properties>
</object>
<object name="POP" x="1127" y="360" width="18" height="18">
<properties>
<property name="subtype" value="arena"/>
<property name="type" value="quest"/>
<property name="subtype" value="&quot;arena&quot;"/>
<property name="type" value="&quot;quest&quot;"/>
</properties>
</object>
<object name="POP" x="901" y="390" width="18" height="18">
<properties>
<property name="subtype" value="outside-arena"/>
<property name="type" value="quest"/>
<property name="subtype" value="&quot;outside-arena&quot;"/>
<property name="type" value="&quot;quest&quot;"/>
</properties>
</object>
</objectgroup>
......
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