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

[REQUEST] Event NPC!

Ranyo13

ManCausingMayhem
Joined
Aug 22, 2009
Messages
981
Reaction score
39
Hello otlanders,
Today im requesting an event npc, his job is to sell vip items for event tokens in game, this way players will be so happy that they don't have to pay real life money to be powerful, only rich players that aren't professional gamers donate.. So, the npc should should sell items like an Addon doll or a vip medal, for 100 event tokens, i realy need a configure-able npc like theres a table that i can edit to put what item can be sold, and how much is it..
Here's an example:
Table:
[8982] = {9020, 100}
--^--------^----^
Addon----Event--How many event tokens shud it be
Doll Id---Token id

I realy hope you guys get what i mean, i will add reputation for who helps me with this!
Thanks in advance,
Ranyo13
 
Kind of what you asked for, i didnt setup a table because i have no time but read and learn how to add them its not that hard.

+Rep

LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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)
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	local tokenid = xxxx -- token id here
	local dollid = xxxx -- doll id here
	if(msgcontains(msg, 'hi')  or msgcontains(msg, 'hello')) then
	npcHandler:say("Hello i sell very strong {equipment} for special {event tokens}")
	Talkstate[TalkUser] = 1
	end
	elseif(msgcontains(msg, 'equipment') or msgcontains(msg, 'event tokens') and  Talkstate[TalkUser] = 1) then
	npcHandler:say("I can sell you currently {vip doll}."}
	end
	elseif(msgcontains(msg, 'vip doll') and Talkstate[TalkUser] = 1) then
	npcHandler:say("Would you like to buy the {vip doll} for {100 tokens}?")
	Talkstate[TalkUser] = 2
	end
	elseif(msgcontains(msg, 'yes') and Talkstate[TalkUser] = 2 then
	if(doPlayerRemoveItem(cid, tokenid, 100) == TRUE then
	doPlayerAddItem(cid, dollid, 1)
	npcHander.say:("Here you go.")
	talkState[talkUser] = 0
	end
	return true
	end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
Back
Top