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

04-24-2006, 07:24 PM
|
Dragon
|
|
Join Date: May 2003
Posts: 539
|
|
Your last quest is how you must write quests with checkhandin now. (except there my be an extra } at its end, check that if it does not work).
If you don't want the NPC to say that he returns items, you must test that there's still some items left in the %itemcount hashtable.
Code:
if (scalar(%itemcount)>0) {
quest::say("Take this back");
plugin::return_items(\%itemcount);
}
Another way is to say nothing and just add return_items.
To test that a string isn't something, use 'ne' and != for an integer
Code:
if ($class ne "Paladin") { }
if ($level != 5) { }
These is the basic perl syntax, there's many tutorials on the web...
Last edited by Muuss; 04-25-2006 at 03:29 AM..
|
 |
|
 |

04-25-2006, 04:49 PM
|
Discordant
|
|
Join Date: Jan 2005
Posts: 320
|
|
Final Working version of quest. Works Perfectly ( Thank you Doodman for all the help )
Code:
sub EVENT_SAY
{
if ($text =~ /hail/i)
{
quest::say("Hello $name , I am one of the finest weaponsmiths this land has ever seen. If you find me a mold I will craft you a weapon. However if it is armor you seek, my brother makes the best around.");
}
}
sub EVENT_ITEM
{
if ($class eq 'Warrior' && plugin::check_handin (\%itemcount, 6141 => 1))
{
quest::summonitem (62189);
quest::exp (750);
quest::emote ("smiles warmly as he hands you your weapon.");
quest::ding ();
}
elsif ($class eq 'Paladin' && plugin::check_handin (\%itemcount, 6141 => 1))
{
quest::summonitem (62189);
quest::exp (750);
quest::emote ("smiles warmly as he hands you your weapon.");
quest::ding ();
}
elsif ($class eq 'Shadow Knight' && plugin::check_handin (\%itemcount, 6141 => 1))
{
quest::summonitem (62189);
quest::exp (750);
quest::emote ("smiles warmly as he hands you your weapon.");
quest::ding ();
}
elsif ($class eq 'Berserker' && plugin::check_handin (\%itemcount, 6141 => 1))
{
quest::summonitem (62189);
quest::exp (750);
quest::emote ("smiles warmly as he hands you your weapon.");
quest::ding ();
}
elsif ($class eq 'Monk' && plugin::check_handin (\%itemcount, 6141 => 1))
{
quest::summonitem (6611);
quest::exp (750);
quest::emote ("smiles warmly as he hands you your weapon.");
quest::ding ();
}
elsif ($class eq 'Beastlord' && plugin::check_handin (\%itemcount, 6141 => 1))
{
quest::summonitem (6611);
quest::exp (750);
quest::emote ("smiles warmly as he hands you your weapon.");
quest::ding ();
}
elsif ($class eq 'Druid' && plugin::check_handin (\%itemcount, 6141 => 1))
{
quest::summonitem (29422);
quest::exp (750);
quest::emote ("smiles warmly as he hands you your weapon.");
quest::ding ();
}
elsif ($class eq 'Necromancer' && plugin::check_handin (\%itemcount, 6141 => 1))
{
quest::summonitem (29422);
quest::exp (750);
quest::emote ("smiles warmly as he hands you your weapon.");
quest::ding ();
}
elsif ($class eq 'Wizard' && plugin::check_handin (\%itemcount, 6141 => 1))
{
quest::summonitem (29422);
quest::exp (750);
quest::emote ("smiles warmly as he hands you your weapon.");
quest::ding ();
}
elsif ($class eq 'Magician' && plugin::check_handin (\%itemcount, 6141 => 1))
{
quest::summonitem (29422);
quest::exp (750);
quest::emote ("smiles warmly as he hands you your weapon.");
quest::ding ();
}
elsif ($class eq 'Enchanter' && plugin::check_handin (\%itemcount, 6141 => 1))
{
quest::summonitem (29422);
quest::exp (750);
quest::emote ("smiles warmly as he hands you your weapon.");
quest::ding ();
}
elsif ($class eq 'Shaman' && plugin::check_handin (\%itemcount, 6141 => 1))
{
quest::summonitem (29422);
quest::exp (750);
quest::emote ("smiles warmly as he hands you your weapon.");
quest::ding ();
}
elsif ($class eq 'Cleric' && plugin::check_handin (\%itemcount, 6141 => 1))
{
quest::summonitem (29442);
quest::exp (750);
quest::emote ("smiles warmly as he hands you your weapon.");
quest::ding ();
}
else
{
plugin::return_items (\%itemcount);
quest::say ("These are not the pieces I need.");
}
}
|
 |
|
 |

04-25-2006, 07:29 PM
|
Dragon
|
|
Join Date: May 2003
Posts: 539
|
|
If you're using the last plugin, i bet you my shirt and my shoes than this won't work for any other class than warrior.
L8rs.
|

04-26-2006, 05:28 AM
|
Discordant
|
|
Join Date: Jan 2005
Posts: 320
|
|
Just tested with a Beastlord, Warrior, and Necro, give the right item he hands you your wep. Give the wrong item and all you get back is what you gave him with the message telling you it's the wrong item. It seems to work fine even with that last plugin. I have 2 quests that use it and give multiple items. My other quest has 8 different rewards and works.
|

04-27-2006, 12:27 AM
|
Dragon
|
|
Join Date: May 2003
Posts: 539
|
|
I retire what i said about warrior. That quest works, but writing it like this is so risky that i wouldn't advise it to a perl beginner (inverse the tests and write 'if (plugin::check_handin(\%itemcount,6461=>1) && ($class eq "Warrior")) {' and it won't work anymore... but well...
Anyway, for that same quest, try to give the item 6461 plus another item, the one you want, and the npc won't return you the extra item.
|

06-23-2006, 03:13 PM
|
Sarnak
|
|
Join Date: Jun 2006
Posts: 38
|
|
ehh too much typing i'd just do this
Code:
sub EVENT_ITEM {
if (plugin::check_handin(\%itemcount, 6164 => 1)) {
if ( ($class == "Warrior") || ($class == "Paladin") || ($class == "Shadow Knight") || ($class == "Berserker") ) {
quest::summonitem(62189);
}
if ( ($class == "Monk") || ($class == "Beastlord") ) {
quest::summonitem(6611);
}
if ( ($class == "Druid") || ($class == "Shaman") || ($class == "Necromancer") || ($class == "Wizard") || ($class == "Magician") || ($class == "Enchanter") ) {
quest::summonitem(29422);
}
if ( $class == "Cleric" ) {
quest::summonitem(29442);
}
# probably add something for rogues, bards, and rangers
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
else {
plugin::return_items(\%itemcount);
quest::say("These are not the pieces I need.");
}
}
|

06-23-2006, 03:19 PM
|
Developer
|
|
Join Date: Jul 2004
Posts: 773
|
|
Just to throw yet another solution to the same problem out:
Code:
sub EVENT_ITEM {
if (plugin::check_handin(\%itemcount, 6164 => 1)) {
my %rewards = (
"Warrior" => 62189, "Paladin" => 62189, "Shadow Knight" => 62189,
"Monk" => 6611, "Beastlord" => 6611,
"Cleric" => 29442,
"Druid" => 29422, "Shaman" => 29422, "Necromancer" => 29422,
"Wizard" => 29422, "Magician" => 29422, "Enchanter" => 29422
);
if(defined($rewards{$class})) {
quest::summonitem($rewards{$class});
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
}
else {
plugin::return_items(\%itemcount);
quest::say("These are not the pieces I need.");
}
}
|
Thread Tools |
|
Display Modes |
Hybrid Mode
|
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:45 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |