EffectDisease(int)
Create a Disease effect.
effect EffectDisease( int nDiseaseType );
Parameters
nDiseaseType
The type of disease this effect should apply, chosen from DISEASE_*constant group.
Description
Returns a new effect object that when applied to a target will cause them to be diseased. The disease can be chosen from the DISEASE_* constants group.
Diseases' specifications can be looked at in the 2da array file called "disease.2da". Most are Extraodinary or Supernatural, so cannot be dispelled.
Please note that no more then one disease can be applied to a target at once - wether from a creature weapon (EG: mummy hit) or a script.
Remarks
Constructors are special methods that return a new instance of an object. In NWN Script each effect that you can place on an object has it’s own constructor that creates a new instance of the specified effect. This effect object can then be used in an ApplyEffectToObject() Command. See Effect Constructor for more details.
Version
1.22
Example
/* Place this in the OnUsed event of an object. It will cause a new disease to attempt to infect the user of the object each time it is used and advances the time by an hour to rush ahead through the Disease's Incubation period. It loops through all diseases defined in the game. */ #include "nw_i0_plot" //Used to report the name of the current and next Disease. string GetDiseaseName(int nCurrentEffect); void main() { int nCurrentEffect; int nNextEffect; effect eDisease; object oPC; string sDisease; nCurrentEffect = GetLocalInt(OBJECT_SELF,"nCurrentEffect"); eDisease = EffectDisease(nCurrentEffect); oPC = GetLastUsedBy(); RemoveEffects(oPC); sDisease = GetDiseaseName(nCurrentEffect); SendMessageToPC(oPC,"Applying Disease number " + IntToString(nCurrentEffect) + " " + sDisease); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eDisease,oPC,30.0f); if( nCurrentEffect == 16) { nNextEffect=0; }else{ nNextEffect=nCurrentEffect+1; } SetLocalInt(OBJECT_SELF,"nCurrentEffect",nNextEffect); sDisease = GetDiseaseName(nNextEffect); SendMessageToPC(oPC,"Advancing 1 hour to End of Incubation Stage in 10 seconds."); DelayCommand(10.0, SetTime(1,0,0,0)); DelayCommand(3600.0, SendMessageToPC(oPC,"Next Disease number " + IntToString(nNextEffect) + " - " + sDisease)); return; } string GetDiseaseName(int nCurrentEffect) { string sDisease = ""; switch (nCurrentEffect) { case 0: sDisease = "DISEASE_BLINDING_SICKNESS"; break; case 1: sDisease = "DISEASE_CACKLE_FEVER"; break; case 2: sDisease = "DISEASE_DEVIL_CHILLS"; break; case 3: sDisease = "DISEASE_DEMON_FEVER"; break; case 4: sDisease = "DISEASE_FILTH_FEVER"; break; case 5: sDisease = "DISEASE_MINDFIRE"; break; case 6: sDisease = "DISEASE_MUMMY_ROT"; break; case 7: sDisease = "DISEASE_RED_ACHE"; break; case 8: sDisease = "DISEASE_SHAKES"; break; case 9: sDisease = "DISEASE_SLIMY_DOOM"; break; case 10: sDisease = "DISEASE_RED_SLAAD_EGGS"; break; case 11: sDisease = "DISEASE_GHOUL_ROT"; break; case 12: sDisease = "DISEASE_ZOMBIE_CREEP"; break; case 13: sDisease = "DISEASE_DREAD_BLISTERS"; break; case 14: sDisease = "DISEASE_BURROW_MAGGOTS"; break; case 15: sDisease = "DISEASE_SOLDIER_SHAKES"; break; case 16: sDisease = "DISEASE_VERMIN_MADNESS"; break; } return sDisease; }
See Also
functions: | EffectPoison |
categories: | Effects Functions |
constants: | DISEASE_* Constants |
author: John Shuell, editor: Jasperre
Send comments on this topic.