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

[8.4]Problem with spells ;S

kret

K R E T O W N A G E
Joined
Apr 4, 2008
Messages
947
Reaction score
6
Location
PяOLAND
On other forum i found spells from tibia 8.4


Code:
local fistskill = getPlayerSkill(cid, 0)
local clubskill = getPlayerSkill(cid, 1)
local swordskill = getPlayerSkill(cid, 2)
local axeskill = getPlayerSkill(cid, 3)
local distskill = getPlayerSkill(cid, 4)
local shieldskill = getPlayerSkill(cid, 5)

local upskill = shieldskill/2
local downskill1 = clubskill/2
local downskill2 = swordskill/2
local downskill3 = axeskill/2


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition2 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition2, CONDITION_PARAM_TICKS, 10000)
setConditionParam(condition2, CONDITION_PARAM_SKILL_CLUB, -downskill1)
setConditionParam(condition2, CONDITION_PARAM_SKILL_SWORD, -downskill2)
setConditionParam(condition2, CONDITION_PARAM_SKILL_AXE, -downskill3)
setConditionParam(condition2, CONDITION_PARAM_SKILL_SHIELD, upskill)
setCombatCondition(combat, condition2)


function onCastSpell(cid, var)
	local ret = LUA_ERROR
	if(doCombat(cid, combat, var) == LUA_NO_ERROR) then
		ret = LUA_NO_ERROR
	end
	return ret
end

and the Blood Rage spell... just a little edit:

Code:
local fistskill = getPlayerSkill(cid, 0)
local clubskill = getPlayerSkill(cid, 1)
local swordskill = getPlayerSkill(cid, 2)
local axeskill = getPlayerSkill(cid, 3)
local distskill = getPlayerSkill(cid, 4)
local shieldskill = getPlayerSkill(cid, 5)
local upskill = shieldskill/2
local downskill1 = clubskill/2
local downskill2 = swordskill/2
local downskill3 = axeskill/2


local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition2 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition2, CONDITION_PARAM_TICKS, 10000)
setConditionParam(condition2, CONDITION_PARAM_SKILL_CLUB, downskill1)
setConditionParam(condition2, CONDITION_PARAM_SKILL_SWORD, downskill2)
setConditionParam(condition2, CONDITION_PARAM_SKILL_AXE, downskill3)
setConditionParam(condition2, CONDITION_PARAM_SKILL_SHIELD, -upskill)
setCombatCondition(combat, condition2)


function onCastSpell(cid, var)
	local ret = LUA_ERROR
	if(doCombat(cid, combat, var) == LUA_NO_ERROR) then
		ret = LUA_NO_ERROR
	end
	return ret
end

Charge Spell for knights

Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 8000)
setConditionFormula(condition, 0.7, -24, 0.7, -24)
setCombatCondition(combat, condition)

function onCastSpell(cid, var)
	doCombat(cid, combat, var)
end

Paladin:s Swift Foot:

Code:
local fistskill = getPlayerSkill(cid, 0)
local clubskill = getPlayerSkill(cid, 1)
local swordskill = getPlayerSkill(cid, 2)
local axeskill = getPlayerSkill(cid, 3)
local distskill = getPlayerSkill(cid, 4)
local shieldskill = getPlayerSkill(cid, 5)
local downskill1 = distskill/2
local downskill2 = shieldskill/2



local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

ocal combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat2, COMBAT_PARAM_AGGRESSIVE, 0)


local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 8000)
setConditionFormula(condition, 1.3, -24, 1.3, -24)
setCombatCondition(combat2, condition)

local condition2 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition2, CONDITION_PARAM_TICKS, 8000)
setConditionParam(condition2, CONDITION_PARAM_SKILL_DISTANCE, -downskill1)
setConditionParam(condition2, CONDITION_PARAM_SKILL_SHIELD, -downskill2)
setCombatCondition(combat, condition2)


function onCastSpell(cid, var)
	local ret = LUA_ERROR
	if(doCombat(cid, combat, var) == LUA_NO_ERROR) and (doCombat(cid, combat2, var) == LUA_NO_ERROR) then
		ret = LUA_NO_ERROR
	end
	return ret
end

Sharpshooter
Code:
local fistskill = getPlayerSkill(cid, 0)
local clubskill = getPlayerSkill(cid, 1)
local swordskill = getPlayerSkill(cid, 2)
local axeskill = getPlayerSkill(cid, 3)
local distskill = getPlayerSkill(cid, 4)
local shieldskill = getPlayerSkill(cid, 5)
local downskill1 = distskill/2
local downskill2 = shieldskill/2



local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

ocal combat2 = createCombatObject()
setCombatParam(combat2, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat2, COMBAT_PARAM_AGGRESSIVE, 0)


local condition = createConditionObject(CONDITION_HASTE)
setConditionParam(condition, CONDITION_PARAM_TICKS, 8000)
setConditionFormula(condition, -0.4, -24, -0.4, -24)
setCombatCondition(combat2, condition)

local condition2 = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition2, CONDITION_PARAM_TICKS, 8000)
setConditionParam(condition2, CONDITION_PARAM_SKILL_DISTANCE, downskill1)
setCombatCondition(combat, condition2)


function onCastSpell(cid, var)
	local ret = LUA_ERROR
	if(doCombat(cid, combat, var) == LUA_NO_ERROR) and (doCombat(cid, combat2, var) == LUA_NO_ERROR) then
		ret = LUA_NO_ERROR
	end
	return ret
end

for example im testing PROTECTOR spell (utamo tempo) and have an error
[20/12/2008 20:11:05] Lua Script Error: [Spell Interface]
[20/12/2008 20:11:05] data/spells/scripts/support/protector.lua

[20/12/2008 20:11:05] luaGetPlayerSkill(). Player not found
how to repair this ;d
 
I had that problem as well. The issue is that when it tries to set those local values, it has no idea who cid is. I fixed that by moving them down into the oncast function.

Doing that fixed the player not found error but then gave me another error saying that I cannot do any arithmetic on the numbers. This gave me the idea that the getskill was not working properly. Im stuck there.
 
Back
Top