Jump to content
  • 0

Guild Level Check


Question

Posted

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?

9 answers to this question

Recommended Posts

Posted

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 :P

Posted

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;
}

Posted

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.

Posted (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 by Brian
Posted

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

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...