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!

[RunUO 2.0 RC1] Lokai's Advanced Player Gate

Lokai

Knight
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:
http://www.runuo.com/forums/custom-...new-advanced-player-gate-w-shard-control.html
 

Attachments

  • AdvancedPlayerGate.zip
    10 KB · Views: 991
  • ShardControl w-Advanced Player Gate.zip
    45.4 KB · Views: 605

Vhaerun

Sorceror
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.
 

Lokai

Knight
AtlantisReborn said:
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!
 

Lokai

Knight
Vhaerun said:
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....:eek:
 

Ajax2000

Wanderer
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
 

Lokai

Knight
Ajax2000 said:
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

Knight
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! :p That'll teach em.
 

Ajax2000

Wanderer
Lokai said:
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! :p 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.:p
 

obelix952

Wanderer
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.OnTarget(Mobile from, Object o)
at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
 

LNewman

Wanderer
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

Knight
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.

obelix952 said:
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.OnTarget(Mobile from, Object o)
at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
 

Lokai

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

LNewman said:
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?
 

Merlinman27

Wanderer
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
 

Lokai

Knight
PHP:
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?

Merlinman27 said:
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

Wanderer
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

Wanderer
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
 
Top