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

Custom Combo Monster Attack!

zezin009

Member
Joined
May 30, 2019
Messages
49
Reaction score
24
Hello everyone!

These days I read about monsters making combos, like it used to be in the old days. I took myself the challenge of find how to make it works!

I guess there is a way to do it in the sources files, but I wasn't deep into it. Instead, I found a way to put it in a single attack of the monsters. It means that if you want give to every creature the chance to make combos, it would be necessary to do it for every single of them.

But! I'll share how to do it anyway, maybe this could be a good strategy for specific creatures or bosses


Let's begin. Inside the paste /data/spells/scripts you create a new spell, such as monster_spell.xml, and you going to write something like this:
Lua:
function onCastSpell(cid, var)
local count = 0
while (count < math.random(0,5)) do
    local i = math.random(1,2)
    if i == 1 then
    addEvent(doTargetCombatHealth, count*200, cid, getCreatureTarget(cid), COMBAT_HOLYDAMAGE, -10, -30, 3)
    addEvent(doSendDistanceShoot, count*200, getCreaturePosition(cid), getCreaturePosition(getCreatureTarget(cid)), 2)
    end
    if i == 2 then
    addEvent(doTargetCombatHealth, count*200, cid, getCreatureTarget(cid), COMBAT_FIREDAMAGE, -100, -300, 5)
    addEvent(doSendDistanceShoot, count*200, getCreaturePosition(cid), getCreaturePosition(getCreatureTarget(cid)), 3)
    end
    count = count+1
end
end
In other words, a number between 0 ~ 5 will be sorted, let's say 4!
Then, the 'while' loop will run 4 times and the damage will happen 4 times! Bam, -20, -160, -27, -18!
I make it with 'addEvent' to give the impression that the creature is doing this very quickly, instead of look like a single attack...
Also, there's an another math.radom(1,2) if you want to combo 2 different attacks! Then you should use a variable to choose between 1 to 2 and use 'if' conditions to set up the differents attacks.

Well, the least but most important, in your specifc creature, suppose 'hunter.xml' for example, you shoud add the following line into the attacks:
XML:
<attack type="instant" name="Slayer Combo" interval="2000" chance="100"/>

Well, that's it! Have fun and please REP+
 
Just forgot one small step. You must declare your monster spell in spells.xml, inside the directory /data/spells. And will be something like this

XML:
<instant name="Slayer Combo" words="blablablablabla123456" casterTargetOrDirection="1" range="7" exhaustion="2000" event="script" value="monsters/poison serpent.lua"> </instant>

Keep in mind that the words for this spells must be something really unpredictible and also, impossible to guess it
 
Back
Top