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

Help with this functions...

Joined
Apr 17, 2008
Messages
1,922
Solutions
1
Reaction score
188
Location
Venezuela
Hello i'm making a own spell..

What I try to do is that when you have a enchanted weapon on fire in the hands, the spells will hit of fire and physical, but if you do not have any weapon enchanted on fire it will hit only physical.

Here is the script

Code:
local fireWeapons = 7750 or 7754 or 7747 or 7745 or 7746 or 7756 or 7752 or 7784 or 7758 or 7751 or 7744 or 7757 or 7749 or 7755 or 7753

function onCastSpell(cid, var)
	if getPlayerSlotItem(cid, 5) == fireWeapons then
	doCombat(cid, combatNone, var)
	doCombat(cid, combatFire, var)
else
	doCombat(cid, combatNone, var)
		end
	return TRUE
end

This only hit physical damages "WHY?"

I think is the function "getPlayerSlotItem" because it works with other functions like "getPlayerLevel" or "getPlayerMagLevel"....

"SORRY MY BAD ENGLISH"
 
Last edited:
I don't know much about spells, but you have to use
thus:
Code:
local combat1 = createCombatObject()--creating the object
--parameters
setCombatParam(combat9, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatParam(combat9, COMBAT_PARAM_EFFECT, 49)

setCombatCondition(combat1, CONDITION_FIRE ) -- condition

--for use

doCombat(cid, combat, var)
 
It is not what I want, which I want is that when you have a enchanted weapon in fire equipped, the spell will do damage in fire and physical
 
Well, I guess it will work:
Code:
local fireWeapons = 7750 or 7754 or 7747 or 7745 or 7746 or 7756 or 7752 or 7784 or 7758 or 7751 or 7744 or 7757 or 7749 or 7755 or 7753

function onCastSpell(cid, var)
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE,COMBAT_PHYSICALDAMAGE)
setCombatCondition(combat1, CONDITION_NONE)
--
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatCondition(combat2, CONDITION_FIRE)
	if getPlayerSlotItem(cid, 5) == fireWeapons then
	doCombat(cid, combat1, var)
	doCombat(cid, combat2, var)
else
	doCombat(cid, combat1, var)
		end
	return TRUE
end
 
But, is working this compare? (if getPlayerSlot ~~?)

If not, use this:

local fireWeapons = {7750 ,7754, 7747, 7745, 7746, 7756, 7752, 7784, 7758, 7751, 7744, 7757, 7749, 7755, 7753

if isInArray(fireWeapons, getPlayerSlotItem(cid, 5)) == TRUE then
 
It insn't working yet... :S

Code:
function onCastSpell(cid, var)

	if isInArray(fireWeapons, getPlayerSlotItem(cid, 5)) == TRUE then
	doCombat(cid, combatNone, var)
	doCombat(cid, combatFire, var)
else
	doCombat(cid, combatNone, var)
		end
	return TRUE
end

^ This isn't working
 
Did you try this?
Code:
local fireWeapons = {7750 ,7754, 7747, 7745, 7746, 7756, 7752, 7784, 7758, 7751, 7744, 7757, 7749, 7755, 7753}

function onCastSpell(cid, var)
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE,COMBAT_PHYSICALDAMAGE)
setCombatCondition(combat1, CONDITION_NONE)
--
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatCondition(combat2, CONDITION_FIRE)
	if isInArray(fireWeapons, getPlayerSlotItem(cid, 5)) == TRUE then
	doCombat(cid, combat1, var)
	doCombat(cid, combat2, var)
else
	doCombat(cid, combat1, var)
		end
	return TRUE
end
 
Code:
local fireWeapons = {7750 ,7754, 7747, 7745, 7746, 7756, 7752, 7784, 7758, 7751, 7744, 7757, 7749, 7755, 7753}

function onCastSpell(cid, var)
local combat1 = createCombatObject()
setCombatParam(combat1, COMBAT_PARAM_TYPE,COMBAT_PHYSICALDAMAGE)
setCombatCondition(combat1, CONDITION_NONE)
--
local combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
setCombatCondition(combat2, CONDITION_FIRE)
	if isInArray(fireWeapons, getPlayerSlotItem(cid, 5)) == TRUE then
	return doCombat(cid, combat1, var)
	return doCombat(cid, combat2, var)
else
	return doCombat(cid, combat1, var)
		end
end

And this?
 

Similar threads

Back
Top