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

Lua Make an item attack?

ond

Veteran OT User
Joined
Mar 24, 2008
Messages
2,775
Solutions
25
Reaction score
483
Location
Sweden
Is it possible to make an item attack Players? (by script)

In my case, ID: 1560 to attack like this:

Lua:
  <attacks>
    <attack name="melee" interval="2000" skill="1" attack="1"/>
    <attack name="poison" interval="1000" chance="100" range="7" min="-50" max="-100">
      <attribute key="shootEffect" value="energy"/>
      <attribute key="areaEffect" value="yellowspark"/>
    </attack>
  </attacks>
 
New idea! is it possible to make a code (similar to warlocks invisible) but instead you turn into the id of 1560? :p
 
well all you needa do is like getSpectators to get creatures in the pos, remove every player that cannot be reached (e.g. behind wall) and then from the remaining players we check who is closest and then set him as target...

I personally would use 2 addEvents. One running each 500ms to attack the current target. Another running e.g. each 2500ms to pick a new target if there is one that is closer by now.
 
Well I aint much of a script writer. Perhaps, if you got time and so you could help me with it? :p
 
I'm sorry to have bother you all, but I have solved it in another way... I'm very thankful for the help & replies I've recieved for this.

How did I solve it?

If you put looktype 0 on monsters you can put them on stuff and they wont have name and so on...
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="magic pillar" nameDescription="a magic pillar" race="undead" experience="0" speed="0" manacost="0">
    <health now="9950" max="9950"/>
    [COLOR="red"]<look typeex="1560"/>[/COLOR]
    <targetchange interval="5000" chance="20"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag illusionable="0"/>
        <flag convinceable="0"/>
        <flag pushable="0"/>
        <flag canpushitems="0"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag staticattack="90"/>
        <flag runonhealth="100"/>
        [COLOR="red"]<flag hidehealth="1"/>[/COLOR]
    </flags>
 <attacks>
    <attack name="melee" interval="2000" skill="1" attack="1"/>
    <attack name="poison" interval="1000" chance="100" range="7" min="-50" max="-100">
      <attribute key="shootEffect" value="energy"/>
      <attribute key="areaEffect" value="yellowspark"/>
    </attack>
  </attacks>
    <defenses armor="1" defense="1"/>
    <immunities>
        <immunity physical="1"/>
        <immunity energy="1"/>
        <immunity fire="1"/>
        <immunity poison="1"/>
        <immunity ice="1"/>
        <immunity holy="1"/>
        <immunity death="1"/>
        <immunity lifedrain="1"/>
        <immunity manadrain="1"/>
        <immunity paralyze="1"/>
        <immunity drunk="1"/>
        <immunity outfit="1"/>
        <immunity invisible="1"/>
    </immunities>
</monster>

go into data/monster/traps for examples. its easy to make any monster attack
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="magic pillar" nameDescription="a magic pillar" race="undead" experience="0" speed="0" manacost="0">
    <health now="9950" max="9950"/>
    [COLOR="red"]<look typeex="1560"/>[/COLOR]
    <targetchange interval="5000" chance="20"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <flag attackable="1"/>
        <flag hostile="1"/>
        <flag illusionable="0"/>
        <flag convinceable="0"/>
        <flag pushable="0"/>
        <flag canpushitems="0"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag staticattack="90"/>
        <flag runonhealth="100"/>
        [COLOR="red"]<flag hidehealth="1"/>[/COLOR]
    </flags>
 <attacks>
    <attack name="melee" interval="2000" skill="1" attack="1"/>
    <attack name="poison" interval="1000" chance="100" range="7" min="-50" max="-100">
      <attribute key="shootEffect" value="energy"/>
      <attribute key="areaEffect" value="yellowspark"/>
    </attack>
  </attacks>
    <defenses armor="1" defense="1"/>
    <immunities>
        <immunity physical="1"/>
        <immunity energy="1"/>
        <immunity fire="1"/>
        <immunity poison="1"/>
        <immunity ice="1"/>
        <immunity holy="1"/>
        <immunity death="1"/>
        <immunity lifedrain="1"/>
        <immunity manadrain="1"/>
        <immunity paralyze="1"/>
        <immunity drunk="1"/>
        <immunity outfit="1"/>
        <immunity invisible="1"/>
    </immunities>
</monster>

go into data/monster/traps for examples. its easy to make any monster attack

Read the thread. He didn't manage to get hidehealth/hidename to work.
 
Back
Top