Ir para conteúdo

Featured Replies

Postado
  • Autor
3 minutos atrás, Talesigorvr disse:

if isMC (cid) and isInArray (config.monster, getCreatureName (target)) then

 

Ficaria aonde? Tentei trocar aqui sozinho mas acabou dando um errorzinho. :/

Citar

 

local config = {
monster = {"Amon", "Basilisco","Azazel"}, -- nome dos monstros, separado por vírgulas.
item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o anterior] = ID do item1, ID do item2, ID do item3...
qnt = {[1] = 2, [2] = 5}, -- [um numero maior que o anterior] = quantidade do item1, quantidade do item2, quantidade do item3...
effect = 27, -- efeito ao matar o monstro.
}


local function isMC (cid)
    for _, pid in ipairs(getPlayersOnline()) do
        if cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid) then return false end
    end
return true
end

function onKill(cid, target)
    if isMC (cid) then
        if isInArray(config.monster, getCreatureName(target)) then
            for i = 1, #config.item do
                doPlayerAddItem (cid, config.item, config.qnt)
            end

            doPlayerSendTextMessage (cid, 19, "You will receive a reward for defeating the "..getCreatureName(target)..".")
            doSendMagicEffect (getThingPos (cid), config.effect)
        end
    else
        doPlayerSendTextMessage (cid, 19, "You will not receive a reward for is Multi-Client.")
    end
return true
end

 

 

  • Respostas 51
  • Visualizações 6.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • function onDeath(cid, corpse, deathList) local monsters, t = {"Demon","Hydra"}, {} local items = {{2160,1},{2148,2}} -- ITEM ID, QUANTIDADE if isMonster(cid) and isInArray(monsters, getCreatureName

  • Bodak Reborn
    Bodak Reborn

    creaturescripts/script nome_arquivo.lua local config = { monster = {"Demon", "Dragon"}, -- nome dos monstros, separado por vírgulas. item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o

  • @Talesigorvr   se você diz, ta dito!   eu pensei em fazer por onDeath, fiz um esboço, claro que tem que arrumar para checar se o jogador tem CAP suficiente, se não tiver mandar o i

Postado
local config = {
monster = {"Amon", "Basilisco","Azazel"}, -- nome dos monstros, separado por vírgulas.
item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o anterior] = ID do item1, ID do item2, ID do item3...
qnt = {[1] = 2, [2] = 5}, -- [um numero maior que o anterior] = quantidade do item1, quantidade do item2, quantidade do item3...
effect = 27, -- efeito ao matar o monstro.
}

local function isMC (cid)
    for _, pid in ipairs(getPlayersOnline()) do
        if cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid) then return false end
    end
return true
end
function onKill(cid, target)
	if isInArray (config.monster, getCreatureName (target)) then
		if isMC (cid) then
				for i = 1, #config.item do
					doPlayerAddItem (cid, config.item, config.qnt)
				end
				doPlayerSendTextMessage (cid, 19, "You will receive a reward for defeating the "..getCreatureName(target)..".")
				doSendMagicEffect (getThingPos (cid), config.effect)
		else
			doPlayerSendTextMessage (cid, 19, "You will not receive a reward for is Multi-Client.")
		end
	end
return true
end

 

Editado por Talesigorvr (veja o histórico de edições)

Não dou suporte via PM, crie um tópico caso tenha dúvidas.

Isso previne que outras pessoas com a mesma dúvida criem tópicos desnecessários.

Postado
  • Autor
25 minutos atrás, Talesigorvr disse:

local config = {
monster = {"Amon", "Basilisco","Azazel"}, -- nome dos monstros, separado por vírgulas.
item = {[1] = 2160, [2] = 2159}, -- [um numero maior que o anterior] = ID do item1, ID do item2, ID do item3...
qnt = {[1] = 2, [2] = 5}, -- [um numero maior que o anterior] = quantidade do item1, quantidade do item2, quantidade do item3...
effect = 27, -- efeito ao matar o monstro.
}

local function isMC (cid)
    for _, pid in ipairs(getPlayersOnline()) do
        if cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid) then return false end
    end
return true
end
function onKill(cid, target)
    if isMC (cid) and isInArray (config.monster, getCreatureName (target)) then
            for i = 1, #config.item do
                doPlayerAddItem (cid, config.item, config.qnt)
            end
            doPlayerSendTextMessage (cid, 19, "You will receive a reward for defeating the "..getCreatureName(target)..".")
            doSendMagicEffect (getThingPos (cid), config.effect)
    else
        doPlayerSendTextMessage (cid, 19, "You will not receive a reward for is Multi-Client.")
    end
return true
end

 

Continua a msm coisa, ao matar algum dos bosses com MC, ele bloqueia a recompensa e manda a msg (Ate ai normal).

Mas qud eu mato um Wasp ou Player, ele manda a msg. :/

@Talesigorvr Mano nao sei se tem algo haver, mas vou mandar meu OnKill (Nao sei se pode ser isso que esteja fazendo acontecer)

 

 

Citar

function onKill(cid, target)
--config----------------------------
local lvl = getPlayerLevel(cid) --players level
local nlvl = getPlayerLevel(cid) + 5 -- add 5 levels
--end-------------------------------
    if isPlayer(target) == TRUE then
        if getPlayerIp(cid) ~= getPlayerIp(target) then
                        local exp = (50 * (lvl) * (lvl) * (lvl) - 150 * (lvl) * (lvl) + 400 * (lvl)) / 5
                        local nexp = (50 * (nlvl) * (nlvl) * (nlvl) - 150 * (nlvl) * (nlvl) + 400 * (nlvl)) / 5
                        local newexp = nexp - exp
                        doPlayerAddExp(cid,newexp)
                        doSendAnimatedText(getPlayerPosition(cid), "Orgasmic~", 198)
                else
            doPlayerAddExperience(cid, -50000)
            doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
        end
        end
    return TRUE
end 

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo