Zesstra | 1862697 | 2017-01-31 10:38:27 +0100 | [diff] [blame] | 1 | QueryBuyValue() |
| 2 | =============== |
| 3 | |
| 4 | QueryBuyValue() |
| 5 | |
| 6 | Funktion |
| 7 | static varargs int QueryBuyValue(mixed ob, object client) |
| 8 | |
| 9 | Definiert in |
| 10 | /std/room/shop |
| 11 | |
| 12 | Argumente |
| 13 | ob |
| 14 | Das zu kaufende Objekt (String oder object). |
| 15 | Im Normalfall handelt es sich um ein Objekt. Ausnahme sind |
| 16 | Gegenstaende, die mit AddFixedObject() hinzugefuegt wurden. |
| 17 | client |
| 18 | Der Kaeufer. |
| 19 | |
| 20 | Beschreibung |
| 21 | Ermittelt den Preis, den <client> fuer <ob> zu bezahlen hat. |
| 22 | |
| 23 | Rueckgabewert |
| 24 | Der Preis als Integer. |
| 25 | |
| 26 | Beispiel |
| 27 | Ein Haendler, der Spielern die ihm geholfen haben einen Rabatt von 10% |
| 28 | gewaehrt |
| 29 | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 30 | :: |
| 31 | |
| 32 | |
| 33 | |
| 34 | object *helpers; |
| 35 | protected void create() |
| 36 | { |
| 37 | ::create(); |
| 38 | helpers=({}); |
| 39 | ... |
| 40 | } |
| 41 | |
| 42 | |
| 43 | |
| 44 | static varargs int QueryBuyValue(mixed ob, object client) |
| 45 | { |
| 46 | if(member(helpers,client)!=-1) |
| 47 | { |
| 48 | return ::QueryBuyValue(ob,client)*9/10; |
| 49 | } |
| 50 | return ::QueryBuyValue(ob,client); |
| 51 | } |
| 52 | |
| 53 | Siehe auch: |
| 54 | Funktionen: |
| 55 | AddFixedObject(), RemoveFixedObject(), SetStorageRoom(), |
| 56 | QueryStorageRoom(), QueryBuyFact(), sell_obj(), buy_obj() |
| 57 | Properties: |
| 58 | P_KEEPER, P_MIN_STOCK, P_STORE_CONSUME |
| 59 | |
| 60 | |
| 61 | Letzte Aenderung: 21.05.2014, Bugfix |
| 62 | |