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

Lua Help needed... Spell doesn't want to work the way I'd love it to work :D

Blue Identity

Member
Joined
Feb 20, 2009
Messages
174
Reaction score
15
Location
Netherlands
Dear anyone, :)

I'm fighting with this script for half a day and still it doesn't do the thinks I'd like it to do. So here I am asking any of you for help! [TFS 0.4]

This is the lua I have so far:
Code:
--[[ Spell by Shawak - Wolf transform ]]--
 
local time = 30 * 1000 -- 120 * 1000 = 30 seconds
local addShielding = 80 -- how much shielding should be added
local addFist = 120 -- how much shielding should be added
 
 
local tiger = {lookType = 125, lookHead = 0, lookBody = 0, lookLegs = 0, lookFeet = 0, lookTypeEx = 0, lookAddons = 0}
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_BLUE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)
 
local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, time)
setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, addShielding)
setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, 140)
setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)
setCombatCondition(combat, condition)
 
local speed = createConditionObject(CONDITION_HASTE)
setConditionParam(speed, CONDITION_PARAM_TICKS, time)
setConditionFormula(speed, 1.0, -100, 1.0, -100)
setCombatCondition(combat, speed)
 
local outfit = createConditionObject(CONDITION_OUTFIT)
setConditionParam(outfit, CONDITION_PARAM_TICKS, time)
addOutfitCondition(outfit, tiger)
setCombatCondition(combat, outfit)
 
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, 1)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, 30000)
setCombatCondition(combat, exhaust)
 
function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end

What happents now: You change into a Tiger and get the amout of fist and shielding skills and the speed i've set for the amout of time I wanted. But I cannot use any kind of healing spell like "exura gran / exana mort or exura vita".

What I would like to get: Is this script but working in a way that ones you use the spell you turn into a Tiger, get the fist and shielding skill and speed added BUT also be able to use "healing spells and potions"... This means no attack spells or runes.


Please help me with this cause im lost! :p

Thanks, Rep++
 
Last edited:
Problem solved! Credits go to Cykotitan for helping me solve this problem and come up with ideas.

Changed:
Code:
exhaustion="15000"
Into:
Code:
exhaustion="2000"

On Spells.XML

I tought the exhaustion was as a cooldown for the spell but it wasn't... So also we added the next part to give the spell a 5 minutes cooldown.
Code:
function onCastSpell(cid, var)
        if exhaustion.check(cid, 30000) == false then
                exhaustion.set(cid, 30000, 300)
                return doCombat(cid, combat, var)
        else
                doPlayerSendCancel(cid, "Cooldown..[" ..exhaustion.get(cid, 30000).."]")
        end
end

Thanks for the help!
 
Back
Top