sn3ejk
This account is inactive.
- Joined
- Nov 16, 2011
- Messages
- 2,121
- Solutions
- 1
- Reaction score
- 145
[Weapons]
Bonebreaker
Bonebreaker
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: