blob: fa716fe564c1f1efa5052f1a533a560988503e7a [file] [log] [blame]
Zesstra18626972017-01-31 10:38:27 +01001ModifySkill()
2=============
3
4FUNKTION
5--------
6::
7
8 public varargs void ModifySkill(string sname, mixed val,
9 int diff, string gilde)
10
11DEFINIERT IN
12------------
13::
14
15 /std/living/skills.c
16
17ARGUMENTE
18---------
19::
20
21 string sname der zu aendernde Skill
22 mixed val Aenderungswert: int fuer SI_SKILLABILITY, sonst mapping
23 int diff Schwierigkeit (optional: default ist existierendes diff)
24 string gilde Gilde (optional: default ist eigene Gilde)
25
26BESCHREIBUNG
27------------
28::
29
30 Mit der Methode kann man die Werte eines Skills/Spells veraendern. Dabei
31 wird ein Skill immer in ein Mapping umgewandelt (Skills/Spells koennen
32 auch einfach nur ihren Skillwert enthalten, diese ist aequivalent zu
33 einem Mapping mit ([SI_SKILLABILITY:<Skillwert>]).
34
35 Ist 'val' ein int, wird dieses als SI_SKILLABILITY gesetzt. Falls der
36 Skill nur ein int war, wird ein 'diff'!=0 als SI_DIFFICULTY gesetzt.
37
38 Ist 'val' ein Mapping, wird dieses zum Skillmapping addiert.
39
40
41
42 Etwaige SI_SKILLABILITY-Aenderungen laufen danach noch durch LimitAbility.
43
44BEISPIELE
45---------
46::
47
48 // #1a: Lerne einen Spell/Skill (einer Gilde)
49 caster->ModifySkill("feuerball", MAX_ABILITY, 100, "abenteurer")
50 // #1b: ... oder ...
51 caster->ModifySkill("feuerball", ([SI_SKILLABILITY: MAX_ABILITY]), 100,
52 "abenteurer")
53 // #1c: ... oder fuer einen Abenteurer ...
54 caster->ModifySkill("feuerball", ([SI_SKILLABILITY: MAX_ABILITY]), 100);
55
56
57
58 // #2: Setze eine Skill-Funktion fuer einen Kampfskill des Klerus
59 this_player()->ModifySkill(FIGHT(WT_CLUB),
60 ([SI_SKILLFUNC: "Keulenkampf",
61 SI_DIFFICULTY: 100]),
62 100, "klerus");
63
64 // #3: Speichere im Skill (also Spieler) eine Option fuer diesen Skill
65 // Vorteil: dieser Eintrag wird dem Spell immer uebergeben
66 caster->ModifySkill("blitz", (["klerus_spell_option": 2]));
67
68 (Code in /doc/beispiele/testobjekte/modifyskillspell_test)
69 // #4: Lerne einen unabhaengigen Spell: ACHTUNG
70 // dieser Spell funktioniert nur solange, wie die Closure existiert,
71 // SI_SKILLABILITY und Spell bleiben jedoch im Spieler gespeichert (!)
72 this_player()->ModifySkill("fnrx",
73 ([SI_CLOSURE:
74 function int (object caster, string skill, mapping sinf) {
75 caster->LearnSkill("fnrx", 1);
76 tell_object(caster, "Peng! Dein Skillwert steigt auf "+
77 caster->QuerySkillAbility("fnrx")+".\n");
78 return ERFOLG;
79 },
80 SI_SKILLABILITY: 8432]),
81 100,
82 "ANY");
83
84SIEHE AUCH
85----------
86::
87
88 Skills Lernen: LearnSkill, LimitAbility
89 * Nutzung: UseSpell, UseSkill
90 * Abfragen: QuerySkill, QuerySkillAbility
91 * Modifikation: ModifySkillAttribute, QuerySkillAttribute,
92 QuerySkillAttributeModifier, RemoveSkillAttributeModifier
93 * Properties: P_SKILL_ATTRIBUTES, P_SKILL_ATTRIBUTE_OFFSETS
94 * sonstig: spruchermuedung
95 * Properties: P_NEWSKILLS
96
973. Okt 2011 Gloinson
98