Code: Show/Hide String coords; Player p = m_botAction.getPlayerName(event.getPlayerID()); coords=""+((char)(65+((p.getXLocation() * 5 ) >> 12)))+ (((p.getYLocation() * 5 ) >> 12) + 1); m_botAction.sendPrivateMessage( p.getPlayerName() + " is at " + coords ); |
Code: Show/Hide private String wabbit; public void rabbit(String name, String message){ Player p = m_botAction.getPlayer(name); if(oplist.isER(name)){ if( message.equals("on") ){ m_botAction.sendArenaMessage( p.getPlayerName() + " is the new rabbit! Get him/her to become the new rabbit." ); wabbit = p.getPlayerName(); m_botAction.sendUnfilteredPrivateMessage( wabbit, "*prize 5000" ); } else if( message.equals("off") ){ wabbit=off; } } if( message.equals("") ){ m_botAction.sendPrivateMessage( name, "Wabbit: " + wabbit ); } } public void handleEvent(PlayerDeath event){ String killee = m_botAction.getPlayerName( event.getKilleeID() ); String killer = m_botAction.getPlayerName( event.getKillerID() ); String coords; Player p = m_botAction.getPlayer(event.getKillerID()); coords=""+((char)(65+((p.getXLocation() * 5 ) >> 12)))+(((p.getYLocation() * 5 ) >> 12) + 1); if( killee.equals(wabbit) ){ m_botAction.sendUnfilteredPrivateMessage( killer, "*points 100000" ); m_botAction.sendUnfilteredPrivateMessage( killer, "*prize 5000" ); m_botAction.sendArenaMessage( killer + " is the new rabbit! Kill the wabbit to get the reward! (" + coords + ")" ); m_botAction.sendPrivateMessage( wabbit, "You are no longer the wabbit!" ); m_botAction.sendPrivateMessage( killer, "You are the new wabbit! You have been given the reward: 100,000 points." ); wabbit = killer; } |
Code: Show/Hide public String getPlayerLocation(int xtiles, int ytiles)
{ char x = ('A' + xtiles * 20 / 1024); short y = (ytiles * 20 / 1024) + 1; return (""+ x + y); } |