Package games.stendhal.server.entity.npc

Examples of games.stendhal.server.entity.npc.SpeakerNPC.say()


            if (Rand.throwCoin() == 1) {
              rewardClass = "cod";
            } else {
              rewardClass = "perch";
            }
            npc.say("Thank you! Here, take some " + rewardClass + "! I do not like to eat them.");
            final StackableItem reward = (StackableItem) SingletonRepository.getEntityManager().getItem(rewardClass);
            reward.setQuantity(20);
            player.equipOrPutOnGround(reward);
            player.notifyWorldAboutChanges();
          }
View Full Code Here


            StringBuffer saybuf = new StringBuffer();
            saybuf.append("my ice ");
            for (int i = 0; i < N; i++) {
              saybuf.append(":) ");
            }
          npc.say(saybuf.toString());
        }
      });
               
  }
View Full Code Here

              public void fire(final Player player,
                  final Sentence sentence,
                  final EventRaiser npc) {
                int grilledsteakAmount = Rand.rand(4) + 1;
                new EquipItemAction("grilled steak", grilledsteakAmount, true).fire(player, sentence, npc);
                npc.say("Thank you!! Take " + Grammar.thisthese(grilledsteakAmount) + " " +
                    Grammar.quantityNumberStrNoun(grilledsteakAmount, "grilled steak") + " from my grill!");
                new SetQuestAndModifyKarmaAction(getSlotName(), "waiting;"
                    + System.currentTimeMillis(), 10.0).fire(player, sentence, npc);
              }
            }));
View Full Code Here

              saidStr = npcDoneText[1];
            } else {
              // compatibility with broken quests
              logger.warn("Player " + player.getTitle() + " found with find_ghosts quest slot in state " + player.getQuest(QUEST_SLOT) + " - now setting this to done.");
              player.setQuest(QUEST_SLOT, "done");
              npc.say("Sorry, it looks like you have already found them after all. I got confused");
              player.notifyWorldAboutChanges();
              npc.setCurrentState(ConversationStates.ATTENDING);
              return;
            }
View Full Code Here

            // we may have changed the missing list
            missing = missingNames(player);

            if (!missing.isEmpty()) {
              reply += " If you met any other spirits, please tell me their name.";
              npc.say(reply);
            } else {
              player.setBaseHP(50 + player.getBaseHP());
              player.heal(50, true);
              player.addXP(5000);
              player.addKarma(15);
View Full Code Here

              player.setBaseHP(50 + player.getBaseHP());
              player.heal(50, true);
              player.addXP(5000);
              player.addKarma(15);
              reply += " Now that I know those 4 names, perhaps I can even reach the spirits with my mind. I can't give you anything of material value, but I have given you a boost to your basic wellbeing, which will last forever. May you live long, and prosper.";
              npc.say(reply);
              player.setQuest(QUEST_SLOT, "done");
              player.notifyWorldAboutChanges();
              npc.setCurrentState(ConversationStates.ATTENDING);
            }
          }
View Full Code Here

            .getItem("red lionfish");
        int redlionfishamount;
        redlionfishamount = Rand.roll1D6();
        red_lionfish.setQuantity(redlionfishamount);
        player.equipOrPutOnGround(red_lionfish);
        npc.say("Thank you! Take " + Grammar.thisthese(redlionfishamount) + " " +  Grammar.quantityplnoun(redlionfishamount,"red lionfish","") + "! I got some from a guy who visited Amazon island some time ago, maybe you need " + Grammar.itthem(redlionfishamount) + " for something.");

      }
    };
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("flower", "zantedeschia", "fine", "amber", "done"),
View Full Code Here

                //put the rewarded bottles on the counter
                final IRPZone zone = SingletonRepository.getRPWorld().getZone("int_wofol_bar");
                koboldish_torcibud_vsop.setPosition(3, 3);
                zone.add(koboldish_torcibud_vsop);

                npc.say(
                    "Wrof! Here take "
                    + Integer.toString(torcibud_bottles)
                    + " bottles of my V.S.O.P. Koboldish Torcibud with my best wishes for you!");
            }
        };
View Full Code Here

        goldamount = 5 * Rand.roll1D6();
        goldbars.setQuantity(goldamount);
        // goldbars.setBoundTo(player.getName()); <- not sure
        // if these should get bound or not.
        player.equipOrPutOnGround(goldbars);
        npc.say("Thank you! Take these " + Integer.toString(goldamount) + " gold bars, I have plenty. And, listen: If you'd ever like to get me another, be sure to ask me first. Rose Leigh is superstitious, she won't give the bloom unless she senses you need it.");
      }
    };
    npc.add(ConversationStates.ATTENDING,
        Arrays.asList("flower", "Rhosyd"),
        new AndCondition(new QuestInStateCondition(QUEST_SLOT, 0, "got_flower"), new PlayerHasItemWithHimCondition("rhosyd")),
View Full Code Here

                player.removePet(pet);
                // reward with some karma but limit abuse
                if (player.getKarma() < 60.0) {
                  player.addKarma(30.0);
                }
                npc.say("Thank you for rescuing this " + petName + ", I will take good care of it. Remember you can come back "
                + "and visit the pet sanctuary any time you like!");
                notifyWorldAboutChanges();
              } else {
                // there was no room for the pet
                npc.say("It looks like we don't have any space left in our pet sanctuary! I hope you can look after this " + petName + " a little longer.")
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.