Sfoglia il codice sorgente

Fixed bugreport:6516 where duplicate entry in produce_db.txt is been ignored when both required skills are present in a character (ex. AM_PHARMACY w/ GN_CHANGEMATERIAL)
Updated all Genetic's item creation skills to its official behavior and added all missing items used for GN_CHANGEMATERIAL.(bugreport:6539)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16712 54d463be-8e91-2dee-dedb-b68131a5f0ec

rud0lp20 12 anni fa
parent
commit
5bd2f6f4f2
5 ha cambiato i file con 437 aggiunte e 244 eliminazioni
  1. 119 91
      db/produce_db.txt
  2. 85 0
      db/skill_changematerial_db.txt
  3. 7 2
      src/map/clif.c
  4. 225 150
      src/map/skill.c
  5. 1 1
      src/map/skill.h

+ 119 - 91
db/produce_db.txt

@@ -446,129 +446,157 @@
 //==============================================
 // Genetic Foods And Potions  (LV= 26 -> 29)
 //==============================================
-//----- Change Material ---- ItemLV=26 --------- [Igniz]
-//-- Phracon [8] <-- GN_CHANGEMATERIAL Lv1, 40 Spawn, 40 Glass Bead
-1010,26,2494,1,908,40,746,40
-//-- Detrmindexta [5] <-- GN_CHANGEMATERIAL Lv1, 40 Chrysalis, 10 Clam Flesh
-971,26,2494,1,915,40,966,10
-//-- Detonator [7] <-- GN_CHANGEMATERIAL Lv1, 45 Manacles, 25 Feather of Birds
-1051,26,2494,1,1098,45,916,25
-//-- Maneater Roots [4] <-- GN_CHANGEMATERIAL Lv1, 25 Talon, 20 Zenorc's Fang
-1033,26,2494,1,917,25,1044,20
-//-- Mixture [4] <-- GN_CHANGEMATERIAL Lv1, 15 Venom Canine, 30 Powder of Butterfly
-974,26,2494,1,937,15,924,30
-//-- Grit [8] <-- GN_CHANGEMATERIAL Lv1, 35 Crystal Mirror, 50 Mantis Scythe
-1056,26,2494,1,747,35,1031,50
-//-- Witch Starsand [2] <-- GN_CHANGEMATERIAL Lv1, 10 Insect Feeler, 15 Chung Jah
-1061,26,2494,1,928,10,735,15
-//-- Hinalle [4] <-- GN_CHANGEMATERIAL Lv1, 45 Bouquet, 40 Mole Whiskers
-703,26,2494,1,744,45,1017,40
-//-- Coal [1] <-- GN_CHANGEMATERIAL Lv1, 1 Guard [0]
-1003,26,2494,1,2101,1
-//-- Steel [10] <-- GN_CHANGEMATERIAL Lv1, 1 Tsurugi [1]
-999,26,2494,1,1119,1
-//-- Soft Silk [2] <-- GN_CHANGEMATERIAL Lv1, 10 Fabric
-7166,26,2494,1,1059,10
-//-- Fabric [5] <-- GN_CHANGEMATERIAL Lv1, 2 Soft Silk
-1059,26,2494,1,7166,2
-//-- Cigarette [1] <-- GN_CHANGEMATERIAL Lv1, 1 Orcish Axe
-2267,26,2494,1,1309,1
-//-- Wind of Verdure [1] <-- GN_CHANGEMATERIAL Lv1, 100 Ice Cubic
-992,26,2494,1,7066,100
-//-- Heroic Emblem [5] <-- GN_CHANGEMATERIAL Lv1, 5 Tree Root, 45 Mole Claw
-968,26,2494,1,902,5,1018,45
-//-- Tiger's footskin [2] <-- GN_CHANGEMATERIAL Lv1, 5 Pointed Scale, 20 China
-1030,26,2494,1,906,5,736,20
-//-- Necklace of Oblivion [6] <-- GN_CHANGEMATERIAL Lv1, 25 Racoon Doll, 35 Moth Dust
-1008,26,2494,1,754,25,1057,35
-//-- Reins [8] <-- GN_CHANGEMATERIAL Lv1, 30 Chonchon Doll, 50 Puppet
-1064,26,2494,1,742,30,740,50
-//-- Hand of God [4] <-- GN_CHANGEMATERIAL Lv1, 10 Scorpion Tail, 30 Jack o' Pumpkin
-1009,26,2494,1,904,10,1062,30
-//-- Alcohol [9] <-- GN_CHANGEMATERIAL Lv1, 50 Orcish Voucher, 40 Skel-Bone
-970,26,2494,1,931,50,932,40
-//-- Soft Feather [1~3] <-- GN_CHANGEMATERIAL Lv1, 30 Feather, 30 Feather of Birds
-7063,26,2494,1,949,30,916,30
-//-- Counteragent [4] <-- GN_CHANGEMATERIAL Lv1, 15 Evil Horn, 30 Memento
-973,26,2494,1,923,15,934,30
-//-- Little Evil Horn [1] <-- GN_CHANGEMATERIAL Lv1, 5 Stone Heart, 10 Resin
-1038,26,2494,1,953,5,907,10
-//-- Scorpion Nipper [5] <-- GN_CHANGEMATERIAL Lv1, 40 Worm Peeling, 5 Yoyo Doll
-1046,26,2494,1,955,40,753,5
-//-- Cultish Masque [8] <-- GN_CHANGEMATERIAL Lv1, 45 Grasshopper's Leg, 35 Yoyo Tail
+//----- Change Material ---- ItemLV=26 ---------
+//-- Sacred Masque <-- GN_CHANGEMATERIAL Lv1, 45 Grasshopper's Leg, 35 Yoyo Tail
 1045,26,2494,1,940,45,942,35
-//-- Black Hair [4~6] <-- GN_CHANGEMATERIAL Lv1, 40 Pencil Case, 5 Tiger Skin
+//-- Long Hair <-- GN_CHANGEMATERIAL Lv1, 40 Pencil Case, 5 Tiger's Skin
 1020,26,2494,1,738,40,1029,5
-//-- Lantern [3] <-- GN_CHANGEMATERIAL Lv1, 10 Solid Shell, 30 Maneater's Blossom
-1041,26,2494,1,943,10,1032,30
-//-- Acorn [4] <-- GN_CHANGEMATERIAL Lv1, 30 Cactus Needle, 10 Snail's Shell
+//-- Phracon <-- GN_CHANGEMATERIAL Lv1, 45 Spawn, 40 Glass Bead
+1010,26,2494,1,908,45,746,40
+//-- Lantern <-- GN_CHANGEMATERIAL Lv1, 10 Solid Shell, 20 Blossom Of Maneater
+1041,26,2494,1,943,10,1032,20
+//-- Acorn <-- GN_CHANGEMATERIAL Lv1, 30 Cactus Needle, 10 Snail's Shell
 1026,26,2494,1,952,30,946,10
-//-- Horrendous Mouth [9] <-- GN_CHANGEMATERIAL Lv1, 45 Stem, 45 Dragon Scale
+//-- Frozen Heart <-- GN_CHANGEMATERIAL Lv1, 25 Raccoondog Doll, 35 Moth Dust
+1008,26,2494,1,754,25,1057,35
+//-- Horrendous Mouth <-- GN_CHANGEMATERIAL Lv1, 45 Stem, 45 Dragon Scale
 958,26,2494,1,905,45,1036,45
-//-- Elder Pixie's Moustache [8~12] <-- GN_CHANGEMATERIAL Lv1, 35 Bee Sting, 45 Little Evil Wing
+//-- Detrimindexta <-- GN_CHANGEMATERIAL Lv1, 40 Chrysalis, 10 Flesh Of Clam
+971,26,2494,1,915,40,966,10
+//-- Detonator <-- GN_CHANGEMATERIAL Lv1, 45 Nose Ring, 25 Feather Of Birds
+1051,26,2494,1,941,45,916,25
+//-- Tweezer <-- GN_CHANGEMATERIAL Lv1, 40 Worm Peelings, 5 Monkey Doll
+1046,26,2494,1,955,40,753,5
+//-- Petite DiablOfs Horn <-- GN_CHANGEMATERIAL Lv1, 5 Stone Heart, 10 Resin
+1038,26,2494,1,953,5,907,10
+//-- Root Of Maneater <-- GN_CHANGEMATERIAL Lv1, 25 Talon, 20 Tooth Of 
+1033,26,2494,1,917,25,1044,20
+//-- Conch <-- GN_CHANGEMATERIAL Lv1, 5 Gill, 25 Immortal Heart
+961,26,2494,1,956,5,929,25
+//-- Rotten Scale <-- GN_CHANGEMATERIAL Lv1, 20 Shell, 50 Thin N' Long Tongue
+959,26,2494,1,935,20,1015,50
+//-- Elder Pixie's Beard <-- GN_CHANGEMATERIAL Lv1, 35 Bee Sting, 45 Petite DiablOfs Wing
 1040,26,2494,1,939,35,1039,45
-//-- Frill [3] <-- GN_CHANGEMATERIAL Lv1, 20 Snake Scale, 15 Karvodailnirol
+//-- Lizard Scruff <-- GN_CHANGEMATERIAL Lv1, 20 Scale Of Snakes, 15 Karvodailnirol
 1012,26,2494,1,926,20,972,15
-//-- Squid Ink [4] <-- GN_CHANGEMATERIAL Lv1, 20 Bear's Footskin, 25 Black Laddle
+//-- Emveretarcon <-- GN_CHANGEMATERIAL Lv1, 5 Heart Of Mermaid, 40 Grasshopper Doll
+1011,26,2494,1,950,5,752,40
+//-- Chinese Ink <-- GN_CHANGEMATERIAL Lv1, 20 Bear's Foot, 25 Black Ladle
 1024,26,2494,1,948,20,737,25
-//-- Cobweb [8] <-- GN_CHANGEMATERIAL Lv1, 50 Fin, 35 Horrendous Hair
+//-- Spiderweb <-- GN_CHANGEMATERIAL Lv1, 50 Fin, 35 Slender Snake
 1025,26,2494,1,951,50,1048,35
-//-- Trunk [2] <-- GN_CHANGEMATERIAL Lv1, 10 Rotten Bandage, 10 Single Cell
+//-- Reins <-- GN_CHANGEMATERIAL Lv1, 30 Chonchon Doll, 50 Stuffed Doll
+1064,26,2494,1,742,30,740,50
+//-- Wooden Block <-- GN_CHANGEMATERIAL Lv1, 10 Rotten Bandage, 10 Single Cell
 1019,26,2494,1,930,10,1052,10
-//-- Tentacle [4~6] <-- GN_CHANGEMATERIAL Lv1, 40 Decayed Nail, 5 Mane
+//-- Tentacle <-- GN_CHANGEMATERIAL Lv1, 40 Decayed Nail, 5 Wild Boar's Mane
 962,26,2494,1,957,40,1028,5
-//-- Rainbow Shell [9~13] <-- GN_CHANGEMATERIAL Lv1, 50 Horn, 45 Zargon
+//-- Mixture <-- GN_CHANGEMATERIAL Lv1, 15 Posionous Canine, 30 Powder Of Butterfly
+974,26,2494,1,937,15,924,30
+//-- Colorful Shell <-- GN_CHANGEMATERIAL Lv1, 50 Horn, 45 Zargon
 1013,26,2494,1,947,50,912,45
-//-- Moth Wings [5] <-- GN_CHANGEMATERIAL Lv1, 20 Frozen Rose, 30 Reptile Tongue
+//-- Wing Of Moth <-- GN_CHANGEMATERIAL Lv1, 20 Frozen Rose, 30 Reptile Tongue
 1058,26,2494,1,749,20,903,30
-//-- Nipper [6~9] <-- GN_CHANGEMATERIAL Lv1, 25 Sticky Mucus, 45 Earthworm Peeling
-960,26,2494,1,938,25,1055,45
-//-- Turtle Shell [4] <-- GN_CHANGEMATERIAL Lv1, 5 Fluff, 40 Poring Doll
+//-- Nipper <-- GN_CHANGEMATERIAL Lv1, 25 Sticky Mucus, 40 Earthworm Peeling
+960,26,2494,1,938,25,1055,40
+//-- Turtle Shell <-- GN_CHANGEMATERIAL Lv1, 5 Fluff, 40 Poring Doll
 967,26,2494,1,914,5,741,40
-//-- Orc Claw [6] <-- GN_CHANGEMATERIAL Lv1, 50 Raccoon Leaf, 10 Garlet
+//-- Nail Of Orc <-- GN_CHANGEMATERIAL Lv1, 50 Raccoon Leaf, 10 Garlet
 1043,26,2494,1,945,50,910,10
-//-- Dragon Canine [8~12] <-- GN_CHANGEMATERIAL Lv1, 50 Osiris Doll, 35 Sticky Webfoot
+//-- Dragon Canine <-- GN_CHANGEMATERIAL Lv1, 50 Osiris Doll, 35 Sticky Webfoot
 1035,26,2494,1,751,50,918,35
-//-- Skirt of Virgin [6] <-- GN_CHANGEMATERIAL Lv1, 30 Scale Shell, 35 Dead Medusa
+//-- Skirt Of Virgin <-- GN_CHANGEMATERIAL Lv1, 30 Scales Shell, 35 Head Of Medusa
 1049,26,2494,1,936,30,1047,35
-//-- Dragon Tail [6] <-- GN_CHANGEMATERIAL Lv1, 25 Tooth of Bat, 35 Fang
+//-- Dragon Train <-- GN_CHANGEMATERIAL Lv1, 25 Tooth Of Bat, 35 Sharpened Cuspid
 1037,26,2494,1,913,25,1063,35
-//-- Dokebi Horn [4] <-- GN_CHANGEMATERIAL Lv1, 15 Shining Scale, 25 Ancient Lips
-1021,26,2494,1,954,15,1053,25
-//-- Nine Tails [2~3] <-- GN_CHANGEMATERIAL Lv1, 10 Animal Skin, 15 Rouge
+//-- Dokkaebi Horn <-- GN_CHANGEMATERIAL Lv1, 15 Shining Scales, 25 Lip Of Ancient Fish
+1021,26,2494,1,954,15,1054,25
+//-- Grit <-- GN_CHANGEMATERIAL Lv1, 35 Crystal Mirror, 50 Limb Of Mantis
+1056,26,2494,1,747,35,1031,50
+//-- Sharp Scale <-- GN_CHANGEMATERIAL Lv1, 10 Horseshoe, 20 Clam Shell
+963,26,2494,1,944,10,965,20
+//-- Short Leg <-- GN_CHANGEMATERIAL Lv1, 20 Claw Of Wolves, 45 Scell
+1042,26,2494,1,920,20,911,45
+//-- Starsand Of Witch <-- GN_CHANGEMATERIAL Lv1, 10 Insect Feeler, 15 Blue Porcelain
+1061,26,2494,1,928,10,735,15
+//-- Fox Tail <-- GN_CHANGEMATERIAL Lv1, 10 Animal's Skin, 15 Rouge
 1022,26,2494,1,919,10,739,15
-//-- Blue Hair [15] <-- GN_CHANGEMATERIAL Lv1, 45 Jellopy, 20 Wedding Bouquet
+//-- Cobold Hair <-- GN_CHANGEMATERIAL Lv1, 45 Jellopy, 20 Wedding Bouquet
 1034,26,2494,1,909,45,745,20
-//-- Ant Jaw [4~6] <-- GN_CHANGEMATERIAL Lv1, 20 Spore Doll, 20 Witherless Rose
+//-- Jaws Of Ant <-- GN_CHANGEMATERIAL Lv1, 20 Spore Doll, 20 Witherless Rose
 1014,26,2494,1,743,20,748,20
-//-- Crab Shell [8] <-- GN_CHANGEMATERIAL Lv1, 50 Baphomet doll, 30 Fish Tail
+//-- Voucher Of Orcish Hero <-- GN_CHANGEMATERIAL Lv1, 5 Tree Root, 45 Nail Of Mole
+968,26,2494,1,902,5,1018,45
+//-- Sacred Marks <-- GN_CHANGEMATERIAL Lv1, 10 Scorpion's Tail, 30 Pumpkin Head
+1009,26,2494,1,904,10,1062,30
+//-- Alchol <-- GN_CHANGEMATERIAL Lv1, 50 Orcish Voucher, 40 Skel Bone
+970,26,2494,1,931,50,932,40
+//-- Crap Shell <-- GN_CHANGEMATERIAL Lv1, 50 Baphomet Doll, 30 Fish Tail
 964,26,2494,1,750,50,1023,30
-//-- Tendon [3] <-- GN_CHANGEMATERIAL Lv1, 25 Orc's Fang, 5 Feather
+//-- Tendon <-- GN_CHANGEMATERIAL Lv1, 25 Orcish Cuspid, 5 Feather
 1050,26,2494,1,922,25,949,5
-//-- Ancient Tooth [6~9] <-- GN_CHANGEMATERIAL Lv1, 35 Bill of Birds, 30 Fabric
+//-- Tiger Footskin <-- GN_CHANGEMATERIAL Lv1, 5 Pointed Scale, 20 White Platter
+1030,26,2494,1,906,5,736,20
+//-- Hinalle <-- GN_CHANGEMATERIAL Lv1, 45 Bunch Of Flowers, 40 Moustache Of Mole
+703,26,2494,1,744,45,1017,40
+//-- Counteragent <-- GN_CHANGEMATERIAL Lv1, 15 Evil Horn, 30 Mementos
+973,26,2494,1,923,15,934,30
+//-- Tooth Of Ancient Fish <-- GN_CHANGEMATERIAL Lv1, 35 Bill Of Birds, 30 Transparent Cloth
 1053,26,2494,1,925,35,1059,30
-//-- Rat Tail [7~10] <-- GN_CHANGEMATERIAL Lv1, 35 Mushroom Spore, 40 Golden Hair
+//-- Rat Tail <-- GN_CHANGEMATERIAL Lv1, 35 Mushroom Spore, 40 Golden Hair
 1016,26,2494,1,921,35,1060,40
-//-- Crystal Blue [1~3] <-- GN_CHANGEMATERIAL Lv1, 100 Wolf Claw
+//-- Coal <-- GN_CHANGEMATERIAL Lv1, 1 Guard
+1003,26,2494,1,2101,1
+//-- Steel <-- GN_CHANGEMATERIAL Lv1, 1 Tsurugi
+999,26,2494,1,1119,1
+//-- Cigar <-- GN_CHANGEMATERIAL Lv1, 1 Orcish Axe
+2267,26,2494,1,1304,1
+//-- Bone Wand <-- GN_CHANGEMATERIAL Lv1, 100 Clattering Skull, 100 Broken Farming Utensil
+1615,26,2494,1,7752,100,7753,100
+//-- Cigar <-- GN_CHANGEMATERIAL Lv1, 1 Orcish Axe, 100 Orcish Voucher
+2267,26,2494,1,1304,1,931,100
+//-- Starsand Of Witch <-- GN_CHANGEMATERIAL Lv1, 100 Moth Dust, 100 Scell
+1061,26,2494,1,1057,100,911,100
+//-- Soft Feather <-- GN_CHANGEMATERIAL Lv1, 30 Feather, 30 Feather Of Birds
+7063,26,2494,1,949,30,916,30
+//-- Wind Of Verdure <-- GN_CHANGEMATERIAL Lv1, 100 Ice Piece
+992,26,2494,1,7066,100
+//-- Crystal Blue <-- GN_CHANGEMATERIAL Lv1, 100 Claw Of Wolves
 991,26,2494,1,920,100
-// Throwable HP Increase Potion (Small) [10] <-- GN_CHANGEMATERIAL Lv1, 10 'Throwing Bottle', 10 HP Potions (Small)
+//-- Soft Silk Cloth <-- GN_CHANGEMATERIAL Lv1, 10 Transparent Cloth
+7166,26,2494,1,1059,10
+//-- Transparent Cloth <-- GN_CHANGEMATERIAL Lv1, 2 Soft Silk Cloth
+1059,26,2494,1,7166,2
+//-- Boost500 To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Empty Potion, 10 Boost500, 10 Flexible String
+13269,26,2494,1,1093,10,12417,10,7200,10
+//-- Full SwingK To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Empty Potion, 10 Full SwingK, 10 Flexible String
+13270,26,2494,1,1093,10,12418,10,7200,10
+//-- Mana Plus To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Empty Potion, 10 Mana Plus, 10 Flexible String
+13271,26,2494,1,1093,10,12419,10,7200,10
+//-- Cure Free To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Empty Potion, 10 Cure Free, 10 Flexible String
+13272,26,2494,1,1093,10,12475,10,7200,10
+//-- Stamina Up M To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Empty Potion, 10 Stamina Up M, 10 Flexible String
+13273,26,2494,1,1093,10,12420,10,7200,10
+//-- Digestive F To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Empty Potion, 10 Digestive F, 10 Flexible String
+13274,26,2494,1,1093,10,12421,10,7200,10
+//-- HP Inc PotS To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Bottle To Throw, 10 HP Increase PotionS
 13275,26,2494,1,6297,10,12422,10
-// Throwable HP Increase Potion (Medium) [10] <-- GN_CHANGEMATERIAL Lv1, 10 'Throwing Bottle', 10 HP Potions (Medium)
+//-- HP Inc PotM To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Bottle To Throw, 10 HP Increase PotionM
 13276,26,2494,1,6297,10,12423,10
-// Throwable HP Increase Potion (Large) [10] <-- GN_CHANGEMATERIAL Lv1, 10 'Throwing Bottle', 10 HP Potions (Large)
+//-- HP Inc PotL To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Bottle To Throw, 10 HP Increase PotionL
 13277,26,2494,1,6297,10,12424,10
-// Throwable SP Increase Potion (Small) [10] <-- GN_CHANGEMATERIAL Lv1, 10 'Throwing Bottle', 10 SP Potions (Small)
+//-- SP Inc PotS To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Bottle To Throw, 10 SP Increase PotionS
 13278,26,2494,1,6297,10,12425,10
-// Throwable SP Increase Potion (Medium) [10] <-- GN_CHANGEMATERIAL Lv1, 10 'Throwing Bottle', 10 SP Potions (Medium)
+//-- SP Inc PotM To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Bottle To Throw, 10 SP Increase PotionM
 13279,26,2494,1,6297,10,12426,10
-// Throwable SP Increase Potion (Large) [10] <-- GN_CHANGEMATERIAL Lv1, 10 'Throwing Bottle', 10 SP Potions (Large)
+//-- SP Inc PotL To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Bottle To Throw, 10 SP Increase PotionL
 13280,26,2494,1,6297,10,12427,10
-// Enrich Celermine Juice Throw [10] <-- GN_CHANGEMATERIAL Lv1, 10 'Throwing Bottle', 10 Enrich Celermine Juice
-13283,26,2494,1,6297,10,12437,10
-// Vitata500 Throw [10] <-- GN_CHANGEMATERIAL Lv1, 10 'Throwing Bottle', 10 Vitata500
-13282,26,2494,1,6297,10,12436,10
-// Enriched White PotionZ Throw [10] <-- GN_CHANGEMATERIAL Lv1, 10 'Throwing Bottle', 10 Enriched White PotionZ
+//-- En White PotZ To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Bottle To Throw, 10 Enrich White PotionZ
 13281,26,2494,1,6297,10,12428,10
+//-- Vitata500 To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Bottle To Throw, 10 Vitata500
+13282,26,2494,1,6297,10,12436,10
+//-- En Cel Juice To Throw <-- GN_CHANGEMATERIAL Lv1, 10 Bottle To Throw, 10 Enrich Celermine Juice
+13283,26,2494,1,6297,10,12437,10
 //==============================================
 
 //---- Mix Cooking --- ItemLV=27 ---------------

+ 85 - 0
db/skill_changematerial_db.txt

@@ -0,0 +1,85 @@
+// Change Material Database
+//
+// Structure of Database:
+// ProductID,BaseRate,MakeAmount1,MakeAmountRate1...,MakeAmount5,MakeAmountRate5
+//
+// NOTE: 
+// Up to 5 ID/Amount pairs can be specified.
+// Rate = n/10%
+
+703,4,800,2,200		// Hinalle 
+958,800,9,1000		// Horrendous_Mouth
+959,800,7,1000		// Rotten_Scale
+960,1000,6,800,9,200	// Nipper 
+961,800,3,1000		// Conch
+962,1000,4,800,6,200	// Tentacle 
+963,800,3,1000		// Sharp_Scale
+964,800,8,1000		// Crap_Shell
+967,800,4,1000		// Turtle_Shell
+968,800,5,1000		// Voucher_Of_Orcish_Hero
+970,800,9,1000		// Alchol
+971,800,5,1000		// Detrimindexta
+973,800,4,1000		// Counteragent
+974,1000,4,800,6,200	// Mixture 
+991,1000,1,500,1,500	// Crystal_Blue 
+992,1000,1,500,1,500	// Wind_Of_Verdure 
+999,1000,10,1000	// Steel
+1003,500,1,1000		// Coal
+1008,800,6,1000		// Frozen_Heart
+1009,800,4,1000		// Sacred_Marks
+1010,800,8,1000		// Phracon
+1011,800,4,1000		// Emveretarcon
+1012,800,3,1000		// Lizard_Scruff
+1013,9,800,13,200	// Colorful_Shell
+1014,4,800,6,200	// Jaws_Of_Ant
+1016,1000,7,800,10,200	// Rat_Tail 
+1019,800,2,1000		// Wooden_Block
+1020,1000,4,800,6,200	// Long_Hair 
+1021,800,4,1000		// Dokkaebi_Horn
+1022,1000,2,800,3,200	// Fox_Tail 
+1024,800,4,1000		// Chinese_Ink
+1025,800,8,1000		// Spiderweb
+1026,800,4,1000		// Acorn
+1030,800,2,1000		// Tiger_Footskin
+1033,1000,4,800,6,200	// Root_Of_Maneater 
+1034,1000,6,800,9,200	// Cobold_Hair 
+1035,1000,8,800,12,200	// Dragon_Canine 
+1037,800,6,1000		// Dragon_Train
+1038,1000,1,1000	// Petite_Dablofs_Horn 
+1040,1000,8,800,12,200	// Elder_Pixie's_Beard 
+1041,800,3,1000		// Lantern
+1042,800,6,1000		// Short_Leg
+1043,800,6,1000		// Nail_Of_Orc
+1045,800,8,1000		// Sacred_Masque
+1046,800,4,1000		// Tweezer
+1049,800,6,1000		// Skirt_Of_Virgin
+1050,800,3,1000		// Tendon
+1051,800,7,1000		// Detonator
+1053,1000,6,800,9,200	// Tooth_Of_Ancient_Fish 
+1056,800,8,1000		// Grit
+1058,800,5,1000		// Wing_Of_Moth
+1059,1000,5,1000	// Transparent_Cloth
+1061,80,2,1000		// Starsand_Of_Witch
+1061,1000,1,1000	// Starsand_Of_Witch
+1064,800,8,1000		// Reins
+1615,200,1,1000		// Bone_Wand
+2267,1000,1,1000	// Cigar
+2267,1000,1,1000	// Cigar
+7063,1000,1,200,1,200,1,100	// Soft_Feather
+7166,1000,2,1000	// Soft_Silk_Cloth
+13269,1000,5,500,2,250,1,100	// Boost500_To_Throw
+13270,1000,5,500,2,250,1,100	// Full_SwingK_To_Throw
+13271,1000,5,500,2,250,1,100	// Mana_Plus_To_Throw
+13272,1000,5,500,2,250,1,100	// Cure_Free_To_Throw
+13273,1000,5,500,2,250,1,100	// Stamina_Up_M_To_Throw
+13274,1000,5,500,2,250,1,100	// Digestive_F_To_Throw
+13275,1000,10,1000	// HP_Inc_PotS_To_Throw
+13276,1000,10,1000	// HP_Inc_PotM_To_Throw
+13277,1000,10,1000	// HP_Inc_PotL_To_Throw
+13278,1000,10,1000	// SP_Inc_PotS_To_Throw
+13279,1000,10,1000	// SP_Inc_PotM_To_Throw
+13280,1000,10,1000	// SP_Inc_PotL_To_Throw
+13281,1000,10,1000	// En_White_PotZ_To_Throw
+13282,1000,10,1000	// Vitata500_To_Throw
+13283,1000,10,1000	// En_Cel_Juice_To_Throw
+

+ 7 - 2
src/map/clif.c

@@ -5247,12 +5247,17 @@ void clif_skill_produce_mix_list(struct map_session_data *sd, int skillid , int
 
 	if(sd->menuskill_id == skillid)
 		return; //Avoid resending the menu twice or more times...
+	if( skillid == GC_CREATENEWPOISON )
+		skillid = GC_RESEARCHNEWPOISON;
+
 	fd=sd->fd;
 	WFIFOHEAD(fd, MAX_SKILL_PRODUCE_DB * 8 + 8);
 	WFIFOW(fd, 0)=0x18d;
 
 	for(i=0,c=0;i<MAX_SKILL_PRODUCE_DB;i++){
-		if( skill_can_produce_mix(sd,skill_produce_db[i].nameid,trigger, 1) ){
+		if( skill_can_produce_mix(sd,skill_produce_db[i].nameid, trigger, 1) &&
+			( ( skillid > 0 && skill_produce_db[i].req_skill == skillid ) || skillid < 0 )
+			){
 			if((view = itemdb_viewid(skill_produce_db[i].nameid)) > 0)
 				WFIFOW(fd,c*8+ 4)= view;
 			else
@@ -10980,7 +10985,7 @@ void clif_parse_ProduceMix(int fd,struct map_session_data *sd)
 		case -1:
 		case AM_PHARMACY:
 		case RK_RUNEMASTERY:
-		case GC_CREATENEWPOISON:
+		case GC_RESEARCHNEWPOISON:
 			break;
 		default:
 			return;

+ 225 - 150
src/map/skill.c

@@ -96,6 +96,13 @@ struct s_skill_improvise_db {
 };
 struct s_skill_improvise_db skill_improvise_db[MAX_SKILL_IMPROVISE_DB];
 bool skill_reproduce_db[MAX_SKILL_DB];
+struct s_skill_changematerial_db {
+	int itemid;
+	short rate;
+	int qty[5];
+	short qty_rate[5];
+};
+struct s_skill_changematerial_db skill_changematerial_db[MAX_SKILL_PRODUCE_DB];
 
 //Warlock
 struct s_skill_spellbook_db {
@@ -8604,7 +8611,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 		if( flag&1 ) {
 			if ( clif_skill_nodamage(bl, src, skillid, skilllv,
 									 sc_start(bl, type, 25 + 10 * skilllv, skilllv, skill_get_time(skillid, skilllv))) )
-				status_zap(bl, 0, status_get_max_sp(bl) / 100 * 25 + 5 * skilllv);
+				status_zap(bl, 0, status_get_max_sp(bl) * (25 + 5 * skilllv) / 100);
 		} else
 			map_foreachinrange(skill_area_sub, bl, skill_get_splash(skillid, skilllv), BL_CHAR,
 							   src, skillid, skilllv, tick, flag|BCT_ENEMY|1, skill_castend_nodamage_id);
@@ -8643,28 +8650,18 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
 		break;
 		
 	case GN_MIX_COOKING:
-		if( sd ) {
-			clif_cooking_list(sd,27,skillid,(skilllv == 2) ? 10 : 1,6);
-			clif_skill_nodamage(src,bl,skillid,skilllv,1);
-		}
-		break;
-		
 	case GN_MAKEBOMB:
-		if( sd ) {
-			clif_cooking_list(sd,28,skillid,(skilllv==2) ? 10 : 1,5);
-			clif_skill_nodamage(src,bl,skillid,skilllv,1);
-		}
-		break;
-		
 	case GN_S_PHARMACY:
 		if( sd ) {
+			int qty = 1;
 			sd->skillid_old = skillid;
 			sd->skilllv_old = skilllv;
-			clif_cooking_list(sd,29,skillid,1,6);
+			if( skillid != GN_S_PHARMACY && skilllv > 1 )
+				qty = 10;
+			clif_cooking_list(sd,(skillid - GN_MIX_COOKING) + 27,skillid,qty,skillid==GN_MAKEBOMB?5:6);
 			clif_skill_nodamage(src,bl,skillid,skilllv,1);
 		}
 		break;
-		
 	case EL_CIRCLE_OF_FIRE:
 	case EL_PYROTECHNIC:
 	case EL_HEATER:
@@ -15516,9 +15513,12 @@ int skill_can_produce_mix (struct map_session_data *sd, int nameid, int trigger,
 			if((j=skill_produce_db[i].req_skill)>0 &&
 				pc_checkskill(sd,j) < skill_produce_db[i].req_skill_lv)
 					continue; // must iterate again to check other skills that produce it. [malufett]
+			if( j > 0 && sd->skillid_old > 0 && sd->skillid_old != j )
+				continue; // special case
 			break;
 		}
 	}
+	sd->skillid_old = sd->skilllv_old = 0;
 	if( i >= MAX_SKILL_PRODUCE_DB )
 		return 0;
 
@@ -15565,7 +15565,7 @@ int skill_can_produce_mix (struct map_session_data *sd, int nameid, int trigger,
 int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, int slot1, int slot2, int slot3, int qty)
 {
 	int slot[3];
-	int i,sc,ele,idx,equip,wlv,make_per,flag = 0, firstQty = qty;
+	int i,sc,ele,idx,equip,wlv,make_per,flag = 0,skilllv = 0;
 	int num = -1; // exclude the recipe
 	struct status_data *status;
 	struct item_data* data;
@@ -15573,6 +15573,11 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
 	nullpo_ret(sd);
 	status = status_get_status_data(&sd->bl);
 
+	if( sd->skillid_old == skill_id )
+		skilllv = sd->skilllv_old;
+	else
+		sd->skillid_old = skill_id;
+
 	if( !(idx=skill_can_produce_mix(sd,nameid,-1, qty)) )
 		return 0;
 	idx--;
@@ -15607,6 +15612,7 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
 			ele=ele_table[slot[i]-994];
 		}
 	}
+
 	if( skill_id == RK_RUNEMASTERY ) {
 		int temp_qty, skill_lv = pc_checkskill(sd,skill_id);
 		data = itemdb_search(nameid);
@@ -15752,83 +15758,100 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
 				make_per = 3000 + 500 * pc_checkskill(sd,GC_RESEARCHNEWPOISON);
 				qty = 1+rnd()%pc_checkskill(sd,GC_RESEARCHNEWPOISON);
 				break;
-			case GN_MIX_COOKING:
-				make_per = 3000; //As I can see this is not affectd by dex or int
-				break;
-			case GN_MAKEBOMB:
-				// 	TODO: find a proper chance.
-				make_per = (5000 + 50*status->dex + 30*status->luk); //Custom rate value.
-				break;
-			case GN_CHANGEMATERIAL: // [Igniz]
-				switch( nameid ) {
-					case 1010: case 1056: case 1064: case 1045:
-					case 1025: case 964:
-						qty *= 8; break;
-					case 971:  case 1059: case 968:  case 1046:
-					case 1058:
-						qty *= 5; break;
-					case 1051:
-						qty *= 7; break;
-					case 1033: case 974:  case 703:  case 1009:
-					case 973:  case 1026: case 1024: case 967:
-					case 1021:
-						qty *= 4; break;
-					case 1061: case 7166: case 1030: case 1019:
-						qty *= 2; break;
-					case 1003: case 2267: case 992:  case 1038:
-						qty *= 1; break;
-					case 1008: case 1043: case 1049: case 1037:
-						qty *= 6; break;
-					case 970:  case 958:
-						qty *= 9; break;
-					case 1041: case 1012: case 1050:
-						qty *= 3; break;
-					case 1034:
-						qty *= 15; break;
-					case 7063: case 991:
-						qty *= 1 + rand()%3; break;
-					case 1020: case 962:  case 1014:
-						qty *= 4 + rand()%3; break;
-					case 1040: case 1035:
-						qty *= 8 + rand()%5; break;
-					case 1013:
-						qty *= 9 + rand()%5; break;
-					case 960: case 1053:
-						qty *= 6 + rand()%4; break;
-					case 1022:
-						qty *= 2 + rand()%2; break;
-					case 1016:
-						qty *= 7 + rand()%4; break;
-						// Throwable potions
-					case 13275: case 13276: case 13277: case 13278:
-					case 13279: case 13280: case 13281: case 13282:
-					case 13283: case 999:
-						qty *= 10;
+			case GN_CHANGEMATERIAL: 
+				for(i=0; i<MAX_SKILL_PRODUCE_DB; i++)
+					if( skill_changematerial_db[i].itemid == nameid ){
+						make_per = skill_changematerial_db[i].rate * 10;
 						break;
+					}
+				break;	
+			case GN_S_PHARMACY:
+				{
+					int difficulty = 0;
+					
+					difficulty = (620 - 20 * skilllv);// (620 - 20 * Skill Level)
+
+					make_per = status->int_ + status->dex/2 + status->luk + sd->status.job_level + (30+rnd()%120) + // (Caster’s INT) + (Caster’s DEX / 2) + (Caster’s LUK) + (Caster’s Job Level) + Random number between (30 ~ 150) +
+								(sd->status.base_level-100) + pc_checkskill(sd, AM_LEARNINGPOTION) + pc_checkskill(sd, CR_FULLPROTECTION)*(4+rnd()%6); // (Caster’s Base Level - 100) + (Potion Research x 5) + (Full Chemical Protection Skill Level) x (Random number between 4 ~ 10)
+					
+					switch(nameid){// difficulty factor
+						case 12422:	case 12425:	
+						case 12428:
+							difficulty += 10;
+							break;
+						case 6212:	case 12426:
+							difficulty += 15;
+							break;
+						case 13264:	case 12423:	
+						case 12427:	case 12436:
+							difficulty += 20;
+							break;
+						case 6210:	case 6211:	
+						case 12437:
+							difficulty += 30;
+							break;
+						case 12424:	case 12475:
+							difficulty += 40;
+							break;
+					}
+
+					if( make_per >= 400 && make_per > difficulty)
+						qty = 10;
+					else if( make_per >= 300 && make_per > difficulty)
+						qty = 7;
+					else if( make_per >= 100 && make_per > difficulty)
+						qty = 6;
+					else if( make_per >= 1 && make_per > difficulty)
+						qty = 5;
+					else
+						qty = 4;
+					make_per = 10000;
 				}
-				make_per = 100000; //100% success rate.
 				break;
-			case GN_S_PHARMACY:
-				// Note: This is not the chosen skill level but the highest available. Need confirmation/fix.
-				switch( sd->skilllv_old ) {
-					case 6:
-					case 7:
-					case 8:
-						qty = 3;
-						break;				//3 items to make at once.
-					case 9:
-						qty = 3 + rnd()%3;
-						break;					//3~5 items to make at once.
-					case 10:
-						qty = 4 + rnd()%3;
-						break;					//4~6 items to make at once.
-					default:
-						qty = 2;
-						break; //2 item to make at once.
+			case GN_MAKEBOMB:
+			case GN_MIX_COOKING:
+				{
+					int difficulty = 30 + rnd()%120; // Random number between (30 ~ 150)
+				
+					make_per = sd->status.job_level / 4 + status->luk / 2 + status->dex / 3; // (Caster’s Job Level / 4) + (Caster’s LUK / 2) + (Caster’s DEX / 3)
+					qty = ~(5 + rnd()%5) + 1;
+
+					switch(nameid){// difficulty factor
+						case 13260:
+							difficulty += 5;
+							break;
+						case 13261:	case 13262:
+							difficulty += 10;
+							break;
+						case 12429:	case 12430:	case 12431:
+						case 12432:	case 12433:	case 12434:
+						case 13263:
+							difficulty += 15;
+							break;
+						case 13264:	
+							difficulty += 20;
+							break;
+					}
+
+					if( make_per >= 30 && make_per > difficulty)
+						qty = 10 + rnd()%2;
+					else if( make_per >= 10 && make_per > difficulty)
+						qty = 10;
+					else if( make_per == 10 && make_per > difficulty)
+						qty = 8;
+					else if( (make_per >= 50 || make_per < 30) && make_per < difficulty)
+						;// Food/Bomb creation fails.
+					else if( make_per >= 30 && make_per < difficulty)
+						qty = 5;
+		
+					if( qty < 0 || (skilllv == 1 && make_per < difficulty)){
+						qty = ~qty + 1;
+						make_per = 0;
+					}else
+						make_per = 10000;
+					qty = (skilllv > 1 ? qty : 1);
 				}
-				make_per = 100000; //100% success rate.
-				sd->skillid_old = sd->skilllv_old = 0;
-				break;				
+				break;
 			default:
 				if (sd->menuskill_id ==	AM_PHARMACY &&
 					sd->menuskill_val > 10 && sd->menuskill_val <= 20)
@@ -15894,10 +15917,7 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
 				case AM_PHARMACY:
 				case AM_TWILIGHT1:
 				case AM_TWILIGHT2:
-				case AM_TWILIGHT3:
-				case GN_MIX_COOKING:
-				case GN_MAKEBOMB:
-				case GN_S_PHARMACY:					
+				case AM_TWILIGHT3:			
 					flag = battle_config.produce_item_name_input&0x2;
 					break;
 				case AL_HOLYWATER:
@@ -15934,44 +15954,41 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
 		} else {
 			int fame = 0;
 			tmp_item.amount = 0;
-			if( skill_id == GN_MIX_COOKING && firstQty > 1 ) {// Mix Cooking level 2.
-			// Success. As I see the chance as level 2 is global, not indiviual.
-				if( rnd()%10000 < make_per )
-					tmp_item.amount = 5 + rnd()%5;
-			} else {
-				for (i=0; i< qty; i++) {	//Apply quantity modifiers.
-					if (rnd()%10000 < make_per || qty == 1) { //Success
-						tmp_item.amount++;
-						if(nameid < 545 || nameid > 547)
-							continue;
-						if( skill_id != AM_PHARMACY &&
-							skill_id != AM_TWILIGHT1 &&
-							skill_id != AM_TWILIGHT2 &&
-							skill_id != AM_TWILIGHT3 &&
-							skill_id != GN_MIX_COOKING &&
-							skill_id != GN_MAKEBOMB &&
-							skill_id != GN_S_PHARMACY )
-							continue;
-						//Add fame as needed.
-						switch(++sd->potion_success_counter) {
-							case 3:
-								fame+=1; // Success to prepare 3 Condensed Potions in a row
-								break;
-							case 5:
-								fame+=3; // Success to prepare 5 Condensed Potions in a row
-								break;
-							case 7:
-								fame+=10; // Success to prepare 7 Condensed Potions in a row
-								break;
-							case 10:
-								fame+=50; // Success to prepare 10 Condensed Potions in a row
-								sd->potion_success_counter = 0;
-								break;
-						}
-					} else //Failure
-						sd->potion_success_counter = 0;
+
+			for (i=0; i< qty; i++) {	//Apply quantity modifiers.
+				if( (skill_id == GN_MIX_COOKING || skill_id == GN_MAKEBOMB || skill_id == GN_S_PHARMACY) && make_per > 1){
+					tmp_item.amount = qty;
+					break;
 				}
+				if (rnd()%10000 < make_per || qty == 1) { //Success
+					tmp_item.amount++;
+					if(nameid < 545 || nameid > 547)
+						continue;
+					if( skill_id != AM_PHARMACY &&
+						skill_id != AM_TWILIGHT1 &&
+						skill_id != AM_TWILIGHT2 &&
+						skill_id != AM_TWILIGHT3 )
+						continue;
+					//Add fame as needed.
+					switch(++sd->potion_success_counter) {
+						case 3:
+							fame+=1; // Success to prepare 3 Condensed Potions in a row
+							break;
+						case 5:
+							fame+=3; // Success to prepare 5 Condensed Potions in a row
+							break;
+						case 7:
+							fame+=10; // Success to prepare 7 Condensed Potions in a row
+							break;
+						case 10:
+							fame+=50; // Success to prepare 10 Condensed Potions in a row
+							sd->potion_success_counter = 0;
+							break;
+					}
+				} else //Failure
+					sd->potion_success_counter = 0;
 			}
+
 			if (fame)
 				pc_addfame(sd,fame);
 			//Visual effects and the like.
@@ -15994,13 +16011,7 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
 				case GC_CREATENEWPOISON:
 					clif_produceeffect(sd,2,nameid);
 					clif_misceffect(&sd->bl,5);
-					break;
-				case GN_MAKEBOMB:
-				case GN_MIX_COOKING:
-					clif_msg_skill(sd,skill_id,0x627);
-					break;
-				case GN_S_PHARMACY:
-					break;	// No effects here.					
+					break;	
 				default: //Those that don't require a skill?
 					if( skill_produce_db[idx].itemlv > 10 && skill_produce_db[idx].itemlv <= 20)
 					{ //Cooking items.
@@ -16011,11 +16022,33 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
 					break;
 			}
 		}
-		if (tmp_item.amount) { //Success
+		if ( skill_id == GN_CHANGEMATERIAL && tmp_item.amount) { //Success
+			int j, k = 0;
+			for(i=0; i<MAX_SKILL_PRODUCE_DB; i++)
+				if( skill_changematerial_db[i].itemid == nameid ){
+					for(j=0; j<5; j++){
+						if( rnd()%1000 < skill_changematerial_db[i].qty_rate[j] ){
+							tmp_item.amount = qty * skill_changematerial_db[i].qty[j];
+							if((flag = pc_additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE))) {
+								clif_additem(sd,0,0,flag);
+								map_addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
+							}
+							k++;
+						}
+					}
+					break;
+				}
+			if( k ){
+				clif_msg_skill(sd,skill_id,0x627);	
+				return 1;
+			}
+		} else if (tmp_item.amount) { //Success
 			if((flag = pc_additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE))) {
 				clif_additem(sd,0,0,flag);
 				map_addflooritem(&tmp_item,tmp_item.amount,sd->bl.m,sd->bl.x,sd->bl.y,0,0,0,0);
 			}
+			if( skill_id == GN_MIX_COOKING || skill_id == GN_MAKEBOMB || skill_id ==  GN_S_PHARMACY )
+				clif_msg_skill(sd,skill_id,0x627);	
 			return 1;
 		}
 	}
@@ -16052,15 +16085,15 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
 				break;
 			case GN_MIX_COOKING: {
 					struct item tmp_item;
-					const int products[5][2] = {{13265,6500},{13266,4000},{13267,3000},{13268,500},{12435,500}};
+					const int compensation[5] = {13265, 13266, 13267, 12435, 13268};
+					int rate = rnd()%500;
 					memset(&tmp_item,0,sizeof(tmp_item));
-					tmp_item.nameid = nameid;
-					do {
-						i = rnd()%5;
-						tmp_item.nameid = products[i][0];
-					}
-					while( rnd()%10000 >= products[i][1] );
-					tmp_item.amount = (firstQty > 1 )? 5 + rnd()%5 : 1; // When it fails it gives a random amount of items.
+					if( rate < 50) i = 4;
+					else if( rate < 100) i = 2+rnd()%1;
+					else if( rate < 250 ) i = 1;
+					else if( rate < 500 ) i = 0;
+					tmp_item.nameid = compensation[i];
+					tmp_item.amount = qty;
 					tmp_item.identify = 1;
 					if( pc_additem(sd,&tmp_item,tmp_item.amount,LOG_TYPE_PRODUCE) ) {
 						clif_additem(sd,0,0,flag);
@@ -16069,9 +16102,9 @@ int skill_produce_mix (struct map_session_data *sd, int skill_id, int nameid, in
 					clif_msg_skill(sd,skill_id,0x628);
 				}
 				break;
-			case GN_S_PHARMACY:
-				break;	// No effects here.
 			case GN_MAKEBOMB:
+			case GN_S_PHARMACY:
+			case GN_CHANGEMATERIAL:
 				clif_msg_skill(sd,skill_id,0x628);
 				break;				
 			default:
@@ -16375,8 +16408,12 @@ int skill_changematerial(struct map_session_data *sd, int n, unsigned short *ite
 							int idx = item_list[k*2+0]-2;
 							nameid = sd->status.inventory[idx].nameid;
 							amount = item_list[k*2+1];
-							
-							if( nameid == skill_produce_db[i].mat_id[j] && (amount-p*skill_produce_db[i].mat_amount[j]) >= skill_produce_db[i].mat_amount[j] )
+							if( nameid > 0 && sd->status.inventory[idx].identify == 0 ){
+								clif_msg_skill(sd,GN_CHANGEMATERIAL,0x62D);
+								return 0;
+							}
+							if( nameid == skill_produce_db[i].mat_id[j] && (amount-p*skill_produce_db[i].mat_amount[j]) >= skill_produce_db[i].mat_amount[j]
+								&& (amount-p*skill_produce_db[i].mat_amount[j])%skill_produce_db[i].mat_amount[j] == 0 ) // must be in exact amount
 								c++; // match
 						}
 					}
@@ -16392,7 +16429,10 @@ int skill_changematerial(struct map_session_data *sd, int n, unsigned short *ite
 			}
 		}
 	}
-	
+
+	if( p == 0)
+		clif_msg_skill(sd,GN_CHANGEMATERIAL,0x623);
+
 	return 0;
 }
 /**
@@ -17416,6 +17456,39 @@ static bool skill_parse_row_abradb(char* split[], int columns, int current)
 	return true;
 }
 
+static bool skill_parse_row_changematerialdb(char* split[], int columns, int current)
+{// SkillID
+	int i = atoi(split[0]);
+	short j = atoi(split[1]);
+	int x,y;
+
+	for(x=0; x<MAX_SKILL_PRODUCE_DB; x++){
+		if( skill_produce_db[x].nameid == i )
+			if( skill_produce_db[x].req_skill == GN_CHANGEMATERIAL )
+				break;
+	}
+
+	if( x >= MAX_SKILL_PRODUCE_DB ){
+		ShowError("changematerial_db: Not supported item ID(%d) for Change Material. \n", i);
+		return false;
+	}
+
+	if( current >= MAX_SKILL_PRODUCE_DB ) {
+		ShowError("skill_changematerial_db: Maximum amount of entries reached (%d), increase MAX_SKILL_PRODUCE_DB\n",MAX_SKILL_PRODUCE_DB);
+	}
+
+	skill_changematerial_db[current].itemid = i;
+	skill_changematerial_db[current].rate = j;
+
+	for( x = 2, y = 0; x+1 < columns && split[x] && split[x+1] && y < 5; x += 2, y++ )
+	{
+		skill_changematerial_db[current].qty[y] = atoi(split[x]);
+		skill_changematerial_db[current].qty_rate[y] = atoi(split[x+1]);
+	}
+
+	return true;
+}
+
 static void skill_readdb(void)
 {
 	// init skill db structures
@@ -17427,6 +17500,7 @@ static void skill_readdb(void)
 	memset(skill_spellbook_db,0,sizeof(skill_spellbook_db));
 	memset(skill_magicmushroom_db,0,sizeof(skill_magicmushroom_db));
 	memset(skill_reproduce_db,0,sizeof(skill_reproduce_db));
+	memset(skill_changematerial_db,0,sizeof(skill_changematerial_db));
 
 	// load skill databases
 	safestrncpy(skill_db[0].name, "UNKNOWN_SKILL", sizeof(skill_db[0].name));
@@ -17450,6 +17524,7 @@ static void skill_readdb(void)
 	sv_readdb(db_path, "magicmushroom_db.txt"  , ',',   1,  1, MAX_SKILL_MAGICMUSHROOM_DB, skill_parse_row_magicmushroomdb);
 	sv_readdb(db_path, "skill_reproduce_db.txt", ',',   1,  1, MAX_SKILL_DB, skill_parse_row_reproducedb);
 	sv_readdb(db_path, "skill_improvise_db.txt"      , ',',   2,  2, MAX_SKILL_IMPROVISE_DB, skill_parse_row_improvisedb);
+	sv_readdb(db_path, "skill_changematerial_db.txt"      , ',',   4,  4+2*5, MAX_SKILL_PRODUCE_DB, skill_parse_row_changematerialdb);
 
 }
 

+ 1 - 1
src/map/skill.h

@@ -13,7 +13,7 @@ struct skill_unit_group;
 struct status_change_entry;
 
 #define MAX_SKILL_DB			MAX_SKILL
-#define MAX_SKILL_PRODUCE_DB	260
+#define MAX_SKILL_PRODUCE_DB	270
 #define MAX_PRODUCE_RESOURCE	12
 #define MAX_SKILL_ARROW_DB		150
 #define MAX_ARROW_RESOURCE		5