[Tut] Dragon Mini-Game

Results 1 to 14 of 14
  1. #1
    Apprentice Sync` is offline
    MemberRank
    Jan 2008 Join Date
    6Posts

    [Tut] Dragon Mini-Game

    Purpose: To add a fun Mini-Game to your Server.

    Difficulty: 2/10

    Assumed Knowledge: C&P

    Server Base: WhiteScape/Cheezscape

    Classes Modified: Autospawn.CFG, Client.java, and Item2.java.

    Procedure
    Firstly open up Autospawn and add:
    Code:
    spawn = 0    2664    9805    0    3264    3285    3260    3281    2    hans
    spawn = 53    2660    9808    0    3264    3285    3260    3281    2    baby red dragon
    spawn = 53    2659    9810    0    3264    3285    3260    3281    2    baby red dragon
    spawn = 53    2662    9811    0    3264    3285    3260    3281    2    baby red dragon
    spawn = 53    2667    9809    0    3264    3285    3260    3281    2    baby red dragon
    spawn = 53    2665    9806    0    3264    3285    3260    3281    2    baby red dragon
    spawn = 1571    2646    9866    0    3264    3285    3260    3281    2    Harold Evans
    spawn = 55    2644    9867    0    3264    3285    3260    3281    2    Blue Dragon
    spawn = 55    2648    9865    0    3264    3285    3260    3281    2    Blue Dragon
    spawn = 37    2546    9844    0    3264    3285    3260    3281    2    Sigbert the Adventurer
    spawn = 54    2542    9844    0    3264    3285    3260    3281    2    Black Dragon
    spawn = 37    2612    9816    0    3264    3285    3260    3281    2    Sigbert the Adventurer
    spawn = 50    2613    9812    0    3264    3285    3260    3281    2    King Black Dragon
    Now open Client.java and search for void UpdateNPCChat() {, go down to the last case and add these(You may have to change the case numbers if these are already taken).
    Code:
                case 8:
                     sendFrame200(4883, 591);
                     sendFrame126(GetNpcName(NpcTalkTo), 4884);
                     sendFrame126("Thanks for coming, get the key from the dragons", 4885);
                     sendFrame75(NpcTalkTo, 4883);
                     sendFrame164(4882);
                     NpcDialogueSend = true;
                     break;
                case 9:
                     sendFrame200(4883, 591);
                     sendFrame126(GetNpcName(NpcTalkTo), 4884);
                     sendFrame126("Good job, now help Harold", 4885);
                     sendFrame75(NpcTalkTo, 4883);
                     sendFrame164(4882);
                     NpcDialogueSend = true;
                     teleportToX = 2646;
                     teleportToY = 9866;
                     break;
                case 10:
                     sendFrame200(4883, 591);
                     sendFrame126(GetNpcName(NpcTalkTo), 4884);
                     sendFrame126("Please help me, I've been trapped here for days", 4885);
                     sendFrame75(NpcTalkTo, 4883);
                     sendFrame164(4882);
                     NpcDialogueSend = true;
                     break;
                case 11:
                     sendFrame200(4883, 591);
                     sendFrame126(GetNpcName(NpcTalkTo), 4884);
                     sendFrame126("Thank you for your help", 4885);
                     sendFrame75(NpcTalkTo, 4883);
                     sendFrame164(4882);
                     NpcDialogueSend = true;
                     teleportToX = 2546;
                     teleportToY = 9844;    
                     break;
                case 12:
                     sendFrame200(4883, 591);
                     sendFrame126(GetNpcName(NpcTalkTo), 4884);
                     sendFrame126("Oh no, help me!", 4885);
                     sendFrame75(NpcTalkTo, 4883);
                     sendFrame164(4882);
                     NpcDialogueSend = true;
                     break;
                case 13:
                     sendFrame200(4883, 591);
                     sendFrame126(GetNpcName(NpcTalkTo), 4884);
                     sendFrame126("Thank yo--wait, what happened!?", 4885);
                     sendFrame75(NpcTalkTo, 4883);
                     sendFrame164(4882);
                     NpcDialogueSend = true;
                     teleportToX = 2612;
                     teleportToY = 9815;
                     break;        
                case 14:
                     sendFrame200(4883, 591);
                     sendFrame126(GetNpcName(NpcTalkTo), 4884);
                     sendFrame126("You're really strong! Take this as a reward.", 4885);
                     sendFrame75(NpcTalkTo, 4883);
                     sendFrame164(4882);
                     NpcDialogueSend = true;
                     teleportToX = 3185;
                     teleportToY = 3426;
                     addItem(1149, 1);
                     addItem(4087, 1);
                     addItem(3140, 1);
                     addItem(1187, 1);
                     break;
    Now search for case 155: and add these.
    Code:
    if(NPCID == 0){
    if(!IsItemInBag(2944)){
                skillX = server.npcHandler.npcs[NPCSlot].absX;
                skillY = server.npcHandler.npcs[NPCSlot].absY;
                NpcWanneTalk = 8;
                }
    if(IsItemInBag(2887)){
                skillX = server.npcHandler.npcs[NPCSlot].absX;
                skillY = server.npcHandler.npcs[NPCSlot].absY;
                NpcWanneTalk = 9;
    }
    }
    if(NPCID == 1571){
    if(!IsItemInBag(2945)){
                skillX = server.npcHandler.npcs[NPCSlot].absX;
                skillY = server.npcHandler.npcs[NPCSlot].absY;
                NpcWanneTalk = 10;
                }
    if(IsItemInBag(2944)){
                skillX = server.npcHandler.npcs[NPCSlot].absX;
                skillY = server.npcHandler.npcs[NPCSlot].absY;
                NpcWanneTalk = 11;
    }
    }
    if(NPCID == 37){
    if(!IsItemInBag(989)){
                skillX = server.npcHandler.npcs[NPCSlot].absX;
                skillY = server.npcHandler.npcs[NPCSlot].absY;
                NpcWanneTalk = 12;
                }
    if(IsItemInBag(2945)){
                skillX = server.npcHandler.npcs[NPCSlot].absX;
                skillY = server.npcHandler.npcs[NPCSlot].absY;
                NpcWanneTalk = 13;
                }
    if(IsItemInBag(989)){
                skillX = server.npcHandler.npcs[NPCSlot].absX;
                skillY = server.npcHandler.npcs[NPCSlot].absY;
                NpcWanneTalk = 14;        
    }
    }
    Now it's time to add the drops.
    WHITESCAPE
    Open npcdrops.cfg and add these.

    Code:
    npcdrop = 53        0        2887    1
    npcdrop = 55        0        2944    1
    npcdrop = 54        0        2945    1
    npcdrop = 50        0        989    1
    OTHER SERVERS
    Open Item2.java and add these, if any of these NPC's already have drops set then just add the drops into it.

    Code:
    public static int BlackDragon[] = {2945,2945,2945,2945};
    
        public static int randomBlackDragon()
        {
            return BlackDragon[(int)(Math.random()*Name.length)];
        }
    public static int RedDragon[] = {2887,2889,2887,2887};
    
        public static int randomRedDragon()
        {
            return RedDragon[(int)(Math.random()*Name.length)];
        }
    public static int BlueDragon[] = {2945,2945,2945,2945};
    
        public static int randomBlueDragon()
        {
            return BlueDragon[(int)(Math.random()*Name.length)];
        }
    public static int KBD[] = {2945,2945,2945,2945};
    
        public static int randomKBD()
        {
            return KBD[(int)(Math.random()*Name.length)];
        }
    Now open NpcHandler.java and search for:
    Code:
    public void MonsterDropItem(int NPCID)
    Under that add:
    Code:
    else if(npcs[NPCID].npcType == 54)
    {
    ItemHandler.addItem(526, npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
    ItemHandler.addItem(Item2.randomBlackDragon(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
    }
    
    else if(npcs[NPCID].npcType == 53)
    {
    ItemHandler.addItem(526, npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
    ItemHandler.addItem(Item2.randomRedDragon(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
    }
    
    else if(npcs[NPCID].npcType == 55)
    {
    ItemHandler.addItem(526, npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
    ItemHandler.addItem(Item2.randomBlueDragon(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
    }
    
    else if(npcs[NPCID].npcType == 50)
    {
    ItemHandler.addItem(526, npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
    ItemHandler.addItem(Item2.randomKBD(), npcs[NPCID].absX, npcs[NPCID].absY, 1, GetNpcKiller(NPCID), false);
    }
    Now it's time to add a command to get there.
    Search for: ("pickup") in Client.java, above that add:

    Code:
        else if (command.equalsIgnoreCase("dragon"))
        {
            teleportToX = 2663;
            teleportToY = 9805;
        }
    If you get:
    Code:
    Exception in thread "main" java.lang.NumberFormatException: For input string: "5
    5        0       2944    1"
            at java.lang.NumberFormatException.forInputString(Unknown Source)
            at java.lang.Integer.parseInt(Unknown Source)
            at java.lang.Integer.parseInt(Unknown Source)
            at NPCHandler.loadNPCDrops(NPCHandler.java:753)
            at NPCHandler.<init>(NPCHandler.java:22)
            at server.main(server.java:23)
    You will have to open NpcHandler.java, you should see this at the top, public static int maxNPCDrops =, add a 0 to the number.

    If your client freezes when you attack a monster you'll have to set the Dragon's HP in npc.cfg.


    Credits: Sync

    Pictures:










    Added some pictures.


  2. #2
    Account Upgraded | Title Enabled! emmon is offline
    MemberRank
    Mar 2007 Join Date
    Playing my server.Location
    228Posts

    Re: [TUT]Dragon Mini-Game[TUT]

    Col!

  3. #3
    Enthusiast HubbaHut is offline
    MemberRank
    Jul 2007 Join Date
    NottinghamLocation
    25Posts

    Re: [TUT]Dragon Mini-Game[TUT]

    Very Nice TuT - I'll be using it on my server and could you post or pm me anymore that you have..

    Thanks

    ~ Jay

  4. #4
    Member ~Bullet is offline
    MemberRank
    Jan 2008 Join Date
    53Posts

    Re: [TUT]Dragon Mini-Game[TUT]

    This is a very great tut,it will help people alot.I will post if I get any errors

  5. #5
    Infraction Banned Martie409 is offline
    MemberRank
    Jan 2008 Join Date
    In Your ShedLocation
    185Posts

    Re: [TUT]Dragon Mini-Game[TUT]

    Very Nice !

  6. #6
    Apprentice plusscape is offline
    MemberRank
    Mar 2008 Join Date
    14Posts

    Re: [TUT]Dragon Mini-Game[TUT]

    very bloody nice nice mini game XDXD

  7. #7
    Apprentice black thief8 is offline
    MemberRank
    Mar 2008 Join Date
    8Posts

    Re: [TUT]Dragon Mini-Game[TUT]

    WTF 42 errors plox? and when i removed it 100+...

  8. #8
    Apprentice black thief8 is offline
    MemberRank
    Mar 2008 Join Date
    8Posts

    Question Re: [TUT]Dragon Mini-Game[TUT]

    Code:
    :: Preparing for compile...
    :: Auto-setting envriomental variables...
    ::
    :: Scanning for latest JDK version...
    ::
    :: Found JDK 1.6.0_04
    :: Results:
    NPCHandler.java:912: ';' expected
            public void MonsterDropItem(int NPCID)
                                                  ^
    NPCHandler.java:919: illegal start of type
    else if(npcs[NPCID].npcType == 53)
    ^
    NPCHandler.java:919: ';' expected
    else if(npcs[NPCID].npcType == 53)
        ^
    NPCHandler.java:919: illegal start of type
    else if(npcs[NPCID].npcType == 53)
           ^
    NPCHandler.java:919: ']' expected
    else if(npcs[NPCID].npcType == 53)
                 ^
    NPCHandler.java:919: illegal start of type
    else if(npcs[NPCID].npcType == 53)
                      ^
    NPCHandler.java:919: <identifier> expected
    else if(npcs[NPCID].npcType == 53)
                       ^
    NPCHandler.java:919: ';' expected
    else if(npcs[NPCID].npcType == 53)
                        ^
    NPCHandler.java:919: illegal start of type
    else if(npcs[NPCID].npcType == 53)
                                ^
    NPCHandler.java:919: <identifier> expected
    else if(npcs[NPCID].npcType == 53)
                                  ^
    NPCHandler.java:919: ';' expected
    else if(npcs[NPCID].npcType == 53)
                                     ^
    NPCHandler.java:925: illegal start of type
    else if(npcs[NPCID].npcType == 55)
    ^
    NPCHandler.java:925: ';' expected
    else if(npcs[NPCID].npcType == 55)
        ^
    NPCHandler.java:925: illegal start of type
    else if(npcs[NPCID].npcType == 55)
           ^
    NPCHandler.java:925: ']' expected
    else if(npcs[NPCID].npcType == 55)
                 ^
    NPCHandler.java:925: illegal start of type
    else if(npcs[NPCID].npcType == 55)
                      ^
    NPCHandler.java:925: <identifier> expected
    else if(npcs[NPCID].npcType == 55)
                       ^
    NPCHandler.java:925: ';' expected
    else if(npcs[NPCID].npcType == 55)
                        ^
    NPCHandler.java:925: illegal start of type
    else if(npcs[NPCID].npcType == 55)
                                ^
    NPCHandler.java:925: <identifier> expected
    else if(npcs[NPCID].npcType == 55)
                                  ^
    NPCHandler.java:925: ';' expected
    else if(npcs[NPCID].npcType == 55)
                                     ^
    NPCHandler.java:931: illegal start of type
    else if(npcs[NPCID].npcType == 50)
    ^
    NPCHandler.java:931: ';' expected
    else if(npcs[NPCID].npcType == 50)
        ^
    NPCHandler.java:931: illegal start of type
    else if(npcs[NPCID].npcType == 50)
           ^
    NPCHandler.java:931: ']' expected
    else if(npcs[NPCID].npcType == 50)
                 ^
    NPCHandler.java:931: illegal start of type
    else if(npcs[NPCID].npcType == 50)
                      ^
    NPCHandler.java:931: <identifier> expected
    else if(npcs[NPCID].npcType == 50)
                       ^
    NPCHandler.java:931: ';' expected
    else if(npcs[NPCID].npcType == 50)
                        ^
    NPCHandler.java:931: illegal start of type
    else if(npcs[NPCID].npcType == 50)
                                ^
    NPCHandler.java:931: <identifier> expected
    else if(npcs[NPCID].npcType == 50)
                                  ^
    NPCHandler.java:931: ';' expected
    else if(npcs[NPCID].npcType == 50)
                                     ^
    31 errors
    :: Done!
    Press any key to continue . . .
    any ideas?

  9. #9
    Account Upgraded | Title Enabled! Mayflair is offline
    MemberRank
    Jul 2007 Join Date
    Tilburg - HollandLocation
    206Posts

    Re: [TUT]Dragon Mini-Game[TUT]

    Omg VERY nice done!

  10. #10
    Account Upgraded | Title Enabled! iHax is offline
    MemberRank
    Dec 2007 Join Date
    Inside you're PCLocation
    309Posts

    Re: [TUT]Dragon Mini-Game[TUT]

    Very very nice :)
    I will use this, thanks.


    Laters,
    iHax

  11. #11
    Proficient Member rolls is offline
    MemberRank
    Apr 2008 Join Date
    In a box with a computerLocation
    164Posts

    Re: [TUT]Dragon Mini-Game[TUT]

    hey, every thing works, compiling running but the command dosn't work, it exacly the same
    Last edited by rolls; 09-06-08 at 03:47 AM.

  12. #12
    Novice Toxcito is offline
    MemberRank
    Jul 2008 Join Date
    2Posts

    Re: [Tut] Dragon Mini-Game

    I get an error about hans

    Code:
     Exception in thread "main" java.lang.NumberFormatException: For input string: "0
           2664    9805    0       3264    3285    3260    3281    2    hans"
            at java.lang.NumberFormatException.forInputString(Unknown Source)
            at java.lang.Integer.parseInt(Unknown Source)
            at java.lang.Integer.parseInt(Unknown Source)
            at NPCHandler.loadAutoSpawn(NPCHandler.java:1162)
            at NPCHandler.<init>(NPCHandler.java:23)
            at server.main(server.java:27)
    Starting CheezScape Server on 0.0.0.0:43594
    Can anyone understand this? D:

  13. #13
    Novice zolindo is offline
    MemberRank
    Jul 2008 Join Date
    In A BoxLocation
    1Posts

    Re: [Tut] Dragon Mini-Game

    on my base server it says "jli.dl wasnt found, re-installing the program might help" ive tried it, but it doesnt do anything...:confused_ do i need to download it from somewhere? or get a different base server? (cheezscape and whitescape are out-of-date not)

  14. #14
    Proficient Member BezzoXar is offline
    MemberRank
    Apr 2008 Join Date
    185Posts

    Re: [Tut] Dragon Mini-Game

    Quote Originally Posted by Toxcito View Post
    I get an error about hans

    Code:
     Exception in thread "main" java.lang.NumberFormatException: For input string: "0
           2664    9805    0       3264    3285    3260    3281    2    hans"
            at java.lang.NumberFormatException.forInputString(Unknown Source)
            at java.lang.Integer.parseInt(Unknown Source)
            at java.lang.Integer.parseInt(Unknown Source)
            at NPCHandler.loadAutoSpawn(NPCHandler.java:1162)
            at NPCHandler.<init>(NPCHandler.java:23)
            at server.main(server.java:27)
    Starting CheezScape Server on 0.0.0.0:43594
    Can anyone understand this? D:
    I get the same error, wtf?



Advertisement