12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- event.load("quest_start");
- event.load("quest_term");
- event.load("entity_click");
- event.load("item_use_finish");
- stage = 0;
- all_stages = 2;
- quest_name = "Nüchtern werden";
- cow_loc = loc.new(world.get("story"), -1642, 66, -972);
- @wait
- wait();
- if(!player.isQuester(player, script)) {
- goto("wait");
- }
- if(event == "quest_term") {
- entity.cleareffects(player);
- entity.remove(cow_ent);
- wait(); //Script wird von außen terminiert
- }
- if(event == "quest_start") {
- entity.addEffect(player, "nausea", 9999, 0);
- quest.display(player, quest_name, stage, all_stages);
- player.giveSingleItem(player, read.item("minecraft:bucket"), false);
- cow_ent = entity.spawn("cow", cow_loc);
- msg.prefix(player, "§dKumpel", "Nimm dir diesen Eimer und melke eine Kuh. Trink die Milch, dann gehts dir besser.");
- goto("wait");
- }
- label = concat("stage", text.number(stage));
- goto(label);
- @stage0
- if(event == "entity_click" && entity.getType(entity) == "cow") {
- item = living.getEquip(player, "hand");
- item_type = item.getType(item);
- if(item_type == "minecraft:bucket") {
- stage.increase(player);
- }
- }
- goto("wait");
- @stage1
- if(event == "item_use_finish") {
- if(!isPlayer(living_entity)) {
- goto("wait");
- }
- player = living_entity;
- item_type = item.getType(item);
- if(item_type == "minecraft:milk_bucket") {
- msg.prefix(player, "§dKumpel", "Sag ich doch. Milch hilft immer.");
- player.setShipProgress(player, 2);
- entity.remove(cow_ent);
- msg(player, "§dQuest abgeschlossen. Belohnung: 3 Snuvis!");
- addMoney(player, 3);
- quest.finish(script, player);
- }
- }
- goto("wait");
|