Пример #1
0
 public static void teleblockPlayer(Player killer, Player target)
 {
     int teleblockDelay = 300000;
     if (target.getPrayers().getHeadIcon() == PrayerData.MAGIC)
     {
         teleblockDelay = 150000;
     }
     target.setTemporaryAttribute("teleblocked", true);
     target.setTeleblockTime(Environment.TickCount + teleblockDelay);
     Event removeTeleBlockEvent = new Event(teleblockDelay);
     removeTeleBlockEvent.setAction(() =>
     {
         removeTeleBlockEvent.stop();
         if (target != null)
         {
             target.removeTemporaryAttribute("teleblocked");
             target.setTeleblockTime(0);
         }
     });
     Server.registerEvent(removeTeleBlockEvent);
 }
Пример #2
0
 private void resetVariables(Player p)
 {
     p.setSkullCycles(0);
     p.getSpecialAttack().resetSpecial();
     p.setLastkiller(null);
     p.setDead(false);
     p.setEntityFocus(65535);
     p.setPoisonAmount(0);
     p.clearKillersHits();
     p.setLastVengeanceTime(0);
     p.setVengeance(false);
     p.removeTemporaryAttribute("willDie");
     p.setFrozen(false);
     p.removeTemporaryAttribute("unmovable");
     p.setAntifireCycles(0);
     p.setSuperAntipoisonCycles(0);
     p.setTeleblockTime(0);
     p.removeTemporaryAttribute("teleblocked");
     p.setTarget(null);
     p.setAttacker(null);
     foreach (Skills.SKILL skill in Enum.GetValues(typeof(Skills.SKILL)))
         p.getSkills().setCurLevel(skill, p.getSkills().getMaxLevel(skill));
     p.getPackets().sendSkillLevels();
     Prayer.deactivateAllPrayers(p);
     if (p.getTemporaryAttribute("cantDoAnything") != null)
     {
         p.getAppearance().setInvisible(false);
         p.getUpdateFlags().setAppearanceUpdateRequired(true);
         p.removeTemporaryAttribute("cantDoAnything");
         p.removeTemporaryAttribute("unmovable");
         teleportToWaitingRoom(p, false);
         p.getPackets().closeInterfaces();
         p.getPackets().setMinimapStatus(0);
         p.getPackets().clearMapFlag();
     }
 }