Announcement

Collapse
No announcement yet.

What's Going On

Collapse

There are currently 42 users online. 3 members and 39 guests.

Most users ever online was 1,083 at 04:38 AM on 2016-11-18.

Hammer

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hammer

    Customizable hammer. Should be pretty obvious with the comments how to customize it, but if you have any questions just post.
    PHP Code:
    if (created) {
      
    toweapons Hammer;
      
    setstring client.hammerstrength,1// Strength of the hammer. Can later be changed without re-adding the weapon.
      
    setimg shiny_hammericon-#v(strtofloat(#s(client.hammerstrength))).png;
      
    this.staketiles = {
        
    // STA,KE,TI,LES, ,REP,LAC,ETI,LES, ,STRENGTH(1 = default),LEAPS(-1 = no leaps)
        
    0x14A,0x14B,0x15A,0x15B, ,0x70A,0x70B,0x71A,0x71B, ,1,-1// STAKE
        
    0x2  ,0x3  ,0x12 ,0x13 , ,0x2A5,0x2A6,0x2B5,0x2B6, ,1,// BUSH
        
    0x200,0x201,0x210,0x211, ,0x70A,0x70B,0x71A,0x71B, ,1,// SIGN
        
    0x2AC,0x2AD,0x2BC,0x2BD, ,0x6EA,0x6EB,0x6FA,0x6FB, ,2,// VASE
        
    0x674,0x675,0x684,0x685, ,0x70A,0x70B,0x71A,0x71B, ,1,-1// LIGHT STAKE
        
    0x7E0,0x7E1,0x7F0,0x7F1, ,0xFE5,0xFE6,0xFF5,0xFF6, ,2,-1// SNOW STAKE
        
    0xB4A,0xB4B,0xB5A,0xB5B, ,0xC50,0xC51,0xC60,0xC61, ,3,-1// VOLCANO STAKE
        
    0x22 ,0x23 ,0x32 ,0x33 , ,0x72A,0x72B,0x73A,0x73B, ,2,// LIGHT ROCK
        
    0x3DE,0x3DF,0x3EE,0x3EF, ,0x72A,0x72B,0x73A,0x73B, ,3,// DARK ROCK
      
    };
    }

    if (
    upgradehammer) {
      
    setstring client.hammerstrength,#p(0);
      
    setimg shiny_hammericon-#v(strtofloat(#s(client.hammerstrength))).png;
    }

    if (
    weaponfired) {
      
    this.hammerlevel strtofloat(#s(client.hammerstrength));
      
    setani shiny_hammer,shiny_hammer-#v(this.hammerlevel).png;
      
    freezeplayer .45;

      
    this.checkx int(playerx+.95)+vecx(playerdir)*2;
      
    this.checky int(playery+1.25)+vecy(playerdir)*2;

      
    this.stake = -1;
      for (
    i=0;i<arraylen(this.staketiles);i++) {
        if (
    tiles[this.checkx,this.checky] == this.staketiles[i*12]) {
          
    this.stake i;
          break;
        }
      }

      
    sleep .35;
      if (
    this.stake >= && this.hammerlevel >= this.staketiles[10+this.stake*12]) ReplaceStake();
      else 
    play lift.wav;
    }

    function 
    ReplaceStake() {
      for (
    i=0;i<4;i++) {
        if (
    tiles[this.checkx+(i%2),this.checky+int(i/2)] != this.staketiles[this.stake*12+i]) {
          
    play lift.wav;
          return;
        }
      }
      for (
    i=0;i<4;i++) {
        
    tiles[this.checkx+(i%2),this.checky+int(i/2)] = this.staketiles[5+this.stake*12+i];
      }
      if (
    this.staketiles[11+this.stake*12] >= 0putleaps this.staketiles[11+this.stake*12],this.checkx,this.checky;
      
    updateboard this.checkx,this.checky,2,2;
      
    play sign.wav;

    Here is the format of the tiles that are used. If you wish to add more stakes you will have to lay out the tiles like this before you get the hex code:
    [ATTACH]562[/ATTACH]
    Don't forget to add the , , between the STAKE and REPLACE tiles in the array!
    I've also attached the gani and images you'll need.

    UPDATE:
    I've added a command that will allow you to update the hammer externally from another NPC. All you have to do is call this script from another NPC(perhaps a blacksmith or something). It does not calculate level automatically, you will have to provide the desired level yourself.
    PHP Code:
    for (i=0;i<weaponscount;i++) {
      if (
    strequals(#w(i),Hammer)) {
        
    callweapon i,upgradehammer,3// UPGRADES THE HAMMER, LAST NUMBER IS DESIRED NEW LEVEL
        
    break;
      }

    Attached Files
    Last edited by Shiny; 2009-06-28, 05:28 PM.

    Click my sig to see an archive.
  • #2

    So much easier to link people to these threads then fussing with finding the code and customizing it for them. I'm sure people will whine about there being no weapon icon for the hammer, but the images tend to get cleaned out anyway.

    Comment

    • #3

      The looks on Beholders hammer is much sexier.

      Comment

      • #4

        Is this like the one you put on the OGCC?
        Originally posted by LoakeyRonso
        oh and the reason graal reborn is dead isn't what ever reason you want to blame it on , it's you . you publicly humiliate anyone who shows up , call them derogatory word's and treat them like shit . you close any thread you don't have any interest in even if other people do . slam their work without consideration for the person themself . how it is anyone can even consider you a decent human being is beyond me .
        3770

        Comment

        • #5

          And for people who do not know any better.

          Hammer = Shovel, as far as scripting goes.
          Same for Flute/Guitar/Drums having the same coding.

          Comment

          • #6

            Originally posted by Spooon View Post
            Is this like the one you put on the OGCC?
            Probably, though I scripted it from scratch and haven't even looked at that hammer.

            As far as Beholder's being better... all you gotta do is change the gani, so knock yourself out

            Click my sig to see an archive.

            Comment

            • #7

              Because I'm a nice guy, and Spoon encouraged me(he already made some icons for me, but I never preferred that angle).
              Attached Files
              Last edited by Shiny; 2009-06-25, 10:36 PM.

              Click my sig to see an archive.

              Comment

              • #8

                Did you scribble on them with the eraser tool on purpose?
                Originally posted by LoakeyRonso
                oh and the reason graal reborn is dead isn't what ever reason you want to blame it on , it's you . you publicly humiliate anyone who shows up , call them derogatory word's and treat them like shit . you close any thread you don't have any interest in even if other people do . slam their work without consideration for the person themself . how it is anyone can even consider you a decent human being is beyond me .
                3770

                Comment

                • #9

                  What do you mean?

                  Click my sig to see an archive.

                  Comment

                  • #10

                    I'm kidding about the eraser tool, but how did you come up with those? Looks like you used a crude extraction method to make them.
                    Originally posted by LoakeyRonso
                    oh and the reason graal reborn is dead isn't what ever reason you want to blame it on , it's you . you publicly humiliate anyone who shows up , call them derogatory word's and treat them like shit . you close any thread you don't have any interest in even if other people do . slam their work without consideration for the person themself . how it is anyone can even consider you a decent human being is beyond me .
                    3770

                    Comment

                    • #11

                      Err... copy/pasted out of the hammer graphics themselves
                      Then just grabbed the numbers out of state.png. I figured it would be better to have it match the rest of the GUI. I didn't really touch anything outside of just copy/pasting.

                      I'm not going to put that much effort into this, especially the graphics. It was mainly just a scripting thing, but I thought I'd throw in the graphics as well. If people aren't happy with the graphics, they can fix it

                      Click my sig to see an archive.

                      Comment

                      • #12

                        Originally posted by Shiny View Post
                        Err... copy/pasted out of the hammer graphics themselves
                        Then just grabbed the numbers out of state.png. I figured it would be better to have it match the rest of the GUI. I didn't really touch anything outside of just copy/pasting.
                        That's not what I see...
                        Originally posted by LoakeyRonso
                        oh and the reason graal reborn is dead isn't what ever reason you want to blame it on , it's you . you publicly humiliate anyone who shows up , call them derogatory word's and treat them like shit . you close any thread you don't have any interest in even if other people do . slam their work without consideration for the person themself . how it is anyone can even consider you a decent human being is beyond me .
                        3770

                        Comment

                        • #13

                          Originally posted by Spooon View Post
                          That's not what I see...
                          I don't know what you're seeing
                          The numbers and such are white, which will blend in with the background if that's what you mean. However, this is because the icons are transparent. If they're just saved to the computer and used, this shouldn't be an issue.

                          Oh... I see. Graal has this stupid transparency thing where it will make pure white(255,255,255) and pure black(0,0,0) transparent. It's so retarded -_-

                          Click my sig to see an archive.

                          Comment

                          • #14

                            :[ yeah
                            Originally posted by LoakeyRonso
                            oh and the reason graal reborn is dead isn't what ever reason you want to blame it on , it's you . you publicly humiliate anyone who shows up , call them derogatory word's and treat them like shit . you close any thread you don't have any interest in even if other people do . slam their work without consideration for the person themself . how it is anyone can even consider you a decent human being is beyond me .
                            3770

                            Comment

                            • #15

                              Well I fixed it

                              Click my sig to see an archive.

                              Comment

                              Working...
                              X