VO

Death Cast

Por Vodkart, 15 de mar. de 2011 em Globalevents e Spells

script
21
6.5k
VodkartV
15 de março de 2011 às 13:55

Resumindo rapidamente é um script onde tem a função de mandar mensagem ao servidor dizendo que tal player morreu,seja para um jogador ou para um montro.

i2092_asasasasaas.PNG

 

 

Creaturescript/script

 

crie um arquivo.lua e renomeie para

 

deathcast.lua

function onDeath(cid, corpse, deathList)
if isPlayer(deathList[1]) then
return true,doBroadcastMessage("[DeathCast] Informs:\n".. getCreatureName(cid) .. "[" .. getPlayerLevel(cid) .. "] was Killed by player: " .. getCreatureName(deathList[1]) .. "[" .. getPlayerLevel(deathList[1]) .. "]",18)
end
return doBroadcastMessage("[DeathCast] Informs:\nThe player ".. getCreatureName(cid) .. "[" .. getPlayerLevel(cid) .. "] was Killed by " .. getCreatureName(deathList[1]) .. ".",20)
end   

 

Creaturescript.xml adicione

<event type="death" name="DeathC" event="script" value="deathcast.lua"/> 

 

creaturescript/script/login.lua

registerCreatureEvent(cid, "DeathC")

Editado Fevereiro 21 por Vodkart

15 de março de 2011 às 14:32

Simples e útil, valeu ae cara. OBS: Fiz a função também, entra no msn.

VodkartV
18 de março de 2011 às 20:07

vlw demon caolho =*

1 mês depois...
HudsinH
27 de abril de 2011 às 21:40

Poderia ser assim mas mandar a msg no default? .-.

 

Assim não daria "spam" na tela ^^

Editado Abril 27 por Hudsin

tinfer4T
29 de abril de 2011 às 22:09

@UP

 

Não tenho a listinha aqui mais é só ir vendo você troca o número 22 no final

,22

 

vai trocando para acho que 14 ~ 20 que vai aparecer no default

Editado Abril 29 por Fault

1 mês depois...
19 de maio de 2011 às 16:29

Ake no meu ot 7.92 nao deu certo

pq deve ser antigo meu ot dai nao deu fera]

se conseguir para 7.92 fiko grato.

3 meses depois...
hique86H
25 de agosto de 2011 às 22:16

Teria como eu fazer com que apareça no chat Default?!? tipo tem outros chats em meu ot, tipo o Private Chat Channel, CHat-bate-papo, RL Chat entre outros, teria como fazer isso?!? para que apareça em outro chat?!? e mais uma coisinha, tem como aparecer, só quando um player for morto por outro player?!?

 

Valew, quem puder, ajuda ae...

29 de agosto de 2011 às 08:32

pow eu tmb quero qeu apareca so no DEFAULT alguem esplica como coloca ?

LolkskyL
29 de agosto de 2011 às 16:03

Eu não usaria a parte que informa pra qual MONSTRO morreu, derrepente o cara ta hunted,e aparece la "fulano morreu pra dragon", o povo que ta atraz dele vai ter uma noção de onde ele caça... assim tira um povo do RPG de "procura" o nego pra debuia na SD :thumbsupsmiley2:

 

é apenas minha opnião, ma so script está otimo :thumbsupsmiley:

2 meses depois...
rian121213R
04 de outubro de 2011 às 11:10

11:08 [DeathCast] Informs: The player Guigo[6318] was Killed by New Blait.

 

BAUM, MEU OT TEM VIP AOL AI QUAND OO LEK MORRE DE VOP AOL APAREÇE HOLY!! E NAO O BROADCAST MAIS SE MORRE SEM AOL APARECE TEM COMO ARRUMA PRA APAREÇE MRM SE O LEK TIVE DE VIP AOL? SE AJUDA E REP ++ :thumbsupsmiley:

4 meses depois...
LucasCastroL
26 de fevereiro de 2012 às 04:01

Muito BOM

 

Vlw's

 

;D

1 mês depois...
kelvinvictorK
09 de março de 2012 às 14:23

Você quem fez o script? se foi você parabéns, vejo muitos ots, principalmente de war com esse sistema.

VodkartV
09 de março de 2012 às 15:07

foi ué '-'

2 semanas depois...
gustavo121G
18 de março de 2012 às 21:29

não teria como vc por tipo ex : loco [148] acabou de matar mane [130]

 

 

 

me repond ainda hj se dermdr.gif

ZmovirZ
18 de março de 2012 às 21:36

 

local config = {

affected = 10, -- how many players (deathAssits) from table deathList should this script be executed for?

 

killStorageValue = 3943,

deathStorageValue = 3944,

 

-- commands for the texts (those inside of ||, example: |KILLS| to show skills): KILLS, KILLERNAME, TARGETNAME

rewardItem = {

use = true,

itemid = 2160,

minLevel = false, -- false if you don't want any level req

minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).

},

 

killMessage = {

use = true,

text = "Voce matou |TARGETNAME|! voce tem |KILLERKILLS| frags!",

messageClass = MESSAGE_STATUS_CONSOLE_BLUE

},

 

broadcastMessage = {

use = true,

minLevel = false, -- false if you don't want any level req

minLevelDiff = false, -- false if you don't want any level diff req (negative numbers allowed).

text = "|KILLERNAME| [|KILLERLEVEL|] Acaba de matar |TARGETNAME| [|TARGETLEVEL|]!",

messageClass = MESSAGE_STATUS_WARNING

},

 

killerAnimation = {

use = true,

text = "MATEI!", -- Only 9 letters! No "commands" here.

color = 144

},

 

targetAnimation = {

use = true,

text = "MORRI!", -- Only 9 letters! No "commands" here.

color = 180

}

}

 

function onDeath(cid, corpse, deathList)

for i = 1, math.min(config.affected, getConfigInfo('deathAssistCount')) do

local killer = deathList

if(isPlayer(killer) == TRUE) then

local targetKills = math.max(0, getPlayerStorageValue(cid, config.killStorageValue)) + 1

local targetDeaths = math.max(0, getPlayerStorageValue(cid, config.deathStorageValue)) + 1

 

local killerKills = math.max(0, getPlayerStorageValue(killer, config.killStorageValue)) + 1

local killerDeaths = math.max(0, getPlayerStorageValue(killer, config.deathStorageValue)) + 1

 

setPlayerStorageValue(killer, config.killStorageValue, targetKills)

setPlayerStorageValue(cid, config.deathStorageValue, targetDeaths)

 

local killerLevel = getPlayerLevel(killer)

local targetLevel = getPlayerLevel(cid)

local levelDiff = targetLevel - killerLevel

 

local values = {

["KILLERKILLS"] = killerKills,

["KILLERDEATHS"] = killerDeaths,

["KILLERNAME"] = getCreatureName(killer),

["KILLERLEVEL"] = killerLevel,

 

["TARGETKILLS"] = targetKills,

["TARGETDEATHS"] = targetDeaths,

["TARGETNAME"] = getCreatureName(cid),

["TARGETLEVEL"] = targetLevel

}

 

function formateString(str)

return(str:gsub("|([A-Z]+)|", (function(a) return values[a] end)))

end

 

if(config.rewardItem.use and (not config.rewardItem.minLevel or targetLevel >= config.rewardItem.minLevel) and (not config.rewardItem.minLevelDiff or levelDiff >= config.rewardItem.minLevelDiff)) then

local uid = doPlayerAddItem(killer, config.rewardItem.itemid, 5)

end

if(config.killMessage.use) then

doPlayerSendTextMessage(killer, config.killMessage.messageClass, formateString(config.killMessage.text))

end

if(config.broadcastMessage.use and (not config.broadcastMessage.minLevel or getPlayerLevel(cid) >= config.broadcastMessage.minLevel) and (not config.broadcastMessage.minLevelDiff or levelDiff >= config.broadcastMessage.minLevelDiff)) then

broadcastMessage(formateString(config.broadcastMessage.text), config.broadcastMessage.messageClass)

end

if(config.killerAnimation.use) then

doSendAnimatedText(getCreaturePosition(killer), config.killerAnimation.text, config.killerAnimation.color)

end

if(config.targetAnimation.use) then

doSendAnimatedText(getCreaturePosition(cid), config.targetAnimation.text, config.targetAnimation.color)

end

end

end

 

return true

end

 

 

 

seria esse?

 

 

@TOPIC

Belo script vodkart parabens

Editado Março 18 por Zmovir