|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
02-03-2009, 09:06 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
Possible Kill counter?
I was wondering if it was possible to have a system to keep track of how many monsters someone has killed for a quest. Por examplar, tracking to see how many guards someone has killed in highkeep and when it reaches 10 enable them to get a reward from an NPC. I was wondering if it was possible to do something like this by making the game add a flag for every guard killed onto the quest, and when it hits 10 they can get the reward by the npc checking their flags. I need to ask this because I have no experience doing anytihng with flags yet.
|
02-03-2009, 10:03 PM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,497
|
|
The task system would be perfect for what you are asking.
|
02-03-2009, 10:08 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
yeah, but I don't know how to use the task system.
|
02-03-2009, 11:13 PM
|
Demi-God
|
|
Join Date: May 2007
Posts: 1,032
|
|
Task system is very nice looking as it has its own window which keeps quest progress track for a player but PAIN IN THE ARSE to code in for even a very simple quest
BUT you can make a kill tracker with a global variable.
I havent made one myself yet but you will need 2 things:
a) a global variable which counts kills and then npc who will read it and respond when coutn reaches certain number
b) npc death sub routine - when npc does something when it dies- in this case increment global variable count for you
this should be relatively simple
|
02-03-2009, 11:17 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
ok only part of that I wouldn't know how to do is make the global variable
|
02-04-2009, 03:07 PM
|
Dragon
|
|
Join Date: Feb 2007
Posts: 659
|
|
Have you tried using KLS's tool for creating tasks via the task system? It does help quite a bit. It's in the SVN if you are interested in using it.
As for global variables, look in the wiki. They are explained fairly well. Keep in mind that any NPC that you use for global variables has to have that enabled on them in the database. You might not need that for this particular quest, but you might later. Also you can look in a number of other quests for examples of using globals. Just grep(or search if Windoze) out qglobal from your quests directory. That'll bring up some quests with that used.
|
02-05-2009, 11:40 PM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
OK when I make this quest, what iwll be the command to increase the global value? In one quest I am using I have
Code:
quest::setglobal("buffbot", $buffbot+$itemcount{1440}, 0, "Y9");
to increase the global for it, but I do not know how to adjust that to be for when the mob dies increase it.
|
02-06-2009, 12:12 AM
|
Demi-God
|
|
Join Date: May 2007
Posts: 1,032
|
|
soemthing like this:
Code:
sub EVENT_DEATH
{
quest::setglobal("buffbot", $buffbot+1, 0, "Y9");
}
this should increment the variable by 1 when mob dies
hopefuly for player who kills it
|
02-06-2009, 12:14 AM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
Alright, sounds good. I should change the variable name though, right?
|
02-06-2009, 12:15 AM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
and Since no trade is disabled on my server, I can see someone just chain hailing the mob for the reward for alts, so is there a check I can do so he doesn't respond if they have done the quest already?
|
02-06-2009, 12:40 AM
|
Demi-God
|
|
Join Date: May 2007
Posts: 1,032
|
|
I am not sure what you referign to.
If reward is given after 10 mobs have been killed - then "just hailing" the npc won't do you any good
|
02-06-2009, 12:57 AM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
Ok, this is basically what I want the quest to be like. An NPC gives you the quest to kill 20 guards and Carson McCabe. I want it to be that everytime you kill a guard it will give you 1 point of credit until you hit 20 credit, then you have to kill Carson McCabe to get the last credit. Once you have 21 then you can hail the original NPC for the reward. If that's not possible, tell me please.
|
02-06-2009, 01:00 AM
|
Demi-God
|
|
Join Date: May 2007
Posts: 1,032
|
|
very posible.
just like I said in the begining.
you need 1st global variable couting 20 kills
and 2nd global checking if you have killed Carson
when you go to quest npc he will check that 1st variable is atleast 20 and then 2nd variable is non 0 and give you a reward
now I call upon one of our quest experts to write all this out
|
02-06-2009, 01:03 AM
|
Dragon
|
|
Join Date: Dec 2007
Posts: 658
|
|
Alright, thats probably a much better plan to have two variables instead of making some complex restricrions and what not. Thanks, I'm going to get to work on this tomorrow.
|
02-06-2009, 07:47 AM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,497
|
|
Much easier to just write a task.
|
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 06:11 PM.
|
|
|
|
|
|
|
|
|
|
|
|
|