Jump to content

Recommended Posts

Posted (edited)
Hello mate you do not have to buy it there is a working version of that shared here http://www.maxcheaters.com/topic/188957-vote-manager-npc/
i translate that for you and is realy simple to add it ..
 
we start::
head-src\com\l2jfrozen\gameserver\model\actor\instance\L2PcInstance.java
 
search
private static final String RESTORE_CHARACTER = 
and in the end ofcode we find (  aio,aio_end, )
 and we add
lastVoteHopzone, lastVoteTopzone, hasVotedHop, hasVotedTop, monthVotes, totalVotes, tries
then search
private long _lastTeleportAction = 0;
and down from there we put
private boolean _isVoting = false;


public final boolean isVoting()
{
return _isVoting;
}


public final void setIsVoting(boolean value)
{
_isVoting = value;
}
 private boolean hasVotedTop,hasVotedHop;




public boolean hasVotedBoth()


   {
       return hasVotedHop && hasVotedTop;
   }
   public void setHop(boolean target)
   {
       hasVotedHop=target;
   }
   public void setTop(boolean target)
   {
       hasVotedTop=target;
   }


private void loadVotes()
   {
       int flag=0;
       try (Connection con = L2DatabaseFactory.getInstance().getConnection())
       {
           PreparedStatement statement = con.prepareStatement("SELECT hasVotedTop FROM characters WHERE obj_Id=?");
           statement.setInt(1, getObjectId());
           ResultSet rset = statement.executeQuery();
           while (rset.next())
           {
               flag = rset.getInt("hasVotedTop");
           }
           if (flag == 1)
           {
               setTop(true);
           }
           else
           {
               setTop(false);
           }
       }
       catch (Exception e)
       {
          
           if (Config.DEVELOPER)
           {
               e.printStackTrace();
           }
       }
       flag=0;
       try (Connection con = L2DatabaseFactory.getInstance().getConnection())
       {
           PreparedStatement statement = con.prepareStatement("SELECT hasVotedHop FROM characters WHERE obj_Id=?");
           statement.setInt(1, getObjectId());
           ResultSet rset = statement.executeQuery();
           while (rset.next())
           {
               flag = rset.getInt("hasVotedHop");
           }
           if (flag == 1)
           {
               setHop(true);
           }
           else
           {
               setHop(false);
           }
       }
       catch (Exception e)
       {
          
           if (Config.DEVELOPER)
           {
               e.printStackTrace();
           }
       }
   }
then search
startWarnUserTakeBreak();
and we put down there:
loadVotes();
then we go on  head-src\com\l2jfrozen\Config.java
and search
public static int HERO_CUSTOM_DAY;
and we put down there 
public static String VOTE_LINK_HOPZONE;
public static String VOTE_LINK_TOPZONE;
public static int VOTE_REWARD_ID1;
public static int VOTE_REWARD_ID2;
public static int VOTE_REWARD_ID3;
public static int VOTE_REWARD_ID4;
public static int VOTE_REWARD_AMOUNT1;
public static int VOTE_REWARD_AMOUNT2;
public static int VOTE_REWARD_AMOUNT3;
public static int VOTE_REWARD_AMOUNT4;
public static int SECS_TO_VOTE;
public static int EXTRA_REW_VOTE_AM;

then we search for

HERO_CUSTOM_DAY = Integer.parseInt(L2JFrozenSettings.getProperty("HeroCustomDay", "0"));
and we put down there:
VOTE_LINK_HOPZONE = L2JFrozenSettings.getProperty("HopzoneUrl", "null");
VOTE_LINK_TOPZONE = L2JFrozenSettings.getProperty("TopzoneUrl", "null");
VOTE_REWARD_ID1 = Integer.parseInt(L2JFrozenSettings.getProperty("VoteRewardId1", "300"));
VOTE_REWARD_ID2 = Integer.parseInt(L2JFrozenSettings.getProperty("VoteRewardId2", "300"));
VOTE_REWARD_ID3 = Integer.parseInt(L2JFrozenSettings.getProperty("VoteRewardId3", "300"));
VOTE_REWARD_ID4 = Integer.parseInt(L2JFrozenSettings.getProperty("VoteRewardId4", "300"));
VOTE_REWARD_AMOUNT1 = Integer.parseInt(L2JFrozenSettings.getProperty("VoteRewardAmount1", "300"));
VOTE_REWARD_AMOUNT2 = Integer.parseInt(L2JFrozenSettings.getProperty("VoteRewardAmount2", "300"));
VOTE_REWARD_AMOUNT3 = Integer.parseInt(L2JFrozenSettings.getProperty("VoteRewardAmount3", "300"));
VOTE_REWARD_AMOUNT4 = Integer.parseInt(L2JFrozenSettings.getProperty("VoteRewardAmount4", "300"));
SECS_TO_VOTE = Integer.parseInt(L2JFrozenSettings.getProperty("SecondsToVote", "20"));
EXTRA_REW_VOTE_AM = Integer.parseInt(L2JFrozenSettings.getProperty("ExtraRewVoteAm", "20"));
then go  head-src\com\l2jfrozen\gameserver\GameServer.java
 
and find
 // Load GameServer Configs
        Config.load();
and we put down there:
VoteManager.load();
then go to gameserver\config\functions\l2jfrozen.properties
and we put everywhere we want 
# ------------------------------
# Vote System Ingame  -
# ------------------------------
HopzoneUrl = 
TopzoneUrl = 


# The characters will have a choice between 3 rewards.Set id for them
VoteRewardId1 = 6392
VoteRewardId2 = 6393
VoteRewardId3 = 4357


# Set the amount of each reward.
VoteRewardAmount1 = 1
VoteRewardAmount2 = 1
VoteRewardAmount3 = 30


# Set the seconds that the character has
# until he votes in the site's banners
SecondsToVote = 45


# Amount of votes a character must collect
# in order to get the 4th vote reward
ExtraRewVoteAm = 20


# Info of the extra reward item
VoteRewardId4 = 6673
VoteRewardAmount4 = 1

then we go to navicat and left click on Characters and we click on Design table

and we add
 
lastVoteHopzone bigint 20 0


lastVoteTopzone bigint 20 0


hasVotedHop int 10 0


hasVotedTop int 10 0


monthVotes int 10 0


totalVotes int 10 0


tries int 10 0
 
and now we must create a new npc and  (type)       L2VoteManager
Edited by L2LostWard

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • L2Virus the one who buyed those files from me.
    • Hi ️ Are you a supplier or do you have your own modem and are looking for a place to sell numbers?  SMS.PRO - The best option for selling your numbers  You choose the selling price yourself  Sale option: public (to everyone) or private (you choose who you want to sell to)  Everything works automatically  The simplest possible connection  Visit the website SMS.PRO and start selling your numbers.  Support @alismsorg_bot
    • Good luck to anyone playing on this server . Kamael items are bugged ( stats are insane ) Commands not working properly ( .getreward for example  ... gives u free reward without voting ). When i had those files , i fixed most of the stuff .   Every 2-3 years , he closes the server because players report bugs to him about items , he dont know how to fix then he repeating the process again https://ibb.co/Fkv7y9hJ https://ibb.co/fdYP2bVQ https://ibb.co/sp1f8C61 https://ibb.co/CKZnCgL7 https://ibb.co/Z6GktJgP  
    • Hello and welcome Server started 2026-01-05 Web site: https://l2dragonlands.eu Discrod: https://discord.gg/ngQUY8FB8G Rates >Xp x500 >Sp x500 >Drop x25 >Spoil x25 Enchant rates: Safe/max enchant +500  Blessed and simple scrolls max enchant (+200)  Enchant maneger to make +500.  In server items are progresed in tiers. Weapons: Starter > Vesper > Vorpal > Elegia > Ferrum. Armors: Starter > Moirai > Vesper > Vesper Noble > Vorpal > Elegia > Scarlet. Jewels: Starter > Vesper > Vorpal > Elegia > Ferrum. Cloaks: Pearl White > Pitch Black > Frintezza > Class Cloka > Hero > Scarlet. Acessories: Goblin Circlet 1/2lvl > Half Mask Mage 1/2lvl > Half Mask Fighter 1/2lvl > Flame of valakas > Gem Mask > Ferrum Helmet. Belt: Mithril Belt > Vitality Belt. Badges: For fighter and mage from 1lvl to 6lvl upgraded in order. Bracelets: Mithril > Shiny Fighter/Mage > 1/2lvl custom talismans in bracelest. Agathion: 7 tiers upgrade in order eatch one. Clan item shop/ New weapon Spadona upgradeble from 1lvl till 85lvl. Farm zones in order: >Giran Harbor > WasteLand > Gateway > Valley of Saints > Chromatic > Ruins of Despair > Soul Harbor > Dragon Valley. >LvL up zone >PvP zone Custom instance zone. Custom buff maneger it will grand big boost in stats. Lotery maneger to gamble. Extra features ALT+B: >Events  >Rankings  >Clan  >RB Status  >Updates and other Auto Event system: >Team VS Team event - Auto event  >Capture The Flag - Auto event Olympiad: >Retail olympiad game  >Competition period [2] week  >Olympiad start time [18:00] end [00:00]  >Maximum enchant in the Olympiad is +10, not custom items in olympiada only normal ones from shop.
    • L2 VOID - ADVERTISING BANNER   L2 FURY - ANIMATED BANNER   L2 HEROIC - ANIMATED BANNER   L2 WEED - ANIMATED BANNER   L2 REFORGE - ANIMATED LOGO   L2 WARZONE - ANIMATED LOGO   L2 ACME - SPLASH SCREEN   L2 DRUGS - ANIMATED BANNER   L2 GOLD - ADVERTISING BANNER   L2 AARON - ADVERTISING BANNER  
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock