God Dunckan Nivel 4
Mensajes : 67 Puntos : 192 Reputación : 22 Fecha de inscripción : 03/05/2011
| Tema: Spells Shot Blaster 2.0 Miér Mayo 11, 2011 8:14 pm | |
| jeej bueno hace tiempo que hice este spell pero ahora lo he mejorado acortando el script y usando una formula basada en los skills, lvl, arma y municion! este spell es el mas avanzado de los paladines para mi servidor! Nombre: Shot Blaster Vocacion: Paladin Tipo: Instantaneo Descripcion: El paladin usa una cantidad especifica de flechas (24 por defecto, debe estar equipadas) para dispararlas en un radio de 6x6 circular, variando su daño y elemento dependiendo de la municion equipada - Código:
-
local amount = 24 local ammunition = { [2544] = {dfx = CONST_ANI_ARROW}, [7364] = {dfx = CONST_ANI_SNIPERARROW}, [7365] = {dfx = CONST_ANI_ONYXARROW}, [2543] = {dfx = CONST_ANI_BOLT}, [7363] = {dfx = CONST_ANI_PIERCINGBOLT}, [2547] = {dfx = CONST_ANI_POWERBOLT}, [6529] = {dfx = CONST_ANI_INFERNALBOLT}, [7838] = {dfx = CONST_ANI_FLASHARROW, efx = CONST_ME_ENERGYHIT, id = 2}, [7839] = {dfx = CONST_ANI_SHIVERARROW, efx = CONST_ME_ICEATTACK, id = 3}, [7840] = {dfx = CONST_ANI_FLAMMINGARROW, efx = CONST_ME_FIREATTACK, id = 4}, [7850] = {dfx = CONST_ANI_EARTHARROW, efx = CONST_ME_SMALLPLANTS, id = 5} } local arr = { {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 2, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0}, {0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0}, {0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, } function onGetFormulaValues(cid, level, skill, attack, factor) local skill = getPlayerSkillLevel(cid, 4) return -(((skill + attack) / 1.5) * (level / 22)), -((skill + attack) * (level / 22)) end local combat = {} for i = 1, 5 do combat[i] = createCombatObject() setCombatParam(combat[i], COMBAT_PARAM_EFFECT, CONST_ME_NONE) setCombatArea(combat[i], createCombatArea(arr)) _G["onGetFormulaValues" .. i] = onGetFormulaValues setCombatCallback(combat[i], CALLBACK_PARAM_SKILLVALUE, "onGetFormulaValues" .. i) end setCombatParam(combat[1], COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatParam(combat[2], COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE) setCombatParam(combat[3], COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatParam(combat[4], COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat[5], COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE) function onCastSpell(cid, var) local slot = getPlayerSlotItem(cid, CONST_SLOT_AMMO) local pPos, ammo = getCreaturePosition(cid), ammunition[slot.itemid] if(ammo) and(doRemoveItem(slot.uid, amount)) then animationShoot = ammo.dfx if isInArray({7838, 7839, 7840, 7850}, slot.itemid) then animationHit = ammo.efx id = ammo.id else animationHit = CONST_ME_HITAREA id = 1 end local poss = { {x=pPos.x-4, y=pPos.y, z=pPos.z}, {x=pPos.x-4, y=pPos.y-1, z=pPos.z}, {x=pPos.x-4, y=pPos.y-2, z=pPos.z}, {x=pPos.x-3, y=pPos.y-3, z=pPos.z}, {x=pPos.x-2, y=pPos.y-4, z=pPos.z}, {x=pPos.x-1, y=pPos.y-4, z=pPos.z}, {x=pPos.x, y=pPos.y-4, z=pPos.z}, {x=pPos.x+1, y=pPos.y-4, z=pPos.z}, {x=pPos.x+2, y=pPos.y-4, z=pPos.z}, {x=pPos.x+3, y=pPos.y-3, z=pPos.z}, {x=pPos.x+4, y=pPos.y-2, z=pPos.z}, {x=pPos.x+4, y=pPos.y-1, z=pPos.z}, {x=pPos.x+4, y=pPos.y, z=pPos.z}, {x=pPos.x+4, y=pPos.y+1, z=pPos.z}, {x=pPos.x+4, y=pPos.y+2, z=pPos.z}, {x=pPos.x+3, y=pPos.y+3, z=pPos.z}, {x=pPos.x+2, y=pPos.y+4, z=pPos.z}, {x=pPos.x+1, y=pPos.y+4, z=pPos.z}, {x=pPos.x, y=pPos.y+4, z=pPos.z}, {x=pPos.x-1, y=pPos.y+4, z=pPos.z}, {x=pPos.x-2, y=pPos.y+4, z=pPos.z}, {x=pPos.x-3, y=pPos.y+3, z=pPos.z}, {x=pPos.x-4, y=pPos.y+2, z=pPos.z}, {x=pPos.x-4, y=pPos.y+1, z=pPos.z} } for i = 1, #poss do doSendDistanceShoot(pPos, poss[i], animationShoot) doSendMagicEffect(poss[i], animationHit) end doCombat(cid, combat[id], var) else doPlayerSendCancel(cid, "You need ".. amount .." of ammunition in your arrow slot") doSendMagicEffect(pPos, CONST_ME_POFF) return LUA_ERROR end return true end Espero Y Les Aiiga Gustado creditos Exidion 99% y 1 % por traerlo bye | |
|