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

Freeze GEM

Luciano

Member
Joined
Feb 18, 2010
Messages
998
Reaction score
24
I need a script.
The Freeze GEM.
How it works?
A player X use the freeze GEM on player Y.
player Y cant move, heal, use spell, or say anything for 3 secs (configurable) and each 1 sec apear the efect 41.
after 3 secs he can heal, spell everything again ;P thanks
rep+++
 
hm strange... when i do /reload spells it gives "monsters " errors on putty - and too much - so i cant see spells one :S
 
Yup but what about uh, sd etc.. That is why i made this script to include runes too

actions/scripts/script.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreatureNoMove(cid) then
		local runes = {
			2268,
			2273
		}
		if isInArray(runes, item.itemid) then
			return doPlayerSendCancel(cid, "Sorry, you are frozen.")
		end
	end
	
	return false
end

actions/scripts/script.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        local time
	time = 1 * 60
	if isPlayer(itemEx.uid) then
		if getCreatureNoMove(itemEx.uid) then
			return
		else
			doMutePlayer(itemEx.uid, time)
			addEvent(function() doCreatureSetNoMove(itemEx.uid, cannotMove) end, time)
		end
	else
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
	
	return true
end

creaturescripts/scripts/script.lua
Code:
function onAttack(cid, target)
	if getCreatureNoMove(cid) then
		return doPlayerSendCancel(cid, "Sorry, you may not attack while frozen.")
	end
	
	return false
end
 
actions/scripts/script.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreatureNoMove(cid) then
		local runes = {
			2268,
			2273
		}
		if isInArray(runes, item.itemid) then
			return doPlayerSendCancel(cid, "Sorry, you are frozen.")
		end
	end
	
	return false
end

actions/scripts/script.lua
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        local time
	time = 1 * 60
	if isPlayer(itemEx.uid) then
		if getCreatureNoMove(itemEx.uid) then
			return
		else
			doMutePlayer(itemEx.uid, time)
			addEvent(function() doCreatureSetNoMove(itemEx.uid, cannotMove) end, time)
		end
	else
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
	
	return true
end

creaturescripts/scripts/script.lua
Code:
function onAttack(cid, target)
	if getCreatureNoMove(cid) then
		return doPlayerSendCancel(cid, "Sorry, you may not attack while frozen.")
	end
	
	return false
end

could u give me the actions.xml etcs code?
 
could u give me the actions.xml etcs code?

Edit the number's in RED.

#1 actions.xml
Code:
<action itemid="[COLOR="red"]2268;2273[/COLOR]" event="script" value="script.lua"/>

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getCreatureNoMove(cid) then
		local runes = {
			2268,
			2273
		}
		if isInArray(runes, item.itemid) then
			return doPlayerSendCancel(cid, "Sorry, you are frozen.")
		end
	end
	
	return false
end

#2 actions.xml
Code:
<action itemid="[COLOR="red"]1234[/COLOR]" event="script" value="script.lua"/>

#3 creaturescripts.xml
Code:
<event type="attack" name="FrozenAttack" event="script" value="script.lua"/>

login.lua
Code:
registerCreatureEvent(cid, "FrozenAttack")
 
Hello again - ill test that as fast as possible - btw how can i add so ppl with BATLE cant use this?
Code:
local cfg = {
	time = 10, -- Time the teleport is open.
	exhausted = 60, -- Time you are exhausted.
	storage = 1337, -- Storage used for "exhaust."
	to = { x = 1000, y = 1000, z = 7 } -- Where the teleport takes you.
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerStorageValue(cid, cfg.storage) > os.time()) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, cfg.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, cfg.storage) - os.time()) == 1 and "" or "s") .. " to create another teleport.")
	elseif(getTilePzInfo(getCreaturePosition(cid)) == true) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You cannot create a teleport in a protection zone.")
	elseif(hasProperty(getThingFromPos(toPosition).uid, CONST_PROP_BLOCKSOLID) == true) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You cannot create a teleport here.")
	else
		local function deleteTeleport()
			local teleport = getTileItemById(toPosition, 1387).uid
			if(teleport > 0) then
				doRemoveItem(teleport)
				doSendMagicEffect(toPosition, CONST_ME_POFF)
				doSendAnimatedText(toPosition, "Closed", TEXTCOLOR_RED)
			end
			return true
		end
		for x = 1, cfg.time do
		local n = cfg.time - x
			addEvent(doSendAnimatedText, x * 1000, toPosition, n > 0 and tostring(n), TEXTCOLOR_WHITE)
		end
		doCreateTeleport(1387, cfg.to, toPosition)
		doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA)
		addEvent(deleteTeleport, cfg.time * 1000)
		setPlayerStorageValue(cid, cfg.storage, os.time() + cfg.exhausted)
	end
	return true
end
 
@1,005,268
Runes are registered in spells.xml, so it's likely to conflict and not work.

@previous
Lua:
local cfg = {
	time = 10, -- Time the teleport is open.
	exhausted = 60, -- Time you are exhausted.
	storage = 1337, -- Storage used for "exhaust."
	to = { x = 1000, y = 1000, z = 7 } -- Where the teleport takes you.
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	toPosition.stackpos = 0
	if(getPlayerStorageValue(cid, cfg.storage) > os.time()) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You must wait another " .. getPlayerStorageValue(cid, cfg.storage) - os.time() .. ' second' .. ((getPlayerStorageValue(cid, cfg.storage) - os.time()) == 1 and "" or "s") .. " to create another teleport.")
	elseif(hasCondition(cid, CONDITION_INFIGHT)) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You cannot create a teleport while in fight.")
	elseif(getTilePzInfo(getCreaturePosition(cid))) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You cannot create a teleport in a protection zone.")
	elseif(hasProperty(getThingFromPos(toPosition).uid, CONST_PROP_BLOCKSOLID) == true) then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You cannot create a teleport here.")
	else
		local function deleteTeleport()
			local teleport = getTileItemById(toPosition, 1387).uid
			if(teleport > 0) then
				doRemoveItem(teleport)
				doSendMagicEffect(toPosition, CONST_ME_POFF)
				doSendAnimatedText(toPosition, "Closed", TEXTCOLOR_RED)
			end
			return true
		end
		for x = 1, cfg.time do
			local n = cfg.time - x
			addEvent(doSendAnimatedText, x * 1000, toPosition, n > 0 and tostring(n), TEXTCOLOR_WHITE)
		end
		doCreateTeleport(1387, cfg.to, toPosition)
		doSendMagicEffect(toPosition, CONST_ME_ENERGYAREA)
		addEvent(deleteTeleport, cfg.time * 1000)
		setPlayerStorageValue(cid, cfg.storage, os.time() + cfg.exhausted)
	end
	return true
end
 
Last edited:
If the freeze you trying didnt work try this..

go to action-->scripts--> create new freeze.lua[paste]
Lua:
--[[Edit]]--
local time = 4   --in seconds (time of freeze)

local storage = 1230
 
local cooldown = 60  --in seconds

--[[End]]--
 
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 doRemove(cid)
      doCreatureSetNoMove(cid, 0)
      doRemoveCondition(cid,CONDITION_EXHAUST,1)
       doRemoveCondition(cid,CONDITION_EXHAUST,2)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
local n = time
  if not exhaustion.get(cid, storage)  then
         doSendAnimatedText(getThingPos(itemEx.uid),"Freezed!", TEXTCOLOR_BLUE)
         doCombat(cid, combat, numberToVariant(itemEx.uid))
         doCreatureSetNoMove(itemEx.uid, 1)
         addEvent(doRemove,time * 1000,itemEx.uid)
         exhaustion.set(cid, storage, cooldown)
		    for i = 1,time + 1 do
		         addEvent(doSendAnimatedText,i * 1000,getThingPos(itemEx.uid), ( i < time+1 and "Melt : "..n.."" or "Melted!") , i< time+1 and TEXTCOLOR_GREEN or TEXTCOLOR_RED)
                 addEvent(doSendMagicEffect,i * 1000,getThingPos(itemEx.uid),5)
			     n = n-1 
		    end
  else
    doPlayerSendCancel(cid,"Cool down : "..exhaustion.get(cid, storage).." seconds.")
 end
return true
end

then go to action.xml
Code:
<action itemid="2275" event="script" value="freeze.lua"/>
Make it an item that can be used on other stuff.
 
If your manarune is action then if you put the itemid of the manarune in that script(jdb's) and put its itemid in action.xml then you will get a duplicated itemid error
 
Back
Top