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

Premium Rings

atomic chavez

Hi there
Joined
Mar 8, 2009
Messages
84
Reaction score
0
Location
Mexico Monterrey
Helo, I was wondering if It was possible to make a ring wearable only for those with premium account.

PHP:
	<item id="2168" article="a" name="life ring">
		<attribute key="weight" value="80"/>
		<attribute key="slotType" value="ring"/>
		<attribute key="transformEquipTo" value="2205"/>
		<attribute key="stopduration" value="1"/>
		<attribute key="showduration" value="1"/>
		<attribute key="manaGain" value="50"/>
		<attribute key="manaTicks" value="2000"/>
	</item>

And another thing...

How can I make so Only premium accounts are able to travel to Yalahar? Thais and venore remain for free

XML
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Marcus Fenix" script="data/npc/scripts/defaultmarcus.lua" walkinterval="2000" floorchange="0">
	<health now="150" max="150"/>
	<look type="268" head="79" body="12" legs="0" feet="14" corpse="2212" addons="2" />
    <parameters>
        <parameter key="module_travel" value="1"/>
		<parameter key="message_greet" value="Hello |PLAYERNAME|. I can bring you to Thais, Venore and to Yalahar."/>
        <parameter key="travel_destinations" value="thais,990,573,6,100;venore,1546,741,6,100;yalahar,456,212,6,100"/>
    </parameters>
</npc>


LUA
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



-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'travel'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can take you to thais, venore and yalahar. "})


npcHandler:addModule(FocusModule:new())

Yes, I've done some research here in forums but I didnt find any npc that could take you to NON premium boats and also to PREMIUM boats.
 
@Premium Boats:
Don't make their travel destinations in the XML file, use the Lua file instead
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


keywordHandler:addKeyword({'travel}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can take you to thais, venore and yalahar. "})

local travelNode1 = keywordHandler:addKeyword({'thais'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Thais for 100 gold coins?'})
travelNode1:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 100, destination = {x=900, y=573, z=6} })
travelNode1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

local travelNode2 = keywordHandler:addKeyword({'venore'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Venore for 100 gold coins?'})
travelNode2:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = false, level = 0, cost = 100, destination = {x=1546, y=741, z=6} })
travelNode2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

local travelNode2 = keywordHandler:addKeyword({'yalahar'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to sail to Yalahar for 100 gold coins?'})
travelNode2:addChildKeyword({'yes'}, StdModule.travel, {npcHandler = npcHandler, premium = true, level = 0, cost = 100, destination = {x=456, y=212, z=6} })
travelNode2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, reset = true, text = 'Then stay here!'})

npcHandler:addModule(FocusModule:new())

Just set the premium = true OR false.
 
Back
Top