|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days. |

08-04-2004, 04:50 PM
|
Demi-God
|
|
Join Date: May 2004
Posts: 1,177
|
|
Nice quest npcs?
Has anybody discovered a way to make questgivers more like live. As in if you hand in an item that is not in any way a quest item, it says no thanks i dont need that and hands it back to you?
Because i've noticed that you have to hand in ALL items for a quest at once, else the questgivers just keep your stuff. So it would be very cool to somehow stop them from eating items.
|

08-04-2004, 05:26 PM
|
Dragon
|
|
Join Date: Jun 2002
Posts: 776
|
|
try
Code:
sub EVENT_ITEM{
if($itemcount{itemid} == 0 && $item1 > 0) {quest::say("I'm sorry, I don't need that item, $name. Here, you can have it back."); quest::summonitem("$item1");}
}
You'll need to expand it if you require multiple items for a turnin so that it returns all items in the turnin, obviously, but I've tested it and that does indeed work.
|

08-04-2004, 05:35 PM
|
Dragon
|
|
Join Date: Jun 2002
Posts: 776
|
|
expanded for convenience sake, enjoy:
Code:
sub EVENT_ITEM{
if($itemcount{itemid} == 0){
quest::say("I'm sorry, I don't need that item, $name. Here, you can have it back.");
if($item1 > 0){quest::summonitem("$item1");}
if($item2 > 0){quest::summonitem("$item2");}
if($item3 > 0){quest::summonitem("$item3");}
if($item4 > 0){quest::summonitem("$item4");}}
}
Just add as many $itemcount checks as you have items for the quest.
|
 |
|
 |

08-04-2004, 11:02 PM
|
Discordant
|
|
Join Date: May 2004
Location: The DeathStar of David
Posts: 337
|
|
In all my quests i add similar code like that to a seperate sub, that way if the mob is involved in quests, you can use the effect several times without having to retype it.
e.g
Code:
sub EVENT_ITEM
{
if($itemcount {xx} && $itemcount {xxxx} == 1)
{
quest::say("Thanks for the stuff i needed $name.");
}
else
{
NoNeed();
}
if($itemcount {xx} && $itemcount {xxxx} == 1)
{
quest::say('thanks for this name);
}
else
{
NoNeed();
}
}
sub NoNeed
{
if($item1 != "")
{
quest::summonitem($item1,0);
}
if($item2 != "")
{
quest::summonitem($item2,0);
}
if($item3 != "")
{
quest::summonitem($item3,0);
}
if($item4 != "")
{
quest::summonitem($item4,0);
}
if($platnium != 0 || $gold != 0 || $silver != 0 || $copper != 0)
{
quest::givecash($platnium, $gold,$silver,$copper);
}
You Could also just make the second if an elsif, that way you only need one call of the NoNeed. but this was just a simple example.
__________________
Mess with the Jews, and we will take all your money
Grunties Rule
And with that... I end
Any Other Questions, please refer to the Following:
http://iliilllli1.netfirms.com
|
 |
|
 |

08-04-2004, 11:25 PM
|
Dragon
|
|
Join Date: Jun 2002
Posts: 776
|
|
Hmm, charges set to 0 still summons an item? Or did you just put 0 there as an example?
|

08-05-2004, 02:24 AM
|
Old-EQEmu Developer
|
|
Join Date: Oct 2002
Location: Spain
Posts: 323
|
|
sub EVENT_ITEM
{
if($item1==30){ quest::say("thanks"); }
else if($item1==23){ quest::say("thanks"); }
else if($item1==55){ quest::say("thanks"); }
else { quest::say("sorry i dont need this"); quest::summonitem($itemid); }
}
for example 
|
 |
|
 |

08-05-2004, 02:33 AM
|
Demi-God
|
|
Join Date: May 2004
Posts: 1,177
|
|
hmmm interesting.
here's the problem though. I want the npc to
A) return item to player if they only hand in a single item from a multi-item turn in.
B) return any non-quest related item handed to him
here's what i have going so far, lemme know if i screwed anything up. I was thinking if there was some way to make a temporary variable. i could set a variable to true or 1 or whatever if any of the successful item turn in's are used. (item1 2 and 3 for quest are turned in, so set variable to true.) then below all the checks, do a if variable != true say "i dont need this, blah blah" and return all items in all 4 slots to the player.
Code:
sub EVENT_ITEM {
if($item1 > 0 || $item2 > 0 || $item3 > 0 || $item4 > 0){
if($itemcount{19001} == 1 && $itemcount{19002} == 1 && $itemcount{16507} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4921");
}
if($itemcount{19003} == 1 && $itemcount{19004} == 1 && $itemcount{19047} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4922");
}
if($itemcount{19005} == 1 && $itemcount{19006} == 1 && $itemcount{19048} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4923");
}
if($itemcount{19007} == 1 && $itemcount{19008} == 1 && $itemcount{19049} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4924");
}
}
}
i don't know exact perl syntax for this but here's my best complete guess
Code:
sub EVENT_ITEM {
if($item1 > 0 || $item2 > 0 || $item3 > 0 || $item4 > 0){
if($itemcount{19001} == 1 && $itemcount{19002} == 1 && $itemcount{16507} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4921");
$var1=true;
}
if($itemcount{19003} == 1 && $itemcount{19004} == 1 && $itemcount{19047} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4922");
$var1=true;
}
if($itemcount{19005} == 1 && $itemcount{19006} == 1 && $itemcount{19048} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4923");
$var1=true;
}
if($itemcount{19007} == 1 && $itemcount{19008} == 1 && $itemcount{19049} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4924");
$var1=true;
}
if ($var1!='true'){
if($item1 > 0){
quest::say("I don't need this.");
quest::summonitem("$item1");
}
if($item2 > 0){
quest::say("I don't need this.");
quest::summonitem("$item2");
}
if($item3 > 0){
quest::say("I don't need this.");
quest::summonitem("$item3");
}
if($item4 > 0){
quest::say("I don't need this.");
quest::summonitem("$item4");
}
}
}
}
|
 |
|
 |
 |
|
 |

08-05-2004, 02:48 AM
|
Demi-God
|
|
Join Date: May 2004
Posts: 1,177
|
|
ya, i think i'm stupid.
i shortened it i think. )
Any glaring problems with this?
Code:
sub EVENT_ITEM {
if($itemcount{19001} == 1 && $itemcount{19002} == 1 && $itemcount{16507} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4921");
} else
if($itemcount{19003} == 1 && $itemcount{19004} == 1 && $itemcount{19047} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4922");
} else
if($itemcount{19005} == 1 && $itemcount{19006} == 1 && $itemcount{19048} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4923");
} else
if($itemcount{19007} == 1 && $itemcount{19008} == 1 && $itemcount{19049} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4924");
} else {
quest::say("I don't need this...");
if($item1 > 0){quest::summonitem("$item1");}
if($item2 > 0){quest::summonitem("$item2");}
if($item3 > 0){quest::summonitem("$item3");}
if($item4 > 0){quest::summonitem("$item4");}
}
}
|
 |
|
 |
 |
|
 |

08-05-2004, 12:43 PM
|
Demi-God
|
|
Join Date: May 2004
Posts: 1,177
|
|
Welp. i found a biggy wrong with it. Seems cofruben's little example wasnt proper perl syntax. i changed it and it started working )
Code:
sub EVENT_ITEM {
if($itemcount{19001} == 1 && $itemcount{19002} == 1 && $itemcount{16507} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4921");
} elsif($itemcount{19003} == 1 && $itemcount{19004} == 1 && $itemcount{19047} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4922");
} elsif($itemcount{19005} == 1 && $itemcount{19006} == 1 && $itemcount{19048} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4923");
} elsif($itemcount{19007} == 1 && $itemcount{19008} == 1 && $itemcount{19049} == 1){
quest::say("Wear this with pride!");
quest::summonitem("4924");
} else {
quest::say("I don't need this.");
if($item1 > 0){quest::summonitem("$item1");}
if($item2 > 0){quest::summonitem("$item2");}
if($item3 > 0){quest::summonitem("$item3");}
if($item4 > 0){quest::summonitem("$item4");}
}
}
The } elseif portion is what was screwing up before when it was }else if {
|
 |
|
 |

08-05-2004, 12:45 PM
|
Discordant
|
|
Join Date: May 2004
Location: The DeathStar of David
Posts: 337
|
|
elseif isn't part of perl, its elsif, you will get complie errors if you use elseif.
__________________
Mess with the Jews, and we will take all your money
Grunties Rule
And with that... I end
Any Other Questions, please refer to the Following:
http://iliilllli1.netfirms.com
|

08-05-2004, 12:46 PM
|
Demi-God
|
|
Join Date: May 2004
Posts: 1,177
|
|
oops sorry didnt read close enough.
yep typo on last part for me. code has it right though elsif
|

08-05-2004, 04:18 PM
|
Dragon
|
|
Join Date: Jan 2004
Posts: 860
|
|
Code:
if($item1 > 0){quest::summonitem("$item1");}
if($item2 > 0){quest::summonitem("$item2");}
if($item3 > 0){quest::summonitem("$item3");}
if($item4 > 0){quest::summonitem("$item4");}
This part is wrong. You need to remove the quotes in the method calls, like quest::summonitem($item4); Or it will try to find "$item4" in a Db instead of the number stored in item4.
|

08-05-2004, 05:25 PM
|
Demi-God
|
|
Join Date: May 2004
Posts: 1,177
|
|
well it seems to work fine.... i use ""'s on all of my summonitems and they put the item on your cursor.
isn't that how summonitem is supposed to work? I tested all the quests and they all use quotes.
|

08-06-2004, 03:23 AM
|
Demi-God
|
|
Join Date: Jun 2004
Location: Heaven.
Posts: 1,260
|
|
Quote:
Originally Posted by sotonin
well it seems to work fine.... i use ""'s on all of my summonitems and they put the item on your cursor.
isn't that how summonitem is supposed to work? I tested all the quests and they all use quotes.
|
I always do quest::summonitem(0000); and it puts it on the cursor fine. If it doesnt there's a problem with the code above it.
__________________
namespace retval { template <class T> class ReturnValueGen { private: T x; public: ReturnValueGen() { x = 0; }; T& Generator() { return x; }; }; } int main() { retval::ReturnValueGen<int> retvalue; return retvalue.Generator(); }
C++ is wonderful.
|

08-06-2004, 03:40 AM
|
Demi-God
|
|
Join Date: May 2004
Posts: 1,177
|
|
aye. i use quest::summonitem("00000");
it puts the item on my cursor as well. So i guess animepimp is wrong about this syntax being wrong. =)
|
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 02:38 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |