Thread: Duel arena

Page 1 of 3 123 LastLast
Results 1 to 10 of 28
  1. #1 Duel arena 
    Donator

    Join Date
    Nov 2012
    Posts
    773
    Thanks given
    45
    Thanks received
    42
    Rep Power
    18
    solved/
    Last edited by Relentless; 06-11-2019 at 10:10 PM.
    Reply With Quote  
     

  2. Thankful user:


  3. #2  
    Registered Member
    Join Date
    Jan 2018
    Posts
    123
    Thanks given
    114
    Thanks received
    10
    Discord
    PattyCakes #9137
    Rep Power
    58
    If I am not mistaken this is pi? Have a look at how Exotic duel arena is set out and it might give you an idea on what to do?
    Reply With Quote  
     

  4. #3  
    Donator

    Join Date
    Nov 2012
    Posts
    773
    Thanks given
    45
    Thanks received
    42
    Rep Power
    18
    Quote Originally Posted by RspsLife View Post
    If I am not mistaken this is pi? Have a look at how Exotic duel arena is set out and it might give you an idea on what to do?
    Abit confusing, I understand what part it is but how would i implement this
    Code:
    	public void applyDead() {
    		c.getPA().sendFrame126(":quicks:off", -1);
    		c.isFullHelm = Item.isFullHat(c.playerEquipment[c.playerHat]);
    		c.isFullMask = Item.isFullMask(c.playerEquipment[c.playerHat]);
    		c.isFullBody = Item.isFullBody(c.playerEquipment[c.playerChest]);
    		c.getPA().requestUpdates();
    		c.respawnTimer = 15;
    		c.isDead = false;
    		c.graceSum = 0;
    		c.freezeTimer = 1;
    		c.recoilHits = 0;
    		DuelSession duelSession = (DuelSession) Server.getMultiplayerSessionListener().getMultiplayerSession(c, MultiplayerSessionType.DUEL);
    		if (Objects.nonNull(duelSession) && duelSession.getStage().getStage() < MultiplayerSessionStage.FURTHER_INTERATION) {
    			duelSession = null;
    		}
    		if (c.inClanWars() || c.inClanWarsSafe() || Boundary.isIn(c, Boundary.SAFEPKSAFE)) {
    			resetDeath();
    		}
    		if(c.getSlayer().superiorSpawned) {
    			c.getSlayer().superiorSpawned = false;
    		}
    		if (Objects.isNull(duelSession)) {
    			Entity killer = c.calculateKiller();
    			if (killer != null) {
    				c.setKiller(killer);
    				if (killer instanceof Player) {
    					Player playerKiller = (Player) killer;
    					c.killerId = killer.getIndex();
    					if (c.killerId != c.getIndex()) {
    						if (c.inWild()) {
    							if (HolidayController.HALLOWEEN.isActive()) {
    								CycleEventHandler.getSingleton().addEvent(c, new HalloweenDeathCycleEvent(c, playerKiller), 6);
    							}
    							if (!Boundary.isIn(c, Boundary.SAFEPK)) {
    								if (c.getItems().playerHasItem(11941)) {
    									c.getLootingBag().onDeath(c, "PVP");
    								}
    								if (c.getItems().playerHasItem(12791)) {
    									c.getRunePouch().onDeath(c, "PVP");
    								}
    								if (c.getItems().playerHasItem(13226)) {
    									c.getHerbSack().onDeath(c, "PVP");
    								}
    								if (c.getItems().playerHasItem(12020)) {
    									c.getGemBag().onDeath(c, "PVP");
    								}
    							}
    							if (playerKiller.inClanWars()) {
    								playerKiller.getItems().addSpecialBar(playerKiller.playerEquipment[playerKiller.playerWeapon]);
    								playerKiller.specAmount = 10;
    							}
    							if (!playerKiller.getPlayerKills().killedRecently(c.connectedFrom) && !playerKiller.getMacAddress().equals(c.getMacAddress())) {
    								playerKiller.getPlayerKills().add(c.connectedFrom);
    								c.deathcount++;
    								playerKiller.killcount++;
    								playerKiller.refreshQuestTab(0);
    								playerKiller.refreshQuestTab(7);
    								playerKiller.getPA().sendFrame126(
    										"@[email protected] KS: @[email protected]" + playerKiller.getKillstreak().getAmount(Killstreak.Type.HUNTER) + "@[email protected], " + "Rogue KS: @[email protected]"
    												+ playerKiller.getKillstreak().getAmount(Killstreak.Type.ROGUE), 29165);
    								
    								
    								/*
    								  Killing targets
    								 */
    								if (Config.BOUNTY_HUNTER_ACTIVE && !Boundary.isIn(c, Boundary.SAFEPKSAFE)) {
    									c.getBH().dropPlayerEmblem(playerKiller);
    									if (c.getBH().hasTarget() && c.getBH().getTarget().getName().equalsIgnoreCase(playerKiller.playerName) && playerKiller.getBH().hasTarget()
    											&& playerKiller.getBH().getTarget().getName().equalsIgnoreCase(c.playerName)) {
    										playerKiller.getBH().setCurrentHunterKills(playerKiller.getBH().getCurrentHunterKills() + 1);
    										if (playerKiller.getBH().getCurrentHunterKills() > playerKiller.getBH().getRecordHunterKills()) {
    											playerKiller.getBH().setRecordHunterKills(playerKiller.getBH().getCurrentHunterKills());
    										}
    										playerKiller.getKillstreak().increase(Killstreak.Type.HUNTER);
    										playerKiller.getBH().upgradePlayerEmblem();
    										playerKiller.getBH().setTotalHunterKills(playerKiller.getBH().getTotalHunterKills() + 1);
    										playerKiller.getBH().removeTarget();
    										c.getBH().removeTarget();
    										playerKiller.getBH().setTargetState(TargetState.RECENT_TARGET_KILL);
    										playerKiller.sendMessage("<col=255>You have killed your target: " + c.playerName + ".");
    									} else {
    										playerKiller.getKillstreak().increase(Killstreak.Type.ROGUE);
    										playerKiller.getBH().setCurrentRogueKills(playerKiller.getBH().getCurrentRogueKills() + 1);
    										playerKiller.getBH().setTotalRogueKills(playerKiller.getBH().getTotalRogueKills() + 1);
    										if (playerKiller.getBH().getCurrentRogueKills() > playerKiller.getBH().getRecordRogueKills()) {
    											playerKiller.getBH().setRecordRogueKills(playerKiller.getBH().getCurrentRogueKills());
    										}
    									}
    									playerKiller.getBH().updateStatisticsUI();
    									playerKiller.getBH().updateTargetUI();
    								}
    								
    								int opponentKillstreak = c.getKillstreak().getAmount(Killstreak.Type.HUNTER);
    								
    								if (Boundary.isIn(c, Boundary.SAFEPK)) {
    									playerKiller.pkp += Config.BONUS_WEEKEND && !Config.DOUBLE_PKP ? 3 : Config.DOUBLE_PKP ? 4 : 2;
    									playerKiller.refreshQuestTab(0);
    								} else {
    									if (opponentKillstreak > 1) {
    										playerKiller.sendMessage("You receive an additional 5 PK tickets, your opponent had a killstreak of " + opponentKillstreak + ".");
    										PlayerHandler.executeGlobalMessage("<col=CC0000>" + WordUtils.capitalize(playerKiller.playerName) + "</col><col=255>" + " has ended </col><col=CC0000>" + WordUtils.capitalize(c.playerName) + "</col><col=255>'s" + " hunter killstreak of " + opponentKillstreak + ".");
    										playerKiller.getItems().addItemUnderAnyCircumstance(2996, Config.DOUBLE_PKP ? 10 : 5);
    									}
    									if (playerKiller.inClanWars()) {
    										if (!playerKiller.getItems().addItem(13307, 5)) {
    											Server.itemHandler.createGroundItem(playerKiller, 13307, playerKiller.getX(), playerKiller.getY(), playerKiller.heightLevel, 5);
    										}
    									} else {
    										playerKiller.pkp += Config.BONUS_WEEKEND && !Config.DOUBLE_PKP ? 6 : Config.DOUBLE_PKP ? 8 : 4;
    										playerKiller.refreshQuestTab(0);
    									}
    								}
    								c.getKillstreak().resetAll();
    								c.getPA().loadQuests();
    								playerKiller.getPA().loadQuests();
    							} else {
    								if (playerKiller.inClanWars() || playerKiller.inClanWarsSafe()) {
    									playerKiller.sendMessage("You do not get any blood money as you have recently defeated @[email protected]" + Misc.optimizeText(c.playerName) + "@[email protected]");
    								} else {
    									playerKiller.sendMessage("You do not get any PK Points as you have recently defeated @[email protected]" + Misc.optimizeText(c.playerName) + "@[email protected]");
    								}
    							}
    						}
    						PlayerSave.saveGame(playerKiller);
    					}
    				} else if (killer instanceof NPC) {
    					if (!Boundary.isIn(c, Boundary.FIGHT_CAVE) && !Boundary.isIn(c, Zulrah.BOUNDARY)
    							&& !Boundary.isIn(c, Boundary.KRAKEN_CAVE) && !Boundary.isIn(c, Boundary.RFD)
    							&& !Boundary.isIn(c, Boundary.LIGHTHOUSE) && !Boundary.isIn(c, Boundary.CERBERUS_BOSSROOMS) && !Boundary.isIn(c, Boundary.SKOTIZO_BOSSROOM)) {
    						if (c.getItems().playerHasItem(11941)) {
    							c.getLootingBag().onDeath(c, "MOB");
    						}
    						if (c.getItems().playerHasItem(12791)) {
    							c.getRunePouch().onDeath(c, "MOB");
    						}
    						if (c.getItems().playerHasItem(13226)) {
    							c.getHerbSack().onDeath(c, "MOB");
    						}
    						if (c.getItems().playerHasItem(12020)) {
    							c.getGemBag().onDeath(c, "MOB");
    						}
    					}
    				}
    				c.sendMessage("Oh dear you are dead!");
    			}
    		}
    		
    		/*
    		  Reset bounty hunter statistics
    		 */
    		if (Config.BOUNTY_HUNTER_ACTIVE) {
    			c.getBH().setCurrentHunterKills(0);
    			c.getBH().setCurrentRogueKills(0);
    			c.getBH().updateStatisticsUI();
    			c.getBH().updateTargetUI();
    		}
    		c.faceUpdate(0);
    		c.stopMovement();
    		
    		/*
    		  Death within the duel arena
    		 */
    		if (duelSession != null && duelSession.getStage().getStage() == MultiplayerSessionStage.FURTHER_INTERATION) {
    			if (!duelSession.getWinner().isPresent()) {
    				c.sendMessage("You have lost the duel!");
    
    				c.setDuelLossCounter(c.getDuelLossCounter() + 1);
    				c.sendMessage("You have now lost a total of @[email protected]" + c.getDuelLossCounter() + " @[email protected] duels.");
    				Player opponent = duelSession.getOther(c);
    				opponent.logoutDelay = System.currentTimeMillis();
    				if (!duelSession.getWinner().isPresent()) {
    					duelSession.setWinner(opponent);
    				}
    				PlayerSave.saveGame(opponent);
    			} else {
    				c.sendMessage("Congratulations, you have won the duel.");
    			}
    			c.logoutDelay = System.currentTimeMillis();
    		}
    		c.startAnimation(2304);
    		resetDeath();
    	}
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,705
    Thanks given
    170
    Thanks received
    285
    Discord
    Arch337#1337
    Rep Power
    606
    Does it work if you are not pressing on the floor?


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  7. Thankful user:


  8. #5  
    Donator

    Join Date
    Jan 2009
    Posts
    467
    Thanks given
    142
    Thanks received
    41
    Rep Power
    65
    this is exotic duel system?
    Reply With Quote  
     

  9. #6  
    Donator

    Join Date
    Nov 2012
    Posts
    773
    Thanks given
    45
    Thanks received
    42
    Rep Power
    18
    nvm
    Last edited by Relentless; 06-11-2019 at 10:10 PM.
    Reply With Quote  
     

  10. Thankful user:


  11. #7  
    Donator

    Join Date
    Jan 2009
    Posts
    467
    Thanks given
    142
    Thanks received
    41
    Rep Power
    65
    use jasons multiplayer sessions snippet will prob fix most of ur bugs

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  12. #8  
    Donator

    Join Date
    Nov 2012
    Posts
    773
    Thanks given
    45
    Thanks received
    42
    Rep Power
    18
    Quote Originally Posted by Kumon View Post
    use jasons multiplayer sessions snippet will prob fix most of ur bugs

    [Only registered and activated users can see links. ]
    Don't mean to sound stupid, But i wouldnt know where to start putting them methods ect, im only looking for a quick fix
    Reply With Quote  
     

  13. Thankful user:


  14. #9  
    I Like Chicken Nuggets :]

    Join Date
    Aug 2014
    Posts
    314
    Thanks given
    4
    Thanks received
    56
    Rep Power
    54
    Just don't use PI. Super outdated and filled with millions of bugs that you will never fix...
    Reply With Quote  
     

  15. #10  
    Registered Member
    arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,705
    Thanks given
    170
    Thanks received
    285
    Discord
    Arch337#1337
    Rep Power
    606
    Quote Originally Posted by Relentless View Post
    yeah all works.



    No i copied that from exotic, this is mine
    Code:
    	public void applyDead() {
    		c.respawnTimer = 15;
    		c.isDead = false;
    		Client o = (Client) Server.playerHandler.players[c.killerId];
    		if(c.duelStatus != 6) {
    			c.killerId = findKiller();
    			if(o != null) {
    				c.DC++;
    				o.KC++;
    				if(o.duelStatus == 5) {
    					o.duelStatus++;
    				}
    				if (Server.playerHandler.players[c.playerId].connectedFrom != o.lastKilled) {		
    	    			if(o.duelStatus == 5) {
    	    				o.freezeTimer = 15;
    	    				
    	    				c.playerKilled = c.playerId;
    	    			}
    					if(c.inWild()) {
    						if(!PlayerKilling.hostOnList(o, c.connectedFrom) && !c.inDuelArena()) {
    							PlayerKilling.addHostToList(o, c.connectedFrom);
    							o.PkPoints = (o.PkPoints + 150);
    							o.KillStreak++;
    							o.getStreak().checkKillStreak();
    							o.getStreak().killedPlayer();	
    							o.sendMessage("<col=0000FF>You have defeated <col=16711680>"+c.playerName+"!");
    							o.sendMessage("<col=16711680>You received 150 Pk Points!");	
    						} else {
    							o.sendMessage("<col=16711680>You do not recieve pk points because you have killed " +c.playerName+ " twice in a row.");
    						}
    						c.playerKilled = c.playerId;
    						if(o.duelStatus == 5) {
    							o.duelStatus++;
    						}
    						c.KillStreak = 0;				
    
    					}
    					o.lastKilled = Server.playerHandler.players[c.playerId].connectedFrom;
    				} else {
    					
    				}
    			}
    		}
    		c.npcIndex = 0;
    		c.playerIndex = 0;
    		c.stopMovement();
    		if(c.duelStatus <= 4) {
    			c.sendMessage("Oh dear you are dead!");
    		} else if(c.duelStatus != 6) {
    			c.sendMessage("You have lost the duel!");
    		}
    		resetDamageDone();
    		c.specAmount = 10;
    		c.getItems().addSpecialBar(c.playerEquipment[c.playerWeapon]);
    		c.lastVeng = 0;
    		c.vengOn = false;
    		resetFollowers();
    		c.attackTimer = 10;
    		removeAllWindows();
    		c.tradeResetNeeded = true;
    	}
    Check your walk packets to see if something in there reset anything duel relative.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  16. Thankful user:


Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. o.O My New Pure In Duel Arena
    By JavaŠ in forum Media
    Replies: 8
    Last Post: 04-07-2007, 10:22 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •