Ir para conteúdo

Featured Replies

Postado

E queria saber se tem alguns script que funciona da seguinte forma...

 

Um item trocado no NPC que eleva a sorte do player, e faz com que ele tenha mais chance no drop de items. Obs: não possuo nenhum script de loot, eles estão em .xml direto no monstro

 

Um item trocado no NPC que eleva a sabedoria de pet elemental, e a cada nível ele ficasse mais forte.

 

Uso este System de Pet...

Spoiler

local egg = {
["Amarelo"] = {id = 6541, mon = "Holy Pet"},
["Vermelho"] = {id = 6542, mon = "Fire Pet"},
["Azul"] = {id = 6543, mon = "Ice Pet"},
["Verde"] = {id = 6544, mon = "Terra Pet"},
["Roxo"] = {id = 6545, mon = "Energy Pet"}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)

if getTilePzInfo(getCreaturePosition(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Você não pode invocar o pet em Protection Zone.")
return true
end

if #getCreatureSummons(cid) >= 1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Você ja tem 1 pet invocado no momento.")
return doPlayerSendCancel(cid,  "")
end

for k, v in pairs(egg) do
if item.itemid == v.id then
local x = doSummonCreature(v.mon, getCreaturePosition(cid))
doConvinceCreature(cid, x)
doRemoveItem(item.uid, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"Você invocou um elemental pet.")
end
end

return true
end

 

.xml

Spoiler

<?xml version="1.0" encoding="UTF-8"?>
<monster name="Ice Pet" nameDescription="Ice Pet" race="undead" experience="300" speed="3000" manacost="0">
    <health now="2000" max="2000"/>
        <look type="140" head="0" body="125" legs="125" feet="0" addons="3" corpse="6080"/>
    <targetchange interval="5000" chance="8"/>
    <strategy attack="100" defense="0"/>
    <flags>
        <flag summonable="0"/>
        <flag attackable="0"/>
        <flag hostile="1"/>
        <flag illusionable="0"/>
        <flag convinceable="1"/>
        <flag pushable="1"/>
        <flag canpushitems="1"/>
        <flag canpushcreatures="1"/>
        <flag targetdistance="1"/>
        <flag staticattack="90"/>
        <flag runonhealth="20"/>
    </flags>
    <attacks>
        <attack name="ice" interval="500" chance="100" range="3" radius="1" target="1" min="-300" max="-650">
            <attribute key="shootEffect" value="smallice"/>
        </attack>
    </attacks>
    <defenses armor="199" defense="199"/>
    <immunities>
        <immunity physical="1"/>
        <immunity energy="1"/>
        <immunity fire="1"/>
        <immunity poison="1"/>
        <immunity ice="1"/>
        <immunity holy="1"/>
        <immunity death="1"/>
        <immunity lifedrain="1"/>
        <immunity manadrain="1"/>
        <immunity paralyze="1"/>
        <immunity drunk="1"/>
        <immunity outfit="1"/>
        <immunity invisible="1"/>
    </immunities>
</monster>
 

 

Um item trocado no NPC que eleva a coragem do Player, e a cada nível ele ficasse mais forte.

 

com o script a arma seria assim eu acho...

Spoiler

function onGetFormulaValues(cid, level, item)
local arma= getPlayerWeapon(cid).id
darma= getItemAttribute(arma.uid, "attack") or 0
skillsword= getPlayerSkill(cid, 2)
local coragem= getPlayerStorageValue(cid, 70003)
min = -(level*0.25) + -(coragem*0.2) + -(skillsword*0.4) + -darma
max = -(level*0.35) + -(coragem*0.3) + -(skillsword*0.8) + -darma
return min, max
end


 

 

Se for possivel alguem me indica como fazer esses Scripts , Sorte, Sabedoria e Coragem. Obg!

Resolvido por xWhiteWolf

Ir para solução
  • Respostas 20
  • Visualizações 828
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • xWhiteWolf
    xWhiteWolf

    pro primeiro pesquisa sobre um ring que aumenta a chance de drop aqui no TK. Pro segundo, na hora de invocar o monstro edite tudo que você conseguir dele pra deixar mais forte usando as funções. As

Postado
  • Solução

pro primeiro pesquisa sobre um ring que aumenta a chance de drop aqui no TK.

Pro segundo, na hora de invocar o monstro edite tudo que você conseguir dele pra deixar mais forte usando as funções. As spells e os ataques que são dificeis de modificar, vc teria que fazer spells próprias e dentro delas colocar algum check pra pegar o storage do caster e ver se for < que determinado valor só retornar false e não soltar a spell. Dessa forma você vai criar o efeito de que conforme o pet evolui ele vai "liberando" novas spells sendo que na vdd elas sempre estiveram lá, só não eram executadas por conta do check do storage.

pro terceiro você teria que modificar todas as weapons OU se fosse TFS 1.X+ daria pra fazer onCreatureChangeHealth multiplicando o primarydamage por algum coeficiente baseado no storage.
Outra opção é modificar a formula de dano na source, mas só recomendo fazer isso se realmente souber o que tá fazendo.

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

Postado
  • Autor

@xWhiteWolf

Em questão do ring achei este...

 

 

Tem como modificar ele pra níveis e no lugar do item colocar  storage para ser obtida no NPC ?

do nível 1 ao 10

 Exemplo:

 

Nivel       NewRate

 

  1               1,5

  2               1,8

  3               2

  4               2,5

  5               2,8

  6               3

  7               3,5

  8               4

  9               4,5

  10             5

Postado
  • Autor

@Adriano SwaTT Esta é a postagem principal,  a modificação seria essa...

 

Tem como modificar ele pra níveis e no lugar do item colocar  storage para ser obtidas no NPC, na troca de um item ?

do nível 1 ao 10

 Exemplo:

 

Nivel       NewRate

 

  1               1,5

  2               1,8

  3               2

  4               2,5

  5               2,8

  6               3

  7               3,5

  8               4

  9               4,5

  10             5

 

Postado
Spoiler

<?xml version="1.0" encoding="UTF-8"?>
<mod name="Loot Ring" version="1.0" author="Cykotitan" contact="otland.net" enabled="yes">
<event type="kill" name="lootring" event="script"> <![CDATA[
local lvls = { -- [level] = rate de drop que vai multiplicar a rate antiga.
--[[ É DE SUMA IMPORTANCIA QUE VOCÊ SEMPRE 
SIGA A ORDEM NA HORA DE CRIAR NOVOS LEVEIS.
NADA DE COLOCAR [0], [1] E [5].
TEM QUE SEGUIR DE 0 A 5 SEM PULAR NADA!
]]
	[0] = 1
	[1] = 1.5,
	[2] = 1.8,
}

local storage = 19456 -- storage que armazena o level do player
local rate = getConfigInfo('rateLoot')

function getContentDescription(uid, comma)
	local ret, i, containers = '', 0, {}	
	while i < getContainerSize(uid) do
		local v, s = getContainerItem(uid, i), ''
		local k = getItemInfo(v.itemid)
		if k.name ~= '' then
			if v.type > 1 and k.stackable and k.showCount then
				s = v.type .. ' ' .. getItemInfo(v.itemid).plural
			else
				local article = k.article
				s = (article == '' and '' or article .. ' ') .. k.name
			end
			ret = ret .. (i == 0 and not comma and '' or ', ') .. s
			if isContainer(v.uid) and getContainerSize(v.uid) > 0 then
				table.insert(containers, v.uid)
			end
		else
			ret = ret .. (i == 0 and not comma and '' or ', ') .. 'an item of type ' .. v.itemid .. ', please report it to gamemaster'
		end
		i = i + 1
	end
	for i = 1, #containers do
		ret = ret .. getContentDescription(containers[i], true)
	end
	return ret
end

local function send(cid, pos, corpseid, monster, party)
	local corpse = getTileItemById(pos, corpseid).uid
	local ret = isContainer(corpse) and getContentDescription(corpse)
	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'))
	if party then
		for _, pid in ipairs(getPartyMembers(party)) do
			doPlayerSendChannelMessage(pid, '', 'Loot of ' .. monster .. ': ' .. (ret ~= '' and ret or 'nothing'), TALKTYPE_CHANNEL_W, CHANNEL_PARTY)
		end
	end
end

local function createLoot(i, ext)
	local item = type(i.id) == 'table' and i.id[math.random(#i.id)] or i.id
	local random = math.ceil(math.random(100000) / ((ext and lvls[ext]) and rate * lvls[ext] or print("algo deu muito errado, chame o lobo.\n"))
	local tmpItem = false

	if random < i.chance then
		tmpItem = doCreateItemEx(item, getItemInfo(item).stackable and random % i.count + 1 or 1)
	end
	if not tmpItem then
		return false
	end
	if i.subType ~= -1 then
		doItemSetAttribute(tmpItem, 'subType', i.subType)
	end
	if i.actionId ~= -1 then
		doItemSetAttribute(tmpItem, 'aid', i.actionId)
	end
	if i.uniqueId ~= -1 then
		doItemSetAttribute(tmpItem, 'uid', i.uniqueId)
	end
	if i.text ~= '' then
		doItemSetAttribute(tmpItem, 'text', i.text)
	end
	return tmpItem
end

local function createChildLoot(parent, i, ext)
	if #i == 0 then
		return true
	end

	local size, cap = 0, getContainerCap(parent)
	for k = 1, #i do
		if size == cap then
			break
		end
		local tmp = createLoot(i[k], ext)
		if tmp then
			if isContainer(tmp) then
				if createChildLoot(tmp, i[k].child, ext) then
					doAddContainerItemEx(parent, tmp)
					size = size + 1
				else
					doRemoveItem(tmp)
				end
			else
				doAddContainerItemEx(parent, tmp)
				size = size + 1
			end
		end
	end

	return size > 0
end

local function dropLoot(pos, v, ext)
	local corpse = getTileItemById(pos, v.lookCorpse).uid
	if isContainer(corpse) then
		for i = 1, getContainerSize(corpse) do
			doRemoveItem(getContainerItem(corpse, 0).uid)
		end
		local size, cap = 0, getContainerCap(corpse)
		for i = 1, #v.loot do
			if size == cap then
				break
			end
			local tmp = createLoot(v.loot[i], ext)
			if tmp then
				if isContainer(tmp) then
					if createChildLoot(tmp, v.loot[i].child, ext) then
						doAddContainerItemEx(corpse, tmp)
						size = size + 1
					else
						doRemoveItem(tmp)
					end
				else
					doAddContainerItemEx(corpse, tmp)
					size = size + 1
				end
			end
		end
	end
end

function onKill(cid, target, lastHit)
	if lastHit and isMonster(target) then
		local v = getMonsterInfo(getCreatureName(target))
		if v.lookCorpse > 0 then
			local master = getCreatureMaster(target)
			if not master or master == target then
				local level = math.min(math.max(getPlayerStorageValue(cid, storage), 0), #lvls) -- usei essa formula pra garantir que o storage vai estar entre 0 e o tamanho do vetor 'lvls'
				addEvent(dropLoot, 0, getThingPos(target), v, level)
			end
			addEvent(send, 100, cid, getThingPos(target), v.lookCorpse, v.description, getPlayerParty(cid))
		end
	end
	return true
end
]]></event>
<event type="login" name="Loot Ring" event="buffer"><![CDATA[
registerCreatureEvent(cid, "lootring")
]]></event>
</mod>

 

 

Todos os meus trabalhos importantes estão na seção "Sobre mim" no meu perfil; Dá uma passada lá!

"Há três caminhos para o fracasso: não ensinar o que se sabe, não praticar o que se ensina, e não perguntar o que se ignora." - São Beda

I7Pm6ih.png

(obg ao @Beeny por fazer essa linda sign <3)

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo