Nokia Posted January 24, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 150 Reputation: 5 Joined: 12/28/11 Last Seen: May 10, 2013 Share Posted January 24, 2012 Hi there, i want to make a "guild reward" npc, the npc should warp all members in a lvl 50 guild to a map. like this: mes hi bla if guild lvl is not 50 mes you cant use this service close else warp bla end but i cant find any script function in eathena to check the guild lvl via scripts, or i missed something? Quote Link to comment Share on other sites More sharing options...
Z3R0 Posted January 24, 2012 Group: Members Topic Count: 39 Topics Per Day: 0.01 Content Count: 618 Reputation: 201 Joined: 11/09/11 Last Seen: June 14, 2024 Share Posted January 24, 2012 I don't believe you can actually check guild level via a script command (single command) you can get the name of the guild, if they are in one, and then read the SQL DB for the level value Quote Link to comment Share on other sites More sharing options...
Aleos Posted January 24, 2012 Group: Development Manager Topic Count: 56 Topics Per Day: 0.01 Content Count: 732 Reputation: 525 Joined: 12/13/11 Last Seen: June 13, 2024 Share Posted January 24, 2012 As Z3R0 said, there is no actual scripting command to get the level of a guild, but this is a simple NPC to get it without having to make an actual command. prontera,150,150,3 script Guild Level 100,{ set .@guild_id,strcharinfo(2); if ( !.@guild_id ) { mes "You aren't in a guild!"; close; } query_sql "SELECT `guild_lv` FROM `guild` WHERE `guild_id` = '"+ .@guild_id +"'",.@guild_lv; mes "Your guild level is "+ .@guild_lv +"!"; close; } Quote Link to comment Share on other sites More sharing options...
Nokia Posted January 24, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 150 Reputation: 5 Joined: 12/28/11 Last Seen: May 10, 2013 Author Share Posted January 24, 2012 hmm, the sql part isent working for me, the npc always says im not in a guild and if i cut the script into this: prontera,150,150,3 script Guild Level 100,{ query_sql "SELECT `guild_lv` FROM `guild` WHERE `guild_id` = '"+ .@guild_id +"'",.@guild_lv; mes "Your guild level is "+ .@guild_lv +"!"; close; } then the npc always says your guild lvl is 0, but its not. Quote Link to comment Share on other sites More sharing options...
Brian Posted January 24, 2012 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted January 24, 2012 (edited) prontera,155,188,0 script GuildLevel50 910,{ query_sql "SELECT guild_lv FROM guild WHERE guild_id = "+getcharid(2), .@guild_lv; mes "hi bla"; if (getcharid(2) == 0) { mes "You are not in a guild."; } else if (.@guild_lv < 50) { mes "you cant use this service"; mes "Your guild must be level 50."; } else { warp "bla",0,0; } close; } @Nokia: your example isn't working because .@guild_id isn't set, so it's 0. Then your 'query_sql' looks up the guild_lv for guild_id 0 (which doesn't exist). Try the full script Aleos posted, or the example I posted above. Edited January 24, 2012 by Brian Quote Link to comment Share on other sites More sharing options...
Nokia Posted January 24, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 150 Reputation: 5 Joined: 12/28/11 Last Seen: May 10, 2013 Author Share Posted January 24, 2012 ah thanks, but now the npc always says my guild is not lvl 50, but my guild is lvl 50 :/ Quote Link to comment Share on other sites More sharing options...
Brian Posted January 24, 2012 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted January 24, 2012 Did you recently level up to 50? since we are querying SQL, there is a slight delay. The map-server saves guild info every 60 seconds (or whatever you have autosave_time set to). Quote Link to comment Share on other sites More sharing options...
Nokia Posted January 24, 2012 Group: Members Topic Count: 43 Topics Per Day: 0.01 Content Count: 150 Reputation: 5 Joined: 12/28/11 Last Seen: May 10, 2013 Author Share Posted January 24, 2012 ah i see, i changed my glvl with @glvl, it works if i wait 60 seconds, thanks Quote Link to comment Share on other sites More sharing options...
REKT Posted January 25, 2012 Group: Members Topic Count: 24 Topics Per Day: 0.00 Content Count: 206 Reputation: 11 Joined: 12/06/11 Last Seen: September 13, 2024 Share Posted January 25, 2012 Hello, Brian how about this? I wanted to 'check guild' name and 'no guild' also. prontera,155,188,0 script Check Guild 910,{ query_sql "SELECT guild FROM guild WHERE guild_id = "+getcharid(2), .@guild; mes "hi bla"; if (getcharid(2) == 0) { mes "Guilde: None Guild"; } // Other else { mes "Guild:"; warp "bla",0,0; } close; } Thank you :3 Quote Link to comment Share on other sites More sharing options...
Brian Posted January 26, 2012 Group: Members Topic Count: 75 Topics Per Day: 0.02 Content Count: 2223 Reputation: 593 Joined: 10/26/11 Last Seen: June 2, 2018 Share Posted January 26, 2012 For guild name, there is a script command: getguildname mes "Guild name:"; mes getguildname(getcharid(2)); Quote Link to comment Share on other sites More sharing options...
Question
Nokia
Hi there, i want to make a "guild reward" npc, the npc should warp all members in a lvl 50 guild to a map. like this:
mes hi bla
if guild lvl is not 50
mes you cant use this service
close
else
warp bla
end
but i cant find any script function in eathena to check the guild lvl via scripts, or i missed something?
Link to comment
Share on other sites
9 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.