L2JMobius

C6 Custom drop list

Maestro · 7 · 5464

Offline Maestro

  • Heir
  • **
    • Posts: 15
Hi how i have some questions.

how can i add drop to all mobs at once? in custom drop list

How i can use config option like

# Only Adena, LifeStones, SealStones, Boss Jewels Drop Option
HighRateServerDrops = True

If I enable this option then the drop from the custom drop list table does not work. How i can fix it? or i need to delete all standart drop from db?


Online G-hamsteR

  • Viscount
  • *****
    • Posts: 332
Hello,

You can use MySQL queries to manage drops easily. For example, to remove all drops except adena, just run this query:

Code: [Select]
DELETE FROM droplist WHERE itemId != 57;
You can also use any programing language to fetch all npcs with type monster and insert into droplist for each one.


Offline Maestro

  • Heir
  • **
    • Posts: 15
Hello, yes, everything is clear with this, but there is no type l2monster in the table structure (droplist table). How can I make a similar request with the existing structure.

Code: [Select]
CREATE TABLE `droplist` (
  `mobId` INT NOT NULL DEFAULT '0',
  `itemId` INT NOT NULL DEFAULT '0',
  `min` INT NOT NULL DEFAULT '0',
  `max` INT NOT NULL DEFAULT '0',
  `category` INT NOT NULL DEFAULT '0',
  `chance` INT NOT NULL DEFAULT '0',
  PRIMARY KEY  (`mobId`,`itemId`,`category`),
  KEY `key_mobId` (`mobId`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;


Online G-hamsteR

  • Viscount
  • *****
    • Posts: 332
Tell me what you want to add and I will send you the SQL files. I can't help you learn MySQL and some other languages.


Offline Maestro

  • Heir
  • **
    • Posts: 15
Tell me what you want to add and I will send you the SQL files. I can't help you learn MySQL and some other languages.

For example, I would like to add to the drop all creatures except for RB and Epic 2 items according to the standard.

For example:
1. Silver drops from level 1 to 60 - id 4357
2. At level 60+, Gold drops - id 4356

If you help me with the first request, I can easily do the rest.


Online G-hamsteR

  • Viscount
  • *****
    • Posts: 332
I will try to explain. If you have xampp, create a file at C:\xampp\htdocs named drops.php.

Inside paste the following:

Code: [Select]
<?php
$db_host 
"localhost"
$db_username "root"
$db_pass ""
$db_name "l2jmobius"
$drop_category 2//Specify drop category

$mysqli = new mysqli($db_host$db_username$db_pass$db_name);


$query "select id, level from npc WHERE type = 'Monster'";

if (
$result $mysqli->query($query)) {
while ($row $result->fetch_assoc()) {
        
$item_id null;
$item_chance null;
$item_min null;
$item_max null;
        if(
$row['level'] == 1){
$item_id 4357;
$item_chance 700000//70% chacge
$item_min 1//min_drop
$item_max 1//max_drop
}
        elseif(
$row['level'] == 2){
$item_id 4357;
$item_chance 700000//70% chacge
$item_min 1//min_drop
$item_max 2//max_drop
}
        elseif(
$row['level'] == 3){
$item_id 4357;
$item_chance 700000//70% chacge
$item_min 1//min_drop
$item_max 2//max_drop
}
        elseif(
$row['level'] > && $row['level'] <= 10){
$item_id 4357;
$item_chance 700000//70% chacge
$item_min 5//min_drop
$item_max 12//max_drop
}


if($item_id){
echo 'INSERT INTO `custom_droplist` VALUES (\''.$row['id'].'\', \''.$item_id.'\', \''.$item_min.'\', \''.$item_max.'\', \''.$drop_category.'\', \''.$item_chance.'\');<br>';
}
    }
    
$result->free();
}
$mysqli->close();

Now open http://localhost/drops.php with your browser.

At drops.php change the lines 2-6 with your information.
From line 19 to line 42, I created a few examples. Just modify these to fit your needs.


Offline Maestro

  • Heir
  • **
    • Posts: 15
I will try to explain. If you have xampp, create a file at C:\xampp\htdocs named drops.php.

Inside paste the following:

Code: [Select]
<?php
$db_host 
"localhost"
$db_username "root"
$db_pass ""
$db_name "l2jmobius"
$drop_category 2//Specify drop category

$mysqli = new mysqli($db_host$db_username$db_pass$db_name);


$query "select id, level from npc WHERE type = 'Monster'";

if (
$result $mysqli->query($query)) {
while ($row $result->fetch_assoc()) {
        
$item_id null;
$item_chance null;
$item_min null;
$item_max null;
        if(
$row['level'] == 1){
$item_id 4357;
$item_chance 700000//70% chacge
$item_min 1//min_drop
$item_max 1//max_drop
}
        elseif(
$row['level'] == 2){
$item_id 4357;
$item_chance 700000//70% chacge
$item_min 1//min_drop
$item_max 2//max_drop
}
        elseif(
$row['level'] == 3){
$item_id 4357;
$item_chance 700000//70% chacge
$item_min 1//min_drop
$item_max 2//max_drop
}
        elseif(
$row['level'] > && $row['level'] <= 10){
$item_id 4357;
$item_chance 700000//70% chacge
$item_min 5//min_drop
$item_max 12//max_drop
}


if($item_id){
echo 'INSERT INTO `custom_droplist` VALUES (\''.$row['id'].'\', \''.$item_id.'\', \''.$item_min.'\', \''.$item_max.'\', \''.$drop_category.'\', \''.$item_chance.'\');<br>';
}
    }
    
$result->free();
}
$mysqli->close();

Now open http://localhost/drops.php with your browser.

At drops.php change the lines 2-6 with your information.
From line 19 to line 42, I created a few examples. Just modify these to fit your needs.

Thank you, I managed to do what I wanted with this script.