Ir para conteúdo
  • Cadastre-se

8.5x - 8.7x [8.60] The Forgotten Server 0.4 (sqlite e mysql)


Posts Recomendados

  • Respostas 378
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Reporte qualquer bug encontrado.   - Mudanças: * opcode adicionado * Monstros andando em cima de corpos * War system arrumado * Anti-divulgação melhorado * Cast syst

Arrumei   Sim, comecei com esse projeto no começo do ano, eu tava usando o tfs 0.3.6 desde 2010, encontrei alguns problemas e acabei migrando pra rev 3777, e deu certo :D

talkactions/scripts/teleporttown.lua local pos = getTownTemplePosition(tmp, false) Troca por: local pos = getTownTemplePosition(tmp)   Foi o único arquivo que mudei. Adic

Posted Images

Em 17/11/2016 ás 06:59, Fir3element disse:

8.6?


Não da , ja tentei as versões 8.60 v1 e v2 , 8.54 ambas versões e não da ...

giphy.gif

Link para o post
Compartilhar em outros sites
1 hora atrás, Fir3element disse:

Vou arrumar os bugs que falaram e colocar sqlite.

 

É ótimo saber que ainda está interessado nesse projeto. Na verdade, isso é reconfortante. :grin:

 

Só pra não perder a prática, um pedido rápido (Vai que cola, né?): Poderia disponibilizar o Donwload dessas soucers compiladas em linux?

Eu sei, eu sei, tem vários tutoriais aqui no TK sobre compilação em Linux, eu sei. Mas é que não deu certo nenhum deles.

Então assim... Poderia quebrar esse galho pra nós, né? :wink:

 

Em todo caso, obrigado por todo esforço.

Grande abraço! 

cms1-pr%C3%AAmio.png

Link para o post
Compartilhar em outros sites
Em 23/11/2016 ás 11:32, Frenesy disse:

 

É ótimo saber que ainda está interessado nesse projeto. Na verdade, isso é reconfortante. :grin:

 

Só pra não perder a prática, um pedido rápido (Vai que cola, né?): Poderia disponibilizar o Donwload dessas soucers compiladas em linux?

Eu sei, eu sei, tem vários tutoriais aqui no TK sobre compilação em Linux, eu sei. Mas é que não deu certo nenhum deles.

Então assim... Poderia quebrar esse galho pra nós, né? :wink:

 

Em todo caso, obrigado por todo esforço.

Grande abraço! 

Qual linux (e versão)?

Link para o post
Compartilhar em outros sites
Em 24/11/2016 ás 16:49, Frenesy disse:

 

Ubuntu 12.04 [64x]

 

Desde já: Obrigadão!  :wow:

Pronto: _heforgottenserver.401021ffd5fd7eeb42be61eaaf85ffcf

Se quiser tentar compilar ai, uso esses comandos:


apt-get install autoconf build-essential pkg-config automake libboost-all-dev libgmp3-dev libxml2-dev liblua5.1-0-dev libmysqlclient-dev libssl-dev libsqlite3-dev
cd /3777-master
chmod -R 777 src
cd src
./autogen.sh && ./configure --enable-sqlite --enable-mysql --enable-root-permission --enable-server-diag && ./build.sh

Editado por Fir3element (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Não tem opcode instalado ne? tentei colocar mas da uns erros que n sei como resolver

 

1>..\protocolgame.cpp(3287): error C2039: 'getByte' : is not a member of 'NetworkMessage'

 

teria como instalar opcode se possivel?

Link para o post
Compartilhar em outros sites

Ae sim, tava doido pro sqlite chegar, é doze depender de esperar o xampp pra testar algo simples, ahushaus! 

 

Arrumou o warningzinho do loop que te mandei ou só arrumou esses citado a cima ?

 

Indiquei essa source a um membro e ele disse que o link das dll's de 32x bits estão off.

 

 

                                                              ezgif-1-98aab239f3.gif.1a897c9c3225228909e7b356a5cfb8e4.gif

Link para o post
Compartilhar em outros sites

@Fir3element caralho c deixou isso aberto em um lugar durante 1 ano é?

Vou testar!

 

Pra quem ta com problemas para baixar os arquivos entrem no github do cara...

Link: https://github.com/Fir3element/3777

 

Não custa nada procurar :p

Editado por login12 (veja o histórico de edições)

 

@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

Parabéns por esse projeto que esta disponibilizando, consegui adicionar o opcode mas ele não manda para o client os dados, não sei porque... Queria ver se tem alguma forma de instalar opcode nessas sources ou não é possivel msm

Link para o post
Compartilhar em outros sites

Link para download 32bits quebrado!

 

                                                           

55f6tc.gif                     

Link para o post
Compartilhar em outros sites
2 horas atrás, Digoshow disse:

Link para download 32bits quebrado!

Arrumei

 

Em 08/12/2016 ás 01:38, login12 disse:

@Fir3element caralho c deixou isso aberto em um lugar durante 1 ano é?

Vou testar!

 

Pra quem ta com problemas para baixar os arquivos entrem no github do cara...

Link: https://github.com/Fir3element/3777

 

Não custa nada procurar :p

Sim, comecei com esse projeto no começo do ano, eu tava usando o tfs 0.3.6 desde 2010, encontrei alguns problemas e acabei migrando pra rev 3777, e deu certo :D

Editado por Fir3element (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

Como eu faco para adiciona no meu  serve.                                        deixa link de tutorial aki pf ajudam muito :D

Link para o post
Compartilhar em outros sites

@Fir3element, to usando sua source, porém no meu npc de rune está dando o seguinte erro,

[ShopModule.onSell]
Attempt to purchase an item which only sellable

Isso acontece quando eu tento comprar, Wands, rods, e outro item que não tenha carga, tipo spellbook e magiclight wand

 

npc/scripts/runes.lua

 

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

local talkState = {}



function onCreatureAppear(cid)				npcHandler:onCreatureAppear(cid)			end

function onCreatureDisappear(cid) 			npcHandler:onCreatureDisappear(cid)			end

function onCreatureSay(cid, type, msg)			npcHandler:onCreatureSay(cid, type, msg)		end

function onThink()					npcHandler:onThink()					end



local shopModule = ShopModule:new()

npcHandler:addModule(shopModule)



shopModule:addBuyableItem({'spellbook'}, 2175, 150, 'spellbook')

shopModule:addBuyableItem({'magic lightwand'}, 2163, 400, 'magic lightwand')



shopModule:addBuyableItem({'small health'}, 8704, 20, 1, 'small health potion')

shopModule:addBuyableItem({'health potion'}, 7618, 45, 1, 'health potion')

shopModule:addBuyableItem({'mana potion'}, 7620, 50, 1, 'mana potion')

shopModule:addBuyableItem({'strong health'}, 7588, 100, 1, 'strong health potion')

shopModule:addBuyableItem({'strong mana'}, 7589, 80, 1, 'strong mana potion')

shopModule:addBuyableItem({'great health'}, 7591, 190, 1, 'great health potion')

shopModule:addBuyableItem({'great mana'}, 7590, 120, 1, 'great mana potion')

shopModule:addBuyableItem({'great spirit'}, 8472, 190, 1, 'great spirit potion')

shopModule:addBuyableItem({'ultimate health'}, 8473, 310, 1, 'ultimate health potion')

shopModule:addBuyableItem({'antidote potion'}, 8474, 50, 1, 'antidote potion')



shopModule:addSellableItem({'normal potion flask', 'normal flask'}, 7636, 5, 'empty small potion flask')

shopModule:addSellableItem({'strong potion flask', 'strong flask'}, 7634, 10, 'empty strong potion flask')

shopModule:addSellableItem({'great potion flask', 'great flask'}, 7635, 15, 'empty great potion flask')



shopModule:addBuyableItem({'instense healing'}, 2265, 95, 1, 'intense healing rune')

shopModule:addBuyableItem({'ultimate healing'}, 2273, 175, 1, 'ultimate healing rune')

shopModule:addBuyableItem({'magic wall'}, 2293, 350, 3, 'magic wall rune')

shopModule:addBuyableItem({'destroy field'}, 2261, 45, 3, 'destroy field rune')

shopModule:addBuyableItem({'light magic missile'}, 2287, 40, 10, 'light magic missile rune')

shopModule:addBuyableItem({'heavy magic missile'}, 2311, 120, 10, 'heavy magic missile rune')

shopModule:addBuyableItem({'great fireball'}, 2304, 180, 4, 'great fireball rune')

shopModule:addBuyableItem({'explosion'}, 2313, 250, 6, 'explosion rune')

shopModule:addBuyableItem({'sudden death'}, 2268, 350, 3, 'sudden death rune')

shopModule:addBuyableItem({'death arrow'}, 2263, 300, 3, 'death arrow rune')

shopModule:addBuyableItem({'paralyze'}, 2278, 700, 1, 'paralyze rune')

shopModule:addBuyableItem({'animate dead'}, 2316, 375, 1, 'animate dead rune')

shopModule:addBuyableItem({'convince creature'}, 2290, 80, 1, 'convince creature rune')

shopModule:addBuyableItem({'chameleon'}, 2291, 210, 1, 'chameleon rune')

shopModule:addBuyableItem({'desintegrate'}, 2310, 80,  3, 'desintegreate rune')

shopModule:addBuyableItem({'blank rune'}, 2260, 10,  1, 'blank rune')



shopModule:addBuyableItemContainer({'bp slhp'}, 2000, 8704, 400, 1, 'backpack of small health potions')

shopModule:addBuyableItemContainer({'bp hp'}, 2000, 7618, 900, 1, 'backpack of health potions')

shopModule:addBuyableItemContainer({'bp mp'}, 2001, 7620, 1000, 1, 'backpack of mana potions')

shopModule:addBuyableItemContainer({'bp shp'}, 2000, 7588, 2000, 1, 'backpack of strong health potions')

shopModule:addBuyableItemContainer({'bp smp'}, 2001, 7589, 1600, 1, 'backpack of strong mana potions')

shopModule:addBuyableItemContainer({'bp ghp'}, 2000, 7591, 3800, 1, 'backpack of great health potions')

shopModule:addBuyableItemContainer({'bp gmp'}, 2001, 7590, 2400, 1, 'backpack of great mana potions')

shopModule:addBuyableItemContainer({'bp gsp'}, 1999, 8472, 3800, 1, 'backpack of great spirit potions')

shopModule:addBuyableItemContainer({'bp uhp'}, 2000, 8473, 6200, 1, 'backpack of ultimate health potions')

shopModule:addBuyableItemContainer({'bp ap'}, 2002, 8474, 2000, 1, 'backpack of antidote potions')



shopModule:addBuyableItem({'wand of vortex', 'vortex'}, 2190, 500, 'wand of vortex')

shopModule:addBuyableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 1000, 'wand of dragonbreath')

shopModule:addBuyableItem({'wand of decay', 'decay'}, 2188, 5000,'wand of decay')

shopModule:addBuyableItem({'wand of draconia', 'draconia'}, 8921, 7500, 'wand of draconia')

shopModule:addBuyableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 10000, 'wand of cosmic energy')

shopModule:addBuyableItem({'wand of inferno', 'inferno'}, 2187, 15000, 'wand of inferno')

shopModule:addBuyableItem({'wand of starstorm', 'starstorm'}, 8920, 18000, 'wand of starstorm')

shopModule:addBuyableItem({'wand of voodoo', 'voodoo'}, 8922, 22000, 'wand of voodoo')



shopModule:addBuyableItem({'snakebite rod', 'snakebite'}, 2182, 500, 'snakebite rod')

shopModule:addBuyableItem({'moonlight rod', 'moonlight'}, 2186, 1000, 'moonlight rod')

shopModule:addBuyableItem({'necrotic rod', 'necrotic'}, 2185, 5000, 'necrotic rod')

shopModule:addBuyableItem({'northwind rod', 'northwind'}, 8911, 7500, 'northwind rod')

shopModule:addBuyableItem({'terra rod', 'terra'}, 2181, 10000, 'terra rod')

shopModule:addBuyableItem({'hailstorm rod', 'hailstorm'}, 2183, 15000, 'hailstorm rod')

shopModule:addBuyableItem({'springsprout rod', 'springsprout'}, 8912, 18000, 'springsprout rod')

shopModule:addBuyableItem({'underworld rod', 'underworld'}, 8910, 22000, 'underworld rod')



shopModule:addSellableItem({'wand of vortex', 'vortex'}, 2190, 250, 'wand of vortex')

shopModule:addSellableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 500, 'wand of dragonbreath')

shopModule:addSellableItem({'wand of decay', 'decay'}, 2188, 2500, 1, 'wand of decay')

shopModule:addSellableItem({'wand of draconia', 'draconia'}, 8921, 3750, 'wand of draconia')

shopModule:addSellableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 5000, 'wand of cosmic energy')

shopModule:addSellableItem({'wand of inferno', 'inferno'},2187, 7500, 'wand of inferno')

shopModule:addSellableItem({'wand of starstorm', 'starstorm'}, 8920, 9000, 'wand of starstorm')

shopModule:addSellableItem({'wand of voodoo', 'voodoo'}, 8922, 11000, 'wand of voodoo')



shopModule:addSellableItem({'snakebite rod', 'snakebite'}, 2182, 250, 'snakebite rod')

shopModule:addSellableItem({'moonlight rod', 'moonlight'}, 2186, 500, 'moonlight rod')

shopModule:addSellableItem({'necrotic rod', 'necrotic'}, 2185, 2500, 'necrotic rod')

shopModule:addSellableItem({'northwind rod', 'northwind'}, 8911, 3750, 'northwind rod')

shopModule:addSellableItem({'terra rod', 'terra'}, 2181, 5000, 'terra rod')

shopModule:addSellableItem({'hailstorm rod', 'hailstorm'}, 2183, 7500, 'hailstorm rod')

shopModule:addSellableItem({'springsprout rod', 'springsprout'}, 8912, 9000, 'springsprout rod')

shopModule:addSellableItem({'underworld rod', 'underworld'}, 8910, 11000, 'underworld rod')



local items = {[1] = 2190, [2] = 2182, [5] = 2190, [6] = 2182}

function creatureSayCallback(cid, type, msg)

	if(not npcHandler:isFocused(cid)) then

		return false

	end



	local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid

	if(msgcontains(msg, 'first rod') or msgcontains(msg, 'first wand')) then

		if(isSorcerer(cid) or isDruid(cid)) then

			if(getPlayerStorageValue(cid, 30002) <= 0) then

				selfSay('So you ask me for a {' .. getItemNameById(items[getPlayerVocation(cid)]) .. '} to begin your advanture?', cid)

				talkState[talkUser] = 1

			else

				selfSay('What? I have already gave you one {' .. getItemNameById(items[getPlayerVocation(cid)]) .. '}!', cid)

			end

		else

			selfSay('Sorry, you aren\'t a druid either a sorcerer.', cid)

		end

	elseif(msgcontains(msg, 'yes')) then

		if(talkState[talkUser] == 1) then

			doPlayerAddItem(cid, items[getPlayerVocation(cid)], 1)

			selfSay('Here you are young adept, take care yourself.', cid)

			setPlayerStorageValue(cid, 30002, 1)

		end

		talkState[talkUser] = 0

	elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser])) then

		selfSay('Ok then.', cid)

		talkState[talkUser] = 0

	end



	return true

end



npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)

npcHandler:addModule(FocusModule:new())

 

Fico no aguardo!

Link para o post
Compartilhar em outros sites

Grande, @Fir3element!

A compilação do Ubuntu lá que eu te pedi? Pois é, deu certo. Você é o cara!

Só voltei pra agradecer e dar REP + :accept: novamente, pois seu esforço merece.

 

Mas só aproveitando que retornei aqui, também senti a necessidade - assim como o pessoal aí em cima - de Extended Opcode instalados nessa Source.

Quem sabe na sua próxima atualização você possa fazer isso.

No mais...

Grande abraço!

cms1-pr%C3%AAmio.png

Link para o post
Compartilhar em outros sites
  • Erimyth unpinned this tópico

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 Veigh
      IP: HYPEOT.COM (Versão 8.60) Por que jogar no HYPEOT? Confira nossos diferenciais: Sistema de Reset 180+ Montarias 65+ Outfits Sistema de Stage Sistema de Pesca Sistema de Refinamento Sistema de Aura Sistema de Mineração Sistema de Woodcut Sistema de Dungeons Sistema de Survival Mais de 30 Bosses de Alavancas +10 Eventos Automáticos Mais de 5 anos online com apenas 2 resets. Agora estamos de volta com força total desde 05/12! O que você está esperando? Junte-se à aventura e faça parte dessa jornada épica! Conecte-se agora mesmo e não fique de fora!
    • Por L3K0T
      Se você está enfrentando o problema de jogadores ganhando experiência ao matar outros jogadores em um servidor PVP, e já tentou várias soluções sem sucesso, este tutorial vai te ajudar a resolver isso. A modificação que vou mostrar foi eficaz para mim e pode ser a solução para o seu servidor também.
       
      Passo 1: Acesse o arquivo creature.cpp
      Primeiro, abra o arquivo creature.cpp, que está localizado na pasta src ou sources do seu servidor. Esse arquivo contém a lógica das criaturas, incluindo a parte de quando um jogador mata outra criatura.
       
      Passo 2: Localize o  onAttackedCreatureKilled
      Dentro do arquivo, procure pela função onAttackedCreatureKilled:
       
      void Creature::onAttackedCreatureKilled(Creature* target) { if(target == this) return; double gainExp = target->getGainedExperience(this); onGainExperience(gainExp, !target->getPlayer(), false); }  
      Altere para
       
      void Creature::onAttackedCreatureKilled(Creature* target) { if (target == this) return; // Verifica se o atacante e o alvo são jogadores Player* attackerPlayer = this->getPlayer(); Player* targetPlayer = target->getPlayer(); if (attackerPlayer && targetPlayer) return; if (!attackerPlayer && targetPlayer) { double gainExp = target->getGainedExperience(this); onGainExperience(gainExp, !target->getPlayer(), false); } else if (attackerPlayer) { double gainExp = target->getGainedExperience(this); onGainExperience(gainExp, true, false); } }  
      Agora Recompile modo Rebuilder (LIMPA) e pronto!!!
       
      Aqui está o que mudou:
      *A primeira modificação verifica se o atacante e o alvo são jogadores. Se ambos forem jogadores, não será concedida experiência.
      *Se o atacante for um monstro, a experiência será concedida normalmente ao jogador.
      *Se o atacante for um jogador, ele ganhará a experiência normalmente.
       
      Créditos @L3K0T
    • Por Emooooo
      gostaria de um sistema em que o player usar um item nele, e quando ele bater no monstro ou outro player ele enchesse um pouco da mana e do life por porcentagem do dano causado, e com tempo de duração de duas horas depois tem que usar o item novamente.
      tfs 0.3.6
       
       
      +rep
    • Por L3K0T
      Sistema de Drop Personalizado
       
      Esse sistema de loot foi projetado para adicionar um elemento de sorte e surpresa ao derrotar monstros. Sempre que um jogador derrota um monstro, há uma chance configurada para que ele solte entre 1 a 3 itens especiais, garantindo recompensas valiosas ao jogador.
       
      O sistema realiza as seguintes ações:
      Chance de Drop: A cada morte de um monstro, há uma chance configurada para dropar itens específicos. O sistema permite que sejam dropados entre 1 a 3 unidades do item, tornando o sistema mais dinâmico.
       
      Efeito Visual: Quando o loot é bem-sucedido, um efeito visual especial (ID 231) é exibido na posição exata onde o monstro foi derrotado, criando uma animação visual que destaca a recompensa.
       
      Notificação ao Jogador: Após o drop, o jogador recebe uma mensagem personalizada informando a quantidade de itens obtidos. Essa notificação aparece após 3 segundos, adicionando uma camada de imersão e evitando sobrecarregar o chat imediatamente após a morte do monstro.
       
      *Ótimo para fazer eventos de dropar certo itens para alguma missão ou resgates.
      *Uso no meu TIBIA HARRY POTTER ORIGIN
       
      VAi em creaturescripts/scripts.lua
      local function findCorpse(position) for i = 1, 255 do position.stackpos = i local corpse = getThingfromPos(position) if isCorpse(corpse.uid) then return corpse.uid end end return false end local function dropLoot(position, killer) local corpse = findCorpse(position) if not corpse then return false end local itemId = 2160 local chance = 23 if math.random(100) <= chance then local amountToDrop = math.random(1, 3) doAddContainerItem(corpse, itemId, amountToDrop) local corpsePosition = getThingPos(corpse) doSendMagicEffect(corpsePosition, 7) local function sendMessage() if isPlayer(killer) then local message = string.format("Você dropou %d Crystal Coin(s).", amountToDrop) doPlayerSendTextMessage(killer, MESSAGE_INFO_DESCR, message) end end addEvent(sendMessage, 2500) end return true end function onKill(cid, target) local position = getCreaturePosition(target) addEvent(dropLoot, 100, position, cid) return true end  
      creaturescripts.xml
      <event type="kill" name="GlobalDrops" registerTo ="GlobalDrops" event="script" value="globalDrops.lua"/> ou depende do tfs
      <event type="kill" name="GlobalDrops" event="script" value="globalDrops.lua"/>  
      Para ambos TFS registra o evento no login.lua
      registerTo ="GlobalDrops"
      feito isso.. agora todos os monstros do mapa vai cair os crystal coins de 1 há 3.
    • Por L3K0T
      TUTORIAL BY L3K0T PT~EN
       
      Olá pessoal, trago a vocês uma atualização que fiz no sistema, contendo 3 novas funcionalidades de movimentação de itens e uma proteção contra Elf Bot. Estas adições foram cuidadosamente implementadas para aperfeiçoar a experiência de jogo e manter a integridade do seu servidor.
      As novas funcionalidades têm a função vital de impedir que jogadores deixem itens indesejados em locais inapropriados, como na entrada de sua casa, em cima de seus depósitos ou em teleportes. Agora, apenas proprietários, subproprietários e convidados têm permissão para manipular itens nesses locais.
      Este pacote de atualização foi meticulosamente revisado para evitar abusos por parte de jogadores mal-intencionados e garantir um ambiente de jogo justo e equilibrado para todos os usuários.
       
       
       
      Iniciando o Tutorial
      1Abra o arquivo "creatureevents.cpp" com o editor de sua preferência. Eu pessoalmente recomendo o Notepad++. 
       
       
      Em creatureevents.cpp:
      return "onPrepareDeath"; Adicione abaixo:
      case CREATURE_EVENT_MOVEITEM: return "onMoveItem"; case CREATURE_EVENT_MOVEITEM2: return "onMoveItem2";  
      Em:
      return "cid, deathList"; Adicione abaixo:
      case CREATURE_EVENT_MOVEITEM: return "moveItem, frompos, topos, cid"; case CREATURE_EVENT_MOVEITEM2: return "cid, item, count, toContainer, fromContainer, fromPos, toPos";  
      Em:
      m_type = CREATURE_EVENT_PREPAREDEATH; Adicione abaixo:
      else if(tmpStr == "moveitem") m_type = CREATURE_EVENT_MOVEITEM; else if(tmpStr == "moveitem2") m_type = CREATURE_EVENT_MOVEITEM2;  
      Procure por:
      bool CreatureEvents::playerLogout(Player* player, bool forceLogout) { //fire global event if is registered bool result = true; for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_LOGOUT && (*it)->isLoaded() && !(*it)->executeLogout(player, forceLogout) && result) result = false; } return result; } Adicione abaixo:
      uint32_t CreatureEvents::executeMoveItems(Creature* actor, Item* item, const Position& frompos, const Position& pos) { // fire global event if is registered for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_MOVEITEM) { if(!(*it)->executeMoveItem(actor, item, frompos, pos)) return 0; } } return 1; }  
      Em:
      bool CreatureEvents::playerLogin(Player* player) { //fire global event if is registered bool result = true; for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { if((*it)->getEventType() == CREATURE_EVENT_LOGIN && (*it)->isLoaded() && !(*it)->executeLogin(player) && result) result = false; } if (result) { for(CreatureEventList::iterator it = m_creatureEvents.begin(); it != m_creatureEvents.end(); ++it) { CreatureEvent* event = *it; if(event->isLoaded() && ( event->getRegister() == "player" || event->getRegister() == "all") ) player->registerCreatureEvent(event->getName()); } } return result; } Adicione Abaixo:
      uint32_t CreatureEvent::executeMoveItem(Creature* actor, Item* item, const Position& frompos, const Position& pos) { //onMoveItem(moveItem, frompos, position, cid) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(pos); std::stringstream scriptstream; env->streamThing(scriptstream, "moveItem", item, env->addThing(item)); env->streamPosition(scriptstream, "position", frompos, 0); env->streamPosition(scriptstream, "position", pos, 0); scriptstream << "local cid = " << env->addThing(actor) << std::endl; scriptstream << m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ char desc[35]; sprintf(desc, "%s", player->getName().c_str()); env->setEventDesc(desc); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(pos); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); LuaInterface::pushThing(L, item, env->addThing(item)); LuaInterface::pushPosition(L, frompos, 0); LuaInterface::pushPosition(L, pos, 0); lua_pushnumber(L, env->addThing(actor)); bool result = m_interface->callFunction(4); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::executeMoveItem] Call stack overflow." << std::endl; return 0; } } uint32_t CreatureEvent::executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack) { //onMoveItem2(cid, item, count, toContainer, fromContainer, fromPos, toPos) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(player->getPosition()); std::stringstream scriptstream; scriptstream << "local cid = " << env->addThing(player) << std::endl; env->streamThing(scriptstream, "item", item, env->addThing(item)); scriptstream << "local count = " << count << std::endl; env->streamThing(scriptstream, "toContainer", toContainer, env->addThing(toContainer)); env->streamThing(scriptstream, "fromContainer", fromContainer, env->addThing(fromContainer)); env->streamPosition(scriptstream, "fromPos", fromPos, fstack); env->streamPosition(scriptstream, "toPos", toPos, 0); scriptstream << m_scriptData; bool result = true; if(m_interface->loadBuffer(scriptstream.str())) { lua_State* L = m_interface->getState(); result = m_interface->getGlobalBool(L, "_result", true); } m_interface->releaseEnv(); return result; } else { #ifdef __DEBUG_LUASCRIPTS__ char desc[30]; sprintf(desc, "%s", player->getName().c_str()); env->setEvent(desc); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(player->getPosition()); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(player)); LuaInterface::pushThing(L, item, env->addThing(item)); lua_pushnumber(L, count); LuaInterface::pushThing(L, toContainer, env->addThing(toContainer)); LuaInterface::pushThing(L, fromContainer, env->addThing(fromContainer)); LuaInterface::pushPosition(L, fromPos, fstack); LuaInterface::pushPosition(L, toPos, 0); //lua_pushnumber(L, env->addThing(actor)); bool result = m_interface->callFunction(7); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::executeMoveItem] Call stack overflow." << std::endl; return 0; } }  
       
       
      Agora em em creatureevents.h:
      CREATURE_EVENT_PREPAREDEATH, Adicione abaixo:
      CREATURE_EVENT_MOVEITEM, CREATURE_EVENT_MOVEITEM2  
      Em:
      uint32_t executePrepareDeath(Creature* creature, DeathList deathList); Adicione abaixo:
      uint32_t executeMoveItem(Creature* actor, Item* item, const Position& frompos, const Position& pos); uint32_t executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack);  
      Em:
      bool playerLogout(Player* player, bool forceLogout); Abaixo adicone também
      uint32_t executeMoveItems(Creature* actor, Item* item, const Position& frompos, const Position& pos); uint32_t executeMoveItem2(Player* player, Item* item, uint8_t count, const Position& fromPos, const Position& toPos, Item* toContainer, Item* fromContainer, int16_t fstack);  
       
      Agora em em game.cpp:
      if(!canThrowObjectTo(mapFromPos, mapToPos) && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere)) { player->sendCancelMessage(RET_CANNOTTHROW); return false; } ReturnValue ret = internalMoveItem(player, fromCylinder, toCylinder, toIndex, item, count, NULL); if(ret == RET_NOERROR) return true; player->sendCancelMessage(ret); return false; } Altere para:
      if (!canThrowObjectTo(mapFromPos, mapToPos) && !player->hasCustomFlag(PlayerCustomFlag_CanThrowAnywhere)) { player->sendCancelMessage(RET_CANNOTTHROW); return false; } bool success = true; CreatureEventList moveitemEvents = player->getCreatureEvents(CREATURE_EVENT_MOVEITEM2); for (CreatureEventList::iterator it = moveitemEvents.begin(); it != moveitemEvents.end(); ++it) { Item* toContainer = toCylinder->getItem(); Item* fromContainer = fromCylinder->getItem(); if (!(*it)->executeMoveItem2(player, item, count, fromPos, toPos, (toContainer ? toContainer : 0), (fromContainer ? fromContainer : 0), fromStackpos) && success) success = false; } if (!success) return false; if (g_config.getBool(ConfigManager::ANTI_PUSH)) { std::string antiPushItems = g_config.getString(ConfigManager::ANTI_PUSH_ITEMS); IntegerVec tmpVec = vectorAtoi(explodeString(antiPushItems, ",")); if (tmpVec[0] != 0) { for (IntegerVec::iterator it = tmpVec.begin(); it != tmpVec.end(); ++it) { if (item->getID() == uint32_t(*it) && player->hasCondition(CONDITION_EXHAUST, 1)) { player->sendTextMessage(MSG_STATUS_SMALL, "Please wait a few seconds to move this item."); return false; } } } } int32_t delay = g_config.getNumber(ConfigManager::ANTI_PUSH_DELAY); if (Condition* condition = Condition::createCondition(CONDITIONID_DEFAULT, CONDITION_EXHAUST, delay, 0, false, 1)) player->addCondition(condition); if (!g_creatureEvents->executeMoveItems(player, item, mapFromPos, mapToPos)) return false; ReturnValue ret = internalMoveItem(player, fromCylinder, toCylinder, toIndex, item, count, NULL); if (ret != RET_NOERROR) { player->sendCancelMessage(ret); return false; } player->setNextAction(OTSYS_TIME() + g_config.getNumber(ConfigManager::ACTIONS_DELAY_INTERVAL) - 10); return true; }  
      Agora em configmanager.h
      ADMIN_ENCRYPTION_DATA Adicione abaixo:
      ANTI_PUSH_ITEMS,  
      em:
      STAMINA_DESTROY_LOOT, Adicione abaixo:
      ANTI_PUSH_DELAY,  
      em:
      ADDONS_PREMIUM, Adicione abaixo:
      ANTI_PUSH  
      Agora você pode compilar a Source.
       
       
      Configurando no servidor:
       
      Abra seu config.lua do servidor e adicione isso dentro qualquer lugar:
      -- Anti-Push useAntiPush = true antiPushItems = "2148,2152,2160,3976" antiPushDelay = 500  
       
      Navegue até o diretório 'creaturescripts' e localize o arquivo 'login.lua'.
      em resgistros de eventos adicione:
      login.lua
      registerCreatureEvent(cid, "MoveItem") registerCreatureEvent(cid, "MoveItem2")  
      Agora abra o aquivo creaturescript .xml
      <event type="moveitem" name="MoveItem" event="script" value="houseprotecao.lua"/> <event type="moveitem2" name="MoveItem2" event="script" value="moveitem2.lua"/>  
      Crie um novo arquivo lua em scripts com o nome houseprotecao.lua e adicione isso:
      function onMoveItem(moveItem, frompos, position, cid) if position.x == CONTAINER_POSITION then return true end local house = getHouseFromPos(frompos) or getHouseFromPos(position) --correção 100% if type(house) == "number" then local owner = getHouseOwner(house) if owner == 0 then return false, doPlayerSendCancel(cid, "Isso não é Possível.") end if owner ~= getPlayerGUID(cid) then local sub = getHouseAccessList(house, 0x101):explode("\n") local guest = getHouseAccessList(house, 0x100):explode("\n") local isInvited = false if (#sub > 0) and isInArray(sub, getCreatureName(cid)) then isInvited = true end if (#guest > 0) and isInArray(guest, getCreatureName(cid)) then isInvited = true end if not isInvited then return false, doPlayerSendCancel(cid, "Desculpe, você não está invitado.") end end end return true end  
      Crie um novo arquivo lua em scripts com o nome moveitem2.lua e adicione isso abaixo:
      local depottiles = {} --piso pra n jogar local depots = {2589} --id dos dps local group = 3 --id dos group 6 é todos. local function checkIfThrow(pos,topos) if topos.x == 0xffff then return false end local thing = getThingFromPos(pos) if isInArray(depottiles,thing.itemid) then if not isInArea(topos,{x=pos.x-1,y=pos.y-1,z=pos.z},{x=pos.x+1,y=pos.y+1, z=pos.z}) then return true end else for i = 1, #depots do if depots[i] == getTileItemById(topos,depots[i]).itemid or getTileInfo(topos).actionid == 7483 then return true end end end return false end function onMoveItem2(cid, item, count, toContainer, fromContainer, fromPos, toPos) if isPlayer(cid) then local pos = getThingPos(cid) if getPlayerGroupId(cid) > group then return true end if checkIfThrow({x=pos.x,y=pos.y,z=pos.z,stackpos=0},toPos) then doPlayerSendCancel(cid,"Não jogue item ai!!") doSendMagicEffect(getThingPos(cid),CONST_ME_POFF) return false end end return true end  
      ajudei?? REP+
      CRÉDITOS:
      @L3K0T
      Fir3element
      Summ
      Wise
      GOD Wille
      Yan Lima
       
       
       
       



×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo