• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

spell teacher.

yandere

New Member
Joined
Feb 1, 2014
Messages
76
Reaction score
4
needs teacher spells. if I have 50 lvl, 30 Fishing teaches me mega fish, and 100lvl, 50 fishing and 5cc teaches super fish. thanks.
 
Code:
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 megaFish(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
      return false
    end
    if getPlayerSkillLevel(cid, 6) >= 30 then
        if getPlayerLearnedInstantSpell(cid, "mega fish") == false then
            if getPlayerLevel(cid) >= 50 then
              doPlayerLearnInstantSpell(cid, "mega fish")
            else
              selfSay("You are not level 50.", cid)
            end
        else
          selfSay("You have already learned this spell.", cid)
        end
    else
      selfSay("You need to be level 30 in fishing.", cid)
    end
   return true
end
      

function superFish(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
      return false
    end
    if getPlayerSkillLevel(cid, 6) >= 50 then
        if getPlayerLearnedInstantSpell(cid, "super fish") == false then
            if getPlayerLevel(cid) >= 100 then
              doPlayerLearnInstantSpell(cid, "super fish")
            else
              selfSay("You are not level 100.", cid)
            end
        else
          selfSay("You have already learned this spell.", cid)
        end
    else
      selfSay("You need to be level 50 in fishing.", cid)
    end
   return true
end


keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I am a teacher and I can teach you spells to {mega fish} and {super fish}."})

local node1 = keywordHandler:addKeyword({'mega fish'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to learn mega fish?"})
    node1:addChildKeyword({'yes'}, megaFish, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Are you an alienated!", reset = true})

local node2 = keywordHandler:addKeyword({'super fish'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Do you want to learn super fish?"})
    node2:addChildKeyword({'yes'}, superFish, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "Are you an alienated!", reset = true})

npcHandler:addModule(FocusModule:new())
npcHandler:setMessage(MESSAGE_GREET, "Hello, can I {help} you?")
 
Last edited:
Back
Top