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

Help with 2 small scripts please (Action Vocation Req and Spell Add Mana)

Tufte

Active Member
Joined
Nov 19, 2007
Messages
652
Reaction score
25
Location
Norway
I need so only mages can use this action:

PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 60000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICPOINTS, 10)
setCombatCondition(combat, condition)

function onUse(cid, item, frompos, item2, topos)
var = numberToVariant(cid)
	doCombat(cid, combat, var)
	doCreatureSay(cid, "You Gained 10 Magic Levels! You can only get this power once!", TALKTYPE_ORANGE_1)


	return 1
end



and so this spell adds mana INSTEAD of health


PHP:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_HEALING)
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, FALSE)
setCombatParam(combat, COMBAT_PARAM_DISPEL, CONDITION_PARALYZE)

function onGetFormulaValues(cid, level, maglevel)
	min = (level * 1 + maglevel * 4) * 1.7
	max = (level * 1 + maglevel * 4) * 2.1
	if min < 250 then
		min = 250
	end
	return min, max
end


setCombatCallback(combat, CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

local area = createCombatArea(AREA_MANAWAVE5)
setCombatArea(combat, area)

function onCastSpell(cid, var)
	return doCombat(cid, combat, var)
end



thanks :D
 
First script:
Code:
local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_MAGIC_GREEN)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

local condition = createConditionObject(CONDITION_ATTRIBUTES)
setConditionParam(condition, CONDITION_PARAM_TICKS, 60000)
setConditionParam(condition, CONDITION_PARAM_STAT_MAGICPOINTS, 10)
setCombatCondition(combat, condition)

function onUse(cid, item, frompos, item2, topos)
    if getPlayerVocation(cid) == 1 or getPlayerVocation(cid) == 5 then
        var = numberToVariant(cid)
        doCombat(cid, combat, var)
        doCreatureSay(cid, "You Gained 10 Magic Levels! You can only get this power once!", TALKTYPE_ORANGE_1)
    else
        doPlayerSendCancel(cid,'Only sorcerers may use this.')
        return 0
    end
    return 1
end
 
Back
Top