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

Need help to configure Rashid and Soya!

DonHagman

Chill'Reward2014
Joined
Dec 26, 2010
Messages
875
Reaction score
186
Location
Dudeland, Macronesia
Hello.

I've got an map with Rashid in Thais depot, and Soya just outside. At this moment everyone can sell their items to them.

What I would need is some Help to get both Rashid and Soya Only to trade with premium accounts. Would be lovely if they also could say something like "Only premium players can trade with me." if any non-premium players try to trade with them!

I would really appriciate if anyone can help me out with this!


Peace out,
Hagman
 
4.0 doesn't exist, I assume you mean 0.4.
loot.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

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'helmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal (40k), warrior (6k), crusader (9k), crown (5k), devil (4k), chain (35gp) and iron helmets (30gp), also mystic turbans (500gp).'})
keywordHandler:addKeyword({'boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden boots (100k), steel boots (40k) and boots of haste (40k).'})
keywordHandler:addKeyword({'armors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (30k), crown (20k), knight (5k), lady (7,5k), plate (400gp), brass (200gp) and chain armors (100gp), also mpa (100k), dsm (60k) and blue robes (15k).'})
keywordHandler:addKeyword({'legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (80k), crown (15k), knight (6k), plate (500gp) and brass legs (100gp).'})
keywordHandler:addKeyword({'shields'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy blessed (150k), great (100k), demon (40k), vampire (25k), medusa (8k), amazon (4k), crown (5k), tower (4k), dragon (3k), guardian (2k), beholder (1k), and dwarven shields (100gp), also mms (80k).'})
keywordHandler:addKeyword({'swords'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant (10k), bright (6k), fire (3k) serpent (1.5k), spike (800gp) and two handed swords (400gp), also ice rapiers (4k), magic longswords (150k), magic swords (90k), warlord swords (100k) broad swords (70gp), short swords (30gp), sabres (25gp) and swords (25gp).'})
keywordHandler:addKeyword({'axes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy fire (10k), guardian halberds (7,5k) knight (2k), double (200gp) and battle axes (100gp), also dragon lances (10k), stonecutters axes (90k), halberds (200gp) and hatchets (20gp).'})
keywordHandler:addKeyword({'clubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).'})


function greetCallback(cid)
     if not isPremium(cid) then
         selfSay("Only premium players can trade with me.", cid)
         return false
     end
     return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())

Do the same thing for the other npc.
 
You can just add this part to the Lua script of the npcs
Code:
local function greetCallback(cid)
     if not isPremium(cid) then
         selfSay("I only trade with premium members.", cid)
         return false
     end
     return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)
 
You can just add this part to the Lua script of the npcs
Code:
local function greetCallback(cid)
     if not isPremium(cid) then
         selfSay("I only trade with premium members.", cid)
         return false
     end
     return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)


Perfect, I will try it out in a while. Thanks again!
 
You can just add this part to the Lua script of the npcs
Code:
local function greetCallback(cid)
     if not isPremium(cid) then
         selfSay("I only trade with premium members.", cid)
         return false
     end
     return true
end

npcHandler:setCallback(CALLBACK_GREET, greetCallback)


I try to add this code on my script and didnt work " if not isPremium(cid) then"

i need script only for premium player trade with rashid if you can help please i got OTHIRE 0.2
 
Back
Top