Finaltwist

Member
We have hidden traps on the server, and they are great, but it would be good to have something to give a hint of where they are. I figured a light (circle150) would be a good idea, forcing players to lower their light level (and turn off alternative lights) in dungeons to see them, making the experience moodier.

that being said, i've set the traps to an "invisible" itemID, and set the following for them:

Movable = false;
Visible = true;
Light = LightType.Circle150;

this works fine, no one can see them (since the item ID is transparent). BUT, people can see them just by holding ctrl-shift in the classicuo client. Doing this makes ALL The traps visible and pop up on the player's screen.

When the traps are visible = false, the light does not show on the player's screens.

I've tried to be creative with the traps with things like

LootType = LootType.Blessed;
Layer = Layer.Talisman;

but nothing works.

my question: can a visible = false; item be coded such that it emits a light?
 
Just add a light source, you can build it into the trap script, so when the trap is constructed, it adds a light source to the same location, if trap deleted, it removes any light sources in that location! Not tested, might need to make another item, like a gold coin and add a light source to it and use it in the above example! Either way you'll need to have the light source outside the item that is invisible!
 
well you'd think that would work, but light sources are visible and therefore ctrl-shift viewable.

Any visible items can be seen by ctrl-shift.

in that case players can just look for light sources in the dungeon (that's how they aappear) and avoid all traps. I want it to be subtle...
my next alternative is a sound played when moving close... but that's harder to code.
 
Look at sticky grass for an example of a item reacting to a player, you should be able to re purpose it for your needs!

Also,
Playing sound is as easy as Player.PlaySound(0x2E7);
 
Check out the EffectController. If it won't do what you're after (I've never played around to see what it's capable of) it will at least show you how to accomplish things you're after.
 
thanks! will look at both - the grass appears to use the (unruo) onthink method to see if a player is nearby, and if it is, then it does the action.
in this instance, it would be possible to turn the traps to visible when players are near, making it a bit better, but still not perfect since they can still see the traps by using ctrl-shift when they are near

ill look at effectcontroller!
 
You can get around the ctrl/shift exposing stuff by not setting the name, example, check out TimeTest, Ctrl/Shift doesn't expose it!
 
oooh!! is that all i had to do??????
Post automatically merged:

Okay... timetest shows "an orange potion" when ctrl-shifting, so it does show.
also, not setting the name seems to show the name of the static's name when ctrl-shifting.

my only alternative is to set this on onmovement to check for players coming close, and only then make it visible.
 
Last edited:
i just created this method in onmovement - serves purpose. but as far as i know, it is not possible to have an item be visible and not be ctrl-shiftable.

C#:
        public override void OnMovement( Mobile m, Point3D oldLocation )
        {

            if (m is PlayerMobile && Utility.InRange( m.Location, this.Location, 2 ) && (Utility.RandomDouble() > 0.80 || Utility.RandomDouble() <= (m.Skills[SkillName.DetectHidden].Value /200) ) && !this.Visible )
            {
                this.Visible = true;   
                switch( 3 )
                    {
                        case 0: m.PlaySound(0x1FF); break;
                        case 1: m.PlaySound(0x33B); break;
                        case 2: m.PlaySound(0x520); break;

                    }
            }               
            else if (m is PlayerMobile && Utility.InRange( m.Location, this.Location, 4 ) && (Utility.RandomDouble() > 0.66 || Utility.RandomDouble() <= (m.Skills[SkillName.DetectHidden].Value /175) ) && !this.Visible )
            {
                    switch( 5 )
                    {
                        case 0: m.PlaySound(0x04A); break;
                        case 1: m.PlaySound(0x051); break;
                        case 2: m.PlaySound(0x343); break;
                        case 3: m.PlaySound(0x4C8); break;
                        case 4: m.PlaySound(0x5DE); break;
                    }
            }   
            else if (m is PlayerMobile && Utility.InRange( m.Location, this.Location, 4 ) ) {}
            else if (m is PlayerMobile && Utility.InRange( m.Location, this.Location, 6 ) && this.Visible )
                this.Visible = false;
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back