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!

Getting close to LBR-spellcasting (Revised for 2.0)

Ilutzio

Sorceror
Getting close to LBR/UO:R spellcasting (Revised for 2.0)

Getting close to LBR spellcasting (Revised for 2.0)


NOTE PLEASE: This is the highly revised Second Edition of this FAQ for 2.0, if you followed the Old 2.0-FAQ then you need to redo it using this new FAQ.


This FAQ
will enable all of this:
  • Smooth spellcasting very similar to UO:R.
  • Smooth spell animations.
  • Damage delay on spells.
  • Pre-Casting boost.
  • No more disturbing "Recover from spell"-message.
  • Healing by spell thru poison.
  • Optional edit to allow movement during spellcasting.


So let us begin


First of all you need to disable all expansions. This will give you (most) spelltimings, damage-levels, recoveries etc. like they were in LBR.

Go to: \RunUO-2.0-RC1\Scripts\Misc\Currentexpansion.cs
And find line 8; wich looks like this:
Code:
        private static readonly Expansion Expansion = Expansion.ML;
Change it to:
Code:
        private static readonly Expansion Expansion = Expansion.None;



Go to \scripts\spells\base\ and open Spell.cs, find line 31
: A value of 1.2 works good here. (So after casting a spell and getting the target cursor up, they need to wait 1.2 seconds before they can cast a new one. They can either wait the timer out while holding the target cursor, or targeting, and wait from there.)


Line 32: The delay between casting a spell and when the character that casted it performs the "cast spell"-animation. A value of 1.1 usually work good and looks smooth, it can look messy when you mount an Ethereal thou, and if that is a problem then raise it back to 1.5.


Next you'll need to activate damage-delay on spells, (namely: magic arrow, harm?, fireball, flamestrike, explosion and mindblast), still in Spell.cs, find line 41; wich looks like this:
Code:
        public virtual bool DelayedDamage{ get{ return false; } }
Change to:
Code:
        public virtual bool DelayedDamage{ get{ return true; } }
What this does: When you cast Explosion (for example) and target the spell, the damage will not be instantaniously done on the target, there is a delay between targeting the spell and when damage is done.
This is a very important aspect of mage PvP.


The disturbing "You have not yet recovered from casting a spell." -message diden't exist in UO:R, nor in LBR. Find the line in Spell.cs that looks like this (around line 545):
Code:
m_Caster.SendLocalizedMessage( 502644 ); // You have not yet recovered from casting a spell.
And change it to:
Code:
//123 m_Caster.SendLocalizedMessage( 502644 ); // You have not yet recovered from casting a spell.
Pre-Casting is enabled by default in RunUO scripts. This here is an option to boost it slightly.
After they have equipted an item and they target the spell, they won't drop the item while the sequence is finished, this can't be done in UO:R or LBR, but i have included it because of the Oldschool feel.
Spell.cs, Line 805 - 810 looks like this:
Code:
                else
                {
                    if ( ClearHandsOnCast )
                        m_Caster.ClearHands();
                }
Change it to:
Code:
                /*123 When target cursor comes up, they can equipt an item. Then can target the spell and still hold the item as the spell effect/dmg/heal is finished.
                else
                {
                    if ( ClearHandsOnCast )
                        m_Caster.ClearHands();
                }
                */

A note to those that used the Old 2.0 Spell FAQ: Apart from making the above change, you also need to set line 203 - 209 back to what it originaly was:
Code:
        public virtual bool OnCasterEquiping( Item item )
        {
            if ( IsCasting )
                Disturb( DisturbType.EquipRequest );

            return true;
        }
In UO:R, you could heal thru poison, meaning: If you were poisoned and was damaged, you could heal the damage with a heal spell but still be poisoned, this is how to enable it:

Find line 48 - 52 in Heal.cs and line 49 - 53 in GreaterHeal.cs, in both files, they look like this:
Code:
            else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
            }
Change, in both files, to:
Code:
            /*123 Edited out, so they can heal thru Poison.
            else if ( m.Poisoned || Server.Items.MortalStrike.IsWounded( m ) )
            {
                Caster.LocalOverheadMessage( MessageType.Regular, 0x22, (Caster == m) ? 1005000 : 1010398 );
            }
            */
This following change has nothing to do with UO:R or LBR-spellcasting. I just put it in for shits and giggles.
(I suggest that you don't use it on a production shard because of the awesome advantage to mages.)
To allow mages free movement while casting spells. You need to find line 192 in Spell.cs:
Code:
        public virtual bool OnCasterMoving( Direction d )
        {
            if ( IsCasting && BlocksMovement )
            {
                m_Caster.SendLocalizedMessage( 500111 ); // You are frozen and can not move.
                return false;
            }

            return true;
        }
And change it to:
Code:
        public virtual bool OnCasterMoving( Direction d )
        {
            if ( IsCasting && BlocksMovement )
            {
                return true;
            }

            return true;
        }

Special thanks to:
PappaSmurf for helping with testing of the method.
Twice for reminding about the value on Line 31.
Jeoku for being the mail pigeon. *wink*
XxPrinceValoxX for reminding me to revise the FAQ for 2.0.
XxSharxX for tips on additions.
Suil Ban for testing of the methods.


Karma, comments and help requests thru PM are all welcome.
Also, feel free to PM me about additions that you would like in this FAQ or errors that you've found and i'll add/change it.

 

Ilutzio

Sorceror
I posted this message in order to bump this FAQ to the top, i felt it was justified since the total overhaul i gave the FAQ will help both those that used the old FAQ and the ones that hasen't seen this FAQ yet.

I hope it wasen't out of line to do so.
 
Top