Jump to content
  • 0

Help With Item


Question

Posted (edited)

Hello guys i made a item

l3zPblQ.png



i want  to make it when some one double click on it to give 500 reputation points to his clan

how can i do that ? i have no idea really! help me out please ! thanks!


and something else, im searching for A Sub class master npc in which you can choose any subclass available. but i cant find any

you know all these npcs in one

8cUDsNe.png


can i make one? how?  i use l2jfrozen


thanks for your time

Edited by Stev0

15 answers to this question

Recommended Posts

  • 0
Posted (edited)

So, just make 2 new configs like

REQUIRED_ITEM = your id
REQUIRED_AMOUNT = 5000

and replace them in the code here

if st.getPlayer().isClanLeader() and st.getPlayer().getClan().getLevel() >= 5 and st.getPlayer().getClan().getReputationScore() < NEW_REP_SCORE :
if st.getPlayer().isNoble() and count > REQUESTED_AMOUNT:
htmltext=event
st.getPlayer().getClan().setReputationScore(NEW_REP_SCORE, 5000);
st.playSound("ItemSound.quest_finish")
st.takeItems(REQUESTED_ITEM,REQUESTED_AMOUNT)

REQUESTED_TEM / REQUESTED_AMOUNT => REQUIRED_ITEM / REQUIRED_AMOUNT

 

 

Should work :P

Edited by SweeTs
  • 0
Posted (edited)

Depend what pack he use. There may be not such config. Anyway.

 

About clan rep item. You have to create new item handler

/*
 * This program is free software: you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License along with
 * this program. If not, see <http://www.gnu.org/licenses/>.
 */
package net.sf.l2j.gameserver.handler.itemhandlers;

import net.sf.l2j.gameserver.handler.IItemHandler;
import net.sf.l2j.gameserver.model.L2ItemInstance;
import net.sf.l2j.gameserver.model.actor.L2Playable;
import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
import net.sf.l2j.gameserver.network.serverpackets.MagicSkillUse;

public class ClanItem implements IItemHandler
{
    @Override
    public void useItem(L2Playable playable, L2ItemInstance item, boolean forceUse)
    {
        if (!(playable instanceof L2PcInstance))
            return;
        
        final L2PcInstance activeChar = (L2PcInstance) playable;
        
        if (activeChar.getClan() == null)
            return;
        
        if (!activeChar.isClanLeader())
        {
            activeChar.sendMessage("Only clan leader can use it.");
            return;
        }
        
        activeChar.getClan().addReputationScore(500);
        activeChar.getClan().broadcastClanStatus();
        activeChar.sendMessage("Your clans reputation score has been increased.");
        MagicSkillUse MSU = new MagicSkillUse(activeChar, activeChar, 2024, 1, 1, 0);
        activeChar.broadcastPacket(MSU);
        activeChar.destroyItem("Consume", item.getObjectId(), 1, null, true);
    }
}

Then register it inside Itemhandler.java

 

Go to xml folder, to the item that you want and change its handler to ClanItem.

Edited by SweeTs
  • 0
Posted

i use l2jfrozen


and sweets how do i make a new item handler? im a newbie so i dont really understand the items i show on the pic its called "lord of the manor's certificate"(id 5708) something like that i just changed its name and description (about eclipse i dont know anything)

  • 0
Posted

So, use frozen forum. There is a patch @ frozen forum for sure. Also, Im award it's not implemented in sources, or maybe it is, dunno rly.

 

You must add new file at eclipse, gameserver.handler.itemhandlers; in here, you have create it.

  • 0
Posted

oh dude im not good with java ...

is it possible to make a npc which will give clan reputation points in exchange for some items like gold bars or something?

i have a clan manager in my pack but it only lvls up the clan to lvl 8
 

you know without using eclipse


any ideas?

  • 0
Posted (edited)

so im using a clan manager from a different pack and this npc can lvl up the clan and give clan reputations :-beep- yeah:

but i want to change this> when i want to lvl up the clan the requirements are 5k fire mantra
and when i want to get reputation the requirements are again 5k fire mantra     

so i want to change the requirements for clan reputation to be 2k water mantra if possible
it uses the same item ID for both things..

heres the code:
 

import sys
from com.l2jfrozen.gameserver.model.actor.instance import L2PcInstance
from com.l2jfrozen.gameserver.model.actor.instance import L2NpcInstance
from java.util import Iterator
from com.l2jfrozen.util.database import L2DatabaseFactory
from com.l2jfrozen.gameserver.model.quest import State
from com.l2jfrozen.gameserver.model.quest import QuestState
from com.l2jfrozen.gameserver.model.quest.jython import QuestJython as JQuest

qn = "6667_ClanManager"

NPC=[66667]
REQUESTED_ITEM=5574
REQUESTED_AMOUNT=5000
NEW_REP_SCORE=5000
QuestId     = 6667
QuestName   = "ClanManager"
QuestDesc   = "custom"
InitialHtml = "66667-1.htm"

print "Clan Manager (66667) Enabled..."

class Quest (JQuest) :

	def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr)

	def onEvent(self,event,st):
               htmltext = "<html><head><body>I have nothing to say you</body></html>"
               count=st.getQuestItemsCount(REQUESTED_ITEM)
               if event == "66667-clanOk.htm" :
                   if st.getPlayer().isClanLeader() and st.getPlayer().getClan().getLevel()<8:
                       if st.getPlayer().isNoble() and count >= REQUESTED_AMOUNT:
                            htmltext=event
                            st.getPlayer().getClan().changeLevel(8)
                            st.playSound("ItemSound.quest_finish")
                            st.takeItems(REQUESTED_ITEM,REQUESTED_AMOUNT)
                       else :
                            htmltext="66667-no_clan.htm"
                            st.exitQuest(1)
                   else :
                       htmltext="66667-no_clan.htm"
                       st.exitQuest(1)
               elif event == "66667-repOk.htm" :
                   if st.getPlayer().isClanLeader() and st.getPlayer().getClan().getLevel() >= 5 and st.getPlayer().getClan().getReputationScore() < NEW_REP_SCORE :
                       if st.getPlayer().isNoble() and count > REQUESTED_AMOUNT:
                            htmltext=event
                            st.getPlayer().getClan().setReputationScore(NEW_REP_SCORE, 5000);
                            st.playSound("ItemSound.quest_finish")
                            st.takeItems(REQUESTED_ITEM,REQUESTED_AMOUNT)
                       else :
                            htmltext="66667-no_points.htm"
                            st.exitQuest(1)
                   else :
                       htmltext="66667-no_points.htm"
                       st.exitQuest(1)
               return htmltext

	def onTalk (self,npc,player):
	   htmltext = "<html><head><body>I have nothing to say you</body></html>"
           st = player.getQuestState(qn)
           if not st : return htmltext
           npcId = npc.getNpcId()
           id = st.getState()
           if id == CREATED :
               htmltext="66667-1.htm"
           elif id == COMPLETED :
               htmltext = "<html><head><body>This quest have already been completed.</body></html>"
           else :
               st.exitQuest(1)
           return htmltext


QUEST = Quest(6667,qn,"custom")
CREATED     = State('Start', QUEST)
STARTING    = State('Starting', QUEST)
STARTED     = State('Started', QUEST)
COMPLETED   = State('Completed', QUEST)
QUEST.setInitialState(CREATED)

for npcId in NPC:
 QUEST.addStartNpc(npcId)
 QUEST.addTalkId(npcId)

please some1 help i need to fix this Thanks! :alone:

Edited by Stev0
  • 0
Posted (edited)

You already changed it

REQUESTED_ITEM=5574
REQUESTED_AMOUNT=5000

I don't get your problem :o

 

Btw, when you restart the server your clan lvl stay or get back to previous level or to 0 ?

 

Since..

st.getPlayer().getClan().changeLevel(8)

Should be setLevel and not change.. Anyway, that's broken pack, so everything is possible :happyforever:

 

 

Also, haha this code is funny :happyforever: :happyforever:

Edited by SweeTs
  • 0
Posted (edited)

nope the clan stays at lvl 8.
 

what i mean is that ,  this> "REQUESTED_ITEM=5574" its used for lvl up and rep points.  i want to change the clan rep to another id, or the lvl up to another item id so it doesnt take the same amount of the same item

when i want to lvl up the clan to take gold bars and when i want to get rep point to take ancient adena (i dont knwo how else to describe it)

first button lvl up clan = gold bars
second button rep points = ancient adena

sorry for my english (im still learning) :forever alone like a boss:

Edited by Stev0
  • 0
Posted

You say that you are not good with java.. but he already provided you with the code.. so what's the problem here? Just import it in your source and you'll be fine, it's really just 1 min job.

  • 0
Posted

clan manager fixed

now about the other thing the Sub class master npc in which you can choose any subclass available

how to make one ? or is there any a can download? (no luck with this npc cant be found)

Guest
This topic is now closed to further replies.


  • Posts

    • 🚀 L2JOne Website System — Features & Security Overview 📌 Overview The L2JOne Website System is a complete platform designed for Lineage 2 servers, providing account management, donation processing, game integration, automation tools, and advanced security protections.   Built with a focus on: Security Performance Automation Scalability Easy Administration 🎮 Player Features ✔ Account Registration Direct account creation from the website Game database integration Data validation Optional email verification Google reCAPTCHA protection ✔ Secure Login System Protected user sessions Automatic Session ID regeneration Session Fixation protection Secure logout ✔ Player Control Panel Ticket balance management Purchase history Transfer history Character selection Automatic item delivery ✔ Account Recovery Email-based recovery Temporary recovery tokens Automatic token expiration 💰 Donation System Supported Payment Gateways Mercado Pago PIX Credit Card Debit Card Stripe International credit cards PayPal Worldwide payments Binance Pay Cryptocurrency payments ⚡ Automated Credit Delivery Once a payment is confirmed: Gateway validates the transaction. Webhook signature is verified. Order is marked as completed. Credits are added to the player's balance. Player transfers credits to a character. Items are automatically delivered in-game. No manual intervention required. 🎁 Coupon System Percentage discounts Fixed value discounts Usage limits Expiration dates Minimum purchase requirements 🎟 Ticket System Internal virtual currency Item conversion system Administrative adjustments Full transaction history Balance management 📊 Administrative Dashboard Real-Time Statistics Total revenue Daily revenue New registrations Total purchases Pending payments Approved payments Reports Sales reports Financial reports Player activity reports Transfer history Interactive Charts Revenue growth Daily earnings Monthly earnings Visitors by country Payment distribution 🌍 Analytics System Visitor countries Browser statistics Operating systems Device tracking Access history 📰 News Management System Unlimited news posts Featured images HTML editor support Homepage highlights 🎥 Video & Streaming System Supports: YouTube Twitch Kick Custom stream embeds ⏳ Countdown System Launch countdown timer Configurable date and time Timezone support Homepage integration 📥 Download Center Fully configurable: Game Client Official Patch Mirror Downloads Torrent Downloads External Download Links 📱 Social Media Integration Discord Facebook Instagram Telegram YouTube 🔒 Security Layer CSRF Protection All forms include: Unique security tokens Mandatory validation Automatic expiration Protects against: Cross-Site Request Forgery (CSRF) Google reCAPTCHA Protection Integrated Google reCAPTCHA v3 Protects against: Bots Automated registrations Brute-force attacks Session Security Session ID regeneration HttpOnly cookies SameSite cookie protection Secure cookie support Protects against: Session hijacking Session fixation attacks Upload Protection Sensitive file types are blocked: .sql .sqlite .log .pem .key Directory Protection Direct access denied to: config/ private/ storage/ cli/ database/ Unauthorized access is blocked. Anti-Replay Protection Financial callbacks include: Signed timestamps Expiration windows One-time validation Protects against: Payment replay attacks Duplicate transaction processing Webhook Security HMAC signature validation Shared secret verification Mandatory request authentication Protects against: Fake payment notifications Fraudulent credit generation Duplicate Payment Prevention Built-in: Idempotency control Transaction reference validation Payment status verification Prevents: Double credits Repeated processing SQL Injection Protection Secure database layer using: PDO Prepared Statements Parameter Binding No unsafe SQL concatenation. XSS Protection Output sanitization through: HTML escaping Input filtering Protects against: Cross-Site Scripting (XSS) Session theft Licensing Protection Centralized licensing system with: Unique license key Unique secret key Remote validation Domain verification Heartbeat monitoring Anti-Cloning Protection Licenses are linked to: Authorized domain Unique credentials Central validation server Unauthorized domain usage can be automatically blocked. ⚙ Administrative Tools User Management Create accounts Edit accounts Suspend users Adjust balances Financial Management Approve transactions Cancel orders Financial reports Content Management News management Download management Video management Social media management Global Settings Rates configuration Countdown management Payment gateway settings License management 🚀 Technology Stack PHP 8+ MySQL 9+ / MariaDB 11+ Bootstrap 5.3.8 AdminLTE 4..0.2 Mercado Pago SDK Stripe SDK PayPal API Binance Pay API Google reCAPTCHA v3 PDO Secure Database Layer 🛡 Final Result The L2JOne Website System delivers a professional-grade solution for Lineage 2 servers, combining: ✅ Modern Administrative Dashboard ✅ Advanced Donation System ✅ Automatic In-Game Delivery ✅ Real-Time Statistics ✅ Centralized Licensing Platform ✅ Financial Fraud Protection ✅ SQL Injection Protection ✅ XSS Protection ✅ CSRF Protection ✅ Anti-Replay Security ✅ Anti-Cloning Protection A complete, secure, and scalable platform built for professional Lineage 2 server operations DEMO SITE: "My Site" - Lineage II I am currently studying programming in Trybe | Cursos de Inteligência Artificial e Tecnologia Price: 100 USDT Payment methods: Crypto using the Tron network or PayPal (you pay an administrative fee). You can choose to pay a monthly fee to get new features or stick with your current version with security updates! The maintenance fee is only 30 USDT per month. Customers currently using my website: http://www.l2shadowwars.com/
    • Fixed a lot of null crashes, damn vanganth 🤣 Added engine that you can create your custom quests Extender dungeon systen so u can create as many dungeons as you like       Possibility to create a server from scratch its possible just is the work + the license/month , many ask for the creation.. i can do everything u like, i can even implement UFOs to fly over gym so.. whatever your dream is i can be as close as possible!
    • Hello, it is someone here to help me to make multiskill on helios pack? ( Not stacksub ) i want. On Hi5 i have this config .   # When enabled, the following will be true: # All classes can learn all skills. # Skills of another class costs x2 SP to learn. # Skills of another race costs x2 SP to learn. # Skills of fighters/mages costs x3 SP to learn. # Default: False AltGameSkillLearn = True
    • Thank you Mobius, and thank you to everybody that has helped this project making it the easiest platform to work on even if new. GGZ
  • 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..