Advertisement
Tyluur

Untitled

Jul 5th, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. package com.sevador.network.out;
  2.  
  3. import com.sevador.content.grandExchange.ItemOffer;
  4. import com.sevador.network.OutgoingPacket;
  5.  
  6. /**
  7. * Sets the Offer Data.
  8. *
  9. * @author Jefferson
  10. *
  11. */
  12. public class GrandExchangePacket extends OutgoingPacket {
  13.  
  14. /**
  15. * The offer to be set.
  16. */
  17. private final ItemOffer offer;
  18.  
  19. /**
  20. * The offer progress type.
  21. */
  22. private final byte progressType;
  23.  
  24. /**
  25. * Creates a new packet.
  26. *
  27. * @param player
  28. * @param offer
  29. */
  30. public GrandExchangePacket(ItemOffer offer, byte progressType) {
  31. super(offer.getOwner(), 7);
  32. this.offer = offer;
  33. this.progressType = progressType;
  34. }
  35.  
  36. @Override
  37. public OutgoingPacket get() {
  38. put(offer.getSlot());
  39. put(progressType);
  40. putShort(offer.getId());
  41. putInt(offer.getPrice());
  42. putInt(offer.getAmount());
  43. putInt(offer.getOfferedQuantity());
  44. putInt(offer.getPrice() * offer.getOfferedQuantity());
  45. return this;
  46. }
  47.  
  48. /*
  49. * XXX - Notes
  50. *
  51. * Progress type values:
  52. *
  53. * 0 empty slot
  54. * 1 buy and submitting message
  55. * 2 buy 10%
  56. * 5 cancelled buy offer if the offeredAmount is not equal as offerAmount
  57. * 8 empty slot
  58. * 9 sell and submitting message
  59. * 11 sell 10%
  60. * 13 cancelled sell offer if the offeredAmount is not equal as offerAmount
  61. *
  62. */
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement