• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

Action Mana Rune by Actions

Rodo

New Member
Joined
Oct 23, 2007
Messages
575
Solutions
1
Reaction score
3
Location
Mexico
This mana rune by action is usefull if you wanna customize effects, MIN, MAX, use it or no in protection zone, give pz or no or throw it to another players :thumbup:

Lua:
local MIN = 100
local MAX = 120
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

function onUse(cid, item, fromPosition, itemEx, toPosition)

  if(hasCondition(cid, CONDITION_EXHAUST)) then
     doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
     return true
  end


  if isPlayer(itemEx.uid) == FALSE then
    return false
  end
  
  if (getTileInfo(getCreaturePosition(cid)).protection) then
    doPlayerSendCancel(cid, "You cannot use mana runes in protection zones.")
    return TRUE
  end
  
  
  if doPlayerAddMana(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
    return FALSE
  end
  
  doAddCondition(cid, exhaust)
  doSendMagicEffect(getThingPos(itemEx.uid), 29)
  doChangeTypeItem(item.uid,item.type-1)

  return TRUE
  end
 
something like this
Lua:
local config = {
		MIN =  100,
		MAX = 120,
		use_in_pz = true;
		};
				
local exhaust = createConditionObject(CONDITION_EXHAUST);
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100));

function onUse(cid, item, fromPosition, itemEx, toPosition)
  if(hasCondition(cid, CONDITION_EXHAUST)) then
     return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED);    
  end
  if (getTileInfo(getCreaturePosition(cid)).protection and not config.use_in_pz) then
    return doPlayerSendCancel(cid, "You cannot use mana runes in protection zones.");
  end
  if (not isPlayer(itemEx.uid))
	return doPlayerSendCancel(cid, "You can use this rune only on other players.");
  end
  if (not doPlayerAddMana(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR) then
	doAddCondition(cid, exhaust);
	doSendMagicEffect(getThingPos(itemEx.uid), 29);
	doChangeTypeItem(item.uid,item.type-1);
  end
  return true;
end
 
Very Good Easy Manarune =) =)

Very Good Easy Mana Rune =) Very Good you can use this in pz and outside

local config = {
MIN = 100,
MAX = 120,
use_in_pz = false;
};

local exhaust = createConditionObject(CONDITION_EXHAUST);
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100));

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(hasCondition(cid, CONDITION_EXHAUST)) then
return doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED);
end
if (getTileInfo(getCreaturePosition(cid)).protection and not config.use_in_pz) then
return doPlayerSendCancel(cid, "You can use mana runes in protection zones and outside from protection zone.");
end
if (not isPlayer(itemEx.uid))
return doPlayerSendCancel(cid, "You can use this rune only on other players.");
end
if (not doPlayerAddMana(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR) then
doAddCondition(cid, exhaust);
doSendMagicEffect(getThingPos(itemEx.uid), 29);
doChangeTypeItem(item.uid,item.type-1);
end
return true;
end
 
i will send to u the best
Code:
local MIN = 5000
local MAX = 5000
local EMPTY_RUNE = 2300

local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 1))

function onUse(cid, item, fromPosition, itemEx, toPosition)
if isPlayer(itemEx.uid) == FALSE then
return FALSE
end

if hasCondition(cid, CONDITION_EXHAUST_HEAL) == true then
doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)
return true
end



if doPlayerAddMana(itemEx.uid, math.random(MIN, MAX)) == LUA_ERROR then
return FALSE
end

doAddCondition(cid, exhaust)
                  doSendMagicEffect(getCreaturePosition(cid), CONST_ME_SLEEP)
doCreatureSay(itemEx.uid, "first manarune... ", TALKTYPE_ORANGE_1)
doTransformItem(item.uid, EMPTY_POTION)
return TRUE
end
if it's work please rep++ for me :D
 
Back
Top