Scofield Posted March 25, 2013 Posted March 25, 2013 (edited) Hello I want a npc that makes the awards for the first players of each class, I am using this no longer be working. prontera,164,166,5 script FirstLevel 410,{ mes .n$; mes "Lista dos primeiros jogadores a conquistarem o level "+.nvm+"."; mes " "; for(set .i, 0; .i < getarraysize($class_fix);set .i,.i+1) mes (.i+1)+" - [^b00808"+$nmc$[.i]+"^000000] Classe: [^f80b0b"+jobname($class_fix[.i])+"^000000]"; close; end; OnPCBaseLvUpEvent: OnPCJobLvUpEvent: if(BaseLevel == .nvm && JobLevel == .jbm){ for(set .i, 0; .i < getarraysize($class_fix);set .i,.i+1){ if(Class == $class_fix[.i])end; } announce "Parabéns ao jogador ["+strcharinfo(0)+"] por se o primeiro ["+jobname(Class)+"] a antingir o level "+.nvm+".",bc_all; set $class_fix[getarraysize($class_fix)],Class; set $nmc$[getarraysize($class_fix)],strcharinfo(0); for(set .i, 0; .i < getarraysize(.ipm);set .i,.i+1) getitem .ipm[.i],.qpm[.i]; end; } end; OnInit: set .n$, "[^0b85f8First Level^000000]"; set .nvm, 99; // Level maximo do servidor. set .jbm, 70; // Level Job maximo do servidor. setarray .ipm[0], 32002,7828,7773,7829; // ID dos premios. setarray .qpm[0], 1, 150, 150, 150; // Quantidade de premios. end; } Edited March 25, 2013 by cumbe11 Quote
Capuche Posted March 26, 2013 Posted March 26, 2013 Hello I want a npc that makes the awards for the first players of each class The first player of each class (acolyte class, priest class, high novice... too) in the whole server gain a reward ? 1 Quote
Scofield Posted March 26, 2013 Author Posted March 26, 2013 (edited) I have not explained right, I want the first players from each class to reach the maximum level "99/70" to win a prize, studies using this npc above him not doing more to reward and neither shows the ranking of players prontera, 164,166,5 script FirstLevel 410, { months. $ n; mes "List of the first players to win the level" +. nvm + "."; months ""; for (set ï., 0,. i <getarraysize ($ class_fix); September i,. i +1) months (. i +1) + "- [^ b00808" nmc + $ $ [. i] + "^ 000000] Class: [^ f80b0b "+ jobname ($ class_fix [. i]) +" ^ 000000] "; close; end; OnPCBaseLvUpEvent: OnPCJobLvUpEvent: if (BaseLevel ==. == nvm && JobLevel. jbm) { for (set ï., 0,. i <getarraysize ($ class_fix); September i,. i +1) { if (Class == $ class_fix [. i]) end; } announce "Congratulations to the player [" + strcharinfo (0) + "] for the first [" + jobname (Class) + "] to the level antingir" +. nvm + "." bc_all; set $ class_fix [getarraysize ($ class_fix)] Class; set $ $ nmc [getarraysize ($ class_fix)], strcharinfo (0); for (set ï., 0,. i <getarraysize (. ipm); September i,. i +1) getitem. ipm [. i]. QPM [. i]; end; } end; OnInit: September n $, "[^ 0b85f8First Level ^ 000000]"; September nvm, 99 / / Level maximo server. September jbm, 70 / / Level Job maximo server. setarray. ipm [0], 32002,7828,7773,7829 / / ID of prizes. setarray. QPM [0], 1, 150, 150, 150, / / Number of prizes. end; } Edited March 26, 2013 by cumbe11 Quote
Capuche Posted March 27, 2013 Posted March 27, 2013 Each trans class (+ ninja +gun + sg + sl + supernovice ) who reach the max level and the max job get a reward and they are in the ranking. If that's what you want then test this : SQL part ALTER table `char` add column lvl_type int(8) unsigned NOT NULL default '0' after `rename`, add index (lvl_type); prontera,164,166,5 script FirstLevel 410,{ mes .npc_name$; mes "Lista dos primeiros jogadores a conquistarem o level "+ .max_level +"."; mes " "; next; .@s = select( .menu$ ) -1; .@count = query_sql( "SELECT `name` FROM `char` WHERE `class` = "+ .index[.@s] +" AND `lvl_type` != 0 ORDER BY `lvl_type` ASC LIMIT 20", .@name$ ); if( !.@count ) { mes .npc_name$; mes "There are nothing to display."; close; } for( .@j = 0; .@j < .@count; .@j++ ) mes (.@j +1) +" - [^b00808"+ .@name$[.@j]+"^000000] Class: [^f80b0b"+ .job_index$[.@s] +"^000000]"; close; OnPCBaseLvUpEvent: OnPCJobLvUpEvent: if( BaseLevel == .max_level && JobLevel == .max_job_level ) { while( .@i < .size_class && Class != .class_[.@i] ) set .@i, .@i +1; if( .@i == .size_class ) end; query_sql "SELECT `lvl_type` FROM `char` WHERE `class` = "+ Class +" ORDER BY `lvl_type` DESC LIMIT 1", .@type; query_sql "UPDATE `char` SET `lvl_type` = ("+ .@type +" +1) WHERE `char_id` = '"+ getcharid(0) +"'"; announce "Parabéns ao jogador ["+ strcharinfo(0) +"] por se o primeiro ["+ jobname(Class) +"] a antingir o level "+ .max_level +".",bc_all; for( set .@i, 0; .@i < .size_item; set .@i, .@i +1 ) getitem .item_ID[.@i], .item_num[.@i]; } end; OnInit: set .npc_name$, "[^0b85f8First Level^000000]"; set .max_level, 99; // Level maximo do servidor. set .max_job_level, 70; // Level Job maximo do servidor. setarray .item_ID[0], 32002,7828,7773,7829; // ID setarray .item_num[0], 1, 150, 150, 150; // Quantidade setarray .class_, 23, 24, 25, 4008,4009,4010,4011,4012,4013,4015,4016,4017,4018,4019,4020,4021,4046,4047,4049; setarray .@al$, "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"; set .size_class, getarraysize( .class_ ); set .size_item, getarraysize( .item_ID ); freeloop(1); for( .@j = 0; .@j < 26; .@j++ ) { for( .@i = 0; .@i < .size_class; .@i++ ) if( strtolower( charat( jobname( .class_[.@i] ),0 ) ) == .@al$[.@j] ) { .index[ .@size_index ] = .class_[.@i]; .job_index$[ .@size_index ] = jobname( .class_[.@i] ); .@size_index++; } } freeloop(0); .menu$ = implode( .job_index$, ":" ); end; } 1 Quote
Scofield Posted March 27, 2013 Author Posted March 27, 2013 This script will reward only the first of each class to achieve the maximum level 99/70? Quote
Capuche Posted March 27, 2013 Posted March 27, 2013 No this script will give a reward to all class that reached the max level 99/70 and put a top 20 ranking for each class that reached theses conditions (top 20 LK, top 20 HP...) But.. you only want to give a reward for the first of each class to achieve the maximum level 99/70 ? 1 Quote
Scofield Posted March 27, 2013 Author Posted March 27, 2013 This is only the first of each class that reaches the maximum level. Quote
Scofield Posted March 27, 2013 Author Posted March 27, 2013 (edited) Capuche I've been testing and found that this script is working perfectly, he just has a problem in that part of raking, he is not showing the player's name rightraking in the class and shows the player's name, but the name of the row player to be popping up on the bottom lineEX; 1 [] Class [Sniper] <---- his name goes down Pepico2 [Pepico] Class [Lord Kingnith] <--- His name Striker3 [Striker] Class [Champ] prontera,164,166,5 script FirstLevel 410,{ mes .n$; mes "Lista dos primeiros jogadores a conquistarem o level "+.nvm+"."; mes " "; for(set .i, 0; .i < getarraysize($class_fix);set .i,.i+1) mes (.i+1)+" - [^b00808"+$nmc$[.i]+"^000000] Classe: [^f80b0b"+jobname($class_fix[.i])+"^000000]"; close; end; OnPCBaseLvUpEvent: OnPCJobLvUpEvent: if(BaseLevel == .nvm && JobLevel == .jbm){ for(set .i, 0; .i < getarraysize($class_fix);set .i,.i+1){ if(Class == $class_fix[.i])end; } announce "Parabéns ao jogador ["+strcharinfo(0)+"] por se o primeiro ["+jobname(Class)+"] a antingir o level "+.nvm+".",bc_all; set $class_fix[getarraysize($class_fix)],Class; set $nmc$[getarraysize($class_fix)],strcharinfo(0); for(set .i, 0; .i < getarraysize(.ipm);set .i,.i+1) getitem .ipm[.i],.qpm[.i]; end; } end; OnInit: set .n$, "[^0b85f8First Level^000000]"; set .nvm, 99; // Level maximo do servidor. set .jbm, 70; // Level Job maximo do servidor. setarray .ipm[0], 32002,7828,7773,7829; // ID dos premios. setarray .qpm[0], 1, 150, 150, 150; // Quantidade de premios. end; } Edited March 27, 2013 by cumbe11 Quote
Capuche Posted March 28, 2013 Posted March 28, 2013 prontera,164,166,5 script FirstLevel 410,{ mes .n$; mes "Lista dos primeiros jogadores a conquistarem o level "+.nvm+"."; mes " "; for( set .@i, 0; .@i < getarraysize($class_fix); set .@i,.@i+1) mes (.@i+1)+" - [^b00808"+ $nmc$[.@i] +"^000000] Classe: [^f80b0b"+ jobname($class_fix[.@i]) +"^000000]"; close; OnPCBaseLvUpEvent: OnPCJobLvUpEvent: if(BaseLevel == .nvm && JobLevel == .jbm){ for( set .@i, 0; .@i < getarraysize($class_fix); set .@i,.@i+1 ) if(Class == $class_fix[.@i]) end; announce "Parabéns ao jogador ["+strcharinfo(0)+"] por se o primeiro ["+jobname(Class)+"] a antingir o level "+.nvm+".",bc_all; set .@size, getarraysize($class_fix); set $class_fix[ .@size ],Class; set $nmc$[ .@size ], strcharinfo(0); for(set .@i, 0; .@i < getarraysize(.ipm);set .@i,.@i+1) getitem .ipm[.@i],.qpm[.@i]; } end; OnInit: set .n$, "[^0b85f8First Level^000000]"; set .nvm, 99; // Level maximo do servidor. set .jbm, 70; // Level Job maximo do servidor. setarray .ipm[0], 32002,7828,7773,7829; // ID dos premios. setarray .qpm[0], 1, 150, 150, 150; // Quantidade de premios. end; } Quote
Scofield Posted March 28, 2013 Author Posted March 28, 2013 (edited) still be the same. http://imageshack.us/photo/my-images/812/screenimperialro007.jpg/ Edited March 28, 2013 by cumbe11 Quote
Capuche Posted March 28, 2013 Posted March 28, 2013 I tested with a reset of the variable x.x prontera,164,166,5 script FirstLevel 410,{ mes .n$; mes "Lista dos primeiros jogadores a conquistarem o level "+.nvm+"."; mes " "; for( set .@i, 0; .@i < getarraysize($class_fix); set .@i,.@i+1) mes (.@i+1)+" - [^b00808"+ $nmc$[.@i +1] +"^000000] Classe: [^f80b0b"+ jobname($class_fix[.@i]) +"^000000]"; close; OnPCBaseLvUpEvent: OnPCJobLvUpEvent: if(BaseLevel == .nvm && JobLevel == .jbm){ for( set .@i, 0; .@i < getarraysize($class_fix); set .@i,.@i+1 ) if(Class == $class_fix[.@i]) end; announce "Parabéns ao jogador ["+strcharinfo(0)+"] por se o primeiro ["+jobname(Class)+"] a antingir o level "+.nvm+".",bc_all; set $class_fix[ getarraysize($class_fix) ],Class; set $nmc$[ getarraysize($class_fix) ], strcharinfo(0); for(set .@i, 0; .@i < getarraysize(.ipm);set .@i,.@i+1) getitem .ipm[.@i],.qpm[.@i]; } end; OnInit: set .n$, "[^0b85f8First Level^000000]"; set .nvm, 99; // Level maximo do servidor. set .jbm, 70; // Level Job maximo do servidor. setarray .ipm[0], 32002,7828,7773,7829; // ID dos premios. setarray .qpm[0], 1, 150, 150, 150; // Quantidade de premios. end; } 1 Quote
Scofield Posted March 28, 2013 Author Posted March 28, 2013 It worked, Capuche you're the best, thank you Quote
Question
Scofield
Hello I want a npc that makes the awards for the first players of each class, I am using this no longer be working.
Edited by cumbe11
11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.