mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-11 09:00:23 -07:00
Merge pull request #178 from Ceikry/master
Pyramid Plunder: The (probably) final boogaloo
This commit is contained in:
commit
19b39c7de7
3 changed files with 94 additions and 16 deletions
|
|
@ -0,0 +1,4 @@
|
||||||
|
package org.crandor.game.content.eco.ge;
|
||||||
|
|
||||||
|
public class GEAutoStock {
|
||||||
|
}
|
||||||
74
Server/src/plugin/activity/pyramidplunder/PlunderZones.java
Normal file
74
Server/src/plugin/activity/pyramidplunder/PlunderZones.java
Normal file
|
|
@ -0,0 +1,74 @@
|
||||||
|
package plugin.activity.pyramidplunder;
|
||||||
|
import org.crandor.game.node.entity.Entity;
|
||||||
|
import org.crandor.game.node.entity.player.Player;
|
||||||
|
import org.crandor.game.system.task.LocationLogoutTask;
|
||||||
|
import org.crandor.game.system.task.LogoutTask;
|
||||||
|
import org.crandor.game.world.map.Location;
|
||||||
|
import org.crandor.game.world.map.zone.MapZone;
|
||||||
|
import org.crandor.game.world.map.zone.ZoneBorders;
|
||||||
|
import org.crandor.game.world.map.zone.ZoneBuilder;
|
||||||
|
import org.crandor.plugin.InitializablePlugin;
|
||||||
|
import org.crandor.plugin.Plugin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines the zones for the pyramid plunder rooms
|
||||||
|
* @author ceik
|
||||||
|
*/
|
||||||
|
|
||||||
|
@InitializablePlugin
|
||||||
|
public class PlunderZones implements Plugin<Object> {
|
||||||
|
PlunderZone[] ROOMS = {
|
||||||
|
new PlunderZone("PR1", 1,1923, 4464, 1932, 4474),
|
||||||
|
new PlunderZone("PR2", 2,1925, 4449, 1941, 4458),
|
||||||
|
new PlunderZone("PR3", 3,1941, 4421, 1954, 4432),
|
||||||
|
new PlunderZone("PR4", 4,1949, 4464, 1959, 4477),
|
||||||
|
new PlunderZone("PR5", 5,1968, 4420, 1978, 4436),
|
||||||
|
new PlunderZone("PR6", 6,1969, 4452, 1980, 4473),
|
||||||
|
new PlunderZone("PR7", 7,1923, 4424, 1931, 4439),
|
||||||
|
new PlunderZone("PR8", 8, 1950, 4442, 1969, 4455)
|
||||||
|
};
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
||||||
|
for(PlunderZone ROOM : ROOMS){
|
||||||
|
ZoneBuilder.configure(ROOM);
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public Object fireEvent(String identifier, Object... args) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PlunderZone extends MapZone {
|
||||||
|
int swx, swy, nex, ney;
|
||||||
|
String name;
|
||||||
|
int roomnum;
|
||||||
|
|
||||||
|
public PlunderZone(String name, int roomnum, int swx, int swy, int nex, int ney) {
|
||||||
|
super(name, true);
|
||||||
|
this.name = name;
|
||||||
|
this.swx = swx;
|
||||||
|
this.swy = swy;
|
||||||
|
this.nex = nex;
|
||||||
|
this.ney = ney;
|
||||||
|
this.roomnum = roomnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void configure() {
|
||||||
|
ZoneBorders borders = new ZoneBorders(swx, swy, nex, ney,0);
|
||||||
|
register(borders);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean enter(Entity e){
|
||||||
|
if(e instanceof Player) {
|
||||||
|
e.asPlayer().getPacketDispatch().sendMessage("<col=7f03ff>Room: " + (roomnum) + " Level required: " + (21 + ((roomnum - 1) * 10)));
|
||||||
|
e.asPlayer().getPlunderObjectManager().resetObjectsFor(e.asPlayer());
|
||||||
|
e.asPlayer().addExtension(LogoutTask.class, new LocationLogoutTask(12, Location.create(3288, 2801, 0)));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -11,6 +11,7 @@ import org.crandor.game.node.item.Item;
|
||||||
import org.crandor.game.node.object.ObjectBuilder;
|
import org.crandor.game.node.object.ObjectBuilder;
|
||||||
import org.crandor.game.world.GameWorld;
|
import org.crandor.game.world.GameWorld;
|
||||||
import org.crandor.game.world.map.Location;
|
import org.crandor.game.world.map.Location;
|
||||||
|
import org.crandor.game.world.map.zone.ZoneMonitor;
|
||||||
import org.crandor.game.world.update.flag.context.Animation;
|
import org.crandor.game.world.update.flag.context.Animation;
|
||||||
import org.crandor.plugin.InitializablePlugin;
|
import org.crandor.plugin.InitializablePlugin;
|
||||||
import org.crandor.plugin.Plugin;
|
import org.crandor.plugin.Plugin;
|
||||||
|
|
@ -70,50 +71,53 @@ public final class PyramidPlunderOptions extends OptionHandler {
|
||||||
public boolean handle(Player player, Node node, String option) {
|
public boolean handle(Player player, Node node, String option) {
|
||||||
PlunderObjectManager manager = player.getPlunderObjectManager();
|
PlunderObjectManager manager = player.getPlunderObjectManager();
|
||||||
int NPCDeathTime = GameWorld.getTicks() + (1000 / 6);
|
int NPCDeathTime = GameWorld.getTicks() + (1000 / 6);
|
||||||
Location room_entrance[] = {new Location(1927,4477), new Location(1927,4453), new Location(1943,4421), new Location(1954,4477), new Location(1974,4420), new Location(1977,4471), new Location(1927, 4424)};
|
Location room_entrance[] = {new Location(1927,4477), new Location(1927,4453), new Location(1943,4421), new Location(1954,4477), new Location(1974,4420), new Location(1977,4471), new Location(1927, 4424), new Location(1965,4444)};
|
||||||
int currentX = player.getLocation().getX();
|
|
||||||
int currentY = player.getLocation().getY();
|
|
||||||
int level = player.getSkills().getLevel(Skills.THIEVING);
|
int level = player.getSkills().getLevel(Skills.THIEVING);
|
||||||
int room = 0;
|
int room = 0;
|
||||||
int spearX = 0;
|
int spearX = 0;
|
||||||
int spearY = 0;
|
int spearY = 0;
|
||||||
double droom = 0.0;
|
double droom = 0.0;
|
||||||
if(currentX >= 1923 && currentX <= 1932 && currentY <= 4477 && currentY >= 4464 ){
|
ZoneMonitor zmon = player.getZoneMonitor();
|
||||||
|
if(zmon.isInZone("PR1")){
|
||||||
room = 1;
|
room = 1;
|
||||||
reqLevel = 21;
|
reqLevel = 21;
|
||||||
spearX = 0;
|
spearX = 0;
|
||||||
spearY = -2;
|
spearY = -2;
|
||||||
|
} else if(zmon.isInZone("PR2")){
|
||||||
} else if(currentX >= 1925 && currentX <= 1941 && currentY <= 4458 && currentY >= 4449 ){
|
|
||||||
room = 2;
|
room = 2;
|
||||||
reqLevel = 31;
|
reqLevel = 31;
|
||||||
spearX = 2;
|
spearX = 2;
|
||||||
spearY = 0;
|
spearY = 0;
|
||||||
} else if(currentX >= 1941 && currentX <= 1954 && currentY >=4421 && currentY <= 4432 ){
|
} else if(zmon.isInZone("PR3")){
|
||||||
room = 3;
|
room = 3;
|
||||||
reqLevel = 41;
|
reqLevel = 41;
|
||||||
spearX = 0;
|
spearX = 0;
|
||||||
spearY = 2;
|
spearY = 2;
|
||||||
} else if(currentX >= 1949 && currentX <= 1959 && currentY <= 4477 && currentY >= 4464){
|
} else if(zmon.isInZone("PR4")){
|
||||||
room = 4;
|
room = 4;
|
||||||
reqLevel = 51;
|
reqLevel = 51;
|
||||||
spearX = 0;
|
spearX = 0;
|
||||||
spearY = -2;
|
spearY = -2;
|
||||||
} else if(currentX >= 1968 && currentX <= 1978 && currentY <= 4436 && currentY >= 4420){
|
} else if(zmon.isInZone("PR5")){
|
||||||
room = 5;
|
room = 5;
|
||||||
reqLevel = 61;
|
reqLevel = 61;
|
||||||
spearX = 0;
|
spearX = 0;
|
||||||
spearY = 2;
|
spearY = 2;
|
||||||
} else if(currentX >= 1970 && currentX <= 1979 && currentY <= 4471 && currentY >= 4424){
|
} else if(zmon.isInZone("PR6")){
|
||||||
room = 6;
|
room = 6;
|
||||||
reqLevel = 71;
|
reqLevel = 71;
|
||||||
spearX = 0;
|
spearX = 0;
|
||||||
spearY = -2;
|
spearY = -2;
|
||||||
} else if(currentX >= 1923 && currentX <= 1931 && currentY <= 4439 && currentY >= 4424){
|
} else if(zmon.isInZone("PR7")){
|
||||||
room = 8;
|
room = 7;
|
||||||
reqLevel = 81;
|
reqLevel = 81;
|
||||||
spearX = 0;
|
spearX = 0;
|
||||||
spearY = 2;
|
spearY = 2;
|
||||||
|
} else if(zmon.isInZone("PR8")){
|
||||||
|
room = 8;
|
||||||
|
reqLevel = 91;
|
||||||
|
spearX = -2;
|
||||||
|
spearY = 0;
|
||||||
}
|
}
|
||||||
PlunderObject object = new PlunderObject(node.asObject().getId(),node.asObject().getLocation(),player);
|
PlunderObject object = new PlunderObject(node.asObject().getId(),node.asObject().getLocation(),player);
|
||||||
droom = (double) room;
|
droom = (double) room;
|
||||||
|
|
@ -301,16 +305,12 @@ public final class PyramidPlunderOptions extends OptionHandler {
|
||||||
if (doesOpen) {
|
if (doesOpen) {
|
||||||
player.getPacketDispatch().sendMessage("The door opens!");
|
player.getPacketDispatch().sendMessage("The door opens!");
|
||||||
player.getProperties().setTeleportLocation(room_entrance[room]);
|
player.getProperties().setTeleportLocation(room_entrance[room]);
|
||||||
player.getPacketDispatch().sendMessage("<col=7f03ff>Room: " + (room + 1) + " Level required: " + (reqLevel + 10));
|
|
||||||
player.getPlunderObjectManager().resetObjectsFor(player);
|
|
||||||
} else {
|
} else {
|
||||||
player.getPacketDispatch().sendMessage("You fail to unlock the door.");
|
player.getPacketDispatch().sendMessage("You fail to unlock the door.");
|
||||||
}
|
}
|
||||||
} else if(room == 8) {
|
} else if(room == 8) {
|
||||||
ClimbActionHandler.climb(player, ClimbActionHandler.CLIMB_UP, Location.create(3288, 2801, 0));
|
ClimbActionHandler.climb(player, ClimbActionHandler.CLIMB_UP, Location.create(3288, 2801, 0));
|
||||||
player.getPlunderObjectManager().resetObjectsFor(player);
|
|
||||||
}
|
}
|
||||||
manager.resetObjectsFor(player);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue