Área Incorreta
Reportado
Por markindoot, 15 de nov. de 2012 em Scripts
info
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: No Have

Área Incorreta
Reportado
info
Grupo: Barão
Registrado: 26/12/11
Posts: 201
Reputação: +18
Char no Tibia: Flaah

Aqui ó.
Crie um arquivo chamado: sentar.lua
E coloque dentro:
events = {}
config = {
sit = {hp = 5, mana = 5},
male = {lookType = 301},
female = {lookType = 291},
storage = 21211
}
local outfits = {
[1] = {lookType = 200}, -- o numero 1 é o ID da vocação e 200 é o ID do looktype.
[2] = {lookType = 201}, -- o numero 2 é o ID da vocação e 201 é o ID do looktype.
[3] = {lookType = 202}, -- o numero 1 é o ID da vocação e 202 é o ID do looktype.
}
function onStepIn(cid, item, position, fromPosition)
setPlayerStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) == -1 and 1 or -1)
if getPlayerStorageValue(cid, config.storage) == 1 then
doPlayerSay(cid, "Ufa, Relaxando")
doSetCreatureOutfit(cid, config.male, -1)
doSetCreatureOutfit(cid, config.female, -1)
doSendMagicEffect(getCreaturePosition(cid), 69)
doSitRelax(cid, config.sit)
else
doPlayerSay(cid, "OPA, hora de volta ao trabalho")
doRemoveCondition(cid, CONDITION_OUTFIT)
stopEvent(events[getPlayerGUID(cid)])
local voc_id = getPlayerVocation(cid)
if getPlayerVocation(cid) > 0 then
doSetCreatureOutfit(cid, outfits[voc_id], -1)
end
end
return true
end
function doSitRelax(cid, formula)
if not isCreature(cid) then return LUA_ERROR end
doCreatureAddHealth(cid, formula.hp)
doCreatureAddMana(cid, formula.mana)
doSendMagicEffect(getCreaturePosition(cid), 69)
events[getPlayerGUID(cid)] = addEvent(doSitRelax, 5000, cid, formula)
end
Depois, crie um arquivo escrito: sair.lua
E coloque dentro:
events = {}
config = {
sit = {hp = 5, mana = 5},
male = {lookType = 301},
female = {lookType = 291},
storage = 21211
}
local outfits = {
[1] = {lookType = 200}, -- o numero 1 é o ID da vocação e 200 é o ID do looktype.
[2] = {lookType = 201}, -- o numero 2 é o ID da vocação e 201 é o ID do looktype.
[3] = {lookType = 202}, -- o numero 1 é o ID da vocação e 202 é o ID do looktype.
}
function onStepOut(cid, item, position, fromPosition)
setPlayerStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage) == -1 and 1 or -1)
if getPlayerStorageValue(cid, config.storage) == 1 then
doPlayerSay(cid, "Ufa, Relaxando")
doSetCreatureOutfit(cid, config.male, -1)
doSetCreatureOutfit(cid, config.female, -1)
doSendMagicEffect(getCreaturePosition(cid), 69)
doSitRelax(cid, config.sit)
else
doPlayerSay(cid, "OPA, hora de volta ao trabalho")
doRemoveCondition(cid, CONDITION_OUTFIT)
stopEvent(events[getPlayerGUID(cid)])
local voc_id = getPlayerVocation(cid)
if getPlayerVocation(cid) > 0 then
doSetCreatureOutfit(cid, outfits[voc_id], -1)
end
end
return true
end
function doSitRelax(cid, formula)
if not isCreature(cid) then return LUA_ERROR end
doCreatureAddHealth(cid, formula.hp)
doCreatureAddMana(cid, formula.mana)
doSendMagicEffect(getCreaturePosition(cid), 69)
events[getPlayerGUID(cid)] = addEvent(doSitRelax, 5000, cid, formula)
end
Depois coloque no movements.xml
<movevent type="StepIn" itemid="1652" event="script" value="sentar.lua"/> <movevent type="StepOut" itemid="1652" event="script" value="sair.lua"/>
OBS: Mais informações pra editar o script, entre:
http://www.xtibia.co...cao-automatica/
PS: No itemid="1652" vc modifica pro ID da cadeira, ou banco que vc queira.
AJUDEI? +REP
Editado Novembro 16 por Flaah
info
Grupo: Visconde
Registrado: 27/10/12
Posts: 323
Reputação: +46
Char no Tibia: Schznister Equilibriun
Queria pedir ajuda com um script de que o player suba no banco e sente mas quando sair ele volte ao outfit normal
eu tenho outfits de female e male sentados
preciso da ajuda com script
alguem me ajuda porfavor
outfit female = 291 / male = 301