|
||
|
|||||||
| Script Support Get support for modifying RunUO Scripts, or writing your own! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Newbie
Join Date: May 2008
Posts: 56
|
I`m trying now to create lvl & class system. Can u help me with some questions?
1.Can my lvl system base on players Fame (Fame=exp), if yes, where can i write script, which will increase players stats, skill & caps? & where can i change fame loosing with death? 2.How can i do items req. for lvl & class? 3.How can i set spellcasting (for my new spells) at command (like say ".fireball" to cast it) and set class&lvl req for spells? |
|
|
|
|
|
#2 (permalink) |
|
Forum Master
|
1.Can my lvl system base on players Fame (Fame=exp), if yes, where can i write script, which will increase players stats, skill & caps? & where can i change fame loosing with death?
you can base the experience off anything you want best place is in basecreature ondeath section as for adjusting skills, stats, etc etc based on level - better to use a seperate file for that, and have them call a "level gump" (or when awarding experience, if ready to level, send gump - but combat can get messy then) playermobil ondeath for loosing fame 2.How can i do items req. for lvl & class? if you mean items requiered to level up? in the gump a check for them if you mean can't use unless class/level/race/what ever then in the items script put in an override for onequip and check there for it, and return false or true 3.How can i set spellcasting (for my new spells) at command (like say ".fireball" to cast it) and set class&lvl req for spells? look at lucids spell system either modify it for your system or use the ideas in there for your own it has an oncastsystem that can be used to block out wrong classes
__________________
http://www.AoAUO.com
:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
|
|
|
|
|
#3 (permalink) |
|
Newbie
Join Date: May 2008
Posts: 56
|
ty a lots.
i`m trying to use now NEO lvl system - [RUNUO 2.0 RC1] Neo's Level System <alpha> & Nacrom`s class system [RunUO 2.0 RC1] Nacrom's Class Gate System i`ve edited & compiled it, but now i`m trying to create level gump file & i have a problem can u give me example, how can i set properties like m_Level from neo system & m.Title from Nacrom`s system in level gump file to set something like that ................... if m.Title=" , the Warrior" && m_Lvl=2 m.Str+=10 else if m.Title=", the Mage" && m_Lvl=2 m.Int+=10 .................... i know, that is wrong code, but i posted it to tell u, what i need, i need example how to take this properties from playermobile.cs and classmoongate files to set gumps. i`m sorry for noob questions, i know what i need to do, but i don`t know how ( Last edited by Rivet; 06-01-2008 at 11:58 AM. |
|
|
|
|
|
#5 (permalink) |
|
Forum Master
|
unless people are using those class systems, be hard to help you, because we do not know the systems
The system i use is totaly custom, as is most peoiples - they may start with a different one (my case totaly from scratch) but then they tweak it, change it and madify the hell out of it to make it custom but here is a couple of guesses 1) do not try to compare titles - they can be messed up to easy or other things change them (like noto, skill gains, etc) have a variable for class name/type and compare it instead 2) when raising stats - it is rawstr, rawdex or rawint that you want to adjust
__________________
http://www.AoAUO.com
:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
|
|
|
|
|
#6 (permalink) |
|
Newbie
Join Date: May 2008
Posts: 56
|
ty again.
1) can i just delete some code in Titles.cs to remove other titles? I`m using class system, based on class moogates, here one of them: red text - title, where system writes classname blue text - properties, which i need to increase with level Code:
using System;
using Server.Gumps;
using Server.Mobiles;
namespace Server.Items
{
public class WarriorsGate : Item
{
[Constructable]
public WarriorsGate() : base( 0xF6C ) //Change Class Gate name here
{
Movable = false;
Name = "Warrior's Gate"; // What class name should be visible on the gate itself
Hue = 1263;
}
public WarriorsGate( Serial serial ) : base( serial ) //Change Class Gate name here too
{
}
public override bool OnMoveOver( Mobile m )
{
if (m.Skills[SkillName.Camping].Base == 0)
{
if (m.Map.CanFit(m.Location, 16, false, false))
{
//Edit Skill/Stat TOTAL cap here
m.SkillsCap = 5000;
m.StatCap = 125;
//Edit Base Stats values here
m.Str = 55;
m.Dex = 40;
m.Int = 30;
//Edit Class Title here. This is the title next to the players name above their head
m.Title = " , the Warrior";
//Edit Starting Equiptment here
m.AddToBackpack(new Gold(3000));
//Edit Skill Caps here
m.Skills.Alchemy.Cap = 0;
m.Skills.Anatomy.Cap = 30;
m.Skills.AnimalLore.Cap = 0;
m.Skills.AnimalTaming.Cap = 0;
m.Skills.Archery.Cap = 0;
m.Skills.ArmsLore.Cap = 30;
m.Skills.Begging.Cap = 0;
m.Skills.Blacksmith.Cap = 0;
m.Skills.Bushido.Cap = 0;
m.Skills.Camping.Cap = 0;
m.Skills.Carpentry.Cap = 0;
m.Skills.Cartography.Cap = 0;
m.Skills.Chivalry.Cap = 0;
m.Skills.Cooking.Cap = 0;
m.Skills.DetectHidden.Cap = 0;
m.Skills.Discordance.Cap = 0;
m.Skills.EvalInt.Cap = 0;
m.Skills.Fencing.Cap = 30;
m.Skills.Fishing.Cap = 0;
m.Skills.Fletching.Cap = 0;
m.Skills.Focus.Cap = 30;
m.Skills.Forensics.Cap = 0;
m.Skills.Healing.Cap = 30;
m.Skills.Herding.Cap = 0;
m.Skills.Hiding.Cap = 0;
m.Skills.Inscribe.Cap = 0;
m.Skills.ItemID.Cap = 0;
m.Skills.Lockpicking.Cap = 0;
m.Skills.Lumberjacking.Cap = 0;
m.Skills.Macing.Cap = 30;
m.Skills.Magery.Cap = 0;
m.Skills.MagicResist.Cap = 30;
m.Skills.Meditation.Cap = 0;
m.Skills.Mining.Cap = 0;
m.Skills.Musicianship.Cap = 0;
m.Skills.Necromancy.Cap = 0;
m.Skills.Ninjitsu.Cap = 0;
m.Skills.Parry.Cap = 30;
m.Skills.Peacemaking.Cap = 0;
m.Skills.Poisoning.Cap = 0;
m.Skills.Provocation.Cap = 0;
m.Skills.RemoveTrap.Cap = 0;
m.Skills.Snooping.Cap = 0;
m.Skills.SpiritSpeak.Cap = 0;
m.Skills.Stealing.Cap = 0;
m.Skills.Stealth.Cap = 0;
m.Skills.Swords.Cap = 30;
m.Skills.Tactics.Cap = 30;
m.Skills.Tailoring.Cap = 0;
m.Skills.TasteID.Cap = 0;
m.Skills.Tinkering.Cap = 0;
m.Skills.Tracking.Cap = 0;
m.Skills.Veterinary.Cap = 0;
m.Skills.Wrestling.Cap = 0;
//Edit actual Skill Values here
m.Skills.Alchemy.Base = 0;
m.Skills.Anatomy.Base = 30;
m.Skills.AnimalLore.Base = 0;
m.Skills.AnimalTaming.Base = 0;
m.Skills.Archery.Base = 30;
m.Skills.ArmsLore.Base = 30;
m.Skills.Begging.Base = 0;
m.Skills.Blacksmith.Base = 0;
m.Skills.Camping.Base = 0;
m.Skills.Carpentry.Base = 0;
m.Skills.Cartography.Base = 0;
m.Skills.Cooking.Base = 0;
m.Skills.DetectHidden.Base = 0;
m.Skills.Discordance.Base = 0;
m.Skills.EvalInt.Base = 0;
m.Skills.Fishing.Base = 0;
m.Skills.Fencing.Base = 30;
m.Skills.Fletching.Base = 0;
m.Skills.Focus.Base = 30;
m.Skills.Forensics.Base = 0;
m.Skills.Healing.Base = 30;
m.Skills.Herding.Base = 0;
m.Skills.Hiding.Base = 0;
m.Skills.Inscribe.Base = 0;
m.Skills.ItemID.Base = 0;
m.Skills.Lockpicking.Base = 0;
m.Skills.Lumberjacking.Base = 0;
m.Skills.Macing.Base = 30;
m.Skills.Magery.Base = 0;
m.Skills.MagicResist.Base = 30;
m.Skills.Meditation.Base = 0;
m.Skills.Mining.Base = 0;
m.Skills.Musicianship.Base = 0;
m.Skills.Parry.Base = 30;
m.Skills.Peacemaking.Base = 0;
m.Skills.Poisoning.Base = 0;
m.Skills.Provocation.Base = 0;
m.Skills.RemoveTrap.Base = 0;
m.Skills.Snooping.Base = 0;
m.Skills.SpiritSpeak.Base = 0;
m.Skills.Stealing.Base = 0;
m.Skills.Stealth.Base = 0;
m.Skills.Swords.Base = 30;
m.Skills.Tactics.Base = 30;
m.Skills.Tailoring.Base = 0;
m.Skills.TasteID.Base = 0;
m.Skills.Tinkering.Base = 0;
m.Skills.Tracking.Base = 0;
m.Skills.Veterinary.Base = 0;
m.Skills.Wrestling.Base = 0;
m.Skills.Bushido.Base = 0;
m.Skills.Ninjitsu.Base = 0;
m.Skills.Chivalry.Base = 0;
m.Skills.Necromancy.Base = 0;
//Edit Teleport Location here
m.Location = new Point3D(3015, 1058, 0); // New Starting Point for this class
m.Map = Map.Trammel; //Which Map should they start on
return false;
}
else
{
return true;
}
}
else
{
return true;
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
Last edited by Rivet; 06-01-2008 at 04:01 PM. Reason: code example added |
|
|
|
|
|
#7 (permalink) |
|
Forum Master
|
i think you would be petter off setting up a variable in playermobile for classname (as an enum like solen freindship is, etc)
this way you have something that can not be modified by other scripts by mistake (since they do not know about it, but you can by writing changes for it) also makes it a lot easier for a gm to change a class if needed (like they want to do an event and look like a type of player) also makes it much easier down the line if you want to use a class reference - for like equipment that can only be used by a certain class, etc muchease to remember classname.warrior than it is " , the Warrior" and put in warior instead of Warrior and wonder why it is not working (mess it up with an enum and it comes back as not having it and will not compile, so instant check for making mistakes - where string compare wil not return those mistakes)
__________________
http://www.AoAUO.com
:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
|
|
|
|
|
#8 (permalink) |
|
Newbie
Join Date: May 2008
Posts: 56
|
ok, ty a lot,i`m trying now....
i have error in playermobile.cs line 2965 (red text) : The type of namespace name 'PlayerClass' could not be found. i`ve added Code:
m.PlayerClass = "warrior"; & in playermobile.cs after Code:
public enum SolenFriendship
{
None,
Red,
Black
}
Code:
public enum PlayerClass
{
Warrior,
Mage,
Paladin //others classes will be,when it`ll work )
}
Code:
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
}
Code:
case 26:
{
m_PlayerClass = (PlayerClass) reader.ReadEncodedInt();
goto case 25;
}
Code:
#region Quests blablabla #endregion Code:
#region Class
private PlayerCLass m_PlayerClass;
[CommandProperty( AccessLevel.GameMaster )]
public PlayerClass PlayerClass
{
get{ return m_PlayerClass; }
set{ m_PlayerClass = value; }
}
#endregion
Last edited by Rivet; 06-02-2008 at 07:25 AM. |
|
|
|
|
|
#10 (permalink) |
|
Newbie
Join Date: May 2008
Posts: 56
|
oh, nice.... i throught, that does not so sensitive)))
now i have another mistake in class moongate file , RunUO tells me that "Server.Mobile does not contain a definition for 'PlayerClass' " Where i need add code to tell, what it is?) |
|
|
|
|
|
#11 (permalink) | |
|
Forum Expert
|
Quote:
Example: Code:
public bool MyStupidMethod(Mobile m)
{
if (m is PlayerMobile)
{
PlayerMobile pm = m as PlayerMobile;
pm.PlayerClass = PlayerClass.NinjaOrc;
return true;
}
else return false;
}
|
|
|
|
|
|
|
#12 (permalink) |
|
Newbie
Join Date: May 2008
Posts: 56
|
TY very much!!! it`s working now!!!! I`m trying to create LevelGump.cs file now, but it`s full of mistakes & doesn`t working
Code:
using System;
using Server;
using Server.Mobiles;
namespace Server.Gumps
{
public class LevelGump : Gump
{
private PlayerClass m_PlayerClass;
private bool PlayerClass (Mobile m)
{
if (m.Level ==1 && m.PlayerClass == "Warrior" )
m.Str += 10;
else if (m.Level ==1 && m.PlayerClass == "Mage" )
m.Int += 10;
}
}
}
Last edited by Rivet; 06-03-2008 at 04:03 PM. |
|
|
|
|
|
#13 (permalink) |
|
Forum Master
|
mobiles will not have your level and classes, unless you modified the core
need to cast it as your playermobile also have to modify rawstr, etc Code:
using System;
using Server;
using Server.Mobiles;
namespace Server.Gumps
{
public class LevelGump : Gump
{
private PlayerClass m_PlayerClass;
private bool PlayerClass (Mobile m)
{
PlayerMobile pm = m as PmayerMobile;
if (pm.Level ==1 && pm.PlayerClass == "Warrior" )
m.RawStr += 10;
else if (pm.Level ==1 && pm.PlayerClass == "Mage" )
m.RawInt += 10;
}
}
}
because this adds directly to their str/int which will eventuly cap out thus loosing the bonus for the class if you want it to be a bonus, then you need to modify something else that they will have all the time equiped, and have it as a bonus like i my shard, i took the talisman layer, made a permenant item to be there, and made it of the "basearmor", so i can add bonuses there from the class/race/level bonuses just have to unequip & equip each time it is modified an other way to do it with out using a talisman or some other permenant equiped item, is in baseweapon and spellbook that when equiped (orverride section) & removed - have it check class and then they get the bonus (or remove it) i.e. they only have the bonus when using stuff of their class
__________________
http://www.AoAUO.com
:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
|
|
|
|
|
#14 (permalink) | |
|
Forum Expert
|
Quote:
A gump needs to have a constructor and a response method, like this: Code:
using System;
using Server;
using Server.Mobiles;
namespace Server.Gumps
{
public class LevelGump : Gump
{
private PlayerClass m_PlayerClass;
public LevelGump (Mobile m) : base(40, 40)
{
// Your code to show the gump goes here....
}
public override void OnResponse(NetState state, RelayInfo info)
{
// Your response code for the gump goes here....
}
}
}
|
|
|
|
|
|
|
#17 (permalink) |
|
Forum Master
|
skills are done as
Skills.SkillName.Base to set them or read the base skill .Value to read with bonuses .Cap to set the cap (if obeycap = true then .base and .vale will return .cap if higher than .cap when reading them) RawStr, etc is for the 3 stats only rawstr is their ".base" and str is its ".value"
__________________
http://www.AoAUO.com
:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
|
|
|
|
|
#19 (permalink) |
|
Forum Master
|
just design the item - scroll, whgat ever
and put in an overide ondoubleclick and in there put in the stuff that is added to them for using it
__________________
http://www.AoAUO.com
:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
|
|
|
|
|
#20 (permalink) |
|
Newbie
Join Date: May 2008
Posts: 56
|
Line 36 : } expected
Line 48 : Type or namespace definition, or end-of-file expected Code:
using System;
using Server;
using Server.Items;
namespace Server.Items
{
public class LevelScroll : Item
{
[Constructable]
public LevelScroll() : this( 1 ) {}
[Constructable]
public LevelScroll()
{
LootType = "Blessed";
}
public LevelScroll( Serial serial ) : base( serial ) {}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 1 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
public override void OnDoubleClick( Mobile from )
{
PlayerClass m_PlayerClass;
bool PlayerClass (Mobile m)
{
PlayerMobile pm = m as PmayerMobile;
if (pm.Level ==1 && pm.PlayerClass == "Warrior" )
m.RawStr = 70;
else if (pm.Level ==1 && pm.PlayerClass == "Paladin" )
m.RawStr = 60;
}
}
}
}
|
|
|
|
|
|
#21 (permalink) |
|
Forum Master
|
had a few different major errors in there, here is what i would change and cxomments as to why
Code:
using System;
using Server;
using Server.Items;
using Server.Mobiles; //needed for calling the class info
namespace Server.Items
{
public class LevelScroll : Item
{
//[Constructable] remove these 2 lines will cause more problems
//public LevelScroll() : this( 1 ) {}
[Constructable]
public LevelScroll()
{
LootType = "Blessed";
Name = "Level Scroll"; //if not there, name will just be scroll
}
public LevelScroll( Serial serial ) : base( serial ) {}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); //do not change unless new serialized variables are added in
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
public override void OnDoubleClick( Mobile from )
{ // changed so it should work, as long as PlayerClass is an Enum in Playerr mobile - if it is a strin, then check back to using " "
if (from is PlayerMobile)
{
PlayerMobile pm = m as PmayerMobile;
PlayerClass m_PlayerClass = pm.PlayerClass;
if (pm.Level ==1 && pm.PlayerClass == PlayerClass.Warrior )
m.RawStr = 70;
else if (pm.Level ==1 && pm.PlayerClass == PlayerClass.Paladin )
m.RawStr = 60;
}
}
}
}
__________________
http://www.AoAUO.com
:) ..... Come for the Customs, Play for the Fun. Return to see your new Friends ..... :) |
|
|
|
|
|
#22 (permalink) |
|
Newbie
Join Date: May 2008
Posts: 56
|
Errors:
Line 15: Cannot implicitly convert type 'string' to 'Server.LootType' Line 33: The name 'm' does dot exist in the current context Line 36: The name 'm' does dot exist in the current context Line 38: The name 'm' does dot exist in the current context |
|
|
|