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

Blessing NPC Problem on item loss

Creon

Well-Known Member
Joined
Aug 25, 2009
Messages
709
Reaction score
94
Location
United States
Ive got this npc which gives you blessings and it works fine. You only lose around 1-2 lvls, But you lose all your items. Im not sure how to fix this. Please help. Here is the npc:

Code:
<?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>
 
vocations.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<vocations>
	<vocation id="0" name="None" description="none" gaincap="5" gainhp="5" gainmana="5" gainhpticks="6" gainhpamount="1" gainmanaticks="6" gainmanaamount="1" manamultiplier="4.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="0">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> 
		<skill id="0" multiplier="1.5"/>
		<skill id="1" multiplier="2.0"/>
		<skill id="2" multiplier="2.0"/>
		<skill id="3" multiplier="2.0"/>
		<skill id="4" multiplier="2.0"/>
		<skill id="5" multiplier="1.5"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="1" name="Sorcerer" description="a sorcerer" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="5" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="1">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/> 
		<skill id="0" multiplier="1.5"/>
		<skill id="1" multiplier="2.0"/>
		<skill id="2" multiplier="2.0"/>
		<skill id="3" multiplier="2.0"/>
		<skill id="4" multiplier="2.0"/>
		<skill id="5" multiplier="1.5"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="2" name="Druid" description="a druid" gaincap="10" gainhp="5" gainmana="30" gainhpticks="6" gainhpamount="5" gainmanaticks="3" gainmanaamount="5" manamultiplier="1.1" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="2">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.5"/>
		<skill id="1" multiplier="1.8"/>
		<skill id="2" multiplier="1.8"/>
		<skill id="3" multiplier="1.8"/>
		<skill id="4" multiplier="1.8"/>
		<skill id="5" multiplier="1.5"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="3" name="Paladin" description="a paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="4" gainhpamount="5" gainmanaticks="4" gainmanaamount="5" manamultiplier="1.4" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="3">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.2"/>
		<skill id="1" multiplier="1.2"/>
		<skill id="2" multiplier="1.2"/>
		<skill id="3" multiplier="1.2"/>
		<skill id="4" multiplier="1.1"/>
		<skill id="5" multiplier="1.1"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="4" name="Knight" description="a knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="3" gainhpamount="5" gainmanaticks="6" gainmanaamount="5" manamultiplier="3.0" attackspeed="2000" soulmax="100" gainsoulticks="120" fromvoc="4">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.1"/>
		<skill id="1" multiplier="1.1"/>
		<skill id="2" multiplier="1.1"/>
		<skill id="3" multiplier="1.1"/>
		<skill id="4" multiplier="1.4"/>
		<skill id="5" multiplier="1.1"/>
		<skill id="6" multiplier="1.1"/>
	</vocation>
	<vocation id="5" name="Master Sorcerer" description="a master sorcerer" gaincap="10" gainhp="5" gainmana="30" gainhpticks="4" gainhpamount="10" gainmanaticks="2" gainmanaamount="10" manamultiplier="1.1" attackspeed="2000" soulmax="200" gainsoulticks="15" fromvoc="1">
		<formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
		<skill id="0" multiplier="1.5"/>
		<skill id="1" multiplier="2.0"/>
		<skill id="2" multiplier="2.0"/>
		<skill id="3" multiplier="2.0"/>
		<skill id="4" multiplier="2.0"/>
 
Back
Top