Dynamis - Mega Boss Repops Mobs

Forum rules
NO LONGER BEING MAINTAINED!
Post Reply
sekigah
Posts: 13
Joined: Fri Aug 12, 2016 2:02 pm

Dynamis - Mega Boss Repops Mobs

Post by sekigah » Wed Aug 24, 2016 12:33 pm

So the Dyna Sandy and Windy zones had the mega boss respawning mobs if you re engage. So I was doing some testing and I just wanted to see if I'm interpreting and subsequently fixing this correctly.

In Dyna Sandy and Windy that if you manage to get off the Mega Boss' hate list or die or come back in and re-engage him, he will spawn another set of mobs.

I went into the scripts for the zone and looked at the Mega Boss' LUA and noticed that there wasn't a check for the onMobEngaged function.

So I added a condition using the existing [DynaSandoria]Boss_Trigger and [DynaWindurst]Boss_Trigger server variables that was used for the pop NMs to prevent subsequent spawns.

I double checked to make sure the condition uses the server variable set when the mega boss was spawned so no wonky pop behavior occurs.

Here is a link to the Github: https://github.com/DarkstarProject/dark ... bstone.lua

As an example, here is the modified Dyna Sandy code. I haven't tested since I'm at work but does anyone see an issue with this code? I'll test it tonight and if it works I'll submit it to Github.

Code: Select all

-----------------------------------
-- Area: Dynamis San d'Oria
--  MOB: Overlord's Tombstone
-----------------------------------

require("scripts/globals/titles");
require("scripts/globals/dynamis");

-----------------------------------
-- onMobSpawn Action
-----------------------------------

function onMobSpawn(mob)
end;

-----------------------------------
-- onMobEngaged
-----------------------------------

function onMobEngaged(mob,target)
		
	if (GetServerVariable("[DynaSandoria]Boss_Trigger") == 4) then     -- Adds condition to prevent mega boss from respawning mobs if you re-engage.
		SpawnMob(17535350):updateEnmity(target); 						-- 110
		SpawnMob(17535351):updateEnmity(target); 						-- 111
		SpawnMob(17535352):updateEnmity(target); 						-- 112
		SpawnMob(17535354):updateEnmity(target); 						-- 114
		SpawnMob(17534978):updateEnmity(target); 						-- Battlechoir Gitchfotch
		SpawnMob(17534979):updateEnmity(target); 						-- Soulsender Fugbrag
		SetServerVariable("[DynaSandoria]Boss_Trigger",5);
	end
end;

-----------------------------------
-- onMobDeath
-----------------------------------

function onMobDeath(mob, player, isKiller)

    if (alreadyReceived(player,8) == false) then
        addDynamisList(player,128);
        player:addTitle(DYNAMISSAN_DORIA_INTERLOPER); 					-- Add title
        local npc = GetNPCByID(17535224); 								-- Spawn ???
        npc:setPos(mob:getXPos(),mob:getYPos(),mob:getZPos());
        npc:setStatus(0);
        player:launchDynamisSecondPart(); 								-- Spawn dynamis second part
    end

    for i = 17534978, 17534979 do
        if (GetMobAction(i) ~= 0) then
            DespawnMob(i);
        end
    end

end;

Post Reply