Ir para conteúdo

Featured Replies

Postado
Em 28/08/2019 em 01:18, Breniin disse:

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

 

how i can add this function? i dont have it and i need it please (doPlayerSendMailByName)

  • 1 month later...
  • Respostas 92
  • Visualizações 21k
  • 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

@luanluciano93 Tentei utilizar o script de mc para não ganhar loot, mas eu não sabia se era pra criar um novo arquivo, ou substituir, dai eu criei um arquivo e deu esse erro \/ no xml eu deixei assim <event type="login" name="RewardChestMc" event="script" value="rewardchest_mc.lua"/>   

image.png.1f1abcd713973cad4e4877c4ac6ea36d.png

 

Em 12/09/2019 em 09:02, luanluciano93 disse:

@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

 

 

 

Meu Curso sobre Programação para OTServer

Programando OTServer

 

Peça o seu script! Entre agora mesmo no grupo

Developing

 

Conteúdos:

 

Discord: Belmont#7352

Não esqueça do REP+ :)     

Postado

@luanluciano93 O event type está certo? onLogin, eu preciso registrar no login.lua?

Meu Curso sobre Programação para OTServer

Programando OTServer

 

Peça o seu script! Entre agora mesmo no grupo

Developing

 

Conteúdos:

 

Discord: Belmont#7352

Não esqueça do REP+ :)     

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

Informação Importante

Confirmação de Termo