XV
action

[action] Blessed Wooden Stake E Obsidian Knife

Por XvX, 24 de jun. de 2009 em Actions e Talkactions

script
5
2.1k
XvXX
24 de junho de 2009 às 10:17

Essas actions são da base de dados do Projeto Forgoten Server, porém até hoje não consertaram essa action, então adaptei para ficarem com os efeitos de animação igual ao do global!

 

1º Passo:

Crie um arquivo em data\actions\scripts\tools com nome: blessed_wooden_stake.lua

Depois cole isso dentro do arquivo:

local DUSTS = {
-- Demons
[2956] = {25000, 5905},

-- Vampires
[2916] = {25000, 5906}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerLevel(cid) <= 1) then
	doPlayerSendCancel(cid, "You have to be at least Level 2 to use this tool.")
	return TRUE
end

local dust = DUSTS[itemEx.itemid]
if(dust == nil) then
	doPlayerSendCancel(cid, "Sorry, not possible.")
	return TRUE
end

local random = math.random(1, 100000)
if(random <= dust[1]) then
	doSendMagicEffect(toPosition, [color="#FF0000"]CONST_ME_MAGIC_RED[/color])
	doPlayerAddItem(cid, dust[2], 1)
elseif(dust[3] and random >= dust[3]) then
	doSendMagicEffect(toPosition, [color="#FF0000"]CONST_ME_MAGIC_RED[/color])
	doPlayerAddItem(cid, dust[4], 1)
else
	doSendMagicEffect(toPosition, [color="#FF0000"]CONST_ME_BLOCKHIT[/color])
end

doTransformItem(itemEx.uid, itemEx.itemid + 1)
return TRUE
end

 

2º Passo:

Crie um arquivo em data\actions\scripts\tools com nome: obsidian_knife.lua

Depois cole isso dentro do arquivo:

local SKINS = {
-- Minotaurs
[2830] = {25000, 5878},
[2871] = {25000, 5878},
[2866] = {25000, 5878},
[2876] = {25000, 5878},
[3090] = {25000, 5878},

-- Lizards
[4259] = {25000, 5876},
[4262] = {25000, 5876},
[4256] = {25000, 5876},

-- Dragons
[3104] = {25000, 5877},
[2844] = {25000, 5877},

-- Dragon Lords
[2881] = {25000, 5948},

-- Behemoths
[2931] = {25000, 5930, 90000, 5893},

-- Bone Beasts
[3031] = {25000, 5925}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerLevel(cid) <= 1) then
	doPlayerSendCancel(cid, "You have to be at least Level 2 to use this tool.")
	return TRUE
end

local skin = SKINS[itemEx.itemid]
if(skin == nil) then
	doPlayerSendCancel(cid, "Sorry, not possible.")
	return TRUE
end

local random = math.random(1, 100000)
if(random <= skin[1]) then
	doSendMagicEffect(toPosition, [color="#FF0000"]CONST_ME_MAGIC_GREEN[/color])
	doPlayerAddItem(cid, skin[2], 1)
elseif(skin[3] and random >= skin[3]) then
	doSendMagicEffect(toPosition, [color="#FF0000"]CONST_ME_MAGIC_GREEN[/color])
	doPlayerAddItem(cid, skin[4], 1)
else
	doSendMagicEffect(toPosition, [color="#FF0000"]CONST_ME_BLOCKHIT[/color])
end

doTransformItem(itemEx.uid, itemEx.itemid + 1)
return TRUE
end

 

3º Passo:

Abra o arquivo: \data\actions\actions.xml com seu bloco de notas e adicione isso:

	<action itemid="5942" script="tools/blessed_wooden_stake.lua"/>
<action itemid="5908" script="tools/obsidian_knife.lua"/>

 

 

 

Créditos 99% ao team do Forgotten pelo script e 1 % para mim que modifiquei os MagicEffect para funcionar igual ao global!

 

Segue Spoil do sistema antigo ( Em Vermelho as partes que modifiquei):

Obsidian Knife:

local SKINS = {
-- Minotaurs
[2830] = {25000, 5878},
[2871] = {25000, 5878},
[2866] = {25000, 5878},
[2876] = {25000, 5878},
[3090] = {25000, 5878},

-- Lizards
[4259] = {25000, 5876},
[4262] = {25000, 5876},
[4256] = {25000, 5876},

-- Dragons
[3104] = {25000, 5877},
[2844] = {25000, 5877},

-- Dragon Lords
[2881] = {25000, 5948},

-- Behemoths
[2931] = {25000, 5930, 90000, 5893},

-- Bone Beasts
[3031] = {25000, 5925}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerLevel(cid) <= 1) then
	doPlayerSendCancel(cid, "You have to be at least Level 2 to use this tool.")
	return TRUE
end

local skin = SKINS[itemEx.itemid]
if(skin == nil) then
	doPlayerSendCancel(cid, "Sorry, not possible.")
	return TRUE
end

local random = math.random(1, 100000)
if(random <= skin[1]) then
	doSendMagicEffect(toPosition, [color="#FF0000"]CONST_ME_GROUNDSHAKER[/color])
	doPlayerAddItem(cid, skin[2], 1)
elseif(skin[3] and random >= skin[3]) then
	doSendMagicEffect(toPosition, [color="#FF0000"]CONST_ME_GROUNDSHAKER[/color])
	doPlayerAddItem(cid, skin[4], 1)
else
	doSendMagicEffect(toPosition, [color="#FF0000"]CONST_ME_POFF[/color])
end

doTransformItem(itemEx.uid, itemEx.itemid + 1)
return TRUE
end

 

Blessed Wooden Stake:

local DUSTS = {
-- Demons
[2956] = {25000, 5905},

-- Vampires
[2916] = {25000, 5906}
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getPlayerLevel(cid) <= 1) then
	doPlayerSendCancel(cid, "You have to be at least Level 2 to use this tool.")
	return TRUE
end

local dust = DUSTS[itemEx.itemid]
if(dust == nil) then
	doPlayerSendCancel(cid, "Sorry, not possible.")
	return TRUE
end

local random = math.random(1, 100000)
if(random <= dust[1]) then
	doSendMagicEffect(toPosition, [color="#FF0000"]CONST_ME_GROUNDSHAKER[/color])
	doPlayerAddItem(cid, dust[2], 1)
elseif(dust[3] and random >= dust[3]) then
	doSendMagicEffect(toPosition, [color="#FF0000"]CONST_ME_GROUNDSHAKER[/color])
	doPlayerAddItem(cid, dust[4], 1)
else
	doSendMagicEffect(toPosition, [color="#FF0000"]CONST_ME_POFF[/color])
end

doTransformItem(itemEx.uid, itemEx.itemid + 1)
return TRUE
end

Editado Junho 29 por XvX

satan666S
27 de junho de 2009 às 13:23

quais foram os ajustes que vc fez?

XvXX
29 de junho de 2009 às 16:45
quais foram os ajustes que vc fez?

 

Eu alterei a animação ao vc usar os itens, até hoje só vi no meu Ot o sistema idêntico ao global!

satan666S
29 de junho de 2009 às 19:49

se esse e o sistema igual ao global ja faz tempo que ta aqui no meu ot.

XvXX
01 de julho de 2009 às 10:42
se esse e o sistema igual ao global ja faz tempo que ta aqui no meu ot.

Repare no efeito da animação ao vc tirar as leathers e as dust e quando vc da use! Depois vou adicionar fotos, têm gente que só acretida vendo. Vou botar o antes e o depois!