Jump to content
  • 0

Help about Max Level Ranking


Question

Posted (edited)

Hi guys, 

 

i have this script 

/*	    ___       ___       ___       ___       ___       ___       ___       ___       ___       ___       ___
	   /\  \     /\  \     /\  \     /\__\     /\  \     /\  \     /\  \     /\  \     /\__\     /\__\     /\  \
	   \:\  \   /::\  \   /::\  \   /:| _|_   /::\  \   /::\  \   /::\  \   /::\  \   /:| _|_   /:/ _/_   /::\  \
	   /::\__\ /::\:\__\ /:/\:\__\ /::|/\__\ /:/\:\__\ /:/\:\__\ /::\:\__\ /:/\:\__\ /::|/\__\ /:/_/\__\ /\:\:\__\
	  /:/\/__/ \:\:\/  / \:\ \/__/ \/|::/  / \:\/:/  / \:\ \/__/ \;:::/  / \:\/:/  / \/|::/  / \:\/:/  / \:\:\/__/
	  \/__/     \:\/  /   \:\__\     |:/  /   \::/  /   \:\__\    |:\/__/   \::/  /    |:/  /   \::/  /   \::/  /
        	     \/__/     \/__/     \/__/     \/__/     \/__/     \|__|     \/__/     \/__/     \/__/     \/__/

	*----------------------------------------- eAthena Script ---------------------------------------------*
	* Maximum Level Announce									       *
	*----------------------------------------------- By: --------------------------------------------------*
	* TecnoCronus                                                                                          *
	*----------------------------------------- Current Version: -------------------------------------------*
	* 1.0												       *
	*----------------------------------------- Compatible With: -------------------------------------------*
	* rAthena											       *
	* eAthena		             								       *
	*------------------------------------------- Description: ---------------------------------------------*
	* A NPC that announce the 10th firsts persons who got the maximum level				       *
	*----------------------------------------- Additional Comments: ---------------------------------------*
	* It give a item as reward, the item ids of reward are keeped at $@Glob_Array_Item array	       *
	* The index of array will be get randomly.							       *
	*-------------------------------------------- Changelog -----------------------------------------------*
	*- https://xp-dev.com/trac/TC_Scripts/log/tecnocronus_scripts/scripts/EN/MaxLvLAnnouncer.txt	       *
	*------------------------------------------------------------------------------------------------------*/

-	script	MaxLvLAn	-1,{

	end;

	OnPCBaseLvUpEvent:

		if($numMaxLevel == 10)
			disablenpc "MaxLvLAn";
		else if (BaseLevel==.MaxLvl) {
				// Check if the player for some reason, reached to Maximum level again
				if(Rew > 0) end;

				// Keep the player name on array
				setarray $Rank$[$numMaxLevel], strcharinfo(0);

				announce strcharinfo(0)+", you are the "+.places$[$numMaxLevel]+" person to reach the level "+.MaxLvl+", you will receive a reward",0;

				//give prize
				set @Rnd_Item, rand(0,(getarraysize(.Global_Array_Item)-1));
				getitem .Global_Array_Item[@Rnd_Item],1;

				// set this variable, to don't take rewards again
				set Rew, 1;

				// Keep the last array index
				set $numMaxLevel,$numMaxLevel+1;

				if($numMaxLevel == 9) // Should be 9 now because the array index start in 0 (Thanks to ToastOfDoom)
					disablenpc "MaxLvLAn";
			}
		end;

	OnInit:
		// Set here the maximum level of your server
		set .MaxLvl,99;

		// Array with the item id rewards
		setarray .Global_Array_Item[0],671,675;

		//array lookup for place names
		setarray .places$[0], "First", "Second", "Third", "Fourth", "Fifth", "Sixth", "Seventh", "Eighth", "Ninth", "Tenth";

		if(!$numMaxLevel) set $numMaxLevel, 0;
}

ayothaya,158,163,6	script	MaxLvLRank	837,{

	mes "[Caizer]";
	mes "Hello, I'm Caizer, I'm the person";
	mes "Who have access to all the Rune Midgard Registries";
	mes "Are you interested in something ?";
	if(select("I want see the Top Level Ranking: No, Nothing.")==1) {
		mes "This rank shows the first 10 people who reached the";
		mes "Maximum Level.";
		next;
		mes "[Caizer]";

		if($Rank$ != "") {
			mes "No one reached the maximum level yet";
			close;
		}

		for(set @i, 0; @i < getarraysize( $Rank$ ); set @i, @i + 1) mes @i+"º"+$Rank$[@i]+".";
	} else {
		mes "Ok, no problems.";
	}

	close;
}

the thing is, even my character is level 99 "this is the first character created",

 

on the ranking i only see is "No one reached the maximum level yet". need help.

 

topic link: http://rathena.org/board/topic/81218-maximum-level-announcer/

 

thanks in advance

Edited by caizercafe

5 answers to this question

Recommended Posts

Posted (edited)

Well you know that is not 100% solved and if anybody reach the max lvl the npc will show you the rank anyway but i going to see how i can make it...


maybe it work

 

change this

  if($Rank$ != "") {
            mes "No one reached the maximum level yet";
            close;
        }

for that

query_sql "SELECT `base_level` FROM char WHERE `base_level` = `99`", .@acclvl;
        if (.@acclvl==.MaxLvl) {
            mes "No one reached the maximum level yet";
            close
        }

It only work if you run sql tables

Edited by Dynasty
Posted

delete this part 

        if($Rank$ != "") {
            mes "No one reached the maximum level yet";
            close;
        }

and plz tell me what happen

Posted

delete this part 

        if($Rank$ != "") {
            mes "No one reached the maximum level yet";
            close;
        }

and plz tell me what happen

 

It solved my problem! thanks!  /thx   /thx   /thx

 

anyway, is theres a way to solve this?  

 

it starts with number 0 not number 1

 

ex. 

 

[Caizer] // name of the npc

 

0 - ahura mazda

1 - centaur

2 - kultuog

3 - nabistak

Posted (edited)

emmm... change it for this xD

query_sql "SELECT `base_level` FROM char WHERE `base_level` = `99`", .@acclvl;
        if (.@acclvl <.MaxLvl) {
            mes "No one reached the maximum level yet";
            close
        }

-w-

Edited by Dynasty

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...