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

How to change the attackspeed on monsters? TFS 0.4

Zippiex

Member
Joined
Nov 4, 2015
Messages
255
Solutions
2
Reaction score
20
Location
Sweden
Hello. I was edit the source in monster.cpp > basespeed. I change basespeed from 200 to 50 and also turn the server off, compile and turn the server on with the new file theforgottenserver which you get from the compile. Then I didn't see any change. I also edit frost dragon.xml in monster I changed interval to 10000 and much more to higher and lower numbers but nothing changed the speed. My question is how do I change the attackspeed from monsters?

EDIT: To be more clear. The monsters don't follow the interval rule in the script because
it's attacks every second even if I set all intervals in the whole script to 8000 or 10000.

Example
Code:
<attack name="melee" interval="2000" <-- The monster don't follow this rule! skill="60" attack="40" poison="80"/>

EDIT AGAIN: I tried the server on my windows and the monsters works like they should there so it's something with the sources I'm pretty sure about that on the server I use now It's debian.
 
Last edited:
I'm not sure if I understood you correctly, but if you want faster attackspeed from monsters, you are supposed to decrease the interval. Increasing the interval to 10 000 will just make it slower.
 
I'm not sure if I understood you correctly, but if you want faster attackspeed from monsters, you are supposed to decrease the interval. Increasing the interval to 10 000 will just make it slower.
I want it slower. There are many intervals which of them do I edit?
 
Slower? Then increasing it to 10 000 should the monster make it attack once every 10 seconds, (unless if you have got chance="x" to the attack) ? Are your other monsters even working properly though? It feels like your monster isn't even working in the first place.

Any errors while reloading monsters / spawning it?
 
Slower? Then increasing it to 10 000 should the monster make it attack once every 10 seconds, (unless if you have got chance="x" to the attack) ? Are your other monsters even working properly though? It feels like your monster isn't even working in the first place.

Any errors while reloading monsters / spawning it?
No errors. The monsters are fine it's something with the sources I think and I don't know how to how to make the attackspeed from monster slower!

Here is the script, yes I have try to set the intervals to like 100000 but It don't works. Also set chance to 0 but that didn't work.
Frost dragon xml.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Frost Dragon" nameDescription="a frost dragon" race="undead" experience="2300" speed="260" manacost="0">
    <health now="1800" max="1800"/>
    <look type="248" corpse="7091"/>
    <targetchange interval="5000" chance="6"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <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="250"/>
    </flags>
    <attacks>
        <attack name="melee" interval="2000" skill="100" attack="40"/>
        <attack name="physical" interval="10000" chance="12" range="7" target="1" min="-0" max="-2200">
            <attribute key="areaEffect" value="poff"/>
        </attack>
        <attack name="lifedrain" interval="2000" chance="8" length="8" spread="3" min="-0" max="-380">
            <attribute key="areaEffect" value="poff"/>
        </attack>
        <attack name="speed" interval="2000" chance="5" length="8" spread="3" speedchange="-720" duration="5000">
            <attribute key="areaEffect" value="icearea"/>
        </attack>
        <attack name="speed" interval="2000" chance="5" radius="4" target="1" speedchange="-500" duration="5000">
            <attribute key="shootEffect" value="ice"/>
            <attribute key="areaEffect" value="icearea"/>
        </attack>
        <attack name="ice" interval="2000" chance="5" radius="4" target="1" min="-0" max="-240">
            <attribute key="shootEffect" value="ice"/>
            <attribute key="areaEffect" value="icearea"/>
        </attack>
        <attack name="ice" interval="2000" chance="5" radius="3" target="0" min="-0" max="-120">
            <attribute key="areaEffect" value="icearea"/>
        </attack>
        <attack name="speed" interval="2000" chance="5" radius="3" target="0" speedchange="-500" duration="5000">
            <attribute key="areaEffect" value="poff"/>
        </attack>
        <defense name="speed" interval="2000" chance="5" speedchange="360" duration="5000">
            <attribute key="areaEffect" value="redshimmer"/>
        </defense>   
    </attacks>
    <defenses armor="22" defense="35">
        <defense name="healing" interval="2000" chance="5" min="175" max="225">
            <attribute key="areaEffect" value="blueshimmer"/>
        </defense>
    </defenses>
    <elements>
        <element earthPercent="100"/>
        <element physicalPercent="15"/>
    </elements>
    <immunities>
        <immunity fire="1"/>
        <immunity ice="1"/>
        <immunity earth="1"/>
        <immunity lifedrain="1"/>
        <immunity paralyze="1"/>
        <immunity invisible="1"/>
    </immunities>
    <voices interval="5000" chance="10">
        <voice sentence="YOU WILL FREEZE!" yell="1"/>
        <voice sentence="ZCHHHHH!" yell="1"/>
        <voice sentence="I am so cool" yell="1"/>
        <voice sentence="Chill out!." yell="1"/>
    </voices>
    <loot>
    <item id="2148" countmax="100" chance="33950" /><!-- gold coin -->
    <item id="2148" countmax="100" chance="33950" /><!-- gold coin -->
    <item id="2148" countmax="43" chance="33950" /><!-- gold coin -->
    <item id="2672" chance="71700" /><!-- dragon ham -->
    <item id="2547" countmax="6" chance="4000" /><!-- power bolt -->
    <item id="2033" chance="3450" /><!-- golden mug -->
    <item id="2167" chance="5675" /><!-- energy ring -->
    <item id="2146" chance="5700" /><!-- small sapphire -->
    <item id="2796" chance="12475" /><!-- green mushroom -->
    <item id="7441" chance="4575" /><!-- ice cube -->
    <item id="1950" chance="9375" /><!-- book -->
    <item id="2177" chance="1075" /><!-- life crystal -->
    <item id="2492" chance="625" /><!-- dragon scale mail -->
    <item id="1987" chance="100000"><!-- bag -->
        <inside>
            <item id="7290" chance="975" /><!-- shard -->
            <item id="2528" chance="800" /><!-- tower shield -->
            <item id="2396" chance="800" /><!-- ice rapier -->
            <item id="2479" chance="950" /><!-- strange helmet -->
            <item id="7402" chance="600" /><!-- dragon slayer -->
            <item id="2498" chance="700" /><!-- royal helmet -->
        </inside>
    </item>
</loot>





















</monster>
 
No errors. The monsters are fine it's something with the sources I think and I don't know how to how to make the attackspeed from monster slower!

Here is the script, yes I have try to set the intervals to like 100000 but It don't works. Also set chance to 0 but that didn't work.
Frost dragon xml.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Frost Dragon" nameDescription="a frost dragon" race="undead" experience="2300" speed="260" manacost="0">
    <health now="1800" max="1800"/>
    <look type="248" corpse="7091"/>
    <targetchange interval="5000" chance="6"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <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="250"/>
    </flags>
    <attacks>
        <attack name="melee" interval="2000" skill="100" attack="40"/>
        <attack name="physical" interval="10000" chance="12" range="7" target="1" min="-0" max="-2200">
            <attribute key="areaEffect" value="poff"/>
        </attack>
        <attack name="lifedrain" interval="2000" chance="8" length="8" spread="3" min="-0" max="-380">
            <attribute key="areaEffect" value="poff"/>
        </attack>
        <attack name="speed" interval="2000" chance="5" length="8" spread="3" speedchange="-720" duration="5000">
            <attribute key="areaEffect" value="icearea"/>
        </attack>
        <attack name="speed" interval="2000" chance="5" radius="4" target="1" speedchange="-500" duration="5000">
            <attribute key="shootEffect" value="ice"/>
            <attribute key="areaEffect" value="icearea"/>
        </attack>
        <attack name="ice" interval="2000" chance="5" radius="4" target="1" min="-0" max="-240">
            <attribute key="shootEffect" value="ice"/>
            <attribute key="areaEffect" value="icearea"/>
        </attack>
        <attack name="ice" interval="2000" chance="5" radius="3" target="0" min="-0" max="-120">
            <attribute key="areaEffect" value="icearea"/>
        </attack>
        <attack name="speed" interval="2000" chance="5" radius="3" target="0" speedchange="-500" duration="5000">
            <attribute key="areaEffect" value="poff"/>
        </attack>
        <defense name="speed" interval="2000" chance="5" speedchange="360" duration="5000">
            <attribute key="areaEffect" value="redshimmer"/>
        </defense>  
    </attacks>
    <defenses armor="22" defense="35">
        <defense name="healing" interval="2000" chance="5" min="175" max="225">
            <attribute key="areaEffect" value="blueshimmer"/>
        </defense>
    </defenses>
    <elements>
        <element earthPercent="100"/>
        <element physicalPercent="15"/>
    </elements>
    <immunities>
        <immunity fire="1"/>
        <immunity ice="1"/>
        <immunity earth="1"/>
        <immunity lifedrain="1"/>
        <immunity paralyze="1"/>
        <immunity invisible="1"/>
    </immunities>
    <voices interval="5000" chance="10">
        <voice sentence="YOU WILL FREEZE!" yell="1"/>
        <voice sentence="ZCHHHHH!" yell="1"/>
        <voice sentence="I am so cool" yell="1"/>
        <voice sentence="Chill out!." yell="1"/>
    </voices>
    <loot>
    <item id="2148" countmax="100" chance="33950" /><!-- gold coin -->
    <item id="2148" countmax="100" chance="33950" /><!-- gold coin -->
    <item id="2148" countmax="43" chance="33950" /><!-- gold coin -->
    <item id="2672" chance="71700" /><!-- dragon ham -->
    <item id="2547" countmax="6" chance="4000" /><!-- power bolt -->
    <item id="2033" chance="3450" /><!-- golden mug -->
    <item id="2167" chance="5675" /><!-- energy ring -->
    <item id="2146" chance="5700" /><!-- small sapphire -->
    <item id="2796" chance="12475" /><!-- green mushroom -->
    <item id="7441" chance="4575" /><!-- ice cube -->
    <item id="1950" chance="9375" /><!-- book -->
    <item id="2177" chance="1075" /><!-- life crystal -->
    <item id="2492" chance="625" /><!-- dragon scale mail -->
    <item id="1987" chance="100000"><!-- bag -->
        <inside>
            <item id="7290" chance="975" /><!-- shard -->
            <item id="2528" chance="800" /><!-- tower shield -->
            <item id="2396" chance="800" /><!-- ice rapier -->
            <item id="2479" chance="950" /><!-- strange helmet -->
            <item id="7402" chance="600" /><!-- dragon slayer -->
            <item id="2498" chance="700" /><!-- royal helmet -->
        </inside>
    </item>
</loot>





















</monster>
If I remember correctly, chance is in percentage, which makes 0 = 0%. So either remove the chance="x" completely, otherwise try set it at 100. Only then will it attack with the correct interval.
I assume that other monsters works properly, so I doubt it's in the sources?
 
If I remember correctly, chance is in percentage, which makes 0 = 0%. So either remove the chance="x" completely, otherwise try set it at 100. Only then will it attack with the correct interval.
I assume that other monsters works properly, so I doubt it's in the sources?
I just test this and it's not working.
 
Code:
 <attacks>
        <attack name="melee" interval="200000" skill="100" attack="40"/>
        <attack name="physical" interval="10000" chance="100" range="7" target="1" min="-0" max="-2200">
            <attribute key="areaEffect" value="poff"/>
        </attack>
     
        <defense name="speed" interval="2000" chance="5" speedchange="360" duration="5000">
            <attribute key="areaEffect" value="redshimmer"/>
        </defense>  
    </attacks>

Removed some attacks in order to test it myself, works fine. Attacked once every 10 secs. No idea what sources or anything you are using, but it surely works on default r3777 and on 0.4. You must have changed something.
 
Code:
<attacks>
        <attack name="melee" interval="200000" skill="100" attack="40"/>
        <attack name="physical" interval="10000" chance="100" range="7" target="1" min="-0" max="-2200">
            <attribute key="areaEffect" value="poff"/>
        </attack>
   
        <defense name="speed" interval="2000" chance="5" speedchange="360" duration="5000">
            <attribute key="areaEffect" value="redshimmer"/>
        </defense>
    </attacks>

Removed some attacks in order to test it myself, works fine. Attacked once every 10 secs. No idea what sources or anything you are using, but it surely works on default r3777 and on 0.4. You must have changed something.
Ye but what did I change that's the question! Any ideas?

EDIT: All monsters do this no monster follow the interval I think it's the sources.
 
Last edited:
Okey it has been fixed by Quas -> https://otland.net/members/quas.15421/
It was monsters.cpp in sources. Extrameleeattack was added by someone and we didn't know why so he removed it and abracadabra it worked. He also did some small changes I think but I forgot to ask. Anyway this was solved and you can closed this thread now moderator!


EDIT: Sorry he didn't removed it he fixed it.
 
Last edited:
Back
Top