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!

Step Count during Magery Cast

Ventania

Wanderer
Step Count during Magery Cast

Heya everyone. Ive got a big problem, wich it seems that only a few know how to do it, so im asking for them to help. Ive changed the magery system so the player could walk when casting a spell. What happens is, i want a limit of steps. I Mean, if he walks too much, the spell fizzle.
What i really needed is to know how can i count steps, if is there a better way then gettin XY and doing some creepy math, and how can i make the spell circle involved into this. For EX. A spell in 5th circle could be casted walking 12 tiles, and a spell from 6 about 10 tiles. I dont nessesary need a finished script, if someone could just gimme the way i should go i think i would be fine. Ive already looked at stealth script for some information but couldn´t get anything.

Thanx for the attention. []´s

Ventania
 
look at the stealth scripts and see how they do it - for counting steps (might be in the player mobile script in the on move section(

otherwise, need to be the point location

as for different circle having different ranges - that is easy

do it in reverse order: (this is just rough display - have t0o set it up to match your own stuff)

if spellcircle >= 8 steps alowed = 2
else if spellcircle > 5 steps allowed = 4
else if spell circle is >3 steps allowed = 8
else steps allowed = 1000 (only way to do basicaly unlimited like you wanted)
 

Ventania

Wanderer
Hmmm i got the logic. How may i ajust those commands to the magery system ? Is the "steps allowed" a true value i can use ?

PS: How can i rename stuff, like, there is a sign sayng "Welcome to Brittain", i with to translate that, is there anyhow i can do this by renaming or something ? Btw, where can i translate skill titles like "warrior" "mage" and such ? Already did on karma/fame and skill amounts (aprendice etc).

[]´s Ventania

EDIT: My dungeons are Clean, i cant see NO monsters. How may i spawn them at the dungeon? And i acidentally added a Bank Camp in a dungeon, and i cant remove it lol. Also i wished to change the speech font, to the same font names appear, how may that be done ?
 

Greystar

Wanderer
Ventania;744324 said:
Hmmm i got the logic. How may i ajust those commands to the magery system ? Is the "steps allowed" a true value i can use ?

PS: How can i rename stuff, like, there is a sign sayng "Welcome to Brittain", i with to translate that, is there anyhow i can do this by renaming or something ? Btw, where can i translate skill titles like "warrior" "mage" and such ? Already did on karma/fame and skill amounts (aprendice etc).

[]´s Ventania

EDIT: My dungeons are Clean, i cant see NO monsters. How may i spawn them at the dungeon? And i acidentally added a Bank Camp in a dungeon, and i cant remove it lol. Also i wished to change the speech font, to the same font names appear, how may that be done ?


The speech font is a Core edit as I mentione previously. The other things are all Cliloc... I'm guessing there isn't one for your language. You could probably find a cliloc editor and manually edit those yourself (you'd have to provide your players with the correctly Cliloc file then though). You need to find the "Center" of the Bank Camp to remove it, I don't know any other way to get rid those. The dungeons are empty because the only spawn that RunUO comes with is the Vendors the remaining spawns you have to either A) Do by hand using the built in spawner [add spawner doubleclick place mobile name in field then it's on a spawner. B) get Nerun's Distro C) some other method.
 

Ventania

Wanderer
Hmmm wich you think its better?
Ppl told me Neurun´s Distro is good, but im afraid its bugged or something, cause this runuo standard distro is pretty awesome. Also ive changed many things so far, i wouldnt like to change it all over again. I Got a friend that was already translating the cliloc, its almost 100% done.
 

Greystar

Wanderer
Ventania;744334 said:
Hmmm wich you think its better?
Ppl told me Neurun´s Distro is good, but im afraid its bugged or something, cause this runuo standard distro is pretty awesome. Also ive changed many things so far, i wouldnt like to change it all over again. I Got a friend that was already translating the cliloc, its almost 100% done.

Nerun's distro has no issues that I'm aware of it's just a "slightly" more advanced spawner. However if I remember correctly you only wanted to use one facet so you'd just use the spawners for that facet (there is a gump) its pretty straight forward and easy to use.

Personally I used the spawners from it but I use XMLSpawner because of what it offers.
 

Ventania

Wanderer
Hmmm can u tell me more about that XMLspawner ?
By the way im having a little problem.

[Constructable]
public Herbalist() : base( "o herbalista" )

The thing is, if its a male would be O herbalista
if its a female, should be A herbalista... i dont think that would be a problem , just gotta verify wich graphic is the npc, if im wrong correct me, but as long as i remember it was 400 for man n 401 for woman i think... how may i check the sex to change the title ?

EDIT: how about the skill titles as "grandmaster" (wich i already translated) "mage" (wich i dunno where to translate) ?
Also i couldnt respawn NPCs after deleting them... do anyone know how to re-spawn npcs ? [respawnallregions havent worked. And i just firewalled me (LOL) for expirement, how can i undo this ? lol
 
for the steps part - you would have to create your own section for that, simular the stealth steps part, and set it up the magery section to use
so instead of just stealthstepsallowed you would also have like magerystepsallowed

Like how i explained in the other thread - need to check if spell casted, then check steps, and if over - cancel spell
 

Ventania

Wanderer
I have no idea on how creating a CheckMagerySteps =/ In stealth.cs i found no usefull information about that.
 

Greystar

Wanderer
Ventania;744671 said:
I changed some stuff, but i acidentally firewalled me (127.0.0.1) how can i undo this ?

I think you can remove it in the Accounts file... but I'm not sure, if your lucky you can log in from another ip address and Unfirewall it... Otherwise you "Might" be in trouble.
 

Ventania

Wanderer
Firewall removed. Ive got a problem on the step counting still, the only line in mobiles i found related to step count is :

Code:
if( (AllowedStealthSteps -= 2) <= 0 )

Dont have a clue on how counting steps.... =/

[]´s Ventania
 

Ventania

Wanderer
Just adding for some who wouldnt know. There is a firewall.cfg in the runuo folder, simply remove the IP so u can connect. Quite simple heh :p
 
you would have to set up your own "magicasteps" variable, like the stealth steps one is

then each move - subtract 1 from it and check for if failied or not point

it is not simply add 1 or 2 lines to do this stuff, what you want to do is more advanced than that

but the lines for the stealth steps, gave you an idea of how to lower it, now just have to set it all up to have magical steps, count them down and check them to cancel the spell or not
 

Ventania

Wanderer
I cant figure out how can i subtract the amount of steps, since the PlayerMobile.cs doesnt seems to subtract 1 from the variable stealthsteps. I Would need to know wich command is the right one, to know when someone did a step.
 

Greystar

Wanderer
Ventania;744957 said:
I cant figure out how can i subtract the amount of steps, since the PlayerMobile.cs doesnt seems to subtract 1 from the variable stealthsteps. I Would need to know wich command is the right one, to know when someone did a step.

OnMove in playermobile (code to follow)

Code:
		protected override bool OnMove( Direction d )
		{
			if( !Core.SE )
				return base.OnMove( d );

			if( AccessLevel != AccessLevel.Player )
				return true;

			if( Hidden && DesignContext.Find( this ) == null )	//Hidden & NOT customizing a house
			{
				if( !Mounted && Skills.Stealth.Value >= 25.0 )
				{
					bool running = (d & Direction.Running) != 0;

					if( running )
					{
						[COLOR="Red"]if( (AllowedStealthSteps -= 2) <= 0 ) \\Subtracts to when running
							RevealingAction();[/COLOR]
					}
					[COLOR="Red"]else if( AllowedStealthSteps-- <= 0 ) \\subtracts 1 when nomal move
					{
						Server.SkillHandlers.Stealth.OnUse( this );
					}[/COLOR]			
				}
				else
				{
					RevealingAction();
				}
			}

			#region Mondain's Legacy
			if ( InvisibilityPotion.HasTimer( this ) )
				InvisibilityPotion.Iterrupt( this );
			#endregion

			return true;
		}

This WILLNOT be exactly like yours but it's what you are looking for to decrease the AllowedStealthSteps variable. Took me all of 3 seconds to do a search through the Sourcecode using Notepad++ or MSVC# 2k5.
 

Ventania

Wanderer
Ive already found that, but wouldnt be nessesary to create another variable called MagerySteps wich the sabe format ? I found the class stealthsteps on the mobile.cs in the runuo.exe source file, but i couldnt transform that into a new class, to count steps.

thanx for the reply

[]´s Ventania
 
i said that way above - you would have to add in a countmagerysteps variable in the playermobile

and then set it up to count like that copying from the stealthsteps

and like i said above - it isnot just a 1 or 2 line add, but a decent update to do what you want
 
Top