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

2 requests.

XouruS

Active Member
Joined
Dec 29, 2009
Messages
941
Reaction score
36
Location
Canada
1. Mana shield gem
(If you use it on yourself it will cast a mesage ON/ use it again and it turns it OFF)

2. Freeze crystal
(Use on target/ stops moving/ casting spells/ using runes for 10sec.

I always rep++

Thanks in advance.

EDIT: found the freeze crystal
Code:
 local t =  
 { 
 item = xxxx ---- ID of the item you want to use 
 timemute = xx ---- How long should the player be muted 
 } 

function onUse(cid, item, fromPosition, itemEx, toPosition) 
      if item.itemid == t.item then 
     doMutePlayer(cid, t.timemute) 
     end 
  return TRUE 
  end
 
that freeze you have will only disable you not player u use on, also it wont disable runes any way here is mana shield gem :
LUA:
local storage = 10239    -- epmty storage

local shield = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(shield, CONDITION_PARAM_TICKS, -1)
function onUse(cid, item, frompos, item2, topos)
	if getPlayerStorageValue(cid,storage) < 1 then 
		doAddCondition(cid,shield)
		doSendMagicEffect(getThingPos(cid),12)
		doPlayerSendTextMessage(cid,27,"Mana shield : On.")
		setPlayerStorageValue(cid,storage,1)
	else
		doRemoveCondition(cid,CONDITION_MANASHIELD)
		doPlayerSendTextMessage(cid,27,"Mana shield : Off.")
		setPlayerStorageValue(cid,storage,-1)
	end
	return true
end
 
that freeze you have will only disable you not player u use on, also it wont disable runes any way here is mana shield gem :
LUA:
local storage = 10239    -- epmty storage

local shield = createConditionObject(CONDITION_MANASHIELD)
setConditionParam(shield, CONDITION_PARAM_TICKS, -1)
function onUse(cid, item, frompos, item2, topos)
	if getPlayerStorageValue(cid,storage) < 1 then 
		doAddCondition(cid,shield)
		doSendMagicEffect(getThingPos(cid),12)
		doPlayerSendTextMessage(cid,27,"Mana shield : On.")
		setPlayerStorageValue(cid,storage,1)
	else
		doRemoveCondition(cid,CONDITION_MANASHIELD)
		doPlayerSendTextMessage(cid,27,"Mana shield : Off.")
		setPlayerStorageValue(cid,storage,-1)
	end
	return true
end

Works great, can you make me the freeze crystal?

Repped
 
that is the most i can do in a lua way, it prevent spells,runes(spell runes, in spell folder) , freeze player.

LUA:
local freezetime = 4    

local cooldown = 10   -- 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 another players.")
	end
	
	doSendAnimatedText(getThingPos(itemEx.uid),"Freezed!", 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)
	doRemoveItem(item.uid,1)
	return true
end
 
that is the most i can do in a lua way, it prevent spells,runes(spell runes, in spell folder) , freeze player.

LUA:
local freezetime = 4    

local cooldown = 10   -- 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 another players.")
	end
	
	doSendAnimatedText(getThingPos(itemEx.uid),"Freezed!", 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)
	doRemoveItem(item.uid,1)
	return true
end

works great!
rep+ again.
 
Back
Top