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

Solved Freeze rune!

Hatsune Miku

Intermediate OT User
Joined
Jan 22, 2009
Messages
370
Reaction score
139
I need to insert this somewhere. But I don't know where and how... I wanted the frozen person to get the GroupId 8. Already made the flag for it but no idea how to write inside the script.. Halp pl0x :D

doPlayerSetGroupId(cid, group)



Lua:
local freezetime = 3
local cooldown = 20 -- time to use again
 
local storage = 19002
 
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 41)
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)
	if isPlayer(cid) then
		doCreatureSetNoMove(cid, 0)
		doRemoveCondition(cid,CONDITION_EXHAUST,1)
		doRemoveCondition(cid,CONDITION_EXHAUST,2)
	end
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doPlayerSetGroupId(cid, group)
	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 another players.")
	end
 
	doSendAnimatedText(getThingPos(itemEx.uid),"SLOW!", TEXTCOLOR_WHITE)
	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
 
Last edited:
Lua:
local freezetime = 3
local cooldown = 20 -- time to use again
local group = 8
local originalgroupid = 1
local storage = 19002
 
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 41)
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)
	if isPlayer(cid) then
		doCreatureSetNoMove(cid, 0)
		doRemoveCondition(cid,CONDITION_EXHAUST,1)
		doRemoveCondition(cid,CONDITION_EXHAUST,2)
	end
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doPlayerSetGroupId(cid, group)
        addEvent(doPlayerSetGroupId, freezetime*1000, cid, originalgroupid)
	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 another players.")
	end
 
	doSendAnimatedText(getThingPos(itemEx.uid),"SLOW!", TEXTCOLOR_WHITE)
	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
 
Lua:
local freezetime = 3
local cooldown = 20 -- time to use again
local group = 8
local originalgroupid = 1
local storage = 19002
 
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, 41)
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)
	if isPlayer(cid) then
		doCreatureSetNoMove(cid, 0)
		doRemoveCondition(cid,CONDITION_EXHAUST,1)
		doRemoveCondition(cid,CONDITION_EXHAUST,2)
	end
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	doPlayerSetGroupId(cid, group)
        addEvent(doPlayerSetGroupId, freezetime*1000, cid, originalgroupid)
	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 another players.")
	end
 
	doSendAnimatedText(getThingPos(itemEx.uid),"SLOW!", TEXTCOLOR_WHITE)
	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

But isn't that give the group id even if the attacker can't use the rune?
 
But isn't that give the group id even if the attacker can't use the rune?

What? I cannot understand what you just said. That will do exactly the same as the original script does, the only thing I added to it was setting a group id (group) and after a set amount of time (freezetime*1000) it will return the targets group id back to another group id (originalgroupid).
 
What? I cannot understand what you just said. That will do exactly the same as the original script does, the only thing I added to it was setting a group id (group) and after a set amount of time (freezetime*1000) it will return the targets group id back to another group id (originalgroupid).

You will set the group id on the target everytime that you use the rune, even if you can't use it by exhaust or whatever.
 
Doesn't seem to work :S
I don't know what the problem is :(

My groups XML:

XML:
<group id="8" name="Frozen Player" flags="13194609303557"/>

I don't get any errors.. But well.. player still gets mana.... I wonder if its cause my manarune is a action.

Solved :D
 
Last edited:
Back
Top