• 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 [MEGA Release] Complete addon NPC, newest NPC system, Yalaharian addon supported!

Hay i'm using TFS 0.3 from erp0t and it got a Free Premium System.
The Npc is checking if Player got Premium or not.
And if i write Hi he tellin' me i'm without Premium Account.
Anyone can change the Script for me so it doesn't need Premium Account?

Thanks!
 
Hay i'm using TFS 0.3 from erp0t and it got a Free Premium System.
The Npc is checking if Player got Premium or not.
And if i write Hi he tellin' me i'm without Premium Account.
Anyone can change the Script for me so it doesn't need Premium Account?

Thanks!

just search for Premium="1"/TRUE and change it to Premium="0"/FALSE or FALSE if it say TRUE
 
I get this Error...

Code:
[15/01/2009 03:08:18] Lua Script Error: [Npc interface] 
[15/01/2009 03:08:18] data/npc/scripts/addons.lua:onCreatureSay

[15/01/2009 03:08:18] data/npc/scripts/addons.lua:30: bad argument #1 to 'maxn' (table expected, got nil)
[15/01/2009 03:08:18] stack traceback:
[15/01/2009 03:08:18] 	[C]: in function 'maxn'
[15/01/2009 03:08:18] 	data/npc/scripts/addons.lua:30: in function 'callback'
[15/01/2009 03:08:18] 	data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
[15/01/2009 03:08:18] 	data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'
[15/01/2009 03:08:18] 	data/npc/lib/npcsystem/keywordhandler.lua:128: in function 'processMessage'
[15/01/2009 03:08:18] 	data/npc/lib/npcsystem/npchandler.lua:371: in function 'onCreatureSay'
[15/01/2009 03:08:18] 	data/npc/scripts/addons.lua:8: in function <data/npc/scripts/addons.lua:8>
 
maybe you have allowed freepremium in config.lua in your otserv folder
 
20:02 Leduzin [57]: first yalaharian addon
20:02 Varkhal: Did you bring me 1 vampiric crest for first yalaharian addon?
20:02 Leduzin [57]: yes
20:02 Varkhal: Here you are.

---------------

20:03 Leduzin [57]: second yalaharian addon
20:03 Varkhal: You already have this addon!

Wrong ERROR!! i only got the first addon :(

but i know whats wrong please edit it in your script :)



change to 10042

btw thanks for the nice script :)

Did you read what I have written in first post? First and second addons doesn't match each other! Just made as it is in real tibia.

@someone with problem with premium

just delete the following few lines from the code:
Code:
        if(getPlayerPremiumDays(cid) == 0) and (parameters.premium == true) then
            npcHandler:say('Sorry, but this addon is only for premium players!', cid)
            npcHandler:resetNpc()
            return true
        end
 
I think nowhere. But it's possible to make by quest="storage" tag in outfits.xml.
 
Hmmm I cant buy them:p If I say: Buy first citizen addon it says back: only premium players can buy this! But I am premium...
 
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(not npcHandler:isFocused(cid)) then
		return false
	end

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

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


is it possible to make this script none preem
becouse premium = false doesnt work
 
On latest TFS (0.3.1pl2) it not work (maybe only for me?)

Error from TFS console:
Code:
Lua Script Error: [Npc interface] 
data/npc/scripts/addoner.lua:onCreatureSay

data/npc/scripts/addoner.lua:33: attempt to call global 'getItemNameById' (a nil value)
stack traceback:
	data/npc/scripts/addoner.lua:33: in function 'callback'
	data/npc/lib/npcsystem/keywordhandler.lua:40: in function 'processMessage'
	data/npc/lib/npcsystem/keywordhandler.lua:168: in function 'processNodeMessage'
	data/npc/lib/npcsystem/keywordhandler.lua:128: in function 'processMessage'
	data/npc/lib/npcsystem/npchandler.lua:371: in function 'onCreatureSay'
	data/npc/scripts/addoner.lua:8: in function <data/npc/scripts/addoner.lua:8>
 
Back
Top