Thread: [Vencillio] Make a Item heal a % of damage you give

Results 1 to 6 of 6
  1. #1 [Vencillio] Make a Item heal a % of damage you give 
    Extreme Donator

    CusYaBasic's Avatar
    Join Date
    Jul 2010
    Age
    29
    Posts
    290
    Thanks given
    85
    Thanks received
    26
    Rep Power
    88
    I wanna make a ring have kinda the same effects as soulsplit prayer
    How would I go about doing this?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Oct 2015
    Posts
    136
    Thanks given
    3
    Thanks received
    7
    Rep Power
    11
    In the applyDamage method:

    Code:
    if(player.getEquipment().getSlot(RING_SLOT) == ItemID) {
    player.setCurrentHitpoints(player.getCurrentHitpoints + (damage % 10));
    }
    something along those lines.
    Reply With Quote  
     

  3. #3  
    Extreme Donator

    CusYaBasic's Avatar
    Join Date
    Jul 2010
    Age
    29
    Posts
    290
    Thanks given
    85
    Thanks received
    26
    Rep Power
    88
    Still need help with this if anyone can

    So far I've got this (please don't judge it's the first thing I've wrote in 3 years)

    Code:
    			Item ring = player.getEquipment().getItems()[12];
    		
    		int damage = player.getLastDamageDealt();
    		int heal = player.getSkill().getLevels()[3] + damage / 20;
    
    		if ((ring != null) && (ring.getId() == 2550)) {
    			if(player.getSkill().getLevels()[3] < heal){
    			player.getSkill().setLevel(3, heal);
    			player.getClient().queueOutgoingPacket(new SendMessage("@blu@Your ring vibrates; Healing you " + damage / 20)); 
    		}
    		}
    It heals me; but it doesn't heal me for 20%.. it heals me for all the damage. and it won't stop healing at full health, it'll heal to around 120 then the npc one hits me any help would be great

    EDIT: Fixed the healing % just need to stop healing if health is 99
    EDIT2: Fixed both issues myself

    If anyone was curious this is how I did it

    Code:
    		Item ring = player.getEquipment().getItems()[12];
    		
    		int damage = player.getLastDamageDealt();
    		int heal = player.getSkill().getLevels()[3] + damage / 3;
    
    		if ((ring != null) && (ring.getId() == 2550)) {
    			if(player.getSkill().getLevels()[3] >= 99){
    				player.getClient().queueOutgoingPacket(new SendMessage("@red@Your ring cannot heal at full health "));
    			} else
    			if(player.getSkill().getLevels()[3] < heal){
    				player.getSkill().setLevel(3, heal);
    				player.getClient().queueOutgoingPacket(new SendMessage("@blu@Your ring vibrates; You hit: " + damage + "@red@ healing you " + damage / 3)); 
    		}
    		}
    If theres a better way of doing this or any feedback let me know

    Many thanks
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jan 2017
    Posts
    196
    Thanks given
    15
    Thanks received
    22
    Rep Power
    11
    Spamming the player every hit he does is quite annoying tbh
    Reply With Quote  
     

  5. #5  
    Registered Member 1m6n29s9gmxh's Avatar
    Join Date
    Jan 2017
    Posts
    430
    Thanks given
    32
    Thanks received
    100
    Rep Power
    40
    Lol do it the right way bud,
    Code:
    if(player.getSkill().getLevels()[3] >= 99){
    Not everyone will have 99 hp, so lets say you're a level 3 or w.e and you use this item. Then you'll get boosted to 99.
    Heres the code for telling their max hp level.
    Code:
    player.getMaxLevels()[3]
    Spoiler for Insanity V2 Coders be like ::
    Attached image
    Attached image
    Reply With Quote  
     

  6. #6  
    Extreme Donator

    CusYaBasic's Avatar
    Join Date
    Jul 2010
    Age
    29
    Posts
    290
    Thanks given
    85
    Thanks received
    26
    Rep Power
    88
    Quote Originally Posted by Sami2427 View Post
    Spamming the player every hit he does is quite annoying tbh
    I like too see How much the ring heals you compaired to the damage; Gunna add a toggle option for it for thoses who dislike it

    Quote Originally Posted by OsFury View Post
    Lol do it the right way bud,
    Code:
    if(player.getSkill().getLevels()[3] >= 99){
    Not everyone will have 99 hp, so lets say you're a level 3 or w.e and you use this item. Then you'll get boosted to 99.
    Heres the code for telling their max hp level.
    Code:
    player.getMaxLevels()[3]
    I did say I haven't done any scripting for a few years now, so things ain't going to be done properly or cleanly..

    But thank you for the feedback; I've made changes where needed
    Attached image
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. Replies: 2
    Last Post: 09-05-2013, 02:52 AM
  2. making an item heal in 718
    By killiewilli in forum Help
    Replies: 7
    Last Post: 09-02-2013, 09:39 AM
  3. Replies: 14
    Last Post: 12-08-2012, 10:40 PM
  4. Replies: 9
    Last Post: 01-15-2012, 02:28 AM
  5. Replies: 5
    Last Post: 08-10-2011, 07:49 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
  •