Pagina de start a forumului DarkneT DarkneT
Forum destinat Developeriilor
 
 FAQFAQ   CautareCautare   MembriMembri   GrupuriGrupuri   InregistrareInregistrare 
 ProfilProfil   Mesaje privateMesaje private   AutentificareAutentificare 

Interlude Buffer Instance

 
Creaza un subiect nou   Raspunde la subiect    Pagina de start a forumului DarkneT -> JAVA CODE
Subiectul anterior :: Subiectul urmator  
Autor Mesaj
Ombladon
Administrator, Head DEV
Administrator, Head DEV
Ombladon

Data inscrierii: 30/Aug/2007
Mesaje: 8

MesajTrimis: 02/09/2007 12:52    Titlul subiectului: Interlude Buffer Instance Raspunde cu citat (quote)

acest cod este facut de mine in scopul de a crea in buffer in interlude, fara sa folosim quest ptr a bufa
Codul:
Cod:
package net.sf.l2j.gameserver.model.actor.instance;

import java.util.StringTokenizer;

import net.sf.l2j.gameserver.datatables.SkillTable;
import net.sf.l2j.gameserver.model.L2Skill;
import net.sf.l2j.gameserver.model.L2Skill.SkillType;
import net.sf.l2j.gameserver.serverpackets.ActionFailed;
import net.sf.l2j.gameserver.templates.L2NpcTemplate;

/**
 * Interlude Buffer Instance
 *
 * @author  Ombladon
 */
public class L2GmBufferInstance extends L2FolkInstance
{
   public L2GmBufferInstance(int objectId, L2NpcTemplate template)
   {
      super(objectId, template);
   }
   

    public void onBypassFeedback(L2PcInstance player, String command)
    {
        player.sendPacket(new ActionFailed());

        StringTokenizer st = new StringTokenizer(command, " ");
        String actualCommand = st.nextToken(); // Get actual command

        if (actualCommand.equalsIgnoreCase("gmbuff"))
        {
           try
           {
              int skillId = Integer.parseInt(st.nextToken());
                  int skillLevel = Integer.parseInt(st.nextToken());
                  int adena = Integer.parseInt(st.nextToken());
              
                this.setTarget(player);
                L2Skill skill;

                try
                {
                    try
                    {
                        skill = SkillTable.getInstance().getInfo(skillId,skillLevel);
                       
                        player.destroyItemByItemId("L2GmBufferInstance", 57, adena, null, true);
                       
                        if (skill.getSkillType() == SkillType.SUMMON)
                            player.doCast(skill);
                        else
                            this.doCast(skill);
                    }
                    catch (Exception e)
                    {
                        player.sendMessage("L2GmBufferInstance: Invalid skill level!");
                    }
                }
                catch (Exception e)
                {
                    player.sendMessage("L2GmBufferInstance: Invalid skill!");
                }
                return;
              
           }
           catch (Exception e)
           {
              _log.warning("L2GmBufferInstance: Error while parsing bypass value");
              e.printStackTrace();
           }
        }

        super.onBypassFeedback(player, command);
    }

    public String getHtmlPath(int npcId, int val)
    {
        String pom = "";
        if (val == 0)
        {
           
            pom = "" + npcId;
        }
        else
        {
            pom = npcId + "-" + val;
        }

        return "data/html/gmbuffer/" + pom + ".htm";
    }
}

salavti aceasta fila cu numele: L2GmBufferInstance.Java

dak nu folositi eclipse va voi da si un server prebuild cu classul in el :P
dak folositi eclipse:java\net\sf\l2j\gameserver\model\actor\instance
_________________
L2J:
---------------------------------------------
Core DEV
Datapack DEV
Database Dev
Client modder
Sus
Vezi profilul utilizatorului Trimite mesaj privat Trimite un mesaj
Afiseaza mesajele pentru a le previzualiza:   
Creaza un subiect nou   Raspunde la subiect    Pagina de start a forumului DarkneT -> JAVA CODE Ora este GMT + 2 ore
Pagina 1 din 1

Mergi direct la:  

Nu puteti crea un subiect nou in acest forum
Nu puteti raspunde in subiectele acestui forum
Nu puteti modifica mesajele proprii din acest forum
Nu puteti sterge mesajele proprii din acest forum
Nu puteti vota in chestionarele din acest forum


Powered by phpBB © 2001 phpBB Group
Fa-ti si tu propriul forum GRATUIT, pe www.myforum.ro

Chronicles phpBB2 theme by Jakob Persson (http://www.eddingschronicles.com). Stone textures by Patty Herford.