Lyky
Well-Known Member
- Joined
- May 27, 2014
- Messages
- 291
- Solutions
- 8
- Reaction score
- 89
Hi,
So my players have been sending complains for dragons on my server having over 200 IQ; Its running on [TFS 1.2];
I was wondering if its possible - through lua - make monsters having a chance turn towards player 20% per 2sec turn.
As it stands now, all of my monsters automatically from a get-go turn to player position, and when running away they move in a way so that player is going to be hit by a wave attack, and dodge their attacks.
The issue has been described here:
Monster AI Revamp [$100] · Issue #922 · otland/forgottenserver · GitHub [2014 couple years back]
Turning/Facing - if a creature changes directions while while moving there is no delay before or after the turn, they turn and take their next step in a fluid motion. During dancestep if the creature turns away from the target when it moves, it will adjust the direction to face the target again during it's next attack interval (turn and attack in fluid motion)
later stated it has been implemented; thus how to control that turning/facing direction switch chance?
@edit
After thinking a little bit about it; it should be scriptable in creaturescripts; but i have no idea how to start - can anyone point me to example that modifies how certain creatures behave.
So my players have been sending complains for dragons on my server having over 200 IQ; Its running on [TFS 1.2];
I was wondering if its possible - through lua - make monsters having a chance turn towards player 20% per 2sec turn.
As it stands now, all of my monsters automatically from a get-go turn to player position, and when running away they move in a way so that player is going to be hit by a wave attack, and dodge their attacks.
XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="dragon" nameDescription="a dragon" race="blood" experience="700" speed="150" manacost="0">
<health now="1000" max="1000"/>
<look type="34" corpse="3104"/>
<targetchange interval="1000" chance="5"/>
<targetstrategies nearest="70" health="10" damage="10" random="10"/>
<flags>
<flag attackable="1"/>
<flag hostile="1"/>
<flag summonable="0"/>
<flag convinceable="0"/>
<flag illusionable="1"/>
<flag pushable="0"/>
<flag canpushitems="1"/>
<flag canpushcreatures="1"/>
<flag targetdistance="1"/>
<flag staticattack="80"/>
<flag runonhealth="300"/>
</flags>
<attacks>
<attack name="melee" skill="55" attack="42"/>
<attack name="fire" chance="15" range="7" radius="4" target="1" min="-55" max="-105">
<attribute key="shootEffect" value="fire"/>
<attribute key="areaEffect" value="firearea"/>
</attack>
<attack name="fire" chance="12" length="8" spread="3" min="-100" max="-160">
<attribute key="areaEffect" value="firearea"/>
</attack>
</attacks>
<defenses armor="25" defense="38">
<defense name="healing" chance="13" min="34" max="56">
<attribute key="areaEffect" value="blueshimmer"/>
</defense>
</defenses>
<elements>
<element firePercent="100"/>
<element earthPercent="100"/>
</elements>
<immunities>
<immunity paralyze="1"/>
<immunity invisible="1"/>
</immunities>
<voices interval="1000" chance="5">
<voice sentence="GROOAAARRR" yell="1"/>
<voice sentence="FCHHHHH" yell="1"/>
</voices>
<loot>
<item id="2672" chance="45000" countmax="3"/><!-- 3 45% dragon ham -->
<item id="2148" chance="80000" countmax="45"/><!-- 45 80% gold coin -->
<item id="2148" chance="50000" countmax="60"/><!-- 60 50% gold coin -->
<item id="2145" chance="400"/><!-- 0.4% small diamond -->
<item id="2546" chance="16000" countmax="10"/><!-- 10 16% burst arrow -->
<item id="2177" chance="100"/><!-- 0.1% life crystal -->
<item id="2457" chance="3000"/><!-- 3% steel helmet -->
<item id="2647" chance="2000"/><!-- 2% plate legs -->
<item id="5877" chance="1005"/><!-- green dragon leather -->
<item id="5920" chance="1000"/><!-- green dragon scale -->
<item id="1987" chance="100000"><!-- bag -->
<item id="2455" chance="10000"/><!-- 10% crossbow -->
<item id="2397" chance="4000"/><!-- 4% longsword -->
<item id="2413" chance="2000"/><!-- 2% broadsword -->
<item id="2387" chance="1000"/><!-- 1% double axe -->
<item id="2434" chance="500"/><!-- 0.5% dragon hammer -->
<item id="2409" chance="500"/><!-- 0.5% serpent sword -->
<item id="2406" chance="25000"/><!-- 25% short sword -->
<item id="2398" chance="20000"/><!-- 20% mace -->
<item id="2187" chance="1000"/><!-- 1% wand of inferno -->
<item id="2509" chance="15000"/><!-- 15% steel shield -->
<item id="2516" chance="300"/><!-- 0.3% dragon shield -->
<item id="7430" chance="10"/><!-- dragonbone staff -->
</item>
</loot>
</monster>
The issue has been described here:
Monster AI Revamp [$100] · Issue #922 · otland/forgottenserver · GitHub [2014 couple years back]
Turning/Facing - if a creature changes directions while while moving there is no delay before or after the turn, they turn and take their next step in a fluid motion. During dancestep if the creature turns away from the target when it moves, it will adjust the direction to face the target again during it's next attack interval (turn and attack in fluid motion)
later stated it has been implemented; thus how to control that turning/facing direction switch chance?
@edit
After thinking a little bit about it; it should be scriptable in creaturescripts; but i have no idea how to start - can anyone point me to example that modifies how certain creatures behave.
Last edited: