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

Make Areas of my choice REGEN HP

Joined
Jan 20, 2015
Messages
120
Reaction score
11
Location
Born in Russia.
I tried to use Pitufo area health script, but is not working.

So i want a script whre i can setup multiple locations
example:
fromX = 32117,
fromY = 32118,
fromZ = 7,
toX = 32116,
toY = 32159,
toZ = 7,


then inside these locations players regen HP

The idea is put a camp fire there and pretend it heals players :p
 
Last edited by a moderator:
i dont know how to do that

It is very simple.
First, make a creature, and give him the outfit of the campfire and give him 0 movement speed
Code:
<monster name="Campfire" nameDescription="a campfire" race="undead" experience="0" speed="0" manacost="0">
<look typeex="ITEMID"/> <!-- Place the itemid of the campfire here -->

Then under flags, change the following to match the below:
Code:
<flag attackable="0"/>
<flag hostile="0"/>
<flag pushable="0"/>
<flag hidename="1"/>
<flag hidehealth="1"/>

Then give the campfire a new defense spell (call it whatever you want)
Code:
<defenses armor="0" defense="0">
<defense name="Campfire" interval="1000" />
</defenses>

And make sure you add the new monster to your monsters.xml file.

Then you make a new spell called "Campfire" that either heals players, or gives them a regeneration condition (You can find examples of these in light healing.lua and party heal.lua)
 
If you don't want to do it yourself, I made these for you:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="campfire" nameDescription="a campfire" race="undead" experience="0" speed="0" manacost="0">
  <health now="9950" max="9950"/>
  <look typeex="1935"/>
  <targetchange interval="5000" chance="20"/>
  <strategy attack="100" defense="0"/>
  <flags>
  <flag summonable="0"/>
  <flag attackable="0"/>
  <flag hostile="0"/>
  <flag illusionable="0"/>
  <flag convinceable="0"/>
  <flag pushable="0"/>
  <flag canpushitems="0"/>
  <flag canpushcreatures="1"/>
  <flag targetdistance="1"/>
  <flag staticattack="90"/>
  <flag runonhealth="100"/>
  <flag hidehealth="1"/>
  </flags>
  <attacks>

  </attacks>
  <defenses armor="1" defense="1">
  <defense name="Campfire" interval="1000" />
  </defenses>
  <immunities>
  <immunity physical="1"/>
  <immunity energy="1"/>
  <immunity fire="1"/>
  <immunity poison="1"/>
  <immunity ice="1"/>
  <immunity holy="1"/>
  <immunity death="1"/>
  <immunity lifedrain="1"/>
  <immunity manadrain="1"/>
  <immunity paralyze="1"/>
  <immunity drunk="1"/>
  <immunity outfit="1"/>
  <immunity invisible="1"/>
  </immunities>
  <loot>
  </loot>
</monster>

Code:
local range = 5 -- How close you need to be to the campfire to receive healing

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 2)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setConditionParam(condition, CONDITION_PARAM_TICKS, 2 * 60 * 1000) -- How long should it continue to heal you once you leave the campfire?
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, 20) -- How much health should you gain?
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 2000) -- How many seconds between healthgain?
setConditionParam(condition, CONDITION_PARAM_MANAGAIN, 20) -- How much mana should you gain?
setConditionParam(condition, CONDITION_PARAM_MANATICKS, 2000) -- How many seconds between managain?

function onCastSpell(cid, var)
   local mypos = getCreaturePosition(cid)
   local specs = getSpectators(getCreaturePosition(cid), range, range, 1)
   for _, tid in ipairs(specs) do
     if cid ~= tid then
       if not hasCondition(tid, CONDITION_INFIGHT) then -- Make sure the player is not in combat (So they can't lure monsters to the campfire for easy kills)
         doAddCondition(tid, condition)
       end
     end
   end
   return true
end

Though, I suggest trying to do it yourself :), You may learn something!
 
If you don't want to do it yourself, I made these for you:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="campfire" nameDescription="a campfire" race="undead" experience="0" speed="0" manacost="0">
  <health now="9950" max="9950"/>
  <look typeex="1935"/>
  <targetchange interval="5000" chance="20"/>
  <strategy attack="100" defense="0"/>
  <flags>
  <flag summonable="0"/>
  <flag attackable="0"/>
  <flag hostile="0"/>
  <flag illusionable="0"/>
  <flag convinceable="0"/>
  <flag pushable="0"/>
  <flag canpushitems="0"/>
  <flag canpushcreatures="1"/>
  <flag targetdistance="1"/>
  <flag staticattack="90"/>
  <flag runonhealth="100"/>
  <flag hidehealth="1"/>
  </flags>
  <attacks>

  </attacks>
  <defenses armor="1" defense="1">
  <defense name="Campfire" interval="1000" />
  </defenses>
  <immunities>
  <immunity physical="1"/>
  <immunity energy="1"/>
  <immunity fire="1"/>
  <immunity poison="1"/>
  <immunity ice="1"/>
  <immunity holy="1"/>
  <immunity death="1"/>
  <immunity lifedrain="1"/>
  <immunity manadrain="1"/>
  <immunity paralyze="1"/>
  <immunity drunk="1"/>
  <immunity outfit="1"/>
  <immunity invisible="1"/>
  </immunities>
  <loot>
  </loot>
</monster>

Code:
local range = 5 -- How close you need to be to the campfire to receive healing

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 2)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setConditionParam(condition, CONDITION_PARAM_TICKS, 2 * 60 * 1000) -- How long should it continue to heal you once you leave the campfire?
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, 20) -- How much health should you gain?
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 2000) -- How many seconds between healthgain?
setConditionParam(condition, CONDITION_PARAM_MANAGAIN, 20) -- How much mana should you gain?
setConditionParam(condition, CONDITION_PARAM_MANATICKS, 2000) -- How many seconds between managain?

function onCastSpell(cid, var)
   local mypos = getCreaturePosition(cid)
   local specs = getSpectators(getCreaturePosition(cid), range, range, 1)
   for _, tid in ipairs(specs) do
     if cid ~= tid then
       if not hasCondition(tid, CONDITION_INFIGHT) then -- Make sure the player is not in combat (So they can't lure monsters to the campfire for easy kills)
         doAddCondition(tid, condition)
       end
     end
   end
   return true
end

Though, I suggest trying to do it yourself :), You may learn something!
Haven't tested it yet and didn't need it but you gave me awesome idea/script so have my like.
 
sorry for annoying but where do i put this?

at functions?

Code:
local range = 5 -- How close you need to be to the campfire to receive healing

local condition = createConditionObject(CONDITION_REGENERATION)
setConditionParam(condition, CONDITION_PARAM_SUBID, 2)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setConditionParam(condition, CONDITION_PARAM_TICKS, 2 * 60 * 1000) -- How long should it continue to heal you once you leave the campfire?
setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, 20) -- How much health should you gain?
setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 2000) -- How many seconds between healthgain?
setConditionParam(condition, CONDITION_PARAM_MANAGAIN, 20) -- How much mana should you gain?
setConditionParam(condition, CONDITION_PARAM_MANATICKS, 2000) -- How many seconds between managain?

function onCastSpell(cid, var)
   local mypos = getCreaturePosition(cid)
   local specs = getSpectators(getCreaturePosition(cid), range, range, 1)
   for _, tid in ipairs(specs) do
     if cid ~= tid then
       if not hasCondition(tid, CONDITION_INFIGHT) then -- Make sure the player is not in combat (So they can't lure monsters to the campfire for easy kills)
         doAddCondition(tid, condition)
       end
     end
   end
   return true
end
 
created campfire.xml inside monsters folder

added <monster name="Campfire" file="campfire.xml"/> to monsters.xml

and put Campfire.lua inside spells/scripts/healing folder



EDIT, added the spell at spells.xml

<instant name="Campfire" words="Usu" maglv="0" mana="0" selftarget="1" aggressive="0" prem="0" needlearn="0" script="healing/campfire.lua">
</instant>


still getting the immunity error:



29/01/2015 19:15:36] [Warning - Monsters::loadMonster] Unknown immunity undead. data/monster/campfire.xml
[29/01/2015 19:15:36] [Warning - Monsters::loadMonster] Unknown immunity undead. data/monster/campfire.xml
[29/01/2015 19:15:36] [Warning - Monsters::loadMonster] Unknown immunity undead. data/monster/campfire.xml
[29/01/2015 19:15:36] [Warning - Monsters::loadMonster] Unknown immunity undead. data/monster/campfire.xml


Edit: i can finally summon it, its transparent lol, im not in combat and is NOT healing me :/

rf3lF956H.png
 
Last edited:
Back
Top