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

Making these fish have exhaust

  • Thread starter Thread starter Deleted member 49793
  • Start date Start date
D

Deleted member 49793

Guest
As title says, not sure if you do exhaust in the action script itself but ya make these fish have same exhaust as potions :)
Code:
local berserk = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(berserk, CONDITION_PARAM_TICKS, 60 * 1000)
setConditionParam(berserk, CONDITION_PARAM_SKILL_MELEE, 10)
setConditionParam(berserk, CONDITION_PARAM_SKILL_DISTANCE, 10)
setConditionParam(berserk, CONDITION_PARAM_SUBID, 4)
 
local magic = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(magic, CONDITION_PARAM_TICKS, 60 * 1000)
setConditionParam(magic, CONDITION_PARAM_STAT_MAGICLEVEL, 5)
setConditionParam(magic, CONDITION_PARAM_SUBID, 5)
 
local shield = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(shield, CONDITION_PARAM_TICKS, 60 * 1000)
setConditionParam(shield, CONDITION_PARAM_SKILL_SHIELD, 10)
setConditionParam(shield, CONDITION_PARAM_SUBID, 6)
 
local t = {
	[2670] = {'Munch.', hp=150, mp=150},
	[2667] = {'Munch.', hp=400, mp=400},
	[2668] = {'Munch.', hp=800},
	[7159] = {'Munch.', condition=berserk},
	[7158] = {'Munch.', condition=magic},
	[2669] = {'Munch.', condition=shield},
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local v = t[item.itemid]
	local a, b, p = v.hp or math.ceil(getCreatureMaxHealth(cid) * (v.hppc or 0) / 100), v.mp or math.ceil(getCreatureMaxMana(cid) * (v.mppc or 0) / 100), getThingPos(cid)
 
	doCreatureSay(cid, v[1], TALKTYPE_ORANGE_1)
	doRemoveItem(item.uid, 1)
 
	if a ~= 0 then
		doCreatureAddHealth(cid, a)
		doSendAnimatedText(p, '+' .. a, COLOR_GREEN)
	end
 
	if b ~= 0 then
		doCreatureAddMana(cid, b)
		doSendAnimatedText(p, '+' .. b, COLOR_PURPLE)
	end
 
	if v.condition then
		doAddCondition(cid, v.condition)
	end
 
	return true
end
 
LUA:
local exhaust = createConditionObject(CONDITION_EXHAUST)
setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') - 100))

local berserk = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(berserk, CONDITION_PARAM_TICKS, 60 * 1000)
setConditionParam(berserk, CONDITION_PARAM_SKILL_MELEE, 10)
setConditionParam(berserk, CONDITION_PARAM_SKILL_DISTANCE, 10)
setConditionParam(berserk, CONDITION_PARAM_SUBID, 4)
 
local magic = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(magic, CONDITION_PARAM_TICKS, 60 * 1000)
setConditionParam(magic, CONDITION_PARAM_STAT_MAGICLEVEL, 5)
setConditionParam(magic, CONDITION_PARAM_SUBID, 5)
 
local shield = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(shield, CONDITION_PARAM_TICKS, 60 * 1000)
setConditionParam(shield, CONDITION_PARAM_SKILL_SHIELD, 10)
setConditionParam(shield, CONDITION_PARAM_SUBID, 6)
 
local t = {
    [2670] = {'Munch.', hp=150, mp=150},
    [2667] = {'Munch.', hp=400, mp=400},
    [2668] = {'Munch.', hp=800},
    [7159] = {'Munch.', condition=berserk},
    [7158] = {'Munch.', condition=magic},
    [2669] = {'Munch.', condition=shield},
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)

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

    local v = t[item.itemid]
    local a, b, p = v.hp or math.ceil(getCreatureMaxHealth(cid) * (v.hppc or 0) / 100), v.mp or math.ceil(getCreatureMaxMana(cid) * (v.mppc or 0) / 100), getThingPos(cid)
 
    doCreatureSay(cid, v[1], TALKTYPE_ORANGE_1)
    doAddCondition(cid, exhaust)
    doRemoveItem(item.uid, 1)
 
    if a ~= 0 then
        doCreatureAddHealth(cid, a)
        doSendAnimatedText(p, '+' .. a, COLOR_GREEN)
    end
 
    if b ~= 0 then
        doCreatureAddMana(cid, b)
        doSendAnimatedText(p, '+' .. b, COLOR_PURPLE)
    end
 
    if v.condition then
        doAddCondition(cid, v.condition)
    end
    
    return true
end
 

Similar threads

Back
Top