Animera
* * * * *
everything is fixed atm.
Last edited:
function onKill(cid, target)
if isMonster(target) then
if getCreatureName(target) == "[COLOR="red"]name[/COLOR]" then
local storage = 45459
if getPlayerStorageValue(cid, storage) == -1 then
setPlayerStorageValue(cid, storage, 1)
doCreatureSay(cid, 'Congratulations! You slaughted The Haunted dragon, Get your rewards in the room in the west.', TALKTYPE_ORANGE_1)
doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
end
end
end
return true
end
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
-- OTServ event handling functions start
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
-- OTServ event handling functions end
function pick_quest(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local level = getPlayerLevel(cid)
for k, v in pairs(wow_like_quests) do
local required = tonumber(k)
if(level >= required) then
for i, v in ipairs(v) do
if getPlayerLevel(cid) >= 80 then
setPlayerStorageValue(cid,66226,1)
npcHandler:say("Our city keep getting earthquakes please help us go to the larva cave and find out who is responsible for this and kill him!", cid)
parameters.quest = v
return true
end
npcHandler:resetNpc()
return true
end
end
end
npcHandler:say("I have no quests to offer you at the moment. Come back when your stronger", cid)
npcHandler:resetNpc()
return true
end
function accept_quest(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end
local quest = node:getParent():getParameters().quest
local storage = quest.storage
setPlayerStorageValue(cid, storage, 0)
npcHandler:say("I'm expecting to hear from you again. Don't dissapoint me.", cid)
if(quest.on_accept) then quest.on_accept(cid, quest) end
npcHandler:resetNpc()
return true
end
-- Keyword "Quest" will pick lowest undone quest for you.
local questNode = keywordHandler:addKeyword({'quest'}, pick_quest, {})
questNode:addChildKeyword({'yes'}, accept_quest, {})
questNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Too hard for you, eh?'})
npcHandler:addModule(FocusModule:new())
most of everything in there looks very messy!That code looks so bad, it makes me dizzy.
Hope it works.
local m = {
["Cursed Behemoth"] = {
time = 60, -- Seconds
to = { x = 1202, y = 1214, z = 10 }, -- Where Teleport Goes
tp = { x = 1235, y = 1205, z = 10 } -- Where Teleport Creates
}
}
function onKill(cid, target, lastHit)
local monster = m[getCreatureName(target)]
if(monster) then
doCreateTeleport(1387, monster.to, monster.tp)
addEvent(reset, monster.time*1000, monster)
doCreatureSay(cid, "You have " .. monster.time .. " seconds to escape!", TALKTYPE_ORANGE_1)
end
return true
end
function deleteTeleport(monster)
local teleport = getTileItemById(monster.tp, 1387)
if(teleport.uid > 0) then
doRemoveItem(teleport.uid, 1)
doSendMagicEffect(monster.tp, CONST_ME_POFF)
doSendAnimatedText(monster.tp, "Closed", TEXTCOLOR_RED)
end
return true
end
function reset(monster)
addEvent(deleteTeleport, 0, monster)
end
You must spread some Reputation around before giving it to KylerXX again.