[Tut] making Npc's Teleport You Upon Your Death

Results 1 to 5 of 5
  1. #1
    Member owner abz is offline
    MemberRank
    Feb 2008 Join Date
    Under Your BedLocation
    69Posts

    [Tut] making Npc's Teleport You Upon Your Death

    Difficulty: 2/10

    Purpose: To be able to make an NPC teleport its killer upon death. Also can be used for teleportation mini-games that use waves such as fire cape minigame.

    Files Edited: NPCHandler.java

    Required Knowledge: Ability to follow directions

    Server Base: Pimpscape Related Sources (Czar, hiya, etc.)

    Tutorial:


    Step 1: Finding The Section
    Everything we will be doing takes place in NPCHandler.java and the first thing you might want to do is make a backup in case you miscode something. Next Search (control + f) for: Code:
    (npcs[i].IsDead == true)
    Why did I just do that? Because this section deals with the animation the selected NPC simulates upon death, but were going to be adding other stuff with the animations.

    Step 2: Adding The Command to Teleport
    Next we'll have to add a new part for our type of NPC, heres an example of one:
    Code:
    } else if (npcs[i].npcType == 2627) {
    npcs[i].animNumber = 0x900; //Tz-kih
    plr.teleportToX = 2228;
    plr.teleportToY = 4954;
    plr.heightLevel = 0;
    Important You can place this anywhere in the list as long as its above Code:
    } else {
    because that code means all other npc ids not stated above.
    What did I just do? Well the npc Type is the npc id; I used 2627 which is tz-kih also known as the first creature in the fire cape minigame. Then the animNumber is the animation that Tz-kih will do when he dies, I chose 0x900 because thats the default animation that most creatures do when they die. You should understand what 'teleportToX', 'teleportToY', and 'heightLevel' is because those come straight from client.java. We added the 'plr.' in front of them because were telling the server to teleport the player not the npc.

    Step 3: Declaring The New Commands
    Scroll back up to Code:
    } else if (npcs[i].IsDead == true) {
    and make sure you're at the end of the line or after the '{' if its in the next line, then you'll have to hit enter. (if you want, I like to hit it a few times for the extra room and white space) Then Add this in that area: Code:
    int Player = npcs[i].StartKilling;
    client plr = (client) server.playerHandler.players[Player];

    All Credits to : Me!!


  2. #2
    Member Mc.Rui is offline
    MemberRank
    Oct 2007 Join Date
    PortugalLocation
    54Posts

    Re: [tut]making Npc's Teleport You Upon Your Death[tut]

    Thx very much! It worked for me!

    I was asking how to do that in Help Center!!!
    Now I can finish my minigame =))


    U rock man!




    Do u know how to take cart off? I just did ::cart and now idk how to take it off =S

  3. #3
    Member Bloodster is offline
    MemberRank
    Jul 2005 Join Date
    AustraliaLocation
    61Posts

    Re: [tut]making Npc's Teleport You Upon Your Death[tut]

    Owner ABZ, thanks for this, helps alot in Mini-Games like Castle Wars & The Pits.(Fire Cape Event)

  4. #4
    Member owner abz is offline
    MemberRank
    Feb 2008 Join Date
    Under Your BedLocation
    69Posts

    Re: [tut]making Npc's Teleport You Upon Your Death[tut]

    no problem

  5. #5
    Member owner abz is offline
    MemberRank
    Feb 2008 Join Date
    Under Your BedLocation
    69Posts

    Re: [tut]making Npc's Teleport You Upon Your Death[tut]

    Quote Originally Posted by Mc.Rui View Post
    Thx very much! It worked for me!

    I was asking how to do that in Help Center!!!
    Now I can finish my minigame =))


    U rock man!




    Do u know how to take cart off? I just did ::cart and now idk how to take it off =S
    I think You Need To Do ::female/::male



Advertisement