Close Thread
Printable View
Close Thread
so basically you just added shops and a new player commands:blink:
If I were you, I would add more features soon, just for the sake of you not being superflamed.
I could see the humor and this and be like grt rls man, it's AWESOME...
But right now I don't feel it...
sooooo...
What the fuck. why do you even bother posting this.
lol u wrote hired merchants 2 times :O
I got a error when compiling.
In NPCScriptManager.java
addNpcTalkTimes is buged.
Heres the fix if any one want:
PHP Code:package net.sf.odinms.scripting.npc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.script.Invocable;
import net.sf.odinms.client.MapleClient;
import net.sf.odinms.client.MapleCharacter;
import net.sf.odinms.scripting.AbstractScriptManager;
import net.sf.odinms.tools.Pair;
public class NPCScriptManager extends AbstractScriptManager {
private Map<MapleClient, NPCConversationManager> cms = new HashMap<MapleClient, NPCConversationManager>();
private Map<MapleClient, NPCScript> scripts = new HashMap<MapleClient, NPCScript>();
private static NPCScriptManager instance = new NPCScriptManager();
public synchronized static NPCScriptManager getInstance() {
return instance;
}
public void start(MapleClient c, int npc) {
start(c, npc, null, null);
}
public void start(MapleClient c, int npc, String filename, MapleCharacter chr) {
try {
NPCConversationManager cm = new NPCConversationManager(c, npc, chr, filename);
if (cms.containsKey(c)) {
dispose(c);
return;
}
cms.put(c, cm);
Invocable iv = getInvocable("npc/" + npc + ".js", c);
if (filename != null) {
iv = getInvocable("npc/" + filename + ".js", c);
}
if (iv == null || NPCScriptManager.getInstance() == null) {
if (iv == null) {
cm.sendOk("Hi I'm an uncoded npc.\r\nMy ID is #r" + npc + "#k.");
}
cm.dispose();
return;
}
addNpcTalkTimes(c.getPlayer().getId(), npc);
engine.put("cm", cm);
NPCScript ns = iv.getInterface(NPCScript.class);
scripts.put(c, ns);
ns.start();
} catch (Exception e) {
log.error("Error executing NPC script.", e);
dispose(c);
cms.remove(c);
}
}
public void action(MapleClient c, byte mode, byte type, int selection) {
NPCScript ns = scripts.get(c);
if (ns != null) {
try {
ns.action(mode, type, selection);
} catch (Exception e) {
log.error("Error executing NPC script.", e);
dispose(c);
}
}
}
public void dispose(NPCConversationManager cm) {
cms.remove(cm.getC());
scripts.remove(cm.getC());
if (cm.getFileName() != null) {
resetContext("npc/" + cm.getFileName() + ".js", cm.getC());
} else {
resetContext("npc/" + cm.getNpc() + ".js", cm.getC());
}
}
public void dispose(MapleClient c) {
NPCConversationManager npccm = cms.get(c);
if (npccm != null) {
dispose(npccm);
}
}
public NPCConversationManager getCM(MapleClient c) {
return cms.get(c);
}
private Map<Pair<Integer, Integer>, Integer> npcTalk = new HashMap<Pair<Integer, Integer>, Integer>();
public int getNpcTalkTimes(int chrid, int npc) {
Pair<Integer, Integer> pplayer = new Pair<Integer, Integer>(chrid, npc); // first time <3 looks wrong.
if (!npcTalk.containsKey(pplayer)) {
npcTalk.put(pplayer, 0);
}
return npcTalk.get(pplayer);
}
public void addNpcTalkTimes(int chrid, int npc) {
Pair<Integer, Integer> pplayer = new Pair<Integer, Integer>(chrid, npc);
if (!npcTalk.containsKey(pplayer)) {
npcTalk.put(pplayer, 0);
}
int talk = 1 + npcTalk.get(pplayer);
npcTalk.remove(pplayer);
npcTalk.put(pplayer, talk);
}
public void setNpcTalkTimes(int chrid, int npc, int amount) {
Pair<Integer, Integer> pplayer = new Pair<Integer, Integer>(chrid, npc);
if (!npcTalk.containsKey(pplayer)) {
npcTalk.put(pplayer, 0);
}
npcTalk.remove(pplayer);
npcTalk.put(pplayer, amount);
}
public List<Integer> listTalkedNpcsByID(int chrid) {
List<Integer> npcs = new ArrayList<Integer>();
for (Pair<Integer, Integer> rawr : npcTalk.keySet()) {
if (rawr.getLeft().equals(chrid)) {
npcs.add(rawr.getRight());
}
}
return npcs;
}
public List<Integer> listAllTalkedNpcs() {
List<Integer> npcs = new ArrayList<Integer>();
for (Pair<Integer, Integer> rawr : npcTalk.keySet()) {
npcs.add(rawr.getRight());
}
return npcs;
}
public int talkedTimesByNpc(int npc) {
int i = 0;
for (Pair<Integer, Integer> rawr : npcTalk.keySet()) {
if (rawr.getRight().equals(npc)) {
i += npcTalk.get(rawr);
}
}
return i;
}
}
another repack based off another one
is this repack good?
@fuzzor there is an error so thats the fix?
oh ok thanks! i have no idea which repack to use.
which repack has npcs?
This is from a another forum i see this!! leecher -,-
---------- Post added at 02:16 AM ---------- Previous post was at 02:15 AM ----------
sorry i read wrong its based on raverstory not raver story xd
i get this error then commands dont work
some1 help plzzCode:java.lang.ClassNotFoundException: net.sf.odinms.client.messages.commands.Donato
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at sun.misc.Launcher$ExtClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at net.sf.odinms.client.messages.CommandProcessor.reloadCommands(Comman
Processor.java:212)
at net.sf.odinms.client.messages.CommandProcessor.<init>(CommandProcess
r.java:71)
at net.sf.odinms.client.messages.CommandProcessor.<clinit>(CommandProce
sor.java:60)
at net.sf.odinms.net.channel.ChannelServer.main(ChannelServer.java:641)
the repack stable?
nope this is full error
Code:SEVERE: THROW
java.lang.ClassNotFoundException: net.sf.odinms.client.messages.commands.Donator
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at sun.misc.Launcher$ExtClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at net.sf.odinms.client.messages.CommandProcessor.reloadCommands(Command
Processor.java:212)
at net.sf.odinms.client.messages.CommandProcessor.<init>(CommandProcesso
r.java:71)
at net.sf.odinms.client.messages.CommandProcessor.<clinit>(CommandProces
sor.java:60)
at net.sf.odinms.net.channel.ChannelServer.main(ChannelServer.java:641)
i getting this error after a while (see attachment) only one know how to fix? i can login etc but after a while i get this error(tried to change the EventManager file from another source, didnt work either
Sorry About that my computer Have Spoil so i cant make. i will make it asap (: sorry.