Lottery Spawn Issues

Post Reply
Magnusxi
Posts: 8
Joined: Fri May 08, 2015 8:46 am

Lottery Spawn Issues

Post by Magnusxi » Mon May 18, 2015 10:01 am

Hello, DSP

I am playing around with a server, but i realized that my lottery spawns dont seem to be working, I even tried to set the 5% to higher percents by editing the random math values and they still do not spawn, mostly tried Leapy and Emp..

(standard scripts no edits except settings)
So my question is: am i missing something somewhere?

Code: Select all

----------------------------------
-- Area: Valkurm Dunes
-- NM: Valkurm Emperor
-----------------------------------

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

function onMobDeath(mob,killer)

    -- Set VE's Window Open Time
    SetServerVariable("[POP]Valkurm_Emperor", os.time(t) + 3600); -- 1 hour
    DeterMob(mob:getID(), true);

    -- Set PH back to normal, then set to respawn spawn
    PH = GetServerVariable("[PH]Valkurm_Emperor");
    SetServerVariable("[PH]Valkurm_Emperor", 0);
    DeterMob(PH, false);
    GetMobByID(PH):setRespawnTime(GetMobRespawnTime(PH));

end;

-----------------------------------
-- onMobDespawn
-----------------------------------

function onMobDespawn(mob)

    SetServerVariable("[POP]Valkurm_Emperor", os.time(t) + 3600); -- 1 hour
    DeterMob(mob:getID(), true);

	-- Set PH back to normal, then set to respawn spawn
	PH = GetServerVariable("[PH]Valkurm_Emperor");
	SetServerVariable("[PH]Valkurm_Emperor", 0);
	DeterMob(PH, false);
    GetMobByID(PH):setRespawnTime(GetMobRespawnTime(PH));

end;

Code: Select all

-----------------------------------	
-- Area: Valkurm Dunes	
-- MOB: Damselfly
-- Note: Place holder Valkurm Emperor 
-----------------------------------	

require("/scripts/zones/Valkurm_Dunes/MobIDs");
require("/scripts/globals/fieldsofvalor");	
	
-----------------------------------	
-- onMobDeath	
-----------------------------------	
	
function onMobDeath(mob,killer)	
	checkRegime(killer,mob,9,1);
	checkRegime(killer,mob,10,2);
  
    mob = mob:getID();
    if (Valkurm_Emperor_PH[mob] ~= nil) then

        VE_ToD = GetServerVariable("[POP]Valkurm_Emperor");
        if (VE_ToD <= os.time(t) and GetMobAction(Valkurm_Emperor) == 0) then
            if (math.random(1,20) == 5) then
                UpdateNMSpawnPoint(Valkurm_Emperor);
                GetMobByID(Valkurm_Emperor):setRespawnTime(GetMobRespawnTime(mob));
                SetServerVariable("[PH]Valkurm_Emperor", mob);
                DeterMob(mob, true);
            end
        end
    end
end;	

Code: Select all

-----------------------------------
-- Area: Valkurm Dunes (103)
-- Comments: -- posX, posY, posZ
--(Taken from 'mob_spawn_points' table)
-----------------------------------

-- Valkurm Emporer
Valkurm_Emperor=17199438;
Valkurm_Emperor_PH={ 
  [17199434] = '1', -- -228.957, 2.776, -101.226
  [17199437] = '1', -- -264.829, -0.843, -91.306
  [17199420] = '1', -- -95.250, -0.268, -49.386
  [17199419] = '1', -- -144.284, -1.103, 4.202
  [17199435] = '1', -- -270.823, -2.168, -16.349
  [17199436] = '1', -- -327.000, -1.000, -21.000
}; 

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: Lottery Spawn Issues

Post by TeoTwawki » Tue May 19, 2015 4:50 am

Code: Select all

if (math.random(1,20) == 5)
A one in twenty chance, if its been longer than the cooldown time. If you are unlucky that can take a long long time. I can tell you he does spawn on unmodified DarkStar, and I just checked to be sure there wasn't a mobID shift that would have effected it (rarely do mob IDs change, but occasionally happens so I looked).

If you change that code to

Code: Select all

if (math.random(1,5) == 3)
you'll have a one in five chance. (Any number from 1 to 5 works but I chose the middle value because OCD)
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

Magnusxi
Posts: 8
Joined: Fri May 08, 2015 8:46 am

Re: Lottery Spawn Issues

Post by Magnusxi » Tue May 19, 2015 8:55 am

Thank you teotwawki,

I tried adjusting it, but i will try again I will set it to a 50% for testing to see if it makes a difference..

If i restart the server it sets him to be ready to spawn correct? because i have not been waiting an hour before trying to spawn him

Edit:
Ok i tried setting it to (1,2) == 2 then.... waited an hour after restarting the server, after killing the PH's for ~2 hours, I commented out the random math and changed the setservervariable to be + 1 for testing.. (which should have set the window time to a second after server is up and spawn after PH is killed, but still no spawn.. im confused.

Additionally I did @spawnmob 17199438, and he did spawn so I dont know.

Code: Select all

function onMobDeath(mob,killer)	
	checkRegime(killer,mob,9,1);
	checkRegime(killer,mob,10,2);
  
    mob = mob:getID();
    if (Valkurm_Emperor_PH[mob] ~= nil) then

        VE_ToD = GetServerVariable("[POP]Valkurm_Emperor");
        if (VE_ToD <= os.time(t) and GetMobAction(Valkurm_Emperor) == 0) then
           --if (math.random(1,2) == 2) then
                UpdateNMSpawnPoint(Valkurm_Emperor);
                GetMobByID(Valkurm_Emperor):setRespawnTime(GetMobRespawnTime(mob));
                SetServerVariable("[PH]Valkurm_Emperor", mob);
                DeterMob(mob, true);
          --  end
        end
    end
end;	

Code: Select all

function onMobDeath(mob,killer)

    -- Set VE's Window Open Time
    SetServerVariable("[POP]Valkurm_Emperor", os.time(t) + 1); -- 1 hour
    DeterMob(mob:getID(), true);

    -- Set PH back to normal, then set to respawn spawn
    PH = GetServerVariable("[PH]Valkurm_Emperor");
    SetServerVariable("[PH]Valkurm_Emperor", 0);
    DeterMob(PH, false);
    GetMobByID(PH):setRespawnTime(GetMobRespawnTime(PH));

end;

-----------------------------------
-- onMobDespawn
-----------------------------------

function onMobDespawn(mob)

    SetServerVariable("[POP]Valkurm_Emperor", os.time(t) + 1); -- 1 hour
    DeterMob(mob:getID(), true);

	-- Set PH back to normal, then set to respawn spawn
	PH = GetServerVariable("[PH]Valkurm_Emperor");
	SetServerVariable("[PH]Valkurm_Emperor", 0);
	DeterMob(PH, false);
    GetMobByID(PH):setRespawnTime(GetMobRespawnTime(PH));

end;

User avatar
whasf
Site Admin
Posts: 1312
Joined: Thu Jul 19, 2012 9:11 pm

Re: Lottery Spawn Issues

Post by whasf » Tue May 19, 2015 5:55 pm

I'm wondering if the IDs for the placeholders are wrong
-- Whasf

User avatar
TeoTwawki
Developer
Posts: 527
Joined: Mon Jul 15, 2013 9:50 pm

Re: Lottery Spawn Issues

Post by TeoTwawki » Tue May 19, 2015 9:35 pm

set the server variable to zero, get rid of the random check entirely so that every kill of the PH results in a pop, round up all the flies in the area and mow them down. you can also @getid while targetting one to see if the IDs still match.
Hi, I run The Demiurge server.


Image
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. - Martin Golding
PLS USE [ code ] CODE TAGS [ /code ] WHEN POSTING CODE
DO NOT PRIVATE MESSAGE ME ABOUT BUGS

User avatar
tagban
Posts: 352
Joined: Fri Dec 28, 2012 11:31 am
Location: Pennsylvania, USA

Re: Lottery Spawn Issues

Post by tagban » Wed May 20, 2015 12:32 am

Right now a lot of monster ID's are wrong, case in point, KB, Behemoth, and a lot of others have new ID's..

Desufire
Posts: 162
Joined: Sun Feb 22, 2015 2:58 am

Re: Lottery Spawn Issues

Post by Desufire » Wed May 20, 2015 5:46 am

Have had a few players camping Lord of Onzozo and are reporting times way over its window and still no pops. I've been forcing it for them after I see them kill the PH for an hour or so when I know its window is open lol. Now I know so I can go in and see if i can locally fix this :). Thank you all.

Magnusxi
Posts: 8
Joined: Fri May 08, 2015 8:46 am

Re: Lottery Spawn Issues

Post by Magnusxi » Wed May 20, 2015 12:24 pm

I removed the math and set the servervariable to 0, I checked the ID's of each PH against the list in /zones/*/MobID.lua and they match, but still no NM (did this for leapy and Emp)

Not sure what is the issue.

Post Reply