Package games.stendhal.server.entity.creature

Examples of games.stendhal.server.entity.creature.Sheep


        // If quest is offered and player says yes, give a sheep to him.
        List<ChatAction> sheepActions = new LinkedList<ChatAction>();
        sheepActions.add(new SetQuestAction(QUEST_SLOT, "start"));
        sheepActions.add(new ChatAction() {
            public void fire(Player player, Sentence sentence, EventRaiser npc) {
                final Sheep sheep = new Sheep(player);
                StendhalRPAction.placeat(npc.getZone(), sheep, npc.getX(), npc.getY() + 1);
            }
        });
        npc.add(
                ConversationStates.QUEST_OFFERED,
View Full Code Here


        // Remove action
        final List<ChatAction> removeSheepAction = new LinkedList<ChatAction>();
        removeSheepAction.add(new ChatAction() {
            public void fire(Player player, Sentence sentence, EventRaiser npc) {
                // remove sheep
                final Sheep sheep = player.getSheep();
                if(sheep != null) {
                    player.removeSheep(sheep);
                    player.notifyWorldAboutChanges();
                    if(npc.getEntity() instanceof SheepBuyerSpeakerNPC) {
                        ((SheepBuyerSpeakerNPC)npc.getEntity()).moveSheep(sheep);
                    } else {
                        // only to prevent that an error occurs and the sheep does not disappear
                        sheep.getZone().remove(sheep);
                    }
                } else {
                    // should not happen
                    npc.say("What? What sheep? Did I miss something?");
                    npc.setCurrentState(ConversationStates.IDLE);
View Full Code Here

TOP

Related Classes of games.stendhal.server.entity.creature.Sheep

Copyright © 2018 www.massapicom. 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.