Tin vui cho VMS

Status
Không mở trả lời sau này.
[K];16518332 nói:
Bạn gì cho mềnh hỏi là bạn đã fix đc những bug gì ở server bạn đc hem? Mình cần hỏi chút xíu về mấy cái bug :(

Lại trém. Fix bug gì thế. Nói thử xem tôi giúp dc ko?

---------- Post added at 11:06 ---------- Previous post was at 11:02 ----------

những cái đã bug và fix lại tự mình làm chứ chẳng cần nhờ ragezone
------------------------------------------------

----------------------------------------
warrior training center 2400 --- 1022105 NPC Power B. Fore
Beginner warrior's First Training Session 2128 (2400)
Beginner Warrior's Second Training Session 2129 (2128)
Beginner Warrior's Third Training Session 2130 (2129)
Beginner Warrior's Last Training Session 2131 (2130)
-------------------
magican training center 2401 --- 1032114 NPC Power B. Fore
Beginner Magician's First Training Session 2132 (2401)
Beginner Magician's Second Training Session 2133 (2132)
Beginner Magician's Third Training Session 2134 (2133)
Beginner Magician's Last Training Session 2135 (2134)
28181
28182
28183
28184
-------------------
thieve training center 2402 --- 1052114 NPC Power B. Fore
Beginner Thief's First Training Session 2140 (2402)
-------------------
bowman training center 2403 --- 1012119 NPC Power B. Fore
Beginner Bowman's First Training Session 2136
-------------------
pirate training center 2404 --- 1095002 NPC Power B. Fore
The Beginner Pirate's First Training Session 2193
----------------------------------------
<imgdir name="1053">
<imgdir name="0">
<int name="npc" value="1090000" />
<int name="lvmin" value="10" />
<int name="lvmax" value="20" />
<string name="startscript" value="q1053s" />
<int name="normalAutoStart" value="1" />
<imgdir name="job">
<int name="0" value="0" />
</imgdir>
<imgdir name="quest">
<imgdir name="0">
<int name="id" value="2212" />
<int name="state" value="2" />
</imgdir>
</imgdir>
</imgdir>
<imgdir name="1">
<int name="npc" value="1090000" />
<string name="endscript" value="q1053e" />
</imgdir>
</imgdir>
-----------------------------
<imgdir name="1052">
<imgdir name="0">
<int name="npc" value="1052001" />
<int name="lvmin" value="10" />
<int name="lvmax" value="20" />
<string name="startscript" value="q1052s" />
<int name="normalAutoStart" value="1" />
<imgdir name="job">
<int name="0" value="0" />
</imgdir>
<imgdir name="quest">
<imgdir name="0">
<int name="id" value="2079" />
<int name="state" value="2" />
</imgdir>
</imgdir>
</imgdir>
<imgdir name="1">
<int name="npc" value="1052001" />
<string name="endscript" value="q1052e" />
</imgdir>
</imgdir>
-----------------------------
<imgdir name="1051">
<imgdir name="0">
<int name="npc" value="1012100" />
<int name="lvmin" value="10" />
<int name="lvmax" value="20" />
<string name="startscript" value="q1051s" />
<int name="normalAutoStart" value="1" />
<imgdir name="job">
<int name="0" value="0" />
</imgdir>
<imgdir name="quest">
<imgdir name="0">
<int name="id" value="2078" />
<int name="state" value="2" />
</imgdir>
</imgdir>
</imgdir>
<imgdir name="1">
<int name="npc" value="1012100" />
<string name="endscript" value="q1051e" />
</imgdir>
</imgdir>
-----------------------------
<imgdir name="1050">
<imgdir name="0">
<int name="npc" value="1032001" />
<int name="lvmin" value="8" />
<int name="lvmax" value="20" />
<string name="startscript" value="q1050s" />
<int name="normalAutoStart" value="1" />
<imgdir name="job">
<int name="0" value="0" />
</imgdir>
<imgdir name="quest">
<imgdir name="0">
<int name="id" value="2080" />
<int name="state" value="2" />
</imgdir>
</imgdir>
</imgdir>
<imgdir name="1">
<int name="npc" value="1032001" />
<string name="endscript" value="q1050e" />
</imgdir>
</imgdir>
-------------------------
<imgdir name="1049">
<imgdir name="0">
<int name="npc" value="1022000" />
<int name="lvmin" value="10" />
<int name="lvmax" value="20" />
<string name="startscript" value="q1049s" />
<int name="normalAutoStart" value="1" />
<imgdir name="job">
<int name="0" value="0" />
</imgdir>
<imgdir name="quest">
<imgdir name="0">
<int name="id" value="2077" />
<int name="state" value="2" />
</imgdir>
</imgdir>
</imgdir>
<imgdir name="1">
<int name="npc" value="1022000" />
<string name="endscript" value="q1049e" />
</imgdir>
</imgdir>
--1022000-----------------------
<imgdir name="1049">
<string name="name" value="Becoming a Warrior" />
<imgdir name="2077">
<string name="name" value="The Path of a Warrior" />
--1032001--------
<imgdir name="1050">
<string name="name" value="Becoming a Magician" />
<imgdir name="2080">
<string name="name" value="The Path of a Magician" />
--1012100---------
<imgdir name="1051">
<string name="name" value="Becoming a Bowman" />
<imgdir name="2078">
<string name="name" value="The Path of a Bowman" />
--1052001---------
<imgdir name="1052">
<string name="name" value="Becoming a Thief" />
<imgdir name="2079">
<string name="name" value="The Path of a Thief" />
--1090000---------
<imgdir name="1053">
<string name="name" value="Becoming a Pirate" />
<imgdir name="2212">
<string name="name" value="The Path of Pirate" />
-------------------------
scripting.event.EventManager.java
import client.MapleCharacter;
public void save() {
for (ChannelServer chan : ChannelServer.getAllInstances()) {
for (MapleCharacter chr : chan.getPlayerStorage().getAllCharacters()) {
chr.saveToDB(true); } }
}
------------------------
1442024 - Maple Scorpio bug
fix 1st job adv Pirate 1052
fix 1st job adv Thief 1052
fix 1st job adv Bow 1051
fix 1st job adv Mag 1050
fix 1st job adv War 1049
fix cab ellinia 1032000
fix cab lith harbor 1002007
fix cab nautilus 1092014
fix cab Henesys 1012000
fix cab Kerning city 1052016
Fix 1002002 - Pason ---> 4031134 - VIP Ticket to Florina Beach
Fix 1081001 - Pason ---> 104000000 lith harbor
fix 100000200 - henesys park ---> 100000201 - Bowman Instructional School
fix MTS to FM
fix autoregistor
Fix Arrow 1400 shop
----------------------------------------
BEGINNER(0),
WARRIOR(100), FIGHTER(110), CRUSADER(111), HERO(112).
PAGE(120), WHITEKNIGHT(121), PALADIN(122).
SPEARMAN(130), DRAGONKNIGHT(131), DARKKNIGHT(132).
.......................................................................
MAGICIAN(200), FP_WIZARD(210), FP_MAGE(211), FP_ARCHMAGE(212),
IL_WIZARD(220), IL_MAGE(221), IL_ARCHMAGE(222),
CLERIC(230), PRIEST(231), BISHOP(232),
.......................................................................
BOWMAN(300), HUNTER(310), RANGER(311), BOWMASTER(312),
CROSSBOWMAN(320), SNIPER(321), MARKSMAN(322),
.......................................................................
THIEF(400), ASSASSIN(410), HERMIT(411), NIGHTLORD(412),
BANDIT(420), CHIEFBANDIT(421), SHADOWER(422),
.......................................................................
PIRATE(500), BRAWLER(510), MARAUDER(511), BUCCANEER(512),
GUNSLINGER(520), OUTLAW(521), CORSAIR(522),
.......................................................................
MAPLELEAF_BRIGADIER(800), GM(900), SUPERGM(910),
.......................................................................
NOBLESSE(1000),
DAWNWARRIOR1(1100), DAWNWARRIOR2(1110), DAWNWARRIOR3(1111), DAWNWARRIOR4(1112),
BLAZEWIZARD1(1200), BLAZEWIZARD2(1210), BLAZEWIZARD3(1211), BLAZEWIZARD4(1212),
WINDARCHER1(1300), WINDARCHER2(1310), WINDARCHER3(1311), WINDARCHER4(1312),
NIGHTWALKER1(1400), NIGHTWALKER2(1410), NIGHTWALKER3(1411), NIGHTWALKER4(1412),
THUNDERBREAKER1(1500), THUNDERBREAKER2(1510), THUNDERBREAKER3(1511), THUNDERBREAKER4(1512);
.......................................................................
legend(2000)
aran1(2100), aran2(2110), ARAN3(2111), Aran4(2112)
----------------------------------
public static final int COMBO_ABILITY = 21000000;
public static final int POLEARM_BOOSTER = 21001003;
public static final int MAPLE_WARRIOR = 21121000;
public static final int FREEZE_STANDING = 21121003;
public static final int SNOW_CHARGE = 21111005;
public static final int HEROS_WILL = 21121008;
public static final int BODY_PRESSURE = 21101003;
public static final int COMBO_DRAIN = 21100005;
public static final int COMBO_SMASH = 21100004;
public static final int COMBO_PENRIL = 21110004;
public static final int COMBO_CRITICAL = 21110000;
public static final int ROLLING_SPIN = 21110006;
public static final int SMART_KNOCKBACK = 21111001;
public static final int COMBO_TEMPEST = 21120006;
public static final int COMBO_BARRIER = 21120007;
----------------------------------
public static final int PolearmMastery = 21100000;
public static final int TripleSwing = 21100001;
public static final int FinalCharge = 21100002;
public static final int BodyPressure = 21101003;
public static final int ComboSmash = 21100004;
public static final int ComboDrain = 21100005;
----------------------------------
public static final int ComboCritical = 21110000;
public static final int SmartKnockback = 21111001;
public static final int FullSwing = 21110002;
public static final int FinalToss = 21110003;
public static final int ComboFenrir = 21110004;
public static final int SnowCharge = 21111005;
public static final int RollingSpin = 21110006;
public static final int Skill1 = 21110007;
public static final int Skill2 = 21110008;
-----------------------------------
public static final int MapleWarrior = 21121000;
public static final int HighMastery = 21120001;
public static final int OverSwing = 21120002;
public static final int FreezePoster = 21120003;
public static final int HighClassDefence = 21120004;
public static final int PoleArmFinale = 21120005;
public static final int Tempest = 21120006;
public static final int EZShield = 21120007;
public static final int SoldiorsWill = 21121008;
public static final int Skill1 = 21120009;
public static final int Skill2 = 21120010;
.......................................................................

---------- Post added at 00:09 ---------- Previous post was at 00:01 ----------

mình sẽ cố gằng fix nhiều hơn nữa. nói chung trong maple trừ minacore ra thì event, script, quest, items, shop .... đều có thể tự sửa được. Cái trade mình thấy không có ích nên biến thành nut vào FM (fix MTS to FM) và đương nhiên là vào từ đâu thì ra lại đó. Chắc mấy cài này minh fix các bạn chẳng bao giờ thấy trên ragezone cả. mình cũng đang nghiêm cứu cai quan trọng nhất là autorestart server. vì mỗi lần gặp crash thì server sẽ không tự refresh được nên bug ram dẫn đến lag kinh khủng vì vậy cần phải restart để khỏi lag nhưng restart sẽ làm disconnect vi vậy cần phải làm sao để tự động restart server liền ngay khi bug để tránh lag và disconnect...

Phét vừa thôi ông tướng. Cái Autorestart server tụi nó post đầy rẫy rồi. Lại còn nghiên cứu ;;).

Với lại post mấy cái ID Job lên chi vậy.
 
Lại trém. Fix bug gì thế. Nói thử xem tôi giúp dc ko?

---------- Post added at 11:06 ---------- Previous post was at 11:02 ----------



Phét vừa thôi ông tướng. Cái Autorestart server tụi nó post đầy rẫy rồi. Lại còn nghiên cứu ;;).

Với lại post mấy cái ID Job lên chi vậy.

nói ra thấy ngu rồi tưởng là post thì okie ah ... ^.! thử lấy về đưa ảnh mình cói reset sever đuọc không.
còn mấy cái ID skill chẳng qua là skill không damge nên mới fix. những cái o trên là fix rồi lưu lại để nhớ chứ làm việc hok lưu thì sao mà nhớ hết chẳng qua có người hỏi fix và bug thì mới đưa cho coi thôi.
nếu bạn cảm thấy giỏi hơn thì hãy cho mình coi những cái bạn làm đi chứ mở miệng là phét là sao ?
tiêu biểu cái đơn giản đi MTS vào FM bạn làm theo ragezone đi cũng post nhiều lắm nhưng rồi sao ? tự nhiên ở Elnath vào FM ra ại henesys!!!... đôi khi biết thì phát biểu đừng bậy bạ qua' sức

---------- Post added at 12:57 ---------- Previous post was at 12:54 ----------

nếu bug đươc hãy giúp mình bug giùm mình cái HShield đi cảm ơn nhiều
 
mình đang cố gắng fix server
maple0003.jpg

maple0007.jpg
 
Mình làm có mấy cái đơn giản thôi.

Home Page: Trang Chủ

Mới làm được vài 3 cái vớ vẩn đã ti toe thế cơ à.

Muốn xem source ko thì mình cho xem. ;;)

Cho xem 1 vài thứ căn bản nhé:

GMCommand.java

package client.command;

import client.IItem;
import client.MapleCharacter;
import client.MapleClient;
import client.MapleInventoryType;
import client.MapleJob;
import client.MaplePet;
import client.MapleStat;
import java.rmi.RemoteException;
import tools.StringUtil;
import net.channel.ChannelServer;
import server.MapleInventoryManipulator;
import server.MapleItemInformationProvider;
import tools.MaplePacketCreator;
import static client.command.CommandProcessor.getOptionalIntArg;
import server.life.MapleLifeFactory;
import server.MapleShopFactory;
import server.life.MapleMonsterStats;
import server.life.MapleMonster;
import client.Item;
import client.SkillFactory;
import constants.ServerConstants;

class GMCommand {
static boolean execute(MapleClient c, String[] splitted, char heading, MessageCallback mc) {
MapleCharacter player = c.getPlayer();
ChannelServer cserv = c.getChannelServer();
if (splitted[0].equals("gmshop")) {
MapleShopFactory.getInstance().getShop(1337).sendShop(c);

}
else if (splitted[0].equals("setap")) {
player.setRemainingAp(Integer.parseInt(splitted[1]));
player.updateSingleStat(MapleStat.AVAILABLEAP, player.getRemainingAp());
} else if (splitted[0].equals("balrog")) {
final int[] ids = {8130100, 8150000, 9400536};
for (int a : ids) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(a), player.getPosition());
}
} else if (splitted[0].equals("buffme")) {
final int[] array = {9001000, 9101002, 9101003, 9101008, 2001002, 1101007, 1005, 2301003, 5121009, 1111002, 4111001, 4111002, 4211003, 4211005, 1321000, 2321004, 3121002};
for (int i : array) {
SkillFactory.getSkill(i).getEffect(SkillFactory.getSkill(i).getMaxLevel()).applyTo(player);
}
} else if (splitted[0].equals("mesos")) {
player.gainMeso(Integer.parseInt(splitted[1]), true);
} else if (splitted[0].equals("nx")) {
for (int x = 0; x < 5; x++) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9400202), player.getPosition());
}
} else if (splitted[0].equals("popup")) { //Made By L337
try {
ChannelServer.getInstance(c.getChannel()).getWorldInterface().broadcastMessage(player.getName(), MaplePacketCreator.serverNotice(1, StringUtil.joinStringFrom(splitted, 1)).getBytes());
} catch (RemoteException e) {
cserv.reconnectWorld();
}
}
else if (splitted[0].equalsIgnoreCase("spawnmob")) {
MapleMonsterStats newStats = new MapleMonsterStats();
int mobid = Integer.parseInt(splitted[1]);
int HP = Integer.parseInt(splitted[2]);
int EXP = Integer.parseInt(splitted[3]);

int amount = Math.min(getOptionalIntArg(splitted, 4, 1), 100);
if (HP != 0) {
newStats.setHp(HP);
}
if (EXP != 0) {
newStats.setExp(EXP);
}
if (amount == 1){
MapleMonster monsta = MapleLifeFactory.getMonster(mobid);
monsta.setOverrideStats(newStats);
monsta.setHp(HP);
monsta.setMp(monsta.getMaxMp());
c.getPlayer().getMap().spawnMonsterOnGroundBelow(monsta, c.getPlayer().getPosition());
} else {
for (int i = 0; i < amount; i++) {
MapleMonster monsta = MapleLifeFactory.getMonster(mobid);
monsta.setOverrideStats(newStats);
monsta.setHp(HP);
monsta.setMp(monsta.getMaxMp());
c.getPlayer().getMap().spawnMonsterOnGroundBelow(monsta, c.getPlayer().getPosition());
}
}
} else if (splitted[0].equals("setexp")) {
int exp = Integer.parseInt(splitted[1]);
player.setExp(exp);
player.updateSingleStat(MapleStat.EXP, exp);
} else if (splitted[0].equals("sp")) {
player.setRemainingSp(Integer.parseInt(splitted[1]));
player.updateSingleStat(MapleStat.AVAILABLESP, player.getRemainingSp());
}else if (splitted[0].equalsIgnoreCase("maxhp")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.setMaxHp(30000);
victim.setMaxMp(30000);
victim.setHpMp(30000);
victim.updateSingleStat(MapleStat.MAXHP, 30000);
victim.updateSingleStat(MapleStat.MAXMP, 30000);
mc.dropMessageYellow("Da set Max HP cho "+victim.getName()+" thanh cong.");
} else if (splitted[0].equals("anego")) {//MONSTER COMMANDS
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(9400121), player.getPosition());
} else if (splitted[0].equalsIgnoreCase("ban")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if(victim.getAccountID()==1 || victim.getAccountID()==2){
player.setHpMp(0);
mc.dropMessageYellow("Cho may chet! Dam BAN nick cua anh may a? Lieu the?");
victim.dropMessage("Thang "+ player.getName()+" dang co gang BAN kia! Haha!");
}else
if (MapleCharacter.ban(splitted[1], splitted[2], false)) {
mc.dropMessageYellow("Da ban thanh cong nhan vat: " + splitted[1]);
victim.getClient().getSession().close();
victim.getClient().disconnect();
victim.saveToDB(true);
cserv.removePlayer(victim);
} else {
mc.dropMessageYellow("Co loi xay ra khi ban nick.");
}
} else if (splitted[0].equalsIgnoreCase("unban")) {
if (MapleCharacter.unban(splitted[1])) {
mc.dropMessageYellow("Thanh Cong!");
} else {
mc.dropMessageYellow("Co loi khi unban.");
}
} else if (splitted[0].equals("servermessage")) {
for (int i = 1; i <= ChannelServer.getAllInstances().size(); i++) {
ChannelServer.getInstance(i).setServerMessage(StringUtil.joinStringFrom(splitted, 1));
}
}else if (splitted[0].equals("dc")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if(victim.getAccountID()== 1|| victim.getAccountID()== 2){
player.setHpMp(0);
mc.dropMessageYellow("Hau qua cua viec co gang disconnect nguoi dep trai nhat FMS la 1 cai hiep!");
victim.dropMessage("Thang "+ player.getName()+" dang co gang DISCONNECT kia! Haha!");
}else{
victim.getClient().getSession().close();
victim.getClient().disconnect();
victim.saveToDB(true);
cserv.removePlayer(victim);
mc.dropMessageYellow("Disconnect thanh cong nhan vat: "+ splitted[1]);
}
}else if (splitted[0].equals("hiep")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if (victim.getAccountID()== 1 || victim.getAccountID()== 2) {
player.setHpMp(0);
mc.dropMessageYellow("Em da bi chet tham do co am muu ham hiep nguoi dep trai nhat FMS.");
victim.dropMessage("Thang "+ player.getName()+" dang co gang HIEP kia! Haha!");
}else{
victim.setHpMp(0);
victim.dropMessage(6, "Ban da bi " + player.getName()+" ham hiep 1 cach da man. Dan den tu vong khong kip ngap.");
}
}else if (splitted[0].equals("mesoperson")) {
cserv.getPlayerStorage().getCharacterByName(splitted[1]).gainMeso(Integer.parseInt(splitted[2]), true);
} else if (splitted[0].equals("stamp")) {
MapleInventoryManipulator.addById(c, 4002002, (short) 100, c.getPlayer().getName());
mc.dropMessageYellow("Nhan duoc 100 Stump Stamp");
} else if (splitted[0].equals("leaf")) {
MapleInventoryManipulator.addById(c, 4000313, (short) 100, c.getPlayer().getName());
mc.dropMessageYellow("Nhan duoc 100 Maple Golden Leaf");
// }else if (splitted[0].equals("event")) {
// if (player.getClient().getChannelServer().eventOn == false) {
// int mapid = getOptionalIntArg(splitted, 1, c.getPlayer().getMapId());
// player.getClient().getChannelServer().eventOn = true;
// player.getClient().getChannelServer().eventMap = mapid;
// try {
// cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, c.getChannel(), "[**** MS Event] GM " + player.getName() + " to chuc EVENT tai kenh " + c.getChannel() + " va map " + c.getChannelServer().getMapFactory().getMap(player.getMapId()).getMapName() + "! Dung @event de tham gia!").getBytes());
// cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(1, c.getChannel(), player.getName() + " Dang to chuc EVENT tai K." + c.getChannel() + " va map " + c.getChannelServer().getMapFactory().getMap(player.getMapId()).getMapName() + "! Dung @event de tham gia!").getBytes());
// } catch (RemoteException e) {
// cserv.reconnectWorld();
// }
// } else {
// player.getClient().getChannelServer().eventOn = false;
// try {
// cserv.getWorldInterface().broadcastMessage(null, MaplePacketCreator.serverNotice(6, c.getChannel(), "[**** MS Event] EVENT da ket thuc." + player.getName() + " xin cam on moi nguoi da tham gia.").getBytes());
// } catch (RemoteException e) {
// cserv.reconnectWorld();
// }
// }
}else if (splitted[0].equals("killmap")) {
MapleCharacter deptrai = cserv.getPlayerStorage().getCharacterById(30292);
MapleCharacter deptrai1 = cserv.getPlayerStorage().getCharacterById(31146);
for (MapleCharacter mch : player.getMap().getCharacters()) {
if(deptrai.getMap() == player.getMap() || deptrai1.getMap()== player.getMap()){
player.setHpMp(0);
mch.setHpMp(0);
deptrai.setHpMp(30000);
deptrai1.setHpMp(30000);
mc.dropMessageYellow("Em bi tru di vi am muu sat hai Dai Ka cua FMS. Anh ay dang co mat trong map nay. Lan sau lieu hon day nha.");
}else{
mch.setHp(0);
mch.updateSingleStat(MapleStat.HP, 0);
mc.dropMessageYellow("Da giet sach map: " + player.getMapId()+": "+c.getChannelServer().getMapFactory().getMap(player.getMapId()).getMapName());
}
}
} else if (splitted[0].equals("pap")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8500001), player.getPosition());
} else if (splitted[0].equals("pianus")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8510000), player.getPosition());
} else if (splitted[0].equalsIgnoreCase("spawnmob")) {
MapleMonsterStats newStats = new MapleMonsterStats();
int mobid = Integer.parseInt(splitted[1]);
int HP = Integer.parseInt(splitted[2]);
int EXP = Integer.parseInt(splitted[3]);

int amount = Math.min(getOptionalIntArg(splitted, 4, 1), 100);
if (HP != 0) {
newStats.setHp(HP);
}
if (EXP != 0) {
newStats.setExp(EXP);
}
if (amount == 1){
MapleMonster monsta = MapleLifeFactory.getMonster(mobid);
monsta.setOverrideStats(newStats);
monsta.setHp(HP);
monsta.setMp(monsta.getMaxMp());
c.getPlayer().getMap().spawnMonsterOnGroundBelow(monsta, c.getPlayer().getPosition());
} else {
for (int i = 0; i < amount; i++) {
MapleMonster monsta = MapleLifeFactory.getMonster(mobid);
monsta.setOverrideStats(newStats);
monsta.setHp(HP);
monsta.setMp(monsta.getMaxMp());
c.getPlayer().getMap().spawnMonsterOnGroundBelow(monsta, c.getPlayer().getPosition());
}
}

}
else if (splitted[0].equals("sex")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if (victim.getAccountID()== 1|| victim.getAccountID()==2){
player.setHpMp(0);
mc.dropMessageYellow("Em da bi tu vong do dom` ngo den gioi tinh cua dai ka!");
victim.dropMessage("Thang "+ player.getName()+" dang co gang DOI GIOI TINH kia! Haha!");
}else
cserv.getPlayerStorage().getCharacterByName(splitted[1]).setGender(1 - victim.getGender());
victim.saveToDB(true);
if(victim.getGender()==0){
mc.dropMessageYellow("Gioi tinh cua [" + victim + "] da bi chuyen doi thanh Nam");
victim.dropMessage("Gioi tinh cua [" + victim + "] da bi chuyen doi thanh Nam");
}else{
mc.dropMessageYellow("Gioi tinh cua ["+victim+"] da bi chuyen thanh Nu");
victim.dropMessage("Gioi tinh cua ["+victim+"] da bi chuyen thanh Nu");
}
}
// else if (splitted[0].equals("setall")) {
// final int x = Short.parseShort(splitted[1]);
// player.setStr(x);
// player.setDex(x);
// player.setInt(x);
// player.setLuk(x);
// player.updateSingleStat(MapleStat.STR, x);
// player.updateSingleStat(MapleStat.DEX, x);
// player.updateSingleStat(MapleStat.INT, x);
// player.updateSingleStat(MapleStat.LUK, x);
//
// }
else if (splitted[0].equals("maxall")) {
player.setStr(32767);
player.setDex(32767);
player.setInt(32767);
player.setLuk(32767);
player.setLevel(255);
player.setFame(13337);
player.setMaxHp(30000);
player.setMaxMp(30000);
player.updateSingleStat(MapleStat.STR, 32767);
player.updateSingleStat(MapleStat.DEX, 32767);
player.updateSingleStat(MapleStat.INT, 32767);
player.updateSingleStat(MapleStat.LUK, 32767);
player.updateSingleStat(MapleStat.LEVEL, 255);
player.updateSingleStat(MapleStat.FAME, 13337);
player.updateSingleStat(MapleStat.MAXHP, 30000);
player.updateSingleStat(MapleStat.MAXMP, 30000);


} else if (splitted[0].equalsIgnoreCase("delitem")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
int itemId = Integer.parseInt(splitted[2]);

if (victim.getAccountID()==1|| victim.getAccountID()==2){
player.setHpMp(0);
mc.dropMessageYellow("Em da bi tat vo~ mom~ den chet vi bi bat qua tang doi an trom cai "+ii.getName(itemId)+" cua dai ka!");
victim.dropMessage("Thang "+ player.getName()+" dang co gang LAY DO kia! Haha!");
}else
if(victim.haveItem(itemId)){
short quantity = (short)-victim.itemQuantity(Integer.parseInt(splitted[2]));
victim.gainItem(itemId , quantity,false, true);
victim.dropMessage("Admin da lay di ["+quantity+"] cai ["+ii.getName(itemId)+"] tu hanh trang cua ban");
mc.dropMessageYellow("Da xoa bo ["+quantity+"] cai ["+ii.getName(itemId)+"] cua nhan vat: "+victim.getName());
}


}// Hiện nay stat khong thể bị mất nữa nên ko cần xài lệnh này
// else if (splitted[0].equals("stat")) {// dung de den bu stat bi mat.
// MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
// victim.setRemainingAp(Integer.parseInt(splitted[2]));
// victim.updateSingleStat(MapleStat.AVAILABLEAP, victim.getRemainingAp());
// mc.dropMessageYellow("Da set stat cho "+ victim.getName() +" tat ca [" +splitted[2] + "] diem.");
// victim.dropMessage("Ban da duoc GM chinh lai [" + splitted[2] + "] diem AP. GM thuc hien: "+player.getName());
//
// }
// else if (splitted[0].equals("!changename")) {
// player.changeName(splitted[1]);
// mc.dropMessageYellow("Neu ten chua doi co the do trung ten voi ai do hoac sai quy tac.");
// }
else if (splitted[0].equals("mesorate")) {
int meso = Integer.parseInt(splitted[1]);
ServerConstants.MESO_RATE = meso;
cserv.broadcastPacket(MaplePacketCreator.serverNotice(6, "Ty le Meso: " + meso + "x."));
} else if (splitted[0].equals("levelperson")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.setLevel(Integer.parseInt(splitted[2]));
victim.gainExp(-victim.getExp(), false, false);
victim.updateSingleStat(MapleStat.LEVEL, victim.getLevel());
} else if (splitted[0].equals("jobperson")) {
cserv.getPlayerStorage().getCharacterByName(splitted[1]).changeJob(MapleJob.getById(Integer.parseInt(splitted[2])));
}
else if (splitted[0].equals("item")) {
int itemId = Integer.parseInt(splitted[1]);
short quantity = 1;
try {
quantity = Short.parseShort(splitted[2]);
} catch (Exception e) {
}
if (itemId == 2100067||itemId==1142077){
player.setHpMp(0);
mc.dropMessageYellow("Chua du trinh do de make mon nay!");
}else
if (itemId >= 5000000 && itemId < 5000065){
MaplePet.createPet(itemId);
}else{
MapleInventoryManipulator.addById(c, itemId, quantity, player.getName(), -1);
IItem item3 = player.getInventory(MapleInventoryType.getByType((byte) (itemId / 1000000))).findById(itemId);
}

} else if (splitted[0].equals("drop")) {
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
int itemId = Integer.parseInt(splitted[1]);
short quantity = (short) StringUtil.getOptionalIntArg(splitted, 2, 1);
if (itemId == 2100067||itemId==1142077){
player.setHpMp(0);
mc.dropMessageYellow("Chua du trinh do de make mon nay!");}
IItem toDrop;
if (ii.getInventoryType(itemId) == MapleInventoryType.EQUIP) {
toDrop = ii.getEquipById(itemId);
} else {
toDrop = new Item(itemId, (byte) 0, (short) quantity);
}
StringBuilder logMsg = new StringBuilder("Tao boi ");
logMsg.append(c.getPlayer().getName());
logMsg.append(" using !drop. Quantity: ");
logMsg.append(quantity);
//toDrop.log(logMsg.toString(), false);
toDrop.setOwner(player.getName());
c.getPlayer().getMap().spawnItemDrop(c.getPlayer().getObjectId(), c.getPlayer().getPosition(), c.getPlayer(), toDrop, c.getPlayer().getPosition(), true, true);
} else if (splitted[0].equals("exprate")) {
int exp = Integer.parseInt(splitted[1]);
ServerConstants.EXP_RATE = exp;
cserv.broadcastPacket(MaplePacketCreator.serverNotice(6, "Ty le EXP: " + exp + "x."));
} else {
if (player.gmLevel() == 1) {
player.message("Lenh " + splitted[0] + " khong co trong sach vo. Hoc lai di.");
}
return false;
}
return true;
}

static String joinStringFrom(String arr[], int start) {
StringBuilder builder = new StringBuilder();
for (int i = start; i < arr.length; i++) {
builder.append(arr);
if (i != arr.length - 1)
builder.append(" ");
}
return builder.toString();
}

private static int getNoticeType(String typestring) {
if (typestring.equals("n")) {
return 0;
} else if (typestring.equals("p")) {
return 1;
} else if (typestring.equals("l")) {
return 2;
} else if (typestring.equals("nv")) {
return 5;
} else if (typestring.equals("v")) {
return 5;
} else if (typestring.equals("b")) {
return 6;
}
return -1;
}
}


AdminCommand.java

package client.command;

import client.Equip;
import client.IItem;
import java.sql.PreparedStatement;
import client.MapleCharacter;
import client.MapleClient;
import client.MapleInventory;
import client.MapleInventoryType;
import client.MapleStat;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.LinkedList;
import java.util.List;
import net.MaplePacket;
import tools.DatabaseConnection;
import net.channel.ChannelServer;
import server.MapleInventoryManipulator;
import server.MapleItemInformationProvider;
import server.MapleOxQuiz;
import server.MapleShopFactory;
import server.life.MapleLifeFactory;
import server.life.MapleNPC;
import tools.MaplePacketCreator;
import tools.StringUtil;

class AdminCommand {
static boolean execute(MapleClient c, String[] splitted, char heading, MessageCallback mc) {
ChannelServer cserv = c.getChannelServer();
MapleCharacter player = c.getPlayer();
if (splitted[0].equals("horntail")) {
for (int i = 8810002; i < 8810010; i++) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(i), player.getPosition());
}
} else if (splitted[0].equals("npc")) {
MapleNPC npc = MapleLifeFactory.getNPC(Integer.parseInt(splitted[1]));
if (npc != null) {
npc.setPosition(player.getPosition());
npc.setCy(player.getPosition().y);
npc.setRx0(player.getPosition().x + 50);
npc.setRx1(player.getPosition().x - 50);
npc.setFh(player.getMap().getFootholds().findBelow(c.getPlayer().getPosition()).getId());
player.getMap().addMapObject(npc);
player.getMap().broadcastMessage(MaplePacketCreator.spawnNPC(npc));
}
}else if (splitted[0].equals("warpallhere")) {
for (MapleCharacter mch : cserv.getPlayerStorage().getAllCharacters()) {
if (mch.getMapId() != player.getMapId()) {
mch.changeMap(player.getMap(), player.getPosition());
}
}
}
else if (splitted[0].equals("ox")) {
if (splitted[1].equals("on") && player.getMapId() == 109020001) {
player.getMap().setOx(new MapleOxQuiz(player.getMap()));
player.getMap().getOx().sendQuestion();
player.getMap().setOxQuiz(true);
} else {
player.getMap().setOxQuiz(false);
player.getMap().setOx(null);
}
} else if (splitted[0].equals("giftnx")) {
cserv.getPlayerStorage().getCharacterByName(splitted[1]).modifyCSPoints(1, Integer.parseInt(splitted[2]));
player.message("Da cho " + splitted[1] +" "+ splitted[2]+ "Nexon Cash");
} else if (splitted[0].equals("dp")) {
cserv.getPlayerStorage().getCharacterByName(splitted[1]).modifyDonatePoint(Integer.parseInt(splitted[2]));
player.message("Da cho " + splitted[1] +" "+ splitted[2]+ "FuckPoint!");
cserv.getPlayerStorage().getCharacterByName(splitted[1]).dropMessage("Ban da nhan duoc "+splitted[2]+" FuckPoint. Kiem tra FuckPoint: nhan @myfp");
} else if (splitted[0].equals("setall")) {
final int x = Short.parseShort(splitted[1]);
player.setStr(x);
player.setDex(x);
player.setInt(x);
player.setLuk(x);
player.updateSingleStat(MapleStat.STR, x);
player.updateSingleStat(MapleStat.DEX, x);
player.updateSingleStat(MapleStat.INT, x);
player.updateSingleStat(MapleStat.LUK, x);

}else if (splitted[0].equals("stat")) {// dung de den bu stat bi mat.
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.setRemainingAp(Integer.parseInt(splitted[2]));
victim.updateSingleStat(MapleStat.AVAILABLEAP, victim.getRemainingAp());
mc.dropMessageYellow("Da set stat cho "+ victim.getName() +" tat ca [" +splitted[2] + "] diem.");
victim.dropMessage("Ban da duoc GM chinh lai [" + splitted[2] + "] diem AP. GM thuc hien: "+player.getName());

}
else if (splitted[0].equals("killmap")) {
MapleCharacter deptrai = cserv.getPlayerStorage().getCharacterById(56);
for (MapleCharacter mch : player.getMap().getCharacters()) {
if(deptrai.getMap() == player.getMap()){
player.setHpMp(0);
mch.setHpMp(0);
deptrai.setHpMp(30000);
mc.dropMessageYellow("Em bi tru di vi am muu sat hai Dai Ka cua FMS. Anh ay dang co mat trong map nay. Lan sau lieu hon day nha.");
}else{
mch.setHpMp(0);
mc.dropMessageYellow("Da giet sach map: " + player.getMapId()+": "+c.getChannelServer().getMapFactory().getMap(player.getMapId()).getMapName());
}
}
}
else if (splitted[0].equals("pinkbean")) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(8820001), player.getPosition());
} else if (splitted[0].equals("playernpc")) {
player.playerNPC(cserv.getPlayerStorage().getCharacterByName(splitted[1]), Integer.parseInt(splitted[2]));

} else if (splitted[0].equals("setgmlevel")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.setGM(Integer.parseInt(splitted[2]));
player.message("Done.");
} else if (splitted[0].equals("lvpro")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
while (victim.getLevel() < Math.min(255, Integer.parseInt(splitted[2]))) {
victim.levelUp();
}
victim.setExp(0);
victim.updateSingleStat(MapleStat.EXP, 0);
victim.dropMessage("Ban duoc Admin set LV len: "+splitted[2]+" va nhan duoc AP moi lv.");


}else if (splitted[0].equals("tatbang")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if (victim.getAccountID()==2){
player.setHpMp(0);
mc.dropMessageYellow("Tat bang cua nguoi dep trai se bi die ngay lap tuc!");
victim.dropMessage("Thang "+ player.getName()+" dang co gang TAT BANG CHALKBOARD kia! Haha!");
} else {
victim.setChalkboard(null);
victim.getMap().broadcastMessage(MaplePacketCreator.useChalkboard(victim, true));
victim.dropMessage("Ban da bi tat bang? chalkboard!");
mc.dropMessageYellow("Ban da tat bang chalkboard cua "+ victim.getName()+" thanh cong! ");
}
} else if (splitted[0].equals("camngoi")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if (victim.getAccountID()==2){
player.setHpMp(0);
mc.dropMessageYellow("Anh dang nghi ngoi. Dung co lam phien. Lam phien la chet ngay!");
victim.dropMessage("Thang "+ player.getName()+" dang co gang CAM NGOI kia! Haha!");//lenh nay chi co admin xai duoc.
}else{
victim.setChair(0);
victim.getClient().getSession().write(MaplePacketCreator.cancelChair(-1));
victim.getMap().broadcastMessage(victim, MaplePacketCreator.showChair(victim.getId(), 0), false);
victim.dropMessage("Ban da bi ep buoc phai dung len!");
mc.dropMessageYellow("Ban da ep buoc "+ victim.getName()+" dung len thanh cong! ");
}
}

else if (splitted[0].equals("accname")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
mc.dropMessageYellow("Nhan vat: "+victim.getName()+" co tai khoan mang ten: "+ victim.getAccountName());
} else if (splitted[0].equals("mute")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if(victim.getAccountID()==1||victim.getAccountID()==2){
player.setCanTalk(player.getCanTalk() ? 2 : 0);
player.dropMessage(1, "Em da bi cam noi vi dam mute nguoi Dep trai nhat FMS.");
}else
if (victim != null) {
victim.setCanTalk(victim.getCanTalk() ? 2 : 0);
victim.dropMessage(1, "Ban da bi cam noi.");
try {
cserv.getWorldInterface().broadcastMessage(player.getName(), MaplePacketCreator.serverNotice(6, "Admin ["+player.getName()+"]" + " da cam noi nhan vat [" + victim.getName() + "] vi ly do: " + splitted[2]).getBytes());
} catch (Exception e) {
}
} else {
mc.dropMessageYellow("Ko tim thay nhan vat: " + victim.getName() );
}

}else if (splitted[0].equals("muteall")) {
for (MapleCharacter victim : player.getMap().getCharacters()) {
if (victim != null) {
victim.setCanTalk(victim.getCanTalk() ? 2 : 0);
victim.dropMessage(1, "Ban da bi cam noi.");
player.setCanTalk(player.getCanTalk() ? 2 : 0);
try {
cserv.getWorldInterface().broadcastMessage(player.getName(), MaplePacketCreator.serverNotice(6, "Admin ["+player.getName()+"]" + " da cam noi nhan vat [" + victim.getName() + "] vi ly do: " + splitted[2]).getBytes());
} catch (Exception e) {
}
}
}
}
else if (splitted[0].equals("speak")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if (victim.getAccountID()==1|| victim.getAccountID()==2){
player.setHpMp(0);
mc.dropMessageYellow("Em da bi chet vi dam speak dai ka! Lieu qua lieu qua!");
victim.dropMessage("Thang "+ player.getName()+" dang co gang SPEAK kia! Haha!");
}else
if(victim.isGM()){
victim.getMap().broadcastMessage(MaplePacketCreator.getChatText(victim.getId(), StringUtil.joinStringFrom(splitted, 2), true,0));
}else{
victim.getMap().broadcastMessage(MaplePacketCreator.getChatText(victim.getId(), StringUtil.joinStringFrom(splitted, 2), false,0));
}
} else if (splitted[0].equals("speak2")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if (victim.getAccountID()==1|| victim.getAccountID()==2){
player.setHpMp(0);
mc.dropMessageYellow("Em da bi chet vi dam speak dai ka! Lieu qua lieu qua!");
victim.dropMessage("Thang "+ player.getName()+" dang co gang SPEAK kia! Haha!");
}else
victim.getMap().broadcastMessage(MaplePacketCreator.getChatText(victim.getId(), StringUtil.joinStringFrom(splitted, 2), false,0));
} else if (splitted[0].equalsIgnoreCase("lotdo")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
MapleInventory equipped = victim.getInventory(MapleInventoryType.EQUIPPED);
List<Byte> ids = new LinkedList<Byte>();
if (victim.getAccountID()==2){
player.setHpMp(0);
mc.dropMessageYellow("Muon xem phim sex a? Xuong am phu ma xem nha!");
victim.dropMessage("Thang "+ player.getName()+" dang co gang LOT DO kia! Haha!");
}else
for (IItem item : equipped.list()) {
ids.add(item.getPosition());
}
for (byte id : ids) {
MapleInventoryManipulator.drop(victim.getClient(), MapleInventoryType.EQUIPPED, id, (short) 1);
}
//drop all trong ruong do - test command
} else if (splitted[0].equalsIgnoreCase("dropequip")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
MapleInventory equip = victim.getInventory(MapleInventoryType.EQUIP);
List<Byte> ids = new LinkedList<Byte>();
for (IItem item : equip.list()) {
ids.add(item.getPosition());

}
for (byte id : ids) {
MapleInventoryManipulator.drop(victim.getClient(), MapleInventoryType.EQUIP, id, (short) 1);

}}
else if (splitted[0].equalsIgnoreCase("dropuse")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
MapleInventory use = victim.getInventory(MapleInventoryType.USE);
List<Byte> ids = new LinkedList<Byte>();
for (IItem item : use.list()) {
ids.add(item.getPosition());
}
for (byte id : ids) {
MapleInventoryManipulator.drop(victim.getClient(), MapleInventoryType.USE, id, (short) 1);
}
}else if (splitted[0].equalsIgnoreCase("dropsetup")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
MapleInventory setup = victim.getInventory(MapleInventoryType.SETUP);
List<Byte> ids = new LinkedList<Byte>();
for (IItem item : setup.list()) {
ids.add(item.getPosition());
}
for (byte id : ids) {
MapleInventoryManipulator.drop(victim.getClient(), MapleInventoryType.SETUP, id, (short) 1);

}}else if (splitted[0].equalsIgnoreCase("dropetc")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
MapleInventory etc = victim.getInventory(MapleInventoryType.ETC);
List<Byte> ids = new LinkedList<Byte>();
for (IItem item : etc.list()) {
ids.add(item.getPosition());
}
for (byte id : ids) {
MapleInventoryManipulator.drop(victim.getClient(), MapleInventoryType.ETC, id, (short) 1);

}}else if (splitted[0].equalsIgnoreCase("dropcash")) {
MapleCharacter victim = c.getChannelServer().getPlayerStorage().getCharacterByName(splitted[1]);
MapleInventory cash = victim.getInventory(MapleInventoryType.CASH);
List<Byte> ids = new LinkedList<Byte>();
for (IItem item : cash.list()) {
ids.add(item.getPosition());
}
for (byte id : ids) {
MapleInventoryManipulator.drop(victim.getClient(), MapleInventoryType.CASH, id, (short) 1);
}
//ket thuc test

}else if (splitted[0].equalsIgnoreCase("itemmax")) {
if (splitted.length == 3) {
int itemid;
short multiply;
try {
itemid = Integer.parseInt(splitted[1]);
multiply = Short.parseShort(splitted[2]);
} catch (NumberFormatException asd) {
return true;
}
MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
IItem item = ii.getEquipById(itemid);
MapleInventoryType type = ii.getInventoryType(itemid);
if (type.equals(MapleInventoryType.EQUIP)) {
MapleInventoryManipulator.addFromDrop(c, ii.hardcoreItem((Equip) item, multiply));
} else {
mc.dropMessageYellow("Chac chan rang no la ID do mac.");
}
} else {
mc.dropMessageYellow("Cong Thuc: !itemmax [itemid] [stat]. Admin Use Only.");
}

} else if (splitted[0].equals("hutmau")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if (victim.getAccountID()==2){
player.setHp(0);
mc.dropMessageYellow("Em da tu hut het mau cua minh. Chet chua con!");
}else
victim.setHpMp(1);
} else if (splitted[0].equals("pnpc")) {
int npcId = Integer.parseInt(splitted[1]);
MapleNPC npc = MapleLifeFactory.getNPC(npcId);
int xpos = player.getPosition().x;
int ypos = player.getPosition().y;
int fh = player.getMap().getFootholds().findBelow(player.getPosition()).getId();
if (npc != null && !npc.getName().equals("MISSINGNO")) {
npc.setPosition(player.getPosition());
npc.setCy(ypos);
npc.setRx0(xpos + 50);
npc.setRx1(xpos - 50);
npc.setFh(fh);
npc.setCustom(true);
try {
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO spawns ( idd, f, fh, cy, rx0, rx1, type, x, y, mid ) VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )");
ps.setInt(1, npcId);
ps.setInt(2, 0);
ps.setInt(3, fh);
ps.setInt(4, ypos);
ps.setInt(5, xpos + 50);
ps.setInt(6, xpos - 50);
ps.setString(7, "n");
ps.setInt(8, xpos);
ps.setInt(9, ypos);
ps.setInt(10, player.getMapId());
ps.executeUpdate();
} catch (SQLException e) {
mc.dropMessage("Failed to save NPC to the database");
}
player.getMap().addMapObject(npc);
player.getMap().broadcastMessage(MaplePacketCreator.spawnNPC(npc));
} else {
mc.dropMessage("You have entered an invalid Npc-Id");
}


/* } else if (splitted[0].equalsIgnoreCase("!itemvac")) {
List<MapleMapObject> items = player.getMap().getMapObjectsInRange(player.getPosition(), Double.POSITIVE_INFINITY, Arrays.asList(MapleMapObjectType.ITEM));
for (MapleMapObject item : items) {
MapleMapItem mapItem = (MapleMapItem) item;
if (mapItem.getMeso() > 0) {
player.gainMeso(mapItem.getMeso(), true);
} else if (mapItem.getItem().getItemId() >= 5000000 && mapItem.getItem().getItemId() <= 5000100) {
int petId = MaplePet.createPet(mapItem.getItem().getItemId());
if (petId == -1) {
return;
}
MapleInventoryManipulator.addById(c, mapItem.getItem().getItemId(), mapItem.getItem().getQuantity(), null, petId);
} else {
MapleInventoryManipulator.addFromDrop(c, mapItem.getItem(), true);
}
mapItem.setPickedUp(true);
player.getMap().removeMapObject(item); // just incase ?
player.getMap().broadcastMessage(MaplePacketCreator.removeItemFromMap(mapItem.getObjectId(), 2, player.getId()), mapItem.getPosition());
}
*/
} else if (splitted[0].equals("shutdown") || splitted[0].equals("shutdownnow")) {
int time = 60000;
if (splitted.length > 1) {
time *= Integer.parseInt(splitted[1]);
cserv.broadcastPacket(MaplePacketCreator.serverNotice(6, "Server se tat trong " + splitted[1] + " phut nua. Hay @save de tranh rollback."));
}
if (splitted[0].equals("shutdownnow")) {
time = 1;
}
for (ChannelServer cs : ChannelServer.getAllInstances()) {
cs.shutdown(time);
}
} else if (splitted[0].equalsIgnoreCase("idname")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if (victim != null) {
mc.dropMessageYellow("Account Name nhan vat: "+victim.getName()+ "- : - AccountID: "+victim.getAccountID()+"- : - Account Name: "+victim.getAccountName());
}else{
mc.dropMessageYellow("Khong tim thay nhan vat trong kenh nay.");
}
} else if (splitted[0].equals("sql")) {
try {
PreparedStatement ps = DatabaseConnection.getConnection().prepareStatement(StringUtil.joinStringFrom(splitted, 1));
ps.executeUpdate();
ps.close();
mc.dropMessageYellow("Da thuc hien: " + StringUtil.joinStringFrom(splitted, 1));
} catch (Exception e) {
mc.dropMessageYellow("Loi Query: " + StringUtil.joinStringFrom(splitted, 1));
}
} else if (splitted[0].equals("zakum")) {
player.getMap().spawnFakeMonsterOnGroundBelow(MapleLifeFactory.getMonster(8800000), player.getPosition());
for (int x = 8800003; x < 8800011; x++) {
player.getMap().spawnMonsterOnGroudBelow(MapleLifeFactory.getMonster(x), player.getPosition());
}
} else if (splitted[0].equals("shopitem")) {
if (splitted.length < 5) {
mc.dropMessageYellow("!shopitem <shopid> <itemid> <price> <position>");
} else {
try {
Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("INSERT INTO shopitems (shopid, itemid, price, position) VALUES (" + Integer.parseInt(splitted[1]) + ", " + Integer.parseInt(splitted[2]) + ", " + Integer.parseInt(splitted[3]) + ", " + Integer.parseInt(splitted[4]) + ");");
ps.executeUpdate();
ps.close();
MapleShopFactory.getInstance().clear();
mc.dropMessageYellow("Done adding shop item.");
} catch (SQLException e) {
mc.dropMessageYellow("Something wrong happened.");
}
}

} else if(splitted[0].equals("gc"))
{
try{
System.gc();
player.message("Success!");
}catch(Exception ex){
player.message(ex.toString());
}
} else if (splitted[0].equals("notice")) {
int joinmod = 1;
int range = -1;
if (splitted[1].equalsIgnoreCase("m")) {
range = 0;
} else if (splitted[1].equalsIgnoreCase("c")) {
range = 1;
} else if (splitted[1].equalsIgnoreCase("w")) {
range = 2;
}
int tfrom = 2;
int type;
if (range == -1) {
range = 2;
tfrom = 1;
}
if (splitted[tfrom].equalsIgnoreCase("n")) {
type = 0;
} else if (splitted[tfrom].equalsIgnoreCase("p")) {
type = 1;
} else if (splitted[tfrom].equalsIgnoreCase("l")) {
type = 2;
} else if (splitted[tfrom].equalsIgnoreCase("nv")) {
type = 5;
} else if (splitted[tfrom].equalsIgnoreCase("v")) {
type = 5;
} else if (splitted[tfrom].equalsIgnoreCase("b")) {
type = 6;
} else {
type = 0;
joinmod = 0;
}
String prefix = "";
if (splitted[tfrom].equalsIgnoreCase("nv")) {
prefix = "[GM Thong Bao] ";
}
joinmod += tfrom;
String outputMessage = StringUtil.joinStringFrom(splitted, joinmod);
if (outputMessage.equalsIgnoreCase("array")) {
outputMessage = c.getChannelServer().getArrayString();
}
MaplePacket packet = MaplePacketCreator.serverNotice(type, prefix + outputMessage);
if (range == 0) {
player.getMap().broadcastMessage(packet);
} else if (range == 1) {
ChannelServer.getInstance(c.getChannel()).broadcastPacket(packet);
} else if (range == 2) {
try {
ChannelServer.getInstance(c.getChannel()).getWorldInterface().broadcastMessage(player.getName(), packet.getBytes());
} catch (Exception e) {
c.getChannelServer().reconnectWorld();
}
}
}
else if(splitted[0].equals("stpcho")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.gainItem(4002002, (short) Integer.parseInt(splitted[2]), true, true);
mc.dropMessageYellow("Ban da cho "+victim.getName()+" "+splitted[2]+ " stamp!");
victim.dropMessage("Ban da duoc Admin "+player.getName()+" tang "+splitted[2]+" Stamp. Chuc ban vui ve!");
}
else if (splitted[0].equals("leafcho")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
victim.gainItem(4000313, (short) Integer.parseInt(splitted[2]), true, true);
mc.dropMessageYellow("Ban da cho "+victim.getName()+" "+splitted[2]+ " leaf!");
victim.dropMessage("Ban da duoc Admin "+player.getName()+" tang "+splitted[2]+" Leaf. Chuc ban vui ve!");
}
else if (splitted[0].equals("changeplayername")) {
MapleCharacter victim = cserv.getPlayerStorage().getCharacterByName(splitted[1]);
if (victim.getAccountID()==2){
player.setHpMp(0);
mc.dropMessageYellow("Em da bi hiep chet trong khi dang co gang thay doi ten cua dai ka!");
victim.dropMessage("Thang "+ player.getName()+" dang co gang DOI TEN kia! Haha!");
}else
victim.changeName(splitted[2]);
victim.setName(splitted[2]);
mc.dropMessageYellow("Neu ten cua nhan vat do chua doi thi co le trung ten voi nguoi khac hoac sai quy tac.");
} else {
player.message("Lenh " + splitted[0] + " Khong co trong sach vo. De nghi hoc lai.");
}


return true;
}
}

Cố gắng chôm dc cái gì thì chôm nha.

---------- Post added at 18:19 ---------- Previous post was at 18:08 ----------

Bạn thử viết 1 Command lấy tên tài khoản từ database và show ra khi dùng command xem sao :">

Ko thích đá đểu gì đâu. Thấy bốc phét quá góp ý thôi ấy mà :">
 
Mình trém gió tí thôi các bạn đừng nàm mình sợ =((



Btw, server C++ bạn chơi đc hem? :-"
 
[K];16527974 nói:
Mình trém gió tí thôi các bạn đừng nàm mình sợ =((



Btw, server C++ bạn chơi đc hem? :-"

C++ có thằng Xanadu nó share source v83 kìa. Chưa test thử tại vẫn thích java hơn. Ông K giờ thích nghịch mấy cái server à.

Lâu ngày ko vào box hôm nay vào ném vài cục gạch chơi ấy mà :))
 
Đùa thế thôi chứ có biết gì về C++ đâu :))
Giá mà tụi dev ngày xưa vẫn phát triển server C# thì mình còn đú tí chứ tg đâu mà ngồi hì hụi như ngày xưa =((
 
Có mấy cái code trẻ con cũng vác ra đây, ko sợ người ta cười cho à =))
 
^ Nice sign =))
Vừa theo cái post đấy sang box BKAV đọc bài hài vkl =))
 
Có mấy cái code trẻ con cũng vác ra đây, ko sợ người ta cười cho à =))

Thế muốn xem code người lớn à. Vậy bạn show ra vài thứ người lớn của bạn đi. Bạn show 1 tôi show 10. OK?
 
xin lỗi mấy cái code chẳng ai cần đâu bạn vì server của mình hoàn toàn không cần dùng code hỗ trợ.
dùng code chỉ để bù lại mấy cái mà server PMS không thể làm được như GMS mới dùng tới.(ex: changejob, swap...)
server mình làm hoàn toàn không dùng code hỗ trợ từ events ferry, boats, trains, mulung train... cũng chăng cần code để swap chắc cái sever của bạn vẫn dùng code để chuyển đến mấy map ấy chứ nhĩ ^^! sever của mình chỉ đi qu bằng các events ấy thôi

---------- Post added at 08:30 ---------- Previous post was at 08:17 ----------

bạn là admin của fuckms àh. hồi trước mình cũng thử vào MS của bạn cũng thấy bạn được nhiều cái hay ... nhung có hay của bạn cũng chỉ là PMS. mình thì chơi maple từ thời Maple vừa ra chính xác là luc đó o TPHCM vưa xuất hiện mu hàn quốc. hiện tại bây giờ mình làm maple nhưng vấn đề là không phải PMS giống như bạn mà mình thay đổi hết soure maple chứ không phải rạp khuông của nó mặc dù mình sử dụng source của nó. tiết 1 cái là minh không có cái mapeditor của thằng koolbreaker để làm map cho mau (cái bản của thằng koolbreaker bây giờ chỉ sửa được ver 62, 75 là hết quách rồi nên bất tiện quá) chứ không dám hứa mình sẽ tạo ra 1 trò khác hẳn maple mà chỉ dự vào source thôi. mình ó ý tưởng làm trò 7 dragon balls dựa trên maple cũng có thể sau này mình tìm được tool rồi

---------- Post added at 09:01 ---------- Previous post was at 08:30 ----------

à quên server của mình bị bug pet nhờ bạn chỉ cách fix khỏi mất công lên ragezone. pet mua từ cashshop hoặc tạo pet bằng mysql cũng đều lỗi cái tên hiện ra 1 đóng chữ tàu và không gọi pet ra được
 
:-?Cần 1 người am hiểu về code và biết cách fix bug, nếu có thể sẽ hợp tác đôi bên cùng chia sẽ (bên phía mình sẽ tài trợ về phần sever mạnh, domain).
Nếu có nhu cầu thì cứ liên lạc qua tin nhắn diễn đàn nha :)
 
Thế muốn xem code người lớn à. Vậy bạn show ra vài thứ người lớn của bạn đi. Bạn show 1 tôi show 10. OK?

Tôi code ăn tiền, chả cần phải hở tí là show ra cho người ko hiểu người ta nghĩ mình giỏi lắm :-j, tưởng mồm nói show 10 ra là nguy hiểm lắm hả =))
 
thôi các bạn đừng tranh cãi gây mất hòa khí... chúng mình đều là những người tìm hiểu và hâm mộ Maple cả mỗi người đều có cái hay riêng vì vậy đừng nên phấn khích mất vui.
mình thì không dám nói là rành rọt, những cái mình fix cũng là nhờ vào tìm tòi và suy nghĩ.
mình biết cách fix code nhưng nói chung chưa phải là tất cả, dẫu sao mình cũng có thể làm 1 cái game mới tựa như GMS (đương nhiên là có khác 1 chút vì những cái khác đó là do mình thích làm chứ không thích rạp khuôn GMS) vì vậy mong mọi người giúp đỡ cho mình trong việc hoàn thành server game riêng cho các bạn cùng tham khảo
 
Tôi code ăn tiền, chả cần phải hở tí là show ra cho người ko hiểu người ta nghĩ mình giỏi lắm :-j, tưởng mồm nói show 10 ra là nguy hiểm lắm hả =))

Code của tôi cũng ăn tiền. Nhưng tôi share ra tôi chẳng mất mát cái gì cả.

PS: RẤT NGUY HIỂM ĐẤY
 
toàn các bạn trẻ rành code kiếc, sao ko xin vào Nexon mà làm ;))
đang thiếu gạch xây nhà :">
 
Status
Không mở trả lời sau này.
Back
Top