Versão testada : TFS 0.3.6
Autor: Maxwell Denisson(MaXwEllDeN)
Informação adicional: Monster+Creaturescript.
Autor: Maxwell Denisson(MaXwEllDeN)
Informação adicional: Monster+Creaturescript.
Versão 1
#Instalação:
@Monster
Código:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Robber" nameDescription="a robber" race="blood" experience="3060" speed="280" manacost="0">
<health now="1235" max="1235"/>
<look type="335" head="79" body="95" legs="95" feet="81" corpse="6080"/>
<targetchange interval="5000" chance="8"/>
<strategy attack="100" defense="0"/>
<flags>
<flag summonable="1"/>
<flag attackable="1"/>
<flag hostile="1"/>
<flag illusionable="1"/>
<flag convinceable="1"/>
<flag pushable="0"/>
<flag canpushitems="1"/>
<flag canpushcreatures="0"/>
<flag targetdistance="1"/>
<flag staticattack="90"/>
<flag runonhealth="15"/>
</flags>
<attacks>
<attack name="melee" interval="2000" skill="90" attack="80"/>
<attack name="physical" interval="2000" chance="20" range="7" radius="3" target="0" min="-350" max="-455">
<attribute key="areaEffect" value="blackspark"/>
</attack>
</attacks>
<defenses armor="11" defense="15"/>
<elements>
<element holyPercent="-10"/>
<element firePercent="-10"/>
<element energyPercent="-10"/>
<element icePercent="-10"/>
<element earthPercent="-10"/>
<element deathPercent="+1"/>
</elements>
<immunities>
<immunity physical="0"/>
<immunity energy="0"/>
<immunity fire="0"/>
<immunity poison="0"/>
<immunity lifedrain="0"/>
<immunity paralyze="0"/>
<immunity outfit="0"/>
<immunity drunk="0"/>
<immunity invisible="0"/>
</immunities>
<voices interval="5000" chance="10">
<voice sentence="Passa a grana mermão!"/>
<voice sentence="Num tenho medo nem do B.O.P.E."/>
</voices>
<loot>
<item id="2148" countmax="23" chance1="65000" chancemax="0"/> --Gold
<item id="2468" chance="19000"/> --Studded LEgs
<item id="2666" countmax="2" chance1="33333"/> --MEat
<item id="2389" chance="11500"/> --Mace
<item id="1987" chance="100000">
<inside>
<item id="2649" chance="38000"/> --Leather Legs
<item id="2050" chance="50000"/> --torch
<item id="2689" countmax="2" chance1="20000" chancemax="0"/> --Bread
<item id="2209" chance="2500"/> --Club ring
</inside>
</item>
</loot>
<script>
<event name="KRobber"/>
<event name="DRobber"/>
</script>
</monster>
Na pasta data/monster
abra o arquivo monsters.xml, e coloque essa tag dentro dele:
Código:
<monster name="Robber" file="Robber.xml"/>
Na pasta data/creaturescripts/scripts
copie qualquer arquivo de extenção .lua, renomeie ele para KRobber.lua, abra ele, delete tudo que tiver dentro, copie esse código, cole dentro dele e salve:
Código:
function doContainerAddMoney(uid, amount) ---- Function by MatheusMkalo
local crystal = math.floor(amount/10000)
amount = amount-crystal*10000
local platinum = math.floor(amount/100)
amount = amount-platinum*100
local golds = amount
local goldids = {
[2160] = crystal,
[2152] = platinum,
[2148] = golds
}
for i,x in pairs(goldids) do
doAddContainerItem(uid, i, x)
end
return TRUE
end
local percent = function(per, value)
return per/100*value
end
function onCombat(cid, target)
local perc = math.random(5, 50)
if percent(perc, getPlayerMoney(target)) < getPlayerMoney(target) then
local mony = percent(perc, getPlayerMoney(target))
doPlayerRemoveMoney(target, mony)
if getPlayerStorageValue(cid, 124537) < 1 then
setPlayerStorageValue(cid, 124537, mony)
else
setPlayerStorageValue(cid, 124537, getPlayerStorageValue(cid, 124537) + mony)
end
end
return true
end
function onDeath(cid, corpse, deathList)
if getPlayerStorageValue(cid, 124537) < 1 then
return true
else
doContainerAddMoney(corpse.uid, getPlayerStorageValue(cid, 124537))
end
return true
end
Na pasta data/creaturescripts
abra o arquivo creaturescripts.xml, e coloque essas tags dentro dele:
Código:
<event type="kill" name="KRobber" event="script" value="KRobber.lua"/>
<event type="death" name="DRobber" event="script" value="KRobber.lua"/>
Versão 2
(Quando o monstro vai atacando o player o player vai perdendo uma porcentagem aleatoria de 2 à 10 do dinheiro dele, e quando o monstro morre, ele dropa todo dinheiro que ele roubou de todos os players que tentaram matar ele.)
#Instalação:
@Monster
Na pasta data/monster
copie qualquer arquivo com a extenção .xml renomeie ele para Robber.xml, abra ele, delete tudo que tiver dentro, copie e cole esse código dentro dele:
Código:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Robber" nameDescription="a robber" race="blood" experience="3060" speed="280" manacost="0">
<health now="1235" max="1235"/>
<look type="335" head="79" body="95" legs="95" feet="81" corpse="6080"/>
<targetchange interval="5000" chance="8"/>
<strategy attack="100" defense="0"/>
<flags>
<flag summonable="1"/>
<flag attackable="1"/>
<flag hostile="1"/>
<flag illusionable="1"/>
<flag convinceable="1"/>
<flag pushable="0"/>
<flag canpushitems="1"/>
<flag canpushcreatures="0"/>
<flag targetdistance="1"/>
<flag staticattack="90"/>
<flag runonhealth="15"/>
</flags>
<attacks>
<attack name="melee" interval="2000" skill="90" attack="80"/>
<attack name="physical" interval="2000" chance="20" range="7" radius="3" target="0" min="-350" max="-455">
<attribute key="areaEffect" value="blackspark"/>
</attack>
</attacks>
<defenses armor="11" defense="15"/>
<elements>
<element holyPercent="-10"/>
<element firePercent="-10"/>
<element energyPercent="-10"/>
<element icePercent="-10"/>
<element earthPercent="-10"/>
<element deathPercent="+1"/>
</elements>
<immunities>
<immunity physical="0"/>
<immunity energy="0"/>
<immunity fire="0"/>
<immunity poison="0"/>
<immunity lifedrain="0"/>
<immunity paralyze="0"/>
<immunity outfit="0"/>
<immunity drunk="0"/>
<immunity invisible="0"/>
</immunities>
<voices interval="5000" chance="10">
<voice sentence="Passa a grana mermão!"/>
<voice sentence="Num tenho medo nem do B.O.P.E."/>
</voices>
<loot>
<item id="2148" countmax="23" chance1="65000" chancemax="0"/> --Gold
<item id="2468" chance="19000"/> --Studded LEgs
<item id="2666" countmax="2" chance1="33333"/> --MEat
<item id="2389" chance="11500"/> --Mace
<item id="1987" chance="100000">
<inside>
<item id="2649" chance="38000"/> --Leather Legs
<item id="2050" chance="50000"/> --torch
<item id="2689" countmax="2" chance1="20000" chancemax="0"/> --Bread
<item id="2209" chance="2500"/> --Club ring
</inside>
</item>
</loot>
<script>
<event name="KRobber"/>
<event name="DRobber"/>
</script>
</monster>
Na pasta data/monster
abra o arquivo monsters.xml, e coloque essa tag dentro dele:
Código:
<monster name="Robber" file="Robber.xml"/>
Na pasta data/creaturescripts/scripts
copie qualquer arquivo de extenção .lua, renomeie ele para KRobber.lua, abra ele, delete tudo que tiver dentro, copie esse código, cole dentro dele e salve:
Código:
function doContainerAddMoney(uid, amount)
local crystal = math.floor(amount/10000)
amount = amount-crystal*10000
local platinum = math.floor(amount/100)
amount = amount-platinum*100
local golds = amount
local goldids = {
[2160] = crystal,
[2152] = platinum,
[2148] = golds
}
for i,x in pairs(goldids) do
doAddContainerItem(uid, i, x)
end
return TRUE
end
local percent = function(per, value)
return per/100*value
end
function onCombat(cid, target)
local perc = math.random(5, 10)
if percent(perc, getPlayerMoney(target)) < getPlayerMoney(target) then
local mony = percent(perc, getPlayerMoney(target))
doPlayerRemoveMoney(target, mony)
if getPlayerStorageValue(cid, 124537) < 1 then
setPlayerStorageValue(cid, 124537, mony)
else
setPlayerStorageValue(cid, 124537, getPlayerStorageValue(cid, 124537) + mony)
end
end
return true
end
function onDeath(cid, corpse, deathList)
if getPlayerStorageValue(cid, 124537) < 1 then
return true
else
doContainerAddMoney(corpse.uid, getPlayerStorageValue(cid, 124537))
end
return true
end
Na pasta data/creaturescripts
abra o arquivo creaturescripts.xml, e coloque essas tags dentro dele:
Código:
<event type="combat" name="KRobber" event="script" value="KRobber.lua"/>
<event type="death" name="DRobber" event="script" value="KRobber.lua"/>
Nenhum comentário:
Postar um comentário