Author Topic: Disease Pathogen System?  (Read 379 times)

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Disease Pathogen System?
« on: July 06, 2012, 02:20:41 pm »


               I'm wanting to create a Disease / Pathogen system.
Im just wondering if anything like this exists already.


eg - Ability to incubate a Disease,
        Spread Disease through Proximety
        Spread Disease through physical contact.
        Adverse Effects vs Races / Subraces
        Cured by :  Spells/Potions/Consumables


I know diseases exist already in the game.
However

1 . Can the disease 2da file be added to - as a server side 2da, without needing client 2da?
or would it be better to avoid the disease system in nwn already, altogether, and make a custom one?


I'd love to be able to data-drive my diseases as well.

eg-
Disease ID: 0001 -  (Numerical value, that is cached onto the module, and used to reference all further settings) 
Disease Name : Death Rot
Races Affected: 0  (for all)
SubraceIDs Affected: 21   (for my vampire subrace)
Incubation Time: 3600   (1 Hour for full effect)
Pre-Incubation HB Rate: 300  (Every 5 Minutes, the Pre-Incubation HB Script for the Disease fires)
Pre-Incubation HBScript: dis_drot_p_hb   (When fired, it applies a 5 Minute Debuff to Charisma, Consitution, and Slow Effect.
Post-Incubation HB Rate: 120 (Every 2 minutes, after Incubation, the HB Script will fire)
Post-Incubation HBScript: dis_drot_pst_hb  (After having the disease for 1 hour, and not being cured, it will debuff Charisma, Constitution, cause a Slow Effect, as well as cause 5% max hp Damage per hb.
InfectionRate: 1-100  (1 = Rare, 100 = Easy to infect others)
CureSpell: SpellID that cures it
CureItemTag:Tag of onUse Item that will cure it.


eg
string sDiseaseName = GetLocalString(GetModule(),"DISEASE_NAME_"+IntToString(iDiseaseID));
If this returns "" - then we retrieve from the database, and then store it on local module, as part of cacheing,
Meaning it reduces the database calls.

The CureSpell would have a function added into the SpellHooks system, that checks to see whether this spell ID is listed as a cure Spell, if so, it then gets the Diseases to which it can cure, and then it checks if the Spell target has any of them, and then cures the target.

The CureItemTag works in same way,
onActivate event for the module will have a function added in, that gets the item tag, and then checks to see if that item tag exists anywhere as a Cure Item, if so, it gets the Disease ID that it cures, and then if the player has any of them, it cures those diseases.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Disease Pathogen System?
« Reply #1 on: July 06, 2012, 02:23:46 pm »


               1) yes, they are driven by server, player dont need disease.2da in his override
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Disease Pathogen System?
« Reply #2 on: July 06, 2012, 03:05:52 pm »


               ShadowM has a disease package that is heavy on resources but enables you to control what each disease does via script. It would be good to have your eyes on it as well. Maybe it would improve via collaboration between the two of you.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Disease Pathogen System?
« Reply #3 on: July 06, 2012, 04:33:04 pm »


               Cool,
I will have a look at both diseases in 2da, as well as the system you were talking about.

Although, I do think I will be leaning towards the data driven type system I described above.
I might even make it a public release.
               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
Disease Pathogen System?
« Reply #4 on: July 06, 2012, 04:40:01 pm »


               Just had a great idea:
A disease that can inflict subraces:

Eg- Vampirism, and Lycanthopy as actual diseases, that need to be cured, otherwise you shift to that subrace.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Disease Pathogen System?
« Reply #5 on: July 06, 2012, 06:09:06 pm »


               

Baaleos wrote...

Cool,
I will have a look at both diseases in 2da, as well as the system you were talking about.

Although, I do think I will be leaning towards the data driven type system I described above.
I might even make it a public release.

well there are only two choices, either make a two custom scripts for each disease or make a completely new disease system which is not possible without NWNX at least if you want to preserve disease effect icon.