EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Possible Kill counter? (https://www.eqemulator.org/forums/showthread.php?t=27391)

Randymarsh9 02-03-2009 09:06 PM

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.

joligario 02-03-2009 10:03 PM

The task system would be perfect for what you are asking.

Randymarsh9 02-03-2009 10:08 PM

yeah, but I don't know how to use the task system.

ChaosSlayer 02-03-2009 11:13 PM

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

Randymarsh9 02-03-2009 11:17 PM

ok only part of that I wouldn't know how to do is make the global variable

Andrew80k 02-04-2009 03:07 PM

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.

Randymarsh9 02-05-2009 11:40 PM

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.

ChaosSlayer 02-06-2009 12:12 AM

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

Randymarsh9 02-06-2009 12:14 AM

Alright, sounds good. I should change the variable name though, right?

Randymarsh9 02-06-2009 12:15 AM

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?

ChaosSlayer 02-06-2009 12:40 AM

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

Randymarsh9 02-06-2009 12:57 AM

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.

ChaosSlayer 02-06-2009 01:00 AM

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 :D

Randymarsh9 02-06-2009 01:03 AM

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.

joligario 02-06-2009 07:47 AM

Much easier to just write a task.

cavedude 02-06-2009 12:56 PM

Yeah, I'd use the task system for that. It has more of an initial learning curve than quests, but it has proven to be far more powerful. Once you get the hang of it, and use KLS' awesome editor you'll find it is easier than writing quests! In this case, using globals as a counter is just plain ugly. I hate the practice myself, and am often required to do so for lack of a better alternative. Since your server is custom you can take advantage of the task system, since you're not bound by what's Live Like.

Here is all the info you'll ever need, be sure to read everything: http://www.eqemulator.net/wiki/wikka...SystemOverview

Here is KLS' taskmaster editor: http://code.google.com/p/projecteqemu/downloads/list

ChaosSlayer 02-06-2009 05:20 PM

unless I am wrong Task system has 1 annoying thing - you must do steps in order.

Basicly if step 2 asks you to kill 10 orcs and step 1 asks you to kill 10 goblins - untill you kill the goblins killing of orcs complitly pointless which in turn becomes annoying having to kill in the specific order (i can understand when it matters for a progression quest, but when you have 2 mobs sitting next to each other one giving you credit and other does not untill you get to that step of the task - realy gets on my nerves)

so quetsion is- can you ste it so steps can be done out of order or that is a no-no in task system?

Derision 02-06-2009 05:35 PM

Quote:

Originally Posted by ChaosSlayer (Post 164067)
unless I am wrong Task system has 1 annoying thing - you must do steps in order.

You're wrong.

If all activities have the step column set to zero, they must be completed in order.

If any activity has non-zero step number, than all activities with the same step number can be worked on simultaneously.

See Task 16, Arachnida in the PEQ DB for an example.

I agree with you though, writing tasks by hand can be a pain in the a**e :)

Randymarsh9 02-06-2009 09:25 PM

Ok, I don't get how to give the task to an NPC to assign it to people. i have a basic task written up in the task creator, but now I don't know what to do with it.

Randymarsh9 02-21-2009 01:48 PM

Can anyone tell me how to make an NPC make this task selectable? I am looking at a list of task commands, but I can't figure out where I will put them.

Derision 02-21-2009 02:44 PM

Using a Perl quest, quest::assigntask(100) is one way. If you have a number of tasks, e.g. 100,101,102 that you want them to be able to choose from, use quest::taskselector(100,101,102).

The list of the Perl task functions is here:

http://www.eqemulator.net/wiki/wikka...kSystemPerlAPI

Randymarsh9 02-21-2009 04:50 PM

i am using that task creator that someone suggested, and I keep having a problem with it where no matter what the reward method keeps going back to perl quest reward. All I want is for it to give the item that I put as the reward, but even if I save it, as soon as I reload the task it makes it reward type perl quest reward again.

Randymarsh9 02-21-2009 05:59 PM

nvm. I just edited it in navicat and it fixed it.


All times are GMT -4. The time now is 02:36 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.