Tested with TFS 0.3.6pl1 8.54
creaturescripts.xml
Add this line to login.lua
mapmark.lua
How does it work:
You type a location, and it adds a mapmark there.
If you type location or locations you see all the locations in the scroll.
If the location is not in the script, you will receive a message that it doesn't exist.
Let me know if you have any questions or bugs.
creaturescripts.xml
XML:
<event type="textedit" name="Mapmark" event="script" value="mapmark.lua"/>
Lua:
registerCreatureEvent(cid, "Mapmark")
Lua:
-- Mapmark scroll by Limos
local config = {
["Riona"] = {mark = {x = 1000, y = 1000, z = 7}, type = MAPMARK_TICK, name = "Riona\'s Tool Shop"},
["deposit"] = {mark = {x = 1000, y = 1000, z = 7}, type = MAPMARK_TICK, name = "deposit"},
["boat"] = {mark = {x = 1000, y = 1000, z = 7}, type = MAPMARK_TICK, name = "boat"},
["rotworms"] = {mark = {x = 1000, y = 1000, z = 7}, type = MAPMARK_TICK, name = "rotworms"},
["cyclops"] = {mark = {x = 1000, y = 1000, z = 7}, type = MAPMARK_TICK, name = "cyclops"},
["dragons"] = {mark = {x = 1000, y = 1000, z = 7}, type = MAPMARK_TICK, name = "dragons"},
["demons"] = {mark = {x = 1000, y = 1000, z = 7}, type = MAPMARK_TICK, name = "demons"}
}
function onTextEdit(cid, item, newText)
if item.itemid == 1949 then
local x = config[newText]
if x then
doPlayerAddMapMark(cid, x.mark,x.type,x.name)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_GREEN)
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You added a new mapmark for '..newText..' to your minimap.')
end
local y = isInArray({'location', 'locations'}, newText)
if y then
local text = 'Locations\n'
for i, x in pairs(config) do
text = text .. "\n" .. i .. ""
end
doShowTextDialog(cid, 1949, "" .. text)
end
if not x and not y then
doSendMagicEffect(getThingPos(cid), CONST_ME_POFF)
return doPlayerSendCancel(cid, "This location doesn\'t exist in this scroll.")
end
end
return true
end
How does it work:
You type a location, and it adds a mapmark there.
If you type location or locations you see all the locations in the scroll.
If the location is not in the script, you will receive a message that it doesn't exist.
Let me know if you have any questions or bugs.
Last edited: