Jump to content

Recommended Posts

  • 2 months later...
  • 1 year later...
Posted (edited)

AMAZING man. Can you make it to be hero till character relog ? or only for 24 hours ? ( it will be nice if its posible to set time. )

And can you shere the code for Hero item. Once i played one server that you can get 1 hero coint that's make you hero for 24 hours . :)

Edited by MrJack_DeV
Posted

AMAZING man. Can you make it to be hero till character relog ? or only for 24 hours ? ( it will be nice if its posible to set time. )

And can you shere the code for Hero item. Once i played one server that you can get 1 hero coint that's make you hero for 24 hours . :)

about hero item,

 

 

// Hero Custom Item , Created By Stefoulis15
// Added From Stefoulis15 Into The Core.
// Visit www.MaxCheaters.com For Support 
// Source File Name:   HeroCustomItem.java
// Modded by programmos, sword dev
 
package com.l2jfrozen.gameserver.handler.itemhandlers;
 
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.util.logging.Level;
import java.util.logging.Logger;
 
import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.handler.IItemHandler;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
import com.l2jfrozen.gameserver.network.serverpackets.SocialAction;
import com.l2jfrozen.util.CloseUtil;
import com.l2jfrozen.util.database.L2DatabaseFactory;
 
public class HeroCustomItem implements IItemHandler
{
 
public HeroCustomItem()
{
//null
}
 
protected static final Logger _log = Logger.getLogger(HeroCustomItem.class.getName());
 
String INSERT_DATA = "REPLACE INTO characters_custom_data (obj_Id, char_name, hero, noble, donator, hero_end_date) VALUES (?,?,?,?,?,?)";
 
@Override
public void useItem(L2PlayableInstance playable, L2ItemInstance item)
{
if(Config.HERO_CUSTOM_ITEMS)
{
if(!(playable instanceof L2PcInstance))
return;
 
L2PcInstance activeChar = (L2PcInstance) playable;
 
if(activeChar.isInOlympiadMode())
{
activeChar.sendMessage("This Item Cannot Be Used On Olympiad Games.");
}
 
if(activeChar.isHero())
{
activeChar.sendMessage("You Are Already A Hero!.");
}
else
{
activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 16));
activeChar.setHero(true);
updateDatabase(activeChar, Config.HERO_CUSTOM_DAY * 24L * 60L * 60L * 1000L);
activeChar.sendMessage("You Are Now a Hero,You Are Granted With Hero Status , Skills ,Aura.");
activeChar.broadcastUserInfo();
playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
activeChar.getInventory().addItem("Wings", 6842, 1, activeChar, null);
}
activeChar = null;
}
}
 
@Override
public int[] getItemIds()
{
return ITEM_IDS;
}
 
private void updateDatabase(L2PcInstance player, long heroTime)
{
Connection con = null;
try
{
if(player == null)
return;
 
con = L2DatabaseFactory.getInstance().getConnection(false);
PreparedStatement stmt = con.prepareStatement(INSERT_DATA);
 
stmt.setInt(1, player.getObjectId());
stmt.setString(2, player.getName());
stmt.setInt(3, 1);
stmt.setInt(4, player.isNoble() ? 1 : 0);
stmt.setInt(5, player.isDonator() ? 1 : 0);
stmt.setLong(6, heroTime == 0 ? 0 : System.currentTimeMillis() + heroTime);
stmt.execute();
stmt.close();
stmt = null;
}
catch(Exception e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
 
_log.log(Level.SEVERE, "Error: could not update database: ", e);
}
finally
{
CloseUtil.close(con);
 
con = null;
}
}
 
private static final int ITEM_IDS[] =
{
Config.HERO_CUSTOM_ITEM_ID
};
 
}
Posted (edited)

 

about hero item,

// Hero Custom Item , Created By Stefoulis15
// Added From Stefoulis15 Into The Core.
// Visit www.MaxCheaters.com For Support 
// Source File Name:   HeroCustomItem.java
// Modded by programmos, sword dev
 
package com.l2jfrozen.gameserver.handler.itemhandlers;
 
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.util.logging.Level;
import java.util.logging.Logger;
 
import com.l2jfrozen.Config;
import com.l2jfrozen.gameserver.handler.IItemHandler;
import com.l2jfrozen.gameserver.model.actor.instance.L2ItemInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PcInstance;
import com.l2jfrozen.gameserver.model.actor.instance.L2PlayableInstance;
import com.l2jfrozen.gameserver.network.serverpackets.SocialAction;
import com.l2jfrozen.util.CloseUtil;
import com.l2jfrozen.util.database.L2DatabaseFactory;
 
public class HeroCustomItem implements IItemHandler
{
 
public HeroCustomItem()
{
//null
}
 
protected static final Logger _log = Logger.getLogger(HeroCustomItem.class.getName());
 
String INSERT_DATA = "REPLACE INTO characters_custom_data (obj_Id, char_name, hero, noble, donator, hero_end_date) VALUES (?,?,?,?,?,?)";
 
@Override
public void useItem(L2PlayableInstance playable, L2ItemInstance item)
{
if(Config.HERO_CUSTOM_ITEMS)
{
if(!(playable instanceof L2PcInstance))
return;
 
L2PcInstance activeChar = (L2PcInstance) playable;
 
if(activeChar.isInOlympiadMode())
{
activeChar.sendMessage("This Item Cannot Be Used On Olympiad Games.");
}
 
if(activeChar.isHero())
{
activeChar.sendMessage("You Are Already A Hero!.");
}
else
{
activeChar.broadcastPacket(new SocialAction(activeChar.getObjectId(), 16));
activeChar.setHero(true);
updateDatabase(activeChar, Config.HERO_CUSTOM_DAY * 24L * 60L * 60L * 1000L);
activeChar.sendMessage("You Are Now a Hero,You Are Granted With Hero Status , Skills ,Aura.");
activeChar.broadcastUserInfo();
playable.destroyItem("Consume", item.getObjectId(), 1, null, false);
activeChar.getInventory().addItem("Wings", 6842, 1, activeChar, null);
}
activeChar = null;
}
}
 
@Override
public int[] getItemIds()
{
return ITEM_IDS;
}
 
private void updateDatabase(L2PcInstance player, long heroTime)
{
Connection con = null;
try
{
if(player == null)
return;
 
con = L2DatabaseFactory.getInstance().getConnection(false);
PreparedStatement stmt = con.prepareStatement(INSERT_DATA);
 
stmt.setInt(1, player.getObjectId());
stmt.setString(2, player.getName());
stmt.setInt(3, 1);
stmt.setInt(4, player.isNoble() ? 1 : 0);
stmt.setInt(5, player.isDonator() ? 1 : 0);
stmt.setLong(6, heroTime == 0 ? 0 : System.currentTimeMillis() + heroTime);
stmt.execute();
stmt.close();
stmt = null;
}
catch(Exception e)
{
if(Config.ENABLE_ALL_EXCEPTIONS)
e.printStackTrace();
 
_log.log(Level.SEVERE, "Error: could not update database: ", e);
}
finally
{
CloseUtil.close(con);
 
con = null;
}
}
 
private static final int ITEM_IDS[] =
{
Config.HERO_CUSTOM_ITEM_ID
};
 
}

hmm i have add this code in 1 npc in my server (l2j freya) give the hero correct, config working but when restart hero disapear :(

 

The code: http://pastebin.com/brUdp6sx

 

photo from navicat : http://postimg.org/image/vvpgxwqq1/

Edited by nikosdevil20

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • Discord         :  utchiha_market Telegram        : https://t.me/utchiha_market Auto Buy Store  : https://utchiha-market.mysellauth.com/ Not sure if we’re legit? Check Our server — real reviews, real buyers https://discord.gg/uthciha-servicess  | https://campsite.bio/utchihaamkt
    • how can i write you the exact price if the price is constantly changing? you are fucking weird people HELLO EVERYONE. WE ARE SELLING A LOT OF ADENA ON L2 REBORN DISCORD - GODDARDSHOP   HURRY TO BUY OR YOU MAY NOT MAKE IT!!!
    • Marketing without structured promotion is like playing blind. Whether you're building a product, managing a brand, running a blog, developing a service, or launching a startup — visibility is one of the key success factors. No matter how good your project is, without traffic, reach, and engaged audiences, it simply won't reach the right people. ➡ In 2025, marketing is more than just advertising. It's about maintaining a consistent presence in the information space, working smartly with social media, content platforms, and audience feedback. And this process should be automated. Want more attention, reach, and traffic for your project? ➡ SocNet is a powerful and easy-to-use platform for promotion across top platforms. Who is it for? – Website, e-commerce store, and blog owners – Admins of Telegram channels, Discord servers, and communities – Content creators, streamers, and musicians – Marketers, agencies, and SMM professionals – Anyone building projects online Use our SMM Panel to boost Facebook, Instagram, Telegram, Spotify, SoundCloud, YouTube, Reddit, Threads, Kick, Discord, LinkedIn, Likee, VK, Twitch, Kwai, TikTok, Trustpilot, Apple Music, Tripadvisor, Snapchat, and more. Subscribers, likes, views, reposts, listens, live viewers, reactions, comments — everything you need. Get a $1 bonus for your first test run: Just submit a support ticket with the subject “Get Trial Bonus” on our website. ➡ Go to SMM Panel (clickable) or contact our bot support How to order: ➡ SMM Panel: Click ➡ Telegram bot version: Click (Menu ➡ SMM Panel) Our digital goods store: ➡ Online Store: Click ➡ Telegram Bot: Click Regular customers receive extra discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop You can also use these contacts to: — Inquire about wholesale pricing — Propose a partnership (Current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — your store for digital goods and premium subscriptions.
  • Topics

×
×
  • Create New...

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