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

TFS 1.2 - New Condition to Reduce Base Speed

Joined
Dec 13, 2015
Messages
45
Reaction score
13
So I wanted a 'chilled' condition that would reduce the player/creature base speed for its duration.

I tried but I was unable to do it on my own.

Distro Name: TFS 1.2
Script type: Script for a new condition that reduces player/creature base move speed for its duration.
Description of the script:
In conditions.cpp the script would define a new condition (here called 'chilled') that would reduce the player/creature base move speed. Becoming hasted, paralyzed or healed would not remove the 'chilled' condition. Instead, if a chilled player becomes hasted or paralyzed, it would keep both chilled and the haste/paralyze modifiers.

Math Example:

Player Base Speed
= 1000
Haste = 70% speed buff
Paralyze = 70% speed debuff
Chilled = -25 Base Speed

Speed calculations:
Player Hasted = 1000 * (1 + 0,7) = 1700
Player Paralyzed = 1000 * (1 - 0,7) = 300
Player Chilled = 1000 - 25 = 975

Player Chilled + Hasted = (1000 - 25) * (1 + 0,7) = 1657,5 = 1657
Player Chiller + Paralyzed = (1000 - 25) * (1 - 0,7) = 292,5 = 292

I hope I was clear enough.
Thanks in advance for your time and effort.
 
Last edited:
This might require you to edit some of your other spells that do remove paralyze as a heal spell.

Modify the paralyze spell and apply it with a subid greater than 1
https://github.com/otland/forgotten...data/spells/scripts/support/paralyze_rune.lua

I am not to certain if the condition will be removed if it has a separate subid, so maybe that is a solution.
What he said!

I still want healing spells to remove paralyze, I just don't want them to remove chilled.
Anyway thanks for the reply, I'll see if I can work something out based on what you said.

I really would prefer to introduce chilled as a new condition with its exclusive mechanic in conditions.pp source file though.
Any help with that would be appreciated.
 
You can do something similar without source edit. To add a new full condition like chilled, you'd have to modify client aswell to show the new "condition".
So what they told you to do is to do something like paralize but changing subid. If you change subid, healing spells will remove paralize, but no chilled.
If you want to remove chilled, you'll have to do a new spell "exana frigo" in order to remove chill effect, or modify healing spells if you want them to remove
the chill effect. Up to you! It's pretty easy, you just need to check for the spells you already have and modify them a bit.
 
doRemoveCondition has subId as a 3rd optional argument, so if you have regular paralyze on subId 0 (or 1, whatever is default), and chilled on like 10, then you can put in healing spells doRemoveCondition(cid, CONDITION_PARALYZE, 1)
 
I see.

I realise that I can edit the healing spells in order for it to only remove the paralyze condition with a specific subID.
However, haste spells also remove paralyze despite them not having the "condition dispel" line in their lua file (this behavior is defined in conditions.cpp),
so I'm not sure I will be able to have a player with paralyzeSubID(1) and haste at the same time.

Anyway, I don't have my server up atm but I will test it asap and post the results.

Thanks again!
 
wherever haste spells remove it in source, im sure you can add the optional subId argument
unless the condition_haste overrides paralyze, in which case youd have to remove that also
 
This is for 0.3.7 -- however we have a function called "doChangeSpeed(cid, delta)"
Using this with an addEvent such as I did in the link below, it would could make your 'chilled' condition.
https://otland.net/threads/closed-i...e-0-3-7-0-3-6-0-4.234306/page-20#post-2339753
TFS 1.x may have something similar.
using doChangeSpeed will produce some bugs, mainly if you also use paralyze, if i have 1k speed, then a 60% paralyze will remove 600, if i use doChangeSpeed and remove 500, it will still remove 600, because for some reason it seems to always take the x% from the speed you're SUPPOSED to have without paralyze condition, however you can solve this problem, but not really in a simple way afaik
 
Back
Top