CR
pedido

Spell Que Heala X Tempo

Por craigmabbit, 11 de nov. de 2012 em Scripts

6
1.5k
11 de novembro de 2012 às 21:55

Spell que heala X tempo e heala conforme lv do player

se o player é lv 10 heal igual 10 se o player for lv 100 heal igual a 100

LuckOakeL
11 de novembro de 2012 às 22:46

Tó. Usa a tag igual a da exura.

 

 

function heal(cid, time)
a = 0
if a < time then
doCreatureAddHealth(cid, getPlayerLevel(cid))
doSendMagicEffect(getCreaturePos(cid), 12)
a = a+1
addEvent(heal, 1000, cid, time)
return true
end
return true
end

function onCastSpell(cid, var)
heal(cid, 10)
return true
end

 

 

OBS: Não garanto que funciona. Se não der, posta aqui que tento arrumar.

Editado Novembro 11 por LuckOake

11 de novembro de 2012 às 23:03

deu erro luasetCombatParam> this function can only be used while loading the script

LuckOakeL
11 de novembro de 2012 às 23:12

Fiz uma bobagem no script acima. Usa esse:

 

 

function heal(cid, time)
a = getPlayerStorageValue(cid, 1278)
if a < time then
doCreatureAddHealth(cid, getPlayerLevel(cid))
doSendMagicEffect(getCreaturePos(cid), 12)
setPlayerStorageValue(cid, 1278, a+1)
addEvent(heal, 1000, cid, time) return true
else
setPlayerStorageValue(cid, 1278, 0) return true
end
return true
end

function onCastSpell(cid, var)
heal(cid, 10)
return true
end

 

 

OBS: Lembrando que isso é uma spell. Verifica se você colocou ela no lugar certo.

Editado Novembro 11 por LuckOake

SkymagnumS
11 de novembro de 2012 às 23:12

Tenta assim:

 

function addHp(cid, count, rounds, int)

int = not int and 1 or int
rounds = not rounds and 1 or rounds
count = not count and getPlayerLevel(cid) or count


a = 0
 if isCreature(cid) then
 while a < rounds do
	addEvent(doCreatureAddHealth, int * 1000, cid, count)
		a = a + 1
				  end
			   end
  return true
end

 

caso não funcione teste esse:

 

function addHp(cid, count, rounds, int)

int = not int and 1 or int
rounds = not rounds and 1 or rounds
count = not count and getPlayerLevel(cid) or count


a = 0
while a < rounds do
if isCreature(cid) then
	addEvent(doCreatureAddHealth, int * 1000, cid, count)
		a = a + 1
				  end
			   end
  return true
end

 

@Legenda.

 

COUNT - quanto irá healar.

INT - intervalo entre os heals.

ROUNDS - quantas vezes irá healar.

 

@Observação.

Se não funcionar tente colocar isso

if a > 0 then

a = 0

end


encima de a = 0

Editado Novembro 11 por Skymagnum

11 de novembro de 2012 às 23:23

LuckOake funcionou obrigado REP+