HAHAHAHAHAHA !!!
ok you must have learn from my scripts, but strnpcinfo(NPC_NAME_HIDDEN)is HERCULES only constant
in rathena, because NPC_NAME_HIDDEN isn't declare as constant number 2, it becomes 0, means strnpcinfo(0) = the full name of the npc
//== AGIT Manager ==========================================
prtg_cas01,197,197,0 duplicate(Gld_Agit_Manager) Agit#prtg_cas01 FAKE_NPC
change strnpcinfo(NPC_NAME_HIDDEN) into strnpcinfo(2), because you are using rathena, not hercules
ok some more pointing
query_sql "SELECT `castle_name` FROM `agit_defend_stats`",.@castle_ranks$;
if( !getarraysize(.@castle_ranks$) ){
just do
query_sql "SELECT COUNT(1) FROM `agit_defend_stats`, .@count;
if (!.@count)
if I remember correctly, our query_sql doesn't have a row limit on how much it can fetch ...
so if this having a large table, executing this line can cause server to lag
SELECT `defend_time`,`guild_id`,`woe_ended` FROM `agit_defend_stats` WHERE `castle_name`='" + .@castleName$ + "' ORDER BY `defend_time` DESC LIMIT 10
index the `castle_name` and `defend_time` column