Rename and clean up MapleMonster
This commit is contained in:
@@ -961,12 +961,12 @@ public class AbstractPlayerInteraction {
|
||||
}
|
||||
|
||||
public void spawnMonster(int id, int x, int y) {
|
||||
MapleMonster monster = LifeFactory.getMonster(id);
|
||||
Monster monster = LifeFactory.getMonster(id);
|
||||
monster.setPosition(new Point(x, y));
|
||||
getPlayer().getMap().spawnMonster(monster);
|
||||
}
|
||||
|
||||
public MapleMonster getMonsterLifeFactory(int mid) {
|
||||
public Monster getMonsterLifeFactory(int mid) {
|
||||
return LifeFactory.getMonster(mid);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@ import server.ThreadManager;
|
||||
import server.TimerManager;
|
||||
import server.expeditions.Expedition;
|
||||
import server.life.LifeFactory;
|
||||
import server.life.MapleMonster;
|
||||
import server.life.MapleNPC;
|
||||
import server.life.Monster;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.MapleMapManager;
|
||||
import server.maps.MaplePortal;
|
||||
@@ -67,7 +67,7 @@ import java.util.logging.Logger;
|
||||
public class EventInstanceManager {
|
||||
private Map<Integer, Character> chars = new HashMap<>();
|
||||
private int leaderId = -1;
|
||||
private List<MapleMonster> mobs = new LinkedList<>();
|
||||
private List<Monster> mobs = new LinkedList<>();
|
||||
private Map<Character, Integer> killCount = new HashMap<>();
|
||||
private EventManager em;
|
||||
private EventScriptScheduler ess;
|
||||
@@ -431,7 +431,7 @@ public class EventInstanceManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void registerMonster(MapleMonster mob) {
|
||||
public void registerMonster(Monster mob) {
|
||||
if (!mob.getStats().isFriendly()) { //We cannot register moon bunny
|
||||
mobs.add(mob);
|
||||
}
|
||||
@@ -467,7 +467,7 @@ public class EventInstanceManager {
|
||||
leaderId = ldr.getId();
|
||||
}
|
||||
|
||||
public void monsterKilled(final MapleMonster mob, final boolean hasKiller) {
|
||||
public void monsterKilled(final Monster mob, final boolean hasKiller) {
|
||||
int scriptResult = 0;
|
||||
|
||||
sL.lock();
|
||||
@@ -502,19 +502,19 @@ public class EventInstanceManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void friendlyKilled(final MapleMonster mob, final boolean hasKiller) {
|
||||
public void friendlyKilled(final Monster mob, final boolean hasKiller) {
|
||||
try {
|
||||
invokeScriptFunction("friendlyKilled", mob, EventInstanceManager.this, hasKiller);
|
||||
} catch (ScriptException | NoSuchMethodException ex) {} //optional
|
||||
}
|
||||
|
||||
public void friendlyDamaged(final MapleMonster mob) {
|
||||
public void friendlyDamaged(final Monster mob) {
|
||||
try {
|
||||
invokeScriptFunction("friendlyDamaged", EventInstanceManager.this, mob);
|
||||
} catch (ScriptException | NoSuchMethodException ex) {} // optional
|
||||
}
|
||||
|
||||
public void friendlyItemDrop(final MapleMonster mob) {
|
||||
public void friendlyItemDrop(final Monster mob) {
|
||||
try {
|
||||
invokeScriptFunction("friendlyItemDrop", EventInstanceManager.this, mob);
|
||||
} catch (ScriptException | NoSuchMethodException ex) {} // optional
|
||||
@@ -528,7 +528,7 @@ public class EventInstanceManager {
|
||||
});
|
||||
}
|
||||
|
||||
public void reviveMonster(final MapleMonster mob) {
|
||||
public void reviveMonster(final Monster mob) {
|
||||
try {
|
||||
invokeScriptFunction("monsterRevive", EventInstanceManager.this, mob);
|
||||
} catch (ScriptException | NoSuchMethodException ex) {} // optional
|
||||
@@ -555,7 +555,7 @@ public class EventInstanceManager {
|
||||
EventRecallCoordinator.getInstance().storeEventInstance(chr.getId(), this);
|
||||
}
|
||||
|
||||
public void monsterKilled(Character chr, final MapleMonster mob) {
|
||||
public void monsterKilled(Character chr, final Monster mob) {
|
||||
try {
|
||||
final int inc = (int) invokeScriptFunction("monsterValue", EventInstanceManager.this, mob.getId());
|
||||
|
||||
@@ -876,7 +876,7 @@ public class EventInstanceManager {
|
||||
}
|
||||
}
|
||||
|
||||
public MapleMonster getMonster(int mid) {
|
||||
public Monster getMonster(int mid) {
|
||||
return(LifeFactory.getMonster(mid));
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ import server.MapleMarriage;
|
||||
import server.ThreadManager;
|
||||
import server.expeditions.Expedition;
|
||||
import server.life.LifeFactory;
|
||||
import server.life.MapleMonster;
|
||||
import server.life.Monster;
|
||||
import server.maps.MapleMap;
|
||||
import server.quest.MapleQuest;
|
||||
import tools.exceptions.EventInstanceInProgressException;
|
||||
@@ -737,7 +737,7 @@ public class EventManager {
|
||||
}
|
||||
}
|
||||
|
||||
public MapleMonster getMonster(int mid) {
|
||||
public Monster getMonster(int mid) {
|
||||
return(LifeFactory.getMonster(mid));
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ import scripting.AbstractPlayerInteraction;
|
||||
import server.MapleItemInformationProvider;
|
||||
import server.TimerManager;
|
||||
import server.life.LifeFactory;
|
||||
import server.life.MapleMonster;
|
||||
import server.life.Monster;
|
||||
import server.maps.MapMonitor;
|
||||
import server.maps.MapleMap;
|
||||
import server.maps.MapleReactor;
|
||||
@@ -287,7 +287,7 @@ public class ReactorActionManager extends AbstractPlayerInteraction {
|
||||
}
|
||||
|
||||
MapleMap map = reactor.getMap();
|
||||
MapleMonster mm = map.getMonsterById(id);
|
||||
Monster mm = map.getMonsterById(id);
|
||||
if(mm != null) {
|
||||
int damage = (int)Math.ceil(mm.getMaxHp() / hitsToKill);
|
||||
Character chr = this.getPlayer();
|
||||
@@ -326,7 +326,7 @@ public class ReactorActionManager extends AbstractPlayerInteraction {
|
||||
public void dispelAllMonsters(int num, int team) { //dispels all mobs, cpq
|
||||
final MCSkill skil = MapleCarnivalFactory.getInstance().getGuardian(num);
|
||||
if (skil != null) {
|
||||
for (MapleMonster mons : getMap().getAllMonsters()) {
|
||||
for (Monster mons : getMap().getAllMonsters()) {
|
||||
if(mons.getTeam() == team) {
|
||||
mons.dispelSkill(skil.getSkill());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user