mob % reduciton[SOLVED]

For any problems with Dawn of Light website or game server, please direct questions and problems here.

Moderator: Support Team

mob % reduciton[SOLVED]

Postby Loki » Mon Nov 14, 2016 7:02 pm

Hello, could somebody correct my query please?

I am trying to reduce the mob level in a given region by 60% using the following :-
Code: Select all
UPDATE `mob` SET Level = round(x*.4,0) WHERE 'Region' = 'said region';
Thank you
Last edited by Loki on Sun Dec 11, 2016 7:44 pm, edited 1 time in total.
“ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ”

Join https://discord.gg/r3T2U7S Official DOL Discord Chat
User avatar
Loki
Developer
 
Posts: 468
Joined: Fri Jun 23, 2006 2:14 am
Location: uk

Re: mob % reduciton

Postby Loki » Mon Nov 14, 2016 7:46 pm

UPDATE mob SET `Level` = round(`Level` * .4,0) WHERE Region = 'said region';
“ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ”

Join https://discord.gg/r3T2U7S Official DOL Discord Chat
User avatar
Loki
Developer
 
Posts: 468
Joined: Fri Jun 23, 2006 2:14 am
Location: uk

Re: mob % reduciton

Postby LugusSkye » Tue Nov 15, 2016 12:46 pm

This will update whole region the way you wanted. However, keep in mind, region could be just one zone such as 'Coruscating Mine' or a battleground but region can also encompass multiple zones example: region 1 in Albion is 'Camelot Hills', 'Salisbury Plains' and so on. If you want query to update a specific zone instead of whole region - it will cost you at least an introduction to your server :)

Here is the query for whole region update:

UPDATE mob m, zones z
SET m.Level = round(m.Level * .4,0)
WHERE m.region = z.regionid
and z.name = 'Braemar';

Good luck!
User avatar
LugusSkye
DOL Initiate
 
Posts: 20
Joined: Fri Sep 09, 2016 4:05 am

Re: mob % reduciton

Postby Leodagan » Wed Nov 16, 2016 7:00 am

Lugus

You can't select mob by zone with this simple query...

you're just linking mob table to zone table using a common regionid, as long as the zone exists all mob in the region will still be updated with your query ;)

You need at least some X, Y boundaries compared to mob position to achieve a zone update, this can be done using a "VIEW" for example...
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: mob % reduciton

Postby LugusSkye » Wed Nov 16, 2016 11:04 pm

yep, that's why i said that it will only work for unique region to zone combinations.
for regions with multiple zones here is the query:

select distinct m.Name
, m.Level
, z.Name
from mob m
inner join zones z
on m.x - (8192 * z.offsetx) between 0 and 66000
and m.y - (8192 * z.offsety) between 0 and 66000
where z.name = 'Odin''s Gate';
Lugus

You can't select mob by zone with this simple query...

you're just linking mob table to zone table using a common regionid, as long as the zone exists all mob in the region will still be updated with your query ;)

You need at least some X, Y boundaries compared to mob position to achieve a zone update, this can be done using a "VIEW" for example...
User avatar
LugusSkye
DOL Initiate
 
Posts: 20
Joined: Fri Sep 09, 2016 4:05 am

Re: mob % reduciton

Postby Leodagan » Thu Nov 17, 2016 6:44 am

I must have read your previous post too quickly ;)

But this other query looks pretty fine and elegant for a real "Zone Update" :D

Just one thing : you're not filtering on region id this time... All mobs in the table that match the given zone's coords would be updated :oops:

I didn't run any test but something like this should fix it ?
Code: Select all
// in the "ON" Clause AND M.RegionId = Z.RegionId
The thing is DOL use a 4D coords system, zones are virtual area that can be duplicated, you need a vector [X, Y, Z, Region] to pinpoint an area that can be handled by World Manager.
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon


Return to “%s” Support

Who is online

Users browsing this forum: No registered users and 1 guest