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!

ACC - Complete Spell System

Lichbane

Wanderer
I seem to be having problems with the spellbook gump.

Put a single spell into a mage spellbook.
Page forward a couple of pages.
Page back ... and you loose the spell.
 

A_Li_N

Knight
Update 2010-02-10

2010-02-10:
-Fixed paging issue with spellbook gumps

Files Updated
Core\CSpellBookGump.cs

To Update
Overwrite current files with files from rar.
 

A_Li_N

Knight
Lichbane;827918 said:
Oh ... one other question. Apart from the Initializer, where does it define how much mana a spell uses?

The initializer only defines the amount of mana for use in the spellbook gumps...the actual mana used is defined in each spell file.
 

Zabulon

Wanderer
There's still a problem with the pages...if the spellbook has more then 4 Pages, you can only page back from page 3/4 but not from page 5/6.
Since you updated the gump-file it's impossible to turn pages, if you have (for example) only three spells in your spellbook, which appear not on page 1/2.

Would it be possible to order spells towards adding date? So if you have a blank book and add a spell which would normally appear on page 3, would then be placed on the first page.
 

Maedyn

Wanderer
hey, noob to running my own server here. first off, A_Li_N.. damn your stuff's impressive lol. an inspiration to become a better coder even :p

anyways, im getting a couple errors while compiling your spell system, although everything else compiles fine. heres what i get:

Code:
RunUO - [www.runuo.com] Version 2.0, Build 3567.2838
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 4 64-bit processors
Scripts: Compiling C# scripts...failed (5 errors, 0 warnings)
Errors:
 + Customs/Complete Spell System/-=+ 03 Systems/Cleric/Spells/HammerOfFaithSpell
.cs:
    CS0115: Line 92: 'Server.ACC.CSS.Systems.Cleric.ClericHammerOfFaithSpell.Ham
merOfFaith.GetDamageTypes(Server.Mobile, out int, out int, out int, out int, out
 int, out int, out int)': no suitable method found to override
 + Customs/Complete Spell System/-=+ 03 Systems/Ranger/Spells/FireBowSpell.cs:
    CS0115: Line 107: 'Server.ACC.CSS.Systems.Ranger.RangerFireBowSpell.RangerFi
reBow.GetDamageTypes(Server.Mobile, out int, out int, out int, out int, out int,
 out int, out int)': no suitable method found to override
 + Customs/Complete Spell System/-=+ 03 Systems/Ranger/Spells/IceBowSpell.cs:
    CS0115: Line 105: 'Server.ACC.CSS.Systems.Ranger.RangerIceBowSpell.RangerIce
Bow.GetDamageTypes(Server.Mobile, out int, out int, out int, out int, out int, o
ut int, out int)': no suitable method found to override
 + Customs/Complete Spell System/-=+ 03 Systems/Ranger/Spells/LightningBowSpell.
cs:
    CS0115: Line 102: 'Server.ACC.CSS.Systems.Ranger.RangerLightningBowSpell.Ran
gerLightningBow.GetDamageTypes(Server.Mobile, out int, out int, out int, out int
, out int, out int, out int)': no suitable method found to override
 + Customs/Complete Spell System/-=+ 03 Systems/Ranger/Spells/NoxBowSpell.cs:
    CS0115: Line 109: 'Server.ACC.CSS.Systems.Ranger.RangerNoxBowSpell.RangerNox
Bow.GetDamageTypes(Server.Mobile, out int, out int, out int, out int, out int, o
ut int, out int)': no suitable method found to override
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

did exactly as instructions say - any idea what the issue is?? i cant see whats wrong in the error'd files..
 

A_Li_N

Knight
Maedyn;828795 said:
hey, noob to running my own server here. first off, A_Li_N.. damn your stuff's impressive lol. an inspiration to become a better coder even :p

anyways, im getting a couple errors while compiling your spell system, although everything else compiles fine. heres what i get:

Code:
RunUO - [www.runuo.com] Version 2.0, Build 3567.2838
Core: Running on .NET Framework Version 2.0.50727
Core: Optimizing for 4 64-bit processors
Scripts: Compiling C# scripts...failed (5 errors, 0 warnings)
Errors:
 + Customs/Complete Spell System/-=+ 03 Systems/Cleric/Spells/HammerOfFaithSpell
.cs:
    CS0115: Line 92: 'Server.ACC.CSS.Systems.Cleric.ClericHammerOfFaithSpell.Ham
merOfFaith.GetDamageTypes(Server.Mobile, out int, out int, out int, out int, out
 int, out int, out int)': no suitable method found to override
 + Customs/Complete Spell System/-=+ 03 Systems/Ranger/Spells/FireBowSpell.cs:
    CS0115: Line 107: 'Server.ACC.CSS.Systems.Ranger.RangerFireBowSpell.RangerFi
reBow.GetDamageTypes(Server.Mobile, out int, out int, out int, out int, out int,
 out int, out int)': no suitable method found to override
 + Customs/Complete Spell System/-=+ 03 Systems/Ranger/Spells/IceBowSpell.cs:
    CS0115: Line 105: 'Server.ACC.CSS.Systems.Ranger.RangerIceBowSpell.RangerIce
Bow.GetDamageTypes(Server.Mobile, out int, out int, out int, out int, out int, o
ut int, out int)': no suitable method found to override
 + Customs/Complete Spell System/-=+ 03 Systems/Ranger/Spells/LightningBowSpell.
cs:
    CS0115: Line 102: 'Server.ACC.CSS.Systems.Ranger.RangerLightningBowSpell.Ran
gerLightningBow.GetDamageTypes(Server.Mobile, out int, out int, out int, out int
, out int, out int, out int)': no suitable method found to override
 + Customs/Complete Spell System/-=+ 03 Systems/Ranger/Spells/NoxBowSpell.cs:
    CS0115: Line 109: 'Server.ACC.CSS.Systems.Ranger.RangerNoxBowSpell.RangerNox
Bow.GetDamageTypes(Server.Mobile, out int, out int, out int, out int, out int, o
ut int, out int)': no suitable method found to override
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

did exactly as instructions say - any idea what the issue is?? i cant see whats wrong in the error'd files..

Thanks for the compliments :)
As for the errors...what server version are you running? Did you download directly from RunUO website or are you using the SVN? If it's from the web site, it's version 2.0 Final and you will need to use the 2.0 package...if you notice on the first post, there are 2 attachments, one with the title "Complete Spell System - 2.0 - ..." and one without that 2.0. The 2.0 is for RunUO 2.0 Final. If you've downloaded the wrong package, simply delete the folder and put the other package in.

Let me know if that helps or not.
 

Maedyn

Wanderer
wow i am a noob haha. explains why i couldnt fix it..

i just figured higher number newer version. :p works great now thanks..
 

Thagoras

Sorceror
I didn't want to tackle this before work this morning, but I have a feeling he's using a server version that doesn't use Mondain Legacy stuff. I had this run in when I downloaded a Glacial Staff script.

Code:
            public override void GetDamageTypes(Mobile wielder, out int phys, out int fire, out int cold, out int pois, out int nrgy, out int chaos, out int direct)
            {
                phys = cold = pois = nrgy = chaos = direct = 0;
                fire = 100;
            }

He'd be missing chaos and direct damage.

Simple enough fix.

Code:
            public override void GetDamageTypes(Mobile wielder, out int phys, out int fire, out int cold, out int pois, out int nrgy)[COLOR="Red"] //, out int chaos, out int direct)[/COLOR]
            {
                phys = cold = pois = nrgy = 0; [COLOR="#ff0000"]//chaos = direct = 0;[/COLOR]
                fire = 100;
            }

just take out chaos and direct.
 
this is very impressive ive tested everything so far it all works great =D thanks alot for the contribution!


also very nice that you created your own files using C infront of them instead of having to replace orinials.
 

Z3r0

Sorceror
No pain-in-the-ass install? You are a god man.

Just wondering, the [acc gump, Complete Spell System page doesn't have any settings or anything on it at all? Just a blank page? Is this a bug or is this intentional?

Tried doing a search, kinda hard to put this issue into unique words you know?

Using Current SVN (504) and latest version of CSS w/ required mods (Central Mem. + Core)

EDIT: Also, is there any easy way to fill the spellbooks?
 

Vargus

Wanderer
Rune Book question

I guess the important stuff before I forget. Using 2.0 Final.

If you try and use a rune book it says you do not have that spell in your spell book. Is there a way to fix this? I do not mind editing the runebook.cs if necessary.

Thank You
 

runuo_user

Wanderer
dood, why so heavt messin with CSpellbookGump ?
try to do things simpler
this one works great and havent any paging problems coz paging is simple as rock!
Code:
using System;
using System.Collections;
using Server;
using Server.Gumps;
using Server.Items;
using Server.Spells;
using Server.Network;

namespace Server.ACC.CSS
{
    public abstract class CSpellbookGump : Gump
    {
        private CSpellbook m_Book;
        private ArrayList m_Spells;

        private int Pages;
        private int CurrentPage;

        public abstract string TextHue { get; }
        public abstract int BGImage { get; }
        public abstract int SpellBtn { get; }
        public abstract int SpellBtnP { get; }
        public abstract string Label1 { get; }
        public abstract string Label2 { get; }
        public abstract Type GumpType { get; }

        public CSpellbookGump(CSpellbook book)
            : base(50, 100)
        {
            if (!CSS.Running)
                return;

            m_Book = book;
            m_Spells = book.SchoolSpells;

            Pages = (int)Math.Ceiling((m_Spells.Count / 16.0));

            /*			if( Pages > 1 && book.Mark > 0 )
                        {
                            ArrayList temp = new ArrayList();
                            for( int i = 0; i < book.Mark*16 && i < m_Spells.Count; i++ )
                                temp.Add( m_Spells[i] );
                            m_Spells.RemoveRange( 0, (book.Mark*16)-1 );
                            m_Spells.AddRange( temp );
                        }
            */

            AddPage(0);
            AddImage(100, 100, BGImage);

            CurrentPage = 1;

            for (int i = 0; i < Pages; i++, CurrentPage++)
            {
                AddPage(CurrentPage);

                //Hidden Buttons
                for (int j = (CurrentPage - 1) * 16, C = 0; j < CurrentPage * 16 && j < m_Spells.Count; j++, C++)
                {
                    if (HasSpell((Type)m_Spells[j]))
                    {
                        AddButton((C > 7 ? 305 : 145), 142 + (C > 7 ? (C - 8) * 20 : C * 20), 2482, 2482, j + 1000, GumpButtonType.Reply, 0);
                    }
                }
                AddImage(100, 100, BGImage);
                AddHtml(165, 107, 100, 20, String.Format("<basefont color=#{0}><Center>{1}</Center>", TextHue, Label1), false, false);
                AddHtml(285, 107, 100, 20, String.Format("<basefont color=#{0}><Center>{1}</Center>", TextHue, Label2), false, false);
                //End Hidden Buttons

                //Prev/Next Buttons
                if (Pages > 1)
                {
                    if (CurrentPage > 1)
                        AddButton(122, 109, 2205, 2205, 0, GumpButtonType.Page, CurrentPage - 1);
                    if (CurrentPage < Pages)
                        AddButton(394, 104, 2206, 2206, 0, GumpButtonType.Page, CurrentPage + 1);
                }
                //End Prev/Next Buttons

                //Spell Buttons/Labels
                for (int j = (CurrentPage - 1) * 16, C = 0; j < CurrentPage * 16 && j < m_Spells.Count; j++, C++)
                {
                    if (HasSpell((Type)m_Spells[j]))
                    {
                        CSpellInfo info = SpellInfoRegistry.GetInfo(m_Book.School, (Type)m_Spells[j]);
                        if (info == null)
                            continue;

                        AddHtml((C > 7 ? 305 : 145), 140 + (C > 7 ? (C - 8) * 20 : C * 20), 120, 20, String.Format("<basefont color=#{0}>{1}</basefont>", TextHue, info.Name), false, false);
                        AddButton((C > 7 ? 285 : 125), 143 + (C > 7 ? (C - 8) * 20 : C * 20), SpellBtn, SpellBtnP, j + 2000, GumpButtonType.Reply, 0);
                        AddButton((C > 7 ? 410 : 250), 142 + (C > 7 ? (C - 8) * 20 : C * 20), 5411, 5411, j + 1000, GumpButtonType.Reply, 0);
                    }
                }
                //End Spell Buttons/Labels
            }
        }

        public bool HasSpell(Type type)
        {
            return (m_Book != null && m_Book.HasSpell(type));
        }

        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info.ButtonID == 0 || !CSS.Running)
                return;

            else if (info.ButtonID >= 1000 && info.ButtonID < (1000 + m_Spells.Count))
            {
                if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(state.Mobile, m_Book.School))
                {
                    state.Mobile.SendMessage("You are not allowed to cast this spell.");
                    return;
                }

                CSpellInfo si = SpellInfoRegistry.GetInfo(m_Book.School, (Type)m_Spells[info.ButtonID - 1000]);
                if (si == null)
                {
                    state.Mobile.SendMessage("That spell is disabled.");
                    return;
                }
                state.Mobile.CloseGump(typeof(ScrollGump));
                state.Mobile.SendGump(new ScrollGump(m_Book, si, TextHue, state.Mobile));
                //				m_Book.Mark = (info.ButtonID-1000)/16;
                //				state.Mobile.SendMessage( "{0}", m_Book.Mark );
            }

            else if (info.ButtonID >= 2000 && info.ButtonID < (2000 + m_Spells.Count))
            {
                if (SpellRestrictions.UseRestrictions && !SpellRestrictions.CheckRestrictions(state.Mobile, m_Book.School))
                {
                    state.Mobile.SendMessage("You are not allowed to cast this spell.");
                    return;
                }

                if (!CSpellbook.MobileHasSpell(state.Mobile, m_Book.School, (Type)m_Spells[info.ButtonID - 2000]))
                {
                    state.Mobile.SendMessage("You do not have this spell.");
                    return;
                }

                Spell spell = SpellInfoRegistry.NewSpell((Type)m_Spells[info.ButtonID - 2000], m_Book.School, state.Mobile, null);
                if (spell == null)
                    state.Mobile.SendMessage("That spell is disabled.");
                else
                    spell.Cast();
                //				m_Book.Mark = (info.ButtonID-2000)/16;
                //				state.Mobile.SendMessage( "{0}", m_Book.Mark );
            }

            object[] Params = new object[1] { m_Book };
            CSpellbookGump gump = Activator.CreateInstance(GumpType, Params) as CSpellbookGump;
            if (gump != null)
                state.Mobile.SendGump(gump);

            //GumpUpTimer
        }
    }
}
 

SuperBBoy

Sorceror
The spell "sacrifice" does nothing. Why does nothing?:confused: (Cleric Spells)
and I think the "trial by fire spell" does nothing


how can i do so they NPC can't be attacked with "Sleep Spell"?(Ancient Spells)


This system is a great system:D:D

Thanks!!
 

A_Li_N

Knight
SuperBBoy;839535 said:
The spell "sacrifice" does nothing. Why does nothing?:confused: (Cleric Spells)
and I think the "trial by fire spell" does nothing


how can i do so they NPC can't be attacked with "Sleep Spell"?(Ancient Spells)


This system is a great system:D:D

Thanks!!

From my quick read of the script, Sacrifice is a useful spell when the caster is in a party. While active, whenever the caster is damaged, each party member is healed for 1/2 the damage.

Trial by fire has a 50% possibility of returning some damage to a person that attacks you.

SleepSpell.cs is where you would change to disallow casting on NPCs...not sure of the exact code, but you would put an if statement around line 44.
 

SuperBBoy

Sorceror
thank you very much for everything!This System is a Great System :D

I have more questions :D



There is a bug in "Peer Spell". when activated the spell and you double click in the body, the body loses shape.

how can i solve it?



Thanks!!:D
 

SuperBBoy

Sorceror
Casting

Hello again! I can ask a question?

How I can make an attribute with this action?

The attribute have to do this:

public virtual bool BlocksMovement{ get{ return false ; } }

Sorry... I'm new at this:D



Thanks!!
 

A_Li_N

Knight
Z3r0;832865 said:
No pain-in-the-ass install? You are a god man.

Just wondering, the [acc gump, Complete Spell System page doesn't have any settings or anything on it at all? Just a blank page? Is this a bug or is this intentional?

Tried doing a search, kinda hard to put this issue into unique words you know?

Using Current SVN (504) and latest version of CSS w/ required mods (Central Mem. + Core)

EDIT: Also, is there any easy way to fill the spellbooks?
I believe there are no settings for this system at this time. (not able to look at code at this time, but pretty sure) So there would be an empty page for the acc gump.
Easy way to fill spellbooks is the [FillBook command. Also, if you want to have books filled when they are created by default, change the setting in CSSettings.cs in the Changing folder.

Vargus;832902 said:
I guess the important stuff before I forget. Using 2.0 Final.

If you try and use a rune book it says you do not have that spell in your spell book. Is there a way to fix this? I do not mind editing the runebook.cs if necessary.

Thank You
I don't remember if I've worked on this problem or not, but I'm guessing it'll be an edit to the runebook.cs. At this time, I have no access to the code to look further.

SuperBBoy;839594 said:
There is a bug in "Peer Spell". when activated the spell and you double click in the body, the body loses shape.
how can i solve it?
I will look into this at a later time, when I can.

SuperBBoy;839849 said:
How I can make an attribute with this action?
The attribute have to do this:
public virtual bool BlocksMovement{ get{ return false ; } }
Sorry... I'm new at this:D
Sorry, I have no idea what you're asking for here...
 

SuperBBoy

Sorceror
Forgive me, I'm spanish and I don't speak english very well.:eek:
What I'm trying to explain is if it's possible to create an attribute that doesn't block me when I'm Casting Spell.


Your system works almost perfectly, is a great system that is helping me a lot to answer questions of things I want to do.:D:D:D


I have the system installed, and my Runuo is about to be opened:D:D



Thanks!:D
 
Top