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

Request your npcs here!!

Status
Not open for further replies.

Mokerhamer

Retired Global Mod
Senator
Joined
Aug 6, 2007
Messages
1,767
Reaction score
35
What you cant request, ALready released npc's like addon npc and blesser, npc like that that are already can be founded in this forum.

Ofcourse the npc's that i make will get released on otland.net! ANd i only make npc's for The Forgotten Server!



========~~~~~~~How to request~~~~~~~========
What for npc:

What should the npc be able to do:

What advanced functions do u want:
 
Last edited:
What for npc: Assassin NPC like the Tibia Assassin NPC (that sells assassin stars and other paladin things)

What should the npc be able to do: the npc sell assassin stars.

What advanced functions do u want: you can only uy things from this npc if you have full assassin addon and with "fire condition".

Thanks!
 
What for npc: Assassin NPC like the Tibia Assassin NPC (that sells assassin stars and other paladin things)

What should the npc be able to do: the npc sell assassin stars.

What advanced functions do u want: you can only uy things from this npc if you have full assassin addon and with "fire condition".

Thanks!

Premmy check to?

what do u mean with "fire condition" ???





NPC Atrad
Location: Goroma
Occupation: Assassin
Notes:
Items traded: Buys:
Nothing Sells:
Assassin Stars (450 gps and only if you have the Assassin outfit)

See: Entire NPC list.
 
Last edited:
The player need to step on a fire field to buy things from the npc.

EDIT:

Yes, that is the NPC, but you need the fire condition too, if not, the NPC says something like "you is not hot for me".
 
Last edited:
The player need to step on a fire field to buy things from the npc.

EDIT:

Yes, that is the NPC, but you need the fire condition too, if not, the NPC says something like "you is not hot for me".

Hmm i'll check if i can make anywais i can not let him check if he haas the addon because there is no sutch function "doplayergetaddon(cid,looktyped,addon)" or somting like that
 
But my addon npc save if the player have or not the addon on a storage value too.

the checks for assassin addon are:
Code:
getPlayerStorageValue(cid,120001) -- first assassin addon
getPlayerStorageValue(cid,120002) -- second assassin addon

You can do the check with this?
 
You gave me only for male check anywais i'v got this it's made in like 5 min?
not tested but i'v not seen any bugs yet, AND IT"S NOT DONE YET.

Altrad.xml
Code:
<npc name="Altrad" script="data/npc/scripts/sin.lua" autowalk="0" floorchange="0" access="5" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="129" head="95" body="95" legs="95" feet="95" corpse="3058"/>
	<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|, I am Altrad, i sell Assasin Stars only to Assasins." />
<parameter key="message_farewell" value="Good bye |PLAYERNAME|, good luk on your jearny" />
	</parameters>
</npc>

sin.lua
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 creatureSayCallback(cid, type, msg)
	if(npcHandler.focus ~= cid) then
		return false
	end

	    local count = (getCount(msg))	
		no_addon = 'I am sorry you do not have the full assassin outfit.'
        no_money = 'Sorry you do not have enough of money to buy '..count..' Assassin Stars'
------------------------------------------------npc start------------------------------------------------
		if msgcontains(msg, 'assassin stars') then
			if getPlayerStorageValue(cid,120001) and
            getPlayerStorageValue(cid,120002) == TRUE then
			selfSay('How many assassin stars would u like to buy?')
			talk_state = 1
			else
				selfSay(no_addon)
				talk_state = 0
			end
------------------------------------------------ confirm yes ------------------------------------------------			
			elseif isNumber(getCount(msg)) and talk_state == 1 then
            talk_state = 0
           local total = math.floor(count*450)
           if doPlayerRemoveMoney(cid, total) == TRUE then
          doPlayerAddItem(cid,7368,count)
        selfSay('You have successfully bought '..count..' Assasin stars for '..total..' Gold pieces.')
           else
        selfSay(no_money)
        end

------------------------------------------------ confirm no ------------------------------------------------
		elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 1) then
			selfSay('Ok than.')
			talk_state = 0
		end
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())






If you dont have the getCount function here you are add this in npc.lua (add the bottum)

Code:
function getCount(msg)
 local ret = -1
 local b, e = string.find(msg, "%d+")
    if b ~= nil and e ~= nil then
       ret = tonumber(string.sub(msg, b, e))
    end
 
    return ret
end
:thumbup:


i will finish the npc if you post in this thread again
 
Last edited:
i Want a boat Man how can i go to 10 more diferent places...
how about too one Separete addon NPC WORKing! for TFS!
 
Kind like the Tibia Global NPC...you have to colect all items or give money to npc and he give one addon...

actually i cant make all of them but what i could do is give u 1 or 2 examples how to make them and if you have errors i'll help you with it.

and about boat npc here you are.

captain.xml
Code:
<npc name="Captain Black Heart" script="data/npc/scripts/all.lua" autowalk="1" floorchange="0" access="5" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="133" head="20" body="120" legs="75" feet="13" corpse="2212"/>
	<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|, I can send you to Ankhara and to Serpent ride for a small fee" />
<parameter key="message_farewell" value="Good bye |PLAYERNAME|, Let the god of World of Tramon be with you!" />

		<parameter key="module_travel" value="1" />
		<parameter key="travel_destinations"value="ankhara,518,594,6,150,true;serpent ride,573,465,11,150,true" />
		
	</parameters>
</npc>

How it works.
ankhara,518,594,6,150,true;
City name
cordinate X
coordinate Y
coordinate Z
150= Price
True= Premmy needed/False Premmy not needed
and if u want to make it go to to more citys do it at the same way just dont forget to add the ";"
example.

key="travel_destinations"value="ankhara,518,594,6,150,true;serpent ride,573,465,11,150,true" />

so if u want it to goto 3 places it should be:

key="travel_destinations"value="ankhara,518,594,6,150,true;CITYNAME,X,Y,Z,PRICE,PREMMY NEEDED TRUE/FALSE;serpent ride,573,465,11,150,true" />

The lua script of it (do not change anything in it!):
Code:
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

npcHandler:addModule(FocusModule:new())


ANd you have another way but i think this way is the best way for an npc beginner;):p
 
Last edited:
Thanks Mokerhamer!

The script works :)

I've made some changes on that...

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 creatureSayCallback(cid, type, msg)
    if(npcHandler.focus ~= cid) then
        return false
    end

    local count = (getCount(msg))
    local no_addon = 'I am sorry, but you are not a true assassin.'
    local no_money = 'Sorry, you do not have enough money.'
------------------------------------------------npc start------------------------------------------------
    if msgcontains(msg, 'assassin stars') or msgcontains(msg, 'assassin star') then
        if getPlayerStorageValue(cid, 120001) == 1 and getPlayerStorageValue(cid, 120002) == 1 then
            selfSay('How many assassin stars would you like to buy?')
            talk_state = 1
        else
            selfSay(no_addon)
            talk_state = 0
        end
------------------------------------------------ confirm count ------------------------------------------------            
    elseif isNumber(getCount(msg)) == TRUE and talk_state == 1 then
        talk_state = 2
        total_star = math.floor(count*450)
        total_count_star = count
        if (total_count_star > 1) then
            wtb_message = 'Do you want to buy '..total_count_star..' assasin stars for '..total_star..' gold coins?'
        else
            wtb_message = 'Do you want to buy '..total_count_star..' assasin star for '..total_star..' gold coins?'
        end
        selfSay(wtb_message)

------------------------------------------------ confirm yes ------------------------------------------------            
    elseif msgcontains(msg, 'yes') and talk_state == 2 then
        talk_state = 0
        if doPlayerRemoveMoney(cid, total_star) == TRUE then
            doPlayerAddItem(cid, 7368, total_count_star)
            selfSay('You have successfully bought '..total_count_star..' assasin stars for '..total_star..' gold coins.')
        else
                selfSay(no_money)
        end

------------------------------------------------ confirm no ------------------------------------------------
    elseif msgcontains(msg, 'no') and talk_state == 2 then
        selfSay('Not good enough, is it?')
        talk_state = 0
    end
    return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Thanks, rep++ ;)
 
If you look closly you will see it haves the same functions as mine but you just made it bigger, so if you have more npc's it could use like 1~2% more cpu but thats your choise i'm glad i could have helped you =)


P.s it only check if male has an assasin outfit dont forget the female!
 
The male and female use the same storageid :)

It's bigger because I want to the player say "yes" to buy, not only the number of assassin stars :p
 
Last edited:
The male and female use the same storageid :)

It's bigger because I want to the player say "yes" to buy, not only the number of assassin stars :p

Why dident u sai that in the beginning you could have easly made it in 2~3 lines lol :p
 
Thx Man it ll help me a lot ... i'm using the fuc* teleports in the boat xD now the npc will be implemented..
i have to copy and past the stages to go to more cities?
i think i got it xD just put
<parameter key="module_travel" value="1" />
<parameter key="travel_destinations"value="ankhara,518,594,6,150,true;serpent ride,573,465,11,150,true;serpent ride,573,465,11,150,true;serpent ride,573,465,11,150,true;serpent ride,573,465,11,150,true;serpent ride,573,465,11,150,true;serpent ride,573,465,11,150,true;serpent ride,573,465,11,150,true;serpent ride,573,465,11,150,true" />

</parameters>
</npc>
and change the city name positions premmy or no etc...?
 
Last edited:
Thx Man it ll help me a lot ... i'm using the fuc* teleports in the boat xD now the npc will be implemented..
i have to copy and past the stages to go to more cities?
i think i got it xD just put

and change the city name positions premmy or no etc...?


i dont see any problem in the script only a small bug at the first place at the "price" i see a space remove the space.

And yes, you only need to change names coordinates and prices.

The premmy Part:
true = Premmy needed
false= Premmy not needed
 
i got it man thx a lot i was serching this NPC code for a long time.. and no one works properly in the TFS!
 
Status
Not open for further replies.
Back
Top