Go Back   RunUO - Ultima Online Emulation > RunUO > Custom Script Releases

Custom Script Releases This forum is where you can release your custom scripts for other users to use.

Please note: By releasing your scripts here you are submitting them to the public and as such agree to publish them under the GPL licensing terms. The RunUO Team has made its software GPL for you to use and enjoy you should do the same for anything based off of RunUO.

Reply
 
Thread Tools Display Modes
Old 07-12-2006, 12:40 PM   #1 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default Lokai's Advanced Player Gate

Advanced Player Gate Script for RunUO 2.0
Script version# 6.07.12
by Lokai

Additional scripting by Mum_Chamber and Alcore

Completely rescripted for RunUO 2.0, and completely redesigned for maximum performance.

Description:
This gate allows GameMasters to create (IN GAME) custom gates that perform a variety of functions. They can teleport to somewhere, they can change the Player's Stats, Skills, or Hue, they can Resurrect the Player, or they can do all of these things and more. This can be used as a Profession Gate, a Resurrection Gate, a Race Gate, a Class Gate, or an Event Gate.

To Use:
Simply add this script to your RunUO 2.0 custom scripts folder. Then, use the [add command to create an AdvancedPlayerGate, and use [props command to adjust the many built-in features.

NEW! Now you can adjust many features from the GateDialogGump!

HERE IS THE CURRENT LIST OF FEATURES THAT CAN BE ACCESSED BY THE GUMP:
  • Increase/Decrease each Skill
  • Increase/Decrease each Stat
  • Increase/Decrease each Skill Cap
  • Toggle On/Off Skills
  • Toggle On/Off Stats
  • Toggle On/Off Skill Caps
  • Toggle On/Off Resurrection
  • Toggle On/Off Adding Title
  • Toggle On/Off Skills Giving Items
  • Edit Gate Message
  • Edit Title Given to Players
Update at 15/08/2004 by Mum_Chamber
The gate now can add a title of your choice, limit the number of players, show a custom message, give items (blessed or not) and take them back. (May be useful for Events.)

Modified By Alcore...added the bushido and ninjitsu skills

Update 6/19/2006 by Lokai
  • Updated with SpellWeaving Skill
  • Udated GateDialogGump with more POWERFUL features
  • Added CAPS to Skill Adjustment
  • Combined GateDialogGump into this file
Update 6/27/2006 by Lokai
  • Cleaned up Gump and added even more features
  • Added Prompts for editing the Gate Message and Player Title Added
Update 7/05/2006 by Lokai
  • Moved ChangeLog to separate file.
Update 7/12/2006 by Lokai
  • Added Context Menu "Add" to the Gate for adding Items to the list of Items given by the Gate.
  • The Gump is redesigned to allow many more items, using a paged list in the Gump.
  • These are NOT the 'Skill-based' items.
Update 2/6/2007 by Lokai
  • Removed the Attachment, rolled back the changes to before Items were added, and re-uploaded the Attachment. (The Items dialog was just too buggy, and I have no time to mess with it right now.)
Update 6/10/2007 by Lokai
  • Added attachment of AdvancedPlayerGate w/ShardControl
  • New feature: StatCaps, lets you control StrCap, DexCap and IntCap - Requires ShardControl to work.
  • See this link for info:
[2.0]NEW Advanced Player Gate w/Shard Control
Attached Files
File Type: zip AdvancedPlayerGate.zip (10.0 KB, 732 views)
File Type: zip ShardControl w-Advanced Player Gate.zip (45.4 KB, 429 views)

Last edited by Lokai; 06-10-2007 at 06:56 PM.
Lokai is offline   Reply With Quote
Old 07-12-2006, 05:56 PM   #2 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Hold up on any installs. I am checking out a Null Reference error....
Lokai is offline   Reply With Quote
Old 07-13-2006, 08:12 PM   #3 (permalink)
Lurker
 
Join Date: Jul 2006
Location: Kansas
Posts: 12
Default

Very nice script! +karma
AtlantisReborn is offline   Reply With Quote
Old 07-14-2006, 06:25 PM   #4 (permalink)
Forum Novice
 
Join Date: Sep 2004
Age: 33
Posts: 685
Default

You still have the null reference error problem, Lokai? Or is it ready for download and installation? We're looking forward to using this as a keystone to our extensive race system.
__________________
Please don't preach to me. You won't convert me. You won't convince me. I am me and you are you. I will respect you because that's who I am. Disrespect me, and you've only proven who you really are.
Vhaerun is offline   Reply With Quote
Old 07-14-2006, 06:26 PM   #5 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by AtlantisReborn
Very nice script! +karma
Thanks. I still think its not ready. Someone asked me to try to integrate a change Mum_Chamber had made to my old 1.0 script which gives specific items to people based on Targeting. It is still pretty buggy unfortunately.

I have been trying to make it work, but have been running into some roadblocks, including lack of time to work on it....

Anyway, if you want a stable version, please download my original 2.0 release which you can find in the Archive scripts section here:

Advanced Player Gate for RunUO 2.0 RC1

SORRY, JUST FIXED THE URL ABOVE. IT NOW TAKES YOU TO THE ARCHIVED SCRIPT. whew!

Last edited by Lokai; 07-14-2006 at 06:32 PM.
Lokai is offline   Reply With Quote
Old 07-14-2006, 06:28 PM   #6 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by Vhaerun
You still have the null reference error problem, Lokai? Or is it ready for download and installation? We're looking forward to using this as a keystone to our extensive race system.
Yes, still have the Null Reference error. It's worse, actually. When I target the items that I want it to use as a model for which items to give out, it actually makes changes to THOSE targeted items. It's eerie....
Lokai is offline   Reply With Quote
Old 07-16-2006, 01:22 AM   #7 (permalink)
Newbie
 
Ajax2000's Avatar
 
Join Date: Mar 2006
Posts: 97
Default

Love this script Lokai. Was the perfect solution for a caste system I was wanting to add to one of my playable races.

One question.

Could you help me locate where in the script the actual action of walking through the gate first occurs?

I would like to add a gump that asks the player if they are sure they want to go through it since it will make them unable to learn certain skills. Dont want people going through it on accident. hehe
Ajax2000 is offline   Reply With Quote
Old 07-16-2006, 09:04 AM   #8 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Quote:
Originally Posted by Ajax2000
Love this script Lokai. Was the perfect solution for a caste system I was wanting to add to one of my playable races.

One question.

Could you help me locate where in the script the actual action of walking through the gate first occurs?

I would like to add a gump that asks the player if they are sure they want to go through it since it will make them unable to learn certain skills. Dont want people going through it on accident. hehe
My Gate is derived from the regular Moongate. The only thing I override is the 'UseGate' routine. (This is actually a flaw in my system, since setting the gate to 'Felucca' could cause the 'Confirm' gump to come up, and I did not really want that.) I also override the OnDoubleClick routine, because I wanted that to bring up the GateDialogGump instead.

You have a couple options. You can write your own routine and place everything in the 'UseGate' routine inside a big 'IF' loop. Or, you could override the Moongate's other routines that I never called, like OnMoveOver, or something.

Technically, I suppose OnMoveOver is the routine that actually gets the whole ball rolling. In a Moongate, the sequence of routines is like this:

OnMoveOver or OnDoubleClick calls CheckGate
CheckGate calls a DelayTimer
DelayTimer calls DelayCallback
DelayCallback calls BeginConfirmation
BeginConfirmation calls EndConfirmation
EndConfirmation calls UseGate

Whew! You can check those routines if you want to see what each one does.
Lokai is offline   Reply With Quote
Old 07-16-2006, 10:20 AM   #9 (permalink)
Lurker
 
Join Date: Jul 2006
Location: Kansas
Posts: 12
Default

Quote:
Originally Posted by Lokai
Whew! You can check those routines if you want to see what each one does.
Or you could just set the destination to somewhere in the same room and use another gate for their exit.
AtlantisReborn is offline   Reply With Quote
Old 07-16-2006, 10:34 AM   #10 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Everyone,

Just something to watch for in this. A couple times I made a gate, and did not set any STR, DEX or INT on it, but accidentally left the 'ChangesStats' to True. BIG mistake.

If anyone goes through it, it sets their Stats to '0', hehe. They can't move or cast spells or anything! Plus it strips them naked! That'll teach em.
Lokai is offline   Reply With Quote
Old 07-16-2006, 11:37 AM   #11 (permalink)
Newbie
 
Ajax2000's Avatar
 
Join Date: Mar 2006
Posts: 97
Default

Quote:
Originally Posted by Lokai
Everyone,

Just something to watch for in this. A couple times I made a gate, and did not set any STR, DEX or INT on it, but accidentally left the 'ChangesStats' to True. BIG mistake.

If anyone goes through it, it sets their Stats to '0', hehe. They can't move or cast spells or anything! Plus it strips them naked! That'll teach em.
Heh, yeah me and my brother found that out the hard way when we were testing it. Kind of embarrassing getting plopped down in front of LBs castle with nothing but your birthday suit and being unable to figure out whats going on.
Ajax2000 is offline   Reply With Quote
Old 08-20-2006, 04:37 AM   #12 (permalink)
Forum Novice
 
Join Date: Nov 2003
Location: Canada
Posts: 115
Default

Very nice script! Was just wondering what line the location for the teleport function was on!
__________________
m00er is offline   Reply With Quote
Old 08-23-2006, 08:58 PM   #13 (permalink)
Lurker
 
Join Date: Mar 2006
Posts: 12
Default

I agree, very nice script only one problem i have found

when players click on the gate and the item option comes up and any player or myself clicks on it and targets an item we get a crash

i have commented those lines of the script out, or i think i did
regardless this is the crash were getting, just bringing this to your attnetion bud
other than that nice job


Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Custom.AdvancedPlayerGate.ItemDialog..ctor( AdvancedPlayerGate gate, Item item)
at Server.Custom.AdvancedPlayerGate.InternalTarget.On Target(Mobile from, Object o)
at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
at Server.Network.PacketHandlers.TargetResponse(NetSt ate state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
obelix952 is offline   Reply With Quote
Old 08-24-2006, 01:41 AM   #14 (permalink)
Lurker
 
Join Date: Dec 2005
Posts: 22
Default

I dropped the script in and restarted shard. Set props to change skills and stats. Set all stats to 100 and certain skills to what I wanted. Then I used my player character and walked through gate. Everything worked as expected except for his stats did not change from what they were before he walked through the gate. Any thoughts?
LNewman is offline   Reply With Quote
Old 08-28-2006, 07:29 PM   #15 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

You are quite right, obelix. I have never been able to get the Item part to work since updating it from the old version. I just moved 1400 miles north from Florida to Rochester, NY, so I am not quite settled in, but this script is about 4th on my list when I get started again. In the meantime, please comment out the Item sections, as you are doing.

Thanks.

Quote:
Originally Posted by obelix952
I agree, very nice script only one problem i have found

when players click on the gate and the item option comes up and any player or myself clicks on it and targets an item we get a crash

i have commented those lines of the script out, or i think i did
regardless this is the crash were getting, just bringing this to your attnetion bud
other than that nice job


Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Custom.AdvancedPlayerGate.ItemDialog..ctor( AdvancedPlayerGate gate, Item item)
at Server.Custom.AdvancedPlayerGate.InternalTarget.On Target(Mobile from, Object o)
at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
at Server.Network.PacketHandlers.TargetResponse(NetSt ate state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
Lokai is offline   Reply With Quote
Old 08-28-2006, 07:31 PM   #16 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

LNewman, all I can figure is that you have the boolean value set to false that states whether stats change or not. (right?)

Quote:
Originally Posted by LNewman
I dropped the script in and restarted shard. Set props to change skills and stats. Set all stats to 100 and certain skills to what I wanted. Then I used my player character and walked through gate. Everything worked as expected except for his stats did not change from what they were before he walked through the gate. Any thoughts?
Lokai is offline   Reply With Quote
Old 09-03-2006, 08:01 PM   #17 (permalink)
Lurker
 
Join Date: Aug 2006
Posts: 5
Default This script is great, but need a ? answered

Great script I have modified items to work with my shard. Now my question is How would I add some sort of check, on lets say their stats, if they have the gates set amount it tells them they cant go through again, but if they dont have it, it will let them proceed through the gate? I do not understand C# but I am good at figuring stuff out, so a point in the right direction would be helpful.

Thanks,
Merlinman27
Merlinman27 is offline   Reply With Quote
Old 09-04-2006, 08:58 AM   #18 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

PHP Code:
if ( from.STR 100 || from.INT 100 || from.DEX 100 )
{
     
from.SendMessage"You may not use the Gate again, due to your Stat level.";
     return 
false;

Something like that?

Quote:
Originally Posted by Merlinman27
Great script I have modified items to work with my shard. Now my question is How would I add some sort of check, on lets say their stats, if they have the gates set amount it tells them they cant go through again, but if they dont have it, it will let them proceed through the gate? I do not understand C# but I am good at figuring stuff out, so a point in the right direction would be helpful.

Thanks,
Merlinman27
Lokai is offline   Reply With Quote
Old 09-04-2006, 06:11 PM   #19 (permalink)
Lurker
 
Join Date: Aug 2006
Posts: 5
Default yes, thank you...

Yes that would be perfect, now just to find where it goes lol. Sorry learning this stuff as it goes. I didnt want put the wrong thing in and wind up messing the whole thing up lol.
Merlinman27 is offline   Reply With Quote
Old 09-05-2006, 07:32 PM   #20 (permalink)
Lurker
 
Join Date: Aug 2006
Posts: 5
Unhappy Need more help Lokai

Never mind, with a fresh pair of eyes and larger amount of mt. dew I got it to work. ty for giving me the command.

Thank you,

Merlinman27

Last edited by Merlinman27; 09-06-2006 at 02:40 AM.
Merlinman27 is offline   Reply With Quote
Old 11-10-2007, 02:02 PM   #21 (permalink)
Forum Novice
 
Join Date: Aug 2003
Location: Hong Kong
Posts: 574
Send a message via ICQ to Hawkins
Default

I figure that may be it's better to give out skill items based on player's skill level instead of the gate settings.

Code:
if (_SkillsGiveItems)
{
    Server.Skills s = m.Skills;
    for (int i = 0; i < s.Length; ++i)
        //if (gAllSkills[i] >= _SkillsItemsMin)
        if (s[i].Base >= _SkillsItemsMin)
            SkillsItems((SkillName)i, m);
}
Hawkins is offline   Reply With Quote
Old 11-10-2007, 02:56 PM   #22 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

The gate gives out items based on the gate skill setting because the gate is already setting all skills anyway. The gate assumes that a player has no skills to speak of. So, when the gate gives someone 60 mage and 70 carpentry, if the 'SkillsItemsMin' is set to 65 it will only give them carpentry items, but if the value is 55 then it will give them both mage and carpentry items.

Quote:
Originally Posted by Hawkins View Post
I figure that may be it's better to give out skill items based on player's skill level instead of the gate settings.

Code:
if (_SkillsGiveItems)
{
    Server.Skills s = m.Skills;
    for (int i = 0; i < s.Length; ++i)
        //if (gAllSkills[i] >= _SkillsItemsMin)
        if (s[i].Base >= _SkillsItemsMin)
            SkillsItems((SkillName)i, m);
}
Lokai is offline   Reply With Quote
Old 11-11-2007, 10:56 AM   #23 (permalink)
Forum Novice
 
Join Date: Aug 2003
Location: Hong Kong
Posts: 574
Send a message via ICQ to Hawkins
Default

Quote:
Originally Posted by Lokai View Post
The gate gives out items based on the gate skill setting because the gate is already setting all skills anyway. The gate assumes that a player has no skills to speak of. So, when the gate gives someone 60 mage and 70 carpentry, if the 'SkillsItemsMin' is set to 65 it will only give them carpentry items, but if the value is 55 then it will give them both mage and carpentry items.
Thanks Lokai.

You are right. I said so just because I need to set up the last gate in the new player area, then give him all the newbie stuff (bookoftravel...etc) together with some stuff depending on his chosen profession.

That's why I tweak the code such that the gate gives out skill items depending on both the gate setting and the player's skill chosen.

Code:
if (_SkillsGiveItems)
{
    Server.Skills s = m.Skills;
    for (int i = 0; i < s.Length; ++i)
        if ((gAllSkills[i] >= _SkillsItemsMin) && (s[i].Base >= _SkillsItemsMin))
            SkillsItems((SkillName)i, m);
}
I don't mean it's better (my bad), I mean someone may need it behave that way.


Thanks and your scripts are awesome.
Hawkins is offline   Reply With Quote
Old 11-11-2007, 10:54 PM   #24 (permalink)
Forum Expert
 
Lokai's Avatar
 
Join Date: Aug 2003
Location: Bergen, NY (Rochester)
Age: 42
Posts: 1,493
Send a message via ICQ to Lokai Send a message via MSN to Lokai Send a message via Yahoo to Lokai
Default

Thanks.

I can see how someone might use that. Cool.
Lokai is offline   Reply With Quote
Old 11-12-2007, 01:17 AM   #25 (permalink)
Forum Novice
 
neuton's Avatar
 
Join Date: Oct 2006
Location: Westchester County, NY
Posts: 113
Send a message via ICQ to neuton Send a message via MSN to neuton Send a message via Yahoo to neuton
Question Error

I am getting this error after carefully merging Lokai's ShardControl/AdvancedPlayerGate script to mine, any one have any ideas?

Code:
RunUO - [www.runuo.com] Version 2.0, Build 2870.7162
Core: Running on .NET Framework Version 2.0.50727
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
Errors:
 + Spells/Base/Spell.cs:
    CS1513: Line 67: } expected
    CS1520: Line 126: Class, struct, or interface method must have a return type

    CS1513: Line 1018: } expected
Here is my Spell.cs from line 66-68
Code:
					m_Contexts.Remove( m );
				}
		private class DelayedDamageContext {

Here is line 126
Code:
	
public Spell( Mobile caster, Item scroll, SpellInfo info )
and line 1013 to 1018
Code:
					m_Spell.m_CastTimer = null;
				}
			}
		}
	}
}

Last edited by neuton; 11-12-2007 at 01:26 AM. Reason: Changed the lines for easier read.
neuton is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5