• 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!

NPC Nightmare Knights & Brotherhood of Bones

Frankit0

Surf Power
Joined
Feb 22, 2010
Messages
102
Reaction score
0
Location
Argentina
Hello!

I just made these two NPCs: Dream Master & Bone Master
These are my first releases XD so please, be kind :)
Dream Master -> Gives Nightmare shield along with Nightmare Outfit and first addon (500 demonic essences) and second addon (1000 demonic essences)

Bone Master -> Gives Necromancer shield along with Brotherhood Outfit and first addon (500 demonic essences) and second addon (1000 demonic essences)

First go to data/npc/scripts and create dreamers.lua and copy this:
PHP:
-- NIGHTMARE ADDONS & NIGHTMARE SHIELD BY Frankit0 --

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

-- Storage IDs --
local dreamers        = 37326


local outfit	= 'Here is your outfit and your Nightmare Shield, use it wisely!!'
local newaddon    = 'Here you are, enjoy your new addon!'
local noitems        = 'You do not have all the required items.'
local noitems2    = 'You do not have all the required items or you do not have the first addon, which by the way, is a requirement for this addon.'
local already        = 'It seems you already have this addon!'
        
-- DREAMERS START --
function DreamersFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,dreamers)
    if addon == -1 then
        if getPlayerItemCount(cid,6500) >= 500 then
        if doPlayerRemoveItem(cid,6500,500) then
            selfSay(outfit)
             
            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 269, 1)
            doPlayerAddOutfit(cid, 268, 1)
		doPlayerAddItem(cid, 6391, 1)
            setPlayerStorageValue(cid,dreamers,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end

function DreamersSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,dreamers+1)
    if addon == -1 then
        if getPlayerItemCount(cid,6500) >= 1000 then
        if doPlayerRemoveItem(cid,6500,1000) then
            selfSay(newaddon)
             
            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 268, 2)
            doPlayerAddOutfit(cid, 269, 2)
            setPlayerStorageValue(cid,dreamers+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- DREAMERS END --

keywordHandler:addKeyword({'addons'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you first & second addons of the Nightmare outfit."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "What you do is that you type 'first nightmare addon' or 'second nightmare addon'. Assuming that you already collected all the required pieces, say 'yes'"})

local node1 = keywordHandler:addKeyword({'first nightmare addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first nightmare addon you need to give me 500 demonic essences. Do you have them with you?'})
    node1:addChildKeyword({'yes'}, DreamersFirst, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

local node2 = keywordHandler:addKeyword({'second nightmare addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second nightmare addon you need to give me 1000 demonic essences. Do you have them with you?'})
    node2:addChildKeyword({'yes'}, DreamersSecond, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

npcHandler:addModule(FocusModule:new())



now create brotherhood.lua and copy this:
PHP:
-- BROTHERHOOD OF BONES ADDONS & NECROMANCER SHIELD BY Frankit0 --

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

-- Storage IDs --
local brotherhood        = 37335


local outfit	= 'Here is your outfit and your Necromancer Shield, use it wisely!!'
local newaddon    = 'Here you are, enjoy your new addon!'
local noitems        = 'You do not have all the required items.'
local noitems2    = 'You do not have all the required items or you do not have the first addon, which by the way, is a requirement for this addon.'
local already        = 'It seems you already have this addon!'
        
-- BROTHERHOOD START --
function BrotherhoodFirst(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,brotherhood)
    if addon == -1 then
        if getPlayerItemCount(cid,6500) >= 500 then
        if doPlayerRemoveItem(cid,6500,500) then
            selfSay(outfit)
             
            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 278, 1)
            doPlayerAddOutfit(cid, 279, 1)
		doPlayerAddItem(cid, 6433, 1)
            setPlayerStorageValue(cid,brotherhood,1)
        end
        else
            selfSay(noitems)
        end
    end
    end

end

function BrotherhoodSecond(cid, message, keywords, parameters, node)

    if(not npcHandler:isFocused(cid)) then
        return false
    end

    if isPremium(cid) then
    addon = getPlayerStorageValue(cid,brotherhood+1)
    if addon == -1 then
        if getPlayerItemCount(cid,6500) >= 1000 then
        if doPlayerRemoveItem(cid,6500,1000) then
            selfSay(newaddon)
             
            doSendMagicEffect(getCreaturePosition(cid), 13)
            doPlayerAddOutfit(cid, 278, 2)
            doPlayerAddOutfit(cid, 279, 2)
            setPlayerStorageValue(cid,brotherhood+1,1)
        end
        else
            selfSay(noitems)
        end
    else
        selfSay(already)
    end
    end

end
-- BROTHERHOOD END --

keywordHandler:addKeyword({'addons'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can offer you first & second addons of the Brotherhood of Bones outfit."})
keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "What you do is that you type 'first brotherhood addon' or 'second brotherhood addon'. Assuming that you already collected all the required pieces, say 'yes'"})

local node1 = keywordHandler:addKeyword({'first brotherhood addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the first brotherhood of bones addon you need to give me 500 demonic essences. Do you have them with you?'})
    node1:addChildKeyword({'yes'}, BrotherhoodFirst, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

local node2 = keywordHandler:addKeyword({'second brotherhood addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To achieve the second brotherhood of bones addon you need to give me 1000 demonic essences. Do you have them with you?'})
    node2:addChildKeyword({'yes'}, BrotherhoodSecond, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

npcHandler:addModule(FocusModule:new())


Now, let's create the NPCs.
Go to data/NPC and create Dream Master.xml and copy this:
PHP:
<?xml version="1.0"?>
<npc name="Dream Master" script="dreamers.lua" access="5" lookdir="2" walkinterval="2000">
  <mana now="800" max="800" />
  <health now="200" max="200" />
    <look type="130" head="19" body="86" legs="87" feet="95" addons="2"/>
  <parameters>
    <parameter key="message_greet" value="Greetings. I am the Dream Master, what do you need?"/>
        <parameter key="message_farewell" value="Good bye."/>
		<parameter key="message_walkaway" value="Farewell then.." />
    </parameters>
</npc>


Now create Bone Master.xml and copy this:
PHP:
<?xml version="1.0"?>
<npc name="Bone Master" script="brotherhood.lua" access="5" lookdir="2" walkinterval="2000">
  <mana now="800" max="800" />
  <health now="200" max="200" />
    <look type="130" head="19" body="86" legs="87" feet="95" addons="2"/>
  <parameters>
    <parameter key="message_greet" value="Greetings. I am the Bone Master, what do you need?"/>
        <parameter key="message_farewell" value="Good bye."/>
		<parameter key="message_walkaway" value="Farewell then.." />
    </parameters>
</npc>


And done!! :)


If it was helpfull for you, please rep me ^^

Yours.
Garr~
Frankit0~


If it Helped you, please Rep++ me!! XD
 
Last edited:
In dreamers.lua
Change
Lua:
doPlayerAddOutfit(cid, 252, 1)
       doPlayerAddOutfit(cid, 268, 1)
to
Lua:
doPlayerAddOutfit(cid, 269, 1)
            doPlayerAddOutfit(cid, 268, 1)

:)
 
Nice job ryandometal! I like your work.




JKJK Nice job Frankit0
 
I think he was wrong xD
Anyway, fix this in brotherhood:

Lua:
text = "What you do is that you type 'first brothrhoo addon' or 'second brotherhood addon'. Assuming that you already collected all the required pieces, say 'yes'"
to
Lua:
text = "What you do is that you type 'first brotherhood addon' or 'second brotherhood addon'. Assuming that you already collected all the required pieces, say 'yes'"
Some letters are missing there xD.
 
Back
Top