Jump to content
  • 0

Error on adding a condition statement at OnAgitBreak


Poring King

Question


  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

I got this error 

image.png.2d635aaf23287c2b27b7d9eebaf2c002.png




I just add this 2 on OnagitBreak & OnAgitEnd

//OnAgitBreak:
//	query_sql "SELECT `auto_id` FROM `agit_defend_stats` WHERE `castle_name`='" + getcastlename(strnpcinfo(NPC_NAME_HIDDEN)) + "' AND `woe_ended`='0' ORDER BY `auto_id` DESC LIMIT 1",.@last_conquest;
//	if( getarraysize(.@last_conquest) ){
//		query_sql "UPDATE `agit_defend_stats` SET `lost_time`=NOW() WHERE `auto_id`='" + .@last_conquest + "'";
//		query_sql "SELECT `conquest_time` FROM `agit_defend_stats` WHERE `auto_id`='" + .@last_conquest + "'", .@conquest_time$;
//		query_sql "UPDATE `agit_defend_stats` SET `defend_time`=TIMEDIFF(NOW(),'" + .@conquest_time$ + "') WHERE `auto_id`='" + .@last_conquest + "'";
//	}
//	query_sql "INSERT INTO `agit_defend_stats` (castle_name, guild_id, conquest_time,woe_ended) VALUES ('" + getcastlename(strnpcinfo(NPC_NAME_HIDDEN)) + "', '" + .@GID + "', NOW(),'0')";
//
//
//OnAgitEnd:
//	query_sql "SELECT `auto_id` FROM `agit_defend_stats` WHERE `castle_name`='" + getcastlename(strnpcinfo(NPC_NAME_HIDDEN)) + "' AND `woe_ended`='0' ORDER BY `auto_id` DESC LIMIT 1",.@last_conquest;
//	if( getarraysize(.@last_conquest) ){
//		query_sql "SELECT `conquest_time` FROM `agit_defend_stats` WHERE `auto_id`='" + .@last_conquest + "'", .@conquest_time$;
//		query_sql "UPDATE `agit_defend_stats` SET `defend_time`=TIMEDIFF(NOW(),'" + .@conquest_time$ + "') WHERE `auto_id`='" + .@last_conquest + "'";
//		query_sql "UPDATE `agit_defend_stats` SET `woe_ended`='1' WHERE `auto_id`='" + .@last_conquest + "'";
//	}

/*




This is my first time encounter this kind of error so i got 0 idea how to check and how to solve . I don't know how to solve "guild_mapname2gc" error
 

Edited by Poring King
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

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

Edited by AnnieRuru
  • MVP 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

18 minutes ago, AnnieRuru said:

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

I never use Hercules and this is my first hercules sneak peak npc ^_^ . Well let say that this is rAthena script i should notice the strnpcinfo(NPC_NAME_HIDDEN) because there is no NPC_NAME_HIDDEN in strnpcinfo ?? Well its a stupid that i didn't see it i think i should sleep now lol 12am
 

Edited by Poring King
Link to comment
Share on other sites

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.

×
×
  • Create New...