• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

One Bless that gives full bless + No Item loss + condition "blue shield".

Demnish

Tibian Hero
Joined
Sep 28, 2011
Messages
401
Solutions
2
Reaction score
63
Location
Sweden
Im using the distro Cryingdamson 0.3.6 8.60 V5

I'm looking for a NPC script with the following functions;

It will give the player full blessing (I want to be able to modify that)
Also No Item Loss, like AOL does.
And last, the condition "Blue Shield" from Guild Waring, and when you die, everything resets, included the blue shield condition.

Is this possible in a NPC script? Any other type of script is also welcome, but I want a NPC that sells this.
Rep++ for help.


Yours, Demnish.
 
LUA:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Oliver" floorchange="0" walkinterval="0">
	<health now="150" max="150"/>
	<look type="128" head="77" body="65" legs="59" feet="116" addons="1"/>
 
  <interaction range="3" idletime="30">
 
    <interact keywords="hi" focus="1">
      <!--These are the keywords will trigger this interaction-->
      <keywords>hello</keywords>
      <keywords>greet</keywords>
	  <keywords>hei</keywords>
 
      <response>
        <action name="script">
		selfSay("Hello there, I sell blessings. Just type {first blessing} to buy first blessing, second, third and so on...", cid)
        </action>
      </response>
  </interact>
 
   <interact keywords="first">
	<response>
		<action name="script">
		if getPlayerBlessing(cid, 1) then
			selfSay('You already have this blessing.', cid)
		else
			if doPlayerRemoveMoney(cid, 10000) == true then
				doPlayerAddBlessing(cid, 1)		
				selfSay('You got the first blessing!', cid)
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
			else
				selfSay('You need 10k for this blessing!', cid)
			end
		end
        </action>
	</response>
   </interact>
 
   <interact keywords="second">
	<response>
		<action name="script">
		if getPlayerBlessing(cid, 2) then
			selfSay('You already have this blessing.', cid)
		else
			if doPlayerRemoveMoney(cid, 10000) == true then
				doPlayerAddBlessing(cid, 2)		
				selfSay('You got the second blessing!', cid)
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
			else
				selfSay('You need 10k for this blessing!', cid)
			end
		end
        </action>
	</response>
   </interact>
 
   <interact keywords="third">
	<response>
		<action name="script">
		if getPlayerBlessing(cid, 3) then
			selfSay('You already have this blessing.', cid)
		else
			if doPlayerRemoveMoney(cid, 10000) == true then
				doPlayerAddBlessing(cid, 3)		
				selfSay('You got the third blessing!', cid)
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
			else
				selfSay('You need 10k for this blessing!', cid)
			end
		end
        </action>
	</response>
   </interact>
 
   <interact keywords="fourth">
	<response>
		<action name="script">
		if getPlayerBlessing(cid, 4) then
			selfSay('You already have this blessing.', cid)
		else
			if doPlayerRemoveMoney(cid, 10000) == true then
				doPlayerAddBlessing(cid, 4)		
				selfSay('You got the fourth blessing!', cid)
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
			else
				selfSay('You need 10k for this blessing!', cid)
			end
		end
        </action>
	</response>
   </interact>
 
   <interact keywords="fifth">
	<response>
		<action name="script">
		if getPlayerBlessing(cid, 5) then
			selfSay('You already have this blessing.', cid)
		else
			if doPlayerRemoveMoney(cid, 10000) == true then
				doPlayerAddBlessing(cid, 5)		
				selfSay('You got the fifth blessing!', cid)
				doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
			else
				selfSay('You need 10k for this blessing!', cid)
			end
		end
        </action>
	</response>
   </interact>
 
	<interact keywords="bye" focus="0">
      <keywords>farewell</keywords>
		<response>
			<action name="script">
				selfSay('Farewell! Good luck to you!', cid)
			</action>
		</response>
    </interact>
 
</interaction>
</npc>
 
Thanks Cronox, but does that one give you no item loss aswell as blue shield?

If not, can you tell me how to implement it? Since im just a mapper..

- - - Updated - - -

@hugq: Yeah and which uid or w/e does the blue shield possess?

- - - Updated - - -

Tried to do it like this, but I think it's not what I need, do you see any errors?
if getPlayerBlessing(cid, 1) then
selfSay('You already have the blessing.', cid)
else
if doPlayerRemoveMoney(cid, 100000) == true then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSetPlayerEmblem(cid, 1)
doCreatureSetDropLoot(cid, 0)
selfSay('You have been blessed by god!', cid)
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
else
selfSay('You need 100k for this blessing!', cid)
end
end

Also it just hit me, if a player does this and dies, doesnt he save all the blessings and the shield along with no item loss??
 
Last edited:
Okay, cool, anyway the NPC did respond to my greeting, but when I said "blessing of god" which is the interact keyword I chose, it did not respond, just ignored me.

I'm using this NPC script now named bless.lua, but when I say yes, he just removes the money, he wont say that Ive been blessed and I wont get the shield.
-- Script by Amiroslo, dont remove credit!
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

local item = 2160 -- items id
local count = 10 -- count of itemID

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 (msgcontains(msg, 'blessing')) then
selfSay('are you sure you want to buy blessing for 100k?', cid)
elseif (msgcontains(msg, 'yes')) then
doPlayerRemoveItem(cid, item, count)
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doSetPlayerEmblem(cid, EMBLEM_BLUE)
selfSay('You have been blessed by god!', cid)
else
selfSay('You need 100k for this blessing!', cid)
npcHandler:releaseFocus(cid)
end
return true
end

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