blob: 77e8bdb2d01c662405175a4cefdbf8ee4a13a080 [file] [log] [blame]
notstromd1dec4a2018-12-03 10:20:32 +01001/*
notstrom5a93e5a2018-12-09 18:18:39 +01002 Eine Moeglichkeit, eine Waffe nur fuer einen NPC zur Verfuegung zu
3 stellen ist ein wenig frustrierend fuer Spieler. Man sollte Beispiele
notstromd60962e2018-12-09 18:17:44 +01004 wie dieses nicht ungeprueft uebernehmen. Waffen, die kein Spieler zuecken
5 kann, stossen meist nicht auf sehr hohen Enthusiasmus beim Spieler, die
6 betreffende Gegend mehrmals zu aufzusuchen.
notstromd1dec4a2018-12-03 10:20:32 +01007*/
notstrom2b580792018-12-03 10:12:20 +01008inherit "/std/weapon";
9
notstromd60962e2018-12-09 18:17:44 +010010#include <new_skills.h>
notstrom2b580792018-12-03 10:12:20 +010011#include __PATH__(1)"defs.h"
12
13
14protected void create() {
15 if (!clonep()) {
16 set_next_reset(-1);
17 return;
18 }
19 ::create();
20
21 SetProp(P_SHORT, "Eine besondere Axt");
22 SetProp(P_LONG, BSLF(
23 "Dies ist die Axt von Kawumm, dem Zwerg. Niemand kann so damit zuhauen "
24 "wie er."));
25
26 SetProp(P_NAME, "Axt");
27 SetProp(P_GENDER, FEMALE);
28 AddId(({"axt"}));
29
notstromd60962e2018-12-09 18:17:44 +010030 SetProp(P_WC, 180);
notstrom2b580792018-12-03 10:12:20 +010031 SetProp(P_WEAPON_TYPE, WT_AXE);
32 SetProp(P_DAM_TYPE, DT_SLASH);
33 SetProp(P_NR_HANDS, 1);
34
notstromd60962e2018-12-09 18:17:44 +010035 /* "Restriktionen" bezieht sich hier konkret auf das Zuecken der Waffe.
36 In diesem Beispiel wird das anhand der Function wield_check()
37 ueberprueft, die sich in DIESEM Objekt befinden muss: */
38 SetProp(P_RESTRICTIONS, ([SR_FUN: "wield_check"]));
39
notstrom2b580792018-12-03 10:12:20 +010040 SetProp(P_VALUE, 200);
41 SetProp(P_WEIGHT, 3250);
42 SetProp(P_SIZE, 90);
43
44 SetProp(P_MATERIAL, ([MAT_STEEL:100]));
45}
46
notstromd60962e2018-12-09 18:17:44 +010047public string wield_check() {
48 /* Wir pruefen direkt, ob derjenige, der die Axt im Inventory hat, der
49 legale Besitzer ist. Diese Axt funktioniert also z.B. nicht mehr,
50 wenn man einen anderen NPC damit ausruesten moechte. */
51 if (load_name(ENV()) != __PATH__(1)"npc/zwerg4")
52 return BSLF(
53 "Dies ist Kawumms persoenliche Axt. Sie ist so dermassen unhandlich, "
54 "dass Du sie nicht zuecken kannst.");
55 return 0;
56}