Jump to content
  • 0
Sign in to follow this  
WhiteEagle

Guild Quests

Question

It's possible to make quests countable for the whole Guild? 
Excample: Someone start a Guild quest (Kill 100 Mantis), all Guild mates can kill them too (without being in a Party)

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Yes it is possible. You need to either use a custom SQL table combined with getcharid(CHAR_ID_GUILD) or use the '$' global permanent variable.

Example of using '$' variable:

if ($Guild_Quest[getcharid(CHAR_ID_GUILD)] != 0) {
    mes("Your guild has already done this quest.");
    close();
}

$Guild_Quest[getcharid(CHAR_ID_GUILD)] = 1;
mes("You completed the quest for your guild.");
close();

Example of SQL query:

if (query_sql(sprintf("SELECT * FROM `guild_quest` WHERE `guild_id` = %d",  getcharid(CHAR_ID_GUILD))) > 0) {
    mes("Your guild has already done this quest.");
    close();
}

query_sql(sprintf("INSERT INTO `guild_quest`(`guild_id`, `value`, `comment`) VALUES(%d, 1, 'Guild quest 1')", getcharid(CHAR_ID_GUILD)));
mes("You completed the quest for your guild.");
close();
Edited by bWolfie

Share this post


Link to post
Share on other sites
  • 1

what bWolfie meant is that instead of using a character variable to do the quest, you can use a global variable and write it as if it was any quest you ever made. Ex:
 

.GuildID = getcharid( CHAR_ID_GUILD );
  if $MyGuildQuestStep[.GuildID] == 0{
  	mes "Do you want to start this quest?";
  	if(select("YES:NO")==2){
  		close;
  	}
  	mes "You started this quest";
  	$MyGuildQuestStep[.GuildID] = 1;
	close;
  }

since that is a global variable and you want to make a hunting quest, make this variable increase for every kill until it reaches the amount you want.

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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