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

04-24-2006, 01:16 PM
|
Hill Giant
|
|
Join Date: Aug 2005
Posts: 107
|
|
I don't know how to test a NOT TRUE case in perl. If you can figure that out, then you can get that quest::say to work.
|

04-24-2006, 01:42 PM
|
Discordant
|
|
Join Date: Jan 2005
Posts: 320
|
|
Next time you log on my server Jim try handing the armor quest NPC a random item, the quest::say and everything works with him. I'm honestly not sure what the issue is hehe. I'll admit I'm pretty noob with most of this. I've never messed with C++ or perl any. I do manage some sql databases and websites that are pretty php intensive which helps a lot. But I'm no guru for sure. This stuff still confuses me 
|

04-24-2006, 01:51 PM
|
Hill Giant
|
|
Join Date: Aug 2005
Posts: 107
|
|
Yeah, i'm not sure. unless i put the return_item in an if statement, the turn in wouldn't even work. I'm not sure why, perl seems strange with it's logic if you ask me.
|

04-24-2006, 01:58 PM
|
Hill Giant
|
|
Join Date: Aug 2005
Posts: 107
|
|
you may try taking the version that you said you got working earlier, and adding single quotations around the number in quest::summon_item('3453'); <---Like that. Maybe that'll work.
|
 |
|
 |

04-24-2006, 02:42 PM
|
Discordant
|
|
Join Date: Jan 2005
Posts: 320
|
|
This kind of works, but I'm tired of looking at it today, going to go populate my next zone. In this code, the quest works, you get the ding, say, exp, and item, but he also says I cannot use this item, you can have it back and gives you the mold. So now you get the mold back+ the item your supposed to get *boggle* Thinking about this is hurting my head though. I'll sleep on it and tinker more tomorrow
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') {
if (plugin::check_handin(\%itemcount, 6141 => 1)) {
quest::summonitem(62189);
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
}
if ($class eq 'Paladin') {
if (plugin::check_handin(\%itemcount, 6141 => 1)) {
quest::summonitem(62189);
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
}
if ($class eq 'Shadow Knight') {
if (plugin::check_handin(\%itemcount, 6141 => 1)) {
quest::summonitem(62189);
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
}
if ($class eq 'Berserker') {
if (plugin::check_handin(\%itemcount, 6141 => 1)) {
quest::summonitem(62189);
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
}
if ($class eq 'Monk') {
if (plugin::check_handin(\%itemcount, 6141 => 1)) {
quest::summonitem(6611);
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
}
if ($class eq 'Beastlord') {
if (plugin::check_handin(\%itemcount, 6141 => 1)) {
quest::summonitem(6611);
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
}
if ($class eq 'Druid') {
if (plugin::check_handin(\%itemcount, 6141 => 1)) {
quest::summonitem(29422);
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
}
if ($class eq 'Necromancer') {
if (plugin::check_handin(\%itemcount, 6141 => 1)) {
quest::summonitem(29422);
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
}
if ($class eq 'Wizard') {
if (plugin::check_handin(\%itemcount, 6141 => 1)) {
quest::summonitem(29422);
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
}
if ($class eq 'Magician') {
if (plugin::check_handin(\%itemcount, 6141 => 1)) {
quest::summonitem(29422);
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
}
if ($class eq 'Enchanter') {
if (plugin::check_handin(\%itemcount, 6141 => 1)) {
quest::summonitem(29422);
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
}
if ($class eq 'Shaman') {
if (plugin::check_handin(\%itemcount, 6141 => 1)) {
quest::summonitem(29422);
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
}
if ($class eq 'Cleric') {
if (plugin::check_handin(\%itemcount, 6141 => 1)) {
quest::summonitem(29442);
quest::exp(750);
quest::emote("smiles warmly as he hands you your weapon.");
quest::ding();
}
}
plugin::return_items(\%itemcount);
quest::say("These are not the pieces I need.");
}
}
|
 |
|
 |

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.");
}
}
|
 |
|
 |
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 09:15 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |