Advertisement
adrianoswatt

Elemental Weapons by Swatt

Apr 19th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. local cfg = {
  2.     [2381] = {name = "Halberd", delay = 1000, xdmg = 25, element = CONDITION_FIRE},
  3.     [2380] = {name = "Small Axe", delay = 1000, xdmg = 25, element = CONDITION_ENERGY},
  4. } -- delay = 1000 (1s) // xdmg = Dano Extra
  5.  
  6. local combat = createCombatObject()
  7. setCombatParam(combat, COMBAT_PARAM_BLOCKARMOR, 1)
  8. setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE)
  9. setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 1)
  10. setCombatFormula(combat, COMBAT_FORMULA_SKILL, 1, 0, 1, 0)
  11.  
  12. function onUseWeapon(cid, var)
  13.     weaponID = getPlayerWeapon(cid, true).itemid
  14.     get = cfg[weaponID]
  15.     if get then
  16.         local condition = createConditionObject(get.element)
  17.         setConditionParam(condition, CONDITION_PARAM_DELAYED, 1)
  18.         addDamageCondition(condition, 1, get.delay, -get.xdmg)
  19.         setCombatCondition(combat, condition)
  20.     end
  21.     return doCombat(cid, combat, var)
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement