Thread: rock cake

Results 1 to 7 of 7
  1. #1 rock cake 
    Registered Member Bubz's Avatar
    Join Date
    Oct 2008
    Posts
    159
    Thanks given
    4
    Thanks received
    6
    Rep Power
    1
    okay so this is prob so easy but im not sure how to do it. but how do i stop the rock cake from killing you. once u hit 1 hp it wont go lower then that.

    this is my code

    Code:
    			
    case 7509://rock cake
    player.getUpdateFlags().sendAnimation(new Animation(829));
    player.hit(new Hit(1, Hit.HitTypes.NONE));
    player.getUpdateFlags().sendForceMessage("Ow! I think i chipped a tooth.");
    break;
    Reply With Quote  
     

  2. #2  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,451
    Thanks given
    150
    Thanks received
    193
    Rep Power
    345
    Code:
    case 7509://rock cake
    if(health > 1) {
    player.getUpdateFlags().sendAnimation(new Animation(829));
    player.hit(new Hit(1, Hit.HitTypes.NONE));
    player.getUpdateFlags().sendForceMessage("Ow! I think i chipped a tooth.");
    }
    break;
    just change health to whatever determs your current health.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  3. #3  
    Registered Member
    Remi's Avatar
    Join Date
    Jan 2015
    Posts
    463
    Thanks given
    438
    Thanks received
    113
    Rep Power
    176
    Arch posted right when I posted but yeah, what he said.

    Check your players hitpoints, example:

    Code:
     case 7509://rock cake
    if (player.getSkills().getLevel(Skills.HITPOINTS) > 1) {
    player.getUpdateFlags().sendAnimation(new Animation(829));
    player.hit(new Hit(1, Hit.HitTypes.NONE));
    player.getUpdateFlags().sendForceMessage("Ow! I think i chipped a tooth.");
    }
    break;
    Where the fuck is my cigarettes, I need my cancer. [C][Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #4  
    Registered Member Bubz's Avatar
    Join Date
    Oct 2008
    Posts
    159
    Thanks given
    4
    Thanks received
    6
    Rep Power
    1
    Quote Originally Posted by Remi View Post
    Arch posted right when I posted but yeah, what he said.

    Check your players hitpoints, example:

    Code:
     case 7509://rock cake
    if (player.getSkills().getLevel(Skills.HITPOINTS) > 1) {
    player.getUpdateFlags().sendAnimation(new Animation(829));
    player.hit(new Hit(1, Hit.HitTypes.NONE));
    player.getUpdateFlags().sendForceMessage("Ow! I think i chipped a tooth.");
    }
    break;

    okay so this is what i added and it doesn't take damage at all now. also im using vencillo base

    Code:
    			 case 7509://rock cake
    				 if (player.getSkill().getLevels(Skills.HITPOINTS) > 1) {
    				 player.getUpdateFlags().sendAnimation(new Animation(829));
    				 player.hit(new Hit(1, Hit.HitTypes.NONE));
    				 player.getUpdateFlags().sendForceMessage("Ow! I think i chipped a tooth.");
    				 }
    				 break;
    Reply With Quote  
     

  5. #5  
    Registered Member
    Remi's Avatar
    Join Date
    Jan 2015
    Posts
    463
    Thanks given
    438
    Thanks received
    113
    Rep Power
    176
    Quote Originally Posted by Bubz View Post
    okay so this is what i added and it doesn't take damage at all now. also im using vencillo base

    Code:
    			 case 7509://rock cake
    				 if (player.getSkill().getLevels(Skills.HITPOINTS) > 1) {
    				 player.getUpdateFlags().sendAnimation(new Animation(829));
    				 player.hit(new Hit(1, Hit.HitTypes.NONE));
    				 player.getUpdateFlags().sendForceMessage("Ow! I think i chipped a tooth.");
    				 }
    				 break;
    got any errors?

    replace if (player.getSkill().getLevels(Skills.HITPOINTS) > 1) {

    with what I think Vencillio uses for checking levels?

    if (c.playerLevel[3] > 1) {
    Where the fuck is my cigarettes, I need my cancer. [C][Only registered and activated users can see links. ]
    Reply With Quote  
     

  6. #6  
    Copenhagen Mint LC


    Join Date
    Apr 2012
    Age
    21
    Posts
    1,515
    Thanks given
    404
    Thanks received
    364
    Rep Power
    475
    Within the Vencillo base I'm sure there is a getCurrentHealth() method you can call to get the updated health every time.

    Reply With Quote  
     

  7. #7  
    Registered Member Bubz's Avatar
    Join Date
    Oct 2008
    Posts
    159
    Thanks given
    4
    Thanks received
    6
    Rep Power
    1
    figured it out i found in consumables the int for healing and added it to the code this is what i came up with and works !

    Code:
    			 case 7509://rock cake
    				 if (player.getSkill().getLevels()[3] > 1) {
    				 player.getUpdateFlags().sendAnimation(new Animation(829));
    				 player.hit(new Hit(1, Hit.HitTypes.NONE));
    				 /*player.getUpdateFlags().sendForceMessage("Ow! I think i chipped a tooth.");*/
    				 }
    				 break;
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [718] Dwarven Rock Cake
    By _jordan in forum Snippets
    Replies: 6
    Last Post: 08-24-2013, 04:11 AM
  2. Pi Rock Cakes
    By Red Bull in forum Snippets
    Replies: 19
    Last Post: 12-03-2012, 05:42 PM
  3. [667] Dwarven Rock Cake
    By Aksel in forum Snippets
    Replies: 5
    Last Post: 08-31-2012, 09:23 PM
  4. [PI] Rock Cakes?(will thank and rep)
    By RS2006Phat in forum Help
    Replies: 2
    Last Post: 01-30-2012, 10:50 PM
  5. Rock Cake
    By Nikki in forum Help
    Replies: 6
    Last Post: 03-05-2009, 02:10 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •