Guild Quests

WhiteEagle

New member
Messages
52
Points
0
Emulator
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)

 
I like the idea! looking forward someone could make for this or as a base.

 
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:

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

Code:
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();
 
Last edited by a moderator:
@bWolfie,
thanks for your solution, but the problem is, how are the kills counted by all the members?

 
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.

 
Back
Top