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

Problem with fire field movement

Spo teh pro

New Member
Joined
Jan 3, 2008
Messages
319
Reaction score
1
Code:
function onStepIn(cid, item, pos)
---Action by Jovial---

--Config--
voc = 4    --0 = no vocation, 1 = sorcerer, 2 = druida, 3 = paladin, 4 = knight--
voc2 = 1
voc3 = 2 

dano = 900 --quanto ira tirar de vida
cor = 180 --cor da letra do hit 5=azul, 180=red, etc
efeito = 3  --numero do efeito desejado
--End Config--

hp = getPlayerHealth(cid)
topos = getPlayerPosition(cid)
pvoc = getPlayerVocation(cid)
pvoc3 = getPlayerVocation(cid)
pvoc2 = getPlayerVocation(cid)

if voc == pvoc or voc2 == pvoc or voc3 == pvoc then
if getPlayerHealth(cid) >= dano then
doPlayerAddHealth(cid, -dano)
doSendAnimatedText(topos, dano, cor)
  doSendMagicEffect(topos, efeito)
else
doPlayerAddHealth(cid, -hp)
doSendAnimatedText(topos, hp, cor)
  doSendMagicEffect(topos, efeito)
end
end
return 1
end

Well this is the script i got
I think this is for non promoted vocations
could anyone please make it for only promoted vocations?
 
Lua:
local voc = {4, 1, 2}

local health = 900
local color = 180
local effect = 3

function onStepIn(cid, item, pos)
---Action by Jovial---

local hp = getCreatureHealth(cid)
local playerpos = getCreaturePosition(cid)
local pvoc = getPlayerVocation(cid)

	if isInArray(voc, pvoc) == TRUE or isInArray(voc, pvoc+4) == TRUE then
		if getCreatureHealth(cid) >= health then
			doPlayerAddHealth(cid, -health)
			doSendAnimatedText(playerpos, health, color)
			doSendMagicEffect(playerpos, effect)
		else
			doPlayerAddHealth(cid, -hp)
			doSendAnimatedText(playerpos, hp, color)
			doSendMagicEffect(playerpos, effect)
		end
	end
return 1
end
 
Thanks guys but it still doesn't work

Im using TFS 0.3.2

and could someone maybe show me how it would look like in movements.xml?:D

Thanks <3
 
Lua:
local config = {voc = {1,2,3,4,5,6}, rightVOC = 300, wrongVOC = 3000}

function onStepIn(cid, item, position, fromPosition)
    local Pos = getCreaturePosition(cid)
    if isInArray(config.voc, getPlayerVocation(cid)) == TRUE then
        doCreatureAddHealth(cid, -config.rightVOC)
        doSendMagicEffect(Pos, effect)
    else
        doCreatureAddHealth(cid, -config.wrongVOC)
        doSendMagicEffect(Pos, effect)
    end
   return TRUE
end
 
Back
Top