Thread: Single cast magic 667-adrastos

Results 1 to 7 of 7
  1. #1 Single cast magic 667-adrastos 
    Registered Member HFSTD's Avatar
    Join Date
    Mar 2016
    Posts
    73
    Thanks given
    26
    Thanks received
    19
    Rep Power
    49
    Does anyone know how to add the single cast magic in adrastos 667 / feather 667.
    Currently it only walks up to the target and then does nothing, Not getting any errors or something.

    I'm still fairly new to coding and have no clue where to look to fix itso that's why im asking help
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Feb 2014
    Posts
    129
    Thanks given
    122
    Thanks received
    35
    Rep Power
    46
    hey i actually found this about an hour ago so lucky you i think it was their anti leech
    if you go into WorldsPacketDecoder.java and search setSkill replace it with setAction instead keep searching setSkill in the file and replace them with setAction instead there is like 3 of them or so

    it used to be like this :
    Code:
    player.getActionManager().setSkill(new PlayerFollow(p2));
    when it should be like
    Code:
    player.getActionManager().setAction(new PlayerFollow(p2));
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member HFSTD's Avatar
    Join Date
    Mar 2016
    Posts
    73
    Thanks given
    26
    Thanks received
    19
    Rep Power
    49
    Quote Originally Posted by Kozmo View Post
    hey i actually found this about an hour ago so lucky you i think it was their anti leech
    if you go into WorldsPacketDecoder.java and search setSkill replace it with setAction instead keep searching setSkill in the file and replace them with setAction instead there is like 3 of them or so

    it used to be like this :
    Code:
    player.getActionManager().setSkill(new PlayerFollow(p2));
    when it should be like
    Code:
    player.getActionManager().setAction(new PlayerFollow(p2));
    Hey dude thanks for this! I changed what u said but it still doesn't seem to work.. are you maybe able to help me with teamviewer or skype? would be awesome ty
    Reply With Quote  
     

  5. #4  
    Registered Member
    Join Date
    Feb 2014
    Posts
    129
    Thanks given
    122
    Thanks received
    35
    Rep Power
    46
    Quote Originally Posted by Fremennik View Post
    Hey dude thanks for this! I changed what u said but it still doesn't seem to work.. are you maybe able to help me with teamviewer or skype? would be awesome ty
    Oh yeah sorry i only tested for Players not the npcs so casting on players should work soz but i g2g now but you can pm me your skype + i will add you and look into the npc casting for you when im back
    Reply With Quote  
     

  6. #5  
    Registered Member HFSTD's Avatar
    Join Date
    Mar 2016
    Posts
    73
    Thanks given
    26
    Thanks received
    19
    Rep Power
    49
    Quote Originally Posted by Kozmo View Post
    Oh yeah sorry i only tested for Players not the npcs so casting on players should work soz but i g2g now but you can pm me your skype + i will add you and look into the npc casting for you when im back
    Ah yeah nice it work son players Ur awesome man thanks alot Pmed u my skype
    Reply With Quote  
     

  7. #6  
    Registered Member
    Join Date
    Feb 2014
    Posts
    129
    Thanks given
    122
    Thanks received
    35
    Rep Power
    46
    this is the fix for the npc casting search in worldpacketsdecoder.java and replace all of this
    Code:
    		} else if (packetId == INTERFACE_ON_NPC) {
    			if (!player.hasStarted() || !player.clientHasLoadedMapRegion() || player.isDead()) {
    				return;
    			}
    			if (player.getLockDelay() > Utils.currentTimeMillis()) {
    				return;
    			}
    			int slot = stream.readUnsignedShortLE128();
    			stream.readUnsignedShortLE();
    			int npcIndex = stream.readUnsignedShortLE();
    			int interfaceHash = stream.readIntV2();
    			stream.readByte();
    			int interfaceId = interfaceHash >> 16;
    			int componentId = interfaceHash - (interfaceId << 16);
    
    			if (Utils.getInterfaceDefinitionsSize() <= interfaceId) {
    				return;
    			}
    			if (!player.getInterfaceManager().containsInterface(interfaceId)) {
    				return;
    			}
    			if (componentId == 65535) {
    				componentId = -1;
    			}
    			if (componentId != -1 && Utils.getInterfaceDefinitionsComponentsSize(interfaceId) <= componentId) {
    				return;
    			}
    			NPC npc = World.getNPCs().get(npcIndex);
    			if (npc == null || npc.isDead() || npc.hasFinished() || !player.getMapRegionsIds().contains(npc.getRegionId())) {
    				return;
    			}
    			player.stopAll(false);
    			switch (interfaceId) {
    			case Inventory.INVENTORY_INTERFACE:
    				Item item = player.getInventory().getItem(slot);
    				if (item == null) {
    					return;
    				}
    				if (!player.getInventory().containsItem(item.getId(), item.getAmount())) {
    					return;
    				}
    				if (!player.getControlerManager().processItemOnNPC(npc, item)) {
    					return;
    				}
    				//InventoryOptionsHandler.handleItemOnNPC(player, npc, item);
    				break;
    			case 662:
    			case 747:
    				if (player.getFamiliar() == null)
    					return;
    				player.resetWalkSteps();
    				if ((interfaceId == 747 && componentId == 14)
    						|| (interfaceId == 662 && componentId == 65)
    						|| (interfaceId == 662 && componentId == 74)
    						|| interfaceId == 747 && componentId == 17
    						|| interfaceId == 747 && componentId == 23) {
    					if ((interfaceId == 662 && componentId == 74 || interfaceId == 747
    							&& componentId == 17)) {
    						if (player.getFamiliar().getSpecialAttack() != SpecialAttack.ENTITY)
    							return;
    					}
    					if (npc == player.getFamiliar()) {
    						player.getPackets().sendGameMessage(
    								"You can't attack your own familiar.");
    						return;
    					}
    					if (!player.getFamiliar().canAttack(npc)) {
    						player.getPackets()
    								.sendGameMessage(
    										"You can only use your familiar in a multi-zone area.");
    						return;
    					} else {
    						player.getFamiliar().setSpecial(
    								interfaceId == 662 && componentId == 74
    										|| interfaceId == 747
    										&& componentId == 17);
    						player.getFamiliar().setTarget(npc);
    					}
    				}
    				break;
    			case 193:
    				switch (componentId) {
    				case 28:
    				case 32:
    				case 24:
    				case 20:
    				case 30:
    				case 34:
    				case 26:
    				case 22:
    				case 29:
    				case 33:
    				case 25:
    				case 21:
    				case 31:
    				case 35:
    				case 27:
    				case 23:
    					if (Magic.checkCombatSpell(player, componentId, 1, false)) {
    						player.setNextFaceWorldTile(new WorldTile(npc
    								.getCoordFaceX(npc.getSize()), npc
    								.getCoordFaceY(npc.getSize()), npc.getPlane()));
    						if (!player.getControlerManager().canAttack(npc))
    							return;
    						if (npc instanceof Familiar) {
    							Familiar familiar = (Familiar) npc;
    							if (familiar == player.getFamiliar()) {
    								player.getPackets().sendGameMessage(
    										"You can't attack your own familiar.");
    								return;
    							}
    							if (!familiar.canAttack(player)) {
    								player.getPackets().sendGameMessage(
    										"You can't attack this npc.");
    								return;
    							}
    						} else if (!npc.isForceMultiAttacked()) {
    							if (!npc.isAtMultiArea() || !player.isAtMultiArea()) {
    								if (player.getAttackedBy() != npc
    										&& player.getAttackedByDelay() > Utils
    												.currentTimeMillis()) {
    									player.getPackets().sendGameMessage(
    											"You are already in combat.");
    									return;
    								}
    								if (npc.getAttackedBy() != player
    										&& npc.getAttackedByDelay() > Utils
    												.currentTimeMillis()) {
    									player.getPackets().sendGameMessage(
    											"This npc is already in combat.");
    									return;
    								}
    							}
    						}
    						player.getActionManager().setAction(new PlayerCombat(npc));
    					}
    					break;
    				}
    			case 192:
    				switch (componentId) {
    				case 25: // air strike
    				case 28: // water strike
    				case 30: // earth strike
    				case 32: // fire strike
    				case 34: // air bolt
    				case 39: // water bolt
    				case 42: // earth bolt
    				case 45: // fire bolt
    				case 49: // air blast
    				case 52: // water blast
    				case 58: // earth blast
    				case 63: // fire blast
    				case 70: // air wave
    				case 73: // water wave
    				case 77: // earth wave
    				case 80: // fire wave
    				case 84: // air surge
    				case 87: // water surge
    				case 89: // earth surge
    				case 66: // Sara Strike
    				case 67: // Guthix Claws
    				case 68: // Flame of Zammy
    				case 93:
    				case 91: // fire surge
    				case 99: // storm of Armadyl
    				case 36: // bind
    				case 55: // snare
    				case 81: // entangle
    					if (Magic.checkCombatSpell(player, componentId, 1, false)) {
    						player.setNextFaceWorldTile(new WorldTile(npc
    								.getCoordFaceX(npc.getSize()), npc
    								.getCoordFaceY(npc.getSize()), npc.getPlane()));
    						if (!player.getControlerManager().canAttack(npc))
    							return;
    						if (npc instanceof Familiar) {
    							Familiar familiar = (Familiar) npc;
    							if (familiar == player.getFamiliar()) {
    								player.getPackets().sendGameMessage(
    										"You can't attack your own familiar.");
    								return;
    							}
    							if (!familiar.canAttack(player)) {
    								player.getPackets().sendGameMessage(
    										"You can't attack this npc.");
    								return;
    							}
    						} else if (!npc.isForceMultiAttacked()) {
    							if (!npc.isAtMultiArea() || !player.isAtMultiArea()) {
    								if (player.getAttackedBy() != npc
    										&& player.getAttackedByDelay() > Utils
    												.currentTimeMillis()) {
    									player.getPackets().sendGameMessage(
    											"You are already in combat.");
    									return;
    								}
    								if (npc.getAttackedBy() != player
    										&& npc.getAttackedByDelay() > Utils
    												.currentTimeMillis()) {
    									player.getPackets().sendGameMessage(
    											"This npc is already in combat.");
    									return;
    								}
    							}
    						}
    						player.getActionManager().setAction(new PlayerCombat(npc));
    					}
    					break;
    				}
    				break;
    			}
    with this instead

    Code:
    		} else if (packetId == INTERFACE_ON_NPC) {
    			if (!player.hasStarted() || !player.clientHasLoadedMapRegion() || player.isDead()) {
    				return;
    			}
    			if (player.getLockDelay() > Utils.currentTimeMillis()) {
    				return;
    			}
    			int slot = stream.readUnsignedShortLE128();
    			stream.readUnsignedShortLE();
    			int npcIndex = stream.readUnsignedShortLE();
    			int interfaceHash = stream.readIntV2();
    			stream.readByte();
    			int interfaceId = interfaceHash >> 16;
    			int componentId = interfaceHash - (interfaceId << 16);
    
    			if (Utils.getInterfaceDefinitionsSize() <= interfaceId) {
    				return;
    			}
    			if (!player.getInterfaceManager().containsInterface(interfaceId)) {
    				return;
    			}
    			if (componentId == 65535) {
    				componentId = -1;
    			}
    			if (componentId != -1 && Utils.getInterfaceDefinitionsComponentsSize(interfaceId) <= componentId) {
    				return;
    			}
    			NPC npc = World.getNPCs().get(npcIndex);
    			if (npc == null || npc.isDead() || npc.hasFinished() || !player.getMapRegionsIds().contains(npc.getRegionId())) {
    				return;
    			}
    			player.stopAll(false);
    			switch (interfaceId) {
    			case Inventory.INVENTORY_INTERFACE:
    				Item item = player.getInventory().getItem(slot);
    				if (item == null) {
    					return;
    				}
    				if (!player.getInventory().containsItem(item.getId(), item.getAmount())) {
    					return;
    				}
    				if (!player.getControlerManager().processItemOnNPC(npc, item)) {
    					return;
    				}
    				//InventoryOptionsHandler.handleItemOnNPC(player, npc, item);
    				break;
    			case 662:
    			case 747:
    				if (player.getFamiliar() == null)
    					return;
    				player.resetWalkSteps();
    				if ((interfaceId == 747 && componentId == 14)
    						|| (interfaceId == 662 && componentId == 65)
    						|| (interfaceId == 662 && componentId == 74)
    						|| interfaceId == 747 && componentId == 17
    						|| interfaceId == 747 && componentId == 23) {
    					if ((interfaceId == 662 && componentId == 74 || interfaceId == 747
    							&& componentId == 17)) {
    						if (player.getFamiliar().getSpecialAttack() != SpecialAttack.ENTITY)
    							return;
    					}
    					if (npc == player.getFamiliar()) {
    						player.getPackets().sendGameMessage(
    								"You can't attack your own familiar.");
    						return;
    					}
    					if (!player.getFamiliar().canAttack(npc)) {
    						player.getPackets()
    								.sendGameMessage(
    										"You can only use your familiar in a multi-zone area.");
    						return;
    					} else {
    						player.getFamiliar().setSpecial(
    								interfaceId == 662 && componentId == 74
    										|| interfaceId == 747
    										&& componentId == 17);
    						player.getFamiliar().setTarget(npc);
    					}
    				}
    				break;
    			case 193:
    				switch (componentId) {
    				case 28:
    				case 32:
    				case 24:
    				case 20:
    				case 30:
    				case 34:
    				case 36:
    				case 38:
    				case 37:
    				case 39:
    				case 26:
    				case 22:
    				case 29:
    				case 33:
    				case 25:
    				case 21:
    				case 31:
    				case 35:
    				case 27:
    				case 23:
    					if (Magic.checkCombatSpell(player, componentId, 1, false)) {
    						player.setNextFaceWorldTile(new WorldTile(npc.getCoordFaceX(npc.getSize()), npc.getCoordFaceY(npc.getSize()), npc.getPlane()));
    						if (!player.getControlerManager().canAttack(npc)) {
    							return;
    						}
    						if (npc instanceof Familiar) {
    							Familiar familiar = (Familiar) npc;
    							if (familiar == player.getFamiliar()) {
    								player.getPackets().sendGameMessage("You can't attack your own familiar.");
    								return;
    							}
    							if (!familiar.canAttack(player)) {
    								player.getPackets().sendGameMessage("You can't attack this npc.");
    								return;
    							}
    						} else if (!npc.isForceMultiAttacked()) {
    							if (!npc.isAtMultiArea() || !player.isAtMultiArea()) {
    								if (player.getAttackedBy() != npc && player.getAttackedByDelay() > Utils.currentTimeMillis()) {
    									player.getPackets().sendGameMessage("You are already in combat.");
    									return;
    								}
    								if (npc.getAttackedBy() != player && npc.getAttackedByDelay() > Utils.currentTimeMillis()) {
    									player.getPackets().sendGameMessage("This npc is already in combat.");
    									return;
    								}
    							}
    						}
    						player.getActionManager().setAction(new PlayerCombat(npc));
    					}
    					break;
    				}
    			case 192:
    				switch (componentId) {
    				case 98: // wind rush
    				case 25: // air strike
    				case 28: // water strike
    				case 30: // earth strike
    				case 32: // fire strike
    				case 34: // air bolt
    				case 39: // water bolt
    				case 42: // earth bolt
    				case 45: // fire bolt
    				case 49: // air blast
    				case 52: // water blast
    				case 58: // earth blast
    				case 63: // fire blast
    				case 70: // air wave
    				case 73: // water wave
    				case 77: // earth wave
    				case 80: // fire wave
    				case 84: // air surge
    				case 87: // water surge
    				case 89: // earth surge
    				case 66: // Sara Strike
    				case 67: // Guthix Claws
    				case 68: // Flame of Zammy
    				case 93:
    				case 91: // fire surge
    				case 99: // storm of Armadyl
    				case 36: // bind
    				case 55: // snare
    				case 81: // entangle
    					if (Magic.checkCombatSpell(player, componentId, 1, false)) {
    						player.setNextFaceWorldTile(new WorldTile(npc.getCoordFaceX(npc.getSize()), npc.getCoordFaceY(npc.getSize()), npc.getPlane()));
    						if (!player.getControlerManager().canAttack(npc)) {
    							return;
    						}
    						if (npc instanceof Familiar) {
    							Familiar familiar = (Familiar) npc;
    							if (familiar == player.getFamiliar()) {
    								player.getPackets().sendGameMessage("You can't attack your own familiar.");
    								return;
    							}
    							if (!familiar.canAttack(player)) {
    								player.getPackets().sendGameMessage("You can't attack this npc.");
    								return;
    							}
    						} else if (!npc.isForceMultiAttacked()) {
    							if (!npc.isAtMultiArea() || !player.isAtMultiArea()) {
    								if (player.getAttackedBy() != npc && player.getAttackedByDelay() > Utils.currentTimeMillis()) {
    									player.getPackets().sendGameMessage("You are already in combat.");
    									return;
    								}
    								if (npc.getAttackedBy() != player && npc.getAttackedByDelay() > Utils.currentTimeMillis()) {
    									player.getPackets().sendGameMessage("This npc is already in combat.");
    									return;
    								}
    							}
    						}
    						player.getActionManager().setAction(new PlayerCombat(npc));
    					}
    					break;
    				}
    				break;
    			}
    Reply With Quote  
     

  8. Thankful user:


  9. #7  
    Registered Member
    Join Date
    Feb 2016
    Posts
    2
    Thanks given
    0
    Thanks received
    1
    Rep Power
    0
    i am thankful for this
    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. MAGIC single cast
    By HFSTD in forum Help
    Replies: 4
    Last Post: 03-27-2016, 08:58 AM
  2. Casting Magic Delays?
    By Throat in forum Help
    Replies: 2
    Last Post: 05-03-2010, 04:54 PM
  3. Replies: 2
    Last Post: 02-15-2010, 07:54 PM
  4. Attacking with melee when casting magic
    By Its paris in forum Help
    Replies: 1
    Last Post: 05-02-2009, 08:17 PM
  5. Safezone unable to cast magic.
    By 0v3rc0m3 in forum Requests
    Replies: 4
    Last Post: 01-28-2009, 04:59 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
  •