Package games.stendhal.server.script

Source Code of games.stendhal.server.script.EventTest

/* $Id: EventTest.java,v 1.5 2008/07/12 14:43:48 astridemma Exp $ */
package games.stendhal.server.script;

import games.stendhal.server.core.scripting.ScriptImpl;
import games.stendhal.server.entity.player.Player;

import java.util.List;

import marauroa.common.game.Definition;
import marauroa.common.game.RPClass;
import marauroa.common.game.RPEvent;
import marauroa.common.game.Definition.DefinitionClass;

/**
* Tries to add an RPEvent.
*
* @author hendrik
*/
public class EventTest extends ScriptImpl {

  @Override
  public void execute(final Player admin, final List<String> args) {
    if (args.size() < 1) {
      admin.sendPrivateText("Usage: /script EventTest.class {some-text}");
      return;
    }

    final RPClass rpclass = new RPClass("testevent");
    rpclass.add(DefinitionClass.RPEVENT, "testevent", Definition.STANDARD);

    final RPEvent event = new RPEvent("testevent");
    event.put("arg", args.get(0));
    admin.addEvent(event);
  }
}
TOP

Related Classes of games.stendhal.server.script.EventTest

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.