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

Help Npc Budrik!!!

valivan601

New Member
Joined
Apr 13, 2011
Messages
365
Reaction score
1
in my server when a players kill the 5000 minos the npc budrik dont add a storage to enter in teleport also when u say task for him he dont say anything can anyone fix this script for me?

i think the storages are changed cause in sql the 5000 minos are in storage 14104, but the 14104 is the actionid of the teleport for boss

Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local Topic = {}
local questLog = 14504

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

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

function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	elseif msgcontains(msg, 'task') then
		if getPlayerStorageValue(cid, 14004) < 0 then
			selfSay({"I am so angry I could spit grit! That damn Horned Fox and his attacks! Let's show those bull-heads that they have messed with the wrong people. ...", "I want you to kill 5000 minotaurs - no matter where - for me and all the dwarfs of Kazordoon! Are you willing to do that?"}, cid)
			Topic[cid] = 1
		elseif getPlayerStorageValue(cid, 14004) == 5000 and getPlayerStorageValue(cid, 14104) < 1 then
			selfSay("By all that is holy! You are a truly great warrior! With much patience! I have just found out the location the hideout of The Horned Fox! I have marked the spot on your map so you can find it. Go there and slay him!! Good luck!", cid)
			setPlayerStorageValue(cid, 14104, 1)
		end
	elseif Topic[cid] == 1 and msgcontains(msg, 'yes') then
		selfSay("Hussah! Let's bring war to those hoof-legged, dirt-necked, bull-headed minotaurs!! Come back to me when you are done with your mission.", cid)
		setPlayerStorageValue(cid, 14004, 0)
		if getPlayerStorageValue(cid, questLog) < 1 then
			setPlayerStorageValue(cid, questLog, 1)
		end
		Topic[cid] = 0
	end
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:setMessage(MESSAGE_GREET, 'Hiho, hiho |PLAYERNAME|.')
npcHandler:setMessage(MESSAGE_FAREWELL, 'Bye bye.')
npcHandler:setMessage(MESSAGE_WALKAWAY, 'Bye bye.')
npcHandler:setCallback(CALLBACK_GREET, greetCallback)
npcHandler:addModule(FocusModule:new())
 
Last edited:
its a mod i thats something wrong here lol

Code:
<?xml version="1.0" encoding="UTF-8"?>
<mod name="killed-monsters-counter" version="1.0" author="slawkens" contact="[email protected]" enabled="yes">
	<!--
		TODO:
			- automatically assign storages in TFS 0.4 that supports string as a key
			- configurable message interval that will prevent spam in the console (i.e. inform player each X kills)
			- rewards for killing monsters
	-->

	<event type="kill" name="killed-monsters-counter-event" event="script"><![CDATA[
		local monsters = {
			--name = storage
			["necromancer"] = 14004,
			["priestess"] = 14004,
			["pirate buccaneer"] = 14005,
			["pirate cutthroat"] = 14005,
			["pirate marauder"] = 14005,
			["pirate corsair"] = 14005,
			["pirate skeleton"] = 14005,
			["pirate ghost"] = 14005,
			["minotaur"] = 14104,
			["minotaur archer"] = 14104,
			["minotaur guard"] = 14104,
			["demon"] = 14006,
			["crocodile"] = 14007,
			["tarantula"] = 14008,
			["carniphila"] = 14009,
			["stone golem"] = 14010,
			["mammoth"] = 14011,
			["ice golem"] = 14112,
			["quara constrictor scout"] = 14113,
			["quara constrictor"] = 14114,
			["water elemental"] = 14015,
			["earth elemental"] = 14016,
			["energy elemental"] = 14017,
			["fire elemental"] = 14018,
			["mutated rat"] = 14019,
			["giant spider"] = 14020,
			["hydra"] = 14021,
			["sea serpent"] = 14001,
			["behemoth"] = 14022,
			["serpent spawn"] = 14002,
		}

		function onKill(cid, target)
			if(isPlayer(target) ~= TRUE) then
				local master = getCreatureMaster(target)
				if(master and master ~= target) then return TRUE end

				local name = getCreatureName(target)
				local monster = monsters[string.lower(name)]
				if(monster) then
					local killedMonsters = getPlayerStorageValue(cid, monster)
					if(killedMonsters == -1) then
						killedMonsters = 1
					end
					doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed " .. killedMonsters .. " " .. name .. "'s.")
					setPlayerStorageValue(cid, monster, killedMonsters + 1)
				end
			end

			return TRUE
		end
	]]></event>

	<event type="login" name="killed-monsters-counter-login" event="buffer"><![CDATA[
		registerCreatureEvent(cid, "killed-monsters-counter-event")
		_result = true
	]]></event>
</mod>
 
Back
Top