• 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 Summon monk + monster rats

zexus

Member
Joined
Oct 1, 2016
Messages
133
Reaction score
18
How to make to when player use: utevo res "monk
Create a /s Monk, but create 2 rats to train defense like:
/m Rat
/m Rat
???

I've look on spells.xml but show me this:
Code:
    <!-- Summon Spells -->
   <instant name="Summon Creature" words="utevo res" maglv="16" params="1" exhaustion="2000" needlearn="1" event="function" value="summonMonster">
       <vocation id="1"/>
       <vocation id="2"/>
       <vocation id="5"/>
       <vocation id="6"/>
       <vocation id="9"/>
       <vocation id="10"/>
   </instant>

So its sources edits? :(
Where found it on 0.4?

It's on sources?
Where found it?
 
I think i got a better idea...
Should be possible create a physcall spell area for monk attack to train everybody in area?
It's work?
It's possible?
 
If create a pshyc area spell should train defense?
Any experient in tibia know about it?

And i making right?
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Monk" nameDescription="a monk" race="blood" experience="200" speed="200" manacost="600">
   <health now="240" max="240"/>
   <look type="57" corpse="6080"/>
   <targetchange interval="4000" chance="10"/>
   <flags>
       <flag summonable="1"/>
       <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="0"/>
   </flags>
   <attacks>
       <attack name="melee" interval="2000" skill="5" attack="10"/>
       <attack name="physical" interval="2000" chance="50" range="1" radius="2" target="1" min="0" max="0">
           <attribute key="shootEffect" value="physical"/>
           <attribute key="areaEffect" value="14"/>
       </attack>
   </attacks>
   <defenses armor="30" defense="30">
       <defense name="healing" interval="500" chance="15" min="30" max="50">
           <attribute key="areaEffect" value="blueshimmer"/>
       </defense>
       <defense name="speed" interval="2000" chance="15" speedchange="300" duration="5000">
           <attribute key="areaEffect" value="redshimmer"/>
       </defense>
   </defenses>
   <elements>
       <element holyPercent="50"/>
       <element deathPercent="50"/>
       <element physicalPercent="-10"/>
   </elements>
   <immunities>
       <immunity invisible="1"/>
   </immunities>
   <voices interval="5000" chance="10">
       <voice sentence="Repent Heretic!"/>
       <voice sentence="A prayer to the almighty one!"/>
       <voice sentence="I will punish the sinners!"/>
   </voices>
   <loot>
       <item id="2148" countmax="18" chance="15000"/><!-- gold coin -->
       <item id="2689" chance="20000"/><!-- bread -->
       <item id="1949" chance="2000"/><!-- scroll -->
       <item id="2044" chance="880"/><!-- lamp -->
       <item id="10563" chance="4930"/><!-- Book of Prayers -->
       <item id="2015" chance="820"/><!-- brown flask -->
       <item id="12448" chance="2950"/><!-- rope belt -->
       <item id="12449" chance="1001"/><!-- safety pins -->
       <item id="2401" chance="440"/><!-- staff -->
       <item id="2177" chance="1002"/><!-- life crystal -->
       <item id="2193" chance="2240"/><!-- ankh -->
       <item id="2166" chance="100"/><!-- power ring -->
   </loot>
</monster>
 
If there is insufficient space for the summons and/or monsters you may generate errors in console.

You may have to fiddle around with some custom "isPathable" function if you want to check if it's possible to summon the creatures before doing so.

Good luck.
Code:
<talkaction words="/train" script="script_name.lua"/>
Code:
local mana_required = 600
local level_required = 27 -- Level required to use talkaction.
local vocations_allowed = {1, 2, 5, 6, 9, 10}
local max_summons = 2

local training_summon = "Monk"
local training_monsters = "Rat"

function onSay(cid, words, param, channel)
    local pos = getThingPos(cid)
    if not isInArray(vocations_allowed, getPlayerVocation(cid)) then
        doSendMagicEffect(pos, CONST_ME_POFF)
        doPlayerSendCancel(cid, "Your vocation cannot summon creatures!")
        return true
    end
    if getPlayerLevel(cid) < level_required then
        doSendMagicEffect(pos, CONST_ME_POFF)
        doPlayerSendCancel(cid, "Your level is insufficient to use this skill!")
        return true
    end
    if getCreatureSummons(cid) >= max_summons then
        doSendMagicEffect(pos, CONST_ME_POFF)
        doPlayerSendCancel(cid, "You already have the maximum amount of summons!")
        return true
    end
    if getCreatureMana(cid) < mana_required then
        doSendMagicEffect(pos, CONST_ME_POFF)
        doPlayerSendCancel(cid, "You do not have enough mana!")
        return true
    end
    doCreatureSay(cid, "Utevo Res \"Monk", TALKTYPE_ORANGE_1)
    doSummonMonster(training_summon:lower(), pos)
    doCreateMonster(training_monsters:lower(), pos)
    doCreateMonster(training_monsters:lower(), pos)
    return true
end
 
Last edited:
Reading back on this, you'll want to add this to the bottom as well.
Seems I forgot to add it in.

doCreatureAddMana(cid, -mana_required)
doPlayerAddSpentMana(cid, mana_required)
 
Back
Top