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

Spell com delay

massuco

Brazilian, sorry for my bad english XD
Joined
Feb 17, 2013
Messages
199
Solutions
8
Reaction score
22
Location
Brasil
First, Im using OTHIRE 0.3
I have this spell:

Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)

local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)

function onCastSpell(cid, var)
doCreatureSay(cid, 'DEATH AND DOOM', TALKTYPE_ORANGE_1)

    return doCombat(cid, combat, var)
end

This is spell will be used by one monster, and I want that, the monster say DEATH AND DOOM and after 5 seconds, he cast the spell, but dont know how I do this.

This is a spell for GazHaragoth, BUT, for version 7.7, then I cant use the scripts that already exist.
 
Solution
Perfect!
and on monster.xml, I have a chance of the monster cast the spell, like this:
Lua:
<attack name="death_and_doom" chance="10" min="-1000" max="-1000"/>

I can do one interval for the monster cast this spell?
example, every 5 minutes, the monster have a chance of 10% that cast the spell
You can't anymore in OTHIRE, it's now hardcoded to work as in real Tibia. You can do with a creaturescript though.
I'm terrible with spells.. but I'd try something like this
Lua:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_ENERGYHIT)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGY)
local area = createCombatArea(AREA_SQUARE1X1)
setCombatArea(combat, area)

local function delaySpell(cid, combat var)
   if not isCreature(cid) then
       return false
   end
   return doCombat(cid, combat, var)
end
function onCastSpell(cid, var)
   doCreatureSay(cid, 'DEATH AND DOOM', TALKTYPE_ORANGE_1)
   addEvent(delaySpell, 5000, cid, combat, var)
   return true
end

zzz can't edit post.
But you should post this kind of stuff over in Support
Support
 
Last edited by a moderator:
Perfect!
and on monster.xml, I have a chance of the monster cast the spell, like this:
Lua:
<attack name="death_and_doom" chance="10" min="-1000" max="-1000"/>

I can do one interval for the monster cast this spell?
example, every 5 minutes, the monster have a chance of 10% that cast the spell

Ah, and, when the monster say DEATH AND DOOM, and after the 5 seconds, if the monster walk for other sqm, the spell is casted where the monster said DEATH AND DOOM, I want the spell on the sqm of the monster
 
Last edited by a moderator:
Perfect!
and on monster.xml, I have a chance of the monster cast the spell, like this:
Lua:
<attack name="death_and_doom" chance="10" min="-1000" max="-1000"/>

I can do one interval for the monster cast this spell?
example, every 5 minutes, the monster have a chance of 10% that cast the spell
You can't anymore in OTHIRE, it's now hardcoded to work as in real Tibia. You can do with a creaturescript though.
 
Solution
which part did you edit here peonso? so we can't revert that to allow intervals of it's not that easy?
Monsters interval to cast spells is based on a lot of factors, if monster is fleeing or not, if it's ranged or melee, distance form target, if target is reachable or not, and that is handled through sources, ignoring any sort of monster xml file setting.
 
Monsters interval to cast spells is based on a lot of factors, if monster is fleeing or not, if it's ranged or melee, distance form target, if target is reachable or not, and that is handled through sources, ignoring any sort of monster xml file setting.
but what about i don't know if it the same, but othire can handle a spell that handle 2 effects like 8.x servers that have spells with 3 or 4 effects in just one spell? or a monster
 
Back
Top