[CreatueScripts] P.v.P Channel [Simples]
29/9/2015, 19:25
Primeiramente vá em /data/creaturescripts/scripts cria um arquivo pvp channel e adiciona isso dentro:
depois em creaturescripts.xml adicione essa tag:
em login.lua essa linha:
em data/xml/channels adicione essa tag:
- Spoiler:
- local storage = {
kills = 80032
}
local msg = {
[2] = "DOUBLE KILL!", -- kills, mensagem
[3] = "TRIPLE KILL!",
[5] = "M-M-M-MONSTER KILL!!",
[7] = "RAMPAGE!",
[9] = "UNSTOPPABLE!",
[12] = "GODLIKE!"
}
local rewards = {
[2] = {item =12 , quanti =1}
[3] = {item =12 , quanti =1}
[5] = {item =12 , quanti =1}
[7] = {item =12 , quanti =1}
[9] = {item =12 , quanti =1}
[12] = {item =12 , quanti =1}
}
function onKill(cid, target, lastHit)
if isPlayer(cid) and isPlayer(target) then
setPlayerStorageValue(cid, storage.kills, getPlayerStorageValue(cid, storage.kills) + 1)
setPlayerStorageValue(target, storage.kills, 0)
for _, pid in ipairs(getPlayersOnline()) do
local k = msg[getPlayerStorageValue(cid, storage.kills)]
local r = rewards[getPlayerStorageValue(cid, storage.kills)]
local s = {"matou", "cortou em pedaços", "detonou", "humilhou", "arrebentou"}
doPlayerSendChannelMessage(pid, "Killer Informer", "".. getCreatureName(cid) .." ".. s[math.random(1, #s)] .." ".. getCreatureName(target) ..".", TALKTYPE_CHANNEL_Y, 15)
if k then
doPlayerSendChannelMessage(pid, "Killer Informer", getCreatureName(cid) .. " - ".. k, TALKTYPE_CHANNEL_O, 15)
end
end
if r then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "PVP: Você ganhou "..r.quanti.." "..getItemNameById(r.item)..".")
doPlayerAddItem(cid, r.item, r.quanti)
end
end
return true
end
depois em creaturescripts.xml adicione essa tag:
- Código:
<event type="kill" name="PvpChannel" event="script" value="pvp channel.lua"/>
em login.lua essa linha:
- Código:
registerCreatureEvent(cid, "PvpChannel")
em data/xml/channels adicione essa tag:
- Código:
<channel id="10" name="PVP" logged="yes" active="0"/>
Permissões neste sub-fórum
Não podes responder a tópicos
|
|