Thread: Illuminated ancient books

Results 1 to 7 of 7
  1. #1 Illuminated ancient books 
    Learning Code
    Riddler's Avatar
    Join Date
    Oct 2012
    Posts
    338
    Thanks given
    10
    Thanks received
    16
    Rep Power
    13
    How would I make it so when you click preach on these The character will actually start preaching it?




    Reply With Quote  
     

  2. #2  
    Coder in training
    Alienware's Avatar
    Join Date
    Oct 2011
    Age
    27
    Posts
    517
    Thanks given
    35
    Thanks received
    58
    Rep Power
    12
    Find the preach emote id (not sure if it has a gfx aswell?), make a force talk code and put it in InventoryOptionsHandler under handleItemOption2.
    Quote Originally Posted by Alienware
    The heart of a server is its community.
    Reply With Quote  
     

  3. #3  
    Learning Code
    Riddler's Avatar
    Join Date
    Oct 2012
    Posts
    338
    Thanks given
    10
    Thanks received
    16
    Rep Power
    13
    Quote Originally Posted by Alienware View Post
    Find the preach emote id (not sure if it has a gfx aswell?), make a force talk code and put it in InventoryOptionsHandler under handleItemOption2.
    ok going to use a gfk but what is the method to adding it into the statment?

    Code:
    		if (itemId = 22422) {
    			player.setNextForceTalk(new ForceTalk("Good order and discipline in any army are to be depended upon more thatn courage alone!"));
    		}
    Also when I click preach nothing happens. If I wielding it, it just removes the book.



    I put it right here

    Code:
    	public static void handleItemOption2(final Player player, final int slotId,
    			final int itemId, Item item) {
    		if (Firemaking.isFiremaking(player, itemId))
    			return;
    		if (itemId >= 5509 && itemId <= 5514) {
    			int pouch = -1;
    			if (itemId == 5509)
    				pouch = 0;
    			if (itemId == 5510)
    				pouch = 1;
    			if (itemId == 5512)
    				pouch = 2;
    			if (itemId == 5514)
    				pouch = 3;
    			Runecrafting.emptyPouch(player, pouch);
    			player.stopAll(false);
    		} else if (itemId >= 15086 && itemId <= 15100) {
    			Dicing.handleRoll(player, itemId, true); 
    			return;
    		} else {
    			if (player.isEquipDisabled())
    				return;
    			long passedTime = Utils.currentTimeMillis()
    					- WorldThread.LAST_CYCLE_CTM;
    			WorldTasksManager.schedule(new WorldTask() {
    
    				@Override
    				public void run() {
    					List<Integer> slots = player.getSwitchItemCache();
    					int[] slot = new int[slots.size()];
    					for (int i = 0; i < slot.length; i++)
    						slot[i] = slots.get(i);
    					player.getSwitchItemCache().clear();
    					ButtonHandler.sendWear(player, slot);
    					player.stopAll(false, true, false);
    				}
    			}, passedTime >= 600 ? 0 : passedTime > 330 ? 1 : 0);
    			if (player.getSwitchItemCache().contains(slotId))
    				return;
    			player.getSwitchItemCache().add(slotId);
    		}
    	}
    	
    	public static void dig(final Player player) {
    		player.resetWalkSteps();
    		player.setNextAnimation(new Animation(830));
    		player.lock();
    		WorldTasksManager.schedule(new WorldTask() {
    
    			@Override
    			public void run() {
    				player.unlock();
    				if (Barrows.digIntoGrave(player))
    					return;
    				if(player.getX() == 3005 && player.getY() == 3376
    						|| player.getX() == 2999 && player.getY() == 3375
    						|| player.getX() == 2996 && player.getY() == 3377
    						|| player.getX() == 2989 && player.getY() == 3378
    						|| player.getX() == 2987 && player.getY() == 3387
    						|| player.getX() == 2984 && player.getY() == 3387) {
    					//mole
    					player.setNextWorldTile(new WorldTile(1752, 5137, 0));
    					player.getPackets().sendGameMessage("You seem to have dropped down into a network of mole tunnels.");
    					return;
    				}
    				player.getPackets().sendGameMessage("You find nothing.");
    			}
    			
    		});
    	}
    
    	public static void handleItemOption1(Player player, final int slotId,
    			final int itemId, Item item) {
    		long time = Utils.currentTimeMillis();
    		if (player.getLockDelay() >= time
    				|| player.getEmotesManager().getNextEmoteEnd() >= time)
    			return;
    		player.stopAll(false);
    		if (Foods.eat(player, item, slotId))
    			return;
    		if (itemId >= 15086 && itemId <= 15100) {
    			Dicing.handleRoll(player, itemId, true); 
    			return;
    		}
    		if (itemId == 9083) {
    		player.sm("Teleportation with the holy symbol has been activated.");
    		Entrance.MissionTeleport(player, 3040, 3202, 0);
    		player.sm("Hmm... Wierd item isn't it? I Should speak with Klarense now.");
    		}
    		if (itemId == 22422) {
    			player.setNextForceTalk(new ForceTalk("Good order and discipline in any army are to be depended upon more thatn courage alone!"));
    		}
    Is it not the correct spot?




    Reply With Quote  
     

  4. #4  
    Coder in training
    Alienware's Avatar
    Join Date
    Oct 2011
    Age
    27
    Posts
    517
    Thanks given
    35
    Thanks received
    58
    Rep Power
    12
    Quote Originally Posted by Riddler View Post
    ok going to use a gfk but what is the method to adding it into the statment?

    Code:
    		if (itemId = 22422) {
    			player.setNextForceTalk(new ForceTalk("Good order and discipline in any army are to be depended upon more thatn courage alone!"));
    		}
    Also when I click preach nothing happens. If I wielding it, it just removes the book.



    I put it right here

    Code:
    	public static void handleItemOption2(final Player player, final int slotId,
    			final int itemId, Item item) {
    		if (Firemaking.isFiremaking(player, itemId))
    			return;
    		if (itemId >= 5509 && itemId <= 5514) {
    			int pouch = -1;
    			if (itemId == 5509)
    				pouch = 0;
    			if (itemId == 5510)
    				pouch = 1;
    			if (itemId == 5512)
    				pouch = 2;
    			if (itemId == 5514)
    				pouch = 3;
    			Runecrafting.emptyPouch(player, pouch);
    			player.stopAll(false);
    		} else if (itemId >= 15086 && itemId <= 15100) {
    			Dicing.handleRoll(player, itemId, true); 
    			return;
    		} else {
    			if (player.isEquipDisabled())
    				return;
    			long passedTime = Utils.currentTimeMillis()
    					- WorldThread.LAST_CYCLE_CTM;
    			WorldTasksManager.schedule(new WorldTask() {
    
    				@Override
    				public void run() {
    					List<Integer> slots = player.getSwitchItemCache();
    					int[] slot = new int[slots.size()];
    					for (int i = 0; i < slot.length; i++)
    						slot[i] = slots.get(i);
    					player.getSwitchItemCache().clear();
    					ButtonHandler.sendWear(player, slot);
    					player.stopAll(false, true, false);
    				}
    			}, passedTime >= 600 ? 0 : passedTime > 330 ? 1 : 0);
    			if (player.getSwitchItemCache().contains(slotId))
    				return;
    			player.getSwitchItemCache().add(slotId);
    		}
    	}
    	
    	public static void dig(final Player player) {
    		player.resetWalkSteps();
    		player.setNextAnimation(new Animation(830));
    		player.lock();
    		WorldTasksManager.schedule(new WorldTask() {
    
    			@Override
    			public void run() {
    				player.unlock();
    				if (Barrows.digIntoGrave(player))
    					return;
    				if(player.getX() == 3005 && player.getY() == 3376
    						|| player.getX() == 2999 && player.getY() == 3375
    						|| player.getX() == 2996 && player.getY() == 3377
    						|| player.getX() == 2989 && player.getY() == 3378
    						|| player.getX() == 2987 && player.getY() == 3387
    						|| player.getX() == 2984 && player.getY() == 3387) {
    					//mole
    					player.setNextWorldTile(new WorldTile(1752, 5137, 0));
    					player.getPackets().sendGameMessage("You seem to have dropped down into a network of mole tunnels.");
    					return;
    				}
    				player.getPackets().sendGameMessage("You find nothing.");
    			}
    			
    		});
    	}
    
    	public static void handleItemOption1(Player player, final int slotId,
    			final int itemId, Item item) {
    		long time = Utils.currentTimeMillis();
    		if (player.getLockDelay() >= time
    				|| player.getEmotesManager().getNextEmoteEnd() >= time)
    			return;
    		player.stopAll(false);
    		if (Foods.eat(player, item, slotId))
    			return;
    		if (itemId >= 15086 && itemId <= 15100) {
    			Dicing.handleRoll(player, itemId, true); 
    			return;
    		}
    		if (itemId == 9083) {
    		player.sm("Teleportation with the holy symbol has been activated.");
    		Entrance.MissionTeleport(player, 3040, 3202, 0);
    		player.sm("Hmm... Wierd item isn't it? I Should speak with Klarense now.");
    		}
    		if (itemId == 22422) {
    			player.setNextForceTalk(new ForceTalk("Good order and discipline in any army are to be depended upon more thatn courage alone!"));
    		}
    Is it not the correct spot?
    That is under handleItemOption1 mate you need to put it above that.
    Reply With Quote  
     

  5. #5  
    Learning Code
    Riddler's Avatar
    Join Date
    Oct 2012
    Posts
    338
    Thanks given
    10
    Thanks received
    16
    Rep Power
    13
    Ok how do I make the GFX happen when I click preach? like what is the method?




    Reply With Quote  
     

  6. #6  
    Registered Member RuneFurst's Avatar
    Join Date
    Apr 2013
    Posts
    132
    Thanks given
    127
    Thanks received
    5
    Rep Power
    6
    Quote Originally Posted by Riddler View Post
    Ok how do I make the GFX happen when I click preach? like what is the method?
    Got skype? I may be able to help you.



    Reply With Quote  
     

  7. #7  
    Coder in training
    Alienware's Avatar
    Join Date
    Oct 2011
    Age
    27
    Posts
    517
    Thanks given
    35
    Thanks received
    58
    Rep Power
    12
    Code:
    player.setNextGraphics(new Graphics(GFXID));
    or if you want to use more than one gfx as the same time you can use it like this:
    Code:
    		player.setNextGraphics(new Graphics(ID1, ID2, ID3));
    For emote:
    Code:
    player.setNextAnimation(new Animation(EmoteID));
    Quote Originally Posted by Alienware
    The heart of a server is its community.
    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. [REQ] Ancient book model
    By Organic in forum Models
    Replies: 1
    Last Post: 10-27-2010, 09:51 PM
  2. 614 Ancient Book
    By Juggalo Family in forum Configuration
    Replies: 19
    Last Post: 09-01-2010, 01:00 AM
  3. [613/614]ancient book
    By Ecofriendly in forum Requests
    Replies: 3
    Last Post: 08-27-2010, 05:55 PM
  4. Editing Text on ancients book
    By cookies219 in forum Help
    Replies: 5
    Last Post: 03-06-2010, 05:46 PM
  5. Replies: 10
    Last Post: 07-23-2009, 05:18 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
  •