User talk:Kymara: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>Kymara |
imported>Kymara |
||
| Line 71: | Line 71: | ||
games.stendhal.server.maps.semos.baker.ShopAssistantNPC |
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. |
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"> |
<source lang = "java"> |
||
// define a COST int 3000 ? |
// define a COST int 3000 ? |
||
// String QUEST_SLOT = "borrow_kitchen_equipment"; |
// String QUEST_SLOT = "borrow_kitchen_equipment"; |
||
// List<String> ITEMS of the items; |
|||
addOffer("Our pizza delivery team can #borrow some kitchen equipment from me."); |
addOffer("Our pizza delivery team can #borrow some kitchen equipment from me."); |
||
| Line 96: | Line 99: | ||
new QuestNotActiveCondition(QUEST_SLOT)), |
new QuestNotActiveCondition(QUEST_SLOT)), |
||
ConversationStates.ATTENDING, |
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); |
null); |
||
// player already has borrowed something it didn't return |
// player already has borrowed something it didn't return and will pay for it |
||
add(ConversationStates.ATTENDING, "borrow", |
add(ConversationStates.ATTENDING, "borrow", |
||
new QuestActiveCondition(QUEST_SLOT)), |
new AndCondition(new QuestActiveCondition(QUEST_SLOT), new NotCondition(new PlayerHasRequiredItemWithHimCondition(QUEST_SLOT))), |
||
ConversationStates. |
ConversationStates.QUESTION_1, |
||
"You didn't #return what I last lent you! |
"You didn't #return what I last lent you! Do you want to pay for it at a cost of " + 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); |
null); |
||
| Line 112: | Line 122: | ||
payment.add(new SetQuestAction(QUEST_SLOT, "done")); |
payment.add(new SetQuestAction(QUEST_SLOT, "done")); |
||
payment.add(new DecreaseKarmaAction(10)); |
payment.add(new DecreaseKarmaAction(10)); |
||
add(ConversationStates. |
add(ConversationStates.QUESTION_1, |
||
ConversationPhrases.YES_MESSAGES, |
|||
new PlayerHasItemWithHimCondition("money", COST), |
new PlayerHasItemWithHimCondition("money", COST), |
||
ConversationStates.ATTENDING, |
ConversationStates.ATTENDING, |
||
| Line 122: | Line 133: | ||
return.add(new DropRequiredItemAction(QUEST_SLOT)); |
return.add(new DropRequiredItemAction(QUEST_SLOT)); |
||
return.add(new SetQuestAction(QUEST_SLOT, "done")); |
return.add(new SetQuestAction(QUEST_SLOT, "done")); |
||
add(ConversationStates. |
add(ConversationStates.QUESTION_2, |
||
ConversationPhrases.YES_MESSAGES, |
|||
| ⚫ | |||
new PlayerHasRequiredItemWithHimCondition(QUEST_SLOT)), |
|||
ConversationStates.ATTENDING, |
ConversationStates.ATTENDING, |
||
"Thank you! Just let me know if you want to #borrow any tools again.", |
"Thank you! Just let me know if you want to #borrow any tools again.", |
||
new MultipleActions(return)); |
new MultipleActions(return)); |
||
// TODO: NO for both |
|||
| ⚫ | |||
| ⚫ | |||
// 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", |
|||
| ⚫ | |||
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> |
</source> |
||