Jump to content
  • 0
Sign in to follow this  
Alexandria

Help to update this npc

Question

Hello guys,

 

I moved to Hercules emulator system; I have issue with this npc which was perfectly working in rAthena.

 

As long as I know, Hercules doesnt have this table "global_reg_value" anymore and it was splitted in 6 tables now.

 

http://pastebin.com/ACBTKCpN

 

Your help is very appreciated, thank you.

Edited by Alexandria

Share this post


Link to post
Share on other sites

5 answers to this question

Recommended Posts

  • 0

LOL you mixed up both

 

sql query, this one added the index

alter table `char` add empbreak smallint(6) unsigned not null default 0 after unban_time, add index (empbreak);
.

.

npc/guild/agit_main.txt

query_sql "UPDATE `char` SET empbreak = empbreak+1 WHERE char_id = " + getcharid(0);
which is already correct

.

.

////============================//// Emp Breaking Ladder////============================prontera,155,183,4	script	Emperium Ranking	722,{	.@nb = query_sql( "select name, empbreak from `char` where empbreak > 0 order by empbreak desc limit 10", .@name$, .@empbreak );	mes "^FF0000[ Emperium Ranking ]^000000";	for ( .@i = 0; .@i < .@nb; .@i++ )		mes "^0000FF"+ ( .@i +1 ) +".^000000 " + .@name$[.@i] +" - ^FF0000"+ .@empbreak[.@i] +"^000000 Break(s)";	mes " ";	query_sql "select empbreak from `char` where char_id = "+ getcharid(0), .@empbreak;	mes "^0000FF["+ strcharinfo(0) +"'s]^000000 Emperium Break's is ^FF0000" + .@empbreak + "^000000 Break(s)";	close;OnInit://	waitingroom "Emperium's Ranking",0;   // Look on the configuration!	end;}
use this script

Share this post


Link to post
Share on other sites
  • 0

maybe you can use this :)

open database and open table char and added empbreaker colums using this

ALTER TABLE `char` ADD `empbreak` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0' AFTER `fame`;

open npc/guild/agit_main.txt and add this script above // Adjust Economy Invest Level for Castle

query_sql "UPDATE `char` SET empbreak = empbreak+1 WHERE char_id = " + getcharid(0);

and then you must edit your script like this

////============================//// Emp Breaking Ladder////============================sec_in01,88,175,4       script  Emperium Ranking        722,{query_sql "SELECT`char`.`char_id`,`char`.`name`, `char`.`empbreak` FROMchar ORDER BY `char`.`empbreak` DESC LIMIT 10", .@char_id,.@name$, .@count;        mes "^FF0000[ Emperium Ranking ]^000000";        for( set .@x,0; .@x<=9; set .@x,.@x+1 ) {        mes "^0000FF"+(.@x+1)+".^000000 " +((.@name$[.@x] == "")? "None":.@name$[.@x] )+ " -^FF0000"+.@count[.@x]+"^000000 Break(s)";}        mes " ";        mes "^0000FF["+strcharinfo(0)+"'s]^000000 Emperium Break's is ^FF0000" + empbreak + "^000000 Break(s)";        close;OnInit://      waitingroom "Emperium's Ranking",0;   // Look on the configuration!        end;}

please dont use copy and paste with the script notice about using tab on

sec_in01,88,175,4       script  Emperium Ranking        722,{

usually you can get error their If you forget to use the tab :D

 

nb : sorry for my query dont work i forget . hhee


 
Edited by nostafuz

Share this post


Link to post
Share on other sites
  • 0

////============================//// Emp Breaking Ladder////============================prontera,155,183,4	script	Emperium Ranking	722,{	.@nb = query_sql( "select char_id as aaa, ( select name from `char` where char_id = aaa ), value from char_reg_num_db where `key` = 'brokeemp' and value > 0 order by value desc limit 10", .@cid, .@name$, .@value );	mes "^FF0000[ Emperium Ranking ]^000000";	for ( .@i = 0; .@i < .@nb; .@i++ )		mes "^0000FF"+ ( .@i +1 ) +".^000000 " + .@name$[.@i] +" - ^FF0000"+ .@value[.@i] +"^000000 Break(s)";	mes " ";	mes "^0000FF["+ strcharinfo(0) +"'s]^000000 Emperium Break's is ^FF0000" + brokeemp + "^000000 Break(s)";	close;OnInit://	waitingroom "Emperium's Ranking",0;   // Look on the configuration!	end;}
should be like this

 

though I also recommend the way like @nostafuz proposed

alter the `char` table and indexed the column so it won't search over the whole table ..

Share this post


Link to post
Share on other sites
  • 0

At first, thank you very much for your help. It is very appreciated.

 

It didnt work. the EMP breaking times aren't recorded when it is broken.

 

I have done this:

 

First, I have queried this in my db:

 

ALTER TABLE `char` ADD `empbreak` SMALLINT(6) UNSIGNED NOT NULL DEFAULT '0' AFTER `fame`;

Second, I have added this line:

 

query_sql "UPDATE `char` SET empbreak = empbreak+1 WHERE char_id = " + getcharid(0);

in my npc/guild/agit_main.txt and it looks like this now:

 

// The Emperium has been broken.OnAgitBreak:	set .@GID,getcharid(2);	// Show and log error if an unguilded player breaks the Emperium. (Should NEVER happen)	if (.@GID <= 0) {		set .@notice$,"Character "+strcharinfo(0)+" ("+getcharid(0)+") broke the Emperium in Castle: "+strnpcinfo(2)+" while guildless. No data will be saved and Emperium respawned."; 		logmes .@notice$; debugmes .@notice$;		donpcevent "Agit#"+strnpcinfo(2)+"::OnStartArena";		end;	}	query_sql "UPDATE `char` SET empbreak = empbreak+1 WHERE char_id = " + getcharid(0);	// Adjust Economy Invest Level for Castle	set .@Economy,getcastledata(strnpcinfo(2),2) - 5;

 

and im using AnnieRuru's script:

 

////============================//// Emp Breaking Ladder////============================prontera,155,183,4	script	Emperium Ranking	722,{	.@nb = query_sql( "select char_id as aaa, ( select name from `char` where char_id = aaa ), value from char_reg_num_db where `key` = 'brokeemp' and value > 0 order by value desc limit 10", .@cid, .@name$, .@value );	mes "^FF0000[ Emperium Ranking ]^000000";	for ( .@i = 0; .@i < .@nb; .@i++ )		mes "^0000FF"+ ( .@i +1 ) +".^000000 " + .@name$[.@i] +" - ^FF0000"+ .@value[.@i] +"^000000 Break(s)";	mes " ";	mes "^0000FF["+ strcharinfo(0) +"'s]^000000 Emperium Break's is ^FF0000" + brokeemp + "^000000 Break(s)";	close;OnInit://	waitingroom "Emperium's Ranking",0;   // Look on the configuration!	end;}

 

Please, any help? thanks a lot

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.