[Add-on] GM notice Npc

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Alpha Member Soulfist is offline
    Alpha MaleRank
    Dec 2010 Join Date
    a hovelLocation
    1,835Posts

    [Add-on] GM notice Npc


    RaGEZONE Recommends

    RaGEZONE Recommends

    This NPC is actually kind of useless but I got bored and scripted it. If you notice any problems let me know. I never had the opportunity to test it but if anyone could test it let me know!

    PHP Code:
    /** 

    *@author Soulfist 
    */ 

    importPackage(Packages.tools.MaplePacketCreator);

    status 0sname "DominoStory"""
    Op = ["Urgent""Warning""Ban""Severe""Communication"];  

    function 
    start() { 
        var 
    "Welcome to"+sname+", I am the GM notice NPC, which type will it be?"
        for(var 
    0Op.length+= "\r\n#L"+i+"#"+Op[i]+"#l"i++); 
        
    cm.sendSimple(t); 


    function 
    action(mts) { 
        
    status++;
        if (
    != 1) { 
            
    cm.dispose(); 
            return; 
        } 
        if (
    status == 1) { 
            if (
    cm.getPlayer().gmLevel() >= 3)
                
    cm.sendGetText("Please type your desired announcement:\r\n"); 
            else { 
                
    cm.sendOk("You aren't a GM, please don't cause trouble"); 
                
    cm.dispose(); 
            } 
        } else if (
    status == 2) { 
            
    cm.getText(); 
            
    cm.getClient().getChannelServer().getWorldInterface().broadcastGMMessage(nullMaplePacketCreator.serverNotice(6"["+Op[s]+"] "+n).getBytes()); 
            
    cm.dispose(); 
        } 


    It basically just sends out a server notice so GMs can communicate across channels and such. Like I said its not too useful but maybe someone will like it ;)
    Enjoy.

    Note: It will only work if you have the "gmLevel" method. Those who dont can substitute it for "isGM" or w/e. Have fun

    Edit 1: To make it for donors, change this bit.
    PHP Code:
    cm.getPlayer().gmLevel() >= 
    To
    PHP Code:
    cm.getPlayer().gmLevel() > 
    And of cource change the message and the types of announcements at the top, the loop is made to hold as many selections as you want, so enjoy...
    Last edited by Soulfist; 19-06-16 at 03:55 AM.


  2. #2
    Account Inactive xkelvin94 is offline
    InactiveRank
    Nov 2010 Join Date
    ::Malaysia::Location
    235Posts

    Re: [Add-on] GM notice Npc

    Nice. =D

  3. #3
    Alpha Member Soulfist is offline
    Alpha MaleRank
    Dec 2010 Join Date
    a hovelLocation
    1,835Posts

    Re: [Add-on] GM notice Npc

    Thanks but its still somewhat useless ._.

    I just couldnt think of any ideas, like yesterday.

    -refers you to me and chris's JQ release-

  4. #4
    Account Inactive MonsterMS is offline
    InactiveRank
    Jan 2011 Join Date
    10Posts

    Re: [Add-on] GM notice Npc

    It's semi-useful. You could also make it a command. I'm pretty sure it's already out, but you could improve the command.

  5. #5
    Alpha Member XxОsirisxX is offline
    Alpha MaleRank
    Aug 2009 Join Date
    2,730Posts

    Re: [Add-on] GM notice Npc

    I'm a bit tired. But again, that won't work and it's untested. :thumbsdown:

  6. #6
    Account Upgraded | Title Enabled! Sharky is offline
    True MemberRank
    Dec 2010 Join Date
    Ur Mom's Pants.Location
    927Posts

    Re: [Add-on] GM notice Npc

    Quote Originally Posted by XxОsirisxX View Post
    I'm a bit tired. But again, that won't work and it's untested. :thumbsdown:
    Excuse me sir, where's your proof that this doesn't work? It looks okay to me.

  7. #7
    Meteorite Masuzu is offline
    True MemberRank
    Jun 2008 Join Date
    N/ALocation
    856Posts

    Re: [Add-on] GM notice Npc

    Quote Originally Posted by Sharky View Post
    Excuse me sir, where's your proof that this doesn't work? It looks okay to me.
    That's Osiris.
    Quote Originally Posted by Alcohol View Post
    Quote Originally Posted by jahngd View Post
    Um can anyone tell me nexons ip or pm?
    Theres is like blocked its 127.0.0.1 i think that is theirs, i belive....

  8. #8
    Account Upgraded | Title Enabled! NemesisToKill is offline
    True MemberRank
    Nov 2009 Join Date
    874Posts

    Re: [Add-on] GM notice Npc

    Quote Originally Posted by Sharky View Post
    Excuse me sir, where's your proof that this doesn't work? It looks okay to me.
    He calls a reference to MaplePacketCreator but doesn't import it.

    Not sure if this is intended, but this logic does the opposite of what it's supposed to:

    PHP Code:
    if (cm.getPlayer().gmLevel() <= 2) {
    cm.sendGetText("Please type your desired announcement:\r\n");
          } else {
    cm.sendOk("You aren't a GM, please don't cause trouble"); 
    ^means players can do it, and anyone whose gm level is greater than 2 can't do it, which contradicts the else statement.

    He doesn't use a try-catch block for the WorldInterface method, so the NPC won't work if it throws a RemoteException.

    Also, in the description he says that it's for GMs to communicate across channels, but the method he used will make it show to all players as well.

  9. #9
    Account Upgraded | Title Enabled! Sharky is offline
    True MemberRank
    Dec 2010 Join Date
    Ur Mom's Pants.Location
    927Posts

    Re: [Add-on] GM notice Npc

    Quote Originally Posted by NemesisToKill View Post
    He calls a reference to MaplePacketCreator but doesn't import it.

    Not sure if this is intended, but this logic does the opposite of what it's supposed to:

    PHP Code:
    if (cm.getPlayer().gmLevel() <= 2) {
    cm.sendGetText("Please type your desired announcement:\r\n");
          } else {
    cm.sendOk("You aren't a GM, please don't cause trouble"); 
    ^means players can do it, and anyone whose gm level is greater than 2 can't do it, which contradicts the else statement.

    He doesn't use a try-catch block for the WorldInterface method, so the NPC won't work if it throws a RemoteException.

    Also, in the description he says that it's for GMs to communicate across channels, but the method he used will make it show to all players as well.
    Guess I should have looked at this npc a bit longer o-o Thanks for the reasoning.

  10. #10
    Alpha Member XxОsirisxX is offline
    Alpha MaleRank
    Aug 2009 Join Date
    2,730Posts

    Re: [Add-on] GM notice Npc

    Quote Originally Posted by Sharky View Post
    Excuse me sir, where's your proof that this doesn't work? It looks okay to me.
    I may be inactive at coding at this moment, but I got an eye to detect error really fast if I go to compare.

    The reason I said what I said is just simply because:

    PHP Code:
        function start() {
    var 
    "Welcome to"+sname+", I am the GM notice NPC, which type will it be?";
        for(var 
    0Op.lengthi++) {
    += "\r\n#L"+i+"#"+Op[i]+"#l";
       
    cm.sendSimple(t);
    }

    function 
    action(mts) { 
    If you fail to see the huge fail in that syntax then I suggest you to re-read it until you do it because it's really clear.

  11. #11
    Account Upgraded | Title Enabled! Sharky is offline
    True MemberRank
    Dec 2010 Join Date
    Ur Mom's Pants.Location
    927Posts

    Re: [Add-on] GM notice Npc

    Quote Originally Posted by XxОsirisxX View Post
    I may be inactive at coding at this moment, but I got an eye to detect error really fast if I go to compare.

    The reason I said what I said is just simply because:

    PHP Code:
        function start() {
    var 
    "Welcome to"+sname+", I am the GM notice NPC, which type will it be?";
        for(var 
    0Op.lengthi++) {
    += "\r\n#L"+i+"#"+Op[i]+"#l";
       
    cm.sendSimple(t);
    }

    function 
    action(mts) { 
    If you fail to see the huge fail in that syntax then I suggest you to re-read it until you do it because it's really clear.
    Rofl I immediately caught that error when he first showed me the script, and pointed it out to him. I assumed he had fixed it.

  12. #12
    Account Inactive anitawu is offline
    InactiveRank
    Feb 2011 Join Date
    25Posts

    Re: [Add-on] GM notice Npc

    This is good idea. Let GM players able show message via NPC.

  13. #13
    Smoke & Fly Kars is offline
    GammaRank
    Apr 2008 Join Date
    The NetherlandsLocation
    3,416Posts

    Re: [Add-on] GM notice Npc

    Delete the bracket after the "for(var i = 0; i < Op.length; i++)" thing and it will probably work.

  14. #14
    Alpha Member Soulfist is offline
    Alpha MaleRank
    Dec 2010 Join Date
    a hovelLocation
    1,835Posts

    Re: [Add-on] GM notice Npc

    Quote Originally Posted by XxОsirisxX View Post
    I may be inactive at coding at this moment, but I got an eye to detect error really fast if I go to compare.

    The reason I said what I said is just simply because:

    PHP Code:
        function start() {
    var 
    "Welcome to"+sname+", I am the GM notice NPC, which type will it be?";
        for(var 
    0Op.lengthi++) {
    += "\r\n#L"+i+"#"+Op[i]+"#l";
       
    cm.sendSimple(t);
    }

    function 
    action(mts) { 
    If you fail to see the huge fail in that syntax then I suggest you to re-read it until you do it because it's really clear.
    I see teh sytax error.

    Fix3d

  15. #15
    Account Inactive itesuwon is offline
    InactiveRank
    Nov 2010 Join Date
    1Posts

    Re: [Add-on] GM notice Npc

    Yeah, It does kinda feels useless. You could just type !notice, but if the commands aren't working, this might be useful :P




Page 1 of 2 12 LastLast

Advertisement