Ir para conteúdo

Denker

Membro
  • Registro em

  • Última visita

Tudo que Denker postou

  1. O Player será teletransportado para o TC, após sair do TradeCenter o player retornará á cidade de origem, ex: Saffon > TC , o player retornará a saffron. --------------------------------------------------------------------------------------------------------------------- Em Data/Movements/Scripts, crie um arquivo.lua e coloque dentro: -- Developed by: Denker local configs = { tps = { -- Teleport para o TC através de um TP (Item) especifico no chão [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50000}, -- Pallet [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50001}, -- Viridian [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50002}, -- Pewter [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50003}, -- Cerulean [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50004}, -- Saffron [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50005}, -- Celadon [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50006}, -- Vermilion [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50007}, -- Fuchsia [ItemID] = {pos = {x = 0, y = 0, z = 0}, storage = 50008}, -- Cinnabar }, -- LOCALIZAÇÕES localizacaoPallet = {x= 0, y= 0, z= 0}, localizacaoViridian = {x= 0, y= 0, z= 0}, localizacaoPewter = {x= 0, y= 0, z= 0}, localizacaoCerulean = {x= 0, y= 0, z= 0}, localizacaoSaffron = {x= 0, y= 0, z= 0}, localizacaoCeladon = {x= 0, y= 0, z= 0}, localizacaoVermilion = {x= 0, y= 0, z= 0}, localizacaoFuchsia = {x= 0, y= 0, z= 0}, localizacaoCinnabar = {x= 0, y= 0, z= 0} } function onStepIn(cid, item, position, fromPosition) local tp = configs.tps[item.itemid] if tp then doTeleportThing(cid, tp.pos) setPlayerStorageValue(cid, tp.storage, 1) return true end -- Verificação que irá teletransportar o player de acordo com a city que ele estava antes if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50000) == 1 then doTeleportThing(cid, configs.localizacaoPallet) setPlayerStorageValue(cid, 50000, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Pallet") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50001) == 1 then doTeleportThing(cid, configs.localizacaoViridian) setPlayerStorageValue(cid, 50001, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Viridian") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50002) == 1 then doTeleportThing(cid, configs.localizacaoPewter) setPlayerStorageValue(cid, 50002, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Pewter") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50003) == 1 then doTeleportThing(cid, configs.localizacaoCerulean) setPlayerStorageValue(cid, 50003, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Cerulean") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50004) == 1 then doTeleportThing(cid, configs.localizacaoSaffron) setPlayerStorageValue(cid, 50004, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Saffron") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50005) == 1 then doTeleportThing(cid, configs.localizacaoCeladon) setPlayerStorageValue(cid, 50005, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Celadon") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50006) == 1 then doTeleportThing(cid, configs.localizacaoVermilion) setPlayerStorageValue(cid, 50006, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Vermilion") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50007) == 1 then doTeleportThing(cid, configs.localizacaoFuchsia) setPlayerStorageValue(cid, 50007, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Fuchsia") return true end if (item.itemid == ItemID ) and getPlayerStorageValue(cid, 50008) == 1 then doTeleportThing(cid, configs.localizacaoCinnabar) setPlayerStorageValue(cid, 50008, 0) doPlayerSendTextMessage(cid, COLOR_MESSAGE_GREEN, "Você foi Teletransportado para Cinnabar") return true end end OBS: O item ID da verificação de volta, será igual para todas as verificações. Em Data/Movements/Movements.xml, coloque dentro: <movevent type="StepIn" itemid="ID" event="script" value="arquivo.lua"/>
  2. Ao clicar em um baú o player receberá o pokémon, ao ser teleportado para a cidade inicial ele ganhará um kit. OBS: Script desenvolvido para Ot's aonde não há opção de escolha para cidade inicial, sempre será a mesma. Em Data/Actions/Script, crie um arquivo.lua e coloque: -- Developed by: Denker local configs = { position = {x = , y = , z = }, -- Localização que o player será teletransportado level = 8, -- Level minimo item = { [1] = {id = , count = }, -- Item que será entregue [2] = {id = , count = }, }, pokemons = { [] = "Charmander", -- Pokémons a se escolher e os ID item que será correspondente a cada poke [] = "Bulbasaur", [] = "Squitler", } } function onUse(cid, item) local first_Pokemon = configs.pokemons[item.itemid] if getPlayerLevel(cid) >= configs.level then for i = 1, #configs.item do doPlayerAddItem(cid, configs.item[1].id, configs.item[1].count) end addPokeToPlayer(cid, first_Pokemon,nil,"normal") doTeleportThing(cid, configs.position) doPlayerSetTown(cid,ID) -- Seta a cidade inicial no player doPlayerSendTextMessage(cid, 27, "Você pegou "..first_Pokemon.." como seu primeiro pokémon, boa sorte em sua jornada") -- Mensagem enviada após pegar escolher o pokémon else doPlayerSendTextMessage(cid, 27, "Você não pode pegar este Pokémon") -- Mensagem caso o player não tenha o requisito end return true end Em Data/Action/action.xml, coloque: <action itemid="ItemID" event="script" value="arquivo.lua"/>
  3. Basicamente é o uso de um item que troca a outfit do player de acordo com o genêro e acrescenta speed. Em Data/Actions/Scripts, crie um arquivo.lua e coloque: -- Developed by: Denker local configs = { Speed = Value , -- Speed que será adicionada e removida Outfit = { [ItemID] = {looktype_male = Sprite , -- LOOKTYPE MASCULINO looktype_female = Sprite , -- LOOKTYPE FEMININO }, } } function onUse(cid, item, frompos, itemEx, topos) local change_Outfit = configs.Outfit[item.itemid] if getPlayerStorageValue(cid, 32011) == 1 then doRemoveCondition(cid, CONDITION_OUTFIT) doChangeSpeed(cid, -configs.Speed) setPlayerStorageValue(cid, 32011, 0) return true end if getPlayerSex(cid) == 1 then -- Male doChangeSpeed(cid, configs.Speed) doSetCreatureOutfit(cid,{lookType = change_Outfit.looktype_male},-1) setPlayerStorageValue(cid, 32011, 1) elseif getPlayerSex(cid) == 0 then -- Female doChangeSpeed(cid, configs.Speed) doSetCreatureOutfit(cid,{lookType = change_Outfit.looktype_female},-1) setPlayerStorageValue(cid, 32011, 1) end return true end Em Data/Actions/action.xml, adicione: <action itemid="ItemID" event="script" value="arquivo.lua"
  4. Denker postou uma resposta no tópico em Tutoriais sobre Scripting
    Obrigado, estava atrás desta informação
  5. Em Data/Actions/Scripts, crie um arquivo.lua e adicione: -- Developed by: Denker local Storage = -- Storaage que irá ser setada no player local Localizacao = {x= , y= , z= } -- Coordenadas para qual o player será teletransportado local ItemID = -- ID do item que o player terá que usar para ser teletransportado local Quantidade = -- Quantidade do item requerida para o player ser teletransportado function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerItemCount(cid,ItemID) >= Quantidade or getPlayerStorageValue(cid, Storage) >=1 then doTeleportThing(cid,Localizacao) doPlayerRemoveItem(cid, ItemID, Quantidade) doSendMagicEffect(getPlayerPosition(cid), 21) doPlayerSendTextMessage(cid, 25, "Did you make it through the door") -- Mensagem que o player receberá ao ser teletransportado setPlayerStorageValue (cid,Storage,1) else doPlayerSendTextMessage(cid,25,"You don't have what it takes to get through this door") -- Mensagem que o player receberá caso não tenha os requisitos end return true end Em Data/Actions/actions.xml, adicione: <action actionid ou itemid="ID" event="script" value="arquivo.lua" OBS: O 2º teleporte é por conta que a storage foi setada
  6. Obrigado pela informação
  7. Em Data/Actions/Scripts, crie um arquivo.lua e coloque dentro: -- Developed by: Denker function OnUse(cid,item,fromPosition,item2,toPosition) Storage = -- Valor da storage que irá ser setada no player ItemID = -- Id do item Name = -- Nome do item Quantidade = -- Quantidade do item Level = -- Level requerido para pegar o item if getPlayerLevel(cid) >= Level and getPlayerStorageValue (cid,Storage)== -1 then doPlayerSendTextMessage(cid,25,"You found"..Quantidade....Name.."!") -- Mensagem que irá aparecer quando o player coletar o item doPlayerAddItem(cid, ItemID, Quantidade) setPlayerStorageValue (cid,Storage,1) elseif getPlayerLevel(cid) <= Level then doPlayerSendTextMessage(cid,25,"You need to level"..Level.."to collect this item") -- Mensagem caso o player não tenha o level necessário para pegar o item elseif getPlayerStorageValue(cid, Storage) >= 1 then doPlayerSendTextMessage(cid,25,"You have already collected this item") -- Mensagem caso o player já tenha pego o item end return true end Em Data/Actions/Actions.xml, coloque dentro: <action actionid="ID" event="script" value="Arquivo.lua"/>

Informação Importante

Confirmação de Termo