Merge pull request #178 from Ceikry/master

Pyramid Plunder: The (probably) final boogaloo
This commit is contained in:
Daniel Ginovker 2020-03-19 11:01:05 -04:00 committed by GitHub
commit 19b39c7de7
3 changed files with 94 additions and 16 deletions

View file

@ -0,0 +1,4 @@
package org.crandor.game.content.eco.ge;
public class GEAutoStock {
}

View 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;
}
}
}

View file

@ -11,6 +11,7 @@ import org.crandor.game.node.item.Item;
import org.crandor.game.node.object.ObjectBuilder;
import org.crandor.game.world.GameWorld;
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.plugin.InitializablePlugin;
import org.crandor.plugin.Plugin;
@ -70,50 +71,53 @@ public final class PyramidPlunderOptions extends OptionHandler {
public boolean handle(Player player, Node node, String option) {
PlunderObjectManager manager = player.getPlunderObjectManager();
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)};
int currentX = player.getLocation().getX();
int currentY = player.getLocation().getY();
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 level = player.getSkills().getLevel(Skills.THIEVING);
int room = 0;
int spearX = 0;
int spearY = 0;
double droom = 0.0;
if(currentX >= 1923 && currentX <= 1932 && currentY <= 4477 && currentY >= 4464 ){
ZoneMonitor zmon = player.getZoneMonitor();
if(zmon.isInZone("PR1")){
room = 1;
reqLevel = 21;
spearX = 0;
spearY = -2;
} else if(currentX >= 1925 && currentX <= 1941 && currentY <= 4458 && currentY >= 4449 ){
} else if(zmon.isInZone("PR2")){
room = 2;
reqLevel = 31;
spearX = 2;
spearY = 0;
} else if(currentX >= 1941 && currentX <= 1954 && currentY >=4421 && currentY <= 4432 ){
} else if(zmon.isInZone("PR3")){
room = 3;
reqLevel = 41;
spearX = 0;
spearY = 2;
} else if(currentX >= 1949 && currentX <= 1959 && currentY <= 4477 && currentY >= 4464){
} else if(zmon.isInZone("PR4")){
room = 4;
reqLevel = 51;
spearX = 0;
spearY = -2;
} else if(currentX >= 1968 && currentX <= 1978 && currentY <= 4436 && currentY >= 4420){
} else if(zmon.isInZone("PR5")){
room = 5;
reqLevel = 61;
spearX = 0;
spearY = 2;
} else if(currentX >= 1970 && currentX <= 1979 && currentY <= 4471 && currentY >= 4424){
} else if(zmon.isInZone("PR6")){
room = 6;
reqLevel = 71;
spearX = 0;
spearY = -2;
} else if(currentX >= 1923 && currentX <= 1931 && currentY <= 4439 && currentY >= 4424){
room = 8;
} else if(zmon.isInZone("PR7")){
room = 7;
reqLevel = 81;
spearX = 0;
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);
droom = (double) room;
@ -301,16 +305,12 @@ public final class PyramidPlunderOptions extends OptionHandler {
if (doesOpen) {
player.getPacketDispatch().sendMessage("The door opens!");
player.getProperties().setTeleportLocation(room_entrance[room]);
player.getPacketDispatch().sendMessage("<col=7f03ff>Room: " + (room + 1) + " Level required: " + (reqLevel + 10));
player.getPlunderObjectManager().resetObjectsFor(player);
} else {
player.getPacketDispatch().sendMessage("You fail to unlock the door.");
}
} else if(room == 8) {
ClimbActionHandler.climb(player, ClimbActionHandler.CLIMB_UP, Location.create(3288, 2801, 0));
player.getPlunderObjectManager().resetObjectsFor(player);
}
manager.resetObjectsFor(player);
break;
}
return true;