NPC Dialog system

Results 1 to 4 of 4
  1. #1
    Apprentice FCode is offline
    MemberRank
    Dec 2014 Join Date
    11Posts

    NPC Dialog system

    i'm trying to make command which changing the ingame command from message to getNPCTalk.
    @NPCchat


  2. #2
    Member MechAviv is offline
    MemberRank
    Aug 2015 Join Date
    95Posts

    Re: NPC Dialog system

    c.getSession().write(CField.getNPCTalk(...));


    Sent from my iPhone using Tapatalk

  3. #3
    Apprentice FCode is offline
    MemberRank
    Dec 2014 Join Date
    11Posts

    Re: NPC Dialog system

    Quote Originally Posted by MechAviv View Post
    c.getSession().write(CField.getNPCTalk(...));


    Sent from my iPhone using Tapatalk
    Code:
    public boolean playercommandsnpc = false;
    Code:
    public boolean setPCN() {
            return playercommandsnpc;
        }
        
        public boolean getPCN(boolean yn) {
            return playercommandsnpc  = yn;
        }
    Code:
    case "npcchat":
                        if (player.playercommandsnpc = false) 
                                {
                                // player.setPCN() = true;
                                 player.getPCN(!player.setPCN());
                                 player.dropMessage("Your chat style changed  to NPC View is now " + (player.setPCN() ? "ON!" : "OFF!"));
                                }
                        else {
                            player.yellowMessage("NPC Style is On");
                        }
                        break;
    Code:
    case "uptime":
                            if (player.playercommandsnpc = false) {
                long milliseconds = System.currentTimeMillis() - Server.uptime;
                int seconds = (int) (milliseconds / 1000) % 60 ;
                int minutes = (int) ((milliseconds / (1000*60)) % 60);
                int hours   = (int) ((milliseconds / (1000*60*60)) % 24);
                int days    = (int) ((milliseconds / (1000*60*60*24)));
                 player.yellowMessage("Emperial has been online for " + days  + " days " + hours + " hours " + minutes + " minutes and " + seconds + "  seconds.");
                            } else if 
                                    (player.playercommandsnpc= true){
                long milliseconds = System.currentTimeMillis() - Server.uptime;
                int seconds = (int) (milliseconds / 1000) % 60 ;
                int minutes = (int) ((milliseconds / (1000*60)) % 60);
                int hours   = (int) ((milliseconds / (1000*60*60)) % 24);
                int days    = (int) ((milliseconds / (1000*60*60*24)));
                            String sendText1 = "#rHello "+ player.getName()  +" this is our #e#gOnline#k system in#k #e#bMapleEmperial#k\r\n\r\n";
                            sendText1 += "Emperial has been online for " +  days + " days " + hours + " hours " + minutes + " minutes and " +  seconds + " seconds.";
                c.announce(MaplePacketCreator.getNPCTalk(9010000, (byte) 0, sendText1, "00 00", (byte) 0)); 
                            }
                break;
    Now when i'm execute the npcchat command is shows me one time OFF and then all the time NPC Style is On and the uptime command is like all the time NPC Style

    and i'm trying to make it to be saved to the database
    Last edited by FCode; 03-08-17 at 11:49 AM.

  4. #4
    Apprentice FCode is offline
    MemberRank
    Dec 2014 Join Date
    11Posts

    Re: NPC Dialog system

    Quote Originally Posted by MechAviv View Post
    c.getSession().write(CField.getNPCTalk(...));


    Sent from my iPhone using Tapatalk

    Code:
    public boolean getPCN() {
            return playercommandsnpc;
        }
        
        public void togglePCN() {
            playercommandsnpc = !playercommandsnpc;
        }
    Code:
    case "npchat":
                player.togglePCN();
                player.message("Your chat style NPC" + (player.getPCN() ? " ON" : " OFF") + ".");
                           break;



Advertisement