Examples of GameEvent


Examples of games.stendhal.server.core.engine.GameEvent

    }

    if (action.has(TEXT)) {
      final String text = action.get(TEXT);
      player.put("text", text);
      new GameEvent(player.getName(), "chat",  null, Integer.toString(text.length()), text.substring(0, Math.min(text.length(), 1000))).raise();

      player.notifyWorldAboutChanges();
      SingletonRepository.getRuleProcessor().removePlayerText(player);
    }
  }
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

      state = "off";
    } else {
      player.setInvisible(true);
      state =  "on";
    }
    new GameEvent(player.getName(), INVISIBLE, state).raise();

  }
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

      final String message = action.get(TEXT)
          + "\r\nPlease use #/supportanswer #" + player.getTitle()
          + " to answer.";

      new GameEvent(player.getName(), "support", player.getName(), action.get(TEXT)).raise();

      SingletonRepository.getRuleProcessor().sendMessageToSupporters(player.getTitle(), message);

      player.sendPrivateText("You ask for support: "
          + action.get(TEXT)
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

    this.getZone().storeToDatabase();
    String itemname = "null";
    if (o.hasItem()) {
      itemname = o.getItem().getName();
    }
    new GameEvent("market", "expire-offer", o.getOfferer(), itemname, o.getPrice().toString()).raise();
  }
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

      final StendhalRPZone zone = (StendhalRPZone) SingletonRepository.getRPWorld().getRPZone(
          zoneid);
      final int x = action.getInt(X);
      final int y = action.getInt(Y);
      new GameEvent(player.getName(), TELEPORT, action.get(TARGET), zone.getName(), Integer.toString(x), Integer.toString(y)).raise();
      teleported.teleport(zone, x, y, null, player);
     
      SingletonRepository.getJail().grantParoleIfPlayerWasAPrisoner(teleported);
    }
  }
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

    // get the canonical name
    who = validNames.iterator().next();
    final Player buddy = SingletonRepository.getRuleProcessor().getPlayer(who);

    if (player.addBuddy(who, (buddy != null) && !buddy.isGhost())) {
      new GameEvent(player.getName(), "buddy", "add", who).raise();
      player.sendPrivateText(who + " was added to your buddy list.");
    } else {
      player.sendPrivateText(who + " was already on your buddy list.");
    }
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

          default:
              // we switch over an enum
              break;
          }
         
          new GameEvent(player.getName(), ALTER, action.get(TARGET), stat, Integer.toString(numberValue)).raise();
          changed.put(stat, numberValue);
        } else {
          // If value is not a number, only SET and UNSET can be used
          if (mode.equalsIgnoreCase(SET)) {
            new GameEvent(player.getName(), ALTER, action.get(TARGET), stat, action.get(VALUE)).raise();
            changed.put(stat, action.get(VALUE));

          } else if (mode.equalsIgnoreCase(UNSET)) {
            if (type.getType() != Type.FLAG) {
              player.sendPrivateText("Attribute to be unset is not of type 'flag'.");
              return;
            }
            new GameEvent(player.getName(), ALTER, action.get(TARGET), stat, "unset").raise();
            changed.remove(stat);
          }
        }

        changed.update();
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

   */
  public void setQuest(final String name, final String status) {
    final String oldStatus = player.getKeyedSlot("!quests", name);
    player.setKeyedSlot("!quests", name, status);
    if ((status == null) || !status.equals(oldStatus)) {
      new GameEvent(player.getName(), "quest", name, status).raise();
    }
    // check for reached achievements
    SingletonRepository.getAchievementNotifier().onFinishQuest(player);
  }
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

    if (action.has("target")) {
      String target = action.get("target");
      String adminnote = action.get("note");

      Logger.getLogger(AdminNoteAction.class).info(player.getName() + " has added an adminnote to " + target + " saying: " + adminnote);
      new GameEvent(player.getName(), "adminnote",  target, adminnote).raise();       
      SingletonRepository.getRuleProcessor().sendMessageToSupporters("JailKeeper",
          player.getName() + " has added an adminnote to " + target
          + " saying: " + adminnote);
    }
  }
View Full Code Here

Examples of games.stendhal.server.core.engine.GameEvent

          final Present present = (Present) SingletonRepository.getEntityManager().getItem("present");
          present.setContent(itemName);
          player.drop(itemName);
          player.equipToInventoryOnly(present);

          new GameEvent(player.getName(), "wrap", itemName).raise();

          player.updateItemAtkDef();
      } else {
      player.sendPrivateText("You don't have any " + itemName);
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.