RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Sickness System Re-edited V1.6

Status
Not open for further replies.
G

GoldDraco13

Guest
CorwynDriscol said:
Cool script. Any chance Lycanthropy (werewolves and such) might be added at some point in the future. Would be kinda cool to have a player turn into a wolf durning a specific cycle of the moons. And even a good char turn into an evil wolf so they have to watch the server time durning the moon cycle and lock themselves in a house or get far away from a city before night falls during the cycle.

Thanks.

CD



I will be posting on my scripts site a new system that includes werewolf, I'll try to add some special features like you've meantioned before the final release.


:)
 
OK, It's working (editing out the 5 or 6 Token related lines fixed my errors) and I gotta say, this is one cool script.

A couple vampire related questions. I'm not sure how easy you think these modifications might be.
Is is possible to make it so that you won't burn if you're in any building, like a town inn rather than just a player owned house, or in the tunnels/sewers? I'd like to make it so anything that gets you out of the sunlight, but still lets you travel will work.

Also, how easy would it be to make NPC vampires that turn other players/NPCs?
I know for some online servers it may be a problem, but I run a solo server offline right now.

I've been looking at the code and given my limited skills, I'm still trrying to find where to start.

Thanks.

CD
 
H

hudel

Guest
Halciet said:
hud, just add something like this:

Code:
public override void OnGaveMeleeAttack( Mobile defender )
{
   base.OnGaveMeleeAttack( defender );

   if( defender is PlayerMobile )
   {
      PlayerMobile m = defender as PlayerMobile;
      if( Utility.Random(1, 100) <= 2 && mSickness != SickFlag.VampTurn && mSickness != SickFlag.PermImmunity && m.Sickness != SickFlag.TempImmunity)
      {
          m.Sickness = SickFlag.VampTurn;
          m.SendMessage( "You have been bitten by a vampire!" );
          m.SendMessage( "You begin to feel strange..." );
      }
   }
}

Not saying that that exact code will work, as your variables might be different (my copy of the system is heavily edited), but that's kind've what you should look into adding. I added similar code to all my vampires, and now they all have a 2% chance of infecting a player with vampirism when they hit them.

-Hal

@Hal:
Thanks a lot for your help. It works fine for me and I have an unmodified sickness system. Just two small stumbling blocks are in your tip. You forgot two dots in the code. I post the corrected code again. T'was a test, right ;). Thanks again for your help. :D

@Corwin:
put this code in your vampire.cs file somwhere before your serialisation / deserialisation. The blue number is the percent chance for turn a player ...
May the fun will be with you :D .

Code:
public override void OnGaveMeleeAttack( Mobile defender )
{
   base.OnGaveMeleeAttack( defender );

   if( defender is PlayerMobile )
   {
      PlayerMobile m = defender as PlayerMobile;
      if( Utility.Random(1, 100) <= [COLOR=Blue]99[/COLOR] && m[COLOR=Red].[/COLOR]Sickness != SickFlag.VampTurn && m[COLOR=Red].[/COLOR]Sickness != SickFlag.PermImmunity && m.Sickness != SickFlag.TempImmunity)
      {
          m.Sickness = SickFlag.VampTurn;
          m.SendMessage( "You have been bitten by a vampire!" );
          m.SendMessage( "You begin to feel strange..." );
      }
   }
}
 
Got some errors:

Code:
Scripts: Compiling C# scripts...failed (2 errors, 0 warnings)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0102: (line 791, column 15) The cla
ss 'Server.Mobiles.PlayerMobile' already contains a definition for 'm_StepsTaken
'
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0102: (line 792, column 15) The cla
ss 'Server.Mobiles.PlayerMobile' already contains a definition for 'm_Profession
'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

What can I do to correct this?
 

Tru

Knight
SphericalSolaris said:
Got some errors:

Code:
Scripts: Compiling C# scripts...failed (2 errors, 0 warnings)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0102: (line 791, column 15) The cla
ss 'Server.Mobiles.PlayerMobile' already contains a definition for 'm_StepsTaken
'
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0102: (line 792, column 15) The cla
ss 'Server.Mobiles.PlayerMobile' already contains a definition for 'm_Profession
'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

What can I do to correct this?
Looks like you have a duplicate entry on those 2 references
 
H

hudel

Guest
SphericalSolaris said:
Got some errors:

Code:
Scripts: Compiling C# scripts...failed (2 errors, 0 warnings)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0102: (line 791, column 15) The cla
ss 'Server.Mobiles.PlayerMobile' already contains a definition for 'm_StepsTaken
'
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0102: (line 792, column 15) The cla
ss 'Server.Mobiles.PlayerMobile' already contains a definition for 'm_Profession
'
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

What can I do to correct this?


MAybe you have two instances of PlayerMobile.cs in your scripts folder. Do a search for PlayerMobile in your scripts folder and deaktivate the second file.
 

miko

Wanderer
Help Me

I don't know what i must do it.
Code:
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0116: (line 37, column 17) A namesp
ace does not directly contain members such as fields or methods
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

PLEASE HELP ME :confused:
 

Tru

Knight
miko said:
I don't know what i must do it.
Code:
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0116: (line 37, column 17) A namesp
ace does not directly contain members such as fields or methods
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

PLEASE HELP ME :confused:
Show us line 37 of PlayerMobile.cs
 

Lord Andries

Sorceror
Question..

Hello, ive been testing this script and it looks great but when Vampires feed their hunger and thirst dont have a cap so basicly while non vampires can go up to 20 thirst and hunger the vampires can go up to wherever they want... what do i have to do so they cant go above the 20 thirst and hunger cap? Thanks in advance.
 

Tru

Knight
Lord Andries said:
Hello, ive been testing this script and it looks great but when Vampires feed their hunger and thirst dont have a cap so basicly while non vampires can go up to 20 thirst and hunger the vampires can go up to wherever they want... what do i have to do so they cant go above the 20 thirst and hunger cap? Thanks in advance.
here
Code:
if ( from.Hunger < 19)
                    {
                    from.SendMessage( 0x35, "You are too full to feed!" );
                    return;
                    }
that would not allow feeding if thier hunger was 20 or higher
 

Halciet

Sorceror
Don't you mean
Code:
if( from.Hunger > 19 )
Tru? Because if from.Hunger < 19, then you can't feed yourself if you're at anything under 19...

-Hal
 

Tru

Knight
Halciet said:
Don't you mean
Code:
if( from.Hunger > 19 )
Tru? Because if from.Hunger < 19, then you can't feed yourself if you're at anything under 19...

-Hal
Yes yes my bad I always switch those
 

miko

Wanderer
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
- Error: Scripts\Mobiles\PlayerMobile.cs: CS0116: (line 37, column 17) A namesp
ace does not directly contain members such as fields or methods
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

same error :(
 

Tru

Knight
miko said:
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
- Error: Scripts\Mobiles\PlayerMobile.cs: CS0116: (line 37, column 17) A namesp
ace does not directly contain members such as fields or methods
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

same error :(
OK fine post your playermobile
 

ViWinfii

Sorceror
Is he using the version where you edit PlayerMobile.cs directly, or is he using the one with MiddleMobile.cs?
 

numatra

Wanderer
I'm very new to scripting or else I wouldnt have to ask for help... but my problems with this script are as follows:

First, the CheckBurn is only counting Felucca time and not the other 3 facets, which I can ignore for the time being.

Second, and more importantly, Felucca is my PK facet so I'd like to completely disable CheckBurn in Felucca (and Malas). I can add "safe" regions in PlayerMobile (thats the easy part) but like I said I want Felucca and Malas with no burn.

Would I use:
from.Map.Name= "Felucca" or some other code?
 
Status
Not open for further replies.
Top