|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
|
|
|
03-05-2012, 02:08 PM
|
Sarnak
|
|
Join Date: Aug 2008
Location: The ice cave with vox
Posts: 31
|
|
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
|
|
|
|
03-06-2012, 02:19 PM
|
Sarnak
|
|
Join Date: Aug 2008
Location: The ice cave with vox
Posts: 31
|
|
basically as a NON-GM how would a user specify the guild name for a quest creation?
|
03-06-2012, 02:38 PM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,497
|
|
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.
|
03-06-2012, 02:42 PM
|
Sarnak
|
|
Join Date: Aug 2008
Location: The ice cave with vox
Posts: 31
|
|
excellent, let me know
|
|
|
|
03-06-2012, 08:31 PM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,497
|
|
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);
}
}
|
|
|
|
03-07-2012, 02:57 AM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
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.
Last edited by trevius; 03-07-2012 at 03:04 AM..
|
03-07-2012, 06:14 AM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,497
|
|
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.
|
03-07-2012, 07:48 AM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
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.
|
03-07-2012, 02:25 PM
|
|
Administrator
|
|
Join Date: Feb 2009
Location: MN
Posts: 2,071
|
|
Quote:
Originally Posted by trevius
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
|
03-08-2012, 02:14 AM
|
Sarnak
|
|
Join Date: Aug 2008
Location: The ice cave with vox
Posts: 31
|
|
going to try it with the corrections tomorrow... its 1am atm.. bout to pass out.. I'll let you know how it turns out.
|
06-09-2015, 10:54 PM
|
Hill Giant
|
|
Join Date: Dec 2004
Location: Pittsburgh, PA
Posts: 128
|
|
Anyone ever get this working?
|
06-10-2015, 12:35 AM
|
Administrator
|
|
Join Date: May 2013
Location: United States
Posts: 1,594
|
|
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.
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 11:35 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|