Hello there ! IM using TSF 0.4 i have a questions about :
ITs possible or not to give that spell for monster :
IGNORES 80 % of Defence what you got ? (basic def , armor , shield etc)
Debuff a player (example: i have 60 mlvl and he debuff me to 50 mlvl )
Debuff player of HP % (i got 1000 HP i got debuff and i get 800 hp for like 3 sec?)
Its possible to create this scripts ?
Here is an example how to reduce a players melee and shielding skills for 4 seconds (ice golem spell)
Its made for 0.3.6 but should also work for 0.4
But you should be able to change it to magic level and other conditions, im not sure if hp reduce is possible but dont quote me on that.
You have to look what constants you can use (hint: search in data/lib/000-constant.lua)
data/spells/scripts/monster/ice_golem_skill_reducer.lua (If you dont have the monster folder just add it
)
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 4 * 1000) -- 4 * 1000 = 4000 ms (4 seconds)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELDPERCENT, 85) -- set players shielding to 85% (debuff), if the value is 110 then the players shielding would be 110% (buff)
setConditionParam(condition, CONDITION_PARAM_SKILL_MELEEPERCENT, 85) -- set players meleeskills to 85% (debuff), if the value is 110 then the players meleeskills would be 110% (buff)
setCombatCondition(combat, condition)
function onCastSpell(cid, var)
return doCombat(cid, combat, var)
end
You have to add this inside
data/spells/spells.xml
XML:
<instant name="ice_golem_skill_reducer" words="###4" aggressive="1" blockwalls="1" needtarget="0" needlearn="1" script="monster/ice_golem_skill_reducer.lua" />
Then you edit your monster you want to use this spell, this is what you have to add to the monsters xml file
XML:
<attack name="ice_golem_skill_reducer" interval="2000" chance="10" />
Then the monster should have a spell like exori to reduce every player inside the exori area down to 85% of the players regular skill. (You can edit this the way you want, inside the lua file)
skill * 0.85 = temporary skill for 4 seconds
Edit:
This might not be what you are looking for but its a good start.
There is a way to change the maxHealth of a player, but it seems you want to change the current health of a player, its possible but need to make some custom function to calculate the percent for players current health.
About the defence, armor and shielding as a condition, im sure there is way to make that possible, but the thing i provided in the example reduce shielding skill only i didnt find anything about armor, so that has to be something custom aswell.
Magic level is just as the shielding or melee condition just use CONDITION_PARAM_STAT_MAGICLEVELPERCENT
Then you have to test what percent suits you