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

My shitty cleave in .lua

bergamoth

Member
Joined
Jul 26, 2021
Messages
24
Solutions
2
Reaction score
14
Hello! I'm a noob that is slowly learning how to do stuff here.

I tryed really hard to find some "cleave" scripts for my 2handed weapons but cound't find a good way, so i decided to do it myself like a troglodyte.

Here's the result!


Lua:
-- Two Handed Sword
local dawnportWeapon = Weapon(WEAPON_SWORD)

local area = createCombatArea({
     {0, 1, 0},
     {1, 3, 1},
     {0, 1, 0}
 })

local combat = Combat()
combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_STABDAMAGE)
combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WHIRLWINDSWORD)
combat:setParameter(COMBAT_PARAM_BLOCKARMOR, true)
combat:setParameter(COMBAT_PARAM_BLOCKSHIELD, true)
combat:setFormula(COMBAT_FORMULA_SKILL, 1, 0, 1, 0)
combat:setArea(area)



dawnportWeapon.onUseWeapon = function(player, variant)
    return combat:execute(player, variant)
end

dawnportWeapon:id(2377)
dawnportWeapon:level(20)
dawnportWeapon:range(1)
dawnportWeapon:register()

It actually works! That surprised me a lot. Feel free to use and edit it as you see fit!

You add this garbage in the data/scripts/weapons folder and remove the item inside the unscripted_weapons.lua

Btw, if any1 find flaws in it feel free to criticize and help me improve this piece of shit.

Thanks <3
 
Last edited:
I didn't have a chance to actually see how it works on Tibia nor I can't test the script (but I do understand what it's supposed to do based on it)
I wanted to thank you for sharing your implementation of this feature and to cheer you up, amazing work, keep it up dude!
 
Back
Top