New Command : /gmstealth

A place to submit .patch fixes for the DOL SVN

Moderator: Developer Team

New Command : /gmstealth

Postby -Shawn- » Fri Oct 29, 2010 8:10 pm

Code: Select all
using System;
using System.Collections.Generic;
using DOL.GS.Commands;
using DOL.GS;
using DOL.GS.PacketHandler;

namespace DOL.GS.Commands
{
    [CmdAttribute(
        "&gmstealth",
        ePrivLevel.GM,
        "Grants the ability to stealth to a gm/admin character")]
    public class GMStealthCommandHandler : AbstractCommandHandler, ICommandHandler
    {
        public void OnCommand(GameClient client, string[] args)
        {
            if (client.Player.IsStealthed != true)
            {
                client.Player.DBCharacter.MaxSpeed = 400;
                client.Player.Stealth(true);
            }
            else
                client.Player.Stealth(false);
            client.Player.DBCharacter.MaxSpeed = 191;
        }
    }
}
   




just a little near command for people; also took your advice graveen
Attachments
gmstealth.patch
(1.76 KiB) Downloaded 17 times
viewtopic.php?f=6&t=14984

Sky is the limit.
-Shawn-
DOL Devotee
 
Posts: 305
Joined: Tue Nov 24, 2009 1:47 am
Location: New York

Re: New Command : /gmstealth

Postby Graveen » Fri Oct 29, 2010 9:18 pm

what was my advice ? that this command is not reliable due to stealth detection routine ??? :mrgreen:
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: New Command : /gmstealth

Postby -Shawn- » Fri Oct 29, 2010 9:27 pm

No ;p the one that was hardcoding is messy and unnecessary
viewtopic.php?f=6&t=14984

Sky is the limit.
-Shawn-
DOL Devotee
 
Posts: 305
Joined: Tue Nov 24, 2009 1:47 am
Location: New York

Re: New Command : /gmstealth

Postby Graveen » Fri Oct 29, 2010 9:44 pm

I agree for this one ;)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: New Command : /gmstealth

Postby stephenxpimentel » Sat Oct 30, 2010 1:14 am

maybe add this to /player? /player stealth <spec Level> and it will make the target (player, GM, or admin) stealth with the specified spec level? :)
Lets have some fun.
stephenxpimentel
Contributor
 
Posts: 1300
Joined: Wed Sep 19, 2007 5:09 pm

Re: New Command : /gmstealth

Postby Dream » Sat Oct 30, 2010 1:51 am

Shawn made this for my server and it works well.
Its impossible for any other player to see you, works just like Edens /stealth command as i asked :)

As I said works well with no problems
Dream
DOL Novice
 
Posts: 87
Joined: Wed Sep 01, 2010 3:33 am

Re: New Command : /gmstealth

Postby -Shawn- » Sat Oct 30, 2010 8:40 am

stephenxpimentel wrote:maybe add this to /player? /player stealth <spec Level> and it will make the target (player, GM, or admin) stealth with the specified spec level? :)



Well, I like the ideas for a player, but regardless of stealth level gms/admins can not be seen while stealthed :P just saying xD
viewtopic.php?f=6&t=14984

Sky is the limit.
-Shawn-
DOL Devotee
 
Posts: 305
Joined: Tue Nov 24, 2009 1:47 am
Location: New York

Re: New Command : /gmstealth

Postby Graveen » Sat Oct 30, 2010 9:26 am

The more problematic point with your code is the speed change, that 'll remain in the database, if you don't use your command again so you *must* use a temp property. But i suggest to not care about the speed, and extend the command to allow GM to give temp stealth to players (or themselves).

Yes, put it in /player, no target = target the gm issuing the command.
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: New Command : /gmstealth

Postby -Shawn- » Sat Oct 30, 2010 2:18 pm

Code: Select all
using System;
using System.Collections.Generic;
using DOL.GS.Commands;
using DOL.GS;
using DOL.Database;
using DOL.GS.PacketHandler;

namespace DOL.GS.Commands
{
    [CmdAttribute(
        "&gmstealth",
        ePrivLevel.GM,
        "Grants the ability to stealth to a gm/admin character",
        "/gmstealth on : turns the command on",
        "/gmstealth off : turns the command off")]
    public class GMStealthCommandHandler : AbstractCommandHandler, ICommandHandler
    {
        public void OnCommand(GameClient client, string[] args)
        {
            if (args[1].ToLower().Equals("on"))

                if (client.Player.IsStealthed != true)
                {
                    client.Player.DBCharacter.MaxSpeed = 191;
                    client.Player.Stealth(true);
                }
                else if (args[1].ToLower().Equals("off"))
                {
                    client.Player.Stealth(false);
                    client.Player.DBCharacter.MaxSpeed = 191;
                }
        }
    }
}


hows this :P?
Attachments
gmstealth.patch
(2.04 KiB) Downloaded 13 times
viewtopic.php?f=6&t=14984

Sky is the limit.
-Shawn-
DOL Devotee
 
Posts: 305
Joined: Tue Nov 24, 2009 1:47 am
Location: New York

Re: New Command : /gmstealth

Postby Graveen » Sat Oct 30, 2010 2:27 pm

there is no need to change the speed. You *must* not assume a gm char is forced to run at 191 ?!?
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: New Command : /gmstealth

Postby -Shawn- » Sat Oct 30, 2010 2:29 pm

Ah, so just remove the speed? Also do you want to keep the case on/off or ?
viewtopic.php?f=6&t=14984

Sky is the limit.
-Shawn-
DOL Devotee
 
Posts: 305
Joined: Tue Nov 24, 2009 1:47 am
Location: New York

Re: New Command : /gmstealth

Postby Leodagan » Wed Aug 28, 2013 4:40 pm

I updated this one...

Removed speed modifier, changed how arguments are handled, added syntax display, added comment header with dol text.
Attachments
gmstealth.cs
(1.79 KiB) Downloaded 18 times
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: New Command : /gmstealth

Postby Graveen » Wed Aug 28, 2013 9:35 pm

Thank you Leodagan. Can you commit it please, in commands/GMs ?

Please ensure the GPL header is set.
Please read and understand the commit guidelines: http://www.dolserver.net/viewtopic.php?f=47&t=13937

Thanks again :)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: New Command : /gmstealth

Postby Leodagan » Thu Aug 29, 2013 4:49 am

I'll try to commit it when I'll finish reading the guidelines ;)

In my DOL project this script is in GSS, I don't know if it should go in GSS class or GS class on Core (this thing acutally just gives stealth to GM/Admin that don't use a stealther char...)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: New Command : /gmstealth

Postby Graveen » Thu Aug 29, 2013 7:35 am

Oops, my bad, i think it was an easy way to make a GM invisible to players (like a 666 model with no weapons)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France


Return to “%s” DOL Code Contributions

Who is online

Users browsing this forum: No registered users and 1 guest