User talk:Kymara: Difference between revisions

Content deleted Content added
imported>Kymara
imported>Kymara
Line 71:
games.stendhal.server.maps.semos.baker.ShopAssistantNPC
Idea: have erna lend out pestle and mortar or sugar mill and expect them back after a certain time. If you don't bring them back but want to borrow another thing, you have to pay for the previous.
 
I did this without an ide so not all functions or conditions might be right ... will check
 
<source lang = "java">
// define a COST int 3000 ?
// String QUEST_SLOT = "borrow_kitchen_equipment";
// List<String> ITEMS of the items;
 
addOffer("Our pizza delivery team can #borrow some kitchen equipment from me.");
Line 96 ⟶ 99:
new QuestNotActiveCondition(QUEST_SLOT)),
ConversationStates.ATTENDING,
// that grammar method or one close to it
"I lend out #'pestle and mortar' and #'sugar mill'.",
"I lend out " + Grammar.enumerateCollectionWithHash(ITEMS) + ".",
// say items from a list would be better
null);
 
// player already has borrowed something it didn't return and will pay for it
add(ConversationStates.ATTENDING, "borrow",
new AndCondition(new QuestActiveCondition(QUEST_SLOT), new NotCondition(new PlayerHasRequiredItemWithHimCondition(QUEST_SLOT))),
ConversationStates.QUEST_ITEM_QUESTIONQUESTION_1,
"You didn't #return what I last lent you! YouDo mustyou returnwant it, or you canto #pay for it ifat youa lost it.cost That'sof " + COST + " money.?",
null);
 
// player already has borrowed something it didn't return and will return it
add(ConversationStates.ATTENDING, "borrow",
new AndCondition(new QuestActiveCondition(QUEST_SLOT), new PlayerHasRequiredItemWithHimCondition(QUEST_SLOT)),
ConversationStates.QUESTION_2,
"You didn't #return what I last lent you! Do you want to return it now?",
null);
 
Line 112 ⟶ 122:
payment.add(new SetQuestAction(QUEST_SLOT, "done"));
payment.add(new DecreaseKarmaAction(10));
add(ConversationStates.QUEST_ITEM_QUESTION, "pay"QUESTION_1,
ConversationPhrases.YES_MESSAGES,
new PlayerHasItemWithHimCondition("money", COST),
ConversationStates.ATTENDING,
Line 122 ⟶ 133:
return.add(new DropRequiredItemAction(QUEST_SLOT));
return.add(new SetQuestAction(QUEST_SLOT, "done"));
add(ConversationStates.QUEST_ITEM_QUESTION, "return"QUESTION_2,
ConversationPhrases.YES_MESSAGES,
new QuestActiveCondition(QUEST_SLOT)), ▼
new PlayerHasRequiredItemWithHimCondition(QUEST_SLOT)),
ConversationStates.ATTENDING,
"Thank you! Just let me know if you want to #borrow any tools again.",
new MultipleActions(return));
 
// TODO: NO for both
// TODO: a block of saying the item name and storing that item name into the quest slot, and giving the item.▼
 
 
▲// TODO: a block of saying the item name and storing that item name into the quest slot, and giving the item.
 
// TODO: give the item and store it in the quest slot as item name, or itemname = 1 if you feel better about that
add(ConversationStates.ATTENDING,
new TriggerInListCondition(ITEMS),
new AndCondition(
new LevelGreaterThanCondition(5),
new QuestCompletedCondition("pizza_delivery"),
new QuestNotActiveCondition(QUEST_SLOT))
ConversationStates.ATTENDING,
"Here you are! Don't forget to #return it or you have to pay!",
null);
// TODO: say the item name when not in correct conditions should give some appropriate message - or use null condition for a generic message about the item?
 
// player asks about pay from attending state
add(ConversationStates.ATTENDING, "pay",
▲ new QuestActiveCondition(QUEST_SLOT)),
ConversationStates.QUESTION_1,
"If you lost what I lent you, you can pay " + COST + " money. Do you want to pay now?",
null);
 
// player asks about return from attending state
add(ConversationStates.ATTENDING, "return",
new QuestActiveCondition(QUEST_SLOT)),
ConversationStates.QUESTION_2,
"Do you want to return what you borrowed now?",
null);
 
</source>
Return to the user page of "Kymara".