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

Otfan125

Well-Known Member
Joined
Mar 1, 2008
Messages
169
Solutions
1
Reaction score
55
Location
Thais
I know this may sound a lil noobish, because it is .... well... can i have someone's addon and promote npc ? I'm been looking for them all my life. I'm getting tired of it... Someoen please help me. Thank you

Sincerely,
Otfan125 :thumbup:
 
Here you are TFS npcs.. All credits to TFS Developers..

Go toYourserv\data\npc\scripts and make a new file called promotion.lua and paste everything down here..

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

local node1 = keywordHandler:addKeyword({'promot'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can promote you for 20000 gold coins. Do you want me to promote you?'})
	node1:addChildKeyword({'yes'}, StdModule.promotePlayer, {npcHandler = npcHandler, cost = 20000, level = 20, text = 'Congratulations! You are now promoted.'})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Allright then. Come back when you are ready.', reset = true})

npcHandler:addModule(FocusModule:new())

Now go to Yourserv\data\npc and make a new file called yourpromotionnpc(its an example you can change it to the name you want) now paste everything down here..

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="[B]the name you want[/B]" script="data/npc/scripts/promotion.lua" autowalk="1" floorchange="0">
	<health now="100" max="100"/>
	<look type="133" head="20" body="39" legs="45" feet="7" addons="0"/>
</npc>

Thats all for promotion npc now lets move on to addon npc xD

Repeat the first step but instead of naming the file promotion.lua name it addon.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 buyAddons(cid, message, keywords, parameters, node)
	--TODO: buyAddons function in modules.lua
	if(cid ~= npcHandler.focus) then
		return false
	end

	local addon = parameters.addon
	local cost = parameters.cost
	local premium = (parameters.premium ~= nil and parameters.premium ~= false)

	if isPlayerPremiumCallback == nil or isPlayerPremiumCallback(cid) == true or premium == false then
		if doPlayerRemoveMoney(cid, cost) == TRUE then
			doPlayerAddAddons(cid, addon)
			npcHandler:say('There, you are now able to use all addons!')
		else
			npcHandler:say('Sorry, you do not have enough money.')
		end
	else
		npcHandler:say('I only serve customers with premium accounts.')
	end

	keywordHandler:moveUp(1)
	return true
end

local node1 = keywordHandler:addKeyword({'first addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to buy the first addons set for 5000 gold coins?'})
	node1:addChildKeyword({'yes'}, buyAddons, {addon = 1, cost = 5000, premium = true})
	node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})

local node2 = keywordHandler:addKeyword({'second addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Would you like to buy the second addons set for 10000 gold coins?'})
	node2:addChildKeyword({'yes'}, buyAddons, {addon = 2, cost = 10000, premium = true})
	node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, moveup = 1, text = 'Too expensive, eh?'})

keywordHandler:addKeyword({'addon'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I sell the first addons set for 5000 gold coins and the second addons set for 10000 gold coins.'})

npcHandler:addModule(FocusModule:new())

Now .. Step 2..

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Varkhal" script="data/npc/scripts/addons.lua" autowalk="1" floorchange="0">
	<health now="100" max="100"/>
	<look type="134" head="78" body="88" legs="0" feet="88" addons="3"/>
</npc>

thats all some reputation wont hurt ;)
 
Back
Top