trader.txt 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. event.load("entity_click");
  2. event.load("item_air_click");
  3. beer = read.item("{id:\"minecraft:player_head\",Count:1b,tag:{SkullOwner:{Properties:{textures:[{Value:\"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNDE2OGI5ODA5OGEwYzRhMjllMjA0NjcwNDYzMDkxZGI2MDcwZTc3ZDg2NzY5ZDk4NWY2YmVmNDA3NWU1In19fQ==\"}]},Id:[I;-919099029,-843296815,-1978014726,-1632767213]},display:{Name:'{\"text\":\"§FBeer\"}'}}}");
  4. bread = read.item("{id:\"minecraft:player_head\",Count:1b,tag:{SkullOwner:{Properties:{textures:[{Value:\"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjM0ODdkNDU3ZjkwNjJkNzg3YTNlNmNlMWM0NjY0YmY3NDAyZWM2N2RkMTExMjU2ZjE5YjM4Y2U0ZjY3MCJ9fX0=\"}]},Id:[I;-1486995616,574768169,-1899053858,2001973348]},display:{Name:'{\"text\":\"§FBread\"}'}}}");
  5. gem = read.item("{id:\"km:flawless_gem_stone\",Count:1b,tag:{color:16724530,display:{Name:'{\"text\":\"§fRuby\"}'}}}");
  6. gem2 = read.item("{id:\"km:flawless_gem_stone\",Count:1b,tag:{color:3289855,display:{Name:'{\"text\":\"§fSapphire\"}'}}}");
  7. gem3 = read.item("{id:\"km:flawless_gem_stone\",Count:1b,tag:{color:13664802,display:{Name:'{\"text\":\"§fAmber\"}'}}}");
  8. potion = read.item("{id:\"minecraft:splash_potion\",Count:1b,tag:{CustomPotionEffects:[{Duration:400,Id:7b,Amplifier:100b}],Potion:\"minecraft:haste\",HideFlags:32,display:{Name:'{\"text\":\"§f?\"}'}}}");
  9. haste = read.item("{id:\"minecraft:potion\",Count:1b,tag:{CustomPotionEffects:[{Duration:2400,Id:3b,Amplifier:10b}],Potion:\"minecraft:water\",HideFlags:32,display:{Name:'{\"text\":\"§f?\"}'}}}");
  10. allPotion = read.item("{id:\"minecraft:splash_potion\",Count:1b,tag:{CustomPotionEffects:[{Id:2b,Amplifier:5,Duration:4000},
  11. {Id:3b,Amplifier:5,Duration:4000},{Id:4b,Amplifier:5,Duration:4000},{Id:5b,Amplifier:5,Duration:4000},
  12. {Id:6b,Amplifier:5,Duration:4000},{Id:7b,Amplifier:5,Duration:4000},{Id:8b,Amplifier:5,Duration:4000},{Id:9b,Amplifier:5,Duration:4000},
  13. {Id:10b,Amplifier:5,Duration:4000},{Id:11b,Amplifier:5,Duration:4000},{Id:12b,Amplifier:5,Duration:4000},
  14. {Id:13b,Amplifier:5,Duration:4000},{Id:14b,Amplifier:5,Duration:4000},{Id:15b,Amplifier:5,Duration:4000},
  15. {Id:16b,Amplifier:5,Duration:4000},{Id:17b,Amplifier:5,Duration:4000},{Id:18b,Amplifier:5,Duration:4000},{Id:19b,Amplifier:5,Duration:4000},
  16. {Id:20b,Amplifier:5,Duration:4000},{Id:21b,Amplifier:5,Duration:4000},{Id:22b,Amplifier:5,Duration:4000},{Id:23b,Amplifier:5,Duration:4000},
  17. {Id:24b,Amplifier:5,Duration:4000},{Id:25b,Amplifier:5,Duration:4000},{Id:26b,Amplifier:5,Duration:4000},
  18. {Id:27b,Amplifier:5,Duration:4000},{Id:28b,Amplifier:5,Duration:4000},{Id:29b,Amplifier:5,Duration:4000},{Id:30b,Amplifier:5,Duration:4000},
  19. {Id:31b,Amplifier:5,Duration:4000},{Id:32b,Amplifier:5,Duration:4000}],Potion:\"minecraft:water\",HideFlags:32,display:{Name:'{\"text\":\"§f?\"}'}}}");
  20. luck = read.item("{id:\"minecraft:potion\",Count:1b,tag:{CustomPotionEffects:[{Duration:4000,Id:26b,Amplifier:10b}],CustomPotionColor:-1,HideFlags:32,display:{Name:'{\"text\":\"§f?\"}'}}}");
  21. shoes = read.item("{id:\"minecraft:leather_boots\",Count:1b,tag:{Damage:0,Unbreakable:true,Enchantments:[{lvl:5s,id:\"minecraft:protection\"}],display:{color:1908001,Name:'{\"text\":\"§bKajetans Boots\"}'}}}");
  22. item.addAttribute(shoes, "generic.armor", read.slot("feet"), 5, 0);
  23. item.addAttribute(shoes, "generic.armor_toughness", read.slot("feet"), 5, 0);
  24. item.addAttribute(shoes, "generic.knockback_resistance", read.slot("feet"), 0.5, 0);
  25. item.addAttribute(shoes, "generic.movement_speed", read.slot("feet"), 0.05, 0);
  26. chest = read.item("{id:\"minecraft:leather_chestplate\",Count:1b,tag:{Damage:0,Unbreakable:true,Enchantments:[{lvl:5s,id:\"minecraft:protection\"}],display:{color:1908001,Name:'{\"text\":\"§bKajetans Tunic\"}'}}}");
  27. item.addAttribute(chest, "generic.armor", read.slot("chest"), 5, 0);
  28. item.addAttribute(chest, "generic.armor_toughness", read.slot("chest"), 5, 0);
  29. item.addAttribute(chest, "generic.knockback_resistance", read.slot("chest"), 0.5, 0);
  30. item.addAttribute(chest, "generic.attack_speed", read.slot("chest"), 5, 0);
  31. head = read.item("{id:\"minecraft:leather_helmet\",Count:1b,tag:{Damage:0,Unbreakable:true,Enchantments:[{lvl:5s,id:\"minecraft:protection\"}],display:{color:1908001,Name:'{\"text\":\"§bKajetans Cap\"}'}}}");
  32. item.addAttribute(head, "generic.armor", read.slot("head"), 5, 0);
  33. item.addAttribute(head, "generic.armor_toughness", read.slot("head"), 5, 0);
  34. item.addAttribute(head, "generic.knockback_resistance", read.slot("head"), 0.5, 0);
  35. pants = read.item("{id:\"minecraft:leather_leggings\",Count:1b,tag:{Damage:0,Unbreakable:true,Enchantments:[{lvl:5s,id:\"minecraft:protection\"}],display:{color:11546150,Name:'{\"text\":\"§bKajetans Pants\"}'}}}");
  36. item.addAttribute(pants, "generic.armor", read.slot("legs"), 5, 0);
  37. item.addAttribute(pants, "generic.armor_toughness", read.slot("legs"), 5, 0);
  38. item.addAttribute(pants, "generic.knockback_resistance", read.slot("legs"), 0.5, 0);
  39. item.addAttribute(pants, "generic.max_health", read.slot("legs"), 20, 0);
  40. elytra = read.item("{id:\"minecraft:elytra\",Count:1b,tag:{Damage:0,Unbreakable:true}}");
  41. msg("dev", "§bTrader §rloaded.");
  42. @wait
  43. wait();
  44. if(event == "item_air_click" && hand == "MAIN_HAND") {
  45. item = living.getEquip(player, "hand");
  46. beer_amount = item.clone(beer);
  47. item.setAmount(beer_amount, item.getAmount(item));
  48. if(text.item(item) == text.item(beer_amount)) {
  49. entity.addEffect(player, "nausea", 400, 0);
  50. entity.addEffect(player, "luck", 1200, 1);
  51. item.setAmount(item, item.getAmount(item) - 1);
  52. }
  53. }
  54. if(event == "entity_click") {
  55. if(hand == "OFF_HAND") {
  56. goto("wait");
  57. }
  58. entity_type = entity.getType(entity);
  59. if(entity_type != "human") {
  60. goto("wait");
  61. }
  62. entity_name = entity.getName(entity);
  63. shop_name = concat(entity_name, "'s shop");
  64. if(entity_name == "Alena") {
  65. shop = shop.new();
  66. buy_item = read.item("km:coin_copper", 32);
  67. shop.addOffer(shop, buy_item, beer, 999);
  68. shop.open(shop, player, shop_name);
  69. goto("wait");
  70. }
  71. if(entity_name == "Franz") {
  72. shop = shop.new();
  73. buy_item = read.item("km:coin_copper", 32);
  74. shop.addOffer(shop, buy_item, beer, 999);
  75. shop.open(shop, player, shop_name);
  76. goto("wait");
  77. }
  78. if(entity_name == "Berta") {
  79. shop = shop.new();
  80. buy_item = read.item("km:coin_copper", 16);
  81. shop.addOffer(shop, buy_item, bread, 999);
  82. shop.open(shop, player, shop_name);
  83. goto("wait");
  84. }
  85. if(entity_name == "Hans") {
  86. shop = shop.new();
  87. shop.addOffer(shop, read.item("minecraft:string", 2), read.item("km:coin_copper", 1), 999);
  88. shop.addOffer(shop, read.item("minecraft:rotten_flesh", 1), read.item("km:coin_copper", 1), 999);
  89. shop.addOffer(shop, read.item("minecraft:bone", 2), read.item("km:coin_copper", 1), 999);
  90. shop.addOffer(shop, read.item("minecraft:gunpowder", 1), read.item("km:coin_copper", 1), 999);
  91. shop.addOffer(shop, read.item("minecraft:ender_pearl", 1), read.item("km:coin_copper", 1), 999);
  92. shop.open(shop, player, shop_name);
  93. goto("wait");
  94. }
  95. if(entity_name == "Frieda") {
  96. shop = shop.new();
  97. shop.addOffer(shop, read.item("km:coin_silver", 4), read.item("km:cherry_sapling", 1), 999);
  98. shop.addOffer(shop, read.item("km:coin_silver", 2), read.item("km:apricot_sapling", 1), 999);
  99. shop.addOffer(shop, read.item("km:coin_silver", 2), read.item("km:pear_sapling", 1), 999);
  100. shop.addOffer(shop, read.item("km:coin_silver", 2), read.item("km:plum_sapling", 1), 999);
  101. shop.open(shop, player, shop_name);
  102. goto("wait");
  103. }
  104. if(entity_name == "Bartholomäus Tilg") {
  105. shop = shop.new();
  106. shop.addOffer(shop, read.item("minecraft:diamond", 2), read.item("km:coin_silver", 3), 999);
  107. shop.addOffer(shop, gem3, read.item("km:coin_gold", 1), 999);
  108. shop.addOffer(shop, gem2, read.item("km:coin_gold", 2), 999);
  109. shop.addOffer(shop, gem, read.item("km:coin_gold", 5), 999);
  110. shop.addDoubleOffer(shop, read.item("km:coin_gold", 64), read.item("km:coin_gold", 64), read.item("minecraft:trident"), 999);
  111. //shop.addOffer(shop, read.item("km:coin_gold", 1), gem3, 999);
  112. //shop.addOffer(shop, read.item("km:coin_gold", 2), gem2, 999);
  113. //shop.addOffer(shop, read.item("km:coin_gold", 5), gem, 999);
  114. shop.open(shop, player, shop_name);
  115. goto("wait");
  116. }
  117. if(entity_name == "Alchemis Bartl") {
  118. shop = shop.new();
  119. shop.addOffer(shop, read.item("minecraft:glass_bottle", 3), read.item("km:coin_copper", 10), 999);
  120. shop.addOffer(shop, read.item("minecraft:nether_wart", 1), read.item("km:coin_copper", 2), 999);
  121. shop.addOffer(shop, read.item("minecraft:sugar", 2), read.item("km:coin_copper", 1), 999);
  122. shop.addOffer(shop, read.item("minecraft:spider_eye", 1), read.item("km:coin_copper", 10), 999);
  123. shop.addOffer(shop, read.item("minecraft:blaze_powder", 1), read.item("km:coin_copper", 10), 999);
  124. shop.addOffer(shop, read.item("minecraft:magma_cream", 1), read.item("km:coin_copper", 30), 999);
  125. shop.addOffer(shop, read.item("minecraft:redstone", 1), read.item("km:coin_copper", 1), 999);
  126. shop.addOffer(shop, read.item("minecraft:glowstone_dust", 1), read.item("km:coin_copper", 5), 999);
  127. shop.addOffer(shop, read.item("minecraft:phantom_membrane", 1), read.item("km:coin_copper", 40), 999);
  128. shop.addOffer(shop, read.item("minecraft:ghast_tear", 1), read.item("km:coin_copper", 55), 999);
  129. shop.addOffer(shop, read.item("minecraft:rabbit_foot", 1), read.item("km:coin_silver", 1), 999);
  130. shop.addOffer(shop, read.item("minecraft:golden_carrot", 1), read.item("km:coin_silver", 1), 999);
  131. shop.addOffer(shop, read.item("minecraft:glistering_melon_slice", 1), read.item("km:coin_silver", 1), 999);
  132. shop.addOffer(shop, read.item("minecraft:turtle_helmet", 1), read.item("km:coin_silver", 5), 999);
  133. shop.addOffer(shop, read.item("km:coin_copper", 3), read.item("minecraft:bone", 1), 999);
  134. shop.open(shop, player, shop_name);
  135. goto("wait");
  136. }
  137. if(entity_name == "Sven") {
  138. shop = shop.new();
  139. shop.addOffer(shop, read.item("km:coin_copper", 30), read.item("minecraft:experience_bottle", 1), 999);
  140. shop.addOffer(shop, read.item("km:coin_gold", 8), potion, 999);
  141. shop.addOffer(shop, read.item("km:coin_gold", 1), haste, 999);
  142. shop.addOffer(shop, read.item("km:coin_gold", 64), allPotion, 999);
  143. shop.addOffer(shop, read.item("km:coin_gold", 2), luck, 999);
  144. shop.addOffer(shop, read.item("km:coin_gold", 35), head, 999);
  145. shop.addOffer(shop, read.item("km:coin_gold", 40), chest, 999);
  146. shop.addOffer(shop, read.item("km:coin_gold", 40), pants, 999);
  147. shop.addOffer(shop, read.item("km:coin_gold", 40), shoes, 999);
  148. shop.open(shop, player, shop_name);
  149. goto("wait");
  150. }
  151. if(entity_name == "Alfred Nabel") {
  152. shop = shop.new();
  153. shop.addOffer(shop, read.item("km:coin_copper", 6), read.item("minecraft:gunpowder", 1), 999);
  154. shop.addOffer(shop, read.item("km:coin_copper", 40), read.item("minecraft:tnt", 1), 999);
  155. shop.addOffer(shop, read.item("km:coin_copper", 2), read.item("minecraft:paper", 1), 999);
  156. shop.addOffer(shop, read.item("km:coin_copper", 20), read.item("minecraft:fire_charge", 1), 999);
  157. shop.open(shop, player, shop_name);
  158. goto("wait");
  159. }
  160. if(entity_name == "Tree") {
  161. shop = shop.new();
  162. shop.addOffer(shop, read.item("km:coin_gold", 32), read.item("minecraft:beacon", 1), 999);
  163. shop.addOffer(shop, read.item("minecraft:dragon_head", 1), read.item("km:coin_gold", 20), 999);
  164. shop.addOffer(shop, read.item("km:coin_silver", 20), read.item("minecraft:end_crystal", 1), 999);
  165. //shop.addOffer(shop, read.item("minecraft:dragon_egg", 1), read.item("km:coin_gold", 10), 999);
  166. shop.addDoubleOffer(shop, read.item("km:coin_gold", 64), read.item("km:coin_gold", 64), elytra, 999);
  167. shop.open(shop, player, shop_name);
  168. goto("wait");
  169. }
  170. }
  171. goto("wait");