EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Boss spawn after kill count. (https://www.eqemulator.org/forums/showthread.php?t=43270)

ahamilton634 04-17-2021 03:13 PM

Boss spawn after kill count.
 
What I'm trying to accomplish is have a boss spawn after a certain number of spiders are killed. I have a working qglobal that counts how many spiders are killed, but I don't know how to accomplish the actual spawning. If I use quest::spawn then it'll spawn multiple instances of the boss. What I'd prefer to do is once is a certain number of spiders is killed, have it enable a disabled entry in the spawn2 table, and then after the boss is killed then disable that same entry. Is there a way to accomplish this?
I remember back in the day there was a page that went into each table on the database. I was trying to figure out the spawn conditions table but I couldn't find that page. Was it taken down?

nilbog 04-17-2021 03:27 PM

In lieu of using qglobals, you could have an invisible man acting as a controller that would count the number of spider deaths, and spawn the desired npc based on the number of kills.

ahamilton634 04-20-2021 12:12 AM

Hmm...
Is there a guide on how to accomplish this?

Turmoiltoad 04-20-2021 10:05 AM

Perfect use case for a data bucket. https://eqemu.gitbook.io/server/cate...g-data-buckets

Code:

sub EVENT_DEATH_COMPLETE {
        #:: Key a data bucket
        $key = $npc->GetCleanName() . "-kill-count";
        #:: Match if the data bucket does not exist
        if (!quest::get_data($key)) {
                #:: Set the data bucket
                quest::set_data($key, 1);
        }
        else {
                #:: Iterate the kill count value stored in the data bucket
                quest::set_data($key, quest::get_data($key) + 1);
                #:: Match when the value reaches 50 (kills)
                if (quest::get_data($key) eq "50") {
                        #:: Enable the spawn point for North Qeynos >> Fippy_Darkpaw (2001)
                        quest::enable_spawn2(10875);
                        #:: Reset the data bucket
                        quest::delete_data($key);
                }
        }
}


demonstar55 04-20-2021 08:09 PM

Could use lua encounters as well.

ahamilton634 04-25-2021 01:46 AM

Thanks! I'll give it a try.
Would this work for character specific instances too? Like every time a specific npc type dies, the killing PC gets a +1 and when they reach a certain value trigger an event? I know how to use the task system, but I want to try to do it without if possible.

Also, is there a lua guide? There used to be a pretty good guide on writing lua scripts for EQEMU servers but I can't seem to find it.

henrybecker361 01-05-2023 10:14 AM

It sounds like you are trying to set up a unique game mechanic that involves spawning a boss character after a certain number of spiders are killed. One way you could accomplish this is by using a quest script to check the value of the qglobal that counts the number of spiders killed, and then using quest::spawn2 to enable the disabled entry in the spawn2 table when the threshold is reached. You could then use a similar script to disable the entry again after the boss is killed.

As for the spawn conditions table, you might be able to find more information about it by searching online or asking other developers or players who have experience with the game. It could also be helpful to review the documentation or resources provided by the game's creators, if they have made any available. Good luck with your project!

nilbog 01-05-2023 03:48 PM

Oops, looks like I never replied back to this.

My proposed solution would be in perl.

Summary:
Invisible man controller spawns with 0 spider tokens.
Each time a spider is killed, it signals the controller. Controller increments spider token counter.
Once the controller has 20 spider tokens, spawn2 or unique_spawn whatever your boss npc id is and resets spider tokens to 0.

Code:

#invisible man controller

my $spidertoken = 0;

sub EVENT_SPAWN
{
        $spidertoken = 0;
}

sub EVENT_SIGNAL
{
        if ($spidertoken < 20)
        {
                $spidertoken++;
        }
        else
        {
                spawn2 whatever
                $spidertoken = 0;
        }
}

Code:

#spiders

sub EVENT_DEATH
{
        quest::signalwith(controllernpcid,1,1);
}


NatedogEZ 01-05-2023 08:52 PM

zone_controller.pl

This npc can track the deaths of any NPC so no need for signals and such

Code:

my $kill_count_69420 = 0;

sub EVENT_DEATH_ZONE {
        if ($killed_npc_id == 69420) { #NPCID of whatever
                if ($kill_count_69420 < 20) {
                        $kill_count_69420++;
                } else {
                        $kill_count_69420 = 0;
                        #We hit 20~ spawn something or whatever
                }
        }
}

Edit: just noticed how old the OP is on this.. but anyways this is a nice way for anyone who sees it :P


All times are GMT -4. The time now is 05:56 AM.

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