Como usar a mayNotMove?

Sphynx
Por Sphynx
em Scripts

Sphynx

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 14/04/19Posts: 13

Olá, preciso muito de ajuda!
Aos poucos eu estou construindo uma spell, mas cheguei no momento que eu estou empacado, eu gostaria que durante o tempo de conjuração(o tempo que o looktype é trocado) o player ficasse congelado, ou seja, um segundo de congelamento após castar a spell, eu já tentei de tudo, doCreatureSetNoMove, doPlayerSetNoMove, tudo... O mesmo erro é mostrado na tela.

 

"Lua Script Error: [Spell Interface]
data/spells/scripts/attack/ice_strike.lua:onCastSpell
data/spells/scripts/attack/ice_strike.lua:23: attempt to call global 'mayNotMove' (a nil value)
stack traceback:
        [C]: in function 'mayNotMove'
        data/spells/scripts/attack/ice_strike.lua:23: in function <data/spells/scripts/attack/ice_strike.lua:22>"

 

Alguém já passou por isso e pode me ajudar?

gabriel28

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 26/08/10Posts: 429Gênero: MasculinoChar no Tibia: Gabriel Rookgaardian
21 minutos atrás, Sphynx disse:
Versão do Servidor: TFS - 1.2
Tipo de Script: spell
Código:
  Mostrar conteúdo oculto
local	tempo = 1
    
local combat = Combat()
	combat:setParameter(COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE)
	combat:setParameter(COMBAT_PARAM_EFFECT, CONST_ME_FIREATTACK)
	combat:setParameter(COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_FIRE)

local condition = Condition(CONDITION_FIRE)
	condition:setParameter(CONDITION_PARAM_DELAYED, true)
	condition:addDamage(5, 2000, -15)
	condition:addDamage(5, 1000, -5)
	combat:setCondition(condition)

function onGetFormulaValues(player, level, magicLevel)
	local min = (level / 5) + (magicLevel * 1.4) + 8
	local max = (level / 5) + (magicLevel * 2.2) + 14
	return -min, -max
end

combat:setCallback(CALLBACK_PARAM_LEVELMAGICVALUE, "onGetFormulaValues")

function onCastSpell(cid, var, time)
mayNotMove(cid,true)
	addEvent(function()
		if isPlayer(cid) then mayNotMove(cid,false) end
	end,time * 1000)


	local homem = {lookType = 907, lookHead = getCreatureOutfit(cid).lookHead, 
				lookBody = getCreatureOutfit(cid).lookBody, 
				lookLegs = getCreatureOutfit(cid).lookLegs, 
				lookFeet = getCreatureOutfit(cid).lookFeet, 
				lookTypeEx = getCreatureOutfit(cid), 
				lookAddons = getCreatureOutfit(cid)} 
				
	local mulher = {lookType = 907, lookHead = getCreatureOutfit(cid).lookHead, 
				lookBody = getCreatureOutfit(cid).lookBody, 
				lookLegs = getCreatureOutfit(cid).lookLegs, 
				lookFeet = getCreatureOutfit(cid).lookFeet, 
				lookTypeEx = getCreatureOutfit(cid), 
				lookAddons = getCreatureOutfit(cid)} 
  
	local sex = getPlayerSex(cid)

if sex == 0 then
		doSetCreatureOutfit(cid, mulher, tempo*1000)
	else 
		doSetCreatureOutfit(cid, homem, tempo*1000)
end			

return doCombat(cid, combat, var)
end

 

Já que tas usando o TFS 1.2, talvez a função seja diferente, algo como creature:setNoMove(), não sei, só vendo.

Sphynx

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 14/04/19Posts: 13

Brô, o pior de tudo é que retiraram a função nessa versão do TFS, eu vou ter que seguir um tutorial que adiciona ela novamente nas sources. Depois eu farei um tutorial para ajudar as pessoas que vão passar pelo mesmo problema que eu, obrigado por comentar. 

gabriel28

avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 26/08/10Posts: 429Gênero: MasculinoChar no Tibia: Gabriel Rookgaardian
20 minutos atrás, Sphynx disse:

Brô, o pior de tudo é que retiraram a função nessa versão do TFS, eu vou ter que seguir um tutorial que adiciona ela novamente nas sources. Depois eu farei um tutorial para ajudar as pessoas que vão passar pelo mesmo problema que eu, obrigado por comentar. 

Por essas que prefiro continuar no meu velho 0.4 que ainda da pro tranco. hahaha