Thread: zenith coding help please..

Results 1 to 5 of 5
  1. #1 zenith coding help please.. 
    Registered Member
    Join Date
    Jun 2013
    Posts
    154
    Thanks given
    1
    Thanks received
    1
    Rep Power
    10
    public double getCreationExp() {
    return creationExp;
    }

    public long getTime() {
    return time;
    }

    public int getSpawnCost() {
    return spawnCost;
    }

    public static Map<Integer, Pouches> getPouches() {
    return pouches;
    }
    }

    private Pouches pouches;

    public Summoning(Pouches pouches) {
    this.setPouches(pouches);
    }

    public static void infusePouches(Player player) {
    player.getInterfaceManager().sendInterface(INTERFA CE);// close to this
    Object[] options = new Object[] { 78, 1, "List<col=FF9040>",
    "Infuse-X<col=FF9040>", "Infuse-All<col=FF9040>",
    "Infuse-10<col=FF9040>", "Infuse-5<col=FF9040>",
    "Infuse<col=FF9040>", 10, 8, INTERFACE << 16 | 16 };
    // to slot, from slot, options, width, height, component
    player.getPackets().sendRunScript(757, options);
    player.getPackets().sendIComponentSettings(INTERFA CE, 16, 0, 430, 190);
    }

    public static Familiar createFamiliar(Player player, Pouches pouch) {
    try {
    return (Familiar) Class
    .forName(
    "com.rs.game.npc.familiar."
    + (NPCDefinitions.getNPCDefinitions(pouch
    .getNpcId())).name.replace(" ", "")
    .replace("-", ""))
    .getConstructor(Player.class, Pouches.class,
    WorldTile.class, int.class, boolean.class)
    .newInstance(player, pouch, player, -1, true);
    } catch (Throwable e) {

    return null;
    }
    }

    public static void spawnFamiliar(Player player, Pouches pouch) {
    if (player.getFamiliar() != null)
    return;
    ItemDefinitions def = ItemDefinitions.getItemDefinitions(pouch
    .getPouchId());
    if (def == null)
    return;
    HashMap<Integer, Integer> skillReq = def.getWearingSkillRequiriments();
    boolean hasRequiriments = true;
    if (skillReq != null) {
    for (int skillId : skillReq.keySet()) {
    if (skillId > 24 || skillId < 0)
    continue;
    int level = skillReq.get(skillId);
    if (level < 0 || level > 120)
    continue;
    if (player.getSkills().getLevelForXp(skillId) < level) {
    if (hasRequiriments)
    player.getPackets()
    .sendGameMessage(
    "You are not high enough level to use this pouch.");
    hasRequiriments = false;
    String name = Skills.SKILL_NAME[skillId].toLowerCase();
    player.getPackets().sendGameMessage(
    "You need to have a"
    + (name.startsWith("a") ? "n" : "") + " "
    + name + " level of " + level
    + " to summon this.");
    }
    }
    }
    if (!hasRequiriments
    || player.getSkills().getLevel(Skills.SUMMONING) < pouch
    .getSpawnCost())
    return;
    if (!player.isDonator()
    && (pouch == Pouches.PACK_YAK || pouch == Pouches.UNICORN_STALLION)) {
    player.getPackets().sendGameMessage("You are not a donator.");
    return;
    }

    final Familiar npc = createFamiliar(player, pouch);
    if (npc == null) {
    player.getPackets().sendGameMessage(
    "This familiar is not added yet.");
    return;
    }
    player.getInventory().deleteItem(pouch.getPouchId( ), 1);
    player.getSkills().drainSummoning(pouch.getSpawnCo st());
    player.setFamiliar(npc);
    }

    public static boolean sendCreatePouch(Player player, int itemId, int count) {
    ItemDefinitions def = ItemDefinitions.getItemDefinitions(itemId);
    if (def == null)
    return false;
    HashMap<Integer, Integer> skillReq = def.getWearingSkillRequiriments();
    boolean hasRequiriments = true;
    if (skillReq != null) {
    for (int skillId : skillReq.keySet()) {
    if (skillId > 24 || skillId < 0)
    continue;
    int level = skillReq.get(skillId);
    if (level < 0 || level > 120)
    continue;
    if (player.getSkills().getLevelForXp(skillId) < level) {
    if (hasRequiriments)
    player.getPackets()
    .sendGameMessage(
    "You are not high enough level to use this item.");
    hasRequiriments = false;
    String name = Skills.SKILL_NAME[skillId].toLowerCase();
    player.getPackets().sendGameMessage(
    "You need to have a"
    + (name.startsWith("a") ? "n" : "") + " "
    + name + " level of " + level
    + " to create this.");
    }
    }
    HashMap<Integer, Integer> itemReq = def
    .getWearingSkillRequiriments();
    if (itemReq != null) {
    for (int reqId : itemReq.keySet()) {
    int amount = skillReq.get(reqId);
    if (!player.getInventory().containsItem(reqId, amount)) {
    hasRequiriments = false;
    String name = ItemDefinitions.getItemDefinitions(reqId)
    .getName();
    player.getPackets().sendGameMessage(
    "You need to have a"
    + (name.startsWith("a") ? "n" : "")
    + " " + name + " X " + amount + ".");
    }
    player.getInventory().deleteItem(reqId, amount);
    }
    }
    }
    if (!hasRequiriments)
    return true;
    player.getInventory().addItem(new Item(itemId, count));
    return true;
    }

    public Pouches getPouches() {
    return pouches;
    }

    public void setPouches(Pouches pouches) {
    this.pouches = pouches;
    }
    }

    i need help for when it says you need to be donator for pack yaks and unicorns i dont know how to take that out so anyone can use them....
    Reply With Quote  
     

  2. #2  
    Exoria
    Aksel's Avatar
    Join Date
    Jan 2012
    Age
    28
    Posts
    1,443
    Thanks given
    238
    Thanks received
    498
    Rep Power
    56
    LOL

    You highlited what to remove, remove it.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jun 2013
    Posts
    154
    Thanks given
    1
    Thanks received
    1
    Rep Power
    10
    Quote Originally Posted by Aksel View Post
    LOL

    You highlited what to remove, remove it.
    it came up with a bunch of errors when i removed it
    Reply With Quote  
     

  4. #4  
    wat u gon do lol ¯\_(ツ)_/¯
    Nills's Avatar
    Join Date
    Feb 2013
    Posts
    339
    Thanks given
    82
    Thanks received
    36
    Rep Power
    54
    Quote Originally Posted by tfougere View Post
    it came up with a bunch of errors when i removed it
    Don't delete the first return;
    Reply With Quote  
     

  5. #5  
    Donator

    Yuuji's Avatar
    Join Date
    Feb 2012
    Posts
    678
    Thanks given
    232
    Thanks received
    153
    Rep Power
    197
    Code:
    public double getCreationExp() {
    return creationExp;
    }
    
    public long getTime() {
    return time;
    }
    
    public int getSpawnCost() {
    return spawnCost;
    }
    
    public static Map<Integer, Pouches> getPouches() {
    return pouches;
    }
    }
    
    private Pouches pouches;
    
    public Summoning(Pouches pouches) {
    this.setPouches(pouches);
    }
    
    public static void infusePouches(Player player) {
    player.getInterfaceManager().sendInterface(INTERFA CE);// close to this
    Object[] options = new Object[] { 78, 1, "List<col=FF9040>",
    "Infuse-X<col=FF9040>", "Infuse-All<col=FF9040>",
    "Infuse-10<col=FF9040>", "Infuse-5<col=FF9040>",
    "Infuse<col=FF9040>", 10, 8, INTERFACE << 16 | 16 };
    // to slot, from slot, options, width, height, component
    player.getPackets().sendRunScript(757, options);
    player.getPackets().sendIComponentSettings(INTERFA CE, 16, 0, 430, 190);
    }
    
    public static Familiar createFamiliar(Player player, Pouches pouch) {
    try {
    return (Familiar) Class
    .forName(
    "com.rs.game.npc.familiar."
    + (NPCDefinitions.getNPCDefinitions(pouch
    .getNpcId())).name.replace(" ", "")
    .replace("-", ""))
    .getConstructor(Player.class, Pouches.class,
    WorldTile.class, int.class, boolean.class)
    .newInstance(player, pouch, player, -1, true);
    } catch (Throwable e) {
    
    return null;
    }
    }
    
    public static void spawnFamiliar(Player player, Pouches pouch) {
    if (player.getFamiliar() != null)
    return;
    ItemDefinitions def = ItemDefinitions.getItemDefinitions(pouch
    .getPouchId());
    if (def == null)
    return;
    HashMap<Integer, Integer> skillReq = def.getWearingSkillRequiriments();
    boolean hasRequiriments = true;
    if (skillReq != null) {
    for (int skillId : skillReq.keySet()) {
    if (skillId > 24 || skillId < 0)
    continue;
    int level = skillReq.get(skillId);
    if (level < 0 || level > 120)
    continue;
    if (player.getSkills().getLevelForXp(skillId) < level) {
    if (hasRequiriments)
    player.getPackets()
    .sendGameMessage(
    "You are not high enough level to use this pouch.");
    hasRequiriments = false;
    String name = Skills.SKILL_NAME[skillId].toLowerCase();
    player.getPackets().sendGameMessage(
    "You need to have a"
    + (name.startsWith("a") ? "n" : "") + " "
    + name + " level of " + level
    + " to summon this.");
    }
    }
    }
    if (!hasRequiriments
    || player.getSkills().getLevel(Skills.SUMMONING) < pouch
    .getSpawnCost())
    return;
    }
    final Familiar npc = createFamiliar(player, pouch);
    if (npc == null) {
    player.getPackets().sendGameMessage(
    "This familiar is not added yet.");
    return;
    }
    player.getInventory().deleteItem(pouch.getPouchId( ), 1);
    player.getSkills().drainSummoning(pouch.getSpawnCo st());
    player.setFamiliar(npc);
    }
    
    public static boolean sendCreatePouch(Player player, int itemId, int count) {
    ItemDefinitions def = ItemDefinitions.getItemDefinitions(itemId);
    if (def == null)
    return false;
    HashMap<Integer, Integer> skillReq = def.getWearingSkillRequiriments();
    boolean hasRequiriments = true;
    if (skillReq != null) {
    for (int skillId : skillReq.keySet()) {
    if (skillId > 24 || skillId < 0)
    continue;
    int level = skillReq.get(skillId);
    if (level < 0 || level > 120)
    continue;
    if (player.getSkills().getLevelForXp(skillId) < level) {
    if (hasRequiriments)
    player.getPackets()
    .sendGameMessage(
    "You are not high enough level to use this item.");
    hasRequiriments = false;
    String name = Skills.SKILL_NAME[skillId].toLowerCase();
    player.getPackets().sendGameMessage(
    "You need to have a"
    + (name.startsWith("a") ? "n" : "") + " "
    + name + " level of " + level
    + " to create this.");
    }
    }
    HashMap<Integer, Integer> itemReq = def
    .getWearingSkillRequiriments();
    if (itemReq != null) {
    for (int reqId : itemReq.keySet()) {
    int amount = skillReq.get(reqId);
    if (!player.getInventory().containsItem(reqId, amount)) {
    hasRequiriments = false;
    String name = ItemDefinitions.getItemDefinitions(reqId)
    .getName();
    player.getPackets().sendGameMessage(
    "You need to have a"
    + (name.startsWith("a") ? "n" : "")
    + " " + name + " X " + amount + ".");
    }
    player.getInventory().deleteItem(reqId, amount);
    }
    }
    }
    if (!hasRequiriments)
    return true;
    player.getInventory().addItem(new Item(itemId, count));
    return true;
    }
    
    public Pouches getPouches() {
    return pouches;
    }
    
    public void setPouches(Pouches pouches) {
    this.pouches = pouches;
    }
    }
    Replace what you have just shown us with this ^

    Attached image
    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. Obj tele code help please.
    By H3llk03r in forum Help
    Replies: 1
    Last Post: 04-27-2010, 03:37 AM
  2. This code gives instant death? Help please
    By shoopdawhoop in forum Help
    Replies: 0
    Last Post: 02-24-2010, 11:27 AM
  3. how read website source code?? help please?
    By digistr in forum Application Development
    Replies: 7
    Last Post: 12-08-2009, 04:12 AM
  4. Replies: 2
    Last Post: 06-24-2009, 01:21 AM
  5. Coding help please
    By zmanwonder in forum The Red Carpet
    Replies: 2
    Last Post: 05-16-2009, 10:24 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
  •