Ir para conteúdo
  • 0

Adaptar Spell


nbb147

Pergunta

galera eu ja tentei de todas as formas, adaptar esse spell cheguei perto mais nao consegui, bom, essa spell e spell que transfoma e da skills, eu queria q quando usase ela ficase retirando certa quantidade de mana, e q quando a mana chega-se em 100, o addon sai, e os skills taambem saem, abaixo e script:

 

local outfit = {lookType = 8}

local tempo = 600 * 1000

local efeito = 7

 

local ml = 6 -- quantos ira aumentar o skill de ML

local skillfist = 6 -- quantos ira aumentar o skill de Fist

local skillsword = 6 -- quantos ira aumentar o skill de Sword

local skillaxe = 6 -- quantos ira aumentar o skill de Axe

local skillclub = 6 -- quantos ira aumentar o skill de Club

local skilldistance = 0 -- quantos ira aumentar o skill de Distance

local skillshield = 6 -- quantos ira aumentar o skill de Shield

local health = 50 -- A cada 1 segundo quantos aumentar de vida

 

local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_EFFECT, efeito)

setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

 

local condition = createConditionObject(CONDITION_ATTRIBUTES)

setConditionParam(condition, CONDITION_PARAM_TICKS, tempo)

setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml)

setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, skillfist)

setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, skillsword)

setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, skillaxe)

setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, skillclub)

setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, skilldistance)

setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield)

setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit)

setCombatCondition(combat, condition)

 

local condition = createConditionObject(CONDITION_HASTE)

setConditionParam(condition, CONDITION_PARAM_SPEED, 250)

setConditionParam(condition, CONDITION_PARAM_TICKS, tempo)

setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)

setCombatCondition(combat, condition)

 

local condition = createConditionObject(CONDITION_REGENERATION)

setConditionParam(condition, CONDITION_PARAM_SUBID, 1)

setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)

setConditionParam(condition, CONDITION_PARAM_TICKS, tempo)

setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)

setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 50)

setCombatCondition(combat, condition)

 

local sys = createConditionObject(CONDITION_OUTFIT)

setConditionParam(sys, CONDITION_PARAM_TICKS, tempo)

addOutfitCondition(sys, outfit)

setCombatCondition(combat, sys)

 

function onCastSpell(cid, var)

doCombat(cid, combat, var)

setPlayerStorageValue(cid, 21598, 1)

return true

end

 

 

a forma que cheguei mais perto foi essa ela tira o addon, mais e os skills nao saem, e tambem so sai quando chega a 0, eu queria q o adddon e os skills saiam quando a mana chegar a 100, abaixo o script:

 

 

local outfit = {lookType = 8}

local tempo = 600 * 1000

local efeito = 7

 

local ml = 6 -- quantos ira aumentar o skill de ML

local skillfist = 6 -- quantos ira aumentar o skill de Fist

local skillsword = 6 -- quantos ira aumentar o skill de Sword

local skillaxe = 6 -- quantos ira aumentar o skill de Axe

local skillclub = 6 -- quantos ira aumentar o skill de Club

local skilldistance = 0 -- quantos ira aumentar o skill de Distance

local skillshield = 6 -- quantos ira aumentar o skill de Shield

local health = 50 -- A cada 1 segundo quantos aumentar de vida

 

local combat = createCombatObject()

setCombatParam(combat, COMBAT_PARAM_EFFECT, efeito)

setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, 0)

 

local condition = createConditionObject(CONDITION_ATTRIBUTES)

setConditionParam(condition, CONDITION_PARAM_TICKS, tempo)

setConditionParam(condition, CONDITION_PARAM_STAT_MAGICLEVEL, ml)

setConditionParam(condition, CONDITION_PARAM_SKILL_FIST, skillfist)

setConditionParam(condition, CONDITION_PARAM_SKILL_SWORD, skillsword)

setConditionParam(condition, CONDITION_PARAM_SKILL_AXE, skillaxe)

setConditionParam(condition, CONDITION_PARAM_SKILL_CLUB, skillclub)

setConditionParam(condition, CONDITION_PARAM_SKILL_DISTANCE, skilldistance)

setConditionParam(condition, CONDITION_PARAM_SKILL_SHIELD, skillshield)

setConditionParam(condition, CONDITION_PARAM_OUTFIT, outfit)

setCombatCondition(combat, condition)

 

local condition = createConditionObject(CONDITION_HASTE)

setConditionParam(condition, CONDITION_PARAM_SPEED, 250)

setConditionParam(condition, CONDITION_PARAM_TICKS, tempo)

setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)

setCombatCondition(combat, condition)

 

local condition = createConditionObject(CONDITION_REGENERATION)

setConditionParam(condition, CONDITION_PARAM_SUBID, 1)

setConditionParam(condition, CONDITION_PARAM_BUFF, TRUE)

setConditionParam(condition, CONDITION_PARAM_TICKS, tempo)

setConditionParam(condition, CONDITION_PARAM_HEALTHGAIN, health)

setConditionParam(condition, CONDITION_PARAM_HEALTHTICKS, 50)

setCombatCondition(combat, condition)

 

local sys = createConditionObject(CONDITION_OUTFIT)

setConditionParam(sys, CONDITION_PARAM_TICKS, tempo)

addOutfitCondition(sys, outfit)

setCombatCondition(combat, sys)

 

function onCastSpell(cid, var)

doCombat(cid, combat, var)

setPlayerStorageValue(cid, 21598, 1)

setPlayerStorageValue(cid, 8099, 1)

doHealPlayer(cid)

return true

end

 

function doHealPlayer(cid)

local delay = 3 -- de quanto em quanto tempo irá tirar (no caso, 3 segundos)

local minmana = getCreatureMana(cid)

 

if getPlayerStorageValue(cid, 8099) == 1 then

doCreatureAddMana(cid, -5)

addEvent(doHealPlayer, delay*1000, cid)

end

 

if minmana == 0 then

 

 

setPlayerStorageValue(cid, 8099, -1)

doRemoveCondition(cid, CONDITION_OUTFIT)

doRemoveCondition(cid, CONDITION_REGENERATION)

doRemoveCondition(cid, CONDITION_HASTE)

doRemoveCondition(cid, CONDITION_ATRIBUTES)

end

return 1

end

Editado por nbb147
Link para o comentário
Compartilhar em outros sites

3 respostass a esta questão

Posts Recomendados

  • 0

local conditions = {
[CONDITION_ATTRIBUTES] = {
	[CONDITION_PARAM_TICKS] = -1,
	[CONDITION_PARAM_STAT_MAGICLEVEL] = 6,
	[CONDITION_PARAM_SKILL_MELEE] = 6,
	[CONDITION_PARAM_SKILL_DISTANCE] = 0,
	[CONDITION_PARAM_SKILL_SHIELD] = 6,
	[CONDITION_PARAM_BUFF] = true,
	[CONDITION_PARAM_SUBID] = 500
},
[CONDITION_HASTE] = {
	[CONDITION_PARAM_TICKS] = -1,
	[CONDITION_PARAM_SPEED] = 250,
	[CONDITION_PARAM_SUBID] = 500
},
[CONDITION_REGENERATION] = {
	[CONDITION_PARAM_TICKS] = -1,
	[CONDITION_PARAM_HEALTHGAIN] = 50,
	[CONDITION_PARAM_HEALTHTICKS] = 50,
	[CONDITION_PARAM_SUBID] = 500
},
[CONDITION_OUTFIT] = {
	[CONDITION_PARAM_TICKS] = -1,
	[addOutfitCondition] = {lookType = 8},
	[CONDITION_PARAM_SUBID] = 500
}
}

local combat = createCombatObject()
setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_YELLOW_RINGS)
setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false)

for condition, parameters in pairs(conditions) do
local condition = createConditionObject(condition)
for parameter, value in pairs(parameters) do
	if parameter == addOutfitCondition then
		addOutfitCondition(condition, value)
	else
		setConditionParam(condition, parameter, value)
	end
end
setCombatCondition(combat, condition)
end

local function transform(cid)
if getCreatureMana(cid) < 101 then
	for condition, _ in pairs(conditions) do
		doRemoveCondition(cid, condition, 500)
	end
	doSendMagicEffect(getThingPosition(cid), CONST_ME_YELLOW_RINGS)
else
	doCreatureAddMana(cid, -5)
	addEvent(transform, 1 * 1000, cid)
end
end

function onCastSpell(cid, var)
doCombat(cid, combat, var)
addEvent(transform, 1 * 1000, cid)
return true
end  

Editado por Oneshot
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...