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

[Weapons] Bonebreaker

sn3ejk

This account is inactive.
Joined
Nov 16, 2011
Messages
2,121
Solutions
1
Reaction score
145
[Weapons]
Bonebreaker


qaLRE.gif

When player hold bonebreaker, he creates magic field near the target after each attack. Magic field appears twice in the same position. If player touch delayed magic field, he gains 7% club fighting for 1 second.


  • ~/data/items/items.xml
    XML:
    	<item id="7428" name="bonebreaker">
    	<attribute key="weight" value="12000" />
    	<attribute key="defense" value="15" />
    	<attribute key="attack" value="46" />
    	<attribute key="range" value="2" />
    	<attribute key="weaponType" value="club" />
    	<attribute key="slotType" value="two-handed" />
    </item>
  • ~/data/weapons/weapons.xml
    XML:
    <melee id="7428" level="55" unproperly="1" event="script" value="bonebreaker.lua">
    	<vocation id="4"/>
    	<vocation id="8" showInDescription="0"/>
    </melee>
  • ~/data/weapons/scripts/bonebreaker.lua
    Lua:
    local combat = createCombatObject()
    setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
    setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, true)
    setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
    setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)
    
    local condition = createConditionObject(CONDITION_ATTRIBUTES)
    setConditionParam(condition, CONDITION_PARAM_SUBID, 4)
    setConditionParam(condition, CONDITION_PARAM_BUFF, true)
    setConditionParam(condition, CONDITION_PARAM_TICKS, 1000)
    setConditionParam(condition, CONDITION_PARAM_SKILL_CLUBPERCENT, 107)
    
    
    function onGetFormulaValues(cid, level, skill, attack, element, factor)
        return -math.ceil((2 * (attack * (skill + 5.8) / 25 + (level - 1) / 10)) / factor)
    end
    
    setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
    function onUseWeapon(cid, var)
        local ret = doCombat(cid, combat, var)
        if not ret then
            return false
        end
    
        local target = variantToNumber(var)
        if target ~= 0 then
            local pos = choose(getArea(getCreaturePosition(target), 2, 2))
            doSendMagicEffect(pos, CONST_ME_LOSEENERGY)
    
            addEvent(valid(function(cid, pos)
                if doComparePositions(getCreaturePosition(cid), pos) then
                    doSendMagicEffect(pos, CONST_ME_FIREWORK_BLUE, cid)
                    doAddCondition(cid, condition)
                else
                    doSendMagicEffect(pos, CONST_ME_FIREWORK_RED, cid)
                end
            end), 1000, cid, pos)
        end
    
        return ret
    end


_
Regards,
sn3ejk
 
Last edited:
What a really cool idea. A good incentive to hunt intelligently.

Red
 
So, this is kind of like Draven's Spinning Axe move? Nice idea!

2501r1c.gif
 
Thanks for comments. I'm glad you like it.


_
Regards,
sn3ejk
 
Cool idea. I might do something like that in future for my ot. :D
 
I like the idea, would be nice to further it by like allowing multiple weapons to use it, like axe and sword. Without multiple scripts. If player is using axe then ect..

Love it tho, I also thought of Draven instantly haha
 
Does it stack? Like if you catch 3 spots for 7% club fighting, do you get 21% and so forth? Or does it just replenish the time you have it for?
 
It looks like it wwill stack but youd have too add seconds, this effect only ladts 1 second
 
Which part would I change to make it do it after not every 1 attack, but a random attack between 3-7 times, and have the buff last for 4 seconds?

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, true)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_HITAREA)
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_WEAPONTYPE)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_SUBID, 4)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setConditionParam(condition, CONDITION_PARAM_TICKS, 1000)
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUBPERCENT, 107)


function onGetFormulaValues(cid, level, skill, attack, element, factor)
return -math.ceil((2 * (attack * (skill + 5.8) / 25 + (level - 1) / 10)) / factor)
end

setCombatCallback(combat, CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues")
function onUseWeapon(cid, var)
local ret = doCombat(cid, combat, var)
if not ret then
return false
end

local target = variantToNumber(var)
if target ~= 0 then
local pos = choose(getArea(getCreaturePosition(target), 2, 2))
doSendMagicEffect(pos, CONST_ME_LOSEENERGY)

addEvent(valid(function(cid, pos)
if doComparePositions(getCreaturePosition(cid), pos) then
doSendMagicEffect(pos, CONST_ME_FIREWORK_BLUE, cid)
doAddCondition(cid, condition)
else
doSendMagicEffect(pos, CONST_ME_FIREWORK_RED, cid)
end
end), 1000, cid, pos)
end

return ret
end

I was thinking that
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_SUBID, 4)
setConditionParam(condition, CONDITION_PARAM_BUFF, true)
setConditionParam(condition, CONDITION_PARAM_TICKS, 1000)<-----
setConditionParam(condition, CONDITION_PARAM_SKILL_CLUBPERCENT, 107)
would be how long the buff lasts? But either way, what do I change for those 2 things? How often it happens + the buff duration.
 
Greets!

May I ask what version you did this for? I would love to have it on my TFS 1.0! (Can Always try but dont have time in this very moment)

-Could it also be improved to work with EVERY melee wapon instead of putting the script INTO every weapon?
-Would it be possible to random 3 circles out on the screen for Paladins to enter? :)

(Like make a script for each "Creature" "onHit" and not a Single Weapon?
I will add this one way or Another if it works for TFS 1.0! Its an awesome script and im looking for cool features to make unique servers.

Kind Regards,
Eldin
.
 
Back
Top