- Joined
- Jan 24, 2013
- Messages
- 77
- Reaction score
- 2
not working for v62 bubbles
not working for v62 bubbles
not working for v62 bubbles
Function names can vary between sources. Find out what my functions do, and then find the function on your source that does the same thing. Rename accordingly.
Is water made out of H2O? [COLOR=#333333]f
Snail's are level 1. t
etc...[/COLOR]
[COLOR=#333333]!AskOX <time> <questionLine[/COLOR][COLOR=#333333]Number[/COLOR][COLOR=#333333]>[/COLOR]
It is possible to randomize from a text file, code warp in and out, automate the events, etc. But I'll keep this simple so it's easier to add.
But about the text file method, only the server admin (or people who have access to the source) can make custom questions. Otherwise, normal GMs can't really do much.
final int timeLimit = Math.min(Math.max(Integer.parseInt(splitted[2]), 1), 60);
victim.getPosition().y <= -206
Oh you're right; completely forgot about that. I guess you'd have to have an online file or something, but that's something each owner can sort out.
I had a couple of questions:
PHP:final int timeLimit = Math.min(Math.max(Integer.parseInt(splitted[2]), 1), 60);
I had to read this line a few times to work of what was going on. Are you essentially creating a range of valid time inputs to be integers between 1-60?
PHP:victim.getPosition().y <= -206
What exactly is this range? Everything to the left (extreme) of the plat? What about the extreme right?
Thanks again!![]()
Math.min(Math.max(Integer.parseInt(splitted[2]), 1), 60)
timeLimit = number you keyed in
timeLimit = the bigger number of timeLimit and 1 (prevents you from setting the value to 0 and below)
timeLimit = the smaller number of timeLimit and 60 (prevents you from setting the value to 61 and above)
C:\Users\xxx\src\client\messages\commands\SuperGMCommand.java:1572: error: no suitable method found for changeMap(int,int)
c.getPlayer().changeMap(109020001, 0);
method MapleCharacter.changeMap(MapleMap,MaplePortal) is not applicable
(actual argument int cannot be converted to MapleMap by method invocation conversion)
method MapleCharacter.changeMap(MapleMap) is not applicable
(actual and formal argument lists differ in length)
method MapleCharacter.changeMap(MapleMap,Point) is not applicable
(actual argument int cannot be converted to MapleMap by method invocation conversion)
C:\Users\xxx\src\client\messages\commands\SuperGMCommand.java:1630: error: no suitable method found for changeMap(int,int)
victim.changeMap(100000000,0);
method MapleCharacter.changeMap(MapleMap,MaplePortal) is not applicable
(actual argument int cannot be converted to MapleMap by method invocation conversion)
method MapleCharacter.changeMap(MapleMap) is not applicable
(actual and formal argument lists differ in length)
method MapleCharacter.changeMap(MapleMap,Point) is not applicable
(actual argument int cannot be converted to MapleMap by method invocation conversion)
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
public void changeMapBanish(final int mapid, final String portal, final String msg) {
dropMessage(5, msg);
final MapleMap map = client.getChannelServer().getMapFactory().getMap(mapid);
changeMap(map, map.getPortal(portal));
}
public void changeMap(final MapleMap to, final Point pos) {
changeMapInternal(to, pos, CField.getWarpToMap(to, 0x80, this), null);
}
public void changeMap(final MapleMap to) {
changeMapInternal(to, to.getPortal(0).getPosition(), CField.getWarpToMap(to, 0, this), to.getPortal(0));
}
public void changeMap(final MapleMap to, final MaplePortal pto) {
changeMapInternal(to, pto.getPosition(), CField.getWarpToMap(to, pto.getId(), this), null);
}
public void changeMapPortal(final MapleMap to, final MaplePortal pto) {
changeMapInternal(to, pto.getPosition(), CField.getWarpToMap(to, pto.getId(), this), pto);
}
private void changeMapInternal(final MapleMap to, final Point pos, byte[] warpPacket, final MaplePortal pto) {
if (to.mapLocked() && gmLevel < 1) {
dropMessage(6, "There's a strong force holding you back. It seems that there's a battle going on!");
client.getSession().write(CWvsContext.enableActions());
return;
}
if (to == null) {
return;
}
final int nowmapid = map.getId();
if (eventInstance != null) {
eventInstance.changedMap(this, to.getId());
}
final boolean pyramid = pyramidSubway != null;
if (map.getId() == nowmapid) {
client.getSession().write(warpPacket);
final boolean shouldChange = !isClone() && client.getChannelServer().getPlayerStorage().getCharacterById(getId()) != null;
final boolean shouldState = map.getId() == to.getId();
if (shouldChange && shouldState) {
to.setCheckStates(false);
}
map.removePlayer(this);
if (shouldChange) {
map = to;
setPosition(pos);
to.addPlayer(this);
stats.relocHeal(this);
if (shouldState) {
to.setCheckStates(true);
}
}
}
if (pyramid && pyramidSubway != null) { //checks if they had pyramid before AND after changing
pyramidSubway.onChangeMap(this, to.getId());
}
}
It shows this error when i put it in the SuperGMCommands.java
My changemap function in maplecharacter
any help is much appreciated. thanks
public void changeMapBanish(final int mapid, final int portal, final String msg) { //WOT DE FQ
dropMessage(5, msg);
final MapleMap map = client.getChannelServer().getMapFactory().getMap(mapid);
changeMap(map, map.getPortal(portal));
}
public void changeMap(final MapleMap to, final Point pos) {
changeMapInternal(to, pos, CField.getWarpToMap(to, 0x80, this), null);
}
public void changeMap(final MapleMap to) {
changeMapInternal(to, to.getPortal(0).getPosition(), CField.getWarpToMap(to, 0, this), to.getPortal(0));
}
public void changeMap(final MapleMap to, final MaplePortal pto) {
changeMapInternal(to, pto.getPosition(), CField.getWarpToMap(to, pto.getId(), this), null);
}
public void changeMapPortal(final MapleMap to, final MaplePortal pto) {
changeMapInternal(to, pto.getPosition(), CField.getWarpToMap(to, pto.getId(), this), pto);
}
private void changeMapInternal(final MapleMap to, final Point pos, byte[] warpPacket, final MaplePortal pto) {
if (to.mapLocked() && gmLevel < 1) {
dropMessage(6, "There's a strong force holding you back. It seems that there's a battle going on!");
client.getSession().write(CWvsContext.enableActions());
return;
}
if (to == null) {
return;
}
final int nowmapid = map.getId();
if (eventInstance != null) {
eventInstance.changedMap(this, to.getId());
}
final boolean pyramid = pyramidSubway != null;
if (map.getId() == nowmapid) {
client.getSession().write(warpPacket);
final boolean shouldChange = !isClone() && client.getChannelServer().getPlayerStorage().getCharacterById(getId()) != null;
final boolean shouldState = map.getId() == to.getId();
if (shouldChange && shouldState) {
to.setCheckStates(false);
}
map.removePlayer(this);
if (shouldChange) {
map = to;
setPosition(pos);
to.addPlayer(this);
stats.relocHeal(this);
if (shouldState) {
to.setCheckStates(true);
}
}
}
if (pyramid && pyramidSubway != null) { //checks if they had pyramid before AND after changing
pyramidSubway.onChangeMap(this, to.getId());
}
}
Try replacing wif:
or simply change that function with another sources/repacks.
what you pasted above is exactly same as mine. 100%. lol.
check it before your replying.
It shows this error when i put it in the SuperGMCommands.java
Code:C:\Users\xxx\src\client\messages\commands\SuperGMCommand.java:1572: error: no suitable method found for changeMap(int,int) c.getPlayer().changeMap(109020001, 0); method MapleCharacter.changeMap(MapleMap,MaplePortal) is not applicable (actual argument int cannot be converted to MapleMap by method invocation conversion) method MapleCharacter.changeMap(MapleMap) is not applicable (actual and formal argument lists differ in length) method MapleCharacter.changeMap(MapleMap,Point) is not applicable (actual argument int cannot be converted to MapleMap by method invocation conversion) C:\Users\xxx\src\client\messages\commands\SuperGMCommand.java:1630: error: no suitable method found for changeMap(int,int) victim.changeMap(100000000,0); method MapleCharacter.changeMap(MapleMap,MaplePortal) is not applicable (actual argument int cannot be converted to MapleMap by method invocation conversion) method MapleCharacter.changeMap(MapleMap) is not applicable (actual and formal argument lists differ in length) method MapleCharacter.changeMap(MapleMap,Point) is not applicable (actual argument int cannot be converted to MapleMap by method invocation conversion) Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 2 errors
My changemap function in maplecharacter
any help is much appreciated. thanks