Update items and drops to use new attr syntax

This commit is contained in:
Sky Johnson 2024-07-02 13:18:13 -05:00
parent ee6938d9a5
commit b1b0868501

View File

@ -88,54 +88,53 @@ if ($step == 'second') {
'name TEXT NOT NULL',
'level INTEGER DEFAULT 1',
'type INTEGER DEFAULT 1',
"attr1 TEXT DEFAULT ''",
"attr2 TEXT DEFAULT ''"
"attr TEXT DEFAULT ''"
]);
// Add default drops if complete install
if ($complete) {
$db->insert([
['name' => 'Life Pebble', 'level' => 1, 'type' => 1, 'attr1' => 'hp,10', 'attr2' => '' ],
['name' => 'Life Stone', 'level' => 10, 'type' => 1, 'attr1' => 'hp,25', 'attr2' => '' ],
['name' => 'Life Rock', 'level' => 25, 'type' => 1, 'attr1' => 'hp,50', 'attr2' => '' ],
['name' => 'Life Ore', 'level' => 50, 'type' => 1, 'attr1' => 'hp,100', 'attr2' => '' ],
['name' => 'Life Gem', 'level' => 75, 'type' => 1, 'attr1' => 'hp,150', 'attr2' => '' ],
['name' => 'Magic Pebble', 'level' => 1, 'type' => 1, 'attr1' => 'mp,10', 'attr2' => '' ],
['name' => 'Magic Stone', 'level' => 10, 'type' => 1, 'attr1' => 'mp,25', 'attr2' => '' ],
['name' => 'Magic Rock', 'level' => 25, 'type' => 1, 'attr1' => 'mp,50', 'attr2' => '' ],
['name' => 'Magic Ore', 'level' => 50, 'type' => 1, 'attr1' => 'mp,100', 'attr2' => '' ],
['name' => 'Magic Gem', 'level' => 75, 'type' => 1, 'attr1' => 'mp,150', 'attr2' => '' ],
['name' => "Dragon's Scale", 'level' => 10, 'type' => 1, 'attr1' => 'def,25', 'attr2' => '' ],
['name' => "Dragon's Plate", 'level' => 30, 'type' => 1, 'attr1' => 'def,50', 'attr2' => '' ],
['name' => "Dragon's Claw", 'level' => 10, 'type' => 1, 'attr1' => 'atk,25', 'attr2' => '' ],
['name' => "Dragon's Fang", 'level' => 30, 'type' => 1, 'attr1' => 'atk,50', 'attr2' => '' ],
['name' => "Dragon's Tear", 'level' => 35, 'type' => 1, 'attr1' => 'str,75', 'attr2' => '' ],
['name' => "Dragon's Wing", 'level' => 35, 'type' => 1, 'attr1' => 'dex,75', 'attr2' => '' ],
['name' => "Demon's Sin", 'level' => 35, 'type' => 1, 'attr1' => 'hp,-50', 'attr2' => 'str,50' ],
['name' => "Demon's Fall", 'level' => 35, 'type' => 1, 'attr1' => 'mp,-50', 'attr2' => 'str,50' ],
['name' => "Demon's Lie", 'level' => 45, 'type' => 1, 'attr1' => 'hp,-100', 'attr2' => 'str,100' ],
['name' => "Demon's Hate", 'level' => 45, 'type' => 1, 'attr1' => 'mp,-100', 'attr2' => 'str,100' ],
['name' => "Angel's Joy", 'level' => 25, 'type' => 1, 'attr1' => 'hp,25', 'attr2' => 'str,25' ],
['name' => "Angel's Rise", 'level' => 30, 'type' => 1, 'attr1' => 'hp,50', 'attr2' => 'str,50' ],
['name' => "Angel's Truth", 'level' => 35, 'type' => 1, 'attr1' => 'hp,75', 'attr2' => 'str,75' ],
['name' => "Angel's Grace", 'level' => 40, 'type' => 1, 'attr1' => 'hp,100', 'attr2' => 'str,100' ],
['name' => "Seraph's Strength", 'level' => 25, 'type' => 1, 'attr1' => 'mp,25', 'attr2' => 'dex,25' ],
['name' => "Seraph's Power", 'level' => 30, 'type' => 1, 'attr1' => 'mp,50', 'attr2' => 'dex,50' ],
['name' => "Seraph's Justice", 'level' => 35, 'type' => 1, 'attr1' => 'mp,75', 'attr2' => 'dex,75' ],
['name' => "Seraph's Judgement", 'level' => 40, 'type' => 1, 'attr1' => 'mp,100', 'attr2' => 'dex,100' ],
['name' => 'Ruby', 'level' => 50, 'type' => 1, 'attr1' => 'hp,150', 'attr2' => '' ],
['name' => 'Sapphire', 'level' => 50, 'type' => 1, 'attr1' => 'mp,150', 'attr2' => '' ],
['name' => 'Emerald', 'level' => 50, 'type' => 1, 'attr1' => 'str,150', 'attr2' => '' ],
['name' => 'Amethyst', 'level' => 50, 'type' => 1, 'attr1' => 'dex,150', 'attr2' => '' ],
['name' => 'Topaz', 'level' => 50, 'type' => 1, 'attr1' => 'atk,150', 'attr2' => '' ],
['name' => 'Diamond', 'level' => 50, 'type' => 1, 'attr1' => 'def,150', 'attr2' => '' ],
['name' => "Ocean Blessing", 'level' => 77, 'type' => 1, 'attr1' => 'str,7007', 'attr2' => 'dex,7007'],
['name' => 'Memory Tonic', 'level' => 5, 'type' => 1, 'attr1' => 'exp,10', 'attr2' => '' ],
['name' => 'Memory Potion', 'level' => 30, 'type' => 1, 'attr1' => 'exp,20', 'attr2' => '' ],
['name' => 'Memory Elixir', 'level' => 50, 'type' => 1, 'attr1' => 'exp,30', 'attr2' => '' ],
['name' => 'Gold Tonic', 'level' => 5, 'type' => 1, 'attr1' => 'gold,10', 'attr2' => '' ],
['name' => 'Gold Potion', 'level' => 30, 'type' => 1, 'attr1' => 'gold,20', 'attr2' => '' ],
['name' => 'Gold Elixir', 'level' => 50, 'type' => 1, 'attr1' => 'gold,30', 'attr2' => '' ],
['name' => 'Life Pebble', 'level' => 1, 'type' => 1, 'attr' => 'hp,10'],
['name' => 'Life Stone', 'level' => 10, 'type' => 1, 'attr' => 'hp,25'],
['name' => 'Life Rock', 'level' => 25, 'type' => 1, 'attr' => 'hp,50'],
['name' => 'Life Ore', 'level' => 50, 'type' => 1, 'attr' => 'hp,100'],
['name' => 'Life Gem', 'level' => 75, 'type' => 1, 'attr' => 'hp,150'],
['name' => 'Magic Pebble', 'level' => 1, 'type' => 1, 'attr' => 'mp,10'],
['name' => 'Magic Stone', 'level' => 10, 'type' => 1, 'attr' => 'mp,25'],
['name' => 'Magic Rock', 'level' => 25, 'type' => 1, 'attr' => 'mp,50'],
['name' => 'Magic Ore', 'level' => 50, 'type' => 1, 'attr' => 'mp,100'],
['name' => 'Magic Gem', 'level' => 75, 'type' => 1, 'attr' => 'mp,150'],
['name' => "Dragon's Scale", 'level' => 10, 'type' => 1, 'attr' => 'def,25'],
['name' => "Dragon's Plate", 'level' => 30, 'type' => 1, 'attr' => 'def,50'],
['name' => "Dragon's Claw", 'level' => 10, 'type' => 1, 'attr' => 'atk,25'],
['name' => "Dragon's Fang", 'level' => 30, 'type' => 1, 'attr' => 'atk,50'],
['name' => "Dragon's Tear", 'level' => 35, 'type' => 1, 'attr' => 'str,75'],
['name' => "Dragon's Wing", 'level' => 35, 'type' => 1, 'attr' => 'dex,75'],
['name' => "Demon's Sin", 'level' => 35, 'type' => 1, 'attr' => 'hp,-50|str,65'],
['name' => "Demon's Fall", 'level' => 35, 'type' => 1, 'attr' => 'mp,-50|str,65'],
['name' => "Demon's Lie", 'level' => 45, 'type' => 1, 'attr' => 'hp,-100|str,125'],
['name' => "Demon's Hate", 'level' => 45, 'type' => 1, 'attr' => 'mp,-100|str,125'],
['name' => "Angel's Joy", 'level' => 25, 'type' => 1, 'attr' => 'hp,25|str,25'],
['name' => "Angel's Rise", 'level' => 30, 'type' => 1, 'attr' => 'hp,50|str,50'],
['name' => "Angel's Truth", 'level' => 35, 'type' => 1, 'attr' => 'hp,75|str,75'],
['name' => "Angel's Grace", 'level' => 40, 'type' => 1, 'attr' => 'hp,100|str,100'],
['name' => "Seraph's Strength", 'level' => 25, 'type' => 1, 'attr' => 'mp,25|dex,25'],
['name' => "Seraph's Power", 'level' => 30, 'type' => 1, 'attr' => 'mp,50|dex,50'],
['name' => "Seraph's Justice", 'level' => 35, 'type' => 1, 'attr' => 'mp,75|dex,75'],
['name' => "Seraph's Judgement", 'level' => 40, 'type' => 1, 'attr' => 'mp,100|dex,100'],
['name' => 'Ruby', 'level' => 50, 'type' => 1, 'attr' => 'hp,150'],
['name' => 'Sapphire', 'level' => 50, 'type' => 1, 'attr' => 'mp,150'],
['name' => 'Emerald', 'level' => 50, 'type' => 1, 'attr' => 'str,150'],
['name' => 'Amethyst', 'level' => 50, 'type' => 1, 'attr' => 'dex,150'],
['name' => 'Topaz', 'level' => 50, 'type' => 1, 'attr' => 'atk,150'],
['name' => 'Diamond', 'level' => 50, 'type' => 1, 'attr' => 'def,150'],
['name' => "Ocean Blessing", 'level' => 77, 'type' => 1, 'attr' => 'str,7007|dex,7007'],
['name' => 'Memory Tonic', 'level' => 5, 'type' => 1, 'attr' => 'exp,10',],
['name' => 'Memory Potion', 'level' => 30, 'type' => 1, 'attr' => 'exp,20',],
['name' => 'Memory Elixir', 'level' => 50, 'type' => 1, 'attr' => 'exp,30',],
['name' => 'Gold Tonic', 'level' => 5, 'type' => 1, 'attr' => 'gold,10'],
['name' => 'Gold Potion', 'level' => 30, 'type' => 1, 'attr' => 'gold,20'],
['name' => 'Gold Elixir', 'level' => 50, 'type' => 1, 'attr' => 'gold,30'],
]);
}
@ -158,8 +157,7 @@ if ($step == 'second') {
'type INTEGER DEFAULT 1',
'name TEXT NOT NULL',
'cost INTEGER DEFAULT 0',
"attr1 TEXT DEFAULT ''",
"attr2 TEXT DEFAULT ''",
"attr TEXT DEFAULT ''",
"icon TEXT DEFAULT ''"
]);
@ -167,44 +165,44 @@ if ($step == 'second') {
if ($complete) {
$db->insert([
// Type 1 - weapons
['type' => 1, 'name' => 'Stick', 'cost' => 10, 'attr1' => 'atk,2', 'attr2' => '', 'icon' => 'stick.png' ],
['type' => 1, 'name' => 'Branch', 'cost' => 30, 'attr1' => 'atk,4', 'attr2' => '', 'icon' => 'branch.png' ],
['type' => 1, 'name' => 'Club', 'cost' => 40, 'attr1' => 'atk,6', 'attr2' => '', 'icon' => 'club.png' ],
['type' => 1, 'name' => 'Dagger', 'cost' => 80, 'attr1' => 'atk,8', 'attr2' => '', 'icon' => 'dagger.png' ],
['type' => 1, 'name' => 'Hatchet', 'cost' => 120, 'attr1' => 'atk,12', 'attr2' => '', 'icon' => 'hatchet.png' ],
['type' => 1, 'name' => 'Axe', 'cost' => 200, 'attr1' => 'atk,18', 'attr2' => '', 'icon' => 'axe.png' ],
['type' => 1, 'name' => 'Spear', 'cost' => 300, 'attr1' => 'atk,25', 'attr2' => '', 'icon' => 'spear.png' ],
['type' => 1, 'name' => 'Poleaxe', 'cost' => 500, 'attr1' => 'atk,35', 'attr2' => '', 'icon' => 'poleaxe.png' ],
['type' => 1, 'name' => 'Warhammer', 'cost' => 800, 'attr1' => 'atk,50', 'attr2' => '', 'icon' => 'warhammer.png' ],
['type' => 1, 'name' => 'Longsword', 'cost' => 1200, 'attr1' => 'atk,65', 'attr2' => '', 'icon' => 'longsword.png' ],
['type' => 1, 'name' => 'Claymore', 'cost' => 1800, 'attr1' => 'atk,85', 'attr2' => '', 'icon' => 'claymore.png' ],
['type' => 1, 'name' => 'Demon Axe', 'cost' => 2800, 'attr1' => 'atk,125', 'attr2' => 'exp,-5', 'icon' => 'demonaxe.png' ],
['type' => 1, 'name' => 'Dark Sword', 'cost' => 4500, 'attr1' => 'atk,225', 'attr2' => 'exp,-10', 'icon' => 'darksword.png' ],
['type' => 1, 'name' => 'Magic Axe', 'cost' => 2800, 'attr1' => 'atk,95', 'attr2' => 'exp,5', 'icon' => 'magicaxe.png' ],
['type' => 1, 'name' => 'Bright Sword', 'cost' => 4500, 'attr1' => 'atk,185', 'attr2' => 'exp,10', 'icon' => 'brightsword.png'],
['type' => 1, 'name' => 'Dragonbane', 'cost' => 10000, 'attr1' => 'atk,300', 'attr2' => 'str,50', 'icon' => 'dragonbane.png' ],
['type' => 1, 'name' => 'Stick', 'cost' => 10, 'attr' => 'atk,2', 'icon' => 'stick.png' ], // 1
['type' => 1, 'name' => 'Branch', 'cost' => 30, 'attr' => 'atk,4', 'icon' => 'branch.png' ], // 2
['type' => 1, 'name' => 'Club', 'cost' => 40, 'attr' => 'atk,6', 'icon' => 'club.png' ], // 3
['type' => 1, 'name' => 'Dagger', 'cost' => 80, 'attr' => 'atk,8', 'icon' => 'dagger.png' ], // 4
['type' => 1, 'name' => 'Hatchet', 'cost' => 120, 'attr' => 'atk,12', 'icon' => 'hatchet.png' ], // 5
['type' => 1, 'name' => 'Axe', 'cost' => 200, 'attr' => 'atk,18', 'icon' => 'axe.png' ], // 6
['type' => 1, 'name' => 'Spear', 'cost' => 300, 'attr' => 'atk,25', 'icon' => 'spear.png' ], // 7
['type' => 1, 'name' => 'Poleaxe', 'cost' => 500, 'attr' => 'atk,35', 'icon' => 'poleaxe.png' ], // 8
['type' => 1, 'name' => 'Warhammer', 'cost' => 800, 'attr' => 'atk,50', 'icon' => 'warhammer.png' ], // 9
['type' => 1, 'name' => 'Longsword', 'cost' => 1200, 'attr' => 'atk,65', 'icon' => 'longsword.png' ], // 10
['type' => 1, 'name' => 'Claymore', 'cost' => 1800, 'attr' => 'atk,85', 'icon' => 'claymore.png' ], // 11
['type' => 1, 'name' => 'Demon Axe', 'cost' => 2800, 'attr' => 'atk,125|exp,-5', 'icon' => 'demonaxe.png' ], // 12
['type' => 1, 'name' => 'Dark Sword', 'cost' => 4500, 'attr' => 'atk,225|exp,-10', 'icon' => 'darksword.png' ], // 13
['type' => 1, 'name' => 'Magic Axe', 'cost' => 2800, 'attr' => 'atk,95|exp,5', 'icon' => 'magicaxe.png' ], // 14
['type' => 1, 'name' => 'Bright Sword', 'cost' => 4500, 'attr' => 'atk,185|exp,10', 'icon' => 'brightsword.png'], // 15
['type' => 1, 'name' => 'Dragonbane', 'cost' => 10000, 'attr' => 'atk,300|str,50', 'icon' => 'dragonbane.png' ], // 16
// Type 2 - armors
['type' => 2, 'name' => 'Underwear', 'cost' => 25, 'attr1' => 'def,2', 'attr2' => 'gold,10', 'icon' => 'underwear.png' ],
['type' => 2, 'name' => 'Clothes', 'cost' => 50, 'attr1' => 'def,5', 'attr2' => '', 'icon' => 'clothes.png' ],
['type' => 2, 'name' => 'Leather', 'cost' => 75, 'attr1' => 'def,10', 'attr2' => '', 'icon' => 'leather.png' ],
['type' => 2, 'name' => 'Hard Leather', 'cost' => 150, 'attr1' => 'def,25', 'attr2' => '', 'icon' => 'hardleather.png' ],
['type' => 2, 'name' => 'Chainmail', 'cost' => 300, 'attr1' => 'def,35', 'attr2' => '', 'icon' => 'chainmail.png' ],
['type' => 2, 'name' => 'Scale Armor', 'cost' => 900, 'attr1' => 'def,50', 'attr2' => '', 'icon' => 'scalearmor.png' ],
['type' => 2, 'name' => 'Platemail', 'cost' => 1800, 'attr1' => 'def,100', 'attr2' => '', 'icon' => 'platemail.png' ],
['type' => 2, 'name' => 'Magic Plate', 'cost' => 3000, 'attr1' => 'def,125', 'attr2' => 'mp,50', 'icon' => 'magicplate.png' ],
['type' => 2, 'name' => 'Darkmail', 'cost' => 5000, 'attr1' => 'def,200', 'attr2' => 'exp,-10', 'icon' => 'darkmail.png' ],
['type' => 2, 'name' => 'Dragon Plate', 'cost' => 10000, 'attr1' => 'def,165', 'attr2' => 'exp,10', 'icon' => 'dragonplate.png' ],
['type' => 2, 'name' => 'Destiny Raiment', 'cost' => 50000, 'attr1' => 'def,200', 'attr2' => 'dex,50', 'icon' => 'destinyraiment.png'],
['type' => 2, 'name' => 'Underwear', 'cost' => 25, 'attr' => 'def,2|gold,10', 'icon' => 'underwear.png' ], // 17
['type' => 2, 'name' => 'Clothes', 'cost' => 50, 'attr' => 'def,5', 'icon' => 'clothes.png' ], // 18
['type' => 2, 'name' => 'Leather', 'cost' => 75, 'attr' => 'def,10', 'icon' => 'leather.png' ], // 19
['type' => 2, 'name' => 'Hard Leather', 'cost' => 150, 'attr' => 'def,25', 'icon' => 'hardleather.png' ], // 20
['type' => 2, 'name' => 'Chainmail', 'cost' => 300, 'attr' => 'def,35', 'icon' => 'chainmail.png' ], // 21
['type' => 2, 'name' => 'Scale Armor', 'cost' => 900, 'attr' => 'def,50', 'icon' => 'scalearmor.png' ], // 22
['type' => 2, 'name' => 'Platemail', 'cost' => 1800, 'attr' => 'def,100', 'icon' => 'platemail.png' ], // 23
['type' => 2, 'name' => 'Magic Plate', 'cost' => 3000, 'attr' => 'def,125|mp,50', 'icon' => 'magicplate.png' ], // 24
['type' => 2, 'name' => 'Darkmail', 'cost' => 5000, 'attr' => 'def,200|exp,-10', 'icon' => 'darkmail.png' ], // 25
['type' => 2, 'name' => 'Dragon Plate', 'cost' => 10000, 'attr' => 'def,165|exp,10', 'icon' => 'dragonplate.png' ], // 26
['type' => 2, 'name' => 'Destiny Raiment', 'cost' => 50000, 'attr' => 'def,200|dex,50', 'icon' => 'destinyraiment.png'], // 27
// Type 3 - shields
['type' => 3, 'name' => 'Reed Shield', 'cost' => 50, 'attr1' => 'def,5', 'attr2' => '', 'icon' => 'reedshield.png' ],
['type' => 3, 'name' => 'Buckler', 'cost' => 100, 'attr1' => 'def,10', 'attr2' => '', 'icon' => 'nuckler.png' ],
['type' => 3, 'name' => 'Round Shield', 'cost' => 500, 'attr1' => 'def,25', 'attr2' => '', 'icon' => 'roundshield.png' ],
['type' => 3, 'name' => 'Tower Shield', 'cost' => 2500, 'attr1' => 'def,50', 'attr2' => '', 'icon' => 'towershield.png' ],
['type' => 3, 'name' => 'Silver Shield', 'cost' => 10000, 'attr1' => 'def,100', 'attr2' => '', 'icon' => 'silvershield.png'],
['type' => 3, 'name' => 'Dragon Shield', 'cost' => 25000, 'attr1' => 'def,125', 'attr2' => 'mp,100', 'icon' => 'dragonshield.png'],
['type' => 3, 'name' => 'Aegis', 'cost' => 50000, 'attr1' => 'def,225', 'attr2' => 'exp,10', 'icon' => 'aegis.png' ]
['type' => 3, 'name' => 'Reed Shield', 'cost' => 50, 'attr' => 'def,5', 'icon' => 'reedshield.png' ], // 28
['type' => 3, 'name' => 'Buckler', 'cost' => 100, 'attr' => 'def,10', 'icon' => 'nuckler.png' ], // 29
['type' => 3, 'name' => 'Round Shield', 'cost' => 500, 'attr' => 'def,25', 'icon' => 'roundshield.png' ], // 30
['type' => 3, 'name' => 'Tower Shield', 'cost' => 2500, 'attr' => 'def,50', 'icon' => 'towershield.png' ], // 31
['type' => 3, 'name' => 'Silver Shield', 'cost' => 10000, 'attr' => 'def,100', 'icon' => 'silvershield.png'], // 32
['type' => 3, 'name' => 'Dragon Shield', 'cost' => 25000, 'attr' => 'def,125|mp,100', 'icon' => 'dragonshield.png'], // 33
['type' => 3, 'name' => 'Aegis', 'cost' => 50000, 'attr' => 'def,225|exp,10', 'icon' => 'aegis.png' ] // 34
]);
}
@ -502,13 +500,13 @@ if ($step == 'second') {
'player_id INTEGER DEFAULT 1',
'monster_id INTEGER DEFAULT 1',
'turn INTEGER DEFAULT 1',
'user_hp INTEGER DEFAULT 0',
'user_mp INTEGER DEFAULT 0',
'player_hp INTEGER DEFAULT 0',
'player_mp INTEGER DEFAULT 0',
'monster_hp INTEGER DEFAULT 0',
'monster_mp INTEGER DEFAULT 0',
'user_uber_dmg INTEGER DEFAULT 0',
'player_uber_dmg INTEGER DEFAULT 0',
'monster_uber_dmg INTEGER DEFAULT 0',
'user_uber_def INTEGER DEFAULT 0',
'player_uber_def INTEGER DEFAULT 0',
'monster_uber_def INTEGER DEFAULT 0',
'monster_immune INTEGER DEFAULT 0',
'monster_sleep INTEGER DEFAULT 0',