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

08-09-2007, 07:25 AM
|
 |
Sarnak
|
|
Join Date: Jul 2005
Posts: 38
|
|
Ok, I got that to work, so nobody can take shortcuts through quests now :P
Now I have another problem with turn-ins...I have a series of quests where the first person you talk to hands out items based on class and gives you your quest. The other people in the series will only talk to you if you hand in one of the items, so there are multiple lines that get the same response, then 1 line that gets a different response. However, the NPC only replies to the hail and keyword I have set, any item turn-ins result in the NPC having a nice lunch.
This is just 1 of them, but if this problem is solved, the rest will work too:
Code:
sub EVENT_SAY{
if ($text=~/hail/i){quest::say("Begone scum!");}
if ($text=~/assignments/i){quest::say("Lord Nadrah continues to disregard our warnings, so we offer him one last chance. Slay his mistress and bring me her signet ring as proof. Perhaps that will teach him a lesson!");}
}
sub EVENT_ITEM{
if ($item1==1359){quest::say("Hmm, so you are the one who is moving through our ranks so quickly. Well, now you're an Agent, you also have more [assignments]!");quest::summonitem(1359);}
}
if ($item1==3617){quest::say("Hmm, so you are the one who is moving through our ranks so quickly. Well, now you're an Agent, you also have more [assignments]!");quest::summonitem(3617);}
}
if ($item1==5217){quest::say("Hmm, so you are the one who is moving through our ranks so quickly. Well, now you're an Agent, you also have more [assignments]!");quest::summonitem(5217);}
}
if ($item1==2563){quest::say("Hmm, so you are the one who is moving through our ranks so quickly. Well, now you're an Agent, you also have more [assignments]!");quest::summonitem(2563);}
}
if ($item1==5325){quest::say("Hmm, so you are the one who is moving through our ranks so quickly. Well, now you're an Agent, you also have more [assignments]!");quest::summonitem(5325);}
}
if ($item1==1868){quest::say("Hmm, so you are the one who is moving through our ranks so quickly. Well, now you're an Agent, you also have more [assignments]!");quest::summonitem(1868);}
}
if ($item1==1073){quest::say("Well now, you've truely done an Agent's work. I think you should speak to one of our undercover agents in Crow's Tavern near the lake.");quest::exp(40000);quest::faction(14,5);}
}
I've also tried it without putting a "}" between the lines, and nothing, as well as putting multiple SUB EVENT_ITEM things.
|
 |
|
 |

08-09-2007, 12:02 PM
|
|
Hill Giant
|
|
Join Date: Dec 2006
Posts: 102
|
|
This example has an extra } for each if statement which ultimately results in the subroutine not compiling. The result of this is that the npc will quietly eat the items. You may find it easier to follow and maintain if you don't try to do everything on one line.
Code:
You have:
if ($item1==1359){quest::say("Hmm, so you are the one who is moving through our ranks so quickly. Well, now you're an Agent, you also have more [assignments]!");quest::summonitem(1359);}
}
Easier to read (and without the extra } )
if ($item1==1359) {
quest::say("Hmm, so you are the one who is moving through our ranks so quickly. Well, now you're an Agent, you also have more [assignments]!");
quest::summonitem(1359);
}
|
 |
|
 |

08-09-2007, 12:56 PM
|
 |
Sarnak
|
|
Join Date: Jul 2005
Posts: 38
|
|
Ok, so I've changed it to look like this:
Code:
sub EVENT_SAY{
if ($text=~/hail/i){quest::say("Begone scum!");}
if ($text=~/assignments/i){quest::say("Lord Nadrah continues to disregard our warnings, so we offer him one last chance. Slay his mistress and bring me her signet ring as proof. Perhaps that will teach him a lesson!");}
}
sub EVENT_ITEM{
if ($item1==1359){quest::say("Hmm, so you are the one who is moving through our ranks so quickly. Well, now you're an Agent, you also have more [assignments]!");quest::summonitem(1359);
}
if ($item1==3617){quest::say("Hmm, so you are the one who is moving through our ranks so quickly. Well, now you're an Agent, you also have more [assignments]!");quest::summonitem(3617);
}
if ($item1==5217){quest::say("Hmm, so you are the one who is moving through our ranks so quickly. Well, now you're an Agent, you also have more [assignments]!");quest::summonitem(5217);
}
if ($item1==2563){quest::say("Hmm, so you are the one who is moving through our ranks so quickly. Well, now you're an Agent, you also have more [assignments]!");quest::summonitem(2563);
}
if ($item1==5325){quest::say("Hmm, so you are the one who is moving through our ranks so quickly. Well, now you're an Agent, you also have more [assignments]!");quest::summonitem(5325);
}
if ($item1==1868){quest::say("Hmm, so you are the one who is moving through our ranks so quickly. Well, now you're an Agent, you also have more [assignments]!");quest::summonitem(1868);
}
if ($item1==1073){quest::say("Well now, you've truely done an Agent's work. I think you should speak to one of our undercover agents in Crow's Tavern near the lake.");quest::exp(40000);quest::faction(14,5);
}
I haven't gotten a chance to test it, but if it works, thanks in advance 
|
 |
|
 |

08-10-2007, 01:45 AM
|
|
Demi-God
|
|
Join Date: Jul 2006
Posts: 1,552
|
|
If you used the check_handins plugin I mentioned, nothing would get eaten.
|
 |
|
 |

08-10-2007, 08:07 AM
|
|
Hill Giant
|
|
Join Date: Dec 2006
Posts: 102
|
|
Even using check_handin plugin would have eaten the stuff if the subroutine has syntax errors.
The operation of the check_handin routine is a little inconsistent tho.
If you hand in what is needed along with something else it eats what was needed and ignores the rest, acknowledging that it got what it wanted.
If you hand it more of what's needed than it wants, whether or not you also hand anything else, it does not eat anything does not acknowledge it got what it wanted.
Either way, it only returns the items it didn't want or need if you call the return_items plugin at the end.
I would be quicker to use it if check_handin were coded as:
Code:
sub check_handin {
my $hashref = shift;
my %required = @_;
foreach my $req (keys %required) {
if ((!defined $hashref->{$req}) || ($hashref->{$req} < $required{$req})) {
return(0);
}
}
foreach my $req (keys %required) {
if ($required{$req} < $hashref->{$req}) {
$hashref->{$req} -= $required{$req};
} else {
delete $hashref->{$req};
}
}
return 1;
}
This would make it still accept if you gave too many of an item and return the excess of that item as well as anything else that was given and not needed.
As to the potential to exploit of using a negative quantity required, the person coding the quest could just summon it directly if they wanted to.
|
 |
|
 |
| 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 03:48 AM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |