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

NPCs

Sam

Banned User
Joined
Aug 22, 2008
Messages
715
Reaction score
0
Location
British Columbia, Canada
So yeah, I'm somewhat new with NPCs and I'm wondering:

- When I code them, I use parameters and default scripts and there are no errors in the console
- When I try to use "/s" in-game it wont spawn

Anywhere I gotta add it to? I tried adding to spawn, but didn't spawn. Tested everything for both 0.2x and 0.3x.

Also, what parameter can I use to randomly yell out messages?

any ideas? I want to test it. D=

Okay I think I found it in /lib/data, but yet I still need to know what the parameter to yell messages is; do you know?

I can't find it in the data files inside /lib/.

Here's a rundown of what I need:

- Ability to talk in default (elimate NPC channel)
- Ability to still say "trade" and the window pops up
- Ability to buy with saying "buy this, buy that"

I've edited shit in the /lib/; nothing works for me.
 
Last edited:
I dont know what do you exactly want. To spawn a NPC you must write /n. The /s is the old /summon command.
 
Mmm I don't know right now, I'm on the ipod. If nobody answers you, I'll tell you tomorrow. Sorry.
 
Okay I think I found it in /lib/data, but yet I still need to know what the parameter to yell messages is; do you know?

I can't find it in the data files inside /lib/.

Here's a rundown of what I need:

- Ability to talk in default (elimate NPC channel)
- Ability to still say "trade" and the window pops up
- Ability to buy with saying "buy this, buy that"

I've edited shit in the /lib/; nothing works for me.
 
Last edited:
People need the script for the first 3 of the tibia global NPCs, Santiago, and ect ...
Will someone help me or know what NPC Maker which can create these NPCs?
 
@Random Yelling;

Here's my script for Golem Guardian NPCs in Yalahar (They guard NPC Yalahari)
You can't greet them, and they occasionally say one of the messages.

LUA:
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 thinkCallback(cid)

local rand = math.random(1,200)

	if rand == 1 then
		doCreatureSay(getNpcCid(),'Prime Mission: protect Yalahari master.',TALKTYPE_SAY)
	elseif rand == 2 then
		doCreatureSay(getNpcCid(),'N.O.O.B. termination initiated.',TALKTYPE_SAY)
	elseif rand == 3 then
		doCreatureSay(getNpcCid(),'Monitoring interaction for hostilities.',TALKTYPE_SAY)
	elseif rand == 4 then
		doCreatureSay(getNpcCid(),'Danger: Overheating.',TALKTYPE_SAY)
	elseif rand == 5 then
		doCreatureSay(getNpcCid(),'Target locked.',TALKTYPE_SAY)
	elseif rand == 6 then
		doCreatureSay(getNpcCid(),'Scanning human life form.',TALKTYPE_SAY)
	end
	return TRUE
end

function greetCallback(cid)
return false
end
 
npcHandler:setCallback(CALLBACK_ONTHINK, thinkCallback)
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())

  1. Ability to talk in default (elimate NPC channel)

    npchandler.lua and npcsystem.lua:
    LUA:
    	NPCHANDLER_CONVBEHAVIOR = CONVERSATION_DEFAULT
  2. Ability to still say "trade" and the window pops up

    modules.lua:
    LUA:
    	SHOPMODULE_MODE = SHOPMODULE_MODE_BOTH
  3. Ability to buy with saying "buy this, buy that"

    Same as 2.
 
Last edited:
Back
Top