Ranyo13
ManCausingMayhem
- Joined
- Aug 22, 2009
- Messages
- 981
- Reaction score
- 38
Hello otlanders,
I got a huge problem with my freeze rune.. Well i fixed it so you cant use it on people in pz but you can use it from pz like someone is outta pz you use it on him while your in pz.. Plus the cooldown is not working.. I want some scripter or someone to help me with this! Heres the script!
Rep++ if you completely help me with this!
Thanks in advance,
Ranyo13
I got a huge problem with my freeze rune.. Well i fixed it so you cant use it on people in pz but you can use it from pz like someone is outta pz you use it on him while your in pz.. Plus the cooldown is not working.. I want some scripter or someone to help me with this! Heres the script!
Code:
local freezetime = 10
local cooldown = 60 -- time to use again
local storage = 19002
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_SUBID, 1)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, -1)
setCombatCondition(combat, exhaust)
local exhaustt = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaustt, CONDITION_PARAM_SUBID, 2)
setConditionParam(exhaustt, CONDITION_PARAM_TICKS, -1)
setCombatCondition(combat, exhaustt)
function countDown(number, pos, effect, msgonend, effectonend)
local n = number
for i = 1, number do
addEvent(doSendAnimatedText,i* 1000, pos, n > 1 and n.."" or msgonend .."", n < 6 and TEXTCOLOR_RED or TEXTCOLOR_GREEN)
addEvent(doSendMagicEffect,i* 1000, pos, n > 1 and effect or effectonend )
n = n -1
end
n = number
return true
end
function removed(cid)
doCreatureSetNoMove(cid, 0)
doRemoveCondition(cid,CONDITION_EXHAUST,1)
doRemoveCondition(cid,CONDITION_EXHAUST,2)
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if exhaustion.get(cid,storage) then
return doPlayerSendCancel(cid,"You can't use this yet.")
end
if not isPlayer(itemEx.uid) or cid == itemEx.uid then
return doPlayerSendCancel(cid,"You can only use this on players.")
end
if getTilePzInfo(toPosition) == true then
return doPlayerSendCancel(cid, "Sorry, not possible.")
end
doSendAnimatedText(getThingPos(itemEx.uid),"Frozen!", TEXTCOLOR_BLUE)
exhaustion.set(cid,storage,cooldown)
doCombat(cid, combat, numberToVariant(itemEx.uid))
doCreatureSetNoMove(itemEx.uid, 1)
countDown(freezetime , toPosition, 0, "melted", 5)
addEvent(removed,freezetime*1000,itemEx.uid)
return true
end
Thanks in advance,
Ranyo13
Last edited: