melian wrote:Are you not using MWSE for this?? With MWSE you can write to a file so lots of info can be stored there. And you can get IDs and such.
Otherwise you'll have to do it with dialogue I think.
Begin infection_check
float timer
long prospectref ; reference to an NPC (or creature)
long prospectid ; string holding the NPC's id
long temp ; used to control ifx statements
long infect ; used as marker for infection script
Set timer to ( timer + GetSecondsPassed )
if ( timer < 5 )
Return
endif
Set timer to 0
If ( CellChanged == 1 )
setx prospectref to xFirstNPC
whilex ( prospectref )
; loop through each of the NPCs and creatures in the cell
set infect to 1
; check the type because we don't want creatures (Non-NPCs)
setx temp to prospectref->xRefType
if ( temp != 1598246990 ) ; it's not an NPC
set infect to 0
endif
ifx ( infect )
xGetRef prospectref
endif
endif
Begin dp_communicable_diseases_main
float timer
long prospectref ; reference to an NPC (or creature)
long prospectid ; string holding the NPC's id
long temp ; used to control ifx statements
long infect ; used as marker for infection script
Set timer to ( timer + GetSecondsPassed )
if ( timer < 3 )
Return
endif
Set timer to 0
If ( CellChanged == 1 )
setx prospectref to xFirstNPC
whilex ( prospectref )
; loop through each of the NPCs and creatures in the cell
set infect to 1
; check the type because we don't want creatures (Non-NPCs)
setx temp to prospectref->xRefType
if ( temp != 1598246990 ) ; it's not an NPC
set infect to 0
endif
ifx ( infect )
xGetRef prospectref
set dc_current_npc to prospectref
startscript dc_is_mpc_infected
stopscript dc_is_mpc_infected
endif
endif
Begin dc_is_mpc_infected
long dp_disease
if ( GetCommonDisease == 0 )
endif
if ( GetCommonDisease == 1 )
set dp_disease to Getspelleffects "Disease ID"
; update globals if infected
if ( dp_disease == "ataxia" )
set dp_ataxia to ( dp_ataxia + 1)
endif
if ( dp_disease == "brown rot" )
set dp_brown_rot to ( dp_brown_rot + 1)
endif
if ( dp_disease == "chills" )
set dp_chills to ( dp_chills + 1)
endif
if ( dp_disease == "collywobbles" )
set dp_collywobbles to ( dp_collywobbles + 1)
endif
if ( dp_disease == "crimson_plague" )
set dp_crimson_plague to ( dp_crimson_plague + 1)
endif
if ( dp_disease == "dampworm" )
set dp_dampworm to ( dp_dampworm + 1)
endif
if ( dp_disease == "droops" )
set dp_droops to ( dp_droops + 1)
endif
if ( dp_disease == "greenspore" )
set dp_greenspore to ( dp_greenspore + 1)
endif
if ( dp_disease == "helljoint" )
set dp_helljoint to ( dp_helljoint + 1)
endif
if ( dp_disease == "rattles" )
set dp_rattles to ( dp_rattles + 1)
endif
if ( dp_disease == "rockjoint" )
set dp_rockjoint to ( dp_rockjoint + 1)
endif
if ( dp_disease == "rotbone" )
set dp_rotbone to ( dp_rotbone + 1)
endif
if ( dp_disease == "rust chancre" )
set dp_rust_chancre to ( dp_rust_chancre + 1)
endif
if ( dp_disease == "serpiginous dementia" )
set dp_serpiginous_dementia to ( dp_serpiginous_dementia + 1)
endif
if ( dp_disease == "swamp fever" )
set dp_swamp_fever to ( dp_swamp_fever + 1)
endif
if ( dp_disease == "witbane" )
set dp_witbane to ( dp_witbane + 1)
endif
if ( dp_disease == "witchwither" )
set dp_witchwither to ( dp_witchwither + 1)
endif
if ( dp_disease == "wither" )
set dp_ wither to ( dp_wither + 1)
endif
if ( dp_disease == "yellow tick" )
set dp_yellow_tick to ( dp_yellow_tick + 1)
endif
endif
endif
Epididamus wrote:Since you are using MWSE to write things to a file, could you record which specific NPCs are infected and use that to make sure no one is counted twice?
I've never scripted using MWSE, so I'm not really sure...
long dp_disease
if ( GetCommonDisease == 0 )
endif
if ( GetCommonDisease == 1 )
set dp_disease to Getspelleffects "ataxia"
if ( dp_disease == 1 )
set dp_ataxia to ( dp_ataxia + 1)
endif
set dp_disease to Getspelleffects "brown rot"
if ( dp_disease == 1 )
set dp_brown_rot to ( dp_brown_rot + 1)
endif
set dp_disease to Getspelleffects "chills"
if ( dp_disease == 1 )
set dp_chills to ( dp_chills + 1)
endif
set dp_disease to Getspelleffects "collywobbles"
if ( dp_disease == 1 )
set dp_collywobbles to ( dp_collywobbles + 1)
endif
set dp_disease to Getspelleffects "crimson_plague"
if ( dp_disease == 1 )
set dp_crimson_plague to ( dp_crimson_plague + 1)
endif
set dp_disease to Getspelleffects "dampworm"
if ( dp_disease == 1 )
set dp_dampworm to ( dp_dampworm + 1)
endif
set dp_disease to Getspelleffects "droops"
if ( dp_disease == 1 )
set dp_droops to ( dp_droops + 1)
endif
set dp_disease to Getspelleffects "greenspore"
if ( dp_disease == 1 )
set dp_greenspore to ( dp_greenspore + 1)
endif
set dp_disease to Getspelleffects "helljoint"
if ( dp_disease == 1 )
set dp_helljoint to ( dp_helljoint + 1)
endif
set dp_disease to Getspelleffects "rattles"
if ( dp_disease == 1 )
set dp_rattles to ( dp_rattles + 1)
endif
set dp_disease to Getspelleffects "rockjoint"
if ( dp_disease == 1 )
set dp_rockjoint to ( dp_rockjoint + 1)
endif
set dp_disease to Getspelleffects "rotbone"
if ( dp_disease == 1 )
set dp_rotbone to ( dp_rotbone + 1)
endif
set dp_disease to Getspelleffects "rust chancre"
if ( dp_disease == 1 )
set dp_rust_chancre to ( dp_rust_chancre + 1)
endif
set dp_disease to Getspelleffects "serpiginous dementia"
if ( dp_disease == 1 )
set dp_serpiginous_dementia to ( dp_serpiginous_dementia + 1)
endif
set dp_disease to Getspelleffects "swamp fever"
if ( dp_disease == 1 )
set dp_swamp_fever to ( dp_swamp_fever + 1)
endif
set dp_disease to Getspelleffects "witbane"
if ( dp_disease == 1 )
set dp_witbane to ( dp_witbane + 1)
endif
set dp_disease to Getspelleffects "witchwither"
if ( dp_disease == 1 )
set dp_witchwither to ( dp_witchwither + 1)
endif
set dp_disease to Getspelleffects "wither"
if ( dp_disease == 1 )
set dp_ wither to ( dp_wither + 1)
endif
set dp_disease to Getspelleffects "yellow tick"
if ( dp_disease == 1 )
set dp_yellow_tick to ( dp_yellow_tick + 1)
endif
endif
endif
set dp_disease to Getspelleffects "ataxia"
if ( dp_disease == 1 )
set dp_ataxia to ( dp_ataxia + 1 )
elseif ( dp_disease == 0 )
if ( dp_infected_chance + dp_ataxia <= 75 )
dp_current_npc addspell "ataxia"
endif
endif
if ( dp_disease == 1 )
set dp_ataxia to ( dp_ataxia + 1 )
elseif ( dp_disease == 0 )
if ( dp_infected_chance + dp_ataxia <= 75 )
dp_current_npc->addspell "ataxia"
endif
endif
Begin dp_is_mpc_infected
long dp_disease
short dp_infected_chance
set dp_infected_chance to random100
if ( GetCommonDisease == 0 )
endif
if ( GetCommonDisease == 1 )
set dp_disease to Getspelleffects "ataxia"
if ( dp_disease == 1 )
set dp_ataxia to ( dp_ataxia + 1 )
elseif ( dp_disease == 0 )
if ( dp_infected_chance + dp_ataxia <= 75 )
dp_current_npc->addspell "ataxia"
endif
endif
set dp_disease to Getspelleffects "brown rot"
if ( dp_disease == 1 )
set dp_brown_rot to ( dp_brown_rot + 1 )
endif
set dp_disease to Getspelleffects "chills"
if ( dp_disease == 1 )
set dp_chills to ( dp_chills + 1 )
endif
set dp_disease to Getspelleffects "collywobbles"
if ( dp_disease == 1 )
set dp_collywobbles to ( dp_collywobbles + 1 )
endif
set dp_disease to Getspelleffects "crimson_plague"
if ( dp_disease == 1 )
set dp_crimson_plague to ( dp_crimson_plague + 1 )
endif
set dp_disease to Getspelleffects "dampworm"
if ( dp_disease == 1 )
set dp_dampworm to ( dp_dampworm + 1 )
endif
set dp_disease to Getspelleffects "droops"
if ( dp_disease == 1 )
set dp_droops to ( dp_droops + 1 )
endif
set dp_disease to Getspelleffects "greenspore"
if ( dp_disease == 1 )
set dp_greenspore to ( dp_greenspore + 1 )
endif
set dp_disease to Getspelleffects "helljoint"
if ( dp_disease == 1 )
set dp_helljoint to ( dp_helljoint + 1 )
endif
set dp_disease to Getspelleffects "rattles"
if ( dp_disease == 1 )
set dp_rattles to ( dp_rattles + 1 )
endif
set dp_disease to Getspelleffects "rockjoint"
if ( dp_disease == 1 )
set dp_rockjoint to ( dp_rockjoint + 1 )
endif
set dp_disease to Getspelleffects "rotbone"
if ( dp_disease == 1 )
set dp_rotbone to ( dp_rotbone + 1 )
endif
set dp_disease to Getspelleffects "rust chancre"
if ( dp_disease == 1 )
set dp_rust_chancre to ( dp_rust_chancre + 1 )
endif
set dp_disease to Getspelleffects "serpiginous dementia"
if ( dp_disease == 1 )
set dp_serpiginous_dementia to ( dp_serpiginous_dementia + 1 )
endif
set dp_disease to Getspelleffects "swamp fever"
if ( dp_disease == 1 )
set dp_swamp_fever to ( dp_swamp_fever + 1 )
endif
set dp_disease to Getspelleffects "witbane"
if ( dp_disease == 1 )
set dp_witbane to ( dp_witbane + 1)
endif
set dp_disease to Getspelleffects "witchwither"
if ( dp_disease == 1 )
set dp_witchwither to ( dp_witchwither + 1 )
endif
set dp_disease to Getspelleffects "wither"
if ( dp_disease == 1 )
set dp_wither to ( dp_wither + 1 )
endif
set dp_disease to Getspelleffects "yellow tick"
if ( dp_disease == 1 )
set DP_yellow_tick to ( DP_yellow_tick + 1 )
endif
endif
end
Begin dp_communicable_diseases_main
float timer
long prospectref ; reference to an NPC (or creature)
long prospectid ; string holding the NPC's id
long temp ; used to control ifx statements
long infect ; used as marker for infection script
Set timer to ( timer + GetSecondsPassed )
if ( timer < 3 )
Return
endif
Set timer to 0
If ( CellChanged == 1 )
setx prospectref to xFirstNPC
whilex ( prospectref )
; loop through each of the NPCs and creatures in the cell
set infect to 1
; check the type because we don't want creatures (Non-NPCs)
setx temp to prospectref->xRefType
if ( temp != 1598246990 ) ; it's not an NPC
set infect to 0
endif
ifx ( infect )
xGetRef prospectref
set dp_current_npc to prospectref
startscript dp_is_mpc_infected
stopscript dp_is_mpc_infected
endif
endwhile
endif
end
Begin dp_is_mpc_infected
long dp_disease
short dp_infected_chance
set dp_infected_chance to random100
if ( GetCommonDisease == 0 )
endif
if ( GetCommonDisease == 1 )
set dp_disease to Getspelleffects "ataxia"
if ( dp_disease == 1 )
set dp_ataxia to ( dp_ataxia + 1 )
elseif ( dp_disease == 0 )
if ( dp_infected_chance + dp_ataxia <= 75 )
dp_current_npc->addspell "ataxia"
endif
endif
set dp_disease to Getspelleffects "brown rot"
if ( dp_disease == 1 )
set dp_brown_rot to ( dp_brown_rot + 1 )
endif
set dp_disease to Getspelleffects "chills"
if ( dp_disease == 1 )
set dp_chills to ( dp_chills + 1 )
endif
set dp_disease to Getspelleffects "collywobbles"
if ( dp_disease == 1 )
set dp_collywobbles to ( dp_collywobbles + 1 )
endif
set dp_disease to Getspelleffects "crimson_plague"
if ( dp_disease == 1 )
set dp_crimson_plague to ( dp_crimson_plague + 1 )
endif
set dp_disease to Getspelleffects "dampworm"
if ( dp_disease == 1 )
set dp_dampworm to ( dp_dampworm + 1 )
endif
set dp_disease to Getspelleffects "droops"
if ( dp_disease == 1 )
set dp_droops to ( dp_droops + 1 )
endif
set dp_disease to Getspelleffects "greenspore"
if ( dp_disease == 1 )
set dp_greenspore to ( dp_greenspore + 1 )
endif
set dp_disease to Getspelleffects "helljoint"
if ( dp_disease == 1 )
set dp_helljoint to ( dp_helljoint + 1 )
endif
set dp_disease to Getspelleffects "rattles"
if ( dp_disease == 1 )
set dp_rattles to ( dp_rattles + 1 )
endif
set dp_disease to Getspelleffects "rockjoint"
if ( dp_disease == 1 )
set dp_rockjoint to ( dp_rockjoint + 1 )
endif
set dp_disease to Getspelleffects "rotbone"
if ( dp_disease == 1 )
set dp_rotbone to ( dp_rotbone + 1 )
endif
set dp_disease to Getspelleffects "rust chancre"
if ( dp_disease == 1 )
set dp_rust_chancre to ( dp_rust_chancre + 1 )
endif
set dp_disease to Getspelleffects "serpiginous dementia"
if ( dp_disease == 1 )
set dp_serpiginous_dementia to ( dp_serpiginous_dementia + 1 )
endif
set dp_disease to Getspelleffects "swamp fever"
if ( dp_disease == 1 )
set dp_swamp_fever to ( dp_swamp_fever + 1 )
endif
set dp_disease to Getspelleffects "witbane"
if ( dp_disease == 1 )
set dp_witbane to ( dp_witbane + 1)
endif
set dp_disease to Getspelleffects "witchwither"
if ( dp_disease == 1 )
set dp_witchwither to ( dp_witchwither + 1 )
endif
set dp_disease to Getspelleffects "wither"
if ( dp_disease == 1 )
set dp_wither to ( dp_wither + 1 )
endif
set dp_disease to Getspelleffects "yellow tick"
if ( dp_disease == 1 )
set DP_yellow_tick to ( DP_yellow_tick + 1 )
endif
endif
end
ifx ( infect )
set dp_current_npc to prospectref
xSetRef prospectref
startscript dp_is_mpc_infected
stopscript dp_is_mpc_infected
endif
if ( dp_infected_chance + dp_ataxia <= 75 )
if ( ( dp_infected_chance + dp_ataxia ) <= 75 )
dp_current_npc->xAddSpell "ataxia" 1
Users browsing this forum: No registered users and 1 guest