Page 1 of 1
squrriel
Posted: Fri Apr 11, 2008 5:15 pm
by ninja2007
squrriel
what C# progam do you use to code ?[/u]
Archived topic from AOV, old topic ID:2636, old post ID:16819
squrriel
Posted: Fri Apr 11, 2008 5:54 pm
by Death
ninja2007 wrote:squrriel
what C# progam do you use to code ?[/u]
Your favorite text editor or dev environment
Archived topic from AOV, old topic ID:2636, old post ID:16820
squrriel
Posted: Fri Apr 11, 2008 6:14 pm
by Red Squirrel
notepad++
And for core compilation I use this batch file:
Code: Select all
@echo off
SET Path=C:WINDOWSMicrosoft.NETFrameworkv2.0.50727
csc.exe /out:.RunUO.exe /recurse:RunuoAoV*.cs /win32icon:RunuoAoV
unuo.ico /unsafe /debug /optimize
copy runuo.exe ..
ewfiles
unuo.exe
echo done
pause
Archived topic from AOV, old topic ID:2636, old post ID:16825
squrriel
Posted: Fri Apr 11, 2008 10:57 pm
by ninja2007
can you pm me some example scripts like Arties and junk like that
Archived topic from AOV, old topic ID:2636, old post ID:16840
squrriel
Posted: Fri Apr 11, 2008 11:12 pm
by Red Squirrel
if you download the runuo package you can see how some of the stuff is done.
We changed tons of stuff, but our core/sources are not publicly available. (I don't want a bunch of "AoV clones"
)
But I don't mind releasing a few scripts here and there.
This is how the recipes work:
Code: Select all
using System;
using Server.Items;
namespace Server.Items
{
public class SpellWovenBritchesRecipe : BaseRecipe
{
[Constructable]
public SpellWovenBritchesRecipe()
{
//InitRequirements();
}
//overrides:
public override Type CraftedItem { get { return typeof(SpellWovenBritches); } }
public override string artyname { get { return "Spell Woven Britches"; } }
public override void InitRequirements()
{
base.InitRequirements(); //MUST be first!
//add required skills:
RequiredSkills.Add(new ReqSkill(SkillName.Tailoring,92.5));
//add required resources
CommonResources.Add(new ReqRes("regular leather",typeof(Leather),15));
RareResources.Add(new ReqRes("Eye of the travesty",typeof(EyeOfTheTravesty),1));
RareResources.Add(new ReqRes("Putrefaction",typeof(Putrefaction),10));
RareResources.Add(new ReqRes("Scourge",typeof(Scourge),10));
}
public SpellWovenBritchesRecipe( Serial serial ) : base( serial )
{
}
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();
}
}
public class SpellWovenBritches : LeafLegs
{
public override int LabelNumber{ get{ return 1072929; } } // Spell Woven Britches
public override int BaseFireResistance{ get{ return 15; } }
public override int BasePoisonResistance{ get{ return 16; } }
[Constructable]
public SpellWovenBritches()
{
Hue = 0x487;
SkillBonuses.SetValues( 0, SkillName.Meditation, 10.0 );
Attributes.BonusInt = 8;
Attributes.SpellDamage = 10;
Attributes.LowerManaCost = 10;
}
public SpellWovenBritches( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.WriteEncodedInt( 0 );
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize( reader );
int version = reader.ReadEncodedInt();
}
}
}
And one of my favorites, peerless keys:
Code: Select all
using System;
using Server;
using Server.Items;
namespace Server.Items
{
public class ChiefParoxysmusKey : basepeerlesskey
{
[Constructable]
public ChiefParoxysmusKey(Map map) : base("Chief Paroxysmus","ChiefParoxysmus", new Point3D(6517,359,1),new Point3D(6518,365,56),map,
new Rectangle2D( new Point2D(6494,346 ), new Point2D( 6553, 400 ) ) )
{
ItemID=3628;
Hue=168;
}
[Constructable]
public ChiefParoxysmusKey() : this(Map.Trammel)
{
}
public ChiefParoxysmusKey( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
//used experimentally, not really used in game as the cauldron generates it
public class ChiefParoxysmusKeyBag : peerlesskeybag
{
[Constructable]
public ChiefParoxysmusKeyBag() : base(new ChiefParoxysmusKey(), 3,1,1)
{
}
public ChiefParoxysmusKeyBag( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
You should of seen the original scripts for these. Was brutal. Was not in stock runuo but was downloaded from their public script section. Way back before I knew much about coding.
Really at this point theres maybe 1% of that code left. Like the gump, about it lol.
Archived topic from AOV, old topic ID:2636, old post ID:16841
squrriel
Posted: Sat Apr 12, 2008 2:40 am
by Nosferatu
I was just about to say that key script looks awwwfullly trimmed down lol
Archived topic from AOV, old topic ID:2636, old post ID:16843
squrriel
Posted: Sat Apr 12, 2008 10:49 am
by Red Squirrel
big time, the originals used to have the teleport/summon coded in EACH ONE. O_o. Basepeerlesskey takes care of controlling the peerless session. Its about 1k lines long and that includes the region class as well.
Archived topic from AOV, old topic ID:2636, old post ID:16856
squrriel
Posted: Sat Apr 12, 2008 1:05 pm
by ninja2007
cannot download from RunUO cause there Database is still down :/ so just show me like axe of haven or something
Archived topic from AOV, old topic ID:2636, old post ID:16859
squrriel
Posted: Sat Apr 12, 2008 1:38 pm
by Red Squirrel
This is the axe
Code: Select all
using System;
using Server;
namespace Server.Items
{
public class AxeOfTheHeavens : DoubleAxe
{
public override int LabelNumber{ get{ return 1061106; } } // Axe of the Heavens
public override int ArtifactRarity{ get{ return 11; } }
public override int InitMinHits{ get{ return 255; } }
public override int InitMaxHits{ get{ return 255; } }
[Constructable]
public AxeOfTheHeavens()
{
Hue = 0x4D5;
WeaponAttributes.HitLightning = 50;
Attributes.AttackChance = 15;
Attributes.DefendChance = 15;
Attributes.WeaponDamage = 50;
}
public AxeOfTheHeavens( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 );
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
And they STILL have not fixed their download? Wasn't that broke, like over a week ago? lol.
Archived topic from AOV, old topic ID:2636, old post ID:16860
squrriel
Posted: Sat Apr 12, 2008 1:55 pm
by Death
ninja2007 wrote:cannot download from RunUO cause there Database is still down :/ so just show me like axe of haven or something
LOL that makes me happy to know we don't depend on their scripts/distributions anymore.
It's been how long now? 2 and a half weeks?
Archived topic from AOV, old topic ID:2636, old post ID:16863
squrriel
Posted: Sat Apr 12, 2008 4:47 pm
by Nosferatu
Code: Select all
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using System.Collections;
using Server.ContextMenus;
namespace Server.Items
{
public class AnArtifactChest : WoodenBox
{
[Constructable]
public AnArtifactChest()
{
Hue = 1175;
Movable = false;
Name = "An Artifact Chest";
GenerateTreasure();
}
public AnArtifactChest( Serial serial ) : base( serial )
{
}
public override bool IsDecoContainer{ get{ return false; } }
private void GenerateTreasure()
{
for ( int i = this.Items.Count - 1; i >= 0; i-- )
this.Items[i].Delete();
for ( int i = 0; i < 1; i++ )
{
switch ( Utility.Random( 31 ) )
{
case 0: DropItem( new LegacyOfTheDreadLord() ); break;
case 1: DropItem( new TheTaskmaster() ); break;
case 2: DropItem( new ArmorOfFortune() ); break;
case 3: DropItem( new GauntletsOfNobility() ); break;
case 4: DropItem( new HelmOfInsight() ); break;
case 5: DropItem( new HolyKnightsBreastplate() ); break;
case 6: DropItem( new JackalsCollar() ); break;
case 7: DropItem( new LeggingsOfBane() ); break;
case 8: DropItem( new MidnightBracers() ); break;
case 9: DropItem( new OrnateCrownOfTheHarrower() ); break;
case 10: DropItem( new ShadowDancerLeggings() ); break;
case 11: DropItem( new TunicOfFire() ); break;
case 12: DropItem( new VoiceOfTheFallenKing() ); break;
case 13: DropItem( new BraceletOfHealth() ); break;
case 14: DropItem( new OrnamentOfTheMagician() ); break;
case 15: DropItem( new RingOfTheElements() ); break;
case 16: DropItem( new RingOfTheVile() ); break;
case 17: DropItem( new Aegis() ); break;
case 18: DropItem( new ArcaneShield() ); break;
case 19: DropItem( new AxeOfTheHeavens() ); break;
case 20: DropItem( new BladeOfInsanity() ); break;
case 21: DropItem( new BoneCrusher() ); break;
case 22: DropItem( new Frostbringer() ); break;
case 23: DropItem( new SerpentsFang() ); break;
case 24: DropItem( new StaffOfTheMagi() ); break;
case 25: DropItem( new TheBeserkersMaul() ); break;
case 26: DropItem( new TheDryadBow() ); break;
case 27: DropItem( new DivineCountenance() ); break;
case 28: DropItem( new HatOfTheMagi() ); break;
case 29: DropItem( new HuntersHeaddress() ); break;
case 30: DropItem( new SpiritOfTheTotem() ); break;
}
}
}
public override bool CheckHold( Mobile m, Item item, bool message, bool checkItems, int plusItems, int plusWeight )
{
return false;
}
private Item m_item;
public override void OnItemLifted( Mobile from, Item item )
{
PlayerMobile player = from as PlayerMobile;
m_item = item;
string message = String.Format( "You notice {0} Running Away With {1}", player.Name, m_item );
foreach ( NetState ns in player.GetClientsInRange( 20 ) )
{
if ( ns != player.NetState )
ns.Mobile.SendMessage( message );
new AnArtifactChestTimer( item ).Start();
}
base.OnItemLifted (from, item);
from.FixedParticles( 0x375A, 1, 17, 9919, 33, 7, EffectLayer.Waist );
}
public class AnArtifactChestTimer : Timer
{
private Item m_item;
public AnArtifactChestTimer( Item item ) : base( TimeSpan.FromSeconds( 5.0 ) )
{
m_item = item;
}
protected override void OnTick()
{
new CursedTimer ( m_item ).Start();
m_item.LootType = LootType.Cursed;
Stop();
}
}
public class CursedTimer : Timer
{
private Item m_item;
public int cnt;
public CursedTimer( Item item ) : base( TimeSpan.FromSeconds( 15.0 ), TimeSpan.FromSeconds( 15.0 ) )
{
m_item = item;
cnt = 180;
}
protected override void OnTick()
{
if (cnt > 0)
{
cnt -= 60;
}
else if (cnt <= 0)
{
cnt = 0;
m_item.LootType = LootType.Regular;
this.Stop();
}
}
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.WriteEncodedInt( 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadEncodedInt();
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( GenerateTreasure ) );
}
}
}
behold the future of eliminating doom forever!!!
lol and the sloppiest coding i can possibly think to do!
yet it still curses the arty for the right time limit, and all players in the area are aware who has it xD
Archived topic from AOV, old topic ID:2636, old post ID:16897