MG Mud User | 88f1247 | 2016-06-24 23:31:02 +0200 | [diff] [blame^] | 1 | #pragma strong_types,save_types |
| 2 | |
| 3 | #include <defines.h> |
| 4 | #include <moving.h> |
| 5 | #include <properties.h> |
| 6 | #include <language.h> |
| 7 | |
| 8 | private nosave object pl; |
| 9 | |
| 10 | void create() |
| 11 | { |
| 12 | if( IS_BLUE(ME) ) return; |
| 13 | shadow( PL, 1); |
| 14 | pl = PL; |
| 15 | } |
| 16 | |
| 17 | int |
| 18 | AddExp(int ep) |
| 19 | { |
| 20 | object block; |
| 21 | int diff, lim; |
| 22 | |
| 23 | block = present("\n block", pl); |
| 24 | lim = 30 + random(10); |
| 25 | |
| 26 | if ( ep > lim && // Mindestwert |
| 27 | previous_object() && |
| 28 | ( previous_object() == pl || // zB. GiveQuest() |
| 29 | ( living(previous_object()) && // Oder NPCs |
| 30 | !query_once_interactive(previous_object()) |
| 31 | ) |
| 32 | ) |
| 33 | ) |
| 34 | { |
| 35 | diff = block->Gutschreiben(ep-lim); |
| 36 | return pl->AddExp(lim+diff); |
| 37 | } |
| 38 | return pl->AddExp(ep); |
| 39 | } |
| 40 | |
| 41 | void |
| 42 | SeherHatGenug() |
| 43 | { |
| 44 | unshadow(); |
| 45 | destruct(this_object()); |
| 46 | } |
| 47 | |