Guest User

smart shop

a guest
Dec 5th, 2012
432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.42 KB | None | 0 0
  1. Index: java/com/l2jserver/gameserver/instancemanager/SmartShop.java
  2. ===================================================================
  3. --- java/com/l2jserver/gameserver/instancemanager/SmartShop.java (revision 0)
  4. +++ java/com/l2jserver/gameserver/instancemanager/SmartShop.java (revision 0)
  5. @@ -0,0 +1,148 @@
  6. +/*
  7. + * This program is free software: you can redistribute it and/or modify it under
  8. + * the terms of the GNU General Public License as published by the Free Software
  9. + * Foundation, either version 3 of the License, or (at your option) any later
  10. + * version.
  11. + *
  12. + * This program is distributed in the hope that it will be useful, but WITHOUT
  13. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  14. + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
  15. + * details.
  16. + *
  17. + * You should have received a copy of the GNU General Public License along with
  18. + * this program. If not, see <http://www.gnu.org/licenses/>.
  19. + */
  20. +package com.l2jserver.gameserver.instancemanager;
  21. +
  22. +import com.l2jserver.gameserver.model.actor.L2Npc;
  23. +import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
  24. +import com.l2jserver.gameserver.model.quest.Quest;
  25. +import com.l2jserver.gameserver.model.quest.QuestState;
  26. +
  27. +/**
  28. + * Services
  29. + * @author Marwan
  30. + */
  31. +public final class SmartShop extends Quest
  32. +{
  33. +
  34. + static int counter;
  35. + static String omg;
  36. + static String mero[] = new String[100];
  37. +
  38. + private static final class Services
  39. + {
  40. +
  41. + /**
  42. + *
  43. + */
  44. + static String all;
  45. +
  46. + Services(int couunter, String name, String itemcount, String info)
  47. + {
  48. + counter++;
  49. + omg += counter;
  50. + mero[counter] = info;
  51. + name = "<tr><td><font color=\"336699\">" + name + "</td>";
  52. + itemcount = "<td><font color=\"336699\">" + itemcount + "</font></td></tr>";
  53. + String infobut = "<td><a action=\"bypass -h Quest SmartShop " + counter + "\" <font color=\"FFFF00\">Info</font></a></td><br>";
  54. + all += name + infobut + itemcount;
  55. + }
  56. + }
  57. +
  58. + private final int NpcId = 70012;
  59. +
  60. + private SmartShop(int questId, String name, String descr)
  61. + {
  62. +
  63. + super(questId, name, descr);
  64. + addStartNpc(NpcId);
  65. + addTalkId(NpcId);
  66. + }
  67. +
  68. + @Override
  69. + public final String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
  70. + {
  71. + QuestState st = player.getQuestState("SmartShop");
  72. + if (st == null)
  73. + {
  74. + return "";
  75. + }
  76. + else if (event.equalsIgnoreCase("show"))
  77. + {
  78. + StringBuilder sb = new StringBuilder();
  79. + sb.append("<html><title>Smart Shop</title>");
  80. + sb.append("<body>");
  81. + // sb.append("<br><font color=\"0066FF\">Current Event: 1vs1 </font>");
  82. + sb.append("<table width=270 border=0 bgcolor=\"FF9900\"><tr>");
  83. + sb.append("<td width=135 ALIGN=\"CENTER\">Donation Shop" + "</td><br>");
  84. + sb.append("</tr></table><br>");
  85. + sb.append("<br><font color=\"00ff4d\">Hello " + player.getName() + ".<br> Here you can buy permium services for donate coins <br><br></font>");
  86. + sb.append("<hr>");
  87. + sb.append("<br><br><br><br>");
  88. + sb.append("<center><img src=\"L2UI.SquareWhite\" width=300 height=1>");
  89. + sb.append("<table bgcolor=333333 width=100>");
  90. + sb.append("<tr>");
  91. + sb.append("<td width=135 ALIGN=\"LEFT\"><button value=\"Buy Services\" action=\"bypass -h Quest SmartShop services\" width=100 height=25 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></td>");
  92. + // sb.append("<td width=135 ALIGN=\"RIGHT\"><button value=\"Buy Items\" action=\"bypass -h Quest SmartShop moreinfo\" width=100 height=25 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></td>");
  93. + sb.append("<br><td width=135 ALIGN=\"RIGHT\"><button value=\"How to donate\" action=\"bypass -h Quest SmartShop info\" width=100 height=25 back=\"L2UI_CT1.Button_DF_Down\" fore=\"L2UI_ct1.button_df\"></td>");
  94. +
  95. + sb.append("</tr>");
  96. + sb.append("</table>");
  97. + sb.append("<br><br></center>");
  98. +
  99. + return sb.toString();
  100. + }
  101. +
  102. + else if (event.equalsIgnoreCase("services"))
  103. + {
  104. + StringBuilder sb = new StringBuilder();
  105. +
  106. + sb.append("<html><title>Services</title><body><font color=\"525252\">");
  107. + sb.append("<br><br><table width=300><tr><td>Name</td><td width=80>Info</td><td>Price</td></tr><br></font>");
  108. + sb.append("<table>" + Services.all + "</table></body></html>");
  109. + return sb.toString();
  110. +
  111. + }
  112. + else if (event.equalsIgnoreCase("moreinfo"))
  113. + {
  114. +
  115. + StringBuilder sb = new StringBuilder();
  116. + sb.append("<html><title>Services</title>");
  117. + sb.append("<body><h1>Info</h1></body></html>");
  118. + return sb.toString();
  119. + }
  120. + else if (omg.contains(event))
  121. + {
  122. + StringBuilder sb = new StringBuilder();
  123. + sb.append("<html><title>Donating Info</title><body><center>");
  124. + int i = Integer.parseInt(event);
  125. + sb.append("<br><br>" + mero[i] + "</body></html>");
  126. +
  127. + return sb.toString();
  128. +
  129. + }
  130. +
  131. + return event;
  132. + }
  133. +
  134. + Services[] ahm = new Services[]
  135. + {
  136. + new Services(1, "+1 Wep", "56", "You can make ur wep +1<br>:D"),
  137. + new Services(2, "+1 Armor", "56", "INFO<br>INFO"),
  138. + new Services(3, "Fuck !", "56", "gtfo")
  139. + };
  140. +
  141. + @SuppressWarnings("synthetic-access")
  142. + public static SmartShop getInstance()
  143. + {
  144. + return SingletonHolder._instance;
  145. + }
  146. +
  147. + private static class SingletonHolder
  148. + {
  149. + @SuppressWarnings("synthetic-access")
  150. + private static final SmartShop _instance = new SmartShop(-1, "SmartShop", "instances");
  151. + }
  152. +
  153. +}
Advertisement
Add Comment
Please, Sign In to add comment