auguem pode me ajudar ?
auguem ?
Quais os prêmios que o jogador irá receber após matar o boss?
Bom, como você aparentemente não irá responder por agora, fiz da maneira que entendi. Espero que compreenda as configurações.
Primeiramente, em data/creaturescripts/scripts, crie um arquivo com extensão .lua, nomeie-o invasaodie, e coloque o seguinte conteúdo:
function onDeath(cid, corpse, killer)
local prizes = {{id do item, quantidade}, {id do item, quantidade}} --Se quiser adicionar mais items, vá seguindo o modelo do {id, quantidade}. Se quiser retirar, basta retirar um {id, quantidade} da tabela.
local name = "Morgaroth" --Nome do boss.
if isMonster(cid) then
if string.lower(getCreatureName(cid)) == name:lower() then
if getGlobalStorageValue(928371) >= 1 then
broadcastMessage(""..getCreatureName(killer[1]).." killed "..name.." and received some prizes.")
doPlayerSendTextMessage(killer[i], 27, "Congratulations, here are your prizes.")
setGlobalStorageValue(827612, -1)
for _, b in pairs(prizes) do
doPlayerAddItem(killer[1], b[1], b[2])
end
end
end
end
return true
end
function onLogin(cid)
registerCreatureEvent(cid, "morgarothDie")
return true
end
Tags:
<event type="login" name="morgarothDieLogin" event="script" value="invasaodie.lua"/> <event type="death" name="morgarothDie" event="script" value="invasaodie.lua"/>
<script>
<event name="morgarothDie"/>
data/talkactions/scripts, invasao.lua.
local monsters = {
{"nome do monstro", {x = x, y = y, z = z}}, --{"nome do monstro", coordenadas de onde ele vai nascer},
{"nome do monstro", {x = x, y = y, z = z}},
{"nome do monstro", {x = x, y = y, z = z}},
}
local boss = {
name = "Morgaroth", --Nome do boss.
msg = "Morgaroth deu as caras ao norte de Stardon!",
pos = {x = x, y = y, z = z}, --Onde o boss irá nascer.
tempo = 5, --Tempo, após inicar a invasão, que o boss irá nascer.
}
local msgs = {
first = "os moradores da cidade estão ouvindo fortes tremores",
second = "varios demons esta surgindo na cidade de stardon",
tempo = 1, --Tempo, após iniciar a invasão, que os monstros irão nascer.
}
local id = 6 --Group ID necessário para iniciar a invasão.
function onSay(cid, words, param)
if words == "!startinv" then
if getPlayerGroupId(cid) <= (tonumber(id) - 1) then
return doPlayerSendCancel(cid, "Sorry, not possible.")
elseif getGlobalStorageValue(928371) >= 1 then
return doPlayerSendCancel(cid, "Uma invasão já está ocorrendo.")
end
doPlayerSendTextMessage(cid, 27, "You started the invasion. For stop it, say !stopinv.")
broadcastMessage(msgs.first)
setGlobalStorageValue(928371, 1)
addEvent(function()
if getGlobalStorageValue(928371) <= 0 then return true end
broadcastMessage(msgs.second)
for _, b in pairs(monsters) do
doCreateMonster(b[1], b[2])
end
end, msgs.tempo * 1000 * 60)
addEvent(function()
if getGlobalStorageValue(928371) <= 0 then return true end
broadcastMessage(boss.msg)
local monstro = doCreateMonster(boss.name, boss.pos)
doCreatureSay(monstro, "I will kill you all, hahaha!", TALKTYPE_SAY)
end, boss.tempo * 1000 * 60)
elseif words == "!stopinv" then
if getPlayerGroupId(cid) <= (tonumber(id) - 1) then
return doPlayerSendCancel(cid, "Sorry, not possible.")
elseif getGlobalStorageValue(928371) <= 0 then
return doPlayerSendCancel(cid, "Não há invasão alguma ocorrendo no momento.")
end
broadcastMessage("A invasão foi interrompida!")
doPlayerSendTextMessage(cid, 27, "Você parou a invasão. Para iniciá-la, diga !startinv.")
setGlobalStorageValue(928371, 0)
end
return true
end
<talkaction words="!startinv;!stopinv" event="script" value="invasao.lua"/>
Editado Dezembro 29 por zipter98
zipter98 veio n consegui quando eu coloco ´para ativar !startinv n aparece nada é como eu escrevo uma menssagem normal tem como vc ver oq é ?
Acabo de encontrar alguns erros, porem, pelo fato de estar viajando no momento, nao poderei corrigi-los por agora. Na volta (hoje mesmo), ja o faço e testo em meu servidor. Quando estiver funcionando direitinho, edito este meu comentario com o codigo corrigido.
#EDIT: Código alterado. Peço que teste, e, caso encontre algum erro, reporte-o aqui.
Editado Dezembro 29 por zipter98
zipter98 so n entendi a parte de adicionar essa script <event name="morgarothDie"/> n sei pnde fica o luga certo
Pode postar o arquivo .xml do boss (Morgaroth)?
ai ta ae morgaroth.xml
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Morgaroth" nameDescription="Morgaroth" race="fire" experience="15000" speed="400" manacost="0">
<health now="155500" max="155500"/>
<look type="12" head="0" body="94" legs="79" feet="79" corpse="6068"/>
<targetchange interval="10000" chance="5"/>
<strategy attack="100" defense="0"/>
<flags>
<flag summonable="0"/>
<flag attackable="1"/>
<flag hostile="1"/>
<flag illusionable="0"/>
<flag convinceable="0"/>
<flag pushable="0"/>
<flag canpushitems="1"/>
<flag canpushcreatures="1"/>
<flag staticattack="85"/>
<flag targetdistance="1"/>
<flag runonhealth="0"/>
</flags>
<attacks>
<attack name="melee" interval="2000" skill="210" attack="210"/>
<attack name="fire" interval="1000" chance="13" range="7" radius="6" target="1" min="0" max="-1200">
<attribute key="shootEffect" value="fire"/>
<attribute key="areaEffect" value="firearea"/>
</attack>
<attack name="lifedrain" interval="3000" chance="18" radius="7" target="0" min="-120" max="-800">
<attribute key="areaEffect" value="rednote"/>
</attack>
<attack name="death" interval="3000" chance="15" radius="7" target="0" min="-500" max="-800">
<attribute key="areaEffect" value="mortarea"/>
</attack>
<attack name="death" interval="2000" chance="16" length="8" spread="0" min="-600" max="-1400">
<attribute key="areaEffect" value="mortarea"/>
</attack>
<attack name="speed" interval="3000" chance="25" target="1" speedchange="-800" duration="4000">
<attribute key="areaEffect" value="redshimmer"/>
</attack>
</attacks>
<defenses armor="70" defense="70">
<defense name="healing" interval="2000" chance="15" min="4500" max="5000">
<attribute key="areaEffect" value="blueshimmer"/>
</defense>
</defenses>
<elements>
<element physicalPercent="10"/>
<element icePercent="-10"/>
<element deathPercent="50"/>
</elements>
<immunities>
<immunity energy="1"/>
<immunity fire="1"/>
<immunity poison="1"/>
<immunity lifedrain="1"/>
<immunity paralyze="1"/>
<immunity invisible="1"/>
</immunities>
<summons maxSummons="2">
<summon name="demon" interval="15000" chance="100"/>
<summon name="demon" interval="15000" chance="100"/>
<summon name="demon" interval="15000" chance="100"/>
</summons>
<voices interval="5000" chance="10">
<voice sentence="MY SEED IS FEAR AND MY HARVEST ARE YOUR SOULS" yell="1"/>
<voice sentence="The triangle of terror will rise!"/>
<voice sentence="Zathroth look at the destruction i am causing in your name!"/>
<voice sentence="I AM MORGAROTH, LORD OF THE TRIANGLE... AND YOU ARE LOST!" yell="1"/>
</voices>
<loot>
<item id="2144" chance1="99000" countmax="13" /> -- white pearl
<item id="2149" chance1="9900" countmax="4" /> -- small emerald
<item id="2112" chance="7777" /> --teddy bear
<item id="2158" chance="2800"/> --green gem
<item id="2186" chance="1538" /> -- moonlight rod
<item id="2396" chance="1429" /> -- ice rapier
<item id="2462" chance="4700" /> -- devil helmet
<item id="2214" chance="4000" /> -- ring of healing
<item id="8928" chance="5700"/> --obsidian truncheon
<item id="2122" chance="3500"/> --great shield
<item id="8886" chance="9050"/> --molten plate
<item id="6500" countmax="5" chance1="15000"/> --demonic essences
<item id="6529" countmax="100" chance1="8700"/> --infernal bolt
<item id="2148" chance1="100000" countmax="100" /> -- gold coin
<item id="2148" chance1="100000" countmax="90" /> -- gold coin
<item id="2152" chance1="75000" countmax="61"/> --platinum
<item id="1987" chance="100000" > -- bag
<inside>
<item id="2146" countmax="9" chance1="12300"/> --sapphire
<item id="2149" countmax="12" chance1="12300"/> --emerald
<item id="2387" chance="15000" /> -- double axe
<item id="8929" chance="4300"/> --the stomper
<item id="8865" chance="6666"/> --dark lord's cape
<item id="2143" chance="4500" countmax="11"/> -- Black Pearl
<item id="7431" chance="7900" /> -- Demonbone
<item id="8881" chance="6800"/> --fireborn giant armor
<item if="2514" chance="9000" /> -- Mastermind Shield
<item id="5943" chance="3500"/> -- Morgaroth Hearth
<item id="8850" chance="6500" /> -- chainbolter
<item id="8851" chance="4800"/> --royal crossbow
<item id="2195" chance="10500" /> -- boots of haste
<item id="2421" chance="7509" /> -- thunder hammer
</inside>
</item>
</loot>
<script>
<event name="morgarothDie"/>
</script>
</monster>
Editado Dezembro 30 por zipter98




info
Grupo: Campones
Registrado: 22/10/13
Posts: 18
Reputação: 0
Char no Tibia: tsaaghus
boa noite galerinha do xtibia eu estou presizando que voceis façao augumas auteraçoes neste meu script bem esse script é de invasao mais esta meio bugado sla eu keria que foce asim quando vc com o good falace o comando automaticamente aparecia uma menssagem no defaut e na tela do jogador asim o os moradores da cidade estão ouvindo fortes tremores depois de 1 minuto aparece asim varios demons esta surgindo na cidade de stardon ai quando aparece essa menssagem os demons apareciao e na terceira menssagem iria ser asim o boos morgaroth esta dando as caras ao north da cidade de stardon ai ele aparecia e depois o ultimo player que matace o boss apaceria no defaut para todos exemplo o player .... acabou de dar o ultimo hit no boos morgaroth por isso ele sera premiado auguem pode me ajudar por favor estou dando Reep +
---------------------------------------------------------------------------------------------------------------------------------------------
Script