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!

Help, Pay Gates

Black Rat

Wanderer
well this is what I got so far form reading other stone scripts, right now reading through scripts trying to find out how to do a sum check of gold and remove gold from the backpack if sum is greater than the quantity required to perform the action, then I gotta figure out how to remove the gold, THEN I can begin to think about how to make it teleport a player to a location, hehe the x,y,z I get and the map it want it to go to, but like I said before I'm just learning and the only way I know how to learn this stuff is to pick apart scripts I have already and see what makes em tick.

using System;
using Server.Items;

namespace Server.Items
{
public class TollStone : Item
{
[Constructable]
public TollStone() : base( 0xED4 )
{
Movable = false;
Hue = 0x480;
Name = "a toll stone";
}

public override void OnDoubleClick( Mobile from )
{
**I'm assuming the remainder of the command lines will be in
here from what i can tell**

}

public TollStone( 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();
}
}
}
 

UOT

Knight
[code:1]using System;
using Server.Items;

namespace Server.Items
{
public class TollStone : Item
{
[Constructable]
public TollStone() : base( 0xED4 )
{
Movable = false;
Hue = 0x480;
Name = "a toll stone";
}

public override void OnDoubleClick( Mobile from )
{
if (from.Backpack.ConsumeTotal(typeof(Gold), 100))
from.Location = new Point3D(X,Y,Z);
else
from.SendMessage("You lack the funds to pay the toll.");
}

public TollStone( 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();
}
}
} [/code:1]Easy ain't it? ;)
 

CraZy_NooB

Wanderer
yeah in the public override OnDoubleClick, your going to have to edit that, here is a start for you, this is just the stone, you can make the gump and menus if you want, if not, i'll have to make a really ugly one lol
[code:1]
using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Menus;
using Server.Menus.Questions;

namespace Server.Items
{
public class TollBooth : Item
{
[Constructable]
public TollBooth() : base( 0xED4 )
{
Hue = 1158;
Movable = false;
Name = "A Toll Booth";
}

public TollBooth( Serial serial ) : base( serial )
{
}

public override void OnDoubleClick( Mobile from )
{
from.SendGump( new TollGump( from ) );
}

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();
}
}
}
[/code:1]

that should get you started, now u have to make a gump which will start like this,

[code:1]
using System;
using System.Net;
using Server;
using Server.Accounting;
using Server.Gumps;
using Server.Items;
using Server.Mobiles;
using Server.Network;

namespace Server.Gumps
{
public class TollGump : Gump
{
private Mobile m_Mobile;

public TollGump( Mobile from ) : base( 30, 20 )
{
m_Mobile = from;

AddPage( 1 );

AddBackground( parameters here)

AddLabel( LocationOnScreen, "Toll Booth" ); //this is the header

Account a = from.Account as Account;

//notes: locationOnScreen - where your label will appear
buttonDimensions - (x,y,buttonnormalid,buttonclickedid)


AddLabel( LocationOnScreen, 0 "Location 1" );
AddButton( ButtonDimensions, 0 GumpButtonType.Page, 2 );
AddLabel( CloseLabelLocation, 0 "Close" );
AddButton( ButtonDimensinos, 0 GumpButtonType.Reply, 0 );
}
[/code:1]
thats just a start for you, i'm not going to make the whole thing for you, but i will help you out :p
 

Black Rat

Wanderer
okay, damn I'm sill trying to figure out my first errors and you got it finished damn near, okay now, if we was to take this remark
base( 0xED4 )
and change the "base" ( which I'm assuming is the item that the server builds this from ) and change the base code to that of a gate, and put that gate in a high wall that can't be teleported over or maybe not so much a gate, but an iron door, then would is there a way to make it, and I'm just theorizing here so forgive the syntax errors, but could you make it something like

if gold=100 then open=true
else
if gold<100 then open=false

orrrr

if gold=100 then unlocked=true
else
if gold<100 then locked=true

again forgive the horendous errors in the syntax, like I said in a past post, I used to program in basic and aint done that in years but it's more the concept I'm trying to convey here and not the actual code, I know that it's way off as a working code.

hehe you can see my roots in basic I just realized I fell right back in to if-then statements !! LOL

:D

BTW - Just tested the Toll Stone with 100 gold and it works perfect, that's smooth as hell !!
 

Black Rat

Wanderer
Okay, here's what I decided, instead of all the locked/unlocked stuff just take the stone do a [props and substitute the door of your choice item number to make the artwork for it a door, put your wall up beside it and viola! One toll gate working exactly how Sparda asked here's a shot of the one I made to look like a door and I like how it works, I like it a lot, I think the only gump it would need would be to make it possible to change the destination co-ordinates instead of having to bring down the server edit tollstone.cs and re-initialize the server.

Almost forgot, make the gump for destination changes admin level access, and toll amount changeable too, yeah that's it make it admin access level and make it possible to change destination and price, yeah I'm gonna start work on that tonight when I get home I might have that working sometime this fall hehe.



8)
 

Black Rat

Wanderer
LOL now that you mention it I went to the original poster and sure enough it was March of '03, LOL. But as to who bumped it here's your answer:

surge


Newbie


Joined: 08 Jun 2003

Posted: Wed Jul 30, 2003 6:49 am Post subject:

--------------------------------------------------------------------------------

Cant We All Just Get Alone


but in a way I'm glad he did, it was an idea that was kewl and it got me thinking in the ways of c sharp scripting so there was some good in it and I now have a tollstone/gate I can use to charge entry in to an area of sporting or a zoo or something, so it all worked out in the end

8)
 
L

Lost User

Guest
CrazyNoob = Cmonkey

Why the hell are you posting replys to yourself. You are one sad shit.

Lmao

- Konoko
 

Cmonkey123

Wanderer
DarkKonoko said:
CrazyNoob = Cmonkey

Why the hell are you posting replys to yourself. You are one sad shit.

Lmao

- Konoko

Huh? We aren't the same person if that's what you are getting at...

Where on the same dev team, that's what our sigs are about...
 
Top