Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 10.10 KB | None | 0 0
  1. newEntity{ base = "BASE_GEM", define_as = "CRYSTAL_FOCUS",
  2.     power_source = {arcane=true},
  3.     unique = true,
  4.     unided_name = "scintillating crystal",
  5.     name = "Crystal Focus", subtype = "multi-hued",
  6.     color = colors.WHITE, image = "object/artifact/crystal_focus.png",
  7.     level_range = {5, 12},
  8.     desc = [[This crystal radiates the power of the Spellblaze itself.]],
  9.     special_desc = function(self) return "(The created item can be activated to recover the Focus.)" end,
  10.     rarity = 200,
  11.     identified = false,
  12.     cost = 50,
  13.     material_level = 2,
  14.     color_attributes = {
  15.         damage_type = 'ARCANE',
  16.         alt_damage_type = 'ARCANE_SILENCE',
  17.         particle = 'manathrust',
  18.     },
  19.    
  20.     wielder = {
  21.         inc_stats = {[Stats.STAT_MAG] = 5 },
  22.         inc_damage = {[DamageType.ARCANE] = 20, [DamageType.BLIGHT] = 20 },
  23.     },
  24.  
  25.     max_power = 1, power_regen = 1,
  26.     use_power = { name = "combine with a weapon (makes a non enchanted weapon into an artifact)", power = 1, use = function(self, who, gem_inven, gem_item)
  27.         who:showInventory("Fuse with which weapon?", who:getInven("INVEN"), function(o) return (o.type == "weapon" or o.subtype == "hands" or o.subtype == "shield") and o.subtype ~= "mindstar" and not o.egoed and not o.unique and not o.rare and not o.archery end, function(o, item)
  28.             local oldname = o:getName{do_color=true}
  29.  
  30.             -- Remove the gem
  31.             who:removeObject(gem_inven, gem_item)
  32.             who:sortInven(gem_inven)
  33.  
  34.             local Entity = require("engine.Entity")
  35.             local ActorStats = require("engine.interface.ActorStats")
  36.             local crystalline_ego = Entity.new{
  37.                 name = "crystalline weapon",
  38.                 no_unique_lore = true,
  39.                 is_crystalline_weapon = true,
  40.                 power_source = {arcane=true},
  41.                 wielder = {
  42.                     combat_spellpower = 12,
  43.                     combat_dam = 12,
  44.                     inc_stats = {
  45.                         [ActorStats.STAT_WIL] = 3,
  46.                         [ActorStats.STAT_CON] = 3,
  47.                     },
  48.                     inc_damage = {ARCANE=10},
  49.                 },
  50.                 set_list = { {"is_crystalline_armor", true} },
  51.                 on_set_complete = function(self, wearer)
  52.                     self.talent_on_spell = { {chance=10, talent="T_MANATHRUST", level=3} }
  53.                     local weapon = self.combat or self.wielder.combat or self.special_combat
  54.                     if weapon then weapon.talent_on_hit = { T_MANATHRUST = {level=3, chance=10} } end
  55.                     self:specialSetAdd({"wielder","combat_spellcrit"}, 10)
  56.                     self:specialSetAdd({"wielder","combat_physcrit"}, 10)
  57.                     self:specialSetAdd({"wielder","resists_pen"}, {[engine.DamageType.ARCANE]=20, [engine.DamageType.PHYSICAL]=15})
  58.                     game.logPlayer(wearer, "#GOLD#As the crystalline weapon and armour are brought together, they begin to emit a constant humming.")
  59.                 end,
  60.                 on_set_broken = function(self, wearer)
  61.                     local weapon = self.combat or self.wielder.combat or self.special_combat
  62.                     self.talent_on_spell = nil
  63.                     if weapon then weapon.talent_on_hit = nil end
  64.                     game.logPlayer(wearer, "#GOLD#The humming from the crystalline artifacts fades as they are separated.")
  65.                 end,
  66.                 resolvers.generic(function(o)
  67.                     o.name = "Crystalline "..o.name:capitalize()
  68.                     o.unique = o.name
  69.                     o.desc = (o.desc or "") .." Transformed with the power of the Spellblaze."
  70.                     end),
  71.                 resolvers.generic(function(o)
  72.                     if o.combat and o.combat.dam then
  73.                         o.combat.dam = o.combat.dam * 1.25
  74.                         o.combat.damtype = engine.DamageType.ARCANE
  75.                     elseif o.wielder.combat and o.wielder.combat.dam then
  76.                         o.wielder.combat.dam = o.wielder.combat.dam * 1.25
  77.                         o.wielder.combat.convert_damage = o.wielder.combat.convert_damage or {}
  78.                         o.wielder.combat.convert_damage[engine.DamageType.ARCANE] = 100
  79.                     elseif o.special_combat then
  80.                         if o.special_combat.dam then
  81.                             o.special_combat.dam = o.special_combat.dam * 1.25
  82.                             o.special_combat.damtype = engine.DamageType.ARCANE
  83.                         end
  84.                         if o.special_combat.block then
  85.                             o.special_combat.block = o.special_combat.block * 1.25
  86.                         end
  87.                     end
  88.                    
  89.                     o.power = 1
  90.                     o.max_power = 1
  91.                     o.power_regen = 1
  92.                     o.use_no_wear = true
  93.                     o.use_power = { name = "recover the Crystal Focus (destroys this weapon)", power = 1, use = function(self, who, inven, item)
  94.                         local art_list = mod.class.Object:loadList("/data/general/objects/objects-maj-eyal.lua")
  95.                         local o = art_list.CRYSTAL_FOCUS:clone()
  96.                         o:resolve()
  97.                         o:resolve(nil, true)
  98.                         o:identify(true)
  99.                         who:addObject(who.INVEN_INVEN, o)
  100.                         who:sortInven(who.INVEN_INVEN)
  101.                         local name = self:getName({no_count=true, force_id=true, no_add_name=true})
  102.                         for i, h in ipairs(who.hotkey) do
  103.                             if h[2] == name then who.hotkey[i] = nil end
  104.                         end
  105.                         who.changed = true
  106.                         game.logPlayer(who, "You created: %s", o:getName{do_color=true})
  107.                         return {used=true, id=true, destroy=true}
  108.                     end }
  109.                 end),
  110.                 resolvers.genericlast(function(o) if o.wielder.learn_talent then o.wielder.learn_talent["T_COMMAND_STAFF"] = nil end end),
  111.                 fake_ego = true,
  112.             }
  113.             game.zone:applyEgo(o, crystalline_ego, "object", true)
  114.             local images = {
  115.                 battleaxe = "object/artifact/2haxe_crystalline.png",
  116.                 greatmaul = "object/artifact/2hmace_crystalline.png",
  117.                 greatsword = "object/artifact/2hsword_crystalline.png",
  118.                 dagger = "object/artifact/dagger_crystalline.png",
  119.                 longsword = "object/artifact/1hsword_crystalline.png",
  120.                 mace = "object/artifact/1hmace_crystalline.png",
  121.                 waraxe = "object/artifact/1haxe_crystalline.png",
  122.                 shield = "object/artifact/shield_crystalline.png",
  123.                 staff = "object/artifact/staff_crystalline.png",
  124.                 trident = "object/artifact/trident_crystalline.png",
  125.                 hands = "object/artifact/gauntlets_crystalline.png",
  126.             }
  127.             if images[o.subtype] then o.image = images[o.subtype] o:removeAllMOs() end
  128.             o:resolve()
  129.  
  130.             who:sortInven()
  131.             who.changed = true
  132.            
  133.             game.logPlayer(who, "You fix the crystal on the %s and create the %s.", oldname, o:getName{do_color=true})
  134.         end)
  135.     end,
  136.     no_npc_use = true},
  137. }
  138.  
  139. newEntity{ base = "BASE_GEM", define_as = "CRYSTAL_HEART",
  140.     power_source = {arcane=true},
  141.     unique = true,
  142.     unided_name = "coruscating crystal",
  143.     name = "Crystal Heart", subtype = "multi-hued",
  144.     color = colors.RED, image = "object/artifact/crystal_heart.png",
  145.     level_range = {35, 42},
  146.     desc = [[This crystal is huge, easily the size of your head. It sparkles brilliantly almost of its own accord.]],
  147.     special_desc = function(self) return "(The created item can be activated to recover the Heart.)" end,
  148.     rarity = 250,
  149.     identified = false,
  150.     cost = 200,
  151.     material_level = 5,
  152.     color_attributes = {
  153.         damage_type = 'ARCANE',
  154.         alt_damage_type = 'ARCANE_SILENCE',
  155.         particle = 'manathrust',
  156.     },
  157.    
  158.     wielder = {
  159.         inc_stats = {[Stats.STAT_CON] = 5 },
  160.         resists = {[DamageType.ARCANE] = 20, [DamageType.BLIGHT] = 20 },
  161.     },
  162.  
  163.     max_power = 1, power_regen = 1,
  164.     use_power = { name = "combine with a suit of body armor (makes a non enchanted armour into an artifact)", power = 1, use = function(self, who, gem_inven, gem_item)
  165.         -- Body armour only, can be cloth, light, heavy, or massive though. No clue if o.slot works for this.
  166.         who:showInventory("Fuse with which armor?", who:getInven("INVEN"), function(o) return o.type == "armor" and o.slot == "BODY" and not o.egoed and not o.unique and not o.rare end, function(o, item)
  167.             local oldname = o:getName{do_color=true}
  168.  
  169.             -- Remove the gem
  170.             who:removeObject(gem_inven, gem_item)
  171.             who:sortInven(gem_inven)
  172.  
  173.             local Entity = require("engine.Entity")
  174.             local ActorStats = require("engine.interface.ActorStats")
  175.             local crystalline_ego = Entity.new{
  176.                 name = "crystalline armour",
  177.                 no_unique_lore = true,
  178.                 is_crystalline_armor = true,
  179.                 power_source = {arcane=true},
  180.                 wielder = {
  181.                     combat_spellresist = 35,
  182.                     combat_physresist = 25,
  183.                     inc_stats = {
  184.                         [ActorStats.STAT_MAG] = 8,
  185.                         [ActorStats.STAT_CON] = 8,
  186.                         [ActorStats.STAT_LCK] = 12,
  187.                     },
  188.                     resists = {ARCANE=35, PHYSICAL=15},
  189.                     poison_immune=0.6,
  190.                     disease_immune=0.6,
  191.                 },
  192.                 set_list = { {"is_crystalline_weapon", true} },
  193.                 on_set_complete = function(self, who)
  194.                     self:specialSetAdd({"wielder","stun_immune"}, 0.5)
  195.                     self:specialSetAdd({"wielder","blind_immune"}, 0.5)
  196.                 end,
  197.                 resolvers.generic(function(o)
  198.                     o.name = "Crystalline "..o.name:capitalize()
  199.                     o.unique = o.name
  200.                     o.desc = (o.desc or "") .." Transformed with the power of the Spellblaze."
  201.                 end),
  202.                 resolvers.generic(function(o)
  203.                     -- This is supposed to add 1 def for crap cloth robes if for some reason you choose it instead of better robes, and then multiply by 1.25.
  204.                     o.wielder.combat_def = ((o.wielder.combat_def or 0) + 2) * 1.7
  205.                     -- Same for armour. Yay crap cloth!
  206.                     o.wielder.combat_armor = ((o.wielder.combat_armor or 0) + 3) * 1.7
  207.                    
  208.                     o.power = 1
  209.                     o.max_power = 1
  210.                     o.power_regen = 1
  211.                     o.use_no_wear = true
  212.                     o.use_power = { name = "recover the Crystal Heart (destroys this armour)", power = 1, use = function(self, who, inven, item)
  213.                         local art_list = mod.class.Object:loadList("/data/general/objects/objects-maj-eyal.lua")
  214.                         local o = art_list["CRYSTAL_HEART"]:clone()
  215.                         o:resolve()
  216.                         o:resolve(nil, true)
  217.                         o:identify(true)
  218.                         who:addObject(who.INVEN_INVEN, o)
  219.                         who:sortInven(who.INVEN_INVEN)
  220.                         local name = self:getName({no_count=true, force_id=true, no_add_name=true})
  221.                         for i, h in ipairs(who.hotkey) do
  222.                             if h[2] == name then who.hotkey[i] = nil end
  223.                         end
  224.                         who.changed = true
  225.                         game.logPlayer(who, "You created: %s", o:getName{do_color=true})
  226.                         return {used=true, id=true, destroy=true}
  227.                     end }
  228.                 end),
  229.             }
  230.             game.zone:applyEgo(o, crystalline_ego, "object", true)
  231.             local images = {
  232.                 cloth = "object/artifact/cloth_armour_crystalline.png",
  233.                 leather = "object/artifact/leather_armour_crystalline.png",
  234.                 heavy = "object/artifact/heavy_armour_crystalline.png",
  235.                 massive = "object/artifact/massive_armour_crystalline.png",
  236.             }
  237.             if images[o.subtype] then o.image = images[o.subtype] o:removeAllMOs() end
  238.             o:resolve()
  239.  
  240.             who:sortInven()
  241.             who.changed = true
  242.  
  243.             game.logPlayer(who, "You fix the crystal on the %s and create the %s.", oldname, o:getName{do_color=true})
  244.         end)
  245.     end,
  246.     no_npc_use = true},
  247. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement