Jump to content

Recommended Posts

Posted

πήγαινε εδώ: net.sf.l2j.gameserver.model.actor.instance;

 

κάνε ένα καινούργιο αρχείο με όνομα: L2SiegeInformerInstance.java

 

και βάλε μέσα τον παρακάτω κώδικα:

 

/*
* 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.model.actor.instance;

import net.sf.l2j.gameserver.ai.CtrlIntention;
import net.sf.l2j.gameserver.instancemanager.CastleManager;
import net.sf.l2j.gameserver.model.actor.L2Npc;
import net.sf.l2j.gameserver.model.entity.Castle;
import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
import net.sf.l2j.gameserver.network.serverpackets.MyTargetSelected;
import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.network.serverpackets.SiegeInfo;
import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
import net.sf.l2j.gameserver.network.serverpackets.ValidateLocation;
import net.sf.l2j.gameserver.templates.chars.L2NpcTemplate;
import net.sf.l2j.util.Rnd;

/**
* @author Debian
*
*/
public class L2SiegeInformerInstance extends L2Npc
{
        public L2SiegeInformerInstance(int objectId, L2NpcTemplate template)
        {
                super(objectId, template);
        }
        
        @Override
        public void onBypassFeedback(L2PcInstance activeChar, String command)
        {
                if (activeChar == null)
                {
                        return;
                }
                
                if (command.startsWith("giran")){
                        Castle castle = CastleManager.getInstance().getCastleById(3);
                        if (castle != null)
                                activeChar.sendPacket(new SiegeInfo(castle));}
                
                if (command.startsWith("aden")){
                        Castle castle = CastleManager.getInstance().getCastleById(5);
                        if (castle != null)
                                activeChar.sendPacket(new SiegeInfo(castle));}
                
                if (command.startsWith("goddard")){
                        Castle castle = CastleManager.getInstance().getCastleById(7);
                        if (castle != null)
                                activeChar.sendPacket(new SiegeInfo(castle));}
                
                if (command.startsWith("gludio")){
                        Castle castle = CastleManager.getInstance().getCastleById(1);
                        if (castle != null)
                                activeChar.sendPacket(new SiegeInfo(castle));}
        }
        
        @Override
        public void onAction(L2PcInstance activeChar)
        {
                if (this != activeChar.getTarget())
                {
                        activeChar.setTarget(this);
                        activeChar.sendPacket(new MyTargetSelected(getObjectId(), activeChar.getLevel() - getLevel()));
                        activeChar.sendPacket(new ValidateLocation(this));
                }
                else if (isInsideRadius(activeChar, INTERACTION_DISTANCE, false, false))
                {
                        SocialAction sa = new SocialAction(this, Rnd.get(8));
                        broadcastPacket(sa);
                        activeChar.setCurrentFolkNPC(this);
                        showHtmlWindow(activeChar);
                        activeChar.sendPacket(ActionFailed.STATIC_PACKET);
                }
                else
                {
                        activeChar.getAI().setIntention(CtrlIntention.AI_INTENTION_INTERACT, this);
                        activeChar.sendPacket(ActionFailed.STATIC_PACKET);
                }
        }
        
        private void showHtmlWindow(L2PcInstance activeChar)
        {
            NpcHtmlMessage debian = new NpcHtmlMessage(5);
            StringBuilder tb = new StringBuilder("");
                
            tb.append("<html><head><title>Siege Informer</title></head><body>");
            tb.append("<center>");
            tb.append("<img src=\"L2Font-e.replay_logo-e\" width=256 height=80>");
            tb.append("<br>");
            tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center>"); 
            tb.append("<br>");
            tb.append("<font color=\"FFAA00\">Siegable Castles</font>");
            tb.append("<br>");
            tb.append("</center>");
            tb.append("<center>");
            tb.append("<a action=\"bypass -h npc_" + getObjectId() + "_giran\">Giran</a><br>");
            tb.append("<a action=\"bypass -h npc_" + getObjectId() + "_aden\">Aden</a><br>");
            tb.append("<a action=\"bypass -h npc_" + getObjectId() + "_goddard\">Goddard</a><br>");
            tb.append("<a action=\"bypass -h npc_" + getObjectId() + "_gludio\">Gludio</a><br>");
            tb.append("</center>");
            tb.append("<center>");
            tb.append("<img src=\"l2ui_ch3.herotower_deco\" width=256 height=32 align=center>");
            tb.append("</center>");
            tb.append("</body></html>");
                
            debian.setHtml(tb.toString());
            activeChar.sendPacket(debian);
        }
}

 

μετά πήγαινε στην database, βρές ένα οποιοδήποτε npc και βάλε type L2SiegeInformer

 

P.S: Δεν είναι όλα τα castle, επειδή εγώ χρησιμοποιώ μόνο 4.

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

    • Hello, I'd like to share with you a web template of me. https://www.mediafire.com/file/cslzde4h89it91y/Shinemaker.rar/file    
    • I never touch client, but now i want to use lordanov shared interface, but when i use it my lobby background change. in loging screen shows this static image: https://ibb.co/QF47WDmC But if i click on RECORD normal lobby shows up https://ibb.co/tpsG6F3G any idea how to fix it? i been looking for a solution, this thing happen when i paste interface.u file i decompiled interface.u but no idea where to do changes... thanks in advance, and sorry for poor english,
    • 🎙️ 1/ Creators, meet your new favorite tool: Chord.fm Record. Enhance. Deliver. A fully AI-powered recording studio, right in your browser. 🎧 Whether you're a podcaster, interviewer, or team running remote interviews — this is your upgrade. 🎥 2/ Record high-quality audio & video effortlessly ✅ Up to 4K video ✅ Uncompressed WAV audio ✅ Network-proof performance ✅ Multi-participant recording ✅ AI-powered post-processing 💡 No more "can you hear me?" moments. 🔊 3/ Get individual tracks for every participant One of Chord.fm’s superpowers: 🎚️ Each speaker's audio/video is recorded and exported separately. Perfect for post-production: 🎛️ Clean edits 🎧 Custom audio mixes 🎙️ Noise isolation per track   🧠 4/ Let AI do the heavy lifting 💬 Auto-generated subtitles 📝 Transcriptions you can trust 🧾 Smart summarization of recordings 🔍 Keyword highlights & topics Turn raw content into share-ready material without lifting a finger. 🧰 5/ Built for creators who value quality 🎬 Audiograms from your voice 🎚️ Auto-leveling 🌐 Browser-based (no install) 📁 Local backups during recording ⏱️ Time-saving features everywhere Chord.fm isn’t a Zoom alternative — it’s a production studio. 🚀 6/ Ready to level up? If you’re creating podcasts, interviews, or async team content — Chord.fm is what you've been waiting for. 🆓 Start for free: https://chord.fm You won't look back.
  • 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