forked from 2009Scape/Server
Preparing merge
This commit is contained in:
parent
e233110f1d
commit
4c55322faa
67 changed files with 3163 additions and 2387 deletions
|
|
@ -0,0 +1,98 @@
|
|||
package plugin.quest.learningtheropes;
|
||||
|
||||
import org.crandor.game.node.entity.npc.NPC;
|
||||
import org.crandor.game.node.entity.player.Player;
|
||||
import org.crandor.game.world.map.Direction;
|
||||
import org.crandor.game.world.map.Location;
|
||||
import org.crandor.game.world.map.build.DynamicRegion;
|
||||
import org.crandor.game.world.map.zone.MapZone;
|
||||
import org.crandor.game.world.update.flag.context.Animation;
|
||||
|
||||
/**
|
||||
* @author Ethan Kyle Millard <skype:pumpklins>
|
||||
* @since Wed, October 10, 2018 @ 1:03 PM
|
||||
*/
|
||||
public class CellarMapZone extends MapZone {
|
||||
|
||||
private static final NPC[] NPCS = new NPC[]{
|
||||
/** sir vant */
|
||||
NPC.create(7938, Location.create(2524, 5005, 0), Direction.NORTH),
|
||||
/** goblin*/
|
||||
NPC.create(7965, Location.create(2524, 4997, 0), Direction.NORTH),
|
||||
};
|
||||
|
||||
public static final CellarMapZone INSTANCE = new CellarMapZone();
|
||||
|
||||
/**
|
||||
* The region of the zone.
|
||||
*/
|
||||
private DynamicRegion region;
|
||||
|
||||
/**
|
||||
* The base location.
|
||||
*/
|
||||
private Location base;
|
||||
|
||||
|
||||
/**
|
||||
* Constructs a new {@code MapZone} {@code Object}.
|
||||
*/
|
||||
public CellarMapZone() {
|
||||
super("Cellar Map Zone", true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configure() {
|
||||
region = DynamicRegion.create(10062);
|
||||
setRegionBase();
|
||||
registerRegion(region.getId());
|
||||
setNpcs();
|
||||
}
|
||||
|
||||
public void create(Player player) {
|
||||
configure();
|
||||
player.teleport(getBase().transform(28, 12, 0));
|
||||
}
|
||||
|
||||
private void setNpcs() {
|
||||
for (NPC n : NPCS) {
|
||||
n = NPC.create(n.getId(), n.getLocation(), n.getDirection());
|
||||
n.setLocation(base.transform(n.getLocation().getLocalX(), n.getLocation().getLocalY(), 0));
|
||||
n.setRespawn(false);
|
||||
n.init();
|
||||
n.setWalks(false);
|
||||
n.animate(new Animation(-1));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the region base.
|
||||
*/
|
||||
private void setRegionBase() {
|
||||
if (region != null) {
|
||||
setBase(Location.create(region.getBorders().getSouthWestX(), region.getBorders().getSouthWestY(), 0));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the base.
|
||||
*
|
||||
* @return the base
|
||||
*/
|
||||
public Location getBase() {
|
||||
return base;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the base.
|
||||
*
|
||||
* @param base the base to set.
|
||||
*/
|
||||
public void setBase(Location base) {
|
||||
this.base = base;
|
||||
}
|
||||
|
||||
public static CellarMapZone get() {
|
||||
return INSTANCE;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue