Thread: GlitchScape 742 - The introduction

Page 9 of 12 FirstFirst ... 7891011 ... LastLast
Results 81 to 90 of 111
  1. #81 Linking forum threads 
    Vortex RS3 Developer

    Patyosaurs's Avatar
    Join Date
    Dec 2011
    Posts
    94
    Thanks given
    65
    Thanks received
    50
    Rep Power
    122
    GlitchScape updates (other threads):

    Long time since I have posted in this thread, here are some cool links!

    Hybridding Bot/Dharok Bot
    Here

    Server-Side Skilling Macros
    Here

    MOBA inside GlitchScape
    Here

    Other:

    Custom PVP area for testing content/fun pking:

    Reply With Quote  
     

  2. #82  
    Registered Member
    Join Date
    Aug 2014
    Posts
    1
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    loeap
    Reply With Quote  
     

  3. #83  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    R-S Admin Response  December 28th 2017

    • 731 Client and cache are now (almost) fully working. I just need to test all the packets but you can login ingame without crashing (no npc updating or interfaces though):
      Attached image
      The reason we switched revision is to have a clean source with no edits apart from the ones we add. Also the client has no integer obfuscation which is kind of awesome on its own (6MB vs 11.8MB...)

    Project thread
    Reply With Quote  
     

  4. #84  
    Registered Member

    Join Date
    Sep 2014
    Posts
    300
    Thanks given
    122
    Thanks received
    91
    Rep Power
    158
    Goodluck.
    Reply With Quote  
     

  5. Thankful user:


  6. #85  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    R-S Admin Response  December 29th 2017

    • Fixed inventory models:
      Attached image
    • Fixed npc updates (now npc appear normally)
    • Fullscreen interfaces are now fully fonctional:
      Attached image

    Project thread
    Reply With Quote  
     

  7. Thankful user:


  8. #86  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    R-S Admin Response  December 30th 2017

    • Ordered npc masks so interactions like combat don't crash you
    • Fixed interfaces are now fully functional
    • Repacked maps from 667 so places like godwars don't crash you anymore. (101 more maps!):
      Attached image

    Project thread
    Reply With Quote  
     

  9. #87  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    R-S Admin Response  January 20th 2018

    • Added entity animations and texture animations for my tool:
      Attached image

    Project thread
    Reply With Quote  
     

  10. Thankful user:


  11. #88  
    Donator

    Join Date
    Dec 2013
    Posts
    491
    Thanks given
    569
    Thanks received
    123
    Rep Power
    55
    Great shit. Thread font is ugly and hard to read for me but w.e. that''s cus I'm colorblind. Still love the project!
    Reply With Quote  
     

  12. Thankful user:


  13. #89  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    R-S Admin Response  February 11th 2018

    • Finished loading item data, with a few clientscripts keys identified
      Attached image
      Attached image
      Attached image

    Project thread
    Reply With Quote  
     

  14. #90  
    Contributor

    clem585's Avatar
    Join Date
    Sep 2013
    Posts
    3,788
    Thanks given
    706
    Thanks received
    702
    Rep Power
    570
    R-S Admin Response  February 11th 2018

    Cache tool
    • The tool can now load 667 items too

    Server
    • Started alot of refactoring, non-combat spells of the normal spellbook are now alot better:
      Code:
      package com.rs.game.player.skills.magic;
      
      import com.rs.game.enums.*;
      import com.rs.game.player.interfaces.InterfaceTab;
      import com.rs.utils.Logger;
      import lombok.Getter;
      
      import java.lang.reflect.Method;
      
      /**
       * Created by clem585 on 2018-03-03.
       */
      
      public enum Spell {
          /**
           * Alchemy
           */
      
          LOW_ALCHEMY(21, 31, InterfaceTab.MAGIC_BOOK, "Alchemy.lowAlch", new ItemRequirement(EItems.FIRE_RUNES, 3),
                  new ItemRequirement(EItems.NATURE_RUNES, 1)),
          HIGH_ALCHEMY(55, 65, InterfaceTab.MAGIC_BOOK, "Alchemy.highAlch", new ItemRequirement(EItems.FIRE_RUNES, 5),
                  new ItemRequirement(EItems.NATURE_RUNES, 1)),
          SUPERHEAT(43, 53, InterfaceTab.MAGIC_BOOK, "Alchemy.superheat", new ItemRequirement(EItems.FIRE_RUNES, 4),
                  new ItemRequirement(EItems.NATURE_RUNES, 1)),
          BONES_TO_BANANA(15, 25, InterfaceTab.INVENTORY, "Alchemy.bonesToBananas",
                  new ItemRequirement(EItems.NATURE_RUNES, 1), new ItemRequirement(EItems.EARTH_RUNES, 2),
                  new ItemRequirement(EItems.WATER_RUNES, 2)),
          BONES_TO_PEACHES(60, 35.5, InterfaceTab.INVENTORY, "Alchemy.bonesToPeaches",
                  new ItemRequirement(EItems.NATURE_RUNES, 2), new ItemRequirement(EItems.EARTH_RUNES, 4),
                  new ItemRequirement(EItems.WATER_RUNES, 4)),
      
          /**
           * Enchant spells
           */
      
          ENCHANT_LVL_1(7, 17.5, InterfaceTab.MAGIC_BOOK, "Enchanting.enchantSapphires",
                  new ItemRequirement(EItems.COSMIC_RUNES, 1), new ItemRequirement(EItems.WATER_RUNES, 1)),
          ENCHANT_LVL_2(27, 37, InterfaceTab.MAGIC_BOOK, "Enchanting.enchantEmeralds",
                  new ItemRequirement(EItems.COSMIC_RUNES, 1), new ItemRequirement(EItems.AIR_RUNES, 3)),
          ENCHANT_LVL_3(49, 59, InterfaceTab.MAGIC_BOOK, "Enchanting.enchantRubies",
                  new ItemRequirement(EItems.COSMIC_RUNES, 1), new ItemRequirement(EItems.FIRE_RUNES, 5)),
          ENCHANT_LVL_4(57, 67, InterfaceTab.MAGIC_BOOK, "Enchanting.enchantDiamonds",
                  new ItemRequirement(EItems.COSMIC_RUNES, 1), new ItemRequirement(EItems.EARTH_RUNES, 10)),
          ENCHANT_LVL_5(68, 78, InterfaceTab.MAGIC_BOOK, "Enchanting.enchantDragonstones",
                  new ItemRequirement(EItems.COSMIC_RUNES, 1), new ItemRequirement(EItems.EARTH_RUNES, 15),
                  new ItemRequirement(EItems.WATER_RUNES, 15)),
          ENCHANT_LVL_6(87, 97, InterfaceTab.MAGIC_BOOK, "Enchanting.enchantOnyxes",
                  new ItemRequirement(EItems.COSMIC_RUNES, 1), new ItemRequirement(EItems.EARTH_RUNES, 20),
                  new ItemRequirement(EItems.FIRE_RUNES, 20)),
      
          /**
           * Basic teleports
           */
      
          MOBILISING_ARMIES_TP(10, 19, Location.MOBILISING_ARMIES, new ItemRequirement(EItems.LAW_RUNES, 1),
                  new ItemRequirement(EItems.WATER_RUNES, 1), new ItemRequirement(EItems.AIR_RUNES, 1)),
          VARROCK_TELEPORT(25, 35, Location.VARROCK, "Teleport.varrockTeleport", new ItemRequirement(EItems.LAW_RUNES, 1),
                  new ItemRequirement(EItems.FIRE_RUNES, 1), new ItemRequirement(EItems.AIR_RUNES, 3)),
          LUMBRIDGE_TELEPORT(31, 41, Location.LUMBRIDGE, new ItemRequirement(EItems.LAW_RUNES, 1),
                  new ItemRequirement(EItems.EARTH_RUNES, 1), new ItemRequirement(EItems.AIR_RUNES, 3)),
          FALADOR_TELEPORT(37, 48, Location.FALADOR, new ItemRequirement(EItems.LAW_RUNES, 1),
                  new ItemRequirement(EItems.WATER_RUNES, 1), new ItemRequirement(EItems.AIR_RUNES, 3)),
          TELEPORT_TO_HOUSE(40, 30, "Teleport.houseTeleport", new ItemRequirement(EItems.LAW_RUNES, 1),
                  new ItemRequirement(EItems.EARTH_RUNES, 1), new ItemRequirement(EItems.AIR_RUNES, 1)),
          CAMELOT_TELEPORT(45, 55.5, Location.CAMELOT, "Teleport.camelotTeleport", new ItemRequirement(EItems.LAW_RUNES, 1),
                  new ItemRequirement(EItems.AIR_RUNES, 5)),
          ARDOUGNE_TELEPORT(51, 61, Location.ARDOUGNE, "Teleport.ardougneTeleport", new ItemRequirement(EItems.LAW_RUNES, 2),
                  new ItemRequirement(EItems.WATER_RUNES, 2)),
          WATCH_TOWER_TELEPORT(58, 68, Location.TROLLHEIM, "Teleport.watchTowerTeleport",
                  new ItemRequirement(EItems.LAW_RUNES, 2), new ItemRequirement(EItems.EARTH_RUNES, 2)),
          TROLLHEIM_TELEPORT(61, 68, Location.WATCH_TOWER, "Teleport.trollheimTeleport",
                  new ItemRequirement(EItems.LAW_RUNES, 2), new ItemRequirement(EItems.FIRE_RUNES, 2)),
          APE_ATOLL_TELEPORT(64, 76, Location.APE_ATOLL, "Teleport.apeAtollTeleport",
                  new ItemRequirement(EItems.LAW_RUNES, 2), new ItemRequirement(EItems.FIRE_RUNES, 2),
                  new ItemRequirement(EItems.WATER_RUNES, 2), new ItemRequirement(EItem.BANANA, 1));
      
          @Getter
          private final int levelRequirement;
      
          @Getter
          private final double xp;
      
          @Getter
          private final Location location;
      
          @Getter
          private final Method method;
      
          @Getter
          private final ItemRequirement[] runesRequirements;
      
          @Getter
          private final InterfaceTab redirectTab;
      
          Spell(int levelRequirement, double xp, String execute, ItemRequirement... runes) {
              this(levelRequirement, xp, null, null, execute, runes);
          }
      
          Spell(int levelRequirement, double xp, Location location, ItemRequirement... runes) {
              this(levelRequirement, xp, location, null, null, runes);
          }
      
          Spell(int levelRequirement, double xp, InterfaceTab redirectTab, String execute, ItemRequirement... runes) {
              this(levelRequirement, xp, null, redirectTab, execute, runes);
          }
      
          Spell(int levelRequirement, double xp, Location location, String execute, ItemRequirement... runes) {
              this(levelRequirement, xp, location, null, execute, runes);
          }
      
          Spell(int levelRequirement, double xp, Location location, InterfaceTab redirectTab, String execute, ItemRequirement... runes) {
              this.levelRequirement = levelRequirement;
              this.xp = xp;
              this.location = location;
              this.redirectTab = redirectTab;
              this.method = execute == null ? null : getExecutionMethod(execute);
              this.runesRequirements = runes;
          }
      
          /**
           * https://stackoverflow.com/questions/4685563/how-to-pass-a-function-as-a-parameter-in-java
           * 
           * Generate the method from the execution path specified
           */
          private Method getExecutionMethod(String execute) {
              Class c = getExecutionClass(execute);
              try {
                  String methodName = execute.split("\\.")[1];
                  return c.getMethod(methodName, getParameterTypes());
              } catch (NoSuchMethodException e) {
                  Logger.error("Error finding magic method through reflection", false);
              }
              return null;
          }
          
          private Class[] getParameterTypes() {
              Class[] parameterTypes = new Class[1];
              parameterTypes[0] = PlayerSpell.class;
              return parameterTypes;
          }
      
          private Class getExecutionClass(String execute) {
              try {
                  String className = execute.split("\\.")[0];
                  return Class.forName("com.rs.game.player.skills.magic.spells." + className);
              } catch (ClassNotFoundException e) {
                  Logger.error("Error invoking magic class through reflection", false);
              }
              return null;
          }
      
      }
      Code:
      package com.rs.game.player.skills.magic;
      
      import com.rs.cache.reader.loaders.ItemDefinitions;
      import com.rs.game.enums.*;
      import com.rs.game.item.Item;
      import com.rs.game.minigames.stealingcreation.StealingCreationController;
      import com.rs.game.player.Player;
      import com.rs.game.player.content.Magic;
      import com.rs.game.player.content.Skill;
      import com.rs.game.player.interfaces.InterfaceTab;
      import com.rs.utils.GameTime;
      import com.rs.utils.Logger;
      import com.rs.utils.RNG;
      import lombok.Getter;
      
      /**
       * Created by clem585 on 2018-03-04.
       */
      public class PlayerSpell {
      
          @Getter
          private Spell spell;
          @Getter
          private Player player;
          @Getter
          private Item usedOn;
          @Getter
          private int slotId;
      
          private boolean staffOfLight;
      
          public PlayerSpell(Spell spell, Player player) {
              this(spell, player, null, -1);
          }
      
          public PlayerSpell(Spell spell, Player player, Item usedOn, int slotId) {
              this.spell = spell;
              this.player = player;
              this.usedOn = usedOn;
              this.slotId = slotId;
              this.staffOfLight = false;
          }
      
          public void execute() {
              if (!validateLevel()) {
                  player.message("Your Magic level is not high enough for this spell.");
                  return;
              }
      
              if (!validateRunes()) {
                  return;
              }
      
              if (player.getActionDelay() > GameTime.currentTimeMillis()) {
                  return;
              }
      
              if (usedOn != null && !player.getInventory().containsOne(usedOn)) {
                  //TODO log attempt at packet spoofing
                  return;
              }
      
              if (spell.getMethod() != null) {
                  try {
                      boolean executed = (boolean)spell.getMethod().invoke(null, getParams());
                      if (executed) {
                          removeRunes();
                          player.getSkills().addXp(Skill.MAGIC, spell.getXp());
                          if (spell.getRedirectTab() != null) {
                              player.getInterfaceManager().openGameTab(spell.getRedirectTab());
                          }
                      }
                  } catch (Exception e) {
                      e.printStackTrace();
                      Logger.error("Error invoking magic method through reflection", false);
                  }
              } else if (spell.getLocation() != null) {
                  teleport();
              }
          }
      
          public void teleport() {
              Magic.sendTeleportSpell(player, spell.getLocation());
          }
      
          private void removeRunes() {
              if (staffOfLight)
                  return;
              x: for (ItemRequirement requirement : spell.getRunesRequirements()) {
                  if (requirement.getItemIds(player) != null && (checkStaff(requirement.getItems()) || checkRunes(requirement))) {
                      continue;
                  }
                  for (int id : requirement.getItemIds(player)) {
                      if (player.getInventory().containsItem(id, requirement.getQuantity())) {
                          player.getInventory().deleteItem(id, requirement.getQuantity());
                          continue x;
                      }
                  }
                  Logger.error("Error during runes removal", false);
              }
          }
      
          /**
           * Builds the data for the reflection method
           */
          private Object[] getParams() {
              Object[] params = new Object[1];
              params[0] = this;
              return params;
          }
      
          public boolean validateLevel() {
              return player.getSkills().getLevel(Skill.MAGIC) >= spell.getLevelRequirement();
          }
      
          /**
           * Validates if the player has all the necessary runes, sends an error message if he don't
           */
          public boolean validateRunes() {
              if (hasStaffOfLightEffect()) {
                  staffOfLight = true;
                  player.message("Your spell draws its power completely from your weapon.");
                  return true;
              }
              x: for (ItemRequirement requirement : spell.getRunesRequirements()) {
                  if (requirement.getItems() != null && (checkStaff(requirement.getItems()) || checkRunes(requirement))) {
                      continue;
                  }
                  for (int id : requirement.getItemIds(player)) {
                      int quantity = requirement.getQuantity();
                      //exception for stuff like alch 1x nature rune
                      if (usedOn != null && usedOn.getId() == id)
                          quantity++;
                      if (player.getInventory().containsOne(new Item(id, quantity))) {
                          continue x;
                      }
                  }
                  int itemId = requirement.getId(player);
                  player.message("You do not have enough " +
                          ItemDefinitions.getItemDefinitions(itemId).getName().replace("rune", "Rune") +
                          "s to cast this spell.");
                  return false;
              }
              return true;
          }
      
          /**
           * Checks if the staff of light effect activates, saving the player runes
           */
          private boolean hasStaffOfLightEffect() {
              if (!player.getEquipment().isWearingOne(EItems.STAVES_OF_LIGHT))
                  return false;
              double chance = 12.5;
              if (player.getEquipment().isWearingAll(EItemsGenerator.getCombatRobesSet()))
                  chance = 20;
              else if (player.getEquipment().isWearingAll(EItemsGenerator.getBattleRobesSet()))
                  chance = 50;
              return RNG.getChance(chance);
          }
      
          /**
           * If the player is under the stealing creation, it checks for catalytic and elemental runes
           */
          private boolean checkRunes(ItemRequirement requirement) {
              if (player.getControllerManager().getController() instanceof StealingCreationController) {
                  EItems items = requirement.getItems();
                  if (items == EItems.AIR_RUNES || items == EItems.WATER_RUNES || items == EItems.EARTH_RUNES
                          || items == EItems.FIRE_RUNES) {
                      return player.getInventory().containsOne(EItem.makeItem(EItem.ELEMENTAL_RUNE,
                              requirement.getQuantity()));
                  } else if (items == EItems.MIND_RUNES || items == EItems.CHAOS_RUNES || items == EItems.DEATH_RUNES
                          || items == EItems.BLOOD_RUNES || items == EItems.BODY_RUNES || items == EItems.NATURE_RUNES || items == EItems.ASTRAL_RUNES
                          || items == EItems.SOUL_RUNES || items == EItems.LAW_RUNES || requirement.getItem() == EItem.ARMADYL_RUNE) {
                      return player.getInventory().containsOne(EItem.makeItem(EItem.CATALYTIC_RUNE,
                              requirement.getQuantity()));
                  }
              }
              return false;
          }
      
          /**
           * Checks if the player is wearing a staff that would save him a specific type of runes
           */
          private boolean checkStaff(EItems runes) {
              switch (runes) {
                  case AIR_RUNES:
                      return player.getEquipment().isWearingOne(EItems.STAVES_OF_AIR);
                  case WATER_RUNES:
                      return player.getEquipment().isWearingOne(EItems.STAVES_OF_WATER);
                  case EARTH_RUNES:
                      return player.getEquipment().isWearingOne(EItems.STAVES_OF_EARTH);
                  case FIRE_RUNES:
                      return player.getEquipment().isWearingOne(EItems.STAVES_OF_FIRE);
                  default:
                      return false;
              }
          }
      
      }
      Code:
      package com.rs.game.player.skills.magic.spells;
      
      import com.rs.game.enums.*;
      import com.rs.game.item.Item;
      import com.rs.game.player.Player;
      import com.rs.game.player.skills.magic.PlayerSpell;
      import com.rs.game.player.skills.magic.Spell;
      
      import java.util.List;
      
      public class Enchanting {
      
      	public static boolean enchantSapphires(PlayerSpell spell) {
      		return enchant(spell.getSpell(), spell.getPlayer(), spell.getUsedOn(), spell.getSlotId(), 1);
      	}
      
      	public static boolean enchantEmeralds(PlayerSpell spell) {
      		return enchant(spell.getSpell(), spell.getPlayer(), spell.getUsedOn(), spell.getSlotId(), 2);
      	}
      
      	public static boolean enchantRubies(PlayerSpell spell) {
      		return enchant(spell.getSpell(), spell.getPlayer(), spell.getUsedOn(), spell.getSlotId(), 3);
      	}
      
      	public static boolean enchantDiamonds(PlayerSpell spell) {
      		return enchant(spell.getSpell(), spell.getPlayer(), spell.getUsedOn(), spell.getSlotId(), 4);
      	}
      
      	public static boolean enchantDragonstones(PlayerSpell spell) {
      		return enchant(spell.getSpell(), spell.getPlayer(), spell.getUsedOn(), spell.getSlotId(), 5);
      	}
      
      	public static boolean enchantOnyxes(PlayerSpell spell) {
      		return enchant(spell.getSpell(), spell.getPlayer(), spell.getUsedOn(), spell.getSlotId(), 6);
      	}
      
      	private static boolean enchant(Spell spell, Player player, Item usedOn, int slotId, int level) {
      		Combinations enchants = getCombinations(level);
      		Combination combination = enchants.getCombination(player.getInventory().getItems(), usedOn);
      		if (combination == null) {
      			player.sendMessage("This item can't be enchanted.");
      			return false;
      		}
      
      		player.setActionDelay(3);
      		player.setNextEAnimation(getAnimation(level));
      		player.setNextEGraphics(getGraphics(level));
      
      		combination.combine(player, slotId, "enchant");
      		return true;
      	}
      
      	private static Combinations getCombinations(int level) {
      		switch (level) {
      			case 1:
      				return Combinations.SAPPHIRE_ENCHANTS;
      			case 2:
      				return Combinations.EMERALD_ENCHANTS;
      			case 3:
      				return Combinations.RUBY_ENCHANTS;
      			case 4:
      				return Combinations.DIAMOND_ENCHANTS;
      			case 5:
      				return Combinations.DRAGONSTONE_ENCHANTS;
      			case 6:
      				return Combinations.ONYX_ENCHANTS;
      			default:
      				return null;
      		}
      	}
      
      	private static EAnimation getAnimation(int level) {
      		switch (level) {
      			case 1:
      			case 2:
      				return EAnimation.ENCHANT_LVL_1;
      			case 3:
      			case 4:
      				return EAnimation.ENCHANT_LVL_2;
      			case 5:
      			case 6:
      				return EAnimation.ENCHANT_LVL_3;
      			default:
      				return null;
      		}
      	}
      
      	private static EGraphics getGraphics(int level) {
      		switch (level) {
      			case 1:
      			case 2:
      				return EGraphics.ENCHANT_LVL_1;
      			case 3:
      			case 4:
      				return EGraphics.ENCHANT_LVL_2;
      			case 5:
      				return EGraphics.ENCHANT_LVL_3;
      			case 6:
      				return EGraphics.ENCHANT_LVL_4;
      			default:
      				return null;
      		}
      	}
      	
      }
      Code:
      PlayerSpell spell = new PlayerSpell(Spell.VARROCK_TELEPORT, player);
      spell.execute();
      Attached image
      Attached image
      Attached image
      Attached image

    Project thread
    Reply With Quote  
     

  15. Thankful user:


Page 9 of 12 FirstFirst ... 7891011 ... LastLast

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. Elyrion 718/742 The revolution of Rsps
    By Stimulant in forum Advertise
    Replies: 37
    Last Post: 07-31-2014, 02:34 PM
  2. Elyrion 718/742 The Runescape Remake
    By Keiron in forum Advertise
    Replies: 7
    Last Post: 05-09-2014, 08:05 PM
  3. Replies: 2
    Last Post: 07-04-2013, 05:35 PM
  4. Crystal-X 718 Loading 742 [The Real Crystal-X]
    By xlGaM3r in forum Advertise
    Replies: 0
    Last Post: 04-08-2013, 08:18 PM
  5. Dust Metal- The introduction
    By Dust Metal in forum The Red Carpet
    Replies: 2
    Last Post: 05-30-2010, 12:07 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
  •