Guest User

smart shop

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