- Joined
- Nov 17, 2010
- Messages
- 6,829
- Solutions
- 586
- Reaction score
- 5,410
As thread title - Creating a monster that does not heal until it reaches 40% or lower.
If there is another way to achieve this please let me know. ^_^
I have took an intense healing spell, and modified it with some help, to hopefully check if the monster has below 40% hp and if so cast the spell and give a blue shimmer if it's been activated.
The monster is a slightly modified monk.
No vocation can use the spell, although I would assume gods should still be able to cast the spell. Also when reloading monsters/spells there is no error's for either the spell or monster.
-spells-
(note) changing agressive on/off does nothing (ms=monster script | fphm=fourty percent healing monster)
Actual Spell being used. (when casted with the word "iauhdfjcadnvjn" by a god nothing happens, no error's in console either)
-Monster-
If spell in attack does nothing/ if in defense does nothing. (however when in defense it would spam the error for not finding a required boolean (the moment it was summoned), before I changed part of the spell from getCreatureHealth(uid) - to - getCreatureHealth(cid))
I have a feeling that the problem lies with the spell itself, it's like the spell is actually casting but it has no function to start the cast.
Just a hunch but I can't figure out what's wrong.:huh:
If there is another way to achieve this please let me know. ^_^
I have took an intense healing spell, and modified it with some help, to hopefully check if the monster has below 40% hp and if so cast the spell and give a blue shimmer if it's been activated.
The monster is a slightly modified monk.
No vocation can use the spell, although I would assume gods should still be able to cast the spell. Also when reloading monsters/spells there is no error's for either the spell or monster.
-spells-
(note) changing agressive on/off does nothing (ms=monster script | fphm=fourty percent healing monster)
XML:
<instant name="fphm" words="iauhdfjcadnvjn" lvl="999999" mana="50" aggressive="0" selftarget="1" exhaustion="1000" needlearn="0" event="script" value="ms/fphm.lua">
</instant>
XML:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)
setHealingFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 5, 6)
function onCastSpell(cid, var)
local percent = 40
if 100 / (getCreatureMaxHealth(cid) / getCreatureHealth(cid)) <= percent then
return TRUE
end
end
If spell in attack does nothing/ if in defense does nothing. (however when in defense it would spam the error for not finding a required boolean (the moment it was summoned), before I changed part of the spell from getCreatureHealth(uid) - to - getCreatureHealth(cid))
XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Fphm" nameDescription="a fphm" race="blood" experience="200" speed="220" manacost="1200">
<health now="240" max="240"/>
<look type="57" corpse="6080"/>
<targetchange interval="5000" chance="8"/>
<strategy attack="100" defense="0"/>
<flags>
<flag summonable="1"/>
<flag attackable="1"/>
<flag hostile="1"/>
<flag illusionable="1"/>
<flag convinceable="0"/>
<flag pushable="0"/>
<flag canpushitems="1"/>
<flag canpushcreatures="1"/>
<flag targetdistance="1"/>
<flag staticattack="90"/>
<flag runonhealth="0"/>
</flags>
<attacks>
<attack name="melee" interval="2000" skill="30" attack="70"/>
</attacks>
<defenses armor="20" defense="22">
<defense name="fphm" interval="1000" chance="100" min="30" max="50">
<attribute key="areaEffect" value="blueshimmer"/>
</defense>
<defense name="speed" interval="1000" chance="10" speedchange="300" duration="3000">
<attribute key="areaEffect" value="redshimmer"/>
</defense>
</defenses>
<elements>
<element holyPercent="50"/>
<element deathPercent="50"/>
<element physicalPercent="-15"/>
</elements>
<voices interval="5000" chance="10">
<voice sentence="Repent Heretic!"/>
<voice sentence="A prayer to the almighty one!"/>
<voice sentence="I will punish the sinners!"/>
</voices>
<loot>
<item id="8300" chance="25"/><!-- embounding crystal -->
<item id="8305" chance="25"/><!-- refining material -->
<item id="2148" countmax="20" chance="24000"/><!-- gold coin -->
<item id="2689" chance="20000"/><!-- bread -->
<item id="1949" chance="18000"/><!-- scroll -->
<item id="2044" chance="12000"/><!-- lamp -->
<item id="2015" chance="6666"/><!-- brown flask -->
<item id="2642" chance="6666"/><!-- sandals -->
<item id="2467" chance="4000"/><!-- leather armor -->
<item id="2401" chance="20000"/><!-- staff -->
<item id="1987" chance="100000"><!-- bag -->
<inside>
<item id="2177" chance="3000"/><!-- life crystal -->
<item id="2193" chance="1500"/><!-- ankh -->
<item id="2166" chance="700"/><!-- power ring -->
</inside>
</item>
</loot>
</monster>
Just a hunch but I can't figure out what's wrong.:huh:
Last edited: