MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | // (c) by Padreic (Padreic@mg.mud.de) |
| 2 | |
| 3 | #include "../files.h" |
| 4 | #include <combat.h> |
| 5 | #include <moving.h> |
| 6 | #include <new_skills.h> |
| 7 | |
| 8 | inherit NPC("stdnpc"); |
| 9 | inherit MNPC_MOVING; |
| 10 | |
| 11 | void create() |
| 12 | { |
| 13 | if (!clonep(ME)) return; |
| 14 | stdnpc::create(); |
| 15 | moving::mnpc_create(); |
| 16 | SetProp(P_NAME_ADJ, "alt"); |
| 17 | SetProp(P_NAME, "Eiche"); |
| 18 | SetProp(P_SHORT, "Eine alte Eiche"); |
| 19 | SetProp(P_MSGOUT, "wandert"); |
| 20 | SetProp(P_LONG, |
| 21 | "Vor Dir steht eine sehr sehr alte Eiche. Doch diese Eiche ist keine\n" |
| 22 | +"gewoehnliche Eiche, wie Du sie bereits an vielen anderen Stellen gesehn hast.\n" |
| 23 | +"Diese Eiche lebt! Du kannst deutlich einen Mund, eine Nase und sogar zwei\n" |
| 24 | +"Ohren erkennen. Sie ist eigentlich sehr friedlich gesonnen, kann aber auch\n" |
| 25 | +"sehr sehr boese werden, wenn es jemand wagt die Ruhe des Waldes zu stoeren.\n"); |
| 26 | SetProp(P_RACE, "eiche"); |
| 27 | SetProp(P_LEVEL, 50); |
| 28 | SetProp(P_ATTRIBUTES, (["int":50,"con":50,"str":70,"dex":15]) ); |
| 29 | SetProp(P_GENDER, FEMALE); |
| 30 | SetProp(P_MAX_HP, 500); |
| 31 | SetProp(P_HP, 500); |
| 32 | SetProp(P_ALIGN, 500); |
| 33 | SetProp(P_BODY, 100); |
| 34 | SetProp(P_SIZE, 650+random(151)); |
| 35 | AddAdjective("alt"); |
| 36 | AddId(({"eiche", "eichen", WALDID("eiche") })); |
| 37 | SetProp(P_HANDS, ({" mit einem ihrer langen Aeste",400, DT_WHIP}) ); |
| 38 | SetProp(P_SKILL_ATTRIBUTE_OFFSETS, ([SA_SPEED:180])); |
| 39 | SetProp(P_NOCORPSE, 1); |
| 40 | SetProp(P_XP, 500*400*5); |
| 41 | SetProp(P_DEFAULT_INFO, "bleibt absolut regungslos und reagiert ueberhaupt nicht.\n"); |
| 42 | SetProp(P_RESISTANCE_STRENGTHS, |
| 43 | ([DT_SLASH: 0.1, |
| 44 | DT_MAGIC: -1.0, |
| 45 | DT_BLUDGEON: -0.5, |
| 46 | DT_POISON: 0.25, |
| 47 | DT_HOLY: -1.0, |
| 48 | DT_RIP: 0.25, |
| 49 | DT_FIRE: 0.25, |
| 50 | DT_PIERCE: -0.5, |
| 51 | DT_WHIP: -1.0 ]) ); |
| 52 | SetProp(MNPC_AREA, ({ ROOM("weg2"), ROOM("lichtung") }) ); |
| 53 | SetProp(MNPC_RANDOM, 10); |
| 54 | SetProp(MNPC_DELAY, 8); |
| 55 | SetProp(MNPC_WALK_TIME, 600); |
| 56 | SetProp(MNPC_FLAGS, MNPC_WALK|MNPC_NO_WALK_IN_FIGHT|MNPC_ONLY_EXITS); |
| 57 | } |
| 58 | |
| 59 | static string _query_info() |
| 60 | { |
| 61 | if (!PL || PL->QueryProp(ZAUBERWALD)<=time()) |
| 62 | return "Die alte Eiche ist Dir sehr friedlich gesonnen. Es ist jedoch auch sicher\n" |
| 63 | +"klug dieses nicht zu aendern, da sie mit ihren Aesten wohl auch sehr kraeftig\n" |
| 64 | +"zuschlagen kann.\n"; |
| 65 | return "Du hast den Zorn der alten Eiche auf Dich gezogen, das war ganz und gar nicht\n" |
| 66 | +"klug von Dir. Jetzt lebe auch mit den Konsequenzen....\n"; |
| 67 | } |
| 68 | |
| 69 | int remove() |
| 70 | // wenn eine Eiche getoetet wird, dann verlangsamt das den reset der Eiche |
| 71 | // die auf weg2 blockt. In der Regel steht ja auch so schon immer eine der |
| 72 | // wanderden Eichen dort. Dies soll verhindern, das gerade eine Eiche resetet |
| 73 | // wenn man eine tod hat. |
| 74 | { |
| 75 | call_other(ROOM("weg2"), "delay_reset"); |
| 76 | catch(call_other(QueryProp(MNPC_HOME), "delay_reset", 900+random(3600))); |
| 77 | return (int)::remove(); |
| 78 | } |
| 79 | |
| 80 | // wenn man den MNPC mit einem anderen stdnpc kombiniert muessen einige |
| 81 | // funktionen per Hand ueberschrieben werden.... |
| 82 | |
| 83 | void reset() |
| 84 | { |
| 85 | stdnpc::reset(); |
| 86 | moving::mnpc_reset(); |
| 87 | } |
| 88 | |
| 89 | void init() |
| 90 | { |
| 91 | stdnpc::init(); |
| 92 | moving::mnpc_init(); |
| 93 | } |
| 94 | |
| 95 | varargs int move(mixed dest, int meth, string dir, string out, string in) |
| 96 | { |
| 97 | int i; |
| 98 | |
| 99 | // extra fuer den Zauberwald eingebaut |
| 100 | if (environment() && object_name(environment())==ROOM("weg2")) { |
| 101 | // wenn es die einzige Eiche ist, dann bleibt sie hier stehn, |
| 102 | // bewacht den Weg und bewegt sich nicht mehr hier weg! |
| 103 | object *inv; |
| 104 | |
| 105 | inv = all_inventory(environment()) - ({ ME }); |
| 106 | for (i=sizeof(inv)-1; i>=0; i--) |
| 107 | if (BLUE_NAME(inv[i])==NPC("laufeiche")) break; |
| 108 | if (i<0) return ME_CANT_LEAVE_ENV; |
| 109 | } |
| 110 | ////////////////////////////////////// |
| 111 | i=(int)stdnpc::move(dest, meth, dir, out, in); |
| 112 | if (i!=1) return i; |
| 113 | moving::mnpc_move(); |
| 114 | return 1; |
| 115 | } |
| 116 | |
| 117 | int PreventFollow(object dest) |
| 118 | { return moving::mnpc_PreventFollow(dest); } |
| 119 | |
| 120 | void NotifyPlayerDeath(object who, object killer, object lost_exp) |
| 121 | { |
| 122 | if (!who || killer!=ME) return; // uninteressant |
| 123 | log_file("padreic/kill", ctime(time())+" "+capitalize(getuid(who))+" getoetet von /zauberwald/laufeiche\n"); |
| 124 | } |