Mensagem Em Vermelho Ao Matar Um Player

Hellfi
Por Hellfi
em Scripts

Hellfi

William Alves
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 04/06/08Posts: 11Char no Tibia: Lingks Thartarini

Galera, estou aqui para tirar uma dúvida..

Estou com um servidor de war 8.6 e tem o script de quando mata um player aparece em vermelho pra geral , eu percebi que isso dá um lag danado no meu server, ainda mais quando morre vários ao mesmo tempo.

Eu queria saber como faz pra tirar essa msg em vermelho, eu já tentei de vários jeitos aqui, mas eu acabava desabilitando a contagem de frags ,e desabilitando o reward de 5 platinum coins quando o player mata.

 

Aqui segue meu deathBroadcast :

 

 

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 = 2152,

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 = "You owned |TARGETNAME|! You have now |KILLERKILLS| kills!",

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|] Matou Facil o |TARGETNAME| [|TARGETLEVEL|]!",

 

messageClass = MESSAGE_STATUS_WARNING

},

 

killerAnimation = {

use = true,

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

color = 215

},

 

targetAnimation = {

use = true,

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

color = 215

}

}

 

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

 

 

Espero que possam me ajudar!, obrigado.

 

Ahh, e tbm quando mata um player ganha um coração escroto, se souberem tirar isso tbm..vlw

pbottrinks

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 21/08/11Posts: 130

Para tirar o Death Broadcast, vá em data>creaturescripts>scripts>deathBrodcast.lua, e apague as seguintes linhas:

brodcastMessage = {

use = true,

minLevel = false,

minLefelDiff = false

text = "|KILLERNAME| [|KILLERLEVEL|] just killed |TARGETNAME| [TARGETLEVEL]!",

messageClass = MESSAGE_STATUS_WARNING

},

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

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

end

Me passa seu script, qe vejo o do coração para você.

Abraços.

anigif_2.gif

Eskylo

boa sorte
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 11/08/10Posts: 477Gênero: Masculino

affected = 10,-- tenta ir abaixando o numero nessa linha pra ver se ajuda no lag, poe uns 5

 

.................................................

 

rewardItem = {

use = true, --muda pra false pra n ganhar mais o coraçao

itemid = 2152,

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).

}

 

........................................................

 

broadcastMessage = {

use = true, --muda pra false pra tirar o broadcast

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|] Matou Facil o |TARGETNAME| [|TARGETLEVEL|]!",

Atenciosamente, Eskylo

 

 

Ironman-icon.png

.

.

Hellfi

William Alves
avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 04/06/08Posts: 11Char no Tibia: Lingks Thartarini

local config = {

removeOnUse = "no",

usableOnTarget = "yes", -- can be used on target? (fe. healing friend)

splashable = "no",

realAnimation = "no", -- make text effect visible only for players in range 1x1

healthMultiplier = 1.0,

manaMultiplier = 1.0

}

 

config.removeOnUse = getBooleanFromString(config.removeOnUse)

config.usableOnTarget = getBooleanFromString(config.usableOnTarget)

config.splashable = getBooleanFromString(config.splashable)

config.realAnimation = getBooleanFromString(config.realAnimation)

 

local POTIONS = {

[8704] = {empty = 8704, splash = 2, health = {50, 100}}, -- small health potion

[7618] = {empty = 7618, splash = 2, health = {100, 200}}, -- health potion

[7588] = {empty = 7588, splash = 2, health = {200, 400}, level = 50, vocations =

 

{3, 4, 7, 8}, vocStr = "knights and paladins"}, -- strong health potion

[7591] = {empty = 7591, splash = 2, health = {500, 700}, level = 50, vocations =

 

{4, 8}, vocStr = "knights"}, -- great health potion

[8473] = {empty = 8473, splash = 2, health = {800, 1000}, level = 50, vocations =

 

{4, 8}, vocStr = "knights"}, -- ultimate health potion

 

[7620] = {empty = 7620, splash = 7, mana = {70, 130}}, -- mana potion

[7589] = {empty = 7589, splash = 7, mana = {110, 190}, level = 50, vocations = {1,

 

2, 3, 5, 6, 7}, vocStr = "sorcerers, druids and paladins"}, -- strong mana potion

[7590] = {empty = 7590, splash = 7, mana = {200, 300}, level = 50, vocations = {1,

 

2, 5, 6}, vocStr = "sorcerers and druids"}, -- great mana potion

 

[8472] = {empty = 8472, splash = 3, health = {200, 400}, mana = {110, 190}, level

 

= 50, vocations = {3, 7}, vocStr = "paladins"} -- great spirit potion

}

 

local exhaust = createConditionObject(CONDITION_EXHAUST)

setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') -

 

100))

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

local potion = POTIONS[item.itemid]

if(not potion) then

return false

end

 

if(not isPlayer(itemEx.uid) or (not config.usableOnTarget and cid ~= itemEx.uid))

 

then

if(not config.splashable) then

return false

end

 

if(toPosition.x == CONTAINER_POSITION) then

toPosition = getThingPos(item.uid)

end

 

doDecayItem(doCreateItem(2016, potion.splash, toPosition))

doTransformItem(item.uid, potion.empty)

return true

end

 

if(hasCondition(cid, CONDITION_EXHAUST_HEAL)) then

doPlayerSendDefaultCancel(cid, RETURNVALUE_YOUAREEXHAUSTED)

return true

end

 

if(((potion.level and getPlayerLevel(cid) < potion.level) or (potion.vocations and

 

not isInArray(potion.vocations, getPlayerVocation(cid)))) and

not getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES))

then

doCreatureSay(itemEx.uid, "Only " .. potion.vocStr .. (potion.level and ("

 

of level " .. potion.level) or "") .. " or above may drink this fluid.",

 

TALKTYPE_ORANGE_1)

return true

end

 

local health = potion.health

if(health and not doCreatureAddHealth(itemEx.uid, math.ceil(math.random(health[1],

 

health[2]) * config.healthMultiplier))) then

return false

end

 

local mana = potion.mana

if(mana and not doPlayerAddMana(itemEx.uid, math.ceil(math.random(mana[1], mana

 

[2]) * config.manaMultiplier))) then

return false

end

 

if isInArray({8704, 7618, 7588, 7591, 8473}, item.itemid) then

doSendAnimatedText(getPlayerPosition(cid), "Ahhhh...", 180)

elseif isInArray({7620, 7589, 7590, 8472}, item.itemid) then

doSendAnimatedText(getPlayerPosition(cid), "Ahhhh...", 17)

end

doSendMagicEffect(getThingPos(itemEx.uid), 30)

if realAnimation then

for i, tid in ipairs(getSpectators(getCreaturePosition(cid), 1, 1)) do

if(isPlayer(tid)) then

end

end

end

 

return true

end

 

 

 

Não tem o que você citou para mudar,

Eskylo

 

 

 

e ja tentei mudar o

local exhaust = createConditionObject(CONDITION_EXHAUST)

setConditionParam(exhaust, CONDITION_PARAM_TICKS, (getConfigInfo('timeBetweenExActions') -

100))

 

 

e ficou mesma coisa,

LucasCorrea

pbottrinks

avatar
Artesão
Artesão

INFOS

Grupo: ArtesãoRegistrado: 21/08/11Posts: 130

HELLFI o do EXHAUST é aí. Vai mudando e desligando o SERVER para testar.

anigif_2.gif

Eskylo

boa sorte
avatar
Visconde
Visconde

INFOS

Grupo: ViscondeRegistrado: 11/08/10Posts: 477Gênero: Masculino

tem sim, mandei pm...

 

ow, nem precisa desligar pra testar só usar o comando /reload actions com o god e testar

Atenciosamente, Eskylo

 

 

Ironman-icon.png

.

.