Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Eu e um amigo estávamos precisando deste sisteminha a uns dias atrás então resolvemos "tentar" fazê-lo.

Com base em outros scripts chegamos a este script funcional.  :ph34r:

 

:star: O que esse sistema faz ?  :star: 

 

Simples! Ele permite que um lider de uma guild "x" possa trocar os outifits de todos seus membros para o mesmo que ele estiver usando. Isso é útil em um servidor de guerras, ou custom mesmo para organização de quests etc.

 

Especificações

 

O sistema só é capaz de repassar as cores do addon para os membros da guild, ou seja mesmo que o lider da guild tenha addon full e uma montaria, ao utilizar o comando, apenas "as cores" e o "outifit" do addon serão repassados. Os membros não irão ter o addon full ou montaria apartir deste comando. :rock: 

 

Instalação:  

 

abra seu /data/talkactions/talkactions.xml

e adicione a seguinte tag;

	<talkaction words="!go" script="go.lua"/>

Após isso, abra a pasta /data/talkactions/scripts/

crie um arquivo chamado go.lua e adicione o seguinte código dentro;

--[[
outfit.lookMount = getField<uint16_t>(L, arg, "lookMount");
	outfit.lookAddons = getField<uint8_t>(L, arg, "lookAddons");

	outfit.lookFeet = getField<uint8_t>(L, arg, "lookFeet");
	outfit.lookLegs = getField<uint8_t>(L, arg, "lookLegs");
	outfit.lookBody = getField<uint8_t>(L, arg, "lookBody");
	outfit.lookHead = getField<uint8_t>(L, arg, "lookHead");--]]

function onSay(cid, words, param, channel)
local player = Player(cid)
local playerGuildLevel = getPlayerGuildLevel(cid)
		if(playerGuildLevel < GUILDLEVEL_LEADER) then
			doPlayerSendCancel(cid, "Você precisa ser lider de sua guild para utilizar este comando!")
			return TRUE
		end
		local playerGuild = getPlayerGuildId(cid)
		if(playerGuild == FALSE) then
			doPlayerSendCancel(cid, "Desculpe, você não possuí uma guild.")
			return TRUE
		end

local outfit = getCreatureOutfit(cid)
outfit.lookMount = 0
outfit.lookAddons = 0
local no = 0
local members = getOnlinePlayers()
		for i = 1,#members do
			if(getPlayerGuildId(members[i]) == playerGuild and cid ~= members[i]) then
				if canPlayerWearOutfit(members[i], outfit.lookType, addons) then
				outfit.lookAddons = outfit.lookAddons
				doCreatureChangeOutfit(members[i], outfit)
				else
				outfit.lookAddons = getCreatureOutfit(members[i]).lookAddons
				doCreatureChangeOutfit(members[i], outfit)
				end
					if player:hasMount(getCreatureOutfit(members[i]).lookMount) then
						outfit.lookMount = 0
						doCreatureChangeOutfit(members[i], outfit)
					else
						outfit.lookMount = 0
						doCreatureChangeOutfit(members[i], outfit)
					end
					no = no + 1
					doPlayerSendCancel(cid, ""..no.." tiveram suas outifits mudadas com sucesso!")
			end
		end
	return true
end

Espero que ajude você que esteja lendo agora, e se ajudar... por favor não esqueça de avaliar abaixo e dar um rep+

não custa nada, e mostra que este conteúdo não está sendo postado em vão.

 

 

See ya

 

@This life is filled with hurt

When happiness doesn't work

Trust me and take my hand

When the lights go out you will understand

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por Loldinis
      TFS 1.0
      Pessoal, preciso de uma spell que gaste % de vida ao invés de mana

      Atualmente ela ta assim
      Quem souber da um help, vlw
    • Por Pedriinz
      Depois da atualização da TFS, esses scripts ficaram assim:
       
      [Warning - Event::checkScript] Can not load script: scripts/alladdons.lua
      data/talkactions/scripts/alladdons.lua:1: unexpected symbol near '�'
      [Warning - Event::checkScript] Can not load script: scripts/allmounts.lua
      data/talkactions/scripts/allmounts.lua:1: unexpected symbol near '�'
       
       
      Alguem poderia ajudar ?
       
      alladddons.lua
      function onSay(cid, words, param) local femaleOutfits = { ["citizen"]={136}, ["hunter"]={137}, ["knight"]={139}, ["noblewoman"]={140}, ["warrior"]={142}, ["barbarian"]={147}, ["druid"]={148}, ["wizard"]={149}, ["oriental"]={150}, ["pirate"]={155}, ["assassin"]={156}, ["beggar"]={157}, ["shaman"]={158}, ["norsewoman"]={252}, ["nightmare"]={269}, ["jester"]={270}, ["brotherhood"]={279}, ["demonhunter"]={288}, ["yalaharian"]={324}, ["warmaster"]={336},["wayfarer"]={366}, ["afflicted"]={431}, ["elementalist"]={433}, ["deepling"]={464}, ["insectoid"]={466}, ["red baron"]={471}, ["crystal warlord"]={513}, ["soil guardian"]={514}, ["demon"]={542} } local maleOutfits = { ["citizen"]={128}, ["hunter"]={129}, ["knight"]={131}, ["nobleman"]={132}, ["warrior"]={134}, ["barbarian"]={143}, ["druid"]={144}, ["wizard"]={145}, ["oriental"]={146}, ["pirate"]={151}, ["assassin"]={152}, ["beggar"]={153}, ["shaman"]={154}, ["norsewoman"]={251}, ["nightmare"]={268}, ["jester"]={273}, ["brotherhood"]={278}, ["demonhunter"]={289}, ["yalaharian"]={325}, ["warmaster"]={335}, ["wayfarer"]={367}, ["afflicted"]={430}, ["elementalist"]={432}, ["deepling"]={463}, ["insectoid"]={465}, ["red baron"]={472}, ["crystal warlord"]={512}, ["soil guardian"]={516},["demon"]={541} } local player, param = Player(cid), string.lower(param) local addondoll_id = 9693 if player:getItemCount(addondoll_id) > 0 then if param ~= "" and maleOutfits[param] and femaleOutfits[param] then local outfit = player:getSex() == 0 and femaleOutfits[param][1] or maleOutfits[param][1] if not player:hasOutfit(outfit, 3) then player:removeItem(addondoll_id, 1) player:sendTextMessage(MESSAGE_INFO_DESCR, "Seu Addon full foi adicionado!") Position(getThingPos(cid)):sendMagicEffect(CONST_ME_GIFT_WRAPS) player:addOutfitAddon(outfit, 3) else player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce ja tem este addon") end else player:sendTextMessage(MESSAGE_INFO_DESCR, "Digite novamente, algo esta errado!") end else player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce nao tem addon doll!") end end allmounts.lua
      function onSay(cid, words, param) local table = { -- ["mount"] = {price = x, id = x}, ["black sheep"] = {price = 0, id = 4}, ["crystal wolf"] = {price = 0, id = 16}, ["draptor"] = {price = 0, id = 6}, ["dromedary"] = {price = 0, id = 20}, ["gnarlhound"] = {price = 0, id = 32}, ["hellgrip"] = {price = 0, id = 39}, ["kingly deer"] = {price = 0, id = 18}, ["lady bug"] = {price = 0, id = 27}, ["manta ray"] = {price = 0, id = 28}, ["midnight panther"] = {price = 0, id = 5}, ["racing bird"] = {price = 0, id = 2}, ["rapid boar"] = {price = 0, id = 10}, ["scorpion king"] = {price = 0, id = 21}, ["panda"] = {price = 0, id = 19}, ["tiger slug"] = {price = 0, id = 14}, ["tin lizzard"] = {price = 0, id = 8}, ["titanica"] = {price = 0, id = 7}, ["uniwheel"] = {price = 0, id = 15}, ["widow queen"] = {price = 0, id = 1} } local player, param = Player(cid), string.lower(param) local mountdoll_id = 13030 -- id do addon doll local t = table[param] if player:getItemCount(mountdoll_id) > 0 then if param ~= "" and t then if not player:hasMount(t.id) then player:sendTextMessage(MESSAGE_INFO_DESCR, "Sua mount foi adicionada!") player:removeItem(mountdoll_id, 1) Position(getThingPos(cid)):sendMagicEffect(CONST_ME_GIFT_WRAPS) player:addMount(t.id) else player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce ja tem esta mount.") end else player:sendTextMessage(MESSAGE_INFO_DESCR, "Digite novamente, algo está errado!") end else player:sendTextMessage(MESSAGE_INFO_DESCR, "Voce não tem um mount doll!") end end
    • Por massucoserver
      Estou com o seguinte problema:
      - Eu compro algum item no SHOP do Gesior e não recebo no meu char.
       
      Informações:
      Servidor: TFS 1.0 versão 10.37
      Site: Gesior 2015 1.0 do Victor Raful > LINK
       
      Encontrei uma possível solução em um tópico do TibiaKing:
      - Adicionar um script SHOP no GlobalEvents.
       
      Fiz, isso, e obtive o seguinte erro no Distro:

       
      O script que eu adicionei foi: (globalevents/scripts/shop.lua)
      -- ### CONFIG ### -- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 19 -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution) local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do id = tonumber(result_plr:getDataInt("id")) action = tostring(result_plr:getDataString("action")) delete = tonumber(result_plr:getDataInt("delete_it")) cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) == TRUE then local itemtogive_id = tonumber(result_plr:getDataInt("param1")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local container_id = tonumber(result_plr:getDataInt("param3")) local container_count = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local received_item = 0 local full_weight = 0 if add_item_type == 'container' then container_weight = getItemWeightById(container_id, 1) if isItemRune(itemtogive_id) == TRUE then items_weight = container_count * getItemWeightById(itemtogive_id, 1) else items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) if isItemRune(itemtogive_id) == TRUE then full_weight = getItemWeightById(itemtogive_id, 1) else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if full_weight <= free_cap then if add_item_type == 'container' then local new_container = doCreateItemEx(container_id, 1) local iter = 0 while iter ~= container_count do doAddContainerItem(new_container, itemtogive_id, itemtogive_count) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) received_item = doPlayerAddItemEx(cid, new_item) end if received_item == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.') db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.') end end if not(result_plr:next()) then break end end result_plr:free() end return TRUE end E no globalevents.xml :
      <globalevent name="shop" interval="30" script="shop.lua"/> ALGUÉM PODE ME AJUDAR?
    • Por luanluciano93
      Olá pessoal, para quem não sabe esse script funciona da seguinte maneira: você clica em um X item, e o player muda de sexo, se ele for male vira female, e vice-versa.
       
      Crie um arquivo com o nome change_sex.lua em actions/scripts e coloque isso dentro: 

      change_sex.lua (TFS 1.0)
       
       
      change_sex.lua (TFS 1.1 e 1.2)
       
       
       
      E em actions.xml adcione a tag:
      <action itemid="XXXX" script="change_sex.lua"/> Basta colocar o id do item em XXXX acima, e prontinho.
       
      Bem simples né pessoal ?! Espero ter ajudado, abraços!
    • Por uGibuss
      Tópico feito referente a um antigo: Talkaction, "!go", teleport para cidades, inovador; feito por Eduardo Dantas.
      Preciso de ajuda no seguinte ponto, eu coloco o arquivo .lua na pasta script e coloco a talkaction no XLM determinado, abro o servidor e a digitar o comando nada acontece, ele sai como mensagem falada pelo player. Não tem erros na distro e tudo ocorre normal ao abrir, porém o comando não funciona. Desde já agradeço pela ajuda.
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo