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

Lua Premium Accounts (Reputation ++)

Status
Not open for further replies.

Nikkster

Programmer
Joined
May 9, 2008
Messages
2,848
Reaction score
10
Location
Confidential
Hello, do anyone got a clue how I can add to a boat NPC so he only travel Premium accounts to a certain city?

For an example, premium account Player: Hi
Boat NPC: Welcome! I can travel you to Diamond City if you would like to. Notice that this city is only for premium player's!
Premium account Player: Yes

Travelling the player to the city ~~

And for players who has free premium account but can still go to the realtibia premium place such as ankrahmun etc ----
Free account Player: Hi
Boat NPC: Sorry, you need to have a premium account to be able to travel to Diamond City.


Etc, if you understand what I'm talking about. I would really appreciate if someone could make such a NPC for me. Also as I mentioned in the title, I will give repuation to the one who's making this script for me. Thanks
 
Code:
<npc name="Captain Narozia" script="data/npc/scripts/theboat.lua" walkinterval="0" floorchange="0" access="5" level="1" maglevel="1">
	<health now="150" max="150"/>
       	<look type="129" head="116" body="114" legs="89" feet="95" corpse="1313"/>
  corpse="2212"/>
	<parameters>
		<parameter key="module_travel" value="1" />
		<parameter key="message_greet" value="Hello |PLAYERNAME|. I can take you to: {Thais}, {Venore}, {Carlin}, {Edron}, {Ankrahmun},{ Ab dendriel}, {Port hope}, {Darashia}, {Svargrond}, {Goroma}, {Oken}, {Gengia}, {Pyre} and {YALAHAR} for free." />
		<parameter key="travel_destinations" value="liberty bay,32285,32890,6,0;thais,32311,32210,6,0;venore,32954,32022,6,0;carlin,32388,31821,6,0;ab dendriel,32733,31669,6,0;ankrahmun,33092,32883,6,0;darashia,33288,32482,6,0;edron,33176,31765,6,0;port hope,32528,32784,6,0;goroma,31994,32565,6,0;svargrond,32343,31106,6,0;yalahar,1345,1170,6,0;" />
	</parameters>
</npc>
 
lol ur so stupid he means the lua

I wasn't finished, dumb ass. Go out and stop sitting and watching my threads all the time. Learn something about open tibia "omg omg, im omar, i veri veri create best ot in world!! hwehehehe"


Now I am finished with the details. The script isnt in my Lua folder still, he said he will code it for me. That's the NPC I want it to be on, he will handle the premium account for me.
 
Your theboat.lua:
(edit it)
PHP:
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 travelNode = keywordHandler:addKeyword({'premium island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want a trip to premium island for 50 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 50, destination = {x=739, y=582, z=7}})
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Come back anytime.'})
        
        keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to {premium island}.'})

        npcHandler:addModule(FocusModule:new())
 
Explain him how you did it so he can dont ask again the same thing and he can do it himself!

Ill explain it..
Its very simple you just beed to add "premium = true" into the "travelNode:addChildKeyword()" parameters and thats it :D!
 
Your theboat.lua:
(edit it)
PHP:
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 travelNode = keywordHandler:addKeyword({'premium island'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want a trip to premium island for 50 gold coins?'})
        	travelNode:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 50, destination = {x=739, y=582, z=7}})
        	travelNode:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Come back anytime.'})
        
        keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I can take you to {premium island}.'})

        npcHandler:addModule(FocusModule:new())


Thanks mate, I will test if it works. However, now I only need to add the coordinates and the place in the NPC File, right? :)

Added rep to ya
 
Nikkster, why dont u stop hosting the ot I made? didnt u say I did nothing? Sure, just delete the OT download a 8.40 one not edited and edit it, then all what u say about me is true (if you download a normal 8.40 and edit) but not using my edited roxor server, and getting all this players and saying "You didnt do anything".. stupid noob
 
Nikkster, why dont u stop hosting the ot I made? didnt u say I did nothing? Sure, just delete the OT download a 8.40 one not edited and edit it, then all what u say about me is true (if you download a normal 8.40 and edit) but not using my edited roxor server, and getting all this players and saying "You didnt do anything".. stupid noob

Actually, you didnt do a shit (except making some items and mapping some ugly stuff). You dont know anything about open tibia! :) However, yes I've stopped hosting it. I am aiming on serious projects now, not noob projects like you have edited, lol.

Thread closed
 
Status
Not open for further replies.
Back
Top