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

Manabelt addon

Kuzzie

New Member
Joined
Feb 10, 2009
Messages
2
Reaction score
0
Hello i know in rl you have to have lucky to win winning lotery ticket and you need to give snadra 100 flaks of vial but how does it goes on this ot? how get a ticket?
 
Take my Npc. It gives a Scroll for all kind of vials..

lottery.lua
Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

-- OTServ event handling functions start
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
-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)


     if msgcontains(msg, 'lottery ticket') or msgcontains(msg, 'vial') or msgcontains(msg, 'ticket') or msgcontains(msg, 'lottery') then
              if getPlayerItemCount(cid,7636) >= 100 then
                    if doPlayerRemoveItem(cid,7636,100) == 1 then
                              selfSay('Here you are. Good luck!')
                              doPlayerAddItem(cid,5957,1)
                    end

              elseif getPlayerItemCount(cid,7634) >= 100 then
                    if doPlayerRemoveItem(cid,7634,100) == 1 then
                              selfSay('Here you are. Good luck!')
                              doPlayerAddItem(cid,5957,1)
                    end

              elseif getPlayerItemCount(cid,7635) >= 100 then
                    if doPlayerRemoveItem(cid,7635,100) == 1 then
                              selfSay('Here you are. Good luck!')
                              doPlayerAddItem(cid,5957,1)
                    end

              elseif getPlayerItemCount(cid,2006) >= 100 then
                    if doPlayerRemoveItem(cid,2006,100) == 1 then
                              selfSay('Here you are. Good luck!')
                              doPlayerAddItem(cid,5957,1)
                    end
              else
                    selfSay('I need 100 empty vials to give you a lottery ticket.')
                    talk_state = 0
              end
     elseif msgcontains(msg, 'no') then
              selfSay('Maybe later.')
              talk_state = 0
     end

return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Lotto Man.xml
Code:
<npc name="Lotto Man" script="data/npc/scripts/lottery.lua" walkinterval="2000" floorchange="0" access="5">
	<health now="150" max="150"/>
	<look type="143" head="3" body="25" legs="44" feet="119" addons="3"  corpse="2212"/>
	<parameters>
<parameter key="message_greet" value="Hello |PLAYERNAME|. I can give you a lottery ticket for 100 vials." />
	</parameters>
</npc>

You maybe have to edit the ID of the scroll you should get. Maybe you have a different one..

Your's ballack13
 
Back
Top