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. |
try
Code:
sub EVENT_ITEM{ |
expanded for convenience sake, enjoy:
Code:
sub EVENT_ITEM{ |
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 |
Hmm, charges set to 0 still summons an item? Or did you just put 0 there as an example?
|
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 :wink: |
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 { Code:
sub EVENT_ITEM { |
ya, i think i'm stupid.
i shortened it i think. ) Any glaring problems with this? Code:
sub EVENT_ITEM { |
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 { |
elseif isn't part of perl, its elsif, you will get complie errors if you use elseif.
|
oops sorry didnt read close enough.
yep typo on last part for me. code has it right though elsif |
Code:
if($item1 > 0){quest::summonitem("$item1");} |
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. |
Quote:
|
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. =) |
All times are GMT -4. The time now is 02:16 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.