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

Henricus, Blessings.

Lucenzo

The Way You Move :)
Joined
Jan 29, 2011
Messages
363
Reaction score
14
Location
UK
Heya :)


Would anyone be so kind to add into the following script this.

Storage need: none

Blessing of the Inquisition - TibiaWiki - Quests, Items, Spells, and more

LUA:
The Blessing of the Inquisition allows you to buy all five Blessings at once.

It will cost you mathgp (11,000gp) for characters below level 30. After level 30 it will cost mathgp. After level 120 it will cost 110,000gp.

You cannot get this blessing unless you have completed The Inquisition Quest.


player: blessing
Henricus: Do you want to receive the blessing of the inquisition - which means all five available blessings - for [CostHere] (depends on players level) gold?

Into this Script below:

LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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 creatureSayCallback(cid, type, msg)
        if(not npcHandler:isFocused(cid)) then
                return false
        end
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	local storage = getPlayerStorageValue(cid, 1889)
	local storagee = getPlayerStorageValue(cid, 1996)
	
	if(msgcontains(msg, 'join') or msgcontains(msg, 'inquisition'))then
		if storage == -1 then
			npcHandler:say("Do you want to join the inquisition?", cid)
			talkState[talkUser] = 1
		else
			npcHandler:say("You are already a member of the inquisition.", cid)
			talkState[talkUser] = 0
		end
		
	elseif msgcontains(msg, 'mission') then
		if storage == 1 then
			npcHandler:say("Let's see if you are worthy. Take an inquisitor's field guide from the box in the back room. ...", cid)
			npcHandler:say("Follow the instructions in the guide to talk to the Thaian guards that protect the walls and gates of the city and test their loyalty. Then report to me about your mission.", cid)
			setPlayerStorageValue(cid, 1889, 2)
			talkState[talkUser] = 0
		elseif storage == 18 then
			npcHandler:say("Your current mission is to investigate the reliability of certain guards. Are you done with that mission?", cid)
			talkState[talkUser] = 3		
			elseif storage == 19 then
			if getPlayerStorageValue(cid, 1996) == -1 then
			npcHandler:say("Now you need to complete The Shadow Nexus and come back to me.", cid)
			npcHandler:say("Use this vial of holy water to destroy the Shadow Nexus.", cid)
			local item2 = doPlayerAddItem(cid, 7494, 1)
			setPlayerStorageValue(cid, 1996, 1)
			talkState[talkUser] = 0
		elseif getPlayerStorageValue(cid, 1883) == 1 then
			npcHandler:say("Your current mission is to destroy the Shadow Nexus. Are you done with that mission?", cid)
			talkState[talkUser] = 4
	end
		end

	elseif msgcontains(msg, 'yes') then		
		if talkState[talkUser] == 1 then
				if storage == -1 then
					npcHandler:say("So be it. Now you are a member of the inquisition. You might ask me for a mission to raise in my esteem.", cid)
					setPlayerStorageValue(cid, 1889, 1)
					--talkState[talkUser] = 0
				end
		elseif talkState[talkUser] == 2 then
				if storage == 1 then
					npcHandler:say("Indeed, this is exactly what my other sources told me. Of course I knew the outcome of this investigation in advance. This was just a test...", cid)
					npcHandler:say("Well, now that you've proven yourself as useful, you can ask me for another mission.", cid)
					setPlayerStorageValue(cid, 1889, 2)
					talkState[talkUser] = 0
				end
		elseif talkState[talkUser] == 3 then
				if storage == 18 then
					npcHandler:say("Indeed, this is exactly what my other sources told me. Of course I knew the outcome of this investigation in advance. This was just a test...", cid)
					npcHandler:say("Well, now that you've proven yourself as useful, you can ask me for another mission.", cid)
					setPlayerStorageValue(cid, 1889, 19)
					talkState[talkUser] = 0
				end
		elseif talkState[talkUser] == 4 then
				if getPlayerStorageValue(cid, 1883) == 1 then

					npcHandler:say("Fine, fine. You have proven that you can work efficiently. Now you can enter the reward room and choose your reward and Enjoy your new fresh outfit!", cid)
					setPlayerStorageValue(cid, 14916, 1)
					talkState[talkUser] = 0
				end
				
			
		
			
		end
	end
	return TRUE
end




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

Thanks in Advance. x x
 
Try:
LUA:
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
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 creatureSayCallback(cid, type, msg)
        if(not npcHandler:isFocused(cid)) then
                return false
        end
	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
	local storage = getPlayerStorageValue(cid, 1889)
	local storagee = getPlayerStorageValue(cid, 1996)
	
if msgcontains(msg, 'blessing') then
   npcHandler:say("Do you want to receive the blessing of the inquisition - which means all five available blessings - for " .. getPlayerLevel(cid) < 30 and 2000*5*1.1 or getPlayerLevel(cid) >= 30 and getPlayerLevel(cid) < 120 and 1*(200*(getPlayerLevel(cid)-30)+2000)*5*1.1 or getPlayerLevel(cid) >= 120 and 110000 .. " gold? ", cid)
   talkState[talkUser] = 5
end
if talkState[talkUser] == 5 then
   if msgcontains(msg, 'yes') then
      if getPlayerStorageValue(cid, 14916) > 0 then
         if doPlayerRemoveMoney(cid, getPlayerLevel(cid) < 30 and 2000*5*1.1 or getPlayerLevel(cid) >= 30 and getPlayerLevel(cid) < 120 and 1*(200*(getPlayerLevel(cid)-30)+2000)*5*1.1 or getPlayerLevel(cid) >= 120 and 110000) then
            npcHandler:say('Thanks for buying the blessings?', cid)
            for i = 1, 5 do
                doPlayerAddBlessing(cid, i)
            end
         else
             npcHandler:say('You do not have enough money', cid)
             talkState[talkUser] = 0
         end
      else
          npcHandler:say('You cannot buy blessings from me', cid)
          talkState[talkUser] = 0
      end
   end
end
 
	if(msgcontains(msg, 'join') or msgcontains(msg, 'inquisition')) then
		if storage == -1 then
			npcHandler:say("Do you want to join the inquisition?", cid)
			talkState[talkUser] = 1
		else
			npcHandler:say("You are already a member of the inquisition.", cid)
			talkState[talkUser] = 0
		end
 
	elseif msgcontains(msg, 'mission') then
		if storage == 1 then
			npcHandler:say("Let's see if you are worthy. Take an inquisitor's field guide from the box in the back room. ...", cid)
			npcHandler:say("Follow the instructions in the guide to talk to the Thaian guards that protect the walls and gates of the city and test their loyalty. Then report to me about your mission.", cid)
			setPlayerStorageValue(cid, 1889, 2)
			talkState[talkUser] = 0
		elseif storage == 18 then
			npcHandler:say("Your current mission is to investigate the reliability of certain guards. Are you done with that mission?", cid)
			talkState[talkUser] = 3		
			elseif storage == 19 then
			if getPlayerStorageValue(cid, 1996) == -1 then
			npcHandler:say("Now you need to complete The Shadow Nexus and come back to me.", cid)
			npcHandler:say("Use this vial of holy water to destroy the Shadow Nexus.", cid)
			local item2 = doPlayerAddItem(cid, 7494, 1)
			setPlayerStorageValue(cid, 1996, 1)
			talkState[talkUser] = 0
		elseif getPlayerStorageValue(cid, 1883) == 1 then
			npcHandler:say("Your current mission is to destroy the Shadow Nexus. Are you done with that mission?", cid)
			talkState[talkUser] = 4
	end
		end
 
	elseif msgcontains(msg, 'yes') then		
		if talkState[talkUser] == 1 then
				if storage == -1 then
					npcHandler:say("So be it. Now you are a member of the inquisition. You might ask me for a mission to raise in my esteem.", cid)
					setPlayerStorageValue(cid, 1889, 1)
					--talkState[talkUser] = 0
				end
		elseif talkState[talkUser] == 2 then
				if storage == 1 then
					npcHandler:say("Indeed, this is exactly what my other sources told me. Of course I knew the outcome of this investigation in advance. This was just a test...", cid)
					npcHandler:say("Well, now that you've proven yourself as useful, you can ask me for another mission.", cid)
					setPlayerStorageValue(cid, 1889, 2)
					talkState[talkUser] = 0
				end
		elseif talkState[talkUser] == 3 then
				if storage == 18 then
					npcHandler:say("Indeed, this is exactly what my other sources told me. Of course I knew the outcome of this investigation in advance. This was just a test...", cid)
					npcHandler:say("Well, now that you've proven yourself as useful, you can ask me for another mission.", cid)
					setPlayerStorageValue(cid, 1889, 19)
					talkState[talkUser] = 0
				end
		elseif talkState[talkUser] == 4 then
				if getPlayerStorageValue(cid, 1883) == 1 then
 
					npcHandler:say("Fine, fine. You have proven that you can work efficiently. Now you can enter the reward room and choose your reward and Enjoy your new fresh outfit!", cid)
					setPlayerStorageValue(cid, 14916, 1)
					talkState[talkUser] = 0
				end
 
 
 
 
		end
	end
	return TRUE
end
 
 
 
 
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
 
LUA:
[20:38:50.404] [Error - NpcScript Interface]
[20:38:50.404] (Unknown script file)
[20:38:50.404] Description:
[20:38:50.404] attempt to call a nil value
[20:38:50.404] stack traceback:

[20:38:50.896] [Error - NpcScript Interface]
[20:38:50.896] (Unknown script file)
[20:38:50.896] Description:
[20:38:50.896] attempt to call a nil value
[20:38:50.896] stack traceback:

Spams my game console.? x
 
Full:
LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local t = {}

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 creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end

	local storage = getCreatureStorage(cid, 1889)

	if msgcontains(msg, 'join') or msgcontains(msg, 'inquisition') then
		if storage == -1 then
			npcHandler:say("Do you want to join the inquisition?", cid)
			t[cid] = 1
		else
			npcHandler:say("You are already a member of the inquisition.", cid)
			t[cid] = 0
		end
	elseif msgcontains(msg, 'mission') then
		if storage == 1 then
			npcHandler:say("Let's see if you are worthy. Take an inquisitor's field guide from the box in the back room. ...", cid)
			npcHandler:say("Follow the instructions in the guide to talk to the Thaian guards that protect the walls and gates of the city and test their loyalty. Then report to me about your mission.", cid)
			doCreatureSetStorage(cid, 1889, 2)
			t[cid] = 0
		elseif storage == 18 then
			npcHandler:say("Your current mission is to investigate the reliability of certain guards. Are you done with that mission?", cid)
			t[cid] = 3		
		elseif storage == 19 and getCreatureStorage(cid, 1996) == -1 then
			npcHandler:say("Now you need to complete The Shadow Nexus and come back to me.", cid)
			npcHandler:say("Use this vial of holy water to destroy the Shadow Nexus.", cid)
			doPlayerAddItem(cid, 7494, 1)
			doCreatureSetStorage(cid, 1996, 1)
			t[cid] = 0
		elseif getCreatureStorage(cid, 1883) == 1 then
			npcHandler:say("Your current mission is to destroy the Shadow Nexus. Are you done with that mission?", cid)
			t[cid] = 4
		end
	elseif msgcontains(msg, 'blessing') then
		local v = getPlayerLevel(cid)
		if v < 31 then
			v = 11000
		elseif v > 119 then
			v = 110000
		else
			v = (200 * (v - 30) + 2000) * 5 * 1.1
		end
		npcHandler:say('Do you want to receive the blessing of the inquisition - which means all five available blessings - for ' .. v .. ' gold?', cid)
		t[cid] = 5
	elseif msgcontains(msg, 'yes') then		
		if t[cid] == 1 and storage == -1 then
			npcHandler:say("So be it. Now you are a member of the inquisition. You might ask me for a mission to raise in my esteem.", cid)
			doCreatureSetStorage(cid, 1889, 1)
		elseif t[cid] == 2 and storage == 1 then
			npcHandler:say("Indeed, this is exactly what my other sources told me. Of course I knew the outcome of this investigation in advance. This was just a test...", cid)
			npcHandler:say("Well, now that you've proven yourself as useful, you can ask me for another mission.", cid)
			doCreatureSetStorage(cid, 1889, 2)
		elseif t[cid] == 3 and storage == 18 then
			npcHandler:say("Indeed, this is exactly what my other sources told me. Of course I knew the outcome of this investigation in advance. This was just a test...", cid)
			npcHandler:say("Well, now that you've proven yourself as useful, you can ask me for another mission.", cid)
			doCreatureSetStorage(cid, 1889, 19)
		elseif t[cid] == 4 and getCreatureStorage(cid, 1883) == 1 then
			npcHandler:say("Fine, fine. You have proven that you can work efficiently. Now you can enter the reward room and choose your reward and enjoy your new fresh outfit!", cid)
			doCreatureSetStorage(cid, 14916, 1)
		elseif t[cid] == 5 then
			if not(getPlayerBlessing(cid, 1) and getPlayerBlessing(cid, 2) and getPlayerBlessing(cid, 3) and getPlayerBlessing(cid, 4) and getPlayerBlessing(cid, 5)) then
				local v = getPlayerLevel(cid)
				if v < 31 then
					v = 11000
				elseif v > 119 then
					v = 110000
				else
					v = (200 * (v - 30) + 2000) * 5 * 1.1
				end
				if doPlayerRemoveMoney(cid, v) then
					npcHandler:say('So be it!', cid)
					for i = 1, 5 do
						doPlayerAddBlessing(cid, i)
					end
					doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				else
					npcHandler:say('You don\'t have enough money.', cid)
				end
			else
				npcHandler:say('You already have all blessings.', cid)
			end
		else
			return true
		end
		t[cid] = 0
	end
	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Blessings only:
LUA:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local t = {}

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 creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	elseif msgcontains(msg, 'blessing') then
		local v = getPlayerLevel(cid)
		if v < 31 then
			v = 11000
		elseif v > 119 then
			v = 110000
		else
			v = (200 * (v - 30) + 2000) * 5 * 1.1
		end
		npcHandler:say('Do you want to receive the blessing of the inquisition - which means all five available blessings - for ' .. v .. ' gold?', cid)
		t[cid] = 1
	elseif t[cid] == 1 and msgcontains(msg, 'yes') then
		if not(getPlayerBlessing(cid, 1) and getPlayerBlessing(cid, 2) and getPlayerBlessing(cid, 3) and getPlayerBlessing(cid, 4) and getPlayerBlessing(cid, 5)) then
			local v = getPlayerLevel(cid)
			if v < 31 then
				v = 11000
			elseif v > 119 then
				v = 110000
			else
				v = (200 * (v - 30) + 2000) * 5 * 1.1
			end
			if doPlayerRemoveMoney(cid, v) then
				npcHandler:say('So be it!', cid)
				for i = 1, 5 do
					doPlayerAddBlessing(cid, i)
				end
				doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
			else
				npcHandler:say('You don\'t have enough money.', cid)
			end
		else
			npcHandler:say('You already have all blessings.', cid)
		end
		t[cid] = 0
	end
	return true
end

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