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

Spell Shoot Blaster For Paladins! Updated Bug Fix

Exedion

Active Member
Joined
Jun 11, 2007
Messages
628
Reaction score
30
Shoot Blaster 2.0

Well this time i update again my shot blaster spell, is more optimized and reduced to much the code, now with a personal formula based in in level, skill and the current ammonution and weapon!

Lua:
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

SCREENSHOTS:






Creadits to:
Pitufo for help some time ago
Jano (i learn to much from you scripts)
And me! this is a 100% script made by me, no post in another forum please!
if feel grateful and give me some point of reputation, i return the favor!
 
Last edited:
when you create big animations like that (magic effect), you need to use loops, because this will take alot from your system.
 
hello guys i test this spell in my ot server but it dont work, anyone can help me to make work?

this is a best spells ever i seen congratulations for it

arturjuhas

send me a e-mail plz about this [email protected]
 
It takes arrows but don't shoot but write "You need 24 of ammunition in your arrow slot."
Ofc I have got the arrows.
 
@Manimecker

Try just to change
local amount = 24 to local amount = 0

if that doesn't work, try this:
change this:
Code:
[COLOR=#000000][COLOR=Black]if isInArray(ammunition, ammo.itemid)== true and doRemoveItem(ammo.uid, amount) == true then[/COLOR][COLOR=#0000bb]
[/COLOR][/COLOR]

to this:
Code:
[COLOR=#000000][COLOR=Black]if isInArray(ammunition, ammo.itemid)== true then[/COLOR][/COLOR]


 
OMG this works so amzazing

i changed this
local amount = 24 to local amount = 1

i dont have anybugs with it

Thanks very much! im working on a server and will use this 1 in it
 
OMG this works so amzazing

i changed this
local amount = 24 to local amount = 1

i dont have anybugs with it

Thanks very much! im working on a server and will use this 1 in it

if you put "1" amount will remove only 1 ammunition and don't look realistic... (spend one arrow and the spell show 24? o_O)
 
well you need change or add something... i will make your version later
 
Back
Top