Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plane of innovation spider_controller causes crashes #1390

Open
Alcolocfizzalot opened this issue Mar 22, 2024 · 0 comments
Open

Plane of innovation spider_controller causes crashes #1390

Alcolocfizzalot opened this issue Mar 22, 2024 · 0 comments

Comments

@Alcolocfizzalot
Copy link

Alcolocfizzalot commented Mar 22, 2024

I rewrote the quest file so now it will no longer cause crashes and will loop wont let me drop a .pl file so ill just post the code.

function event_spawn(e)
eq.set_timer("spiders", 19000) -- Set the initial timer for spawning spiders with an 8-second delay
end

function event_timer(e)
local npc_list = eq.get_entity_list():GetNPCList() -- Get the list of NPCs in the zone
local spider_count = 0 -- Initialize spider count

if npc_list ~= nil then
    for npc in npc_list.entries do
        local npc_type_id = npc:GetNPCTypeID()
        if npc_type_id == 206000 or npc_type_id == 206001 or npc_type_id == 206002 or npc_type_id == 206086 or npc_type_id == 206071 or npc_type_id == 206070 or npc_type_id == 206072 or npc_type_id == 206069 then
            spider_count = spider_count + 1 -- Increment spider count
        end
    end
end

if spider_count < 400 then -- Check if the number of spiders is less than 400
    -- Spawn additional spiders until reaching 1,000,000, staggering by 8 seconds
    if spider_count < 400 then
        eq.spawn2(206000, 28, 0, 803, -285, 4.63, 314) -- Spawn a spider
        eq.spawn2(206001, 29, 0, 804, 285, 4.63, 314) -- Spawn a spider
        eq.spawn2(206002, 30, 0, 1443, 285, 4.63, 314) -- Spawn a spider
        eq.spawn2(206086, 31, 0, 1443, -285, 4.63, 314) -- Spawn a spider
        eq.spawn2(eq.ChooseRandom(206071, 206070), 26, 0, 1155, 605, 4.63, 0) -- Spawn a spider
        eq.spawn2(eq.ChooseRandom(206072, 206069), 24, 0, 1155, -600, 4.63, 0) -- Spawn a spider
        eq.set_timer("spiders", 19000) -- Reset the timer for the next spider spawn after 8 seconds
    end
else
    eq.stop_timer("spiders") -- Stop the timer if 400 spiders have been spawned
    eq.set_timer("spiders", 19000) -- Reset the timer to start over
end

end

@Alcolocfizzalot Alcolocfizzalot changed the title Plane of innovation spider controller causes crashes Plane of innovation spider_controller causes crashes Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant