Jump to content
  • 0
Smitherz

Scripting Actions tp

Question

Smitherz
Posted (edited)

Antes de fazer a sua pergunta, tenha certeza de ter lido as regras da seção e o guia abaixo:

https://forums.otserv.com.br/index.php?/forums/topic/168583-regras-da-seção/

https://forums.otserv.com.br/index.php?/forums/topic/165121-como-fazer-uma-pergunta-ou-o-grande-guia-do-usuário-com-dúvidas/

Obs: não delete esse formulário pré-definido, preencha-o corretamente para postar o seu tópico!

Descreva em algumas palavras a base utilizada. (Nome do servidor / Nome do cliente / Nome do website / etc.).

Base: 12x OTSERV

 

Qual é a sua pergunta?

Poderiam me auxiliar a passar essa actions para revscriptsys

 

Você tem o código disponível? Se tiver poste-o na caixa de código que está dentro do spoiler abaixo:

Spoiler
local config = {
	storageID = 14586,
	tradeCenter = {pos = {x = 224, y = 307, z = 7}},
	cpActionID = {23000, 23001, 23002, 23003, 23004, 23005, 23006, 23007, 23008, 23009},
	tcActionID = 22334,
}

local cities = {
	pewter = {id = 1, pos = {x = 396, y = 1746, z = 9, stackpos=253}},
	cerulean = {id = 2, pos = {x = 396, y = 1746, z = 9, stackpos=253}},
	viridian = {id = 3, pos = {x = 396, y = 1746, z = 9, stackpos=253}},
	celadon = {id = 4, pos = {x = 396, y = 1746, z = 9, stackpos=253}},
	saffron = {id = 5, pos = {x = 396, y = 1746, z = 9, stackpos=253}},
	lavender = {id = 6, pos = {x = 396, y = 1746, z = 9, stackpos=253}},
	vermilion = {id = 7, pos = {x = 396, y = 1746, z = 9, stackpos=253}},
	cinnabar = {id = 8, pos = {x = 396, y = 1746, z = 9, stackpos=253}},
	fuchsia = {id = 9, pos = {x = 396, y = 1746, z = 9, stackpos=253}},
}

function onStepIn(cid, item, pos)
	if isSummon(cid) then
		return false
	end

	teleportTo = config.tradeCenter.pos
	
	if isInArray (config.cpActionID, item.actionid) then
		if item.actionid == config.cpActionID[1] then
			setPlayerStorageValue(cid, config.storageID, cities.pewter.id)
		elseif item.actionid == config.cpActionID[2] then
			setPlayerStorageValue(cid, config.storageID, cities.cerulean.id)
		elseif item.actionid == config.cpActionID[3] then
			setPlayerStorageValue(cid, config.storageID, cities.viridian.id)
		elseif item.actionid == config.cpActionID[4] then
			setPlayerStorageValue(cid, config.storageID, cities.celadon.id)
		elseif item.actionid == config.cpActionID[5] then
			setPlayerStorageValue(cid, config.storageID, cities.saffron.id)
		elseif item.actionid == config.cpActionID[6] then
			setPlayerStorageValue(cid, config.storageID, cities.lavender.id)
		elseif item.actionid == config.cpActionID[7] then
			setPlayerStorageValue(cid, config.storageID, cities.vermilion.id)
		elseif item.actionid == config.cpActionID[8] then
			setPlayerStorageValue(cid, config.storageID, cities.cinnabar.id)
		elseif item.actionid == config.cpActionID[9] then
			setPlayerStorageValue(cid, config.storageID, cities.fuchsia.id)
		end
	elseif item.actionid == config.tcActionID then
		playerStatus = getPlayerStorageValue(cid, config.storageID)
		if playerStatus == cities.pewter.id then
			teleportTo = cities.pewter.pos
		elseif playerStatus == cities.cerulean.id then
			teleportTo = cities.cerulean.pos
		elseif playerStatus == cities.viridian.id then
			teleportTo = cities.viridian.pos
		elseif playerStatus == cities.celadon.id then
			teleportTo = cities.celadon.pos
		elseif playerStatus == cities.saffron.id then
			teleportTo = cities.saffron.pos
		elseif playerStatus == cities.lavender.id then
			teleportTo = cities.lavender.pos
		elseif playerStatus == cities.vermilion.id then
			teleportTo = cities.vermilion.pos
		elseif playerStatus == cities.cinnabar.id then
			teleportTo = cities.cinnabar.pos
		elseif playerStatus == cities.fuchsia.id then
			teleportTo = cities.fuchsia.pos
		else
			teleportTo = cities.cerulean.pos
		end
	end


	if #getCreatureSummons(cid) >= 1 then
	   for i = 1, #getCreatureSummons(cid) do
	       doTeleportThing(getCreatureSummons(cid), teleportTo, false)
	   end
	end

	doTeleportThing(cid, teleportTo, false)  

	return true
end

 

Você tem alguma imagem que possa auxiliar no problema? Se sim, anexe-a dentro do spoiler abaixo:

Spoiler

 

 

Edited by Smitherz

Share this post


Link to post

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×