SO
creatureevent

Global Quest Loot

Por Sofft, 26 de jul. de 2012 em Scripts

global
quest
loot
todos
otserv
tibia
script
7
1.9k
SofftS
26 de julho de 2012 às 10:31

Servidor: Global

Distro: TFS 0.4 32bits

 

Olá Xtibianos, gostaria de ajuda no seguint Script:

 

Seguindo o estilo de quest global da cipsoft, queria um script que desse uma recompensa a todos os players que ajudaram a matar um monstro.

O monstro aparecerá em uma sala, e todos os players que atacarem esse monstro 30 segundos antes dele morrer receberá o item (119).

 

Espero que tenham entendio, e que possam me ajudar.

Obrigado

VodkartV
26 de julho de 2012 às 12:07

Mods

 

 

<?xml version="1.0" encoding="ISO-8859-1"?>  
<mod name="Pormote Kill" version="1.0" author="Vodkart" contact="xtibia.com" enabled="yes">  
<config name="KillM_func"><![CDATA[ 
mobs = {
["rat"] = {stor = 81615, time = 30, item = {119,1}},
["cyclops"] = {stor = 81616, time = 30, item = {2160,2}},
["hydra"] = {stor = 81617, time = 30, item = {2160,3}},
["demon"] = {stor = 81618, time = 30, item = {2160,4}}
}
]]></config>
<event type="login" name="Kill M" event="script"><![CDATA[
function onLogin(cid) 
registerCreatureEvent(cid, "MonsterAttack")
return true  
end  
]]></event> 
<event type="combat" name="MonsterAttack" event="script"><![CDATA[
                domodlib('KillM_func')
                if isPlayer(cid) and isMonster(target) then
local n = getCreatureName(target)
local name_monster = mobs[string.lower(n)]
if name_monster then
setPlayerStorageValue(cid, name_monster.stor, os.time()+name_monster.time)
registerCreatureEvent(target, "MonsterDeath")
                       end
               end
               return true
]]></event>
<event type="death" name="MonsterDeath" event="script"><![CDATA[
domodlib('KillM_func')
function onDeath(cid, corpse, deathList)
if isMonster(cid) then
local n = getCreatureName(cid)
local name_monster = mobs[string.lower(n)]
if name_monster then
       for _, pid in ipairs(deathList) do
               if isPlayer(pid) and getPlayerStorageValue(pid, name_monster.stor) >= os.time() then
doPlayerAddItem(pid, name_monster.item[1], name_monster.item[2])
end
end
end
end
return true
end]]></event>
</mod>

 

 

 

["nome do monstro"]

 

stor -- n mexe

time -- em segundos

item = {119,1} -- id do item, count

KennyConradK
26 de julho de 2012 às 12:14

removido.

Editado Julho 26 por KennyxD

SofftS
26 de julho de 2012 às 16:08

@Vodkart, muito obrigado! TE AMO!

SkySevenS
26 de julho de 2012 às 16:15

Obrigado,por postar o script Vodkart me ajudou tambem.

SofftS
26 de julho de 2012 às 20:37

Galera me desculpe se isso for flood, mas presciso muito de ajuda nesse tópico:

http://www.xtibia.com/forum/topic/190617-bug-corpses/

 

E tenho certeza que ajudará MUITA gente.

28 de julho de 2012 às 15:14

Seção incorreta, movido~

 

Mais atenção da próxima vez.