• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua change vocation

dervin13

Active Member
Joined
Apr 26, 2008
Messages
459
Solutions
1
Reaction score
28
For example when player get female summoner addon of winning ticket this player when change vocation get wand of mage addon... have any way to fix it??

ty
 
You need to check de storages and the numbers of outfits. Please, send your outfits.xml and your LUA addon npc. I will try to help ya!
 
<?xml version="1.0"?>
<outfits>
<outfit id="1">
<list gender="0" lookType="136" name="Citizen"/>
<list gender="1" lookType="128" name="Citizen"/>
</outfit>

<outfit id="2">
<list gender="0" lookType="137" name="Hunter"/>
<list gender="1" lookType="129" name="Hunter"/>
</outfit>

<outfit id="3">
<list gender="0" lookType="138" name="Mage"/>
<list gender="1" lookType="130" name="Mage"/>
</outfit>

<outfit id="4">
<list gender="0" lookType="139" name="Knight"/>
<list gender="1" lookType="131" name="Knight"/>
</outfit>

<outfit id="5" premium="yes">
<list gender="0" lookType="140" name="Noblewoman"/>
<list gender="1" lookType="132" name="Nobleman"/>
</outfit>

<outfit id="6" premium="yes">
<list gender="0" lookType="141" name="Summoner"/>
<list gender="1" lookType="133" name="Summoner"/>
</outfit>

<outfit id="7" premium="yes">
<list gender="0" lookType="142" name="Warrior"/>
<list gender="1" lookType="134" name="Warrior"/>
</outfit>

<outfit id="8" premium="yes">
<list gender="0" lookType="147" name="Barbarian"/>
<list gender="1" lookType="143" name="Barbarian"/>
</outfit>

<outfit id="9" premium="yes">
<list gender="0" lookType="148" name="Druid"/>
<list gender="1" lookType="144" name="Druid"/>
</outfit>

<outfit id="10" premium="yes">
<list gender="0" lookType="149" name="Wizard"/>
<list gender="1" lookType="145" name="Wizard"/>
</outfit>

<outfit id="11" premium="yes">
<list gender="0" lookType="150" name="Oriental"/>
<list gender="1" lookType="146" name="Oriental"/>
</outfit>

<outfit id="12" premium="yes">
<list gender="0" lookType="155" name="Pirate"/>
<list gender="1" lookType="151" name="Pirate"/>
</outfit>

<outfit id="13" premium="yes">
<list gender="0" lookType="156" name="Assassin"/>
<list gender="1" lookType="152" name="Assassin"/>
</outfit>

<outfit id="14" premium="yes">
<list gender="0" lookType="157" name="Beggar"/>
<list gender="1" lookType="153" name="Beggar"/>
</outfit>

<outfit id="15" premium="yes">
<list gender="0" lookType="158" name="Shaman"/>
<list gender="1" lookType="154" name="Shaman"/>
</outfit>

<outfit id="16" premium="yes">
<list gender="0" lookType="252" name="Norsewoman"/>
<list gender="1" lookType="251" name="Norseman"/>
</outfit>

<outfit id="17" premium="yes">
<list gender="0" lookType="269" name="Nightmare"/>
<list gender="1" lookType="268" name="Nightmare"/>
</outfit>

<outfit id="18" premium="yes">
<list gender="0" lookType="270" name="Jester"/>
<list gender="1" lookType="273" name="Jester"/>
</outfit>

<outfit id="19" premium="yes">
<list gender="0" lookType="279" name="Brotherhood"/>
<list gender="1" lookType="278" name="Brotherhood"/>
</outfit>

<outfit id="20" premium="yes">
<list gender="0" lookType="288" name="Demonhunter"/>
<list gender="1" lookType="289" name="Demonhunter"/>
</outfit>

<outfit id="21" premium="yes">
<list gender="0" lookType="324" name="Yalaharian"/>
<list gender="1" lookType="325" name="Yalaharian"/>
</outfit>

<outfit id="22" premium="yes">
<list gender="0" lookType="336" name="Warmaster"/>
<list gender="1" lookType="335" name="Warmaster"/>
</outfit>

<outfit id="23" default="0">
<list gender="0" lookType="329" name="Newly Wed"/>
<list gender="1" lookType="328" name="Newly Wed"/>
</outfit>

<outfit id="24" premium="yes">
<list gender="0" lookType="366" name="Wayfarer"/>
<list gender="1" lookType="367" name="Wayfarer"/>
</outfit>

<outfit id="33" access="3" premium="yes">
<list gender="0-3" lookType="75" name="Gamemaster"/>
</outfit>

<outfit id="34" access="4" premium="yes">
<list gender="0-3" lookType="266" name="Community Manager"/>
</outfit>

<outfit id="35" access="5" premium="yes">
<list gender="0-3" lookType="302" name="God"/>
</outfit>
</outfits>

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 shopModule = ShopModule:new()
npcHandler:addModule(shopModule)
local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
function creatureSayCallback(cid, type, msg)
-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
if (not npcHandler:isFocused(cid)) then
return false
end

if msgcontains(msg, 'vial') then
npcHandler:say('We have a special offer right now for depositing vials. Are you interested in hearing it?', cid)
talk_state = 1
elseif msgcontains(msg, 'yes') and talk_state == 1 then
npcHandler:say('Great! I\'ve signed you up for our bonus for lottery {ticket}. From now on, you will have the chance to win the potion belt addon!', cid)
talk_state = 0
elseif msgcontains(msg, 'ticket') then
npcHandler:say('Would you like to get a lottery ticket instead of the {deposit} for your vials.', cid)
talk_state = 1
elseif msgcontains(msg, 'deposit') and talk_state == 1 then
if getPlayerItemCount(cid, 7636) >= 100 or getPlayerItemCount(cid, 7635) >= 100 or getPlayerItemCount(cid, 7634) >= 100 then
npcHandler:say('Here, take this lottery ticket and let\'s hope you got some luck', cid)
if doPlayerRemoveItem(cid, 7636,100) or doPlayerRemoveItem(cid, 7635,100) or doPlayerRemoveItem(cid, 7634,100) then
doPlayerAddItem(cid, 5957, 1)
talk_state = 0
else
npcHandler:say('Sorry you need 100 empty vials to you from the lottery ticket', cid)
talkState[talkUser] = 0
end
elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 3) then
npcHandler:say('Ok thanks.', cid)
talk_state = 0
end
return TRUE
end
end
-- Storage IDs --

fmage = 22005
smage = 22006

fsummoner = 22011
ssummoner = 22012

newaddon = 'Ah, right! The fluid belt! Here you go.'
noitems = 'You do not have it!.'
noitems2 = 'You do not have all the required items.'
already = 'It seems you already have this addon, don\'t you try to mock me!'


function MageFirst(cid, message, keywords, parameters, node)

if(not npcHandler:isFocused(cid)) then
return false
end

if isPremium(cid) then
addon = getPlayerStorageValue(cid,fmage)
if addon == -1 then
if getPlayerItemCount(cid,5958) >= 1 then
if doPlayerRemoveItem(cid,5958,1) then
npcHandler:say('Ah, right! The mage fluid belt! Here you go.')
doSendMagicEffect(getCreaturePosition(cid), 13)
setPlayerStorageValue(cid,fmage,1)
if getPlayerSex(cid) == 1 then
doPlayerAddOutfit(cid, 133, 1)
elseif getPlayerSex(cid) == 0 then
doPlayerAddOutfit(cid, 138, 1)
end
end
else
selfSay(noitems)
end
else
selfSay(already)
end
end

end

function SummonerFirst(cid, message, keywords, parameters, node)

if(not npcHandler:isFocused(cid)) then
return false
end

if isPremium(cid) then
addon = getPlayerStorageValue(cid,fsummoner)
if addon == -1 then
if getPlayerItemCount(cid,5958) >= 1 then
if doPlayerRemoveItem(cid,5958,1) then
npcHandler:say('Ah, right! The summoner fluid belt! Here you go.')
doSendMagicEffect(getCreaturePosition(cid), 13)
setPlayerStorageValue(cid,fsummoner,1)
if getPlayerSex(cid) == 1 then
doPlayerAddOutfit(cid, 133, 1)
elseif getPlayerSex(cid) == 0 then
doPlayerAddOutfit(cid, 138, 1)
end
end
else
selfSay(noitems)
end
else
selfSay(already)
end
end

end
-------------------------------------------------SHOP---------------------------------------------------------
shopModule:addBuyableItem({'health potion'}, 7618, 45, 1, 'health potion')
shopModule:addBuyableItem({'mana potion'}, 7620, 50, 1, 'mana potion')
shopModule:addBuyableItem({'strong health'}, 7588, 100, 1, 'strong health potion')
shopModule:addBuyableItem({'vial of oil'}, 2006, 15, 11, 'vial of oil')
shopModule:addBuyableItem({'vial of oil'}, 2006, 15, 2, 'vial of blood')
shopModule:addBuyableItem({'vial of water'}, 2006, 15, 9, 'vial of water')
shopModule:addBuyableItem({'vial of water'}, 2006, 15, 13, 'vial of urine')
shopModule:addBuyableItem({'strong mana'}, 7589, 80, 1, 'strong mana potion')
shopModule:addBuyableItem({'great health'}, 7591, 190, 1, 'great health potion')
shopModule:addBuyableItem({'great mana'}, 7590, 120, 1, 'great mana potion')
shopModule:addBuyableItem({'great spirit'}, 8472, 190, 1, 'great spirit potion')
shopModule:addBuyableItem({'ultimate health'}, 8473, 310, 1, 'ultimate health potion')

shopModule:addSellableItem({'normal potion flask', 'normal flask'}, 7636, 5, 'empty small potion flask')
shopModule:addSellableItem({'strong potion flask', 'strong flask'}, 7634, 10, 'empty strong potion flask')
shopModule:addSellableItem({'great potion flask', 'great flask'}, 7635, 15, 'empty great potion flask')


shopModule:addBuyableItemContainer({'bp hp'}, 2000, 7618, 900, 1, 'backpack of health potions')
shopModule:addBuyableItemContainer({'bp mp'}, 2001, 7620, 1000, 1, 'backpack of mana potions')
shopModule:addBuyableItemContainer({'bp shp'}, 2000, 7588, 2000, 1, 'backpack of strong health potions')
shopModule:addBuyableItemContainer({'bp smp'}, 2001, 7589, 1600, 1, 'backpack of strong mana potions')
shopModule:addBuyableItemContainer({'bp ghp'}, 2000, 7591, 3800, 1, 'backpack of great health potions')
shopModule:addBuyableItemContainer({'bp gmp'}, 2001, 7590, 2400, 1, 'backpack of great mana potions')
shopModule:addBuyableItemContainer({'bp gsp'}, 1999, 8472, 3820, 1, 'backpack of great spirit potions')
shopModule:addBuyableItemContainer({'bp uhp'}, 2000, 8473, 6200, 1, 'backpack of ultimate health potions')

--------



node1 = keywordHandler:addKeyword({'mage fluid belt'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To get mage fluid belt you need give me the winning lottery ticket. Do you have it with you?'})
node1:addChildKeyword({'yes'}, MageFirst, {})
node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

node4 = keywordHandler:addKeyword({'prize'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To get mage fluid belt you need give me the winning lottery ticket. Do you have it with you?'})
node4:addChildKeyword({'yes'}, MageFirst, {})
node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

node2 = keywordHandler:addKeyword({'summoner fluid belt'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To get summoner fluid belt you need give me the winning lottery ticket. Do you have it with you?'})
node2:addChildKeyword({'yes'}, SummonerFirst, {})
node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})

node3 = keywordHandler:addKeyword({'summoner'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'To get summoner fluid belt you need give me the winning lottery ticket. Do you have it with you?'})
node3:addChildKeyword({'yes'}, SummonerFirst, {})
node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got all neccessary items.', reset = true})


npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
tyy
 
Back
Top