Skip to content

Commit

Permalink
Merge branch 'master' into sunnyboy
Browse files Browse the repository at this point in the history
  • Loading branch information
EricSoftTM committed Jun 18, 2018
2 parents 642e1a6 + fbb3e80 commit e6f1632
Show file tree
Hide file tree
Showing 25 changed files with 504 additions and 91 deletions.
29 changes: 29 additions & 0 deletions bin/src/main/java/common/BroadcastMsg.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* This file is part of OrionAlpha, a MapleStory Emulator Project.
* Copyright (C) 2018 Eric Smith <[email protected]>
*
* 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 common;

/**
*
* @author Eric
*/
public class BroadcastMsg {
public static final byte
Notice = 0,
Alert = 1
;
}
34 changes: 34 additions & 0 deletions bin/src/main/java/common/GivePopularityRes.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* This file is part of OrionAlpha, a MapleStory Emulator Project.
* Copyright (C) 2018 Eric Smith <[email protected]>
*
* 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 common;

/**
*
* @author Eric
*/
public class GivePopularityRes {
public static final byte
Success = 0,
InvalidCharacterID = 1,
LevelLow = 2,
AlreadyDoneToday = 3,
AlreadyDoneTarget = 4,
Notify = 5,
UnknownError = -1
;
}
30 changes: 30 additions & 0 deletions bin/src/main/java/common/Request.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* This file is part of OrionAlpha, a MapleStory Emulator Project.
* Copyright (C) 2018 Eric Smith <[email protected]>
*
* 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 common;

/**
*
* @author Eric
*/
public class Request {
public static final byte
Normal = -1,
None = 0,
Excl = 1
;
}
47 changes: 47 additions & 0 deletions bin/src/main/java/common/WhisperFlags.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* This file is part of OrionAlpha, a MapleStory Emulator Project.
* Copyright (C) 2018 Eric Smith <[email protected]>
*
* 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 common;

/**
*
* @author Eric
*/
public class WhisperFlags {
public class WhisperFlag {
public static final byte
Location = 0x1,
Whisper = 0x2,
Request = 0x4,
Result = 0x8,
Receive = 0x10,
Blocked = 0x20
;
}

public static final byte
FindRequest = WhisperFlag.Request | WhisperFlag.Location,
ReplyRequest = WhisperFlag.Request | WhisperFlag.Whisper,

FindResult = WhisperFlag.Result | WhisperFlag.Location,
ReplyResult = WhisperFlag.Result | WhisperFlag.Whisper,
ReplyReceive = WhisperFlag.Receive | WhisperFlag.Whisper,
BlockedResult = WhisperFlag.Blocked | WhisperFlag.Whisper,

None = -1
;
}
30 changes: 30 additions & 0 deletions bin/src/main/java/common/user/UserEffect.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* This file is part of OrionAlpha, a MapleStory Emulator Project.
* Copyright (C) 2018 Eric Smith <[email protected]>
*
* 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 common.user;

/**
*
* @author Eric
*/
public class UserEffect {
public static final byte
LevelUp = 0,
SkillUse = 1,
SkillAffected = 2
;
}
77 changes: 74 additions & 3 deletions bin/src/main/java/game/field/FieldPacket.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/
package game.field;

import common.WhisperFlags;
import network.packet.LoopbackPacket;
import network.packet.OutPacket;

Expand All @@ -26,22 +27,92 @@
*/
public class FieldPacket {

/**
* The "block" packet to restrict users from transferring fields.
*
* In later versions of the game Nexon has types that display messages.
* However, this seems to just act as a "onExclRequest" type packet, which
* means it just resets the client's request and updates the last request
* time to the current time.
*
* @return The ignore field request packet
*/
public static OutPacket onTransferFieldReqIgnored() {
OutPacket packet = new OutPacket(LoopbackPacket.TransferFieldReqIgnored);
return packet;
}

public static OutPacket onBlowWeather(int itemID, String message) {
/**
* The blow weather packet that rains snow and displays a message to the map.
*
* @param weatherItemID The ItemID of the weather item (type 209)
* @param weatherMsg The message to display for the weather effect
*
* @return The weather packet
*/
public static OutPacket onBlowWeather(int weatherItemID, String weatherMsg) {
OutPacket packet = new OutPacket(LoopbackPacket.BlowWeather);
packet.encodeInt(itemID);
packet.encodeString(message);
packet.encodeInt(weatherItemID);
if (weatherItemID != 0) {//0 = DestroyWeather
packet.encodeString(weatherMsg);
}
return packet;
}

/**
* The weird message packet - displays yellow in chat the Name:Message.
* Oh, and it also renders the same Name:Message above the chat window.
*
* Since groups (buddy, party, guild, etc.) don't exist yet, and no types
* for BroadcastMsg exist for megaphones, my best guess is that Nexon uses
* this packet for megaphones in this client.
*
* @param characterName The name of the character
* @param message The message to display
*
* @return The message/megaphone packet
*/
public static OutPacket onGroupMessage(String characterName, String message) {
OutPacket packet = new OutPacket(LoopbackPacket.GroupMessage);
packet.encodeString(characterName);
packet.encodeString(message);
return packet;
}

/**
* The OnWhisper Packet for /find and Whispering purposes.
* Refer to WhisperFlags for the list of results that are used within
* this packet.
*
* @param flag The whisper flag to handle (@see common.WhisperFlags)
* @param find The target you're Whispering or Finding
* @param receiver Your character name
* @param msg The message to be sent
* @param location The targets location (only FieldID in this version)
* @param success If the user exists and is online/able to receive messages
*
* @return A whisper and/or find packet.
*/
public static OutPacket onWhisper(byte flag, String find, String receiver, String msg, int location, boolean success) {
OutPacket packet = new OutPacket(LoopbackPacket.Whisper);
packet.encodeByte(flag);
switch (flag) {
case WhisperFlags.ReplyReceive:
packet.encodeString(receiver);
packet.encodeString(msg);
break;
case WhisperFlags.ReplyResult:
packet.encodeString(find);
packet.encodeBool(success);
break;
case WhisperFlags.FindResult:
packet.encodeString(find);
packet.encodeInt(location);
break;
case WhisperFlags.BlockedResult:
packet.encodeString(find);
break;
}
return packet;
}
}
3 changes: 1 addition & 2 deletions bin/src/main/java/game/field/drop/DropPool.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
*/
package game.field.drop;

import common.Request;
import game.field.Field;
import game.field.FieldSplit;
import game.field.StaticFoothold;
import game.user.User;
import game.user.WvsContext;
import game.user.WvsContext.Request;
import game.user.stat.CharacterTemporaryStat;
import java.util.HashMap;
import java.util.Iterator;
Expand Down
10 changes: 3 additions & 7 deletions bin/src/main/java/game/field/life/LifePool.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@
*/
package game.field.life;

import common.Request;
import common.item.BodyPart;
import common.item.ItemType;
import common.user.CharacterStat.CharacterStatType;
import common.user.UserEffect;
import game.field.Field;
import game.field.FieldOpt;
import game.field.StaticFoothold;
import game.field.life.heapbase.CompareCtrlMax;
import game.field.life.heapbase.CompareCtrlMin;
Expand All @@ -32,14 +33,9 @@
import game.field.life.npc.Npc;
import game.field.life.npc.NpcTemplate;
import game.user.User;
import game.user.User.UserEffect;
import game.user.UserLocal;
import game.user.WvsContext;
import game.user.WvsContext.Request;
import game.user.skill.SkillAccessor;
import game.user.skill.SkillEntry;
import game.user.skill.SkillLevelData;
import game.user.skill.Skills;
import game.user.skill.Skills.Assassin;
import game.user.skill.Skills.Thief;
import java.awt.Point;
Expand Down Expand Up @@ -979,7 +975,7 @@ public boolean onUserAttack(User user, byte type, byte attackType, byte mobCount
}

if (mpSteal != 0) {
user.sendPacket(UserLocal.onEffect(UserEffect.SkillUse, mpStealSkill, 1));
user.onUserEffect(true, false, UserEffect.SkillUse, mpStealSkill, 1);
user.incMP(mpSteal, false);
user.sendCharacterStat(Request.None, CharacterStatType.MP);
}
Expand Down
2 changes: 1 addition & 1 deletion bin/src/main/java/game/miniroom/MiniRoom.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*/
package game.miniroom;

import common.Request;
import game.user.User;
import game.user.WvsContext.Request;
import network.packet.InPacket;

/**
Expand Down
2 changes: 1 addition & 1 deletion bin/src/main/java/game/miniroom/TradingRoom.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
*/
package game.miniroom;

import common.Request;
import common.item.ItemAccessor;
import common.item.ItemSlotBase;
import common.item.ItemType;
import common.user.CharacterStat.CharacterStatType;
import game.user.User;
import game.user.WvsContext.Request;
import game.user.item.BundleItem;
import game.user.item.ChangeLog;
import game.user.item.EquipItem;
Expand Down
4 changes: 2 additions & 2 deletions bin/src/main/java/game/script/ScriptSysFunc.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
*/
package game.script;

import common.BroadcastMsg;
import common.JobAccessor;
import common.Request;
import common.item.BodyPart;
import common.item.ItemAccessor;
import common.item.ItemSlotBase;
Expand All @@ -31,8 +33,6 @@
import game.field.portal.Portal;
import game.user.User;
import game.user.WvsContext;
import game.user.WvsContext.BroadcastMsg;
import game.user.WvsContext.Request;
import game.user.item.ChangeLog;
import game.user.item.ExchangeElem;
import game.user.item.Inventory;
Expand Down
Loading

0 comments on commit e6f1632

Please sign in to comment.