Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 03-05-2012, 02:08 PM
Nall
Sarnak
 
Join Date: Aug 2008
Location: The ice cave with vox
Posts: 31
Arrow Quest::CreateGuild(guild_name, leader); - Question!

Good Afternoon Gentlemen,

Pretty simple question, tough answer?

In Referance too,
"quest::CreateGuild(guild_name, leader); "

i've read the following thread:
http://www.eqemulator.org/forums/sho...guild+creation


"How does the player specify the guild name for a quest creation"?



I understand it grabs leaders name from the person turning in the quest. and the variable it uses is "guild_name" but how do i fill that variable as a player? Can the player type it into a parchment? Say it out loud at a certain point?

Goal: Im attempting to make a quest to automate guild creation, so that no GM intervention is required. AKA.. Turn in Item "A" and "B" and your guild is created.


EXAMPLE:

Quote:

my $first_item = 0;
my $second_item = 0;

sub EVENT_SAY {
if ($text=~/hail/i) {
quest::say("Hello there, I'm XYZ the Headmaster for Guild Creation. are you intrested in creating a guild?")
}
if ($text=~/guild/i) {
quest::say("I'd like to help you create a guild, however im going to need a few items to make this happen, bring me the feather of the Mighty Griffon Grimfeather from North Karana and Paw of Fippy Darkpaw from Qeynos ");
}
if ($text=~/flags/i) {
quest::say("$first_item $second_item");
}
}

sub EVENT_ITEM {
if ($itemcount{19113} > 0) {
$first_item = $first_item + $itemcount{19113};
}
if ($itemcount{16498} > 0) {
$second_item = $second_item + $itemcount{16498};
}


if (($first_item >= 1) && ($second_item >= 1))
{
$first_item = 0;
$second_item = 0;
quest::emote("cheers enthusiastically .");
quest::CreateGuild(guild_name, leader);
quest::ding();
}

}
Missing just a little something to connect the dots
Reply With Quote
  #2  
Old 03-06-2012, 02:19 PM
Nall
Sarnak
 
Join Date: Aug 2008
Location: The ice cave with vox
Posts: 31
Default

basically as a NON-GM how would a user specify the guild name for a quest creation?
Reply With Quote
  #3  
Old 03-06-2012, 02:38 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

I've got an idea for you, but I'd have to test it out first. Maybe I'll have a chance when I get home tonight. It would basically use the text from the client following the turn-in and specific dialogue.
Reply With Quote
  #4  
Old 03-06-2012, 02:42 PM
Nall
Sarnak
 
Join Date: Aug 2008
Location: The ice cave with vox
Posts: 31
Default

excellent, let me know
Reply With Quote
  #5  
Old 03-06-2012, 08:31 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

I was thinking something like this (untested):

Code:
my $GuildName = '';
my $GuildLeader = '';

sub EVENT_TIMER {
  quest::stoptimer("cooldown");
  quest::say("$GuildLeader, just come back when you think of a good [name] for your guild.");
  $GuildName = '';
  $GuildLeader = '';
}

sub EVENT_SAY {
  if (defined($qglobals{newguild}) && ($qglobals{newguild} == 1)) {
    if (($GuildLeader eq '') || ($GuildLeader eq $name)) {
      if ($text =~ /name/i) {
        quest::say("Ok, $name. What is the name of the guild you would like to create?");
        $GuildLeader = $name;
        quest::settimer("cooldown", 60);
      }
      elsif (($text =~ /^yes$/i) && ($GuildLeader eq $name)) {
        quest::say("Ok, $name. Your guild will be called $GuildName. Congratulations!");
        quest::CreateGuild(guild_name, leader);
        quest::ding();
        quest::delglobal("newguild");
        quest::stoptimer("cooldown");
        $GuildName = '';
        $GuildLeader = '';
      }
      elsif (($text =~ /^no$/i) && ($GuildLeader eq $name)) {
        quest::say("Ok, $name. Your guild will not be called $GuildName. Just let me know when you come up with a good [name] for your guild.");
        $GuildName = '';
        $GuildLeader = '';
      }
      else {
        $GuildName = $text;
        quest::say("Ok, $name. You want your guild to be called $GuildName? You must tell me 'yes' or 'no' to continue.");
      }
    }
    else {
      quest::say("Sorry, $name. Let me finish with $GuildLeader first.");
    }
  }
  else {
    if ($text =~ /hail/i) {
      quest::say("Hello there, I'm XYZ the Headmaster for Guild Creation. Are you intrested in creating a [guild]?");
    }
    elsif ($text =~ /guild/i) {
      quest::say("I'd like to help you create a guild, however I'm going to need a few items to make this happen. Bring me the feather of the Mighty Griffon Grimfeather from North Karana and Paw of Fippy Darkpaw from Qeynos.");
    }
  }
}

sub EVENT_ITEM {
  if (plugin::check_handin(\%itemcount, 19113 => 1, 16498 => 1)) {
    quest::emote("cheers enthusiastically.");
    quest::say("Excellent work, $name. I can now help you to create a guild. Let me know when you would like to [name] your guild.");
    quest::setglobal("newguild", 0, 1, "F");
  }
  else {
    quest::say("I do not need this.");
    plugin::return_items(\%itemcount);
  }
}
Reply With Quote
  #6  
Old 03-07-2012, 02:57 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

That looks pretty good. There is at least 1 thing that needs to be corrected in that script and it is the line that actually creates the guild:

Code:
quest::CreateGuild(guild_name, leader);
I think if you change that line to the following, it should correct at least that one issue:

Code:
quest::CreateGuild($GuildName , $GuildLeader);
It looks like the quest command is coded to return a value for that command so you know if the guild was created or not. If that was true, then you would probably want to account for that in the script to make sure one was created before saying that their guild was created. Though, it looks like in quest_mgr.cpp the actual function is set to void, so it won't return anything, unless I am missing something.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 03-07-2012 at 03:04 AM..
Reply With Quote
  #7  
Old 03-07-2012, 06:14 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Yeah, I realized that I hadn't added the variables late last night and came to edit but you already caught it. I also didn't check the syntax of the create command.
Reply With Quote
  #8  
Old 03-07-2012, 07:48 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Looking at the code again, it looks like it is looking for the character id for the leader instead of just the name, so you would want to get their character ID and use it in that function instead of the char name.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #9  
Old 03-07-2012, 02:25 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Quote:
Originally Posted by trevius View Post
Looking at the code again, it looks like it is looking for the character id for the leader instead of just the name, so you would want to get their character ID and use it in that function instead of the char name.
It gets the ID based on the name of the leader, works much like the # command.

http://www.eqemulator.org/forums/showthread.php?t=33655
Reply With Quote
  #10  
Old 03-08-2012, 02:14 AM
Nall
Sarnak
 
Join Date: Aug 2008
Location: The ice cave with vox
Posts: 31
Default

going to try it with the corrections tomorrow... its 1am atm.. bout to pass out.. I'll let you know how it turns out.
Reply With Quote
  #11  
Old 06-09-2015, 10:54 PM
cannon
Hill Giant
 
Join Date: Dec 2004
Location: Pittsburgh, PA
Posts: 128
Default

Anyone ever get this working?
Reply With Quote
  #12  
Old 06-10-2015, 12:35 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Yes, this now works, as this post was 3 years ago, but I guess they never posted to let anyone know, check here for our Perl reference:
Code:
quest::createguild(guild_name, leader_name) # Creates a new guild.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:29 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3