Рейтинг темы:
  • 1 Голос(ов) - 5 в среднем
  • 1
  • 2
  • 3
  • 4
  • 5
Полезные sql запросы
#41
брал за пример вот это
UPDATE `raidboss_spawnlist` SET `respawn_min_delay` = '3600';
UPDATE `raidboss_spawnlist` SET `respawn_max_delay` = '7200';
тут в кавычках ))
без кавычек таже ошибка....
Ответ
#42
У тебя 2 раза прописан set,что я думаю недопустимо. Если плясать от этого, пробуй вот так вот:
Код:
UPDATE `spawnlist` SET `respawn_delay` = '60' where `npc_templateid`='21207';
Работоспособность не гарантирую, ибо сам учусь...
Ответ
#43
insert into droplist (mobId, itemid,min,max, chance) select id, 55555,'1','3', 100000 from npc where level > 40;

55555 - ид вещи которую хочешь добавить

1 - количество
3 - макс количество
100000 - шанс

А какой запрос на удаление 1 вещи?
Ответ
#44
Напишите плз запрос чтоб дать определённому чару итем заточенный на +5.
И точно такой же только не дать, а удалить .
Заранее спасибо Smile

Добавлено через 11 часов 26 минут
ну что, ктонить поможет с запросами, выручайте плз..

Добавлено через 21 час 53 минуты
апаю, ребят выручайте)
Ответ
#45
помогите с sql запросом на добавление определенного итема всем персонажам?
заранее спасибо.
Ответ
#46
вопрос актуален
Ответ
#47
Кто напомнит ветку, где был скрипт на чистку базы от устаревших аккаунтов, персов и всего, что с ними связано? Какой день пытаюсь найти, но поиск не помогает. Sad
Ответ
#48
а как сделать чтоб каждый новый перс был сразу нублесом?
Ответ
#49
Код:
#select round(avg(`hp`)) from npc where type = "L2Monster" and level <= 80 and hp <> 2444 group by `level`;

update npc set pdef = 0.066 * level * level + 1.2129 * level + 40.586  where type in ("L2Monster", "L2Minion");
update npc set mdef = 0.0549 * level * level + 1.1337 * level + 31.743  where type in ("L2Monster", "L2Minion");
update npc set patk = 0.00001 * level * level * level * level + 0.003 * level * level * level + 0.01 * level * level + 1.2 * level + 8 where type in ("L2Monster", "L2Minion");
update npc set matk = 0.0026 * level * level * level - 0.0248 * level * level + 0.1133 * level + 6.4115 where type in ("L2Monster", "L2Minion");
update npc set hp = 0.0164 * level * level * level - 0.0001 * level * level * level * level - 0.0524 * level * level + 20.905 * level + 33.974 where type in ("L2Monster", "L2Minion");

update npc set pdef = pdef * 4 where type = "L2Minion" and id in (select minion_id from minions where boss_id in (select id from npc_copy where type = "L2RaidBoss"));
update npc set mdef = mdef * 4 where type = "L2Minion" and id in (select minion_id from minions where boss_id in (select id from npc_copy where type = "L2RaidBoss"));
update npc set patk = patk * 4 where type = "L2Minion" and id in (select minion_id from minions where boss_id in (select id from npc_copy where type = "L2RaidBoss"));
update npc set matk = matk * 4 where type = "L2Minion" and id in (select minion_id from minions where boss_id in (select id from npc_copy where type = "L2RaidBoss"));

update npc set hp = hp * 4 where type = "L2Minion" and id in (select minion_id from minions where boss_id in (select id from npc_copy where type = "L2RaidBoss"));

update npc set pdef = 4 * (0.066 * level * level + 1.2129 * level + 40.586)  where type = "L2RaidBoss";
update npc set mdef = 4 * (0.0549 * level * level + 1.1337 * level + 31.743)  where type = "L2RaidBoss";

update npc set pdef = 4 * (0.066 * level * level + 1.2129 * level + 40.586)  where type = "L2SiegeBoss";
update npc set mdef = 4 * (0.0549 * level * level + 1.1337 * level + 31.743)  where type = "L2SiegeBoss";
update npc set patk = 4 * (0.00001 * level * level * level * level + 0.003 * level * level * level + 0.01 * level * level + 1.2 * level + 8) where type = "L2SiegeBoss";
update npc set matk = 4 * (0.0026 * level * level * level - 0.0248 * level * level + 0.1133 * level + 6.4115) where type = "L2SiegeBoss";

update npc set pdef = 4 * (0.066 * level * level + 1.2129 * level + 40.586)  where type = "L2ReflectionBoss";
update npc set mdef = 4 * (0.0549 * level * level + 1.1337 * level + 31.743)  where type = "L2ReflectionBoss";
update npc set patk = (0.00001 * level * level * level * level + 0.003 * level * level * level + 0.01 * level * level + 1.2 * level + 8) where type = "L2ReflectionBoss";
update npc set matk = (0.0026 * level * level * level - 0.0248 * level * level + 0.1133 * level + 6.4115) where type = "L2ReflectionBoss";

-- Дефолтные параметры

update npc set `sex` = 'male' where `sex` = '';
update npc set `type` = 'L2Npc' where `type` = '';
update npc set `ai_type` = 'npc' where `ai_type` = '';

update npc set `attackrange` = 40 where `attackrange` = 0;
update npc set `hp` = 2444 where `hp` = 0;
update npc set `mp` = 2444 where `mp` = 0;

update npc set `base_hp_regen` = 7.500 where `base_hp_regen` = 0;
update npc set `base_mp_regen` = 2.700 where `base_mp_regen` = 0;

update npc set `str` = 40 where `str` = 0;
update npc set `con` = 30 where `con` = 0;
update npc set `dex` = 30 where `dex` = 0;
update npc set `int` = 21 where `int` = 0;
update npc set `wit` = 20 where `wit` = 0;
update npc set `men` = 20 where `men` = 0;

update npc set `patk` = 500 where `patk` = 0;
update npc set `pdef` = 500 where `pdef` = 0;
update npc set `matk` = 500 where `matk` = 0;
update npc set `mdef` = 500 where `mdef` = 0;

update npc set `atkspd` = 253 where `atkspd` = 0;
update npc set `matkspd` = 500 where `matkspd` = 0;
update npc set `walkspd` = 80 where `walkspd` = 0;
update npc set `runspd` = 120 where `runspd` = 0;

update npc set `corpse_time` = 7 where `corpse_time` = 0;
update npc set `base_rand_dam` = 30 where `base_rand_dam` = 0;
update npc set `base_critical` = 4 where `base_critical` = 0;
update npc set `physical_hit_modify` = 4 where `physical_hit_modify` = 0;
update npc set `hit_time_factor` = 0.6 where `hit_time_factor` = 0;

update npc set con=30, men=20 where type not in (
"L2SpecialMonster",
"L2RaidBoss",
"QueenAnt",
"QueenAntLarva",
"L2Boss",
"Orfen",
"Antharas",
"L2ReflectionBoss",
"L2SiegeBoss",
"L2Commander"
"L2Pet",
);

update npc set
    runspd = (select runspd from npc2 where id = npc.id)
where
(
    runspd = '' or
    runspd is null or
    #runspd = 'NULL' or
    runspd = 0
)
and id not in
(
    select id from npc2 where
        runspd = '' or
        runspd is null or
        #runspd = 'NULL' or
        runspd = 0
);

Для импорта мобовских скиллов от SF:

select distinct skillid, count(skillid) as count from npcskills_sf where
npcid not in (select id from npc where type in ("L2Npc", "L2Pet")) and
skillid not in (select id from skills where operate_type = 12 or operate_type = 13) and
skillid not in (select skillid from npcskills where npcid = npcskills_sf.npcid) and
skillid not in (4578)
group by skillid order by count desc

insert into npcskills (select * from npcskills_sf where
npcid not in (select id from npc where type in ("L2Npc", "L2Pet")) and
skillid not in (select id from skills where operate_type = 12 or operate_type = 13) and
skillid not in (select skillid from npcskills where npcid = npcskills_sf.npcid) and
skillid not in (4578))

исключения из общих правил:

"L2SpecialMonster",
"L2RaidBoss",
"QueenAnt",
"QueenAntLarva",
"L2Boss",
"Orfen",
"Antharas",
"L2ReflectionBoss",
"L2SiegeBoss",
"L2Commander",
"L2Pet"
Ответ
#50
Имеется скрипт следующего вида:
Код:
DELETE FROM characters WHERE lastAccess < 1254286800;
DELETE FROM accounts WHERE lastactive < 1254286800;
Как подсчитать необходимое значение поля lastactive?
По описанию это какой-то UNIX формат времени.
Пользовался сайтом http://www.unixtimestamp.com/index.php , но там выдает число на несколько порядков меньше, чем записаны в таблице, в результате базу почистить так и не удается.
Сервер работает под L2JServer.
Ответ


Возможно похожие темы ...
Тема Автор Ответы Просмотры Последний пост
  [PTS] Полезные Sql запросы Cache 0 4,309 01-19-2016, 12:32 PM
Последний пост: Cache

Перейти к форуму:


Пользователи, просматривающие эту тему: