Ir para conteúdo

Featured Replies

Postado
  Em 14/08/2016 em 00:35, Zalton Returns disse:

Any way to add it to highscores? :D

 

 


<img id="ContentBoxHeadline" class="Title" src="layouts/tibiacom/images/header/headline-highscores.gif" alt="Contentbox headline">
<?php
if(!defined('INITIALIZED'))
    exit;

$list = 'experience';
if(isset($_REQUEST['list']))
    $list = $_REQUEST['list'];

$page = 0;
if(isset($_REQUEST['page']))
    $page = min(50, $_REQUEST['page']);

$vocation = '';
if(isset($_REQUEST['vocation']))
    $vocation = $_REQUEST['vocation'];

switch($list)
{
    case "fist":
        $id=Highscores::SKILL_FIST;
        $list_name='Fist Fighting';
        break;
    case "club":
        $id=Highscores::SKILL_CLUB;
        $list_name='Club Fighting';
        break;
    case "sword":
        $id=Highscores::SKILL_SWORD;
        $list_name='Sword Fighting';
        break;
    case "axe":
        $id=Highscores::SKILL_AXE;
        $list_name='Axe Fighting';
        break;
    case "distance":
        $id=Highscores::SKILL_DISTANCE;
        $list_name='Distance Fighting';
        break;
    case "shield":
        $id=Highscores::SKILL_SHIELD;
        $list_name='Shielding';
        break;
    case "fishing":
        $id=Highscores::SKILL_FISHING;
        $list_name='Fishing';
        break;
    case "magic":
        $id=Highscores::SKILL__MAGLEVEL;
        $list_name='Magic';
        break;
    default:
        $id=Highscores::SKILL__LEVEL;
        $list_name='Experience';
        break;
}
$world_name = $config['server']['serverName'];

$offset = $page * 100;
$skills = new Highscores($id, 100, $page, $vocation);
$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><CENTER><H2>Ranking for '.htmlspecialchars($list_name).' on '.htmlspecialchars($world_name).'</H2></CENTER><BR>';

$main_content .= '<br><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%></TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=whites><B>Rank</B></TD><TD WIDTH=75% CLASS=whites><B>Name</B></TD><TD WIDTH=15% CLASS=whites><b><center>Level</center></B></TD>';
if($list == "experience")
    $main_content .= '<TD CLASS=whites><b><center>Experience</center></B></TD>';
//$main_content .= '</TR><TR>';
$main_content .= '</TR>';
$number_of_rows = 0;
foreach($skills as $skill)
{
    if($list == "magic")
        $value = $skill->getMagLevel();
    elseif($list == "experience")
        $value = $skill->getLevel();
    else
        $value = $skill->getScore();
    $bgcolor = (($number_of_rows++ % 2 == 1) ?  $config['site']['darkborder'] : $config['site']['lightborder']);
    $main_content .= '<tr bgcolor="'.$bgcolor.'"><td style="text-align:right">'.($offset + $number_of_rows).'.</td><td><a href="?subtopic=characters&name='.urlencode($skill->getName()).'">'.($skill->getOnline()>0 ? "<font color=\"green\">".htmlspecialchars($skill->getName())."</font>" : "<font color=\"red\">".htmlspecialchars($skill->getName())."</font>").'</a><br><small>'.$skill->getLevel().' '.htmlspecialchars(Website::getVocationName($skill->getVocation())).'</small></td><td><center>'.$value.'</center></td>';
    if($list == "experience")
        $main_content .= '<td><center>'.$skill->getExperience().'</center></td>';
    $main_content .= '</tr>';
}
$main_content .= '</TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%>';
if($page > 0)
    $main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list='.urlencode($list).'&page='.($page - 1).'&vocation=' . urlencode($vocation) . '" CLASS="size_xxs">Previous Page</A></TD></TR>';
if($page < 50)
    $main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list='.urlencode($list).'&page='.($page + 1).'&vocation=' . urlencode($vocation) . '" CLASS="size_xxs">Next Page</A></TD></TR>';
$main_content .= '</TABLE></TD><TD WIDTH=5%><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=1 HEIGHT=1 BORDER=0></TD><TD WIDTH=15% VALIGN=top ALIGN=right><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=whites><B>Choose a skill</B></TD></TR><TR BGCOLOR="'.$config['site']['lightborder'].'"><TD><A HREF="?subtopic=highscores&list=experience" CLASS="size_xs">Experience</A><BR><A HREF="?subtopic=highscores&list=magic" CLASS="size_xs">Magic</A><BR><A HREF="?subtopic=highscores&list=shield" CLASS="size_xs">Shielding</A><BR><A HREF="?subtopic=highscores&list=distance" CLASS="size_xs">Distance</A><BR><A HREF="?subtopic=highscores&list=club" CLASS="size_xs">Club</A><BR><A HREF="?subtopic=highscores&list=sword" CLASS="size_xs">Sword</A><BR><A HREF="?subtopic=highscores&list=axe" CLASS="size_xs">Axe</A><BR><A HREF="?subtopic=highscores&list=fist" CLASS="size_xs">Fist</A><BR><A HREF="?subtopic=highscores&list=fishing" CLASS="size_xs">Fishing</A><BR></TD></TR></TABLE></TD><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>';

 

It works :) but anyway to make it so my character doesnt say the word?

 

20:36 God Mythera [83]: !mining

 

 

here bro.

 

<img id="ContentBoxHeadline" class="Title" src="layouts/tibiacom/images/header/headline-highscores.gif" alt="Contentbox headline">
<?php
if(!defined('INITIALIZED'))
	exit;

$list = 'experience';
if(isset($_REQUEST['list']))
	$list = $_REQUEST['list'];

$page = 0;
if(isset($_REQUEST['page']))
	$page = min(50, $_REQUEST['page']);

$vocation = '';
if(isset($_REQUEST['vocation']))
	$vocation = $_REQUEST['vocation'];

switch($list)
{
	case "fist":
		$id=Highscores::SKILL_FIST;
		$list_name='Fist Fighting';
		break;
	case "club":
		$id=Highscores::SKILL_CLUB;
		$list_name='Club Fighting';
		break;
	case "sword":
		$id=Highscores::SKILL_SWORD;
		$list_name='Sword Fighting';
		break;
	case "axe":
		$id=Highscores::SKILL_AXE;
		$list_name='Axe Fighting';
		break;
	case "distance":
		$id=Highscores::SKILL_DISTANCE;
		$list_name='Distance Fighting';
		break;
	case "shield":
		$id=Highscores::SKILL_SHIELD;
		$list_name='Shielding';
		break;
	case "fishing":
		$id=Highscores::SKILL_FISHING;
		$list_name='Fishing';
		break;
	case "magic":
		$id=Highscores::SKILL__MAGLEVEL;
		$list_name='Magic';
		break;
	default:
		$id=Highscores::SKILL__LEVEL;
		$list_name='Experience';
		break;
		$id=Highscores::SKILL__RESET;
		$list_name='Reset';
		break;
}
$world_name = $config['server']['serverName'];

$offset = $page * 100;
$skills = new Highscores($id, 100, $page, $vocation);
$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><CENTER><H2>Ranking for '.htmlspecialchars($list_name).' on '.htmlspecialchars($world_name).'</H2></CENTER><BR>';

$main_content .= '<TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD WIDTH=10% CLASS=whites><B>Rank</B></TD><TD WIDTH=75% CLASS=whites><B>Name</B></TD><TD WIDTH=15% CLASS=whites><b><center>Level</center></B></TD>';
if($list == "experience") 
{
$main_content .= '<TD CLASS=whites><b><center>Resets</center></B></TD>';
}
$main_content .= '</TR><TR>';
$number_of_rows = 0;
foreach($skills as $skill)
{
	if($list == "magic")
		$value = $skill->getMagLevel();
		if($list == "reset")
		$value = $skill->getResets();
	elseif($list == "experience")
		$value = $skill->getLevel();
	else
		$value = $skill->getScore();
	$bgcolor = (($number_of_rows++ % 2 == 1) ?  $config['site']['darkborder'] : $config['site']['lightborder']);
	$main_content .= '<tr bgcolor="'.$bgcolor.'"><td style="text-align:right">'.($offset + $number_of_rows).'.</td><td><a href="?subtopic=characters&name='.urlencode($skill->getName()).'">'.($skill->getOnline()>0 ? "<font color=\"green\">".htmlspecialchars($skill->getName())."</font>" : "<font color=\"red\">".htmlspecialchars($skill->getName())."</font>").'</a><br><small>'.$skill->getLevel().' '.htmlspecialchars(Website::getVocationName($skill->getVocation())).'</small></td><td><center>'.$value.'</center></td>';
	if($list == "experience")
		$main_content .= '<td><center>'.$skill->getResets().'</center></td>';
	$main_content .= '</tr>';
}
$main_content .= '</TABLE><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1 WIDTH=100%>';
if($page > 0)
	$main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list='.urlencode($list).'&page='.($page - 1).'&vocation=' . urlencode($vocation) . '" CLASS="size_xxs">Previous Page</A></TD></TR>';
if($page < 50)
	$main_content .= '<TR><TD WIDTH=100% ALIGN=right VALIGN=bottom><A HREF="?subtopic=highscores&list='.urlencode($list).'&page='.($page + 1).'&vocation=' . urlencode($vocation) . '" CLASS="size_xxs">Next Page</A></TD></TR>';
$main_content .= '</TABLE></TD><TD WIDTH=5%><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=1 HEIGHT=1 BORDER=0></TD><TD WIDTH=15% VALIGN=top ALIGN=right><TABLE BORDER=0 CELLPADDING=4 CELLSPACING=1><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=whites><B>Choose a skill</B></TD></TR><TR BGCOLOR="'.$config['site']['lightborder'].'"><TD><A HREF="?subtopic=highscores&list=experience" CLASS="size_xs">Experience</A><BR><A HREF="?subtopic=highscores&list=magic" CLASS="size_xs">Magic</A><BR><A HREF="?subtopic=highscores&list=shield" CLASS="size_xs">Shielding</A><BR><A HREF="?subtopic=highscores&list=distance" CLASS="size_xs">Distance</A><BR><A HREF="?subtopic=highscores&list=club" CLASS="size_xs">Club</A><BR><A HREF="index.php?subtopic=highscores&list=reset" CLASS="size_xs">Reset</A><BR><A HREF="?subtopic=highscores&list=sword" CLASS="size_xs">Sword</A><BR><A HREF="?subtopic=highscores&list=axe" CLASS="size_xs">Axe</A><BR><A HREF="?subtopic=highscores&list=fist" CLASS="size_xs">Fist</A><BR><A HREF="?subtopic=highscores&list=fishing" CLASS="size_xs">Fishing</A><BR></TD></TR></TABLE></TD><TD><IMG SRC="'.$layout_name.'/images/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>';

 

  • Respostas 122
  • Visualizações 20k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • tem sim, eu só não coloquei porque o próprio tibia ja tem um sistema de exhausted padrão de 1 segundo entre ações contendo itemEx (que é configurável pelo config.lua)

  • dá ué..  terra = {65783} . . . isInArray(terra, itemEx.uid) agora só vai dar pra minerar nos pisos que tiverem unique id 65783. A constante de level é o seguinte.. a fórmula da experiência necessá

  • sim ué.. pra upar do 50 pro 51 a conta é a seguinte: (51*51/k) - (50*50/k) que é igual a 1300 - 1250 = 50 picaretadas.

Postado
  Em 14/08/2016 em 19:06, xWhiteWolf disse:

change return true to return false

 

como eu coloco exhausted pro cara usar a pick?

e como eu colocaria pra ele usar apenas por um tempo, tipo 2~3 horas.. ou até usar um numero de pick na pedra?

 

deixa, já consegui solucionar.

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

  • 1 month later...
Postado

Boa Tarde,

Queria uma Porcentagem Baixa, Exemplo a cada 20 "minerada" upava para outro nivel e Iria ficando mais dificil pra upar....

Porem Conforme Vai Upando vai Pegando Itens Diferentes...

Aqui Tentei Fazer.... Mais não Consegui

terra = {65530}
 levels = {
[0] = {2229,1294},
[1] = {2229,1294,2144}, 
[2] = {2229,1294,2144,2143}, 
[3] = {2229,1294,2144,2143,5881},
[4] = {2229,1294,2144,2143,5881,2159},
[5] = {2229,1294,2144,2143,5881,2159,2151}, 
[6] = {2229,1294,2144,2143,5881,2159,2151,5944}, 
[7] = {2229,1294,2144,2143,5881,2159,2151,5944}, 
[8] = {2229,1294,2144,2143,5881,2159,2151,5944,5889}, 
[9] = {2229,1294,2144,2143,5881,2159,2151,5944,5889},  
[10] = {2229,1294,2144,2143,5881,2159,2151,5944,5889,6547},
[11] = {2229,1294,2144,2143,5881,2159,2151,5944,5889,6547} 
} 


local config = {
storage = 19333,
chance = 80, --- chance de achar um item ou não
k = 1, --- constante de level.. quanto maior, mais fácil é upar. (a fórmula é level ao quadrado dividido pela constante)
experience = 19334
}


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


local drops = {}


function getDrops(cid)
for i= 0,getPlayerStorageValue(cid, config.storage) do
if levels[i] then
table.insert(drops, levels[i])
end
end
return true
end


if isInArray(terra, itemEx.uid) then
getDrops(cid)
doPlayerSetStorageValue(cid, config.experience, getPlayerStorageValue(cid, config.experience)+1)
local experience = getPlayerStorageValue(cid, config.experience)
if experience >= (8+(getPlayerStorageValue(cid, config.storage)^2))/config.k then
doPlayerSetStorageValue(cid, config.storage, getPlayerStorageValue(cid, config.storage)+1)
doPlayerSendTextMessage(cid, 27, "Congratulations, you have leveled! Your currect level is "..getPlayerStorageValue(cid, config.storage) ..".")
if getPlayerStorageValue(cid, config.storage) == 50 then
doPlayerSendTextMessage(cid, 20, "For reaching level "..getPlayerStorageValue(cid, config.storage) .." you have been awarded with Mining Helmet.")
doPlayerAddItem(cid, 7369, 1, true)
end
end
if config.chance >= math.random(1,100) then
if #drops >= 1 then
local item = drops[math.random(1,#drops)]
doPlayerSendTextMessage(cid, 27, "You have found a "..getItemNameById(item)..".")
doCreatureSay(cid, "Success", TALKTYPE_SAY)
doPlayerAddItem(cid, item, 1, true)

end
doSendMagicEffect(toPosition, 3)
else
doSendMagicEffect(toPosition, 2)
return true
end
elseif itemEx.itemid == item.itemid then
doPlayerSendTextMessage(cid, 27, "You're currenctly level "..getPlayerStorageValue(cid, config.storage)..".")
else
return false
end
return true
end

Outro Exemplo Mais Explicado esta no http://realbaiak.com/?subtopic=miningsystem

Poderia Me Ajudar? a fazer deste geito que disse em cima...

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

Postado
  Em 21/08/2016 em 04:15, Jobs disse:

 

como eu coloco exhausted pro cara usar a pick?

e como eu colocaria pra ele usar apenas por um tempo, tipo 2~3 horas.. ou até usar um numero de pick na pedra?

 

deixa, já consegui solucionar.

Tem como você postar a solução? eu tbm queria colocar exhausted na pick

Postado
  • Autor
  Em 02/10/2016 em 19:22, DeathRocks disse:

Boa Tarde,

Queria uma Porcentagem Baixa, Exemplo a cada 20 "minerada" upava para outro nivel e Iria ficando mais dificil pra upar....

Porem Conforme Vai Upando vai Pegando Itens Diferentes...

Aqui Tentei Fazer.... Mais não Consegui

Outro Exemplo Mais Explicado esta no http://realbaiak.com/?subtopic=miningsystem

Poderia Me Ajudar? a fazer deste geito que disse em cima...

no lugar de 

local item = drops[math.random(1,#drops)]

deixa assim

local itens = drops[math.random(1,#drops)]
local item = itens[math.random(1, #itens)]

 

 

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