Max Level Announcer problem

Hadeszeus

New member
Messages
651
Points
0
Location
Philippines
/* ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ / / / /__ / / / / /__ /__ / : /:: /:: /:| _|_ /:: /:: /:: /:: /:| _|_ /:/ _/_ /:: /::__ /:::__ /:/:__ /::|/__ /:/:__ /:/:__ /:::__ /:/:__ /::|/__ /:/_/__ /::__ /://__/ ::/ / : /__/ /|::/ / :/:/ / : /__/ ;:::/ / :/:/ / /|::/ / :/:/ / ::/__/ /__/ :/ / :__ |:/ / ::/ / :__ |:/__/ ::/ / |:/ / ::/ / ::/ / /__/ /__/ /__/ /__/ /__/ |__| /__/ /__/ /__/ /__/ *----------------------------------------- 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 == 20) 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],15; // set this variable, to don't take rewards again set Rew, 1; // Keep the last array index set $numMaxLevel,$numMaxLevel+1; if($numMaxLevel == 19) // 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, 175; // Array with the item id rewards setarray .Global_Array_Item[0],30500; //array lookup for place names setarray .places$[0], "First", "Second", "Third", "Fourth", "Fifth", "Sixth", "Seventh", "Eighth", "Ninth", "Tenth","Eleven","Twelfth","Thirteenth","Forthteenth","Fifteenth","Sixteenth","Seventeenth","Eighteenth","Nineteenth","Twentieth"; if(!$numMaxLevel) set $numMaxLevel, 0;}prontera,146,165,6 script MaxLvLRank 718,{ mes "[Constantin]"; mes "Hello, I'm Constantin, 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 "[Constantin]"; 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;}

Can you help me change the reward items  based on ranking instead of giving random items and also the amount should be base on ranking also. Please anyone.. I really need this

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

 
Replace:
 

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

Code:
//give prize				set @reward,512; //reward				set @amount,1;//amount 				getitem @reward,@amount;
 
Last edited by a moderator:
Replace:

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

//give prize set @reward,512; //reward set @amount,1;//amount  getitem @reward,@amount;
Why setting unnecessary variables, why not directly getitem 512, 2;

 
What I need is different item and amount per place.

1. First Place - 501,1;

2. Second Place - 502,2;

3 Third Place - 503,3

so and so forth.

help pls.

 
Something like this?

/* ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ / / / /__ / / / / /__ /__ / : /:: /:: /:| _|_ /:: /:: /:: /:: /:| _|_ /:/ _/_ /:: /::__ /:::__ /:/:__ /::|/__ /:/:__ /:/:__ /:::__ /:/:__ /::|/__ /:/_/__ /::__ /://__/ ::/ / : /__/ /|::/ / :/:/ / : /__/ ;:::/ / :/:/ / /|::/ / :/:/ / ::/__/ /__/ :/ / :__ |:/ / ::/ / :__ |:/__/ ::/ / |:/ / ::/ / ::/ / /__/ /__/ /__/ /__/ /__/ |__| /__/ /__/ /__/ /__/ *----------------------------------------- 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 == 20) 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 if (getd(".PrizeRank_"+$numMaxLevel)<=0){ for (.@i=0; .@i<getarraysize(.PrizeNoRank); .@i++){ getitem .PrizeNoRank[.@i],.PrizeNoRankQ[.@i]; } }else{ for (.@i=0; .@i<getarraysize(getd(".PrizeRank_"+$numMaxLevel)); .@i++){ getitem getd(".PrizeRank_"+$numMaxLevel+"["+.@i+"]"),getd(".PrizeRankQ_"+$numMaxLevel+"["+.@i+"]"); } } // set this variable, to don't take rewards again set Rew, 1; // Keep the last array index set $numMaxLevel,$numMaxLevel+1; if($numMaxLevel == 19) // 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, 175; // Array with the item id rewards setarray .PrizeRank_1[0],7227,501; //Rank 1 Prize setarray .PrizeRankQ_1[0],3,4; setarray .PrizeRank_2[0],7227; //Rank 2 Prize setarray .PrizeRankQ_2[0],2; setarray .PrizeNoRank[0],501; //Give this when player is not from rank. setarray .PrizeNoRankQ[0],3; //array lookup for place names setarray .places$[0], "First", "Second", "Third", "Fourth", "Fifth", "Sixth", "Seventh", "Eighth", "Ninth", "Tenth","Eleven","Twelfth","Thirteenth","Forthteenth","Fifteenth","Sixteenth","Seventeenth","Eighteenth","Nineteenth","Twentieth"; if(!$numMaxLevel) set $numMaxLevel, 0;}prontera,146,165,6 script MaxLvLRank 718,{ mes "[Constantin]"; mes "Hello, I'm Constantin, 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 "[Constantin]"; 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;}
Check OnInit part to know how prize system will work.

 
Back
Top