Lower Roshamuul: The Giant Traverse
tested in TFS 1.2 10.95
In order to repair the bridge and advance further, the following tasks must be done. Completing a task also awards some Inquisition Gold.
Rewards can be managed with Sandomo by the use of the keyword gratitude, and then repairs.
tested in TFS 1.2 10.95
In order to repair the bridge and advance further, the following tasks must be done. Completing a task also awards some Inquisition Gold.
Rewards can be managed with Sandomo by the use of the keyword gratitude, and then repairs.
Add @data/lib/core/constants.lua
Lua:
ROSHAMUUL_MORTAR_THROWN = 20200
ROSHAMUUL_KILLED_FRAZZLEMAWS = 20201
ROSHAMUUL_KILLED_SILENCERS = 20202
ROSHAMUUL_GOLD_RECORD = 20203
Create folder @data/actions/scripts/roshamuul
Add @data/actions/actions.xml
XML:
<!-- Lower Roshamuul Quest -->
<action itemid="22387" script="roshamuul/mixture.lua" />
<action itemid="22388" script="roshamuul/mixture.lua" />
<action itemid="22459" script="roshamuul/chalk.lua" />
<action itemid="22467" script="roshamuul/gravel.lua" />
<action itemid="22503" script="roshamuul/mortar.lua" />
<action itemid="22504" script="roshamuul/trough.lua" />
Create @data/actions/scripts/roshamuul/mixture.lua
Lua:
local buckets = {
[22387] = 22388,
[22388] = 22387
}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if (target == nil) or not target:isItem() then
return false
end
if target:getId() == buckets[item:getId()] then
item:transform(2005, 0)
target:transform(22503)
end
return true
end
Create @data/actions/scripts/roshamuul/chalk.lua
Lua:
local data = {}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local bucket = player:getItemById(2005, true, 0)
if bucket == nil then
return fromPosition:sendMagicEffect(3)
end
if not data[player:getId()] then
data[player:getId()] = 0
end
data[player:getId()] = data[player:getId()] + 1
if data[player:getId()] > 10 then
bucket:transform(22388)
data[player:getId()] = 0
end
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You fill some of the fine chalk into a bucket.")
item:transform(22470)
item:decay()
return true
end
Create @data/actions/scripts/roshamuul/gravel.lua
Lua:
local data = {}
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local bucket = player:getItemById(2005, true, 0)
if bucket == nil then
return fromPosition:sendMagicEffect(3)
end
if not data[player:getId()] then
data[player:getId()] = 0
end
data[player:getId()] = data[player:getId()] + 1
if data[player:getId()] > 10 then
bucket:transform(22387)
data[player:getId()] = 0
end
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "You gather some fine gravel.")
item:transform(22468)
item:decay()
return true
end
Create @data/actions/scripts/roshamuul/mortar.lua
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if (target == nil) or not target:isItem() then
return false
end
if (target:getId() == 2005) and (target:getFluidType() == 1) then
item:transform(2005, 0)
target:transform(22504)
end
return true
end
Create @data/actions/scripts/roshamuul/trough.lua
Lua:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if (target == nil) or not target:isItem() then
return false
end
if target:getId() == 22550 then
item:transform(2005, 0)
toPosition:sendMagicEffect(10)
player:setStorageValue(ROSHAMUUL_MORTAR_THROWN, math.max(0, player:getStorageValue(ROSHAMUUL_MORTAR_THROWN)) + 1)
end
return true
end
Edit @data/actions/scripts/tools/pick.lua
Before
Lua:
local ground = tile:getGround()
Lua:
--Lower Roshamuul
if (target ~= nil) and target:isItem() and (target:getId() == 22469) then
if math.random(100) > 50 then
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Crushing the stone produces some fine gravel.")
target:transform(22467)
target:decay()
else
Game.createMonster("Frazzlemaw", toPosition)
player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Crushing the stone yields nothing but slightly finer, yet still unusable rubber.")
target:transform(22468)
target:decay()
end
return true
end
Add @data/creaturescripts/creaturescripts.xml
XML:
<event type="kill" name="lowerRoshamuul" script="lowerRoshamuul.lua"/>
Create @data/creaturescripts/scripts/lowerRoshamuul.lua
Lua:
local t = {
["Frazzlemaw"] = ROSHAMUUL_KILLED_FRAZZLEMAWS,
["Silencer"] = ROSHAMUUL_KILLED_SILENCERS
}
function onKill(creature, target)
local v = t[target:getName()]
if v then
creature:setStorageValue(v, math.max(0, creature:getStorageValue(v)) + 1)
end
return true
end
Register @data/creaturescripts/scripts/login.lua
Lua:
player:registerEvent("lowerRoshamuul")
Add @data/movements/movements.xml
XML:
<!-- Lower Roshamuul Quest -->
<movevent event="StepIn" itemid="22456" script="lowerRoshamuul.lua" />
<movevent event="StepIn" actionid="1500" script="lowerRoshamuul.lua" />
Create @data/movements/scripts/lowerRoshamuul.lua
Lua:
local roshamuulCaves = {
Position(33560, 32523, 8),
Position(33554, 32543, 8),
Position(33573, 32545, 8),
Position(33543, 32560, 8),
Position(33579, 32565, 8),
Position(33527, 32597, 8)
}
function onStepIn(creature, item, position, fromPosition)
if not creature:isPlayer() then
return false
end
if item:getId() == 22456 then
creature:teleportTo(Position(33551, 32556, 7))
else
creature:teleportTo(roshamuulCaves[math.random(#roshamuulCaves)])
end
return true
end
NPC Sandomo Position: 33504, 32551, 7
Create @data/npc/Sandomo.xml
XML:
<?xml version="1.0" encoding="utf-8"?>
<npc name="Sandomo" script="Sandomo.lua" walkinterval="2000" floorchange="0">
<health now="100" max="100" />
<look type="289" head="38" body="113" legs="2" feet="20" addons="1" />
</npc>
Create @data/npc/scripts/Sandomo.lua
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function Player.getInquisitionGold(self)
local v = {
math.max(0, self:getStorageValue(ROSHAMUUL_MORTAR_THROWN))*100,
math.max(0, self:getStorageValue(ROSHAMUUL_KILLED_FRAZZLEMAWS)),
math.max(0, self:getStorageValue(ROSHAMUUL_KILLED_SILENCERS))
}
return v[1] + v[2] + v[3]
end
local function creatureSayCallback(cid, type, msg)
local player = Player(cid)
if not npcHandler:isFocused(cid) then
return false
end
if msgcontains(msg, "mission") then
npcHandler:say({
"First, you will help us rebuilding this wretched {bridge} we cannot cross. We need mortar and there are several types of monsters who try to keep us away from it. ...",
"Then there is this enormous wall in the distance. Once we crossed the bridge, we will have to breach this monument. As I see it, you are working for the Inquisition now, I will hear no objection. You may even earn our gratitude."
}, cid)
npcHandler.topic[cid] = 1
elseif msgcontains(msg, "bridge") then
if npcHandler.topic[cid] == 1 then
npcHandler:say({
"Our brother Mortis is constantly working on keeping the bridge intact. We tried some simple wood planks first but it didn't work out that... well. ...",
"What we need is enough {mortar} to actually build a durable traverse. And we will need even more mortar to maintain it as it constantly gets attacked by vile critters."
}, cid)
npcHandler.topic[cid] = 2
end
elseif msgcontains(msg, "mortar") then
if npcHandler.topic[cid] == 2 then
npcHandler:say({
"We scouted some caves beneath the island which hold plenty of chalk to mix some good mortar. The entrances are not very far from here in fact. ...",
"However, the entrances are somewhat... twisted. The entrance we had mapped to a certain cave one day, would lead to a completely different cave on the next. ...",
"And even when emerging from one of the caves you never know where you are since its exits are just as deceptive. ...",
"Once you gathered some chalk, you should also find gravel on the island. If you have a pick and a bucket, you should be able to collect enough fine gravel to mix some mortar. ...",
"Do not forget to bring some buckets, if you are in short supply, brother Maun will hand some out to you - for a fee of course."
}, cid)
npcHandler.topic[cid] = nil
end
end
if msgcontains(msg, "gratitude") then
npcHandler.topic[cid] = 3
npcHandler:say("Oh, so you want a reward, hm? Well... let's see. What did you do for us - helping Mortis with his {repairs} and defended him?", cid)
elseif msgcontains(msg, "repairs") then
if npcHandler.topic[cid] == 3 then
if player:getInquisitionGold() > 0 then
npcHandler.topic[cid] = 4
npcHandler:say({
"Alright, so you mixed and delivered ".. math.max(0, player:getStorageValue(ROSHAMUUL_MORTAR_THROWN)) .." mortar and ...",
"You killed ".. math.max(0, player:getStorageValue(ROSHAMUUL_KILLED_FRAZZLEMAWS)) .." frazzlemaws and ...",
"You also hunted ".. math.max(0, player:getStorageValue(ROSHAMUUL_KILLED_SILENCERS)) .." silencers. That would equal ".. player:getInquisitionGold() .." of inquisition gold - BUT we are currently short of this valuable metal so... do you want me to add this amount to my {books} for now or {trade} it for something else.",
}, cid)
else
npcHandler.topic[cid] = nil
npcHandler:say("Come back after you have done at least one of the tasks I talked you about.", cid)
end
end
elseif npcHandler.topic[cid] == 4 then
local v = math.max(0, player:getStorageValue(ROSHAMUUL_GOLD_RECORD))
if msgcontains(msg, "book") or msgcontains(msg, "books") then
npcHandler.topic[cid] = 5
npcHandler:say({
"Of course, let's see. Hm, your recent endeavours would earn you ".. player:getInquisitionGold() .." of righteous inquisition gold. You have earned ".. v .." of gold in total. ...",
"Do you want me to add this amount to my books? This will reset your current records, too, however - so?",
}, cid)
end
elseif npcHandler.topic[cid] == 5 then
if msgcontains(msg, "yes") then
npcHandler:say({
"Good. Registered as... ".. player:getName() .."... with... about ".. player:getInquisitionGold() .." of righteously earned inquisition gold added. There. Thanks for your help! ..",
"Good. Ask me any time in case you want to know your current {record}. If you have time, Remember you can also {trade} your earnings into some of these... probably far more valuable, ahem... cluster... things, yes.",
}, cid)
player:setStorageValue(ROSHAMUUL_GOLD_RECORD, player:getInquisitionGold())
player:setStorageValue(ROSHAMUUL_MORTAR_THROWN, 0)
player:setStorageValue(ROSHAMUUL_KILLED_FRAZZLEMAWS, 0)
player:setStorageValue(ROSHAMUUL_KILLED_SILENCERS, 0)
npcHandler.topic[cid] = nil
end
elseif msgcontains(msg, "record") then
local v = player:getStorageValue(ROSHAMUUL_GOLD_RECORD)
if v > 0 then
npcHandler:say("You have ".. v .." inquisition gold registered in my book.", cid)
else
npcHandler:say("I do not see inquisition gold registered in my book from you.", cid)
end
elseif msgcontains(msg, "trade") then
local v = player:getStorageValue(ROSHAMUUL_GOLD_RECORD)
if v >= 100 then
npcHandler.topic[cid] = 6
npcHandler:say("Ah yes, you currently have ".. v .." of righteously earned inquisition gold in my book. 100 inquisition gold equals one cluster. How many clusters do you want in exchange?", cid)
else
npcHandler.topic[cid] = nil
npcHandler:say("You do not seem to have enough inquisition gold yet to trade for clusters, as it's registered in my book.", cid)
end
elseif npcHandler.topic[cid] == 6 then
local v = tonumber(msg)
if (v == nil) or (v < 1) or (math.floor(v) ~= v) then
return npcHandler:say("You should tell me a real number.", cid)
end
local max = math.floor(player:getStorageValue(ROSHAMUUL_GOLD_RECORD)/100)
if v > max then
return npcHandler:say("You do not have enough inquisition gold for that, so far you can ask for up to ".. max .." clusters.", cid)
end
player:addItem(22396, v)
npcHandler.topic[cid] = nil
player:setStorageValue(ROSHAMUUL_GOLD_RECORD, player:getStorageValue(ROSHAMUUL_GOLD_RECORD) - (v*100))
npcHandler:say("There you are. Now I register ".. player:getStorageValue(ROSHAMUUL_GOLD_RECORD) .." inquisition gold of yours in my book.", cid)
end
if msgcontains(msg, "bucket") or msgcontains(msg, "supplies") then
npcHandler:say("Head to brother Maun if you are in need of basic supplies. He will help you - for a small fee.", cid)
elseif msgcontains(msg, "maun") then
npcHandler:say("Brother Maun is a valuable member of the Inquisition. He will help you out with supplies. Provided you can actually compensate of course.", cid)
end
return true
end
npcHandler:setMessage(MESSAGE_GREET, "Hm. Greetings.")
npcHandler:setMessage(MESSAGE_FAREWELL, "Praise the gods, I bid you farewell.")
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Add @data/items/items.xml
XML:
<item id="22456" article="an" name="instable vortex" />
<item id="22459" name="chalk">
<attribute key="description" value="This chalk could be gathered with an available bucket." />
</item>
<item id="22467" name="fine gravel">
<attribute key="decayTo" value="22469" />
<attribute key="duration" value="60" />
</item>
<item id="22468" name="rubble">
<attribute key="decayTo" value="22469" />
<attribute key="duration" value="60" />
</item>
<item id="22469" name="stone">
<attribute key="description" value="This stone seems quite suited to crush some fine gravel." />
</item>
<item id="22470" name="chalk residues">
<attribute key="description" value="There is some chalk on this floor. Not enough to fill even a small bucket, however." />
<attribute key="decayTo" value="22459" />
<attribute key="duration" value="120" />
</item>
<item id="22550" article="a" name="trough for mortar">
<attribute key="description" value="This trough should hold a large amount of mortar." />
</item>
Replace the lava hole items for Lavahole monsters near area: 33510, 32598, 8
Set ActionID 1500 to item 22663 at
33560, 32525, 7
33554, 32545, 7
33573, 32547, 7
33543, 32562, 7
33579, 32567, 7
sorry, no easy download way this time