Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • FaTe_Of_GoDs: You guys have an offline client?
      Today at 03:25:13 AM
    • ASDss: where do u download source and clients now
      August 18, 2017, 10:39:31 PM
    • ASDss: yo
      August 18, 2017, 10:39:20 PM
    • dan v jad: click me 4 da fun ;)[link]
      August 18, 2017, 04:39:58 PM
    • stCky: Palidinho is your OpenGL (was it OpenGL?) stuff open source anywhere?
      August 16, 2017, 09:07:22 PM
    • Travas:BUILD THE WALL
      August 15, 2017, 09:28:49 PM
    • Travas: i have ass cancer
      August 15, 2017, 09:23:29 PM
    • stCky: what are the fudge are you tryna ask?
      August 15, 2017, 08:21:35 PM
    • bader: what are the rsps community alive ?
      August 15, 2017, 05:46:16 PM
    • bader: yo guys
      August 15, 2017, 05:46:08 PM
    • Spacehost:[link] Updated our thread :)
      August 15, 2017, 09:40:34 AM
    • Adaro: The client is in Download section at Homepage
      August 15, 2017, 01:09:20 AM
    • FaTe_Of_GoDs: where do i get the client?????????????
      August 14, 2017, 05:23:14 PM
    • stCky: can anyone help me? I cant login to the shoutbox
      August 13, 2017, 05:45:15 PM
    • drubrkletern: appeal denied
      August 13, 2017, 02:35:27 PM
    • King_Trout:[link]
      August 13, 2017, 11:17:12 AM
    • Cole1497: no sorry
      August 13, 2017, 10:27:14 AM
    • ayz: yo can anyone explain something to me
      August 13, 2017, 08:08:51 AM
    • coolking12: Hi
      August 13, 2017, 04:16:06 AM
    • stCky: n+1
      August 11, 2017, 06:09:24 PM

    Author Topic: [PI]Ironman 90%  (Read 2285 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineSmdScape

    • Member
    • **
    • Posts: 41
    • Thanks: +0/-0
      • View Profile
    [PI]Ironman 90%
    « on: September 18, 2016, 05:49:34 AM »
    Difficulty 1/10
    It's pure copy/paste.

    You can choose between an ironman, and an ultimate ironman.
    90% because you can still take the loot of npcs damaged by other players, as well as items dropped by other players on death.




    First, open up Client and add:
    Code: [Select]
    public int isIronman = 0, isUltimateIronman = 0;



    open up DialogueHandler and add in:


    Code: [Select]

    case 32:
             sendPlayerChat1("Hello, I'd like to become an ironman.");
             c.nextChat = 33;
             break;
             
          case 33:
             sendNpcChat3("Ah yes, ironman.. Are you sure that", "is what you would like?", "There's no going back once you've decided.", c.talkingNpc, "Mysterious Old Man");
             c.nextChat = 34;
             break;
             
          case 34:
             sendOption2("Yes, please.",  "No");
             c.dialogueAction = 34;
             break;
         
          case 35:
             sendNpcChat2("I see.. Very well. Would you like to become", "a regular ironman, or an ultimate?", c.talkingNpc, "Mysterious Old Man");
             c.nextChat = 36;
             break;
             
          case 36:
             sendOption2("A regular ironman", "An ultimate ironman");
             c.dialogueAction = 36;
             c.nextChat = 0;
             break;

          case 37:
             sendNpcChat1("There is nothing more I can do for you.", c.talkingNpc, "Mysterious Old Man");
             c.nextChat = 0;
             break;


    Now go over to ClickingButtons and add this under case 9157:
    Code: [Select]
    if (c.dialogueAction == 34) {
                c.getDH().sendDialogues(35, 410);
             }
             
             if (c.dialogueAction == 36) {
                c.isIronman = 1;
                c.isUltimateIronman = 0;
                c.nextChat = 0;
                c.sendMessage("You are now an ironman.");
    c.getPA().closeAllWindows();
             }


    Proceed to case 9158: and add..
    Code: [Select]
    if (c.dialogueAction == 34) {
                c.nextChat = 0;
                c.sendMessage("You choose not to become an ironman.");
    c.getPA().closeAllWindows();
             }
             
             if (c.dialogueAction == 36) {
                c.isIronman = 0;
                c.isUltimateIronman = 1;
                c.nextChat = 0;
                c.sendMessage("You are now an ultimate ironman.");
    c.getPA().closeAllWindows();
             }


    Now, open up ActionHandler and under find
    Quote
    switch (i) {
    Make sure it's the one under firstClickNpc.
    Add this:
    Code: [Select]
    case 410: //iron man mode mysterious man
             if (c.isIronman < 1 && c.isUltimateIronman < 1) {
                c.getDH().sendDialogues(32, 410);
             } else {
                c.getDH().sendDialogues(37, 410);
             }
             break;


    Now proceed over to PlayerSave and under
    Quote
    } else if (token.equals("character-rights")) {
                      p.playerRights = Integer.parseInt(token2);
    add these:
    Code: [Select]
    } else if (token.equals("ironman")) {
                      p.isIronman = Integer.parseInt(token2);
                   } else if (token.equals("ultimateironman")) {
                      p.isUltimateIronman = Integer.parseInt(token2);


    Find
    Quote

       characterfile.write("character-rights = ", 0, 19);
             characterfile.write(Integer.toString(p.playerRights), 0, Integer.toString(p.playerRights).length());
             characterfile.newLine();
    And under it, add:
    Code: [Select]
    characterfile.write("ironman = ", 0, 10);
             characterfile.write(Integer.toString(p.isIronman), 0, Integer.toString(p.isIronman).length());
             characterfile.newLine();
             
             characterfile.write("ultimateironman = ", 0, 18);
             characterfile.write(Integer.toString(p.isUltimateIronman), 0, Integer.toString(p.isUltimateIronman).length());
             characterfile.newLine();


    Now go back to ActionHandler and under secondclickobject, add:
    Code: [Select]
    case 2213:
          case 14367:
          case 11758:
          case 494:
          case 1360:
             if (c.isUltimateIronman < 1)
                c.getPA().openUpBank();

    else
                c.sendMessage("@[email protected] ironmen cannot use banks.");
             break;


    Open up Trade and under
    Code: [Select]
    if (c.disconnected) {
             c.tradeStatus = 0;
          }
    add this:
    Code: [Select]

    if (c.isIronman > 0 || c.isUltimateIronman > 0) {
             c.sendMessage("@[email protected] are not allowed to trade.");
             return;
          }


    Open up ChallengePlayer and under
    Quote
    int answerPlayer = c.getInStream().readUnsignedWord();
    add this:


    Code: [Select]

    if (c.isIronman > 0 || c.isUltimateIronman > 0) {
                c.sendMessage("@[email protected] are not allowed to duel.");
                return;
             }


    Head over to PlayerAssistant and find "c.freezeTimer = 0;". Under it, add this:
    Code: [Select]
    if (c.isUltimateIronman > 0) {
             c.getItems().deleteAllItems();
             c.getItems().dropAllItems();

             c.isSkulled = false;
             c.skullTimer = 0;
             c.attackedPlayers.clear();
          }


    Open up your spawn-config.cfg and add this anywhere:
    Code: [Select]
    spawn = 410   3229   3227   0   1   0   0   0   ironman mysterious man
    « Last Edit: September 18, 2016, 06:00:56 AM by SmdScape »
    Practicing poor code since 2009.
    Feel free to check out my RSPS dev thread -
    moparscape.org/community/server-client-development-showoff/125/pi-smdscape/659033


    Offlinebraedyn

    • Member
    • **
    • Posts: 5
    • Thanks: +0/-0
      • View Profile
    Re: [PI]Ironman 90%
    « Reply #1 on: September 20, 2016, 09:32:47 PM »
    Good job , but how come you cannot use banks?!  :eek:


    OfflinestCky

    • Member
    • ****
    • Posts: 393
    • Thanks: +0/-0
      • View Profile
    Re: [PI]Ironman 90%
    « Reply #2 on: September 21, 2016, 12:54:10 AM »
    Good job , but how come you cannot use banks?!  :eek:

    Ultimate ironmen cant use banks what the fudge do you mean :eek::eek::eek::eek::eek::eek:
    HOLD CTRL AND TYPE "WTF" FOR ℱ𝓪𝓷𝓬𝔂 𝓦𝓣ℱ

    Offlinebraedyn

    • Member
    • **
    • Posts: 5
    • Thanks: +0/-0
      • View Profile
    Re: [PI]Ironman 90%
    « Reply #3 on: September 24, 2016, 12:23:06 PM »
    HELP PLEASE!!!! Compiler works fine, but when i run server this now comes up!!!
    _____________________________________________________________________________________

    Exception in thread "main" java.lang.ExceptionInInitializerError
    Caused by: java.lang.NumberFormatException: For input string: "410   "
            at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
            at java.lang.Integer.parseInt(Integer.java:492)
            at java.lang.Integer.parseInt(Integer.java:527)
            at server.model.npcs.NPCHandler.loadAutoSpawn(NPCHandler.java:4640)
            at server.model.npcs.NPCHandler.<init>(NPCHandler.java:1038)
            at server.Server.<clinit>(Server.java:86)
    Press any key to continue . . .

    HELP PL0X :confused::confused:
    « Last Edit: September 24, 2016, 02:22:53 PM by braedyn »

    OfflineD3i7y

    • Member
    • ***
    • Posts: 174
    • Thanks: +0/-0
      • View Profile
    Re: [PI]Ironman 90%
    « Reply #4 on: October 19, 2016, 03:12:50 PM »
    Personally i love iron man but i never thought to add it into a rsps, i'm sure many people will find this useful
    once very lonely and broken two souls pulled together to fix our broken hearts. Erica&Allen :)

    Offline...nerd123456789

    • Member
    • ***
    • Posts: 246
    • Thanks: +0/-0
      • View Profile
    Re: [PI]Ironman 90%
    « Reply #5 on: October 22, 2016, 02:06:33 PM »
    HELP PLEASE!!!! Compiler works fine, but when i run server this now comes up!!!
    _____________________________________________________________________________________

    Exception in thread "main" java.lang.ExceptionInInitializerError
    Caused by: java.lang.NumberFormatException: For input string: "410   "
            at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
            at java.lang.Integer.parseInt(Integer.java:492)
            at java.lang.Integer.parseInt(Integer.java:527)
            at server.model.npcs.NPCHandler.loadAutoSpawn(NPCHandler.java:4640)
            at server.model.npcs.NPCHandler.<init>(NPCHandler.java:1038)
            at server.Server.<clinit>(Server.java:86)
    Press any key to continue . . .

    HELP PL0X :confused::confused:

    Easy fix. you pasted it wrong in the cfg spawns

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal