Fix example.
diff --git a/npc/zwerg5.c b/npc/zwerg5.c
index 03941b8..818dd81 100644
--- a/npc/zwerg5.c
+++ b/npc/zwerg5.c
@@ -4,8 +4,6 @@
#include __PATH__(1)"defs.h"
-private int ausholen;
-
protected void create() {
if (!clonep()) {
set_next_reset(-1);
@@ -39,29 +37,31 @@
AddItem(__PATH__(1)"obj/axt2", REFRESH_NONE|CLONE_WIELD);
}
+private void festedruff() {
+ // wichtig: auf Paralyse pruefen!
+ if (!objectp(TP) || (ENV(TP) != ENV()) || QueryProp(P_DISABLE_ATTACK))
+ return;
+
+ mixed waffe = QueryProp(P_WEAPON);
+ string* damtype = ({DT_BLUDGEON});
+ if (waffe) damtype = waffe->QueryProp(P_DAM_TYPE);
+
+ tell_room(ENV(), BSLF(
+ "Kawumm semmelt mal so richtig feste drauf. RRRRUMMMMS."));
+ enemy->Defend(1000, damtype, 0, TO);
+}
+
/* Ab und zu (20% Chance) startet Kawumm eine starke Attacke, die braucht
dann aber ein paar Runden: */
void Attack(object enemy) {
- if (ausholen) {
- if (ausholen == 1) {
- mixed waffe = QueryProp(P_WEAPON);
- string* damtype = ({DT_BLUDGEON});
- if (waffe) damtype = waffe->QueryProp(P_DAM_TYPE);
-
- tell_room(ENV(), BSLF(
- "Kawumm semmelt so richtig feste zu."));
- enemy->Defend(300, damtype, 0, TO);
- }
- --ausholen;
- return;
- }
-
- if (!random(5)) {
- ausholen = 3;
+ if (!random(5) && find_call_out(#'festedruff) == -1 &&
+ !QueryProp(P_DISABLE_ATTACK)) {
tell_room(ENV(), BSLF(
- "Kawumm holt mal so richtig weit aus, um dann um so fester "
- "zuzuschlagen."));
+ "Kawumm holt richtig weit aus ..."));
+ call_out(#'festedruff, 3, TP);
return;
}
+
::Attack(enemy);
}
+