-
Posts
1,771 -
Joined
-
Last visited
-
Feedback
0%
Content Type
Articles
Profiles
Forums
Store
Posts posted by Stewie
-
-
voicedcommands.java
create one vote.java register it at the handlers (skip these steps if you want .vote)
then the code should look like this
if (...)
new html
html.set(the html in your code)
player.sendPacket(html)
very simple this command will open the chat dialog, but i dont know how this engine works to further help you
Edit: you have to add the npc oid bypass, so it becomes more complex. So it needs rework from L2Npc extender instance to command
The html itself its easy, bit this NPC is java, so i have no idias what to do :D
-
Okey, so i'm using Vortex Vote Reward System created by Elfocrash....
I wanna make it with command, i modify it a while but i think it will works....
Does anyone have any idias how it should looks like, i tryed alot methods but... nothing worked.
I simple wanna open [NPC dialog] like you talk with NPC, but with command.
Anyway, here is the votemanagetinstance.java
Index: java/l2f/gameserver/models/instance/VoteManagerInstance.java =================================================================== --- java/l2f/gameserver/models/instance/VoteManagerInstance.java (revision 0) +++ java/l2f/gameserver/models/instance/VoteManagerInstance.java (working copy) @@ -0,0 +1,268 @@ +package com.l2jserver.gameserver.model.actor.instance; + +import java.io.File; + +import javolution.text.TextBuilder; +import net.vortextengine.VoteMain; + +import com.l2jserver.Config; +import com.l2jserver.gameserver.ai.CtrlIntention; +import com.l2jserver.gameserver.datatables.ItemTable; +import com.l2jserver.gameserver.model.actor.L2Npc; +import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate; +import com.l2jserver.gameserver.network.serverpackets.MyTargetSelected; +import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; +import com.l2jserver.gameserver.network.serverpackets.PledgeCrest; +import com.l2jserver.gameserver.network.serverpackets.ValidateLocation; + +import gov.nasa.worldwind.formats.dds.DDSConverter; + +/** + * @author Elfocrash + */ +public class L2VoteManagerInstance extends L2Npc +{ + public L2VoteManagerInstance(int objectId, L2NpcTemplate template) + { + super(objectId, template); + } + + @Override + public void onBypassFeedback(final L2PcInstance player, String command) + { + if (player == null) + { + return; + } + + if (command.startsWith("votehopzone")) + { + VoteMain.hopvote(player); + } + + if (command.startsWith("votetopzone")) + { + VoteMain.topvote(player); + } + + if (command.startsWith("rewards")) + { + showRewardsHtml(player); + } + + if (command.startsWith("reward1")) + { + player.getInventory().addItem("reward", Config.VOTE_REWARD_ID1, Config.VOTE_REWARD_AMOUNT1, player, null); + player.sendMessage("Wise choise!"); + VoteMain.setHasNotVotedHop(player); + VoteMain.setHasNotVotedTop(player); + VoteMain.setTries(player, VoteMain.getTries(player) + 1); + } + + if (command.startsWith("reward2")) + { + player.getInventory().addItem("reward", Config.VOTE_REWARD_ID2, Config.VOTE_REWARD_AMOUNT2, player, null); + player.sendMessage("Wise choise!"); + VoteMain.setHasNotVotedHop(player); + VoteMain.setHasNotVotedTop(player); + VoteMain.setTries(player, VoteMain.getTries(player) + 1); + } + + if (command.startsWith("reward3")) + { + player.getInventory().addItem("reward", Config.VOTE_REWARD_ID3, Config.VOTE_REWARD_AMOUNT3, player, null); + player.sendMessage("Wise choise!"); + VoteMain.setHasNotVotedHop(player); + VoteMain.setHasNotVotedTop(player); + VoteMain.setTries(player, VoteMain.getTries(player) + 1); + } + + if (command.startsWith("reward4")) + { + player.getInventory().addItem("reward", Config.VOTE_REWARD_ID4, Config.VOTE_REWARD_AMOUNT4, player, null); + player.sendMessage("Wise choise!"); + VoteMain.setHasNotVotedHop(player); + VoteMain.setHasNotVotedTop(player); + VoteMain.setTries(player, VoteMain.getTries(player) + 1); + } + } + + @Override + public void showChatWindow(L2PcInstance player) + { + if (this != player.getTarget()) + { + player.setTarget(this); + + player.sendPacket(new MyTargetSelected(getObjectId(), 0)); + + player.sendPacket(new ValidateLocation(this)); + } + else if (!canInteract(player)) + { + player.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this); + } + else + { + showHtmlWindow(player); + } + } + + public void showHtmlWindow(L2PcInstance activeChar) + { + generateLogo(activeChar, 1821); + generateLogo(activeChar, 11888); + generateLogo(activeChar, 65531); + generateLogo(activeChar, 65532); + generateLogo(activeChar, 65533); + VoteMain.hasVotedHop(activeChar); + VoteMain.hasVotedTop(activeChar); + + NpcHtmlMessage nhm = new NpcHtmlMessage(5); + TextBuilder tb = new TextBuilder(""); + + tb.append("<html><head><title>Vote reward Panel</title></head><body>"); + tb.append("<center>"); + tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">"); + tb.append("<tr>"); + tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"L2ui_ch3.menubutton4\" width=\"38\" height=\"38\"></td>"); + tb.append("<td valign=\"top\"><font color=\"FF6600\">Vote Panel</font>"); + tb.append("<br1><font color=\"00FF00\">" + activeChar.getName() + "</font>, use this menu to Vote for our server.<br1></td>"); + tb.append("</tr>"); + tb.append("</table>"); + tb.append("</center>"); + tb.append("<center>"); + tb.append("<table bgcolor=\"FFFFFF\"><tr><td align=\"center\"><font color=\"00ff99\">Who's voting now: </font>" + VoteMain.whosVoting() + "</td></tr>"); + tb.append("<tr><td align=\"center\"><font color=\"00ffff\">Tries left: </font>" + VoteMain.getTries(activeChar) + "</td></tr>"); + tb.append("<tr><td align=\"center\"><font color=\"FF6600\">You can vote in Hopzone at " + VoteMain.hopCd(activeChar) + "</font></td></tr>"); + tb.append("<tr><td align=\"center\"><font color=\"FF6600\">You can vote in Topzone at " + VoteMain.topCd(activeChar) + "</font></td></tr></table>"); + tb.append("</center>"); + if (!VoteMain.hasVotedHop() || !VoteMain.hasVotedTop()) + { + tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">"); + tb.append("<tr>"); + tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><button action=\"bypass -h npc_" + getObjectId() + "_votehopzone\" width=256 height=64 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 1821 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 1821 + "\"></td>"); + tb.append("</tr>"); + tb.append("</table>"); + tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">"); + tb.append("<tr>"); + tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><button action=\"bypass -h npc_" + getObjectId() + "_votetopzone\" width=256 height=64 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 11888 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 11888 + "\"></td>"); + tb.append("</tr>"); + tb.append("</table>"); + } + if (VoteMain.hasVotedHop() && VoteMain.hasVotedTop()) + { + tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"FFFFFF\">"); + tb.append("<tr>"); + tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><button action=\"bypass -h npc_" + getObjectId() + "_rewards\" width=256 height=64 back=\"Crest.crest_" + Config.SERVER_ID + "_" + 65531 + "\" fore=\"Crest.crest_" + Config.SERVER_ID + "_" + 65531 + "\"></td>"); + tb.append("</tr>"); + tb.append("</table>"); + } + tb.append("<center><table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">"); + if (!VoteMain.hasVotedHop()) + { + tb.append("<tr><td width=\"45\" valign=\"top\" align=\"center\"><font color=\"FF6600\">Hopzone Status: </font><img src=\"Crest.crest_" + Config.SERVER_ID + "_" + 65533 + "\" width=32 height=32>"); + } + if (VoteMain.hasVotedHop()) + { + tb.append("<tr><td width=\"45\" valign=\"top\" align=\"center\"><font color=\"FF6600\">Hopzone Status: </font><img src=\"Crest.crest_" + Config.SERVER_ID + "_" + 65532 + "\" width=32 height=32>"); + } + if (!VoteMain.hasVotedTop()) + { + tb.append("<br1><font color=\"FF6600\">Topzone Status: </font><img src=\"Crest.crest_" + Config.SERVER_ID + "_" + 65533 + "\" width=32 height=32></td></tr>"); + } + if (VoteMain.hasVotedTop()) + { + tb.append("<br1><font color=\"FF6600\">Topzone Status: </font><img src=\"Crest.crest_" + Config.SERVER_ID + "_" + 65532 + "\" width=32 height=32></td></tr>"); + } + tb.append("</table></center>"); + tb.append("<center>"); + tb.append("<table bgcolor=\"000000\"><tr><td align=\"center\"><font color=\"FF6600\">Your votes this month: </font>" + VoteMain.getMonthVotes(activeChar) + "</td></tr>"); + tb.append("<tr><td align=\"center\"><font color=\"FF6600\">Your total votes in general: </font>" + VoteMain.getTotalVotes(activeChar) + "</td></tr>"); + tb.append("<tr><td align=\"center\"><font color=\"FF6600\">Players voted this month: </font>" + VoteMain.getBigMonthVotes(activeChar) + "</td></tr>"); + tb.append("<tr><td align=\"center\"><font color=\"FF6600\">Players voted in general: </font>" + VoteMain.getBigTotalVotes(activeChar) + "</td></tr></table>"); + tb.append("</center>"); + tb.append("</body></html>"); + + nhm.setHtml(tb.toString()); + activeChar.sendPacket(nhm); + } + + public static void generateLogo(L2PcInstance activeChar, int imgId) + { + try + { + if (imgId == 1821) + { + File captcha = new File("data/images/hopzone.png"); + PledgeCrest packet = new PledgeCrest(imgId, DDSConverter.convertToDDS(captcha).array()); + activeChar.sendPacket(packet); + } + + if (imgId == 11888) + { + File captcha = new File("data/images/topzone.png"); + PledgeCrest packet = new PledgeCrest(imgId, DDSConverter.convertToDDS(captcha).array()); + activeChar.sendPacket(packet); + } + + if (imgId == 65531) + { + File captcha = new File("data/images/rewards.png"); + PledgeCrest packet = new PledgeCrest(imgId, DDSConverter.convertToDDS(captcha).array()); + activeChar.sendPacket(packet); + } + + if (imgId == 65532) + { + File captcha = new File("data/images/check.png"); + PledgeCrest packet = new PledgeCrest(imgId, DDSConverter.convertToDDS(captcha).array()); + activeChar.sendPacket(packet); + } + + if (imgId == 65533) + { + File captcha = new File("data/images/noncheck.png"); + PledgeCrest packet = new PledgeCrest(imgId, DDSConverter.convertToDDS(captcha).array()); + activeChar.sendPacket(packet); + } + } + catch (Exception e) + { + } + + } + + public void showRewardsHtml(L2PcInstance player) + { + TextBuilder tb = new TextBuilder(); + NpcHtmlMessage html = new NpcHtmlMessage(1); + + tb.append("<html><head><title>Vote Reward Panel</title></head><body>"); + tb.append("<center>"); + tb.append("<table width=\"250\" cellpadding=\"5\" bgcolor=\"000000\">"); + tb.append("<tr>"); + tb.append("<td width=\"45\" valign=\"top\" align=\"center\"><img src=\"L2ui_ch3.menubutton4\" width=\"38\" height=\"38\"></td>"); + tb.append("<td valign=\"top\"><font color=\"FF6600\">Vote Panel</font>"); + tb.append("<br1><font color=\"00FF00\">" + player.getName() + "</font>, get your reward here.</td>"); + tb.append("</tr>"); + tb.append("</table>"); + tb.append("</center>"); + tb.append("<center>"); + tb.append("<td valign=\"top\"><font color=\"FF6600\">Choose your reward " + player.getName() + ".</font>"); + tb.append("<button value=\"Item:" + ItemTable.getInstance().getTemplate(Config.VOTE_REWARD_ID1).getName() + " Amount:" + Config.VOTE_REWARD_AMOUNT1 + "\" action=\"bypass -h npc_" + getObjectId() + "_reward1\" width=204 height=20>"); + tb.append("<button value=\"Item:" + ItemTable.getInstance().getTemplate(Config.VOTE_REWARD_ID2).getName() + " Amount:" + Config.VOTE_REWARD_AMOUNT2 + "\" action=\"bypass -h npc_" + getObjectId() + "_reward2\" width=204 height=20>"); + tb.append("<button value=\"Item:" + ItemTable.getInstance().getTemplate(Config.VOTE_REWARD_ID3).getName() + " Amount:" + Config.VOTE_REWARD_AMOUNT3 + "\" action=\"bypass -h npc_" + getObjectId() + "_reward3\" width=204 height=20>"); + if (VoteMain.getTotalVotes(player) >= Config.EXTRA_REW_VOTE_AM) + { + tb.append("<font color=\"FF6600\">Due to your votes you now have a 4th choise!</font><br><button value=\"Item:" + ItemTable.getInstance().getTemplate(Config.VOTE_REWARD_ID4).getName() + " Amount:" + Config.VOTE_REWARD_AMOUNT4 + "\" action=\"bypass -h npc_" + getObjectId() + "_reward4\" width=204 height=20>"); + } + tb.append("</center>"); + + tb.append("</body></html>"); + + html.setHtml(tb.toString()); + player.sendPacket(html); + } + +} \ No newline at end of fileHow to make it open with command?
-
Important New Rule
« on: November 11, 2012, 12:23:51 PM »
From now on topics without :
The correct prefix.
The correct tag.(eg. [L2J], [L2OFF] )
The correct informations.
will be junked without warning.
Edit your post!
-
-
-
Hope you get fine soon, wish you luck.
:)
-
Dont be so sure. We are already DdoS protected.
And about L2Bulgaria. Let's be clear. L2Bulgaria was a project from the same host, IPs from both servers are same. We bought it now , and is totaly new fresh project.
:good sir:
-
The website is great!
:D
-
No, this was to test PvP Colour System. No hatefull comments please.
We will have wipe on official start so dont worry this chars will be deleted.
L2Bulgaria detected, anyway goodluck...
Is the forum link.....
-
Spanish server...
-
GL, website seems nice....
btw... i think this name was in-use by interlude server, are you related with it?
-
With that name, in this forum....
Good luck :)
-
pvp.properties
# --------------------------------------------------------------------------- # PvP Related Settings # --------------------------------------------------------------------------- # The defaults are set to be retail-like. If you modify any of these settings your server will deviate from being retail-like. # Warning: # Please take extreme caution when changing anything. Also please understand what you are changing before you do so on a live server. # --------------------------------------------------------------------------- # Karma Variables # --------------------------------------------------------------------------- # Karma gain/loss # Default: 240 MinKarma = 240 # Default: 10000 MaxKarma = 10000 # The number to divide the xp recieved by to calculate karma lost on xp gain/loss. # Default: 260 XPDivider = 260 # The minimum karma lost if 0 karma is to be removed. # Default: 0 BaseKarmaLost = 0 # --------------------------------------------------------------------------- # PK'er Drop Settings # --------------------------------------------------------------------------- # Default: False CanGMDropEquipment = False # Warning: Make sure the lists do NOT CONTAIN # trailing spaces or spaces between the numbers! # List of pet items we cannot drop. # Default: 2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650 ListOfPetItems = 2375,3500,3501,3502,4422,4423,4424,4425,6648,6649,6650 # Lists of items which should NEVER be dropped (note, adena will # never be dropped) whether on this list or not # Default: 57,1147,425,1146,461,10,2368,7,6,2370,2369,6842,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,7694,8181,5575,7694,9388,9389,9390 ListOfNonDroppableItems = 57,1147,425,1146,461,10,2368,7,6,2370,2369,6842,6611,6612,6613,6614,6615,6616,6617,6618,6619,6620,6621,7694,8181,5575,7694,9388,9389,9390 # Default: 6 MinimumPKRequiredToDrop = 6 # --------------------------------------------------------------------------- # Misc. # --------------------------------------------------------------------------- # Should we award a pvp point for killing a player with karma? # Default: False AwardPKKillPVPPoint = False # How much time one stays in PvP mode after hitting an innocent (in ms) # Default: 120000 PvPVsNormalTime = 120000 # Length one stays in PvP mode after hitting a purple player (in ms) # Default: 60000 PvPVsPvPTime = 60000
Also next time post in correct section.
-
Gl with your project, simple but looks normal... first thing no star wars i see from long time.
I don't like the website, it looks like... comics :D
Anyway GOOD LUCK!
-
Cool idia, i like the idia control things from website....
-
useless share, you can find all in net so... :)
For newbies yeah...
-
Add vote system & change template, this template is shared... you just modify it a little...
Anyway, good luck with your project...
-
Is it possible to post some proves?
-
spamming will not help you, reported.
-
sorry for duble post but can somebody answer to my topic please! :( :( :(
Well simple you need first to find 1 vote reward system, after that all you have to edit is source...
[search in google]
L2J SVN
Eclipse
Guide
How to Apply a patch
-
bump, if you are not going to put advertisting in error then remove it becouse i see more the error then the forum!
RESPONSE!
-
How we can increased our trade counts? I mean i made a trade with MixMaster and i tried to give him a trade count with all the proofs etc but i got an error.
The reason that i make that topic here and not on spam section is cuz i / we need a serious question and hope wont be spammed.
Well... i'm not sure if "Normal Users" can give trade count, but as a VIP i tried too... and it did worked but... noone approve them...
Anyway, someone should care of this becouse we should know is trusted and no...
-
DDoS
in Spam Topics
did everything that i know but still under ddos.
Smart people would just stop a net for a while to let the DDoSers tough that you are dead, just wait them stop...
-
DDoS
in Spam Topics
There are many ways to stop any kind of attacks, depends on your skills & knowlage...
If you are talking about "DDoS" & "DoS" & "Flood"
Or just pay some monkey protect you, if you can't do it yourself...
Also if you are on dedi hosted company, find one that offer "protections" it may be little expansive but... it worth...

[HELP] Open NPC with command [Reward +1]
in Request Server Development Help [L2J]
Posted
bump