Page 1 of 1

GM additions 3.5 *emotes!* *Updated: 12/7/07*

Posted: Sat Feb 25, 2006 7:04 am
by stranf
The "set" command has some limitations for GMs.

For example, as a GM you may wish to reward or penalize players by giving or taking away fame or karma. You may also wish to remove health (damage a PC or NPC) and/or add or remove stamina. Also a certain deed may permenantly add or remove strength. The GM toolkit differs from the 'set command, in that it decrements or increments the stat; whereas, the 'set command requires you to set a value.

**HP, MP, ST, all remove or add health, MP, Stamina, until the PC dies (zero HP) or the maximum stats are reached. It is not permenant. Str, INT, DEX, Fame, Karma, are all permenant, not temporary adjustments**


Currently this toolkit contains:
'gm karma ## Gives or takes away karma depending on the #s sign.
'gm fame ## Gives or takes away fame based on the #s sign.
'gm str ## Gives or takes away strength based on the #s sign.
'gm dex ## Gives or takes away dex based on the #s sign.
'gm int ## Gives or takes away int based on the #s sign.
'gm mp ## Gives or takes away mana based on the #s sign.
'gm hp ## Gives or takes away health based on the #s sign.
'gm st ## Gives or takes away stamina based on the #s sign.
'gm stamina ## Gives or takes away stamina based on the #s sign.

Emotes

'gm bow Forces an NPC or PC to bow
'gm salute forces a salute
'gm shooth forces a bowshoot animation on horseback
'gm shoot forces a bowshot animation
'gm swordh forces a mounted sword animation
'gm sword forces a sword animation
'gm sword2 forces an alternate sword animation
'gm axe forces a 2hd weapon animation (chop)
'gm axe2 forces a 2hd animation 2 (works with swords (swing)
'gm axeh 2hnded mounted animation
'gm die forces death animation (good for falling emote)
'gm salute2 animation for non-human NPCs (causes dogs to scratch)
'gm bow2 2nd non-human animation (dogs scratch)
'gm ffall causes PCs to fall forward (quake animation)
'gm push causes PC to push (resurrect animation)
'gm cast casting animation (wave arms in the air)
'gm fcast forward casting animation (resurrect)

Here is the script:
function CommandRegistration()
{
    RegisterCommand( "gm", 0, true );

}

function command_GM( socket, cmdString )
{
    if( cmdString )
    {
        var splitString = cmdString.split( " ", 2 );
        socket.xText = cmdString;
        socket.CustomTarget( 0, "Choose target for: " + cmdString );
    }
    else
        socket.SysMessage( "No property was specified for the GM

command."
);
}

function onCallback0( socket, ourObj )
{
    if( socket.GetWord( 1 ) )
    {
        socket.SysMessage( "'Set': Invalid target" );
        return;
    }

    var splitString = socket.xText.split( " ", 2 );
    var uKey    = splitString[0].toUpperCase();
    var nVal    = StringToNum( splitString[1] );

    //var for Dm skills

   
   



    switch( uKey )
    {
    case "KARMA":
        ourObj.karma = nVal + ourObj.karma;
        okMsg( socket );
        ourObj.SysMessage( "Karma has changed by " + nVal );
        break;
       
    case "FAME":
   
        ourObj.fame = nVal + ourObj.fame;
        okMsg( socket );
        ourObj.SysMessage( "Fame has changed by " + nVal );
        break;

    case "HP":
            ourObj.health = nVal + ourObj.health;
        okMsg( socket );
        ourObj.TextMessage("HP: "+ourObj.health);
            ourObj.SysMessage( "Health has changed by " + nVal );
        break;

   
    case "ST":
    case "STAMINA":
            ourObj.stamina = nVal + ourObj.stamina;
        okMsg( socket );
        ourObj.TextMessage("ST: "+ourObj.stamina);
            ourObj.SysMessage( "Stamina has changed by " + nVal );
        break;
   
    case "MP":
            ourObj.mana = nVal + ourObj.mana;
        okMsg( socket );
        ourObj.TextMessage("MP: "+ourObj.mana);
            ourObj.SysMessage( "Magic has changed by " + nVal );
        break;
   
    case "STR":
            ourObj.strength = nVal + ourObj.strength;
        okMsg( socket );
            ourObj.SysMessage( "Strength has changed by " + nVal );
        break;
   
    case "INT":
            ourObj.intelligence = nVal + ourObj.intelligence;
        okMsg( socket );
            ourObj.SysMessage( "Intelligence has changed by " + nVal );
        break;

   
    case "DEX":
            ourObj.dexterity = nVal + ourObj.dexterity;
        okMsg( socket );
            ourObj.SysMessage( "Dexterity has changed by " + nVal );
        break;

    case "BOW":
        ourObj.DoAction( 0x20 );
                break;
   
    case "SALUTE":
        ourObj.DoAction( 0x21 );
                break;

   
    case "SHOOTH":
        ourObj.DoAction( 0x1b );
                break;


    case "SHOOT":
        ourObj.DoAction( 0x12 );
                break;

   
    case "SWORDH":
        ourObj.DoAction( 0x1A );
                break;

   
    case "SWORD":
        ourObj.DoAction( 0x09 );
                break;

    case "SWORD2":
        ourObj.DoAction( 0x0A );
                break;

   
    case "AXE":
        ourObj.DoAction( 0x0c );
                break;

    case "AXE2":
        ourObj.DoAction (0x0d);
        break;

   
    case "AXEH":
        ourObj.DoAction( 0x1d );
                break;

    case "DIE":
        ourObj.DoAction( 0x15 );
        break;


    case "SALUTE2":
        ourObj.DoAction( 0x11 );
        break;

    case "BOW2":
        ourObj.DoAction( 0x12 );
        break;

    case "FFALL":
        ourObj.DoAction( 0x16 );
        break;

    case "PUSH":
        ourObj.DoAction( 0x10 );
        break;

    case "CAST":
        ourObj.DoAction( 0x11 );
        break;


    case "FCAST":
        ourObj.DoAction( 0x10 );
        break;




    // avatar case

   


   







    default:
        socket.SysMessage( "Invalid set command " + uKey );
        break;
    }
}

function okMsg( socket )
{ //Sends verification to the player that the specified value was successfully

set.
    socket.SysMessage( GetDictionaryEntry( 1756, socket.Language ));
}

Posted: Sun Sep 10, 2006 11:20 pm
by stranf
Updated 12/16/06:

-- Adjustments in hp, st, and mp will result in the target saying their current hp level. For example, if a gm uses " 'gm hp -15 " to lower the stanima of a PC, and targets the PC, the PC will respond: "hp: 55" showing that that PC has 55 hit points remaining. This is useful for GM's...they can cue of remaining stamina to decide if it is appropriate to subtract health, etc.


-- Emotes have been added. This is a short list, but one I got tested and working for some GMed quests coming up on my shard. I'd like to thank Xuri, Giwo, grimson, Marrc, and everyone else who has been patient with helping me compile and set up these scripts.

Enjoy.

Posted: Sun Dec 17, 2006 3:48 am
by stranf
*bump* to inform interested parties that there as been an update. Xuri, feel free to delete this posting.

12/16/06

(update info on first two posts)

Posted: Wed Apr 04, 2007 10:21 pm
by Fr0zenClassic
This is the script I was referring to in my thread in the other section.
Would you perhaps explain to me how to install this? T'would be appreciated.

~Fr0zenClassic

Posted: Thu Apr 05, 2007 1:49 am
by stranf
I am not at my UOx3 computer, so hopefully I get the filenames right. Someone can correct me if I am wrong.

1-copy the highlighed code where I have written "here is the script". Paste it in notepad and give it a name: like: gmscripts.js (makesure it is saved as a .js file and NOT a .txt file.

2- Move that file into the UOx3/js/custom folder. This is a great place to store your custom scripts so they won't be overwritten when you re-install Uox3.

3- Open the file named JSEFileAssociations.scp inside the Uox3/js directory, this file can be opened with notepad.

4- Search for the section marked "commands" (this is where someone can help me, as I can't remember what the section is titled)... find the next available number.

It should look something like this:

3011= js/commands/ <script>.js
3012= js/commands/ <anotherscript>.js
type in the next number in the sequence. In the above example it would be 3013, and point it to your script.
3013 =js/custom/gmscripts.js


Feel free to download my worldfile (available on the main-discussion sticky thread). You do not need to install it, but look at how my jseFileAssociations.scp links the scripts. This is a good way to learn. The script you are trying to install is actually called karma.js in my worldfile. (originally this script only adjusted karma, but I have added to it since).


NOTE: Notice in the code there is the following:

Code: Select all


function CommandRegistration()
{
   RegisterCommand( "gm", 0, true );

}

change the 0 to a 2 if you want ONLY Gms and councilors to have access to these functions. I set mine to 0 because my PCs are generally running the quests at the same time (we run a small shard, so abuse of these commands does not occur. On bigger shards, it is highly recommened that this be changed to a 2 or 3.




I hope this helps!!!!

Posted: Fri Dec 07, 2007 2:14 pm
by stranf
*bump* in order to inform interested players that an update is out.


Current emote additions include animations for casting, falling forward, and some monster/animal animations. See the first post for details.