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

Bugging Crystal Coins

Glidarn

Member
Joined
May 9, 2009
Messages
970
Reaction score
16
Location
Åkersberga, Sweden
So i found a very bad bug on my rl map, i guess you its possible to do this on all rl maps lemme show you the pic moneybug.jpg When you say yes in that conversation you get debug and the server usually crash but when you log in again you have like over 9kkkkk cash, so my best guess it do remove that line on all the npcs or something so you can't bug it.


Try it on your server :p
 
I dont have it because I remove that bug :p

so did i know, but kinda scary

anyway
Lua:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local Topic, count, transferTo_name = {}, {}, {}

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 function getCount(string)
	local b, e = string:find('%d+')
	return b and e and tonumber(string:sub(b, e)) or -1
end

local function playerExists(name)
	local v, ret = db.getResult("SELECT `name` FROM `players` WHERE `name` = " .. db.escapeString(name) .. ";"), nil
	if v:getID() ~= -1 then
		ret = v:getDataString('name')
	end
	v:free()
	return ret
end

function greetCallback(cid)
	Topic[cid], count[cid], transferTo_name[cid] = 0, 0,0
	return true
end

function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	elseif msgcontains(msg, 'balance') then
		npcHandler:say('Your account balance is ' .. getPlayerBalance(cid) .. ' gold.', cid)
		Topic[cid] = 0
	elseif msgcontains(msg, 'deposit') and msgcontains(msg, 'all') then
		if getPlayerMoney(cid) > 0 then
			count[cid] = getPlayerMoney(cid)
			npcHandler:say('Would you really like to deposit ' .. count[cid] .. ' gold?', cid)
			Topic[cid] = 2
		else
			npcHandler:say('Please tell me how much gold it is you would like to deposit.', cid)
			Topic[cid] = 1
		end
	elseif msgcontains(msg, 'deposit') then
		if getCount(msg) == 0 then
			npcHandler:say('You are joking, aren\'t you??', cid)
			Topic[cid] = 0
		elseif getCount(msg) ~= -1 then
			if getPlayerMoney(cid) >= getCount(msg) then
				count[cid] = getCount(msg)
				npcHandler:say('Would you really like to deposit ' .. count[cid] .. ' gold?', cid)
				Topic[cid] = 2
			else
				npcHandler:say('You do not have enough gold.', cid)
				Topic[cid] = 0
			end
		else
			npcHandler:say('Please tell me how much gold it is you would like to deposit.', cid)
			Topic[cid] = 1
		end
	elseif Topic[cid] == 1 then
		if getCount(msg) == -1 then
			npcHandler:say('Please tell me how much gold it is you would like to deposit.', cid)
			Topic[cid] = 1
		else
			if getPlayerMoney(cid) >= getCount(msg) then
				count[cid] = getCount(msg)
				npcHandler:say('Would you really like to deposit ' .. count[cid] .. ' gold?', cid)
				Topic[cid] = 2
			else
				npcHandler:say('You do not have enough gold.', cid)
				Topic[cid] = 0
			end
		end
	elseif msgcontains(msg, 'yes') and Topic[cid] == 2 then
		if doPlayerRemoveMoney(cid, count[cid]) then
			doPlayerSetBalance(cid, getPlayerBalance(cid) + count[cid])
			npcHandler:say('Alright, we have added the amount of ' .. count[cid] .. ' gold to your balance. You can withdraw your money anytime you want to.', cid)
		else
			npcHandler:say('I am inconsolable, but it seems you have lost your gold. I hope you get it back.', cid)
		end
		Topic[cid] = 0
	elseif msgcontains(msg, 'no') and Topic[cid] == 2 then
		npcHandler:say('As you wish. Is there something else I can do for you?', cid)
		Topic[cid] = 0
	elseif msgcontains(msg, 'withdraw') then
		if getCount(msg) == 0 then
			npcHandler:say('Sure, you want nothing you get nothing!', cid)
			Topic[cid] = 0
		elseif getCount(msg) ~= -1 then
			if getPlayerBalance(cid) >= getCount(msg) then
				count[cid] = getCount(msg)
				npcHandler:say('Are you sure you wish to withdraw ' .. count[cid] .. ' gold from your bank account?', cid)
				Topic[cid] = 4
			else
				npcHandler:say('There is not enough gold on your account.', cid)
				Topic[cid] = 0
			end
		else
			npcHandler:say('Please tell me how much gold you would like to withdraw.', cid)
			Topic[cid] = 3
		end
	elseif Topic[cid] == 3 then
		if getCount(msg) == -1 then
			npcHandler:say('Please tell me how much gold you would like to withdraw.', cid)
			Topic[cid] = 3
		else
			if getPlayerBalance(cid) >= getCount(msg) then
				count[cid] = getCount(msg)
				npcHandler:say('Are you sure you wish to withdraw ' .. count[cid] .. ' gold from your bank account?', cid)
				Topic[cid] = 4
			else
				npcHandler:say('There is not enough gold on your account.', cid)
				Topic[cid] = 0
			end
		end
	elseif msgcontains(msg, 'yes') and Topic[cid] == 4 then
		if getPlayerBalance(cid) >= count[cid] then
			doPlayerAddMoney(cid, count[cid])
			doPlayerSetBalance(cid, getPlayerBalance(cid) - count[cid])
			npcHandler:say('Here you are, ' .. count[cid] .. ' gold. Please let me know if there is something else I can do for you.', cid)
		else
			npcHandler:say('There is not enough gold on your account.', cid)
		end
		Topic[cid] = 0
	elseif msgcontains(msg, 'no') and Topic[cid] == 4 then
		npcHandler:say('The customer is king! Come back anytime you want to if you wish to withdraw your money.', cid)
		Topic[cid] = 0
	elseif msgcontains(msg, 'transfer') then
		if getCount(msg) == 0 then
			npcHandler:say('Please think about it. Okay?', cid)
			Topic[cid] = 0
		elseif getCount(msg) ~= -1 then
			count[cid] = getCount(msg)
			if getPlayerBalance(cid) >= count[cid] then
				npcHandler:say('Who would you like to transfer ' .. count[cid] .. ' gold to?', cid)
				Topic[cid] = 6
			else
				npcHandler:say('There is not enough gold on your account.', cid)
				Topic[cid] = 0
			end
		else
			npcHandler:say('Please tell me the amount of gold you would like to transfer.', cid)
			Topic[cid] = 5
		end
	elseif Topic[cid] == 5 then
		if getCount(msg) == -1 then
			npcHandler:say('Please tell me the amount of gold you would like to transfer.', cid)
			Topic[cid] = 5
		else
			count[cid] = getCount(msg)
			if getPlayerBalance(cid) >= count[cid] then
				npcHandler:say('Who would you like to transfer ' .. count[cid] .. ' gold to?', cid)
				Topic[cid] = 6
			else
				npcHandler:say('There is not enough gold on your account.', cid)
				Topic[cid] = 0
			end
		end
	elseif Topic[cid] == 6 then
		local v = getPlayerByName(msg)
		if getPlayerBalance(cid) >= count[cid] then
			if v then
				transferTo_name[cid] = msg
				npcHandler:say('Would you really like to transfer ' .. count[cid] .. ' gold to ' .. getPlayerName(v) .. '?', cid)
				Topic[cid] = 7
			elseif playerExists(msg):lower() == msg:lower() then
				transferTo_name[cid] = msg
				npcHandler:say('Would you really like to transfer ' .. count[cid] .. ' gold to ' .. playerExists(msg) .. '?', cid)
				Topic[cid] = 7
			else
				npcHandler:say('This player does not exist.', cid)
				Topic[cid] = 0
			end
		else
			npcHandler:say('There is not enough gold on your account.', cid)
			Topic[cid] = 0
		end
	elseif Topic[cid] == 7 and msgcontains(msg, 'yes') then
		if getPlayerBalance(cid) >= count[cid] then
			local v = getPlayerByName(transferTo_name[cid])
			if v then
				doPlayerSetBalance(cid, getPlayerBalance(cid) - count[cid])
				doPlayerSetBalance(v, getPlayerBalance(v) + count[cid])
				npcHandler:say('Very well. You have transferred ' .. count[cid] .. ' gold to ' .. getPlayerName(v) .. '.', cid)
			elseif playerExists(transferTo_name[cid]):lower() == transferTo_name[cid]:lower() then
				doPlayerSetBalance(cid, getPlayerBalance(cid) - count[cid])
				db.executeQuery('UPDATE `players` SET `balance` = `balance` + ' .. count[cid] .. ' WHERE `name` = ' .. db.escapeString(transferTo_name[cid]) .. ' LIMIT 1;')
				npcHandler:say('Very well. You have transferred ' .. count[cid] .. ' gold to ' .. playerExists(transferTo_name[cid]) .. '.', cid)
			else
				npcHandler:say('This player does not exist.', cid)
			end
		else
			npcHandler:say('There is not enough gold on your account.', cid)
		end
	end
	return TRUE
end

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


you won't have taht bug with the script posted above
 
Bug on rlmap often the bank npc and hat of mad quest an strong pot i think you can use unlimited. Look if your rl map had this bug also :p
 
the bug is when the chest with strong mana potion dont has a unique id the players are able to carry the quest chest and use unlimited potion just add a random unique id to chest
 
the bug is when the chest with strong mana potion dont has a unique id the players are able to carry the quest chest and use unlimited potion just add a random unique id to chest

The bug is that the item count on the strong manas is 0. Change them both to item's count to 1 in your map editor.
 
I know this is an old post but doesn't anyone now what the dialogue with the NPC was?

The picture is too small I can't read it :(

EDIT:
Never mind I got it, thanks for sharing this even 2 years later it helped someone (me). :oops:
 
Last edited:
Back
Top