Index: globals/server.lua =================================================================== --- globals/server.lua (revision 4026) +++ globals/server.lua (working copy) @@ -148,7 +148,11 @@ 17285220, -- Woodland Sage 17461338, -- Drexerion the Condemned 17461343, -- Phanduron the Condemned - 17568127 -- Morbolger + 17568127, -- Morbolger + 17203447, -- Fraelissa + 16990252, -- Harvestman + 16785593, -- Tempest Tigon + 17461478 -- Bloodsucker } i = 1; Index: zones/Behemoths_Dominion/mobs/Behemoth.lua =================================================================== --- zones/Behemoths_Dominion/mobs/Behemoth.lua (revision 4031) +++ zones/Behemoths_Dominion/mobs/Behemoth.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------- -- Area: Behemoth's Dominion --- HNM: Behemoth +-- HNM: Behemoth ----------------------------------- require("scripts/globals/titles"); @@ -15,26 +15,6 @@ end; ----------------------------------- --- onMobEngaged Action ------------------------------------ - -function onMobEngaged(mob,target) - Behemoth_Engaged = os.time(t); -end; - ------------------------------------ --- onMobFight Action ------------------------------------ - -function onMobFight(mob,target) - - if(mob:getBattleTime() == 1800) then - mob:rageMode(); - end - -end; - ------------------------------------ -- onMobDeath ----------------------------------- Index: zones/Behemoths_Dominion/mobs/King_Behemoth.lua =================================================================== --- zones/Behemoths_Dominion/mobs/King_Behemoth.lua (revision 4031) +++ zones/Behemoths_Dominion/mobs/King_Behemoth.lua (working copy) @@ -13,27 +13,8 @@ function onMobInitialize(mob) end; ------------------------------------ --- onMobEngaged Action ------------------------------------ -function onMobEngaged(mob,target) - KingBehemoth_Engaged = os.time(t); -end; - ----------------------------------- --- onMobFight Action ------------------------------------ - -function onMobFight(mob,target) - - if(mob:getBattleTime() == 3600) then - mob:rageMode(); - end - -end; - ------------------------------------ -- onMobDeath ----------------------------------- Index: zones/Bhaflau_Thickets/MobIDs.lua =================================================================== --- zones/Bhaflau_Thickets/MobIDs.lua (revision 0) +++ zones/Bhaflau_Thickets/MobIDs.lua (working copy) @@ -0,0 +1,19 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- Comments: -- posX, posY, posZ +--(Taken from 'mob_spawn_points' table) +----------------------------------- + +-- Emergent Elm +Emergent_Elm=16990376; +Emergent_Elm_PH={ + [16990374] = '1', -- 86.000 -35.000 621.000 +}; + +-- Mahishasura +Mahishasura=16990306; +Mahishasura_PH={ + [16990296] = '1', -- 215.000 -18.000 372.000 +}; + + Index: zones/Bhaflau_Thickets/mobs/Emergent_Elm.lua =================================================================== --- zones/Bhaflau_Thickets/mobs/Emergent_Elm.lua (revision 0) +++ zones/Bhaflau_Thickets/mobs/Emergent_Elm.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- NM: Emergent Elm +-- @pos 71.000 -33.000 627.000 52 +----------------------------------- + +require("/scripts/zones/Bhaflau_Thickets/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Set EE's ToD + SetServerVariable("[POP]Emergent_Elm", os.time(t) + 14400); -- 4 hours + DeterMob(mob:getID(), true); + + -- Set PH back to normal, then set to respawn spawn + PH = GetServerVariable("[PH]Emergent_Elm"); + SetServerVariable("[PH]Emergent_Elm", 0); + DeterMob(PH, false); + GetMobByID(PH):setRespawnTime(GetMobRespawnTime(PH)); + +end; Index: zones/Bhaflau_Thickets/mobs/Harvestman.lua =================================================================== --- zones/Bhaflau_Thickets/mobs/Harvestman.lua (revision 0) +++ zones/Bhaflau_Thickets/mobs/Harvestman.lua (working copy) @@ -0,0 +1,18 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- MOB: Harvestman +-- @pos 398.130 -10.675 179.169 52 +----------------------------------- + + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Set Ahtu's spawnpoint and respawn time (21-24 hours) + UpdateNMSpawnPoint(mob:getID()); + mob:setRespawnTime(math.random((75600),(86400))); + +end; Index: zones/Bhaflau_Thickets/mobs/Mahishasura.lua =================================================================== --- zones/Bhaflau_Thickets/mobs/Mahishasura.lua (revision 0) +++ zones/Bhaflau_Thickets/mobs/Mahishasura.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- NM: Mahishasura +-- @pos 206.510 -16.320 357.724 52 +----------------------------------- + +require("/scripts/zones/Bhaflau_Thickets/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Set Mahishasura's ToD + SetServerVariable("[POP]Mahishasura", os.time(t) + 10800); -- 3 hours + DeterMob(mob:getID(), true); + + -- Set PH back to normal, then set to respawn spawn + PH = GetServerVariable("[PH]Mahishasura"); + SetServerVariable("[PH]Mahishasura", 0); + DeterMob(PH, false); + GetMobByID(PH):setRespawnTime(GetMobRespawnTime(PH)); + +end; Index: zones/Bhaflau_Thickets/mobs/Marid.lua =================================================================== --- zones/Bhaflau_Thickets/mobs/Marid.lua (revision 0) +++ zones/Bhaflau_Thickets/mobs/Marid.lua (working copy) @@ -0,0 +1,39 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- MOB: Marid +-- Note: Place holder Mahishasura +----------------------------------- + +require("/scripts/zones/Bhaflau_Thickets/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Get Marid ID and check if it is a PH of Mahishasura + mob = mob:getID(); + + -- Check if Marid is within the Mahishasura_PH table + if (Mahishasura_PH[mob] ~= nil) then + -- printf("%u is a PH",mob); + -- Get Mahishasura's previous ToD + Mahishasura_ToD = GetServerVariable("[POP]Mahishasura"); + + -- Check if Mahishasura window is open, and there is not an Mahishasura popped already(ACTION_NONE = 0) + if (Mahishasura_ToD <= os.time(t) and GetMobAction(Mahishasura) == 0) then + + -- printf("Mahishasura window open"); + -- Give Marid 5 percent chance to pop Mahishasura + if (math.random(1,20) == 5) then + -- printf("Mahishasura will pop"); + UpdateNMSpawnPoint(Mahishasura); + GetMobByID(Mahishasura):setRespawnTime(GetMobRespawnTime(mob)); + SetServerVariable("[PH]Mahishasura", mob); + DeterMob(mob, true); + end + end + end + +end; Index: zones/Bhaflau_Thickets/mobs/Nis_Puk.lua =================================================================== --- zones/Bhaflau_Thickets/mobs/Nis_Puk.lua (revision 0) +++ zones/Bhaflau_Thickets/mobs/Nis_Puk.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- NM: Nis_Puk +-- @pos -155.319 -15.959 -599.366 52 +----------------------------------- + +require("/scripts/zones/Bhaflau_Thickets/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Set NP's ToD + SetServerVariable("[POP]Nis_Puk", os.time(t) + 43200); -- 12 hours + DeterMob(mob:getID(), true); + + -- Set PH back to normal, then set to respawn spawn + PH = GetServerVariable("[PH]Nis_Puk"); + SetServerVariable("[PH]Nis_Puk", 0); + DeterMob(PH, false); + GetMobByID(PH):setRespawnTime(GetMobRespawnTime(PH)); + +end; Index: zones/Bhaflau_Thickets/mobs/Olden_Treant.lua =================================================================== --- zones/Bhaflau_Thickets/mobs/Olden_Treant.lua (revision 0) +++ zones/Bhaflau_Thickets/mobs/Olden_Treant.lua (working copy) @@ -0,0 +1,39 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- MOB: Olden Treant +-- Note: Place holder Emergent Elm +----------------------------------- + +require("/scripts/zones/Bhaflau_Thickets/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Get Olden Treant ID and check if it is a PH of EE + mob = mob:getID(); + + -- Check if Olden Treant is within the Emergent_Elm_PH table + if (Emergent_Elm_PH[mob] ~= nil) then + -- printf("%u is a PH",mob); + -- Get EE's previous ToD + EE_ToD = GetServerVariable("[POP]Emergent_Elm"); + + -- Check if EE window is open, and there is not an EE popped already(ACTION_NONE = 0) + if (EE_ToD <= os.time(t) and GetMobAction(Emergent_Elm) == 0) then + + -- printf("EE window open"); + -- Give Olden Treant 5 percent chance to pop EE + if (math.random(1,20) == 5) then + -- printf("EE will pop"); + UpdateNMSpawnPoint(Emergent_Elm); + GetMobByID(Emergent_Elm):setRespawnTime(GetMobRespawnTime(mob)); + SetServerVariable("[PH]Emergent_Elm", mob); + DeterMob(mob, true); + end + end + end + +end; Index: zones/Bhaflau_Thickets/mobs/Sea_Puk.lua =================================================================== --- zones/Bhaflau_Thickets/mobs/Sea_Puk.lua (revision 0) +++ zones/Bhaflau_Thickets/mobs/Sea_Puk.lua (working copy) @@ -0,0 +1,40 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- MOB: Sea Puk +-- Note: Place holder Nis Puk +----------------------------------- + +require("/scripts/zones/Bhaflau_Thickets/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Get Sea Puk ID and check if it is a PH of NP + mob = mob:getID(); + + -- Check if Sea Puk is within the Nis_Puk_PH table + if (Nis_Puk_PH[mob] ~= nil) then + -- printf("%u is a PH",mob); + -- Get NP's previous ToD + NP_ToD = GetServerVariable("[POP]Nis_Puk"); + + -- Check if NP window is open, and there is not an NP popped already(ACTION_NONE = 0) + if (NP_ToD <= os.time(t) and GetMobAction(Nis_Puk) == 0) then + + -- printf("NP window open"); + -- Give Sea Puk 5 percent chance to pop NP + if (math.random(1,20) >= 1) then + -- printf("NP will pop"); + UpdateNMSpawnPoint(Nis_Puk); + GetMobByID(Nis_Puk):setRespawnTime(GetMobRespawnTime(mob)); + SetServerVariable("[PH]Nis_Puk", mob); + DeterMob(mob, true); + end + end + end + +end; + Index: zones/Bhaflau_Thickets/mobs/Emergent_Elm.lua =================================================================== --- zones/Bhaflau_Thickets/mobs/Emergent_Elm.lua (revision 0) +++ zones/Bhaflau_Thickets/mobs/Emergent_Elm.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- NM: Emergent Elm +-- @pos 71.000 -33.000 627.000 52 +----------------------------------- + +require("/scripts/zones/Bhaflau_Thickets/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Set EE's ToD + SetServerVariable("[POP]Emergent_Elm", os.time(t) + 14400); -- 4 hours + DeterMob(mob:getID(), true); + + -- Set PH back to normal, then set to respawn spawn + PH = GetServerVariable("[PH]Emergent_Elm"); + SetServerVariable("[PH]Emergent_Elm", 0); + DeterMob(PH, false); + GetMobByID(PH):setRespawnTime(GetMobRespawnTime(PH)); + +end; Index: zones/Bhaflau_Thickets/mobs/Harvestman.lua =================================================================== --- zones/Bhaflau_Thickets/mobs/Harvestman.lua (revision 0) +++ zones/Bhaflau_Thickets/mobs/Harvestman.lua (working copy) @@ -0,0 +1,18 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- MOB: Harvestman +-- @pos 398.130 -10.675 179.169 52 +----------------------------------- + + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Set Ahtu's spawnpoint and respawn time (21-24 hours) + UpdateNMSpawnPoint(mob:getID()); + mob:setRespawnTime(math.random((75600),(86400))); + +end; Index: zones/Bhaflau_Thickets/mobs/Mahishasura.lua =================================================================== --- zones/Bhaflau_Thickets/mobs/Mahishasura.lua (revision 0) +++ zones/Bhaflau_Thickets/mobs/Mahishasura.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- NM: Mahishasura +-- @pos 206.510 -16.320 357.724 52 +----------------------------------- + +require("/scripts/zones/Bhaflau_Thickets/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Set Mahishasura's ToD + SetServerVariable("[POP]Mahishasura", os.time(t) + 10800); -- 3 hours + DeterMob(mob:getID(), true); + + -- Set PH back to normal, then set to respawn spawn + PH = GetServerVariable("[PH]Mahishasura"); + SetServerVariable("[PH]Mahishasura", 0); + DeterMob(PH, false); + GetMobByID(PH):setRespawnTime(GetMobRespawnTime(PH)); + +end; Index: zones/Bhaflau_Thickets/mobs/Marid.lua =================================================================== --- zones/Bhaflau_Thickets/mobs/Marid.lua (revision 0) +++ zones/Bhaflau_Thickets/mobs/Marid.lua (working copy) @@ -0,0 +1,39 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- MOB: Marid +-- Note: Place holder Mahishasura +----------------------------------- + +require("/scripts/zones/Bhaflau_Thickets/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Get Marid ID and check if it is a PH of Mahishasura + mob = mob:getID(); + + -- Check if Marid is within the Mahishasura_PH table + if (Mahishasura_PH[mob] ~= nil) then + -- printf("%u is a PH",mob); + -- Get Mahishasura's previous ToD + Mahishasura_ToD = GetServerVariable("[POP]Mahishasura"); + + -- Check if Mahishasura window is open, and there is not an Mahishasura popped already(ACTION_NONE = 0) + if (Mahishasura_ToD <= os.time(t) and GetMobAction(Mahishasura) == 0) then + + -- printf("Mahishasura window open"); + -- Give Marid 5 percent chance to pop Mahishasura + if (math.random(1,20) == 5) then + -- printf("Mahishasura will pop"); + UpdateNMSpawnPoint(Mahishasura); + GetMobByID(Mahishasura):setRespawnTime(GetMobRespawnTime(mob)); + SetServerVariable("[PH]Mahishasura", mob); + DeterMob(mob, true); + end + end + end + +end; Index: zones/Bhaflau_Thickets/mobs/Nis_Puk.lua =================================================================== --- zones/Bhaflau_Thickets/mobs/Nis_Puk.lua (revision 0) +++ zones/Bhaflau_Thickets/mobs/Nis_Puk.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- NM: Nis_Puk +-- @pos -155.319 -15.959 -599.366 52 +----------------------------------- + +require("/scripts/zones/Bhaflau_Thickets/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Set NP's ToD + SetServerVariable("[POP]Nis_Puk", os.time(t) + 43200); -- 12 hours + DeterMob(mob:getID(), true); + + -- Set PH back to normal, then set to respawn spawn + PH = GetServerVariable("[PH]Nis_Puk"); + SetServerVariable("[PH]Nis_Puk", 0); + DeterMob(PH, false); + GetMobByID(PH):setRespawnTime(GetMobRespawnTime(PH)); + +end; Index: zones/Bhaflau_Thickets/mobs/Olden_Treant.lua =================================================================== --- zones/Bhaflau_Thickets/mobs/Olden_Treant.lua (revision 0) +++ zones/Bhaflau_Thickets/mobs/Olden_Treant.lua (working copy) @@ -0,0 +1,39 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- MOB: Olden Treant +-- Note: Place holder Emergent Elm +----------------------------------- + +require("/scripts/zones/Bhaflau_Thickets/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Get Olden Treant ID and check if it is a PH of EE + mob = mob:getID(); + + -- Check if Olden Treant is within the Emergent_Elm_PH table + if (Emergent_Elm_PH[mob] ~= nil) then + -- printf("%u is a PH",mob); + -- Get EE's previous ToD + EE_ToD = GetServerVariable("[POP]Emergent_Elm"); + + -- Check if EE window is open, and there is not an EE popped already(ACTION_NONE = 0) + if (EE_ToD <= os.time(t) and GetMobAction(Emergent_Elm) == 0) then + + -- printf("EE window open"); + -- Give Olden Treant 5 percent chance to pop EE + if (math.random(1,20) == 5) then + -- printf("EE will pop"); + UpdateNMSpawnPoint(Emergent_Elm); + GetMobByID(Emergent_Elm):setRespawnTime(GetMobRespawnTime(mob)); + SetServerVariable("[PH]Emergent_Elm", mob); + DeterMob(mob, true); + end + end + end + +end; Index: zones/Bhaflau_Thickets/mobs/Sea_Puk.lua =================================================================== --- zones/Bhaflau_Thickets/mobs/Sea_Puk.lua (revision 0) +++ zones/Bhaflau_Thickets/mobs/Sea_Puk.lua (working copy) @@ -0,0 +1,40 @@ +----------------------------------- +-- Area: Bhaflau Thickets +-- MOB: Sea Puk +-- Note: Place holder Nis Puk +----------------------------------- + +require("/scripts/zones/Bhaflau_Thickets/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Get Sea Puk ID and check if it is a PH of NP + mob = mob:getID(); + + -- Check if Sea Puk is within the Nis_Puk_PH table + if (Nis_Puk_PH[mob] ~= nil) then + -- printf("%u is a PH",mob); + -- Get NP's previous ToD + NP_ToD = GetServerVariable("[POP]Nis_Puk"); + + -- Check if NP window is open, and there is not an NP popped already(ACTION_NONE = 0) + if (NP_ToD <= os.time(t) and GetMobAction(Nis_Puk) == 0) then + + -- printf("NP window open"); + -- Give Sea Puk 5 percent chance to pop NP + if (math.random(1,20) >= 1) then + -- printf("NP will pop"); + UpdateNMSpawnPoint(Nis_Puk); + GetMobByID(Nis_Puk):setRespawnTime(GetMobRespawnTime(mob)); + SetServerVariable("[PH]Nis_Puk", mob); + DeterMob(mob, true); + end + end + end + +end; + Index: zones/Bostaunieux_Oubliette/mobs/Bloodsucker.lua =================================================================== --- zones/Bostaunieux_Oubliette/mobs/Bloodsucker.lua (revision 0) +++ zones/Bostaunieux_Oubliette/mobs/Bloodsucker.lua (working copy) @@ -0,0 +1,22 @@ +----------------------------------- +-- Area: Bostaunieux Oubliette (167) +-- Mob: Bloodsucker (NM) +-- @pos -21.776 16.983 -231.477 167 +----------------------------------- + + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + mobID = mob:getID(); + + if(mobID == 17461478) then + UpdateNMSpawnPoint(mob); + mob:setRespawnTime(259200); + + end +end; + Index: zones/Carpenters_Landing/MobIDs.lua =================================================================== --- zones/Carpenters_Landing/MobIDs.lua (revision 0) +++ zones/Carpenters_Landing/MobIDs.lua (working copy) @@ -0,0 +1,11 @@ +----------------------------------- +-- Area: Carpenters Landing +-- Comments: -- posX, posY, posZ +--(Taken from 'mob_spawn_points' table) +----------------------------------- + +-- Orctrap +Orctrap=16785676; +Orctrap_PH={ + [16785673] = '1', -- 181.819 -5.887 -524.872 +}; Index: zones/Carpenters_Landing/mobs/Birdtrap.lua =================================================================== --- zones/Carpenters_Landing/mobs/Birdtrap.lua (revision 0) +++ zones/Carpenters_Landing/mobs/Birdtrap.lua (working copy) @@ -0,0 +1,39 @@ +----------------------------------- +-- Area: Carpenters' Landing +-- Mob: Birdtrap +-- Note: Placeholder Orctrap +----------------------------------- + +require("/scripts/zones/Carpenters_Landing/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Get Birdtrap ID and check if it is a PH of Orctrap + mob = mob:getID(); + + -- Check if Birdtrap is within the Orctrap_PH table + if (Orctrap_PH[mob] ~= nil) then + -- printf("%u is a PH",mob); + -- Get Orctrap previous ToD + Orctrap_ToD = GetServerVariable("[POP]Orctrap"); + + -- Check if Orctrap window is open, and there is not an Orctrap popped already(ACTION_NONE = 0) + if (Orctrap_ToD <= os.time(t) and GetMobAction(Orctrap) == 0) then + + -- printf("Orctrap window open"); + -- Give Birdtrap 5 percent chance to pop Orctrap + if (math.random(1,20) == 5) then + -- printf("Orctrap will pop"); + UpdateNMSpawnPoint(Orctrap); + GetMobByID(Orctrap):setRespawnTime(GetMobRespawnTime(mob)); + SetServerVariable("[PH]Orctrap", mob); + DeterMob(mob, true); + end + end + end + +end; \ No newline at end of file Index: zones/Carpenters_Landing/mobs/Mycophile.lua =================================================================== --- zones/Carpenters_Landing/mobs/Mycophile.lua (revision 0) +++ zones/Carpenters_Landing/mobs/Mycophile.lua (working copy) @@ -0,0 +1,19 @@ +----------------------------------- +-- Area: Carpenters' Landing +-- Mob: Mycophile +----------------------------------- + +----------------------------------- +-- OnMobSpawn Action +----------------------------------- + +function onMobSpawn(mob) +end; + +----------------------------------- +-- OnMobDeath Action +----------------------------------- + +function onMobDeath(mob,killer) + GetNPCByID(16785726):hideNPC(900); +end; \ No newline at end of file Index: zones/Carpenters_Landing/mobs/Orctrap.lua =================================================================== --- zones/Carpenters_Landing/mobs/Orctrap.lua (revision 0) +++ zones/Carpenters_Landing/mobs/Orctrap.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------- +-- Area: Carpenters' Landing +-- Mob: Orctrap (NM) +-- @pos 180.087 -5.484 -532.799 2 +----------------------------------- + +require("/scripts/zones/Carpenters_Landing/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Set Orctrap's ToD + SetServerVariable("[POP]Orctrap", os.time(t) + (math.random((3600),(25200))); -- 1-7 hours + DeterMob(mob:getID(), true); + + -- Set PH back to normal, then set to respawn spawn + PH = GetServerVariable("[PH]Orctrap"); + SetServerVariable("[PH]Orctrap", 0); + DeterMob(PH, false); + GetMobByID(PH):setRespawnTime(GetMobRespawnTime(PH)); + +end; \ No newline at end of file Index: zones/Carpenters_Landing/mobs/Tempest_Tigon.lua =================================================================== --- zones/Carpenters_Landing/mobs/Tempest_Tigon.lua (revision 0) +++ zones/Carpenters_Landing/mobs/Tempest_Tigon.lua (working copy) @@ -0,0 +1,17 @@ +----------------------------------- +-- Area: Batallia Downs (105) +-- Mob: Carpenters Landing +----------------------------------- + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Set Tempest Tigon's spawnpoint and respawn time (1-2 hours) + UpdateNMSpawnPoint(mob:getID()); + mob:setRespawnTime(math.random((3600),(7200))); + +end; + Index: zones/Carpenters_Landing/npcs/qm1.lua =================================================================== --- zones/Carpenters_Landing/npcs/qm1.lua (revision 0) +++ zones/Carpenters_Landing/npcs/qm1.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------- +-- Area: Carpenters' Landing +-- NPC: ??? (qm1) +-- Note: Used to spawn Mycophile NM +-- @pos 145.500 -9.000 -699.000 2 +----------------------------------- +package.loaded["scripts/zones/Carpenters_Landing/TextIDs"] = nil; +----------------------------------- + +----------------------------------- +-- onTrade Action +----------------------------------- + +function onTrade(player,npc,trade) + + -- Trade Sleepshroom, Woozyshroom, Danceshroom, + if(GetMobAction(16785722) == 0 and trade:hasItemQty(4373,1) and trade:hasItemQty(4374,1) and trade:hasItemQty(4375,1) and trade:getItemCount() == 3) then + player:tradeComplete(); + SpawnMob(16785722,300):updateEnmity(player); -- Mycophile + end + + +end; + + Index: zones/Dragons_Aery/mobs/Fafnir.lua =================================================================== --- zones/Dragons_Aery/mobs/Fafnir.lua (revision 4031) +++ zones/Dragons_Aery/mobs/Fafnir.lua (working copy) @@ -13,28 +13,8 @@ function onMobInitialize(mob) end; ------------------------------------ --- onMobEngaged Action ------------------------------------ -function onMobEngaged(mob,target) - Fafnir_Engaged = os.time(t); -end; - ----------------------------------- --- onMobFight Action ------------------------------------ - -function onMobFight(mob,target) - - if (mob:getBattleTime() % 60 == 0) then -- Check every minute to reduce load - if(os.time(t) >= (Fafnir_Engaged + 3600)) then - mob:rageMode(); -- Stats = Stats * 10 - end - end -end; - ------------------------------------ -- onMobDeath ----------------------------------- Index: zones/Dragons_Aery/mobs/Nidhogg.lua =================================================================== --- zones/Dragons_Aery/mobs/Nidhogg.lua (revision 4031) +++ zones/Dragons_Aery/mobs/Nidhogg.lua (working copy) @@ -14,28 +14,6 @@ end; ----------------------------------- --- onMobEngaged Action ------------------------------------ - -function onMobEngaged(mob,target) - Nidhogg_Engaged = os.time(t); -end; - ------------------------------------ --- onMobFight Action ------------------------------------ - -function onMobFight(mob,target) - - if (mob:getBattleTime() % 60 == 0) then -- Check every minute to reduce load - if(os.time(t) >= (Nidhogg_Engaged + 3600)) then - mob:rageMode(); -- Stats = Stats * 10 - end - end - -end; - ------------------------------------ -- onMobDeath ----------------------------------- Index: zones/FeiYin/mobs/Capricious_Cassie.lua =================================================================== --- zones/FeiYin/mobs/Capricious_Cassie.lua (revision 4031) +++ zones/FeiYin/mobs/Capricious_Cassie.lua (working copy) @@ -13,18 +13,6 @@ end; ----------------------------------- --- onMobFight Action ------------------------------------ - -function onMobFight(mob,target) - - if(mob:getBattleTime() == 1800) then - mob:rageMode(); - end - -end; - ------------------------------------ -- onMobDeath ----------------------------------- Index: zones/Garlaige_Citadel/mobs/Serket.lua =================================================================== --- zones/Garlaige_Citadel/mobs/Serket.lua (revision 4031) +++ zones/Garlaige_Citadel/mobs/Serket.lua (working copy) @@ -10,22 +10,9 @@ ----------------------------------- function OnMobSpawn(mob) - end; ----------------------------------- --- onMobFight Action ------------------------------------ - -function onMobFight(mob,target) - - if(mob:getBattleTime() == 1800) then - mob:rageMode(); - end - -end; - ------------------------------------ -- onMobDeath ----------------------------------- Index: zones/Jugner_Forest/mobs/King_Arthro.lua =================================================================== --- zones/Jugner_Forest/mobs/King_Arthro.lua (revision 4031) +++ zones/Jugner_Forest/mobs/King_Arthro.lua (working copy) @@ -6,18 +6,6 @@ require("scripts/globals/titles"); ----------------------------------- --- onMobFight Action ------------------------------------ - -function onMobFight(mob,target) - - if(mob:getBattleTime() == 1200) then - mob:rageMode(); - end - -end; - ------------------------------------ -- onMonsterMagicPrepare ----------------------------------- Index: zones/Korroloka_Tunnel/mobs/Morion_Worm.lua =================================================================== --- zones/Korroloka_Tunnel/mobs/Morion_Worm.lua (revision 0) +++ zones/Korroloka_Tunnel/mobs/Morion_Worm.lua (working copy) @@ -0,0 +1,29 @@ +----------------------------------- +-- Area: Korroloka Tunnel (173) +-- Mob: Morion Worm +----------------------------------- + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + local npc = GetNPCByID(17486213); + + npc:hideNPC(900); + + randpos = math.random(1,6); + + switch (randpos): caseof + { + [1] = function (x) npc:setPos(254.652,-6.039,20.878); end, + [2] = function (x) npc:setPos(273.350,-7.567,95.349); end, + [3] = function (x) npc:setPos(-43.004,-5.579,96.528); end, + [4] = function (x) npc:setPos(-96.798,-5.679,94.728); end, + [5] = function (x) npc:setPos(-373.924,-10.548,-27.850); end, + [6] = function (x) npc:setPos(-376.787,-8.574,-54.842); end, + } + +end; + Index: zones/Korroloka_Tunnel/npcs/qm1.lua =================================================================== --- zones/Korroloka_Tunnel/npcs/qm1.lua (revision 0) +++ zones/Korroloka_Tunnel/npcs/qm1.lua (working copy) @@ -0,0 +1,48 @@ +----------------------------------- +-- Area: Korroloka Tunnel +-- NPC: ??? (qm1) - Morion Worm spawn +-- @pos 254.652 -6.039 20.878 173 +----------------------------------- +package.loaded["scripts/zones/Korroloka_Tunnel/TextIDs"] = nil; +----------------------------------- + +require("scripts/zones/Korroloka_Tunnel/TextIDs"); + +----------------------------------- +-- onSpawn Action +----------------------------------- + +function onSpawn(npc) +end; + +----------------------------------- +-- onTrade Action +----------------------------------- + +----------------------------------- +-- onTrade Action +----------------------------------- + +function onTrade(player,npc,trade) + +local x = npc:getXPos(); +local y = npc:getYPos(); +local z = npc:getZPos(); +local mob = GetMobByID(17486190); + + -- Trade Darksteel ore + if(GetMobAction(17486190) == 0 and trade:hasItemQty(643,1) and trade:getItemCount() == 1) then + player:tradeComplete(); + SpawnMob(17486190,1800):updateEnmity(player); -- Morion Worm + mob:setPos(x+1,y,z); + end + + +end; + +----------------------------------- +-- onTrigger Action +----------------------------------- + +function onTrigger(player,npc) +end; \ No newline at end of file Index: zones/Kuftal_Tunnel/mobs/Cancer.lua =================================================================== --- zones/Kuftal_Tunnel/mobs/Cancer.lua (revision 4031) +++ zones/Kuftal_Tunnel/mobs/Cancer.lua (working copy) @@ -1,6 +1,6 @@ ----------------------------------- -- Area: Kuftal Tunnel --- NM: Cancer +-- NM: Cancer ----------------------------------- ----------------------------------- @@ -15,4 +15,7 @@ ----------------------------------- function onMobDeath(mob,killer) + +GetNPCByID(17490251):hideNPC(900); + end; \ No newline at end of file Index: zones/Kuftal_Tunnel/mobs/Phantom_Worm.lua =================================================================== --- zones/Kuftal_Tunnel/mobs/Phantom_Worm.lua (revision 4031) +++ zones/Kuftal_Tunnel/mobs/Phantom_Worm.lua (working copy) @@ -1,18 +1,39 @@ ----------------------------------- --- Area: Kuftal Tunnel --- NM: Phantom Worm +-- Area: Kuftal Tunnel (173) +-- Mob: Phantom Worm ----------------------------------- ----------------------------------- --- OnMobSpawn Action +-- onMobDeath ----------------------------------- -function onMobSpawn(mob) -end; +function onMobDeath(mob,killer) ------------------------------------ --- OnMobDeath Action ------------------------------------ + local npc = GetNPCByID(17490250); + + npc:hideNPC(900); + + randpos = math.random(1,16); + + switch (randpos): caseof + { + [1] = function (x) npc:setPos(75.943,29.969,118.854); end, + [2] = function (x) npc:setPos(75.758,30.000,125.815); end, + [3] = function (x) npc:setPos(65.222,29.364,131.645); end, + [4] = function (x) npc:setPos(53.088,25.033,138.725); end, + [5] = function (x) npc:setPos(85.658,30.155,123.941); end, + [6] = function (x) npc:setPos(91.153,30.146,113.657); end, + [7] = function (x) npc:setPos(86.549,29.875,107.232); end, + [8] = function (x) npc:setPos(94.763,29.054,105.138); end, + [9] = function (x) npc:setPos(102.719,26.751,102.816); end, + [10] = function (x) npc:setPos(71.571,30.241,110.704); end, + [11] = function (x) npc:setPos(65.642,28.018,99.2442); end, + [12] = function (x) npc:setPos(62.090,25.421,93.4702); end, + [13] = function (x) npc:setPos(60.740,22.638,86.1781); end, + [14] = function (x) npc:setPos(80.460,30.293,112.721); end, + [15] = function (x) npc:setPos(76.929,30.050,127.630); end, + [16] = function (x) npc:setPos(68.810,30.175,123.516); end, + } + +end; -function onMobDeath(mob,killer) -end; \ No newline at end of file Index: zones/Kuftal_Tunnel/mobs/Robber_Crab.lua =================================================================== --- zones/Kuftal_Tunnel/mobs/Robber_Crab.lua (revision 0) +++ zones/Kuftal_Tunnel/mobs/Robber_Crab.lua (working copy) @@ -0,0 +1,24 @@ +----------------------------------- +-- Area: Kuftal Tunnel +-- Mob: Robber Crab +----------------------------------- + +----------------------------------- +-- OnMobSpawn Action +----------------------------------- + +function onMobSpawn(mob) +end; + +----------------------------------- +-- OnMobDeath Action +----------------------------------- + +function onMobDeath(mob,killer) + + mobID = mob:getID(); + + if(mobID == 17490232) then -- Crab for Cancer spawn + GetNPCByID(17490251):hideNPC(900); + +end; Index: zones/Kuftal_Tunnel/npcs/qm1.lua =================================================================== --- zones/Kuftal_Tunnel/npcs/qm1.lua (revision 0) +++ zones/Kuftal_Tunnel/npcs/qm1.lua (working copy) @@ -0,0 +1,45 @@ +----------------------------------- +-- Area: Kuftal Tunnel +-- NPC: ??? (qm1) +-- Note: Used to spawn Phantom Worm +-- @pos 75.943 29.916 118.854 174 +----------------------------------- +package.loaded["scripts/zones/Kuftal_Tunnel/TextIDs"] = nil; +----------------------------------- + +require("scripts/zones/Kuftal_Tunnel/TextIDs"); + +----------------------------------- +-- onSpawn Action +----------------------------------- + +function onSpawn(npc) +end; + +----------------------------------- +-- onTrade Action +----------------------------------- + +function onTrade(player,npc,trade) + +local x = npc:getXPos(); +local y = npc:getYPos(); +local z = npc:getZPos(); +local mob = GetMobByID(17490233); + + -- Trade Darksteel ore + if(GetMobAction(17490233) == 0 and trade:hasItemQty(645,1) and trade:getItemCount() == 1) then + player:tradeComplete(); + SpawnMob(17490233,180):updateEnmity(player); -- Phantom Worm + mob:setPos(x+1,y,z); + end + + +end; + +----------------------------------- +-- onTrigger Action +----------------------------------- + +function onTrigger(player,npc) +end; \ No newline at end of file Index: zones/Kuftal_Tunnel/npcs/qm2.lua =================================================================== --- zones/Kuftal_Tunnel/npcs/qm2.lua (revision 0) +++ zones/Kuftal_Tunnel/npcs/qm2.lua (working copy) @@ -0,0 +1,35 @@ +----------------------------------- +-- Area: Kuftal Tunnel +-- NPC: ??? (qm2) +-- Note: Used to spawn Cancer +-- @pos -25.238 -12.785 -148.393 174 +----------------------------------- +package.loaded["scripts/zones/Kuftal_Tunnel/TextIDs"] = nil; +----------------------------------- + +require("scripts/zones/Kuftal_Tunnel/TextIDs"); + +----------------------------------- +-- onTrade Action +----------------------------------- + +function onTrade(player,npc,trade) + + + -- Trade quus + if(GetMobAction(17490231) == 0 and GetMobAction(17490232) == 0 and trade:hasItemQty(4514,1) and trade:getItemCount() == 1) then + player:tradeComplete(); + if(math.random((1),(14)) <= 13) then + SpawnMob(17490232,180) -- Robber Crab + else + SpawnMob(17490231,180) -- Cancer about 7% chance to pop per trade + end + end +end; + +----------------------------------- +-- onTrigger Action +----------------------------------- + +function onTrigger(player,npc) +end; \ No newline at end of file Index: zones/Labyrinth_of_Onzozo/mobs/Flying_Manta.lua =================================================================== --- zones/Labyrinth_of_Onzozo/mobs/Flying_Manta.lua (revision 4031) +++ zones/Labyrinth_of_Onzozo/mobs/Flying_Manta.lua (working copy) @@ -28,7 +28,7 @@ ToD = GetServerVariable("[POP]Peg_Powler"); if (ToD <= os.time(t) and GetMobAction(Peg_Powler) == 0) then - if (math.random((1),(25)) >= 5) then + if (math.random((1),(25)) == 5) then UpdateNMSpawnPoint(Peg_Powler); GetMobByID(Peg_Powler):setRespawnTime(GetMobRespawnTime(mob)); SetServerVariable("[PH]Peg_Powler", mob); Index: zones/Labyrinth_of_Onzozo/mobs/Lord_of_Onzozo.lua =================================================================== --- zones/Labyrinth_of_Onzozo/mobs/Lord_of_Onzozo.lua (revision 4031) +++ zones/Labyrinth_of_Onzozo/mobs/Lord_of_Onzozo.lua (working copy) @@ -1,20 +1,9 @@ ---------------------------------- -- Area: Labyrinth of Onzozo --- NM: Lord of Onzozo +-- NM: Lord of Onzozo ----------------------------------- ------------------------------------ --- onMobFight Action ------------------------------------ -function onMobFight(mob,target) - - if(mob:getBattleTime() == 1200) then - mob:rageMode(); - end - -end; - ----------------------------------- -- onMobDeath ----------------------------------- Index: zones/Lower_Jeuno/npcs/Akamafula.lua =================================================================== --- zones/Lower_Jeuno/npcs/Akamafula.lua (revision 4032) +++ zones/Lower_Jeuno/npcs/Akamafula.lua (working copy) @@ -29,7 +29,7 @@ player:showText(npc, AKAMAFULA_SHOP_DIALOG); end else - player:startEvent(0x0096); + -- player:startEvent(0x0096); end end; Index: zones/Lower_Jeuno/npcs/Amalasanda.lua =================================================================== --- zones/Lower_Jeuno/npcs/Amalasanda.lua (revision 4032) +++ zones/Lower_Jeuno/npcs/Amalasanda.lua (working copy) @@ -29,7 +29,7 @@ player:showText(npc, AMALASANDA_SHOP_DIALOG); end else - player:startEvent(0x0096); + -- player:startEvent(0x0096); end end; Index: zones/Mount_Zhayolm/MobIDs.lua =================================================================== --- zones/Mount_Zhayolm/MobIDs.lua (revision 0) +++ zones/Mount_Zhayolm/MobIDs.lua (working copy) @@ -0,0 +1,12 @@ +----------------------------------- +-- Area: Mount Zhayolm +-- Comments: -- posX, posY, posZ +--(Taken from 'mob_spawn_points' table) +----------------------------------- + +-- Energetic Eruca +Energetic_Eruca=17027466; +Energetic_Eruca_PH={ + [17027146] = '1', -- 175.315 -14.444 -173.589 + [17027145] = '1', -- 181.601 -14.120 -166.218 +}; Index: zones/Mount_Zhayolm/mobs/Cerberus.lua =================================================================== --- zones/Mount_Zhayolm/mobs/Cerberus.lua (revision 4031) +++ zones/Mount_Zhayolm/mobs/Cerberus.lua (working copy) @@ -18,4 +18,5 @@ function onMobDeath(mob, killer) killer:addTitle(CERBERUS_MUZZLER); + mob:setRespawnTime(math.random((172800),(259200))); -- 48-72 hours end; \ No newline at end of file Index: zones/Mount_Zhayolm/mobs/Energetic_Eruca.lua =================================================================== --- zones/Mount_Zhayolm/mobs/Energetic_Eruca.lua (revision 0) +++ zones/Mount_Zhayolm/mobs/Energetic_Eruca.lua (working copy) @@ -0,0 +1,25 @@ +----------------------------------- +-- Area: Mount Zhayolm +-- NM: Energetic Eruca +-- @pos 176.743 -14.210 -180.926 61 +----------------------------------- + +require("/scripts/zones/Mount_Zhayolm/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Set EnE's ToD + SetServerVariable("[POP]Energetic_Eruca", os.time(t) + 86400); -- 24 hours + DeterMob(mob:getID(), true); + + -- Set PH back to normal, then set to respawn spawn + PH = GetServerVariable("[PH]Energetic_Eruca"); + SetServerVariable("[PH]Energetic_Eruca", 0); + DeterMob(PH, false); + GetMobByID(PH):setRespawnTime(GetMobRespawnTime(PH)); + +end; Index: zones/Mount_Zhayolm/mobs/Magmatic_Eruca.lua =================================================================== --- zones/Mount_Zhayolm/mobs/Magmatic_Eruca.lua (revision 0) +++ zones/Mount_Zhayolm/mobs/Magmatic_Eruca.lua (working copy) @@ -0,0 +1,39 @@ +----------------------------------- +-- Area: Mount Zhayolm +-- NPC: Magmatic Eruca +-- Note: Place Holder Energetic Eruca +----------------------------------- + +require("/scripts/zones/Mount_Zhayolm/MobIDs"); + +----------------------------------- +-- onMobDeath +----------------------------------- + +function onMobDeath(mob,killer) + + -- Get Magmatic Eruca ID and check if it is a PH of EE + mob = mob:getID(); + + -- Check if Magmatic Eruca is within the Magmatic_Eruca_PH table + if (Energetic_Eruca_PH[mob] ~= nil) then + -- printf("%u is a PH",mob); + -- Get EnE's previous ToD + EnE_ToD = GetServerVariable("[POP]Energetic_Eruca"); + + -- Check if EnE window is open, and there is not an EnE popped already(ACTION_NONE = 0) + if (EnE_ToD <= os.time(t) and GetMobAction(Energetic_Eruca) == 0) then + + -- printf("EnE window open"); + -- Give Magmatic Eruca 10 percent chance to pop EnE + if (math.random(1,10) >= 1) then + -- printf("EnE will pop"); + UpdateNMSpawnPoint(Energetic_Eruca); + GetMobByID(Energetic_Eruca):setRespawnTime(GetMobRespawnTime(mob)); + SetServerVariable("[PH]Energetic_Eruca", mob); + DeterMob(mob, true); + end + end + end + +end; Index: zones/Port_Bastok/npcs/Silver_Owl.lua =================================================================== --- zones/Port_Bastok/npcs/Silver_Owl.lua (revision 4032) +++ zones/Port_Bastok/npcs/Silver_Owl.lua (working copy) @@ -29,7 +29,7 @@ player:showText(npc,TENSHODO_SHOP_OPEN_DIALOG); end else - player:startEvent(0x0096); + -- player:startEvent(0x0096); end end; Index: zones/Rolanberry_Fields/mobs/Simurgh.lua =================================================================== --- zones/Rolanberry_Fields/mobs/Simurgh.lua (revision 4031) +++ zones/Rolanberry_Fields/mobs/Simurgh.lua (working copy) @@ -10,7 +10,6 @@ ----------------------------------- function OnMobSpawn(mob) - end; ----------------------------------- @@ -18,13 +17,9 @@ ----------------------------------- function onMobFight(mob,target) +end; - if(mob:getBattleTime() == 1200) then - mob:rageMode(); - end -end; - ----------------------------------- -- onMobDeath ----------------------------------- Index: zones/Sauromugue_Champaign/mobs/Roc.lua =================================================================== --- zones/Sauromugue_Champaign/mobs/Roc.lua (revision 4031) +++ zones/Sauromugue_Champaign/mobs/Roc.lua (working copy) @@ -10,11 +10,6 @@ ----------------------------------- function onMobFight(mob,target) - - if(mob:getBattleTime() == 1200) then - mob:rageMode(); - end - end; ----------------------------------- Index: zones/Valley_of_Sorrows/mobs/Adamantoise.lua =================================================================== --- zones/Valley_of_Sorrows/mobs/Adamantoise.lua (revision 4031) +++ zones/Valley_of_Sorrows/mobs/Adamantoise.lua (working copy) @@ -14,28 +14,6 @@ end; ----------------------------------- --- onMobEngaged Action ------------------------------------ - -function onMobEngaged(mob,target) - Adamantoise_Engaged = os.time(t); -end; - ------------------------------------ --- onMobFight Action ------------------------------------ - -function onMobFight(mob,target) - - if (mob:getBattleTime() % 60 == 0) then -- Check every minute to reduce load - if(os.time(t) >= (Adamantoise_Engaged + 1800)) then - mob:rageMode(); -- Stats = Stats * 10 - end - end - -end; - ------------------------------------ -- onMobDeath ----------------------------------- Index: zones/Valley_of_Sorrows/mobs/Aspidochelone.lua =================================================================== --- zones/Valley_of_Sorrows/mobs/Aspidochelone.lua (revision 4031) +++ zones/Valley_of_Sorrows/mobs/Aspidochelone.lua (working copy) @@ -14,28 +14,6 @@ end; ----------------------------------- --- onMobEngaged Action ------------------------------------ - -function onMobEngaged(mob,target) - Aspid_Engaged = os.time(t); -end; - ------------------------------------ --- onMobFight Action ------------------------------------ - -function onMobFight(mob,target) - - if (mob:getBattleTime() % 60 == 0) then -- Check every minute to reduce load - if(os.time(t) >= (Aspid_Engaged + 3600)) then - mob:rageMode(); -- Stats = Stats * 10 - end - end - -end; - ------------------------------------ -- onMobDeath -----------------------------------