Thread: 667 Making the Overload effect reset before a duel start?

Results 1 to 2 of 2
  1. #1 667 Making the Overload effect reset before a duel start? 
    Registered Member 13lack drag's Avatar
    Join Date
    Feb 2011
    Posts
    235
    Thanks given
    1
    Thanks received
    11
    Rep Power
    3
    I've been fixing almost all the major bugs in duel, including 2nd screen, prayer, and what not.

    I've come accross one - Then a player, drinks an overload, preferably before a box, the overload effects, not skill levels, will carry over.

    Heres the void to reset overload, and the statement that will call it.

    Code:
            public static void resetOverLoadEffect(Player player) {
                    if (!player.isDead()) {
                            int actualLevel = player.getSkills().getLevel(Skills.ATTACK);
                            int realLevel = player.getSkills().getLevelForXp(Skills.ATTACK);
                            if (actualLevel > realLevel)
                                    player.getSkills().set(Skills.ATTACK, realLevel);
                            actualLevel = player.getSkills().getLevel(Skills.STRENGTH);
                            realLevel = player.getSkills().getLevelForXp(Skills.STRENGTH);
                            if (actualLevel > realLevel)
                                    player.getSkills().set(Skills.STRENGTH, realLevel);
                            actualLevel = player.getSkills().getLevel(Skills.DEFENCE);
                            realLevel = player.getSkills().getLevelForXp(Skills.DEFENCE);
                            if (actualLevel > realLevel)
                                    player.getSkills().set(Skills.DEFENCE, realLevel);
                            actualLevel = player.getSkills().getLevel(Skills.MAGIC);
                            realLevel = player.getSkills().getLevelForXp(Skills.MAGIC);
                            if (actualLevel > realLevel)
                                    player.getSkills().set(Skills.MAGIC, realLevel);
                            actualLevel = player.getSkills().getLevel(Skills.RANGE);
                            realLevel = player.getSkills().getLevelForXp(Skills.RANGE);
                            if (actualLevel > realLevel)
                                    player.getSkills().set(Skills.RANGE, realLevel);
                            player.heal(500);
                    }
                    player.setOverloadDelay(0);
                    player.getPackets().sendGameMessage(
                                    "The effects of overload have worn off.");
            }
                            return true;
    And the statement that calls it:

    Pots.resetOverLoadEffect(this);
    (Got from player.java)
    I have imported com.rs.game.player.content.Pots; and com.rs.game.player.Player; to the Duelarena.java controller.

    When i apply it to the start of the duel here,

    @Override
    public void start() {
    player.stopAll();
    player.addStopDelay(2); // fixes mass click steps
    player.getTemporaryAttributtes().put("startedDuel" , true);
    player.getTemporaryAttributtes().put("canFight", false);
    player.reset();
    player.setCanPvp(true);
    Pots.resetOverLoadEffect(this);
    player.getHintIconsManager().addHintIcon(
    player.getDuelConfigurations().getOther(player), 1, -1, false);
    WorldTasksManager.schedule(new WorldTask() {
    int count = 3;

    @Override
    public void run() {
    if (count > 0)
    player.setNextForceTalk(new ForceTalk("" + count));

    if (count == 0) {
    player.getTemporaryAttributtes().put("canFight", true);
    player.setNextForceTalk(new ForceTalk("FIGHT!"));
    this.stop();
    }
    count--;
    }
    }, 0, 2);
    }

    I get this errror
    src/com/rs/player/controlers/Duelarena.java:30: error: method resetOverLoadEffect in class Pots cannot be applied to the given types:
    Pots.resetOverLoadEffect(this);
    ......^
    required: Player
    found: Duelarena
    reason: actualy argument Duelarene cannot be converted to Player by method invo
    1 error
    Compiled All Sycessfully
    press any key to continue...
    Reply With Quote  
     

  2. #2  
    Registered Member 13lack drag's Avatar
    Join Date
    Feb 2011
    Posts
    235
    Thanks given
    1
    Thanks received
    11
    Rep Power
    3
    bump
    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. [667/***] Making potion reset in duel
    By erica in forum Snippets
    Replies: 8
    Last Post: 06-28-2012, 12:35 AM
  2. Mystic-Effect [+~NEW START~+]
    By Mr House in forum Projects
    Replies: 326
    Last Post: 03-12-2012, 11:55 PM
  3. overload effect problem
    By g0d 0f war in forum Help
    Replies: 4
    Last Post: 12-16-2011, 08:24 PM
  4. [PI/DSPK] Adding the real Overload Effect
    By rocky2k10 in forum Help
    Replies: 4
    Last Post: 08-05-2011, 05:07 PM
  5. Reset Start Command
    By PrataKosong in forum Snippets
    Replies: 1
    Last Post: 09-22-2010, 05:57 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •