Multiple magic schools spells pack

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
User avatar
Drakkan
Posts: 1317
Joined: Mon Dec 31, 2012 12:25 am

Re: Multiple magic schools spells pack (alpha version)

Post by Drakkan » Tue Apr 21, 2015 1:16 pm

AndakRainor wrote:Yes, all icons for new spells are new (77), and where created from Grimrock 2 asset pack and reusable and allowed modifications images. For the 3D effects, I only used the original game models so far, with a few custom lights, colors and one earthquake audio file.

I am now working on adding 3D models and effects as advised by Akroma, and will pick from the data he shared with me. Yesterday I prepared some new item icons for elemental enchanted daggers and swords. I plan to add weapon enchantment spells and other new things and merge a few current similar spells. The next version also will require the beta 2.2.4 of the game for the party movement speed functions.

Also, I worked on a system to force casters to use scrolls to learn spells. The current design is : you find a new spell scroll, you meet the requirements to cast it, you cast it with the scroll in mouse selection, it converts to a stackable empty scroll, then you are able to cast it without scroll (I check the spell name trait in the champion's traits) or to create this spell's scroll from an empty scroll in mouse selection and give it to another caster.

PS: I noticed yesterday a little "problem" with the meteor-like spells; first, the formula to set the number of projectiles is a little wrong, as it it can only be 0, 2 or more bolts, never 1, but with a true caster character it is never seen, second as this number scales with willpower and magic skills, the meteor hammer special attack for example is really really weak in the hands of a non caster character (0 or 2 in my test !!!).
regarding learning spells before cast - already invented I am using it in my mod, it is working nice. check
viewtopic.php?f=22&t=8365&hilit=before+casting+it
Breath from the unpromising waters.
Eye of the Atlantis

User avatar
AndakRainor
Posts: 673
Joined: Thu Nov 20, 2014 5:18 pm

Re: Multiple magic schools spells pack (alpha version)

Post by AndakRainor » Tue Apr 21, 2015 1:44 pm

Yes I checked this thread to add this system. I did something a little different to match the following goals;

- I wanted to track known spells for each champion and not globally for the party, as I have also taverns where champions can rest or be recruited. It makes more sens this way, but may be it is not a good idea from a game play point of view, I don't know yet...

- I didn't even try to write some generic code to add a usable item part to all scrolls definitions, may be I should !

- As I want casters to be able to share their spells with other casters, I first tried to find a way to add spells traits to all champions currently in the party matching the spell requirements when any champion casts it, but I didn't find a way to check requirements for a spell knowing its name, so I used the scroll creation method instead !

All this could change it's very new :)

User avatar
AndakRainor
Posts: 673
Joined: Thu Nov 20, 2014 5:18 pm

Re: Multiple magic schools spells pack (alpha version)

Post by AndakRainor » Wed Apr 22, 2015 3:06 pm

Ok I managed to simplify the scrolls requirements from a player point of view ! So now :

- You need a scroll in the caster's inventory or in mouse selection to learn a new spell.
- After that you can cast it freely, without the scroll.
- Also, you can learn a new spell when another champion casts it and you meet the requirements of that spell.

I had a great lua newbie cost to pay to achieve that, through imports and putting spells definitions in data tables (seen by all concerned code :evil: ), but finally it works ! 8-)

Azel
Posts: 808
Joined: Thu Nov 06, 2014 10:40 pm

Re: Multiple magic schools spells pack (alpha version)

Post by Azel » Wed Apr 22, 2015 10:17 pm

Nice work! As far as noob LUA... from what I've seen here (between both LoG2 and LoG2 Mods), the LUA noobs end up delivering some of the more memorable and enjoyable gaming experiences :mrgreen:

User avatar
AndakRainor
Posts: 673
Joined: Thu Nov 20, 2014 5:18 pm

Re: Multiple magic schools spells pack (alpha version)

Post by AndakRainor » Thu Jun 04, 2015 9:27 pm

Hi !

I'm currently working on enchantment spells, and I would like your opinion about the balance of bonus stats in Grimrock.
Here is a part of available enchantments, for items with an EquipmentItemComponent. The first column lists the item slots, and the four elemental columns are the resulting bonus of each of the 4 enchantment spells.

Code: Select all

+-------------+----------------+-----------------+----------------+------------------+
| enchantment | fire           | air             | water          | earth            |
+-------------+----------------+-----------------+----------------+------------------+
| shield      | evasion        | dexterity       | vitality       | protection       |
| helmet      | accuracy       | critical        | energy         | health           |
| chest_armor | strength       | dexterity       | willpower      | protection       |
| leg_armor   | fireResistance | shockResistance | coldResistance | poisonResistance |
| boots       | strength       | dexterity       | willpower      | vitality         |
| cloak       | energyRegen    | evasion         | healthRegen    | protection       |
| necklace    | accuracy       | haste           | energyRegen    | healthRegen      |
| gloves      | strength       | dexterity       | willpower      | vitality         |
| bracers     | haste          | accuracy        | willpower      | strength         |
+-------------+----------------+-----------------+----------------+------------------+
I tried to put together on the same slot stats that can feel competitive and an interesting choice for a player who has multiple elemental enchantments available. Now I have to choose the values for those bonuses.

I often read that stats are not well balanced in the game. What would it take for you to consider using an evasion bonus over a protection bonus, or vitality over strength or dexterity ? Are there any theory craft formulas somewhere I could use to compare stats ?
What about health and energy regeneration ?

I hope to show you the next build of the spell pack soon :)

User avatar
Drakkan
Posts: 1317
Joined: Mon Dec 31, 2012 12:25 am

Re: Multiple magic schools spells pack (alpha version)

Post by Drakkan » Tue Jun 09, 2015 1:44 pm

AndakRainor wrote:Hi !

I'm currently working on enchantment spells, and I would like your opinion about the balance of bonus stats in Grimrock.
Here is a part of available enchantments, for items with an EquipmentItemComponent. The first column lists the item slots, and the four elemental columns are the resulting bonus of each of the 4 enchantment spells.

Code: Select all

+-------------+----------------+-----------------+----------------+------------------+
| enchantment | fire           | air             | water          | earth            |
+-------------+----------------+-----------------+----------------+------------------+
| shield      | evasion        | dexterity       | vitality       | protection       |
| helmet      | accuracy       | critical        | energy         | health           |
| chest_armor | strength       | dexterity       | willpower      | protection       |
| leg_armor   | fireResistance | shockResistance | coldResistance | poisonResistance |
| boots       | strength       | dexterity       | willpower      | vitality         |
| cloak       | energyRegen    | evasion         | healthRegen    | protection       |
| necklace    | accuracy       | haste           | energyRegen    | healthRegen      |
| gloves      | strength       | dexterity       | willpower      | vitality         |
| bracers     | haste          | accuracy        | willpower      | strength         |
+-------------+----------------+-----------------+----------------+------------------+
I tried to put together on the same slot stats that can feel competitive and an interesting choice for a player who has multiple elemental enchantments available. Now I have to choose the values for those bonuses.

I often read that stats are not well balanced in the game. What would it take for you to consider using an evasion bonus over a protection bonus, or vitality over strength or dexterity ? Are there any theory craft formulas somewhere I could use to compare stats ?
What about health and energy regeneration ?

I hope to show you the next build of the spell pack soon :)
Hi
these enchantments look cool. How it will be working ? If you enchant some item with spell it is temporary or permanent effect ? How many enchantments one item could have ?
I could imagine this more like some "enchantment crafting" system, where you will require some specific items to enhance your items for minor pernament bonuses. As for spells I fear it could be too much overpowered. I think bonuses should be really minor (max + 2 to primary stat for example).
Also its kinda strange for me that for example enhancing leg_armor is improving resistances, while enhancing some other piece of armor is giving another bonus. I prefer this to be unified somehow, because this way player is quite confused. But again - I could better imagine this with some crafting system, where you for example find some stone of accuracy and you can enhance it in some armor piece.
Well, I wonder with what you will come out :)
Breath from the unpromising waters.
Eye of the Atlantis

User avatar
AndakRainor
Posts: 673
Joined: Thu Nov 20, 2014 5:18 pm

Re: Multiple magic schools spells pack (alpha version)

Post by AndakRainor » Tue Jun 09, 2015 7:56 pm

Well here are the details I have so far :
SpoilerShow

Code: Select all

enchant =
{ fireResistance = {function(e,v) e:setResistFire(v+(e:getResistFire() or 0)) end, 2.5, 20, " of Fire Resistance"},
  shockResistance = {function(e,v) e:setResistShock(v+(e:getResistShock() or 0)) end, 2.5, 20, " of Shock Resistance"},
  coldResistance = {function(e,v) e:setResistCold(v+(e:getResistCold() or 0)) end, 2.5, 20, " of Cold Resistance"},
  poisonResistance = {function(e,v) e:setResistPoison(v+(e:getResistPoison() or 0)) end, 2.5, 20, " of Poison Resistance"},
  strength = {function(e,v) e:setStrength(v+(e:getStrength() or 0)) end, 1, 3, " of Strength"},
  dexterity = {function(e,v) e:setDexterity(v+(e:getDexterity() or 0)) end, 1, 3, " of Dexterity"},
  willpower = {function(e,v) e:setWillpower(v+(e:getWillpower() or 0)) end, 1, 3, " of Willpower"},
  vitality = {function(e,v) e:setVitality(v+(e:getVitality() or 0)) end, 1, 8, " of Vitality"},
  --experience = {function(e,v) e:setExpRate(v+(e:getExpRate() or 0)) end, 4, 25, " of Wisdom"},
  accuracy = {function(e,v) e:setAccuracy(v+(e:getAccuracy() or 0)) end, 1, 8, " of Accuracy"},
  haste = {function(e,v) e:setCooldownRate(v+(e:getCooldownRate() or 0)) end, 2.5, 20, " of Haste"},
  critical = {function(e,v) e:setCriticalChance(v+(e:getCriticalChance() or 0)) end, 1, 8, " of Brutality"},
  evasion = {function(e,v) e:setEvasion(v+(e:getEvasion() or 0)) end, 2.5, 20, " of Evasion"},
  protection = {function(e,v) e:setProtection(v+(e:getProtection() or 0)) end, 1, 8, " of Protection"},
  health = {function(e,v) e:setHealth(v+(e:getHealth() or 0)) end, 5, 40, " of Higher Constitution"},
  healthRegen = {function(e,v) e:setHealthRegenerationRate(v+(e:getHealthRegenerationRate() or 0)) end, 30, 100, " of Physical Endurance"},
  energy = {function(e,v) e:setEnergy(v+(e:getEnergy() or 0)) end, 5, 40, " of Higher Spirituality"},
  energyRegen = {function(e,v) e:setEnergyRegenerationRate(v+(e:getEnergyRegenerationRate() or 0)) end, 30, 100, " of Spiritual Endurance"},
  aquatic = {function(e,v) enchant.willpower[1](e,v) e.go.item:addTrait("aquatic") end, 1, 3, " of the Abyss"},
}

fireEnchantment =
{
byName =
{ long_sword            = {"fire_blade_minor"},
  fire_blade_minor      = {"fire_blade_minor", "fire_blade"},
  fire_blade            = {"fire_blade_minor", "fire_blade", "fire_blade_major"},
  fire_blade_major      = {"fire_blade", "fire_blade_major"},
  lightning_blade_minor = {"fire_blade_minor"},
  lightning_blade       = {"fire_blade_minor", "fire_blade_minor", "fire_blade"},
  lightning_blade_major = {"fire_blade_minor", "fire_blade", "fire_blade"},
  frozen_blade_minor    = {"fire_blade_minor"},
  frozen_blade          = {"fire_blade_minor", "fire_blade_minor", "fire_blade"},
  frozen_blade_major    = {"fire_blade_minor", "fire_blade", "fire_blade"},
  venomous_blade_minor  = {"fire_blade_minor"},
  venomous_blade        = {"fire_blade_minor", "fire_blade_minor", "fire_blade"},
  venomous_blade_major  = {"fire_blade_minor", "fire_blade", "fire_blade"},
  blooddrop_cap  = {"falconskyre"},
  falconskyre    = {"blooddrop_cap"},
  etherweed      = {"blooddrop_cap"},
  mudwort        = {"blooddrop_cap"},
  blackmoss      = {"blackmoss", "blackmoss", "crystal_flower"},
  crystal_flower = {"crystal_flower", "crystal_flower", "blackmoss"},
  water_flask            = {"potion_rage"},
  potion_healing         = {"potion_rage"},
  potion_greater_healing = {"potion_rage", "potion_bear_form"},
  potion_energy          = {"potion_rage"},
  potion_greater_energy  = {"potion_rage", "potion_speed"},
  potion_poison          = {"water_flask"},
  potion_shield          = {"potion_rage"},
  potion_cure_poison     = {"potion_rage"},
  potion_cure_disease    = {"potion_rage"},
  potion_rage            = {"potion_healing", "potion_greater_healing", "potion_resurrection"},
  potion_speed           = {"potion_rage", "potion_energy", "potion_greater_energy"},
  potion_bear_form       = {"potion_rage"},
  potion_resurrection    = {"fire_bomb"},
  potion_strength        = {"potion_vitality"},
  potion_dexterity       = {"potion_strength"},
  potion_vitality        = {"potion_strength"},
  potion_willpower       = {"potion_strength"},
  fire_bomb   = {"potion_resurrection"},
  shock_bomb  = {"fire_bomb"},
  frost_bomb  = {"fire_bomb"},
  poison_bomb = {"fire_bomb"},
},
equipment =
{ shield      = enchant.evasion        ,
  helmet      = enchant.accuracy       ,
  chest_armor = enchant.strength       ,
  leg_armor   = enchant.fireResistance ,
  boots       = enchant.strength       ,
  cloak       = enchant.energyRegen    ,
  necklace    = enchant.accuracy       ,
  gloves      = enchant.strength       ,
  bracers     = enchant.haste          ,
},
weapon = enchant.strength,
food = {"turtle_eggs", "cheese", "horned_fruit", "blueberry_pie"}
}

airEnchantment =
{
byName =
{ long_sword            = {"lightning_blade_minor"},
  fire_blade_minor      = {"lightning_blade_minor"},
  fire_blade            = {"lightning_blade_minor", "lightning_blade_minor", "lightning_blade"},
  fire_blade_major      = {"lightning_blade_minor", "lightning_blade", "lightning_blade"},
  lightning_blade_minor = {"lightning_blade_minor", "lightning_blade"},
  lightning_blade       = {"lightning_blade_minor", "lightning_blade", "lightning_blade_major"},
  lightning_blade_major = {"lightning_blade", "lightning_blade_major"},
  frozen_blade_minor    = {"lightning_blade_minor"},
  frozen_blade          = {"lightning_blade_minor", "lightning_blade_minor", "lightning_blade"},
  frozen_blade_major    = {"lightning_blade_minor", "lightning_blade", "lightning_blade"},
  venomous_blade_minor  = {"lightning_blade_minor"},
  venomous_blade        = {"lightning_blade_minor", "lightning_blade_minor", "lightning_blade"},
  venomous_blade_major  = {"lightning_blade_minor", "lightning_blade", "lightning_blade"},
  blooddrop_cap  = {"falconskyre"},
  falconskyre    = {"etherweed"},
  etherweed      = {"falconskyre"},
  mudwort        = {"falconskyre"},
  blackmoss      = {"blackmoss", "blackmoss", "crystal_flower"},
  crystal_flower = {"crystal_flower", "crystal_flower", "blackmoss"},
  water_flask            = {"potion_speed"},
  potion_healing         = {"potion_speed"},
  potion_greater_healing = {"potion_speed", "potion_bear_form"},
  potion_energy          = {"potion_speed"},
  potion_greater_energy  = {"potion_speed", "potion_speed"},
  potion_poison          = {"water_flask"},
  potion_shield          = {"potion_speed"},
  potion_cure_poison     = {"potion_speed"},
  potion_cure_disease    = {"potion_speed"},
  potion_rage            = {"potion_speed", "potion_energy", "potion_greater_energy"},
  potion_speed           = {"potion_healing", "potion_greater_healing", "potion_resurrection"},
  potion_bear_form       = {"potion_speed"},
  potion_resurrection    = {"shock_bomb"},
  potion_strength        = {"potion_dexterity"},
  potion_dexterity       = {"potion_vitality"},
  potion_vitality        = {"potion_dexterity"},
  potion_willpower       = {"potion_dexterity"},
  fire_bomb   = {"shock_bomb"},
  shock_bomb  = {"potion_resurrection"},
  frost_bomb  = {"shock_bomb"},
  poison_bomb = {"shock_bomb"},
},
equipment =
{ shield      = enchant.dexterity       ,
  helmet      = enchant.critical        ,
  chest_armor = enchant.dexterity       ,
  leg_armor   = enchant.shockResistance ,
  boots       = enchant.dexterity       ,
  cloak       = enchant.evasion         ,
  necklace    = enchant.haste           ,
  gloves      = enchant.dexterity       ,
  bracers     = enchant.accuracy        ,
},
weapon = enchant.dexterity,
food = {"cheese", "horned_fruit", "turtle_eggs", "blueberry_pie"}
}

waterEnchantment =
{
byName =
{ long_sword            = {"frozen_blade_minor"},
  fire_blade_minor      = {"frozen_blade_minor"},
  fire_blade            = {"frozen_blade_minor", "frozen_blade_minor", "frozen_blade"},
  fire_blade_major      = {"frozen_blade_minor", "frozen_blade", "frozen_blade"},
  lightning_blade_minor = {"frozen_blade_minor"},
  lightning_blade       = {"frozen_blade_minor", "frozen_blade_minor", "frozen_blade"},
  lightning_blade_major = {"frozen_blade_minor", "frozen_blade", "frozen_blade"},
  frozen_blade_minor    = {"frozen_blade_minor", "frozen_blade"},
  frozen_blade          = {"frozen_blade_minor", "frozen_blade", "frozen_blade_major"},
  frozen_blade_major    = {"frozen_blade", "frozen_blade_major"},
  venomous_blade_minor  = {"frozen_blade_minor"},
  venomous_blade        = {"frozen_blade_minor", "frozen_blade_minor", "frozen_blade"},
  venomous_blade_major  = {"frozen_blade_minor", "frozen_blade", "frozen_blade"},
  blooddrop_cap  = {"etherweed"},
  falconskyre    = {"etherweed"},
  etherweed      = {"mudwort"},
  mudwort        = {"etherweed"},
  blackmoss      = {"blackmoss", "blackmoss", "crystal_flower"},
  crystal_flower = {"crystal_flower", "crystal_flower", "blackmoss"},
  flask                  = {"water_flask"},
  water_flask            = {"potion_energy"},
  potion_healing         = {"potion_energy",},
  potion_greater_healing = {"potion_energy", "potion_energy", "potion_greater_energy"},
  potion_energy          = {"potion_healing", "potion_healing", "potion_greater_energy"},
  potion_greater_energy  = {"potion_healing", "potion_greater_healing", "potion_resurrection"},
  potion_poison          = {"water_flask"},
  potion_shield          = {"potion_energy", "potion_greater_energy"},
  potion_cure_poison     = {"potion_energy", "potion_greater_energy"},
  potion_cure_disease    = {"potion_energy", "potion_greater_energy"},
  potion_rage            = {"potion_energy", "potion_greater_energy"},
  potion_speed           = {"potion_energy", "potion_greater_energy"},
  potion_bear_form       = {"potion_greater_energy"},
  potion_resurrection    = {"frost_bomb"},
  potion_strength        = {"potion_willpower"},
  potion_dexterity       = {"potion_willpower"},
  potion_vitality        = {"potion_willpower"},
  potion_willpower       = {"potion_vitality"},
  fire_bomb   = {"frost_bomb"},
  shock_bomb  = {"frost_bomb"},
  frost_bomb  = {"potion_resurrection"},
  poison_bomb = {"frost_bomb"},
},
equipment =
{ shield      = enchant.aquatic        ,
  helmet      = enchant.energy         ,
  chest_armor = enchant.willpower      ,
  leg_armor   = enchant.coldResistance ,
  boots       = enchant.energyRegen    ,
  cloak       = enchant.healthRegen    ,
  necklace    = enchant.energyRegen    ,
  gloves      = enchant.willpower      ,
  bracers     = enchant.willpower      ,
},
weapon = enchant.aquatic,
food = {"turtle_eggs", "horned_fruit", "cheese", "blueberry_pie"}
}

earthEnchantment =
{
byName =
{ long_sword            = {"venomous_blade_minor"},
  fire_blade_minor      = {"venomous_blade_minor"},
  fire_blade            = {"venomous_blade_minor", "venomous_blade_minor", "venomous_blade"},
  fire_blade_major      = {"venomous_blade_minor", "venomous_blade", "venomous_blade"},
  lightning_blade_minor = {"venomous_blade_minor"},
  lightning_blade       = {"venomous_blade_minor", "venomous_blade_minor", "venomous_blade"},
  lightning_blade_major = {"venomous_blade_minor", "venomous_blade", "venomous_blade"},
  frozen_blade_minor    = {"venomous_blade_minor"},
  frozen_blade          = {"venomous_blade_minor", "venomous_blade_minor", "venomous_blade"},
  frozen_blade_major    = {"venomous_blade_minor", "venomous_blade", "venomous_blade"},
  venomous_blade_minor  = {"venomous_blade_minor", "venomous_blade"},
  venomous_blade        = {"venomous_blade_minor", "venomous_blade", "venomous_blade_major"},
  venomous_blade_major  = {"venomous_blade", "venomous_blade_major"},
  blooddrop_cap  = {"mudwort"},
  falconskyre    = {"mudwort"},
  etherweed      = {"mudwort"},
  mudwort        = {"blooddrop_cap"},
  blackmoss      = {"blackmoss", "blackmoss", "crystal_flower"},
  crystal_flower = {"crystal_flower", "crystal_flower", "blackmoss"},
  water_flask            = {"potion_healing"},
  potion_healing         = {"potion_energy", "potion_energy", "potion_greater_healing"},
  potion_greater_healing = {"potion_energy", "potion_greater_energy", "potion_resurrection"},
  potion_energy          = {"potion_healing"},
  potion_greater_energy  = {"potion_healing", "potion_healing", "potion_greater_healing"},
  potion_poison          = {"water_flask"},
  potion_shield          = {"potion_healing", "potion_greater_healing"},
  potion_cure_poison     = {"potion_healing", "potion_greater_healing"},
  potion_cure_disease    = {"potion_healing", "potion_greater_healing"},
  potion_rage            = {"potion_healing", "potion_greater_healing"},
  potion_speed           = {"potion_healing", "potion_greater_healing"},
  potion_bear_form       = {"potion_greater_healing"},
  potion_resurrection    = {"poison_bomb"},
  potion_strength        = {"potion_vitality"},
  potion_dexterity       = {"potion_vitality"},
  potion_vitality        = {"potion_strength"},
  potion_willpower       = {"potion_vitality"},
  fire_bomb   = {"poison_bomb"},
  shock_bomb  = {"poison_bomb"},
  frost_bomb  = {"poison_bomb"},
  poison_bomb = {"potion_resurrection"},
},
equipment =
{ shield      = enchant.protection       ,
  helmet      = enchant.health           ,
  chest_armor = enchant.protection       ,
  leg_armor   = enchant.poisonResistance ,
  boots       = enchant.vitality         ,
  cloak       = enchant.protection       ,
  necklace    = enchant.healthRegen      ,
  gloves      = enchant.vitality         ,
  bracers     = enchant.strength         ,
},
weapon = enchant.critical,
food = {"horned_fruit", "cheese", "turtle_eggs", "blueberry_pie"}
}

function enchantment(tab, power)
  local item = getMouseItem()
  power = math.max(0, math.min(1, power))
  if item then
    for old,new in pairs(tab.byName) do
      if item.go.name == old then
        power = quantum(1 + (#new-1)*power)
        if item:getStackable() then
          local stack = item:getStackSize()
          item = spawn(new[power]).item
          item:setStackSize(stack)
          setMouseItem(item)
        else 
          setMouseItem(spawn(new[power]).item)
        end
        playSound("generic_spell")
        return
      end
    end
    if item.go.equipmentitem then
      local new = nil
      for k,v in pairs(tab.equipment) do if item:hasTrait(k) then new = v break end end
      if not new then new = tab.weapon end
      power = quantum(new[2] + (new[3]-new[2])*power)
      item = spawn(item.go.name).item
      new[1](item.go.equipmentitem, power)
      item:setUiName(item:getUiName()..new[4])
      setMouseItem(item)
      playSound("generic_spell")
      return
    end                                                                                      
    if item.go.meleeattack or item:hasTrait("firearm") or item:hasTrait("missile_weapon") then
      -- or item:hasTrait("light_weapon") or item:hasTrait("heavy_weapon") 
      local new = tab.weapon
      power = quantum(new[2] + (new[3]-new[2])*power)
      item = spawn(item.go.name).item
      item.go:createComponent("EquipmentItem")
      new[1](item.go.equipmentitem, power)
      item:setUiName(item:getUiName()..new[4])
      setMouseItem(item)
      playSound("generic_spell")
      return
    end
    if item.go.usableitem and item.go.usableitem:getNutritionValue()>0 then
      local new = tab.food
      power = quantum(1 + (#new-1)*power*math.random())
      if item:getStackable() then
        local stack = item:getStackSize()
        item = spawn(new[power]).item
        item:setStackSize(stack)
        setMouseItem(item)
      else 
        setMouseItem(spawn(new[power]).item)
      end
      playSound("generic_spell")
      return
    end
    hudPrint("You cannot enchant this item.")
  else
    hudPrint("You must pick an item to enchant.")
  end
  playSound("spell_fizzle")
end
To focus just on the first table, it is a list of the functions used to modify the bonus stats of the EquipmentItemComponent.
The function at the end selects the appropriate enchant to apply:
- An item can only have one enchantment on it at any time and it is permanent (it can be changed for another enchantment).
- The enchantment type depends on the item slot.
- The spells cost 100 energy and nothing else, but the idea of consuming some items to craft the enchant can be a good one, especially if you consider bonus stats overpowered and want to limit it.
- Some items like the fire sword, potions, herbs, bombs, ..., can be transformed into other items of the same category.
- The power of the resulting enchant varies from lowest value to maximum value based on the elemental magic skill and concentration.
- An enchanted item with bonus stats has its UI name extended with for example " of Fire Resistance".
- A numeric bonus is always rounded randomly to an integer value.

To summarize the weapon/equipment bonuses in this table you have :
- resistances, haste, evasion : from 2.5 to 20 points.
- strength, dexterity, willpower : 1 to 3.
- accuracy, critical, protection, vitality : 1 to 8
- health, energy : 5 to 40
- health regeneration, energy regeneration : 30% to 100%
- one special water enchant that gives the "aquatic" trait to a weapon or shield ! Hooray for the underwater meteor hammer "of the Abyss" :shock:

I also thought about letting the player choose an enchantment independently of the item slot, but if I did this, wouldn't you just put +strength on ALL the items of your warrior ?

User avatar
AndakRainor
Posts: 673
Joined: Thu Nov 20, 2014 5:18 pm

Re: Multiple magic schools spells pack : new version is out!

Post by AndakRainor » Sun Jun 14, 2015 3:13 pm

Hi every one !

Good news, new version is out ! Check out the 105 spells for grimrock 2 version beta 2.2.4 here : http://ge.tt/9HPTdWE2
This time I share a test dungeon with the spell assets so you can easily install it.
The zip file is cut in 2 parts, as it is quite bigger than the spell assets alone, mainly due to the presence of the winter tileset by Skuggasveinn. (However it is not needed for the spells to work if you plan on using them in any way).

A special thank to Akroma ;) who shared a lot of ideas and visual effects I used in this version, in particular the enchantment and trap spells.

Let me know all your thoughts on those spells :)

Dunkler
Posts: 73
Joined: Thu Jul 10, 2014 3:20 pm

Re: Multiple magic schools spells pack : new version availab

Post by Dunkler » Mon Jun 15, 2015 2:05 pm

Andak that is just great! Thanks for your work!

User avatar
Eleven Warrior
Posts: 735
Joined: Thu Apr 18, 2013 2:32 pm
Location: Australia

Re: Multiple magic schools spells pack : new version availab

Post by Eleven Warrior » Thu Jun 18, 2015 2:34 am

Yeah thxs. The problem is I loaded the 2 files into winzip and nothing just 1 file. I am not sure if the 2 files are .dat or editor files. WinZip will open the 1st but not the 2nd file comes up with error, can you make it just 1 file matey

The error winzip throws up: Error: unable to seek to beginning of central directory.

Post Reply