function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
return FALSE
end
if msgcontains(msg, 'runes') then
selfSay("I sell heavy magic missiles runes, explosion runes, great fireball runes, ultimate healing runes, sudden death runes, mana runes and blank runes.")
talk_state = 0
elseif msgcontains(msg, 'heavy magic missile') or msgcontains(msg, 'hmm') and ShopModule:getCount(msg) <= 100 then
charges = ShopModule:getCount(msg)
price = 10*charges
selfSay('Do you want a heavy magic missile rune with '..charges..' charges for '..price..' gold coins?')
talk_state = 1
itemid = 2311
elseif msgcontains(msg, 'yes') and talk_state == 1 then
if doPlayerRemoveMoney(cid, price) == TRUE then
doPlayerGiveItem(cid, itemid, 1, charges)
selfSay("You have bought this rune.")
talk_state = 0
else
selfSay("You don't have enough money.")
talk_state = 0
end
elseif msgcontains(msg, 'no') and talk_state == 1 then
selfSay("Then not.")
talk_state = 0
end
return TRUE
end