Ir para conteúdo

Featured Replies

Postado

luanluciano93

 

Luan, ainda pode dar suporte? coloquei o script e aparentemente estar funcionando sem erros quando mato o "Boss" aparece 01:21 The following items are available in your reward chest:  red gem, 5 soul orb,  mastermind shield, 56 Dollar, 3 gold ingot, and 12 platinum coins.

Mas não chega na no meu depot sabe me dizer oque é? não aparece nenhum erro na distro TFS 0.4

  • Respostas 92
  • Visualizações 22.4k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • luanluciano93
    luanluciano93

    msg = msg .. " ".. (tabela_reward[x][2] > 1 and tabela_reward[x][2] or "") .." ".. getItemNameById(tabela_reward[x][1]) ..","  

  • luanluciano93
    luanluciano93

    pessoal, só final de semana para fixar

  • Coloquei em meu servidor 8.60 (TFS 0.4) e funcionou de primeira sem erros na distro ou algo parecido. Sistema perfeito. Rep + !! Uma dica para quem quer imitar o global com este sistema e ter uma

Posted Images

Postado
11 horas atrás, luanluciano93 disse:

@Gabrieldsadaxas obrigado pelo comentário, ajustei um "comentário" em cada nome de boss observando que tem que ser todo em letras minúsculas. 
 

@Breniin verifica se no seu servidor existe a função "doPlayerSendMailByName", que é a função que faz o envio dos items para o depot.



Valeu era isso mesmo funcionou perfeitamente, estava faltando a função de enviar os items

  • 2 weeks later...
Postado
  • Autor

@Gabrieldsadaxas testa assim: 

-- Sistema de recompensa criado por luanluciano93

dofile('data/sistemas/rewardchest.lua')

function onStatsChange(cid, attacker, type, combat, value)
	if isMonster(attacker) and (type == STATSCHANGE_HEALTHLOSS or type == STATSCHANGE_MANALOSS) then
		local boss = REWARDCHEST.bosses[getCreatureName(attacker):lower()]
		if boss then
			for _, uid in pairs(getPlayersOnline()) do
				if getPlayerIp(cid) == getPlayerIp(uid) and getPlayerStorageValue(uid, boss.storage) > 0 then
					doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You already have another player inside the reward system.")
					return true
				end
			end
			setPlayerStorageValue(cid, boss.storage, getPlayerStorageValue(cid, boss.storage) + math.ceil((value / REWARDCHEST.formula.block)))
			setPlayerStorageValue(cid, REWARDCHEST.storageExaust, os.time() + 5)
		end
	elseif (isPlayer(attacker) and (type == STATSCHANGE_HEALTHGAIN or type == STATSCHANGE_MANAGAIN) and (getCreatureHealth(cid) < getCreatureMaxHealth(cid)) and (getPlayerStorageValue(cid, REWARDCHEST.storageExaust) >= os.time())) then
		for key, valor in pairs(REWARDCHEST.bosses) do
			if getPlayerStorageValue(cid, valor.storage) > 0 then
				if getCreatureHealth(cid) + value > getCreatureMaxHealth(cid) then
					local add = getCreatureMaxHealth(cid) - getCreatureHealth(cid)
					setPlayerStorageValue(attacker, valor.storage, getPlayerStorageValue(attacker, valor.storage) + math.ceil((add / REWARDCHEST.formula.suport)))
				else
					setPlayerStorageValue(attacker, valor.storage, getPlayerStorageValue(attacker, valor.storage) + math.ceil((value / REWARDCHEST.formula.suport)))
				end
			end
		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 520.2k

Informação Importante

Confirmação de Termo