Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Abri um OT 8.60 recentemente, porém desde quando abri ele os NPC's estão com um bug.

 

Ex.

 

Quando eu crio um NPC ./n Loot Buyer, ele cria normal, falo hi,trade ele funciona normal, mostra tudo que ele vende, porém....

 

Quando vou criar outro NPC, ./n Mage Seller, ele não responde o hi, só me responde se eu falar "trade" e quando mostra os items pra vender, ele vende tudo que o Loot Buyer vende, e assim por diante, se eu criar um Soft Boots Seller, ele vende tudo que o Loot buyer vende.

 

 

Alguem sabe resolver?

Link para o post
Compartilhar em outros sites
16 minutos atrás, Weslley Kiyo disse:

Posta os scripts .xml e .lua(se existir) dos npcs

Loot Buyer.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Loot Buyer" script="data/npc/scripts/loot.lua" walkinterval="2000" floorchange="0">
	<health now="150" max="150"/>
	<look type="155" head="79" body="114" legs="71" feet="0" addons="3"/>
	<parameters>
		<parameter key="module_shop" value="1"/>
		<parameter key="message_greet" value="Hello |PLAYERNAME|. I buy swords, clubs, axes, helmets, boots, legs, shields and armors."/>
		<parameter key="shop_sellable" value="royal helmet,2498,40000;warrior helmet,2475,6000;crusader helmet,2497,9000;crown helmet,2491,5000;devil helmet,2462,4000;mystic turban,2663,500;chain helmet,2458,35;iron helmet,2459,30;steel boots,2645,60000;boots of haste,2195,40000;golden boots,2646,100000;magic plate armor,2472,100000;dragon scale mail,2492,60000;demon armor,2494,90000;golden armor,2466,30000;crown armor,2487,20000;knight armor,2476,5000;blue robe,2656,15000;lady armor,2500,2500;plate armor,2463,400;brass armor,2465,200;chain armor,2464,100;golden legs,2470,80000;crown legs,2488,15000;knight legs,2477,6000;plate legs,2647,500;brass legs,2487,100;mastermind shield,2514,80000;demon shield,2520,40000;blessed shield,2523,150000;great shield,2522,100000;magma boots,7891,100000;nightmare shield,6391,100000;frozen starlight,2361,120000;vampire shield,2534,25000;medusa shield,2536,8000;amazon shield,2537,4000;crown shield,2519,5000;tower shield,2528,4000;guardian shield,2515,200;beholder shield,2518,1500;dwarven shield,2525,100;magic longsword,2390,150000;warlord sword,2408,100000;magic sword,2400,90000;giant sword,2393,10000;bright sword,2407,6000;ice rapier,2396,4000;fire sword,2392,3000;serpent sword,2409,1500;spike sword,2383,800;two handed sword,2377,400;broad sword,2413,70;short sword,2406,30;sword,2376,25;dragon lance,2414,10000;stonecutter axe,2431,90000;guardian halberd,2427,7500;fire axe,2432,10000;knight axe,2430,2000;double axe,2387,200;halberd,2381,200;battle axe,2378,100;hatchet,2388,20;war hammer,2391,6000;thunder hammer,2421,90000;skull staff,2436,1000;dragon hammer,2434,2000;clerical mace,2423,200;battle hammer,2417,60;mace,2398,30;"/>
	</parameters>
</npc>

Loot Buyer.script

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

-- Don't forget npcHandler = npcHandler in the parameters. It is required for all StdModule functions!
keywordHandler:addKeyword({'helmets'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy royal (40k), warrior (6k), crusader (9k), crown (5k), devil (4k), chain (35gp) and iron helmets (30gp), also mystic turbans (500gp).'})
keywordHandler:addKeyword({'boots'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden boots (100k), steel boots (40k) and boots of haste (40k).'})
keywordHandler:addKeyword({'armors'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (30k), crown (20k), knight (5k), lady (7,5k), plate (400gp), brass (200gp) and chain armors (100gp), also mpa (100k), dsm (60k) and blue robes (15k).'})
keywordHandler:addKeyword({'legs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy golden (80k), crown (15k), knight (6k), plate (500gp) and brass legs (100gp).'})
keywordHandler:addKeyword({'shields'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy blessed (150k), great (100k), demon (40k), vampire (25k), medusa (8k), amazon (4k), crown (5k), tower (4k), dragon (3k), guardian (2k), beholder (1k), and dwarven shields (100gp), also mms (80k).'})
keywordHandler:addKeyword({'swords'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy giant (10k), bright (6k), fire (3k) serpent (1.5k), spike (800gp) and two handed swords (400gp), also ice rapiers (4k), magic longswords (150k), magic swords (90k), warlord swords (100k) broad swords (70gp), short swords (30gp), sabres (25gp) and swords (25gp).'})
keywordHandler:addKeyword({'axes'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy fire (10k), guardian halberds (7,5k) knight (2k), double (200gp) and battle axes (100gp), also dragon lances (10k), stonecutters axes (90k), halberds (200gp) and hatchets (20gp).'})
keywordHandler:addKeyword({'clubs'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'I buy thunder hammers (90k), war (6k), dragon (2k) and battle hammers (60gp), also skull staffs (10k) and clerical maces (200gp).'})

npcHandler:addModule(FocusModule:new())

 

 

Mage Seller.xml

<?xml version="1.0" encoding="UTF-8"?>
<npc name="Mage Seller" script="data/npc/scripts/runes.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="130" head="39" body="114" legs="114" feet="94" addons="1"/>
	<parameters>
		<parameter key="message_greet" value="Ola |PLAYERNAME|. Eu vendo runes, potions e etc. Diga {trade}."/>
		<parameter key="message_decline" value="Is |TOTALCOST| gold coins too much for you? Get out of here!"/>
	</parameters>
</npc>

 

Mage Seller.script

local keywordHandler = KeywordHandler:new()

local npcHandler = NpcHandler:new(keywordHandler)

NpcSystem.parseParameters(npcHandler)

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 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:addBuyableItemContainer({'bp intense healing'}, 2000, 2265, 1900, 25, 'backpack of intense healing rune')
shopModule:addBuyableItemContainer({'bp blank rune'}, 2000, 2260, 200, 25, 'backpack of blank rune')
shopModule:addBuyableItemContainer({'bp ultimate healing'}, 2000, 2273, 3500, 25, 'backpack of ultimate healing rune')
shopModule:addBuyableItemContainer({'bp magic wall'}, 2000, 2293, 7000, 25, 'backpack of magic wall rune')
shopModule:addBuyableItemContainer({'bp destroy field'}, 2000, 2261, 900, 25, 'backpack of destroy field rune')
shopModule:addBuyableItemContainer({'bp light magic missile'}, 2000, 2287, 800, 25, 'backpack of light magic missile rune')
shopModule:addBuyableItemContainer({'bp heavy magic missile'}, 2000, 2311, 2400, 25, 'backpack of heavy magic missile rune')
shopModule:addBuyableItemContainer({'bp great fireball'}, 2000, 2304, 3600, 25, 'backpack of great fireball rune')
shopModule:addBuyableItemContainer({'bp explosion'}, 2000, 2313, 5000, 25, 'backpack of explosion rune')
shopModule:addBuyableItemContainer({'bp sudden death'}, 2000, 2268, 6500, 25, 'backpack of sudden death rune')
shopModule:addBuyableItemContainer({'bp mage sd'}, 2000, 2263, 2000000, 100, 'backpack of mage sd rune')
shopModule:addBuyableItemContainer({'bp paralyze'}, 2000, 2278, 14000, 25, 'backpack of paralyze rune')
shopModule:addBuyableItemContainer({'bp animate dead'}, 2000, 2316, 6500, 25, 'backpack of animate dead rune')
shopModule:addBuyableItemContainer({'bp convince creature'}, 2000, 2290, 1600, 25, 'backpack of convince creature rune')
shopModule:addBuyableItemContainer({'bp chameleon'}, 2000, 2291, 4200, 25, 'backpack of chameleon rune')
shopModule:addBuyableItemContainer({'bp desintegrate'}, 2000, 2310, 1600, 25, 'backpack of desintegreate rune')
shopModule:addBuyableItemContainer({'bp icicle'}, 2000, 2271, 2000, 25, 'backpack of icicle rune')
shopModule:addBuyableItemContainer({'bp stalagmite'}, 2000, 2292, 2000, 25, 'backpack of stalagmite rune')
shopModule:addBuyableItemContainer({'bp avalanche'}, 2000, 2274, 2000, 25, 'backpack of avalanche rune')
shopModule:addBuyableItemContainer({'bp stone shower'}, 2000, 2288, 2000, 25, 'backpack of stone shower rune')

shopModule:addBuyableItem({'instense healing'}, 2265, 95, 25, 'intense healing rune')
shopModule:addBuyableItem({'blank rune'}, 2260, 10, 1, 'blank rune')
shopModule:addBuyableItem({'ultimate healing'}, 2273, 175, 25, 'ultimate healing rune')
shopModule:addBuyableItem({'magic wall'}, 2293, 350, 25, 'magic wall rune')
shopModule:addBuyableItem({'light magic missile'}, 2287, 40, 25, 'light magic missile rune')
shopModule:addBuyableItem({'heavy magic missile'}, 2311, 120, 25, 'heavy magic missile rune')
shopModule:addBuyableItem({'great fireball'}, 2304, 180, 25, 'great fireball rune')
shopModule:addBuyableItem({'explosion'}, 2313, 250, 25, 'explosion rune')
shopModule:addBuyableItem({'sudden death'}, 2268, 350, 25, 'sudden death rune')
shopModule:addBuyableItem({'mage sd'}, 2263, 100000, 100, 'mage sd rune')
shopModule:addBuyableItem({'creat bomb'}, 2264, 100000, 25, 'creat bomb rune')
shopModule:addBuyableItem({'paralyze'}, 2278, 700, 25, 'paralyze rune')
shopModule:addBuyableItem({'animate dead'}, 2316, 375, 25, 'animate dead rune')
shopModule:addBuyableItem({'convince creature'}, 2290, 80, 25, 'convince creature rune')
shopModule:addBuyableItem({'chameleon'}, 2291, 210, 25, 'chameleon rune')
shopModule:addBuyableItem({'desintegrate'}, 2310, 80,  25, 'desintegreate rune')
shopModule:addBuyableItem({'icicle'}, 2271, 100,  25, 'icicle rune')
shopModule:addBuyableItem({'stalagmite'}, 2292, 100,  25, 'stalagmite rune')
shopModule:addBuyableItem({'avalanche'}, 2274, 100,  25, 'avalanche rune')
shopModule:addBuyableItem({'stone shower'}, 2288, 100,  25, 'stone shower 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 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({'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({'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, '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'}, 7958, 9000, 'wand of starstorm')

npcHandler:addModule(FocusModule:new())

 

 

Não vou postar todos porque até NPC que nem vende item bugou junto(NPC que troca o sexo, passou a vender também).

Link para o post
Compartilhar em outros sites
  • 3 weeks later...

posta o arquivo ..\data\NPC\Lib\NPC.lua

e o arquivo ..data\npc\scripts\default.lua

 

 

n conheço tanto de 8.6.. mais pelo q sei, n tem nada de errado nos npc..

 

oq parece eh q vc tah usando script de tfs 1.0 em um server 0.4...

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

posta o arquivo ..\data\NPC\Lib\NPC.lua

e o arquivo ..data\npc\scripts\default.lua

 

 

n conheço tanto de 8.6.. mais pelo q sei, n tem nada de errado nos npc..

 

oq parece eh q vc tah usando script de tfs 1.0 em um server 0.4...

 

Agora os NPC's nem respondem cara.. falo hi, eles nem respondem :\

 

 

npc.lua

-- Include the Advanced NPC System
dofile('data/npc/lib/npcsystem/npcsystem.lua')

function doMessageCheck(message, keyword)
	if(type(keyword) == "table") then
		return table.isStrIn(keyword, message)
	else	
		local a, b = message:lower():find(keyword:lower())
		if(a ~= nil and b ~= nil) then
			return true
		end
	end

	return false
end

function selfGotoIdle()
	following = false
	attacking = false
	selfAttackCreature(0)
	target = 0
end

function selfMoveToCreature(id)
	if(id == 0 or id == nil) then
		selfGotoIdle()
	end

	local t = {}
	t.x, t.y, t.z = getCreaturePosition(id)
	if(t.x == nil) then
		selfGotoIdle()
	else
		moveToPosition(t.x, t.y, t.z)
	end
end

function getDistanceToCreature(id)
	if(id == 0 or id == nil) then
		selfGotoIdle()
	end

	local c = {}
	c.x, c.y, c.z = getCreaturePosition(id)
	if(c.x == nil) then
		return nil
	end

	local s = {}
	s.x, s.y, s.z = selfGetPosition()
	if(s.z ~= c.z) then
		return nil
	end

	return math.max(math.abs(s.x - c.x), math.abs(s.y - c.y))
end

function doNpcSellItem(cid, itemid, amount, subType, ignoreCap, inBackpacks, backpack)
	local amount = amount or 1
	local subType = subType or 0
	local ignoreCap = ignoreCap and TRUE or FALSE

	local item = 0
	if(isItemStackable(itemid) == TRUE) then
		item = doCreateItemEx(itemid, amount)
		if(doPlayerAddItemEx(cid, item, ignoreCap) ~= RETURNVALUE_NOERROR) then
			return 0, 0
		end

		return amount, 0
	end

	local a = 0
	if(inBackpacks) then
		local container = doCreateItemEx(backpack, 1)
		local b = 1
		for i = 1, amount do
			item = doAddContainerItem(container, itemid, subType)
			if(itemid == ITEM_PARCEL) then
				doAddContainerItem(item, ITEM_LABEL)
			end

			if(isInArray({(getContainerCapById(backpack) * b), amount}, i) == TRUE) then
				if(doPlayerAddItemEx(cid, container, ignoreCap) ~= RETURNVALUE_NOERROR) then
					break
				end

				a = i
				if(amount > i) then
					container = doCreateItemEx(backpack, 1)
					b = b + 1
				end
			end
		end
		return a, b
	end

	for i = 1, amount do
		item = doCreateItemEx(itemid, subType)
		if(itemid == ITEM_PARCEL) then
			doAddContainerItem(item, ITEM_LABEL)
		end

		if(doPlayerAddItemEx(cid, item, ignoreCap) ~= RETURNVALUE_NOERROR) then
			break
		end
		a = i
	end
	return a, 0
end

function doPosRemoveItem(_itemid, n, position)
	local thing = getThingFromPos({x = position.x, y = position.y, z = position.z, stackpos = 1})
	if(thing.itemid == _itemid) then
		doRemoveItem(thing.uid, n)
		return true
	end

	return false
end

function isPlayerPremiumCallback(cid)
	return isPremium(cid) == TRUE
end

function selfSayChannel(cid, message)
	return selfSay(message, cid, FALSE)
end

msgcontains = doMessageCheck
moveToPosition = selfMoveTo
moveToCreature = selfMoveToCreature
selfMoveToPosition = selfMoveTo
doNpcBuyItem = doPlayerRemoveItem

 

 

default.lua

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

npcHandler:addModule(FocusModule:new())

 

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 cloudrun2023
      CloudRun - Sua Melhor Escolha para Hospedagem de OTServer!
      Você está procurando a solução definitiva para hospedar seu OTServer com desempenho imbatível e segurança inigualável? Não procure mais! Apresentamos a CloudRun, sua parceira confiável em serviços de hospedagem na nuvem.
       
      Recursos Exclusivos - Proteção DDoS Avançada:
      Mantenha seu OTServer online e seguro com nossa robusta proteção DDoS, garantindo uma experiência de jogo ininterrupta para seus jogadores.
       
      Servidores Ryzen 7 Poderosos: Desfrute do poder de processamento superior dos servidores Ryzen 7 para garantir um desempenho excepcional do seu OTServer. Velocidade e estabilidade garantidas!
       
      Armazenamento NVMe de Alta Velocidade:
      Reduza o tempo de carregamento do jogo com nosso armazenamento NVMe ultrarrápido. Seus jogadores vão adorar a rapidez com que podem explorar o mundo do seu OTServer.
       
      Uplink de até 1GB:
      Oferecemos uma conexão de alta velocidade com até 1GB de largura de banda, garantindo uma experiência de jogo suave e livre de lag para todos os seus jogadores, mesmo nos momentos de pico.
       
      Suporte 24 Horas:
      Estamos sempre aqui para você! Nossa equipe de suporte está disponível 24 horas por dia, 7 dias por semana, para resolver qualquer problema ou responder a qualquer pergunta que você possa ter. Sua satisfação é a nossa prioridade.
       
      Fácil e Rápido de Começar:
      Configurar seu OTServer na CloudRun é simples e rápido. Concentre-se no desenvolvimento do seu jogo enquanto cuidamos da hospedagem.
       
      Entre em Contato Agora!
      Website: https://central.cloudrun.com.br/index.php?rp=/store/cloud-ryzen-brasil
      Email: [email protected]
      Telefone: (47) 99902-5147

      Não comprometa a qualidade da hospedagem do seu OTServer. Escolha a CloudRun e ofereça aos seus jogadores a melhor experiência de jogo possível. Visite nosso site hoje mesmo para conhecer nossos planos e começar!
       
      https://central.cloudrun.com.br/index.php?rp=/store/cloud-ryzen-brasil
       
      CloudRun - Onde a Velocidade Encontra a Confiabilidade!
       

    • Por FeeTads
      SALVE rapaziada do TK, esses dias vim pensando em novos scripts pro meu OT, e em um deles eu precisava que determinada area não contasse frag pro player que matasse outros, PORÉM eu precisava que os players que morressem nessa area ainda assim tivessem as penalidades da sua morte, procurei por ai, achei alguns scripts que apenas tiravam o SKULL e não realmente o FRAG do player.

      **script atualizado 22/10/2023** - melhorado e otimizado, levei o script pra puxar as infos por .lua / creatureScripts

      vou disponibilizar o code aqui, e o que fazer pra determinada area não contar frag.

      SOURCE OTX 2 / TFS 0.x, Funciona em TFS 1.x mudando as tags e ajeitando as sintaxes.

      vá em creatureevent.cpp

      procure por:
      else if(type == "preparedeath") _type = CREATURE_EVENT_PREPAREDEATH;
      Adiciona abaixo:
      else if(type == "nocountfrag") _type = CREATURE_EVENT_NOCOUNTFRAG;

      procure por:
      case CREATURE_EVENT_PREPAREDEATH: return "onPrepareDeath";  
      Adicione abaixo: 
      case CREATURE_EVENT_NOCOUNTFRAG: return "noCountFragArea";

      procure por:
      case CREATURE_EVENT_PREPAREDEATH: return "cid, deathList";
      Adicione abaixo:
      case CREATURE_EVENT_NOCOUNTFRAG: return "cid, target";

      agora no mesmo arquivo, vá até o final do arquivo e adicione essa função:
      uint32_t CreatureEvent::executeNoCountFragArea(Creature* creature, Creature* target) { //noCountFragArea(cid, target) if(m_interface->reserveEnv()) { ScriptEnviroment* env = m_interface->getEnv(); if(m_scripted == EVENT_SCRIPT_BUFFER) { env->setRealPos(creature->getPosition()); std::ostringstream scriptstream; scriptstream << "local cid = " << env->addThing(creature) << std::endl; scriptstream << "local target = " << env->addThing(target) << std::endl; if(m_scriptData) 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__ std::ostringstream desc; desc << creature->getName(); env->setEvent(desc.str()); #endif env->setScriptId(m_scriptId, m_interface); env->setRealPos(creature->getPosition()); lua_State* L = m_interface->getState(); m_interface->pushFunction(m_scriptId); lua_pushnumber(L, env->addThing(creature)); lua_pushnumber(L, env->addThing(target)); bool result = m_interface->callFunction(2); m_interface->releaseEnv(); return result; } } else { std::clog << "[Error - CreatureEvent::noCountFragArea] Call stack overflow." << std::endl; return 0; } }

      agora vá em creatureevent.h

      procure por:
      CREATURE_EVENT_PREPAREDEATH
      adicione abaixo:
      CREATURE_EVENT_NOCOUNTFRAG

      procure por:
      uint32_t executePrepareDeath(Creature* creature, DeathList deathList);
      Adicione abaixo:
      uint32_t executeNoCountFragArea(Creature* creature, Creature* target);

      agora vá em player.cpp

      procure por:
      bool Player::onKilledCreature(Creature* target, DeathEntry& entry)
      abaixo de:
      War_t enemy; if(targetPlayer->getEnemy(this, enemy)) { if(entry.isLast()) IOGuild::getInstance()->updateWar(enemy); entry.setWar(enemy); }
      Adicione o seguinte código:
      if (targetPlayer){ CreatureEventList killEvents = getCreatureEvents(CREATURE_EVENT_NOCOUNTFRAG); for (const auto &event : killEvents) { if (!event->executeNoCountFragArea(this, target)) { return true; } } }

      //

      Feito isso, tudo completo na sua source, agora é necessário adicionar o creaturescript dentro do servidor

      vá até creaturescripts/scripts
      crie um arquivo chamado, "noCountFragInArea.lua"
      e dentro dele cole o código:
       
      --[[ script feito por feetads / TibiaKing ]]-- --[[ discord: feetads / FeeTads#0246 ]]-- -- Add positions here for which you do not want to count frags local areas = { [1] = {from = {x = 91, y = 122, z = 7}, to = {x = 98, y = 127, z = 7}}, -- from = area superior esquerda / to = area inferior direita (formando um quadrado) } local onlyKillerInArea = false -- only killer need to be in area? function noCountFragArea(cid, target) if not isCreature(cid) or not isCreature(target) then return true end local posKiller = getPlayerPosition(cid) local posTarget = getPlayerPosition(target) for i = 1, #areas do local area = areas[i] if isInArea(posKiller, area.from, area.to) then if onlyKillerInArea then return false elseif isInArea(posTarget, area.from, area.to) then return false end end end return true end
      agora em creaturescripts.xml
      <event type="nocountfrag" name="fragarea" event="script" value="noCountFragInArea.lua"/>
      agora em creaturescripts/scripts/login.lua
       procure por OU semelhante a esse:
      registerCreatureEvent(cid, "AdvanceSave")
      e abaixo adicione:
      registerCreatureEvent(cid, "fragarea")

      //


      Agora tudo certo, quando quiser adiciona uma area que não pega frag, vá até o script e apenas coloque a area, igual o demonstrado no script

      Exemplo:
      local areas = { [1] = {from = {x = 91, y = 122, z = 7}, to = {x = 98, y = 127, z = 7}}, [2] = {from = {x = 1000, y = 1000, z = 7}, to = {x = 1100, y = 1100, z = 7}}, }
      assim somente colocando a area no script e abrindo o server ou dando /reload, já funcionará a area como não pegar frag.
      Esse sistema pode ser bom pra areas de pvp ativo, onde você ainda quer que o player que morrer perca os atributos, como se fosse uma morte normal, porém não conta frag pra quem matar.
      Bom pra sistemas tipo castle 48h (guild war), onde há diversas mortes e risco de pegar red, atrapalhando a war.

      Façam bom proveito dos scripts, e deixem os créditos no script rsrs

      **Eu fiz as alterações e o simples código por isso vim disponibilizar, créditos meus**
    • Por Muvuka
      Abri canal a força creaturescript acho que funcione no creaturescript cria script creaturescript
       
      <channel id="9" name="HELP" logged="yes"/>
      <channel id="12" name="Report Bugs" logged="yes"/>
      <channel id="13" name="Loot" logged="yes"/>
      <channel id="14" name="Report Character Rules Tibia Rules" logged="yes"/>
      <channel id="15" name="Death Channel"/>
      <channel id="6548" name="DexSoft" level="1"/>
      <channel id="7" name="Reports" logged="yes"/>
       
      antes de 
              if(lastLogin > 0) then adicione isso:
                      doPlayerOpenChannel(cid, CHANNEL_HELP) doPlayerOpenChannel(cid, 1,  2, 3) = 1,2 ,3 Channels, entendeu? NÃO FUNCIONA EU QUERO UM MEIO DE ABRI SEM USA A SOURCE
       
      EU NÃO CONSEGUI ABRI EU NÃO TENHO SOURCE
       
       
    • Por bolachapancao
      Rapaziada seguinte preciso de um script que ao utilizar uma alavanca para até 4 jogadores.
      Os jogadores serão teleportados para hunt durante uma hora e depois de uma hora os jogadores serão teleportados de volta para o templo.
       
      Observação: caso o jogador morra ou saia da hunt o evento hunt é cancelado.

      Estou a base canary
      GitHub - opentibiabr/canary: Canary Server 13.x for OpenTibia community.
       
    • Por RAJADAO
      .Qual servidor ou website você utiliza como base? 
      Sabrehaven 8.0
      Qual o motivo deste tópico? 
      Ajuda com novos efeitos
       
      Olá amigos, gostaria de ajuda para introduzir os seguintes efeitos no meu servidor (usando o Sabrehaven 8.0 como base), adicionei algumas runas novas (avalanche, icicle, míssil sagrado, stoneshower & Thunderstorm) e alguns novos feitiços (exevo mas san, exori san, exori tera, exori frigo, exevo gran mas frigo, exevo gran mas tera, exevo tera hur, exevo frigo hur) mas nenhum dos efeitos dessas magias parece existir no servidor, alguém tem um link para um tutorial ou algo assim para que eu possa fazer isso funcionar?
      Desculpe pelo mau inglês, sou brasileiro.

      Obrigado!


      AVALANCHE RUNE id:3161 \/
      (COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_ICEAREA)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ICE)

      STONESHOWER RUNE id:3175 \/
      (COMBAT_PARAM_TYPE, COMBAT_EARTHDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_STONES)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_EARTH)

      THUNDERSTORM RUNE id:3202 \/
      (COMBAT_PARAM_TYPE, COMBAT_ENERGYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_E NERGYHIT)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_ENERGYBALL)

      ICICLE RUNE id:3158 \/
      COMBAT_ICEDAMAGE
      CONST_ME_ICEAREA
      CONST_ANI_ICE

      SANTO MÍSSIL RUNA id:3182 \/
      (COMBAT_PARAM_TYPE, COMBAT_HOLYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_HOLYDAMAGE)
      (COMBAT_PARAM_EFFECT, CONST_ME_HOLYAREA)
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_HOLY)

      CONST_ME_PLANTATTACK (exevo gran mas tera)
      CONST_ME_ICETORNADO (exevo gran mas frigo)
      CONST_ME_SMALLPLANTS (exevo tera hur)
      CONST_ME_ICEAREA (exevo frigo hur)
      CONST_ME_ICEATTACK (exori frigo)
      CONST_ME_CARNIPHILA (exori tera)

      EXORI SAN \/
      (COMBAT_PARAM_DISTANCEEFFECT, CONST_ANI_SMALLHOLY)
      CONST_ME_HOLYDAM IDADE

      EXEVO MAS SAN \/
      CONST_ME_HOLYAREA
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo