Author Topic: looking for guidance.  (Read 302 times)

Legacy_Surek

  • Full Member
  • ***
  • Posts: 169
  • Karma: +0/-0
looking for guidance.
« on: November 25, 2014, 06:31:41 am »


               

I was hoping to get some help or guidance on this. This not a new idea but it’s something I was thinking about adding to my world. Basically I want to try to imp lent something, let’s just call it a focus item for now.



The basic idea would be is when a mage or sorcerer obtained the focus item their spells would increase in power a certain percentage. Let’s just say by 5 – 10 %. I’m sure if this is even possible but I was looking for some guidance on how I would go about implementing something like this. Maybe some sample script or were I would need to look to get a general idea on how I go about implementing something like this. Maybe someone else might have done something similar that I could look at the scripts and figure out how to do something similar.  Any help with this would be appreciated.



               
               

               
            

Legacy_MagicalMaster

  • Hero Member
  • *****
  • Posts: 2712
  • Karma: +0/-0
looking for guidance.
« Reply #1 on: November 25, 2014, 07:34:03 am »


               

You'd need to edit every spell script affected.


 


When calculating the damage, search the inventory of the caster for the item (or check an item slot if it's supposed to be there) and if they have the item then multiply the damage by 11 and then divide by 10.



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
looking for guidance.
« Reply #2 on: November 25, 2014, 01:13:52 pm »


               

If it is a case of spell damage being increased  - this could be done with nwnx


 


I released a modification to the nwnx_cool plugin.


One of the features is a Damage hook.


 


It allows you to determine the damage being inflicted to players or monsters, and actually modify the damage before it gets applied / displayed in combat log.


 


Using this logic, you could check for the focus item on each damage application, and if it is present, increase its damage by 50% etc


 


I use something similar except I hook it into custom feats.


 


For instance : If a player of mine has a feat called 'Adaptive Flesh' 


Their skin actually adapts to provide immunity to damage types over time.


 


If they suffer 18 consecutive attacks of fire damage, they gain up to 90% immunity to fire. However - their Skin can only retain memory of one damage type.


As they gain immunity to one damage type, it decreases any immunities they may have already by 5%.


However I have it setup that they get a 5% base immunity to all damage types by default.


 


This is done through the damage hook.


 


What your doing is kinda in reverse - but still do-able.


Instead of me checking to see if the player has a feat


You need to check that the person who damaged the monster, has an item.


 


The hook provides access to DamagedObject + DamageInflictor - allowing you to get the data needed to create your focus system.


 


http://www.nwnx.org/...5d7959d3559d972


Source code and compiled binary link can be found here.