Thread: [Adding Bracelet of Etheruem]

Results 1 to 7 of 7
  1. #1 [Adding Bracelet of Etheruem] 
    Registered Member
    Join Date
    Jul 2014
    Posts
    45
    Thanks given
    3
    Thanks received
    4
    Rep Power
    10
    Hello i've been trying to add bracelet of ethereum i wanted to make it like osrs, so when u equip it the revenants can only hit 0's.
    i got quite far, the only thing that is not working is the part that the revenants hit 0's.

    Code:
     if (hit.getAttacker() != null) {
                    if (hit.getAttacker().isNpc()) {
                        Mob mob = World.getNpcs()[hit.getAttacker().getIndex()];
                        if (mob != null && MobConstants.isRevenant(mob)) {
                            if (ItemCheck.isWearingBraceletofethereum(player)&& hit.getType() != Hit.HitTypes.NONE)  {
                            	
                       player.getClient().queueOutgoingPacket(new SendMessage("test1"));
                       hit.setDamage(0);
                       
                            }	
                        } 
                    }
               }
    It does work but can't get the npc hit 0's.

    ps. vencillio base

    Reply With Quote  
     

  2. #2  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,586
    Thanks given
    160
    Thanks received
    248
    Rep Power
    396
    Seems like something else is overwriting your damage.


    "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
    Join Date
    Jul 2014
    Posts
    45
    Thanks given
    3
    Thanks received
    4
    Rep Power
    10
    Quote Originally Posted by arch337 View Post
    Seems like something else is overwriting your damage.
    i've placed this code right under anti dragon fireshield that works fine when its equiped. it's really confusing me...
    Reply With Quote  
     

  4. #4  
    Registered Member
    Tommeh's Avatar
    Join Date
    Nov 2015
    Age
    20
    Posts
    1,927
    Thanks given
    307
    Thanks received
    959
    Rep Power
    5000
    do more debugging, check if ur code is even reached at all
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #5  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,586
    Thanks given
    160
    Thanks received
    248
    Rep Power
    396
    Quote Originally Posted by ihatedef View Post
    i've placed this code right under anti dragon fireshield that works fine when its equiped. it's really confusing me...
    Hard to say with the code you have shared as with the logic of this code it should just make your hit 0.
    As I mention before, something else after this set the damage to something else.


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

  6. #6  
    Registered Member
    Join Date
    Jul 2014
    Posts
    45
    Thanks given
    3
    Thanks received
    4
    Rep Power
    10
    Quote Originally Posted by arch337 View Post
    Hard to say with the code you have shared as with the logic of this code it should just make your hit 0.
    As I mention before, something else after this set the damage to something else.
    my anti d shield code:

    Code:
    f (hit.getAttacker() != null) {
                if (hit.getAttacker().isNpc()) {
                    Mob mob = World.getNpcs()[hit.getAttacker().getIndex()];
                    if (mob != null && MobConstants.isDragon(mob)) {
                        if (ItemCheck.isWearingAntiDFireShield(player) && (hit.getType() == Hit.HitTypes.MAGIC)) {
                            if (ItemCheck.hasDFireShield(player)) {
                                player.getMagic().incrDragonFireShieldCharges(mob);
                            }
                            if (player.hasFireImmunity()) {
                                player.getClient().queueOutgoingPacket(new SendMessage("You resist all of the dragonfire."));
                                hit.setDamage(0);
                            } else {
                                player.getClient().queueOutgoingPacket(new SendMessage("You manage to resist some of the dragonfire."));
                                hit.setDamage((int) (hit.getDamage() * 0.3));
                            }
                        } else if (hit.getType() == Hit.HitTypes.MAGIC && player.hasSuperFireImmunity()) {
                            player.getClient().queueOutgoingPacket(new SendMessage("You reset all of the dragonfire."));
                            hit.setDamage(0);
                        } else if (hit.getType() == Hit.HitTypes.MAGIC && player.hasFireImmunity()) {
                            player.getClient().queueOutgoingPacket(new SendMessage("You manage to resist some of the dragonfire."));
                            hit.setDamage((int) (hit.getDamage() * 0.5));
                        } else if ((hit.getType() == Hit.HitTypes.MAGIC)) {
                            player.getClient().queueOutgoingPacket(new SendMessage("You are horribly burned by the dragonfire."));
                        }
                    }
    this works fine... tryed other possibiltys stil no green light..
    Reply With Quote  
     

  7. #7  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,586
    Thanks given
    160
    Thanks received
    248
    Rep Power
    396
    Well it can also be that the npc's damage is being trigged before the 0 hit damage is. So have a look at your code again as when the damage is being trigged for the npc.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    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. Gamers - Beware of driver problems
    By Colby in forum Windows
    Replies: 11
    Last Post: 03-05-2010, 02:53 AM
  2. abit of a problem
    By TwistedBoner in forum Help
    Replies: 6
    Last Post: 05-02-2009, 08:28 PM
  3. Emulous added tons of shops/npcs
    By Georgeo in forum Downloads
    Replies: 32
    Last Post: 04-10-2009, 09:14 PM
  4. Replies: 2
    Last Post: 04-10-2009, 04:58 PM
  5. [SIMPLE] Adding ONE of the new Hairstlyes
    By newservermaker in forum Tutorials
    Replies: 10
    Last Post: 02-13-2008, 04:38 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
  •