设为首页
加入收藏
联系本站
游戏秘籍 游戏文学游戏沙龙游戏攻略游戏资讯网游秘籍游戏战报私服学院游戏贴图
您的位置: 无限游戏 >> >> 私服学院 >> 天堂私服制作 >>
天堂私服制作热点
·天2服务端简略安装说明!
·在0.2里增加GM命令方法
·天堂II S级装备代码
·天堂2java服务端0.1+JAVA平台 +完整安装说明
·2000架设天2指南
·教你添加 B/A/S 级套装效果
·修改装备的简单方法
·职业,种族,属性!
·天堂2游戏不顺畅的解决方法
·人类战士部分技能代码
推荐广告

在0.2里增加GM命令方法

作者:      来源:     时间:2005-9-16 10:24:44




在0.2里增加GM命令方法(1) 在0.2里增加GM命令(example: .level ,.buy etc)……
文件: L2_Gameserver\ java\net\sf\l2j\gameserv\clientpacket\ Say2.java

/*
* $Header: /cvsroot/l2j/L2_Gameserver/java/net/sf/l2j/gameserver/
clientpackets/Say2.java,v 1.4 2004/07/04 11:09:02 l2chef Exp $
*
* $Author: l2chef $
* $Date: 2004/07/04 11:09:02 $
* $Revision: 1.4 $
* $Log: Say2.java,v $
* Revision 1.4 2004/07/04 11:09:02 l2chef
* commands removed.
* say is now only local
* shout and trade is global
*
* Revision 1.3 2004/06/29 22:55:35 l2chef
* tell and say works now. say is actually a server broadcast now
*
* Revision 1.2 2004/06/27 08:51:42 jeichhorn
* Added copyright notice
*
*
* 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 2, 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, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
* http://www.gnu.org/copyleft/gpl.html
*/
package net.sf.l2j.gameserver.clientpackets;

import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Logger;
import java.util.StringTokenizer;


import net.sf.l2j.gameserver.ClientThread;
import net.sf.l2j.gameserver.Connection;
import net.sf.l2j.gameserver.model.L2PcInstance;
import net.sf.l2j.gameserver.model.L2World;
import net.sf.l2j.gameserver.serverpackets.CreatureSay;
import net.sf.l2j.gameserver.serverpackets.TeleportToLocation;
import net.sf.l2j.gameserver.IdFactory;
import net.sf.l2j.gameserver.NpcTable;
import net.sf.l2j.gameserver.TradeController;
import net.sf.l2j.gameserver.model.L2BuyList;
import net.sf.l2j.gameserver.model.L2DoorInstance;
import net.sf.l2j.gameserver.model.L2NpcInstance;
import net.sf.l2j.gameserver.model.L2Object;
import net.sf.l2j.gameserver.serverpackets.BuyList;
import net.sf.l2j.gameserver.serverpackets.DoorInfo;
import net.sf.l2j.gameserver.serverpackets.DoorStatusUpdate;
import net.sf.l2j.gameserver.serverpackets.ItemList;
import net.sf.l2j.gameserver.serverpackets.NpcHtmlMessage;
import net.sf.l2j.gameserver.serverpackets.NpcInfo;
import net.sf.l2j.gameserver.serverpackets.StatusUpdate;
import net.sf.l2j.gameserver.serverpackets.UserInfo;
import net.sf.l2j.gameserver.templates.L2Npc;
/**
* This class ...
*
* @version $Revision: 1.4 $ $Date: 2004/07/04 11:09:02 $
*/
public class Say2 extends ClientBasePacket
{
private static final String _C__38_SAY2 = "[C] 38 Say2";
private static Logger _log = Logger.getLogger(Say2.class.getName());



public final static int ALL = 0;
public final static int SHOUT = 1;
public final static int TELL = 2;
public final static int PARTY = 3;
public final static int CLAN = 4;
public final static int PRIVATE_CHAT_PLAYER = 6; // used for petition
public final static int PRIVATE_CHAT_GM = 7; // used for petition
public final static int TRADE = 8;
public final static int GM_MESSAGE = 9;


/**
* packet type id 0x38
* format: cSd (S)
* @param decrypt
*/
public Say2(byte[] decrypt, ClientThread client) throws IOException
{
super(decrypt);
String text = readS();
int type = readD();
String target = null;
if (type == TELL)
{
target = readS();
}

_log.fine("Say type:"+type);

L2PcInstance activeChar = client.getActiveChar();
Connection con = client.getConnection();

try{ //if is not special command,it will be catch (to be a normal talk)
if (text.equals(".help"))
{
NpcHtmlMessage adminCommands = new NpcHtmlMessage(5);
StringBuffer html1 = new StringBuffer("<html><title>AdminCommands</title>");
html1.append("<body>");
html1.append("<br><a action=\"bypass -h spawn_monster\">spawn monster</a>");
// -> causes a 0x21 packet
html1.append("<br><a action=\"bypass -h come_here\">force target to move here</a>");
html1.append("<br><a action=\"bypass -h attack_me\">force target to attack</a>");
html1.append("<br><a action=\"bypass -h stats\">show statistics</a>");
html1.append("</body></html>");

adminCommands.setHtml(html1.toString());
con.sendPacket(adminCommands);
}
else if(text.startsWith(".teleport"))
在0.2里增加GM命令方法相关文章:
在0.2里增加GM命令方法相关软件:
分页:
共3页 首页 上一页 [1] [2] [3下一页 尾页>
特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员我们经快给予更正
[打印本页] [关闭窗口] 转载请注明来源:无限游戏网