Benutzer-Werkzeuge

Webseiten-Werkzeuge


Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen gezeigt.

Link zu der Vergleichsansicht

Nächste Überarbeitung
Vorherige Überarbeitung
daedalus:nuetzliches [2015/08/18 22:15]
127.0.0.1 Externe Bearbeitung
daedalus:nuetzliches [2016/12/31 10:11]
milky-way Titel hinzugefügt
Zeile 1: Zeile 1:
-== Inhalt: ​== +====== Nützliches ======
-*[[Daedalus:​nuetzliches|Taschendiebstahl-Dialoge für alle NPCs]] +
-*[[Daedalus:​nuetzliches|Mehr Gilden einfügen]] +
-*[[Daedalus:​nuetzliches| Zufallsfunktion mit passenderer statistischer Verteilung ]] +
-*[[Daedalus:​nuetzliches|[für Fortgeschritene] Zufällige Attribute für Npcs]] +
-*[[Daedalus:​nuetzliches|Automatische Übertragung von Gegenständen von Opfer nach Hero]] +
-*[[Daedalus:​nuetzliches|Kill-Counter erstellen]]+
  
 +===== Taschendiebstahl-Dialoge für alle =====
  
-==  Taschendiebstahl-Dialoge für alle == +<code C>
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​
 // //
Zeile 133: Zeile 127:
   
 }; };
 +</​code>​
  
-==  Mehr Gilden einfügen ==+===== Mehr Gilden einfügen ​=====
  
 Constans.d-Auszug Constans.d-Auszug
 +<code C>
 // ****************** // ******************
 //         ​Gilden //         ​Gilden
Zeile 178: Zeile 174:
  
 const int GIL_HERO ​                   = 9; const int GIL_HERO ​                   = 9;
 +</​code>​
  
 Ich habe hier ein paar Beispiel Gilden zusammen gefügt. Ich habe hier ein paar Beispiel Gilden zusammen gefügt.
Zeile 183: Zeile 180:
 Die Magier genießen hier als Beispiel einen besonderen Stand. Die Magier genießen hier als Beispiel einen besonderen Stand.
 Es gibt noch ein paar Nebengilden und eine Gilde namens Hero, Es gibt noch ein paar Nebengilden und eine Gilde namens Hero,
-damit sich alle Farben bekriegen "​können",​ aber den Sc nich angreifen.+damit sich alle Farben bekriegen "​können",​ aber den Spieler-Charakter ​nich angreifen.
  
 +<code C>
 //Alte gilden bekommen 1 //Alte gilden bekommen 1
 const int GIL_OLD = 1; const int GIL_OLD = 1;
Zeile 210: Zeile 208:
  
 const int GIL_SEPERATOR_HUM ​               = 16    ; const int GIL_SEPERATOR_HUM ​               = 16    ;
 +</​code>​
  
 Dann... Text.d Auszug Dann... Text.d Auszug
 +
 +<code C>
 // **************************************************************************************** // ****************************************************************************************
 // Gildennamen // Gildennamen
Zeile 219: Zeile 220:
  
 //​FixMeHoshi Fokus und Spellnamen abgleichen. (auch    im B_TEachTalentRunes!!) //​FixMeHoshi Fokus und Spellnamen abgleichen. (auch    im B_TEachTalentRunes!!)
 +</​code>​
  
 Und hier noch zwei sachen: Und hier noch zwei sachen:
 Npc_Globals.d:​ Npc_Globals.d:​
 +<code C>
 SetGuild_Text();​ SetGuild_Text();​
      // **********************      // **********************
Zeile 255: Zeile 257:
     TXT_GUILDS[65] = "​Z" ​           ;     TXT_GUILDS[65] = "​Z" ​           ;
 }; };
 +</​code>​
  
 und hier ein Auszug aus einer Npc_Datei: und hier ein Auszug aus einer Npc_Datei:
  
 +<code C>
 // - - - - - - NSC - - - - - - // - - - - - - NSC - - - - - -
     name         = "​Nodrog";​     name         = "​Nodrog";​
Zeile 269: Zeile 272:
     aivar[ AIV_MagicUser] = MAGIC_ALWAYS;​     aivar[ AIV_MagicUser] = MAGIC_ALWAYS;​
     aivar[ AIV_GuildStufe] = GIL_STUFE_MAGIER;​     aivar[ AIV_GuildStufe] = GIL_STUFE_MAGIER;​
 +</​code>​
  
 Hier ergeben sich selbst verständlich viele Nachteile, da alle Mitglieder der einzelnen Gruppen alle der gleichen Gilde angehöhren,​ aber man kann die Gildennamen für die Story ändern (in den Dialogen zum Beispiel), wenn der Held befördert wird. Gleichzeitig kann man immer abfragen welchen Stand ein Npc oder Sc genießt. Hier ergeben sich selbst verständlich viele Nachteile, da alle Mitglieder der einzelnen Gruppen alle der gleichen Gilde angehöhren,​ aber man kann die Gildennamen für die Story ändern (in den Dialogen zum Beispiel), wenn der Held befördert wird. Gleichzeitig kann man immer abfragen welchen Stand ein Npc oder Sc genießt.
  
  
-==  Zufallsfunktion mit passenderer statistischer Verteilung ==+===== Zufallsfunktion mit passenderer statistischer Verteilung ​=====
  
 +<code C>
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​
 // //
Zeile 322: Zeile 327:
  start8 = Hlp_Random(4263);​  start8 = Hlp_Random(4263);​
 }; };
 +</​code>​
  
-==  [für Fortgeschritene] Zufällige Attribute für Npcs =+=====  Automatische Übertragung von Gegenständen von Opfer nach Hero =====
- +
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ +
-// +
-//​ B_SetAttributesRandom +
-// - - - - - - - - - - - - - - - - - - - - - - - - +
-// +
-// Setzt die Attribute mit Hilfe eines Zufalls. +
-// Nötig ist dafür die Stärkeklasse des Npc für Nah, Fern & Magie Kampf. +
-// +
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ +
- +
-/*  +
- Zur Errinerung - Auszug AI_Constants.d:​ +
- +
- Stärkeklassen für die Zufalls-Attribute +
- - - - - - - - - - - - - - - - - - - - +
- +
- const int COWARD = 0; //Lars, NK & FK der Magier +
- const int NORMAL = 1;​ //​leichte Axt & Schwertkämpfer,​ Arbeiter und leichte NK Späher +
- const int STRONG = 2;​ //​schwere Axt & Schwertkämpfer,​ Schwere Späher +
- const int RAISED = 3;​ //​Wächter,​ Krieger, FK der Späher, Magier +
- const int MASTER = 4; //alle Anführer. +
- +
-*/ +
- +
-func void B_SetAttributesRandom (var int nahKampf, var int fernKampf, var int magieKampf) +
-+
- // - - - - - Resett for Random - - - - - -  +
- Hlp_Rand_Resett();​ +
-  +
- var int rnd; +
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ +
- //​ Allgemeine Attribute +
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ +
- +
- if nahKampf == MASTER +
- || fernKampf == MASTER +
- || magieKampf == MASTER +
-+
- self.fight_tactic = FAI_HUMAN_MASTER;​  +
-  +
- // 40 - 60 +
- rnd = Hlp_Rand(20);​ +
- self.level = 40 + rnd;​ //​nicht 0 wegen XP (10 * Level) +
-+
- else if nahKampf == RAISED +
- || fernKampf == RAISED +
- || magieKampf == RAISED +
-+
- self.fight_tactic = FAI_HUMAN_MASTER;​  +
-  +
- // 30 - 50 +
- rnd = Hlp_Rand(20);​ +
- self.level = 30 + rnd;​ //​nicht 0 wegen XP (10 * Level) +
-+
- else if nahKampf == STRONG +
- || fernKampf == STRONG +
- || magieKampf == STRONG +
-+
- self.fight_tactic = FAI_HUMAN_COWARD;​  +
-  +
- // 20 - 40 +
- rnd = Hlp_Rand(20);​ +
- self.level = 20 + rnd;​ //​nicht 0 wegen XP (10 * Level) +
-+
- else if nahKampf == NORMAL +
- || fernKampf == NORMAL +
- || magieKampf == NORMAL +
-+
- self.fight_tactic = FAI_HUMAN_NORMAL;​  +
- // 10 - 30 +
- rnd = Hlp_Rand(20);​ +
- self.level = 10 + rnd;​ //​nicht 0 wegen XP (10 * Level) +
-+
- else //Alles COWARD +
-+
- self.fight_tactic = FAI_HUMAN_COWARD;​  +
- // 1 - 10 +
- rnd = Hlp_Rand(9);​ +
- self.level = 1 + rnd;​ //​nicht 0 wegen XP (10 * Level) +
-  +
- }; +
-  +
- //- - - - - - Nach Level  - - - - - - - - - +
- self.attribute[ATR_HITPOINTS_MAX] = (self.level + 1) * 10; +
- self.attribute[ATR_HITPOINTS] = self.attribute[ATR_HITPOINTS_MAX];​ +
-  +
- //  - - - - - - XP für NSCs - - - - - - +
- self.exp = (500*[[self.level+1):​2)*(self.level+1]];​ +
- self.exp_next = (500*[[self.level+2):​2)*(self.level+2]];​ +
-  +
-  +
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ +
- //​ Nahkampf Attribute +
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ +
- +
- if nahKampf == NORMAL +
-+
- // 10 - 60 +
- rnd = Hlp_Rand(50);​ +
- self.attribute[ATR_STRENGTH] = 10 + rnd; +
- self.aivar[REAL_STRENGTH] = self.attribute[ATR_STRENGTH];​ +
-  +
- // 10 - 29 --> NICHTMAL 30 +
- rnd = Hlp_Rand(19);​ +
- B_RaiseFightTalent (self, NPC_TALENT_1H,​ 10 + rnd); +
- B_RaiseFightTalent (self, NPC_TALENT_2H,​ 10 + rnd); +
-+
- else if nahKampf == STRONG +
-+
- // 50 - 130 +
- rnd = Hlp_Rand(80);​ +
- self.attribute[ATR_STRENGTH] = 50 + rnd; +
- self.aivar[REAL_STRENGTH] = self.attribute[ATR_STRENGTH];​ +
-  +
- // mind. 30 - max 59  +
- rnd = Hlp_Rand(29);​ +
- B_RaiseFightTalent (self, NPC_TALENT_1H,​ 30 + rnd); +
- B_RaiseFightTalent (self, NPC_TALENT_2H,​ 30 + rnd); +
-+
- else if nahKampf == RAISED +
-+
- // 120 - 180  +
- rnd = Hlp_Rand(60);​ +
- self.attribute[ATR_STRENGTH] = 120 + rnd; +
- self.aivar[REAL_STRENGTH] = self.attribute[ATR_STRENGTH];​ +
-  +
- // 60 - 80 +
- rnd = Hlp_Rand(20);​ +
- B_RaiseFightTalent (self, NPC_TALENT_1H,​ 60 + rnd); +
- B_RaiseFightTalent (self, NPC_TALENT_2H,​ 60 + rnd); +
-+
- else if nahKampf == MASTER +
-+
- // 160 - 200  +
- rnd = Hlp_Rand(40);​ +
- self.attribute[ATR_STRENGTH] = 160 + rnd; +
- self.aivar[REAL_STRENGTH] = self.attribute[ATR_STRENGTH];​ +
-  +
- // 80 - 100 +
- rnd = Hlp_Rand(20);​ +
- B_RaiseFightTalent (self, NPC_TALENT_1H,​ 80 + rnd); +
- B_RaiseFightTalent (self, NPC_TALENT_2H,​ 80 + rnd); +
-+
- else +
-+
- // max 10 +
- rnd = Hlp_Rand(9);​ +
- self.attribute[ATR_STRENGTH] = 1 + rnd; +
- self.aivar[REAL_STRENGTH] = self.attribute[ATR_STRENGTH];​ +
- B_RaiseFightTalent (self, NPC_TALENT_1H,​ 1 + rnd); +
- B_RaiseFightTalent (self, NPC_TALENT_2H,​ 1 + rnd); +
- }; +
-  +
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ +
- //​ Fernkampf-Attribute +
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ +
- if fernKampf == NORMAL +
-+
- // 10 - 60 +
- rnd = Hlp_Rand(50);​ +
- self.attribute[ATR_DEXTERITY] = 10 + rnd; +
- self.aivar[REAL_DEXTERITY] = self.attribute[ATR_DEXTERITY];​ +
-  +
- // 10 - 29 --> NICHTMAL 30 +
- rnd = Hlp_Rand(19);​ +
- B_RaiseFightTalent (self, NPC_TALENT_BOW,​    10 + rnd); +
- B_RaiseFightTalent (self, NPC_TALENT_CROSSBOW,​ 10 + rnd); +
-+
- else if fernKampf == STRONG +
-+
- // 50 - 130 +
- rnd = Hlp_Rand(80);​ +
- self.attribute[ATR_DEXTERITY] = 50 + rnd; +
- self.aivar[REAL_DEXTERITY] = self.attribute[ATR_DEXTERITY];​ +
-  +
- // mind. 30 - max 59  +
- rnd = Hlp_Rand(29);​ +
- B_RaiseFightTalent (self, NPC_TALENT_BOW,​ 30 + rnd); +
- B_RaiseFightTalent (self, NPC_TALENT_CROSSBOW, ​ 30 + rnd); +
-+
- else if fernKampf == RAISED +
-+
- // 120 - 180  +
- rnd = Hlp_Rand(60);​ +
- self.attribute[ATR_DEXTERITY] = 120 + rnd; +
- self.aivar[REAL_DEXTERITY] = self.attribute[ATR_DEXTERITY];​ +
-  +
- // 60 - 80 +
- rnd = Hlp_Rand(20);​ +
- B_RaiseFightTalent (self, NPC_TALENT_BOW,​ 60 + rnd); +
- B_RaiseFightTalent (self, NPC_TALENT_CROSSBOW, ​ 60 + rnd); +
-+
- else if fernKampf == MASTER +
-+
- // 160 - 200  +
- rnd = Hlp_Rand(40);​ +
- self.attribute[ATR_DEXTERITY] = 160 + rnd; +
- self.aivar[REAL_DEXTERITY] = self.attribute[ATR_DEXTERITY];​ +
-  +
- // 80 - 100 +
- rnd = Hlp_Rand(20);​ +
- B_RaiseFightTalent (self, NPC_TALENT_BOW,​ 80 + rnd); +
- B_RaiseFightTalent (self, NPC_TALENT_CROSSBOW, ​ 80 + rnd); +
-+
- else +
-+
- // max 10 +
- rnd = Hlp_Rand(9);​ +
- self.attribute[ATR_DEXTERITY] = 1 + rnd; +
- self.aivar[REAL_DEXTERITY] = self.attribute[ATR_DEXTERITY];​ +
- B_RaiseFightTalent (self, NPC_TALENT_BOW,​ 1 + rnd); +
- B_RaiseFightTalent (self, NPC_TALENT_CROSSBOW, ​ 1 + rnd); +
- }; +
-  +
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ +
- //​ Magie-Attribute +
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ +
- // Vorsicht: Dieser Abschnitt setzt voraus, dass die AI an unterschiedliche Magiebenutzung angepasst ist. (zu betrachten: B_SelectSpell.d) +
-  +
- // Gilt für Manchmal-Magier,​ zb Wächter +
- if magieKampf == NORMAL +
-+
- self.aivar[AIV_MagicUser] = MAGIC_SOMETIMES;​ +
-  +
- // 50 - 100 +
- rnd = Hlp_Rand(50);​ +
- self.attribute[ATR_MANA_MAX] = 50 + rnd; +
- self.aivar[REAL_MANA_MAX] = self.attribute[ATR_MANA_MAX];​ +
- self.attribute[ATR_MANA] = self.attribute[ATR_MANA_MAX];​ +
-  +
- Npc_SetTalentSkill (self,​ NPC_TALENT_MAGE,​ 2); +
-+
- // Gilt nur für Magier: +
- else if magieKampf == STRONG +
-+
- self.aivar[AIV_MagicUser] = MAGIC_ALWAYS;​ +
-  +
- // 90 - 180 +
- rnd = Hlp_Rand(90);​ +
- self.attribute[ATR_MANA_MAX] = 90 + rnd; +
- self.aivar[REAL_MANA_MAX] = self.attribute[ATR_MANA_MAX];​ +
- self.attribute[ATR_MANA] = self.attribute[ATR_MANA_MAX];​ +
-  +
- Npc_SetTalentSkill (self,​ NPC_TALENT_MAGE,​ 3); +
-+
- else if magieKampf == RAISED +
-+
- self.aivar[AIV_MagicUser] = MAGIC_ALWAYS;​ +
-  +
- // 170 - 260  +
- rnd = Hlp_Rand(90);​ +
- self.attribute[ATR_MANA_MAX] = 170 + rnd; +
- self.aivar[REAL_MANA_MAX] = self.attribute[ATR_MANA_MAX];​ +
- self.attribute[ATR_MANA] = self.attribute[ATR_MANA_MAX];​ +
-  +
- Npc_SetTalentSkill (self,​ NPC_TALENT_MAGE,​ 4); +
-+
- else if magieKampf == MASTER +
-+
- self.aivar[AIV_MagicUser] = MAGIC_ALWAYS;​ +
-  +
- // 250 - 300  +
- rnd = Hlp_Rand(50);​ +
- self.attribute[ATR_MANA_MAX] = 250 + rnd; +
- self.aivar[REAL_MANA_MAX] = self.attribute[ATR_MANA_MAX];​ +
- self.attribute[ATR_MANA] = self.attribute[ATR_MANA_MAX];​ +
-  +
- Npc_SetTalentSkill (self,​ NPC_TALENT_MAGE,​ 6); +
-+
- else // Alle NICHT-Magier +
-+
- self.aivar[AIV_MagicUser] = MAGIC_NEVER;​ +
-  +
- // max 10 +
- rnd = Hlp_Rand(9);​ +
- self.attribute[ATR_MANA_MAX] = 1 + rnd; +
- self.aivar[REAL_MANA_MAX] = self.attribute[ATR_MANA_MAX];​ +
- self.attribute[ATR_MANA] = self.attribute[ATR_MANA_MAX];​ +
-  +
- Npc_SetTalentSkill (self,​ NPC_TALENT_MAGE,​ 0); +
- }; +
-  +
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ +
- //​ Sonstige Talente +
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ +
- if fernKampf >= STRONG +
-+
- Npc_SetTalentSkill (self,​ NPC_TALENT_PICKLOCK,​ TRUE);  +
- Npc_SetTalentSkill (self,​ NPC_TALENT_SNEAK,​ TRUE); +
- Npc_SetTalentSkill (self,​ NPC_TALENT_ACROBAT,​ TRUE); +
- Npc_SetTalentSkill (self,​ NPC_TALENT_PICKPOCKET,​ TRUE);  +
- }; +
-  +
- if nahKampf >= STRONG +
-+
- Npc_SetTalentSkill (self,​ NPC_TALENT_SMITH,​ TRUE); +
- }; +
-  +
- if nahKampf >= STRONG || fernKampf >= STRONG +
-+
- Npc_SetTalentSkill (self,​ NPC_TALENT_TAKEANIMALTROPHY,​ TRUE);​ +
- }; +
-  +
- if magieKampf >= STRONG +
-+
- Npc_SetTalentSkill (self,​ NPC_TALENT_RUNES,​ TRUE); +
- Npc_SetTalentSkill (self,​ NPC_TALENT_ALCHEMY,​ TRUE); +
- }; +
-}; +
- +
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ +
-// +
-//​ B_SetAttributForWeapons +
-// - - - - - - - - - - - - - - - - - - - - - - +
-// +
-// Das Zufällige Austeilen von Attributen macht es nötig die Werte im Nachhinein an die Waffen anzupassen. +
-// Diese Methode schreibt die Werte neu, wenn sie nicht ausreichen die gewollten Waffen zu tragen. +
-// Dazu wird die Nebenmethode B_SetAttributForWeapon(waffe) benötigt. Die Methode setzt alle 3 Attribute und equipt die Waffe. +
-// +
-///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ +
-/* Zur Erinnerung die in der Waffe beschriebenen benötigten Attribute: (Classes.d) +
-  +
- // Benötigte Attribute zum Benutzen des Items +
- VAR INT cond_atr [3] ;​ +
- VAR INT cond_value [3] ;​ +
- +
-(constants.d) +
- +
-const int ATR_HITPOINTS = ​ 0; // Lebenspunkte +
-const int ATR_HITPOINTS_MAX = ​ 1; // Max. Lebenspunkte +
-const int ATR_MANA = ​ 2; // Mana Mana +
-const int ATR_MANA_MAX = ​ 3; // Mana Max +
- +
-const int ATR_STRENGTH = ​ 4; // Stärke +
-const int ATR_DEXTERITY = ​ 5; // Geschick +
-const int ATR_REGENERATEHP = ​ 6; // Regenerierung von HP alle x sekunden +
-const int ATR_REGENERATEMANA = ​ 7;   // Regenerierung von Mana alle x sekunden +
- +
-*/ +
- +
-func void B_SetAttributForWeapon(var int waffenInstanz) +
-+
- //- - - - - Resett for Random - - - - - - +
- Hlp_Rand_Resett();​ +
-  +
- var int rnd; rnd = Hlp_Rand(10);​ +
-  +
- //​Notausstieg:​ +
- if waffenInstanz == nothing //NO_ARMOR ist Ersatz für nil oder nothing +
-+
- return;​  +
-+
- else +
-+
- CreateInvItems (self,​ waffenInstanz,​ 1);​ +
- }; +
-  +
- if item.cond_atr[0] == ATR_HITPOINTS { if self.attribute[ATR_HITPOINTS] < item.cond_value[0] {self.attribute[ATR_HITPOINTS] = item.cond_value[0] + rnd; }; } +
- else if item.cond_atr[0] == ATR_HITPOINTS_MAX { if self.attribute[ATR_HITPOINTS_MAX] < item.cond_value[0] {self.attribute[ATR_HITPOINTS_MAX] = item.cond_value[0] + rnd; }; } +
- else if item.cond_atr[0] == ATR_MANA { if self.attribute[ATR_MANA] < item.cond_value[0] {self.attribute[ATR_MANA] = item.cond_value[0] + rnd; }; } +
- else if item.cond_atr[0] == ATR_MANA_MAX { if self.attribute[ATR_MANA_MAX] < item.cond_value[0] {self.attribute[ATR_MANA_MAX] = item.cond_value[0] + rnd; }; } +
- else if item.cond_atr[0] == ATR_STRENGTH { if self.attribute[ATR_STRENGTH] < item.cond_value[0] {self.attribute[ATR_STRENGTH] = item.cond_value[0] + rnd; }; } +
- else if item.cond_atr[0] == ATR_DEXTERITY { if self.attribute[ATR_DEXTERITY] < item.cond_value[0] {self.attribute[ATR_DEXTERITY] = item.cond_value[0] + rnd; }; } +
- else if item.cond_atr[0] == ATR_REGENERATEHP { if self.attribute[ATR_REGENERATEHP] < item.cond_value[0] {self.attribute[ATR_REGENERATEHP] = item.cond_value[0] + rnd; }; } +
- else if item.cond_atr[0] == ATR_REGENERATEMANA { if self.attribute[ATR_REGENERATEMANA] < item.cond_value[0] {self.attribute[ATR_REGENERATEMANA] = item.cond_value[0] + rnd; }; }; +
-  +
- if item.cond_atr[1] == ATR_HITPOINTS { if self.attribute[ATR_HITPOINTS] < item.cond_value[1] {self.attribute[ATR_HITPOINTS] = item.cond_value[1] + rnd; }; } +
- else if item.cond_atr[1] == ATR_HITPOINTS_MAX { if self.attribute[ATR_HITPOINTS_MAX] < item.cond_value[1] {self.attribute[ATR_HITPOINTS_MAX] = item.cond_value[1] + rnd; }; } +
- else if item.cond_atr[1] == ATR_MANA { if self.attribute[ATR_MANA] < item.cond_value[1] {self.attribute[ATR_MANA] = item.cond_value[1] + rnd; }; } +
- else if item.cond_atr[1] == ATR_MANA_MAX { if self.attribute[ATR_MANA_MAX] < item.cond_value[1] {self.attribute[ATR_MANA_MAX] = item.cond_value[1] + rnd; }; } +
- else if item.cond_atr[1] == ATR_STRENGTH { if self.attribute[ATR_STRENGTH] < item.cond_value[1] {self.attribute[ATR_STRENGTH] = item.cond_value[1] + rnd; }; } +
- else if item.cond_atr[1] == ATR_DEXTERITY { if self.attribute[ATR_DEXTERITY] < item.cond_value[1] {self.attribute[ATR_DEXTERITY] = item.cond_value[1] + rnd; }; } +
- else if item.cond_atr[1] == ATR_REGENERATEHP { if self.attribute[ATR_REGENERATEHP] < item.cond_value[1] {self.attribute[ATR_REGENERATEHP] = item.cond_value[1] + rnd; }; } +
- else if item.cond_atr[1] == ATR_REGENERATEMANA { if self.attribute[ATR_REGENERATEMANA] < item.cond_value[1] {self.attribute[ATR_REGENERATEMANA] = item.cond_value[1] + rnd; }; }; +
-  +
- if item.cond_atr[2] == ATR_HITPOINTS { if self.attribute[ATR_HITPOINTS] < item.cond_value[2] {self.attribute[ATR_HITPOINTS] = item.cond_value[2] + rnd; }; } +
- else if item.cond_atr[2] == ATR_HITPOINTS_MAX { if self.attribute[ATR_HITPOINTS_MAX] < item.cond_value[2] {self.attribute[ATR_HITPOINTS_MAX] = item.cond_value[2] + rnd; }; } +
- else if item.cond_atr[2] == ATR_MANA { if self.attribute[ATR_MANA] < item.cond_value[2] {self.attribute[ATR_MANA] = item.cond_value[2] + rnd; }; } +
- else if item.cond_atr[2] == ATR_MANA_MAX { if self.attribute[ATR_MANA_MAX] < item.cond_value[2] {self.attribute[ATR_MANA_MAX] = item.cond_value[2] + rnd; }; } +
- else if item.cond_atr[2] == ATR_STRENGTH { if self.attribute[ATR_STRENGTH] < item.cond_value[2] {self.attribute[ATR_STRENGTH] = item.cond_value[2] + rnd; }; } +
- else if item.cond_atr[2] == ATR_DEXTERITY { if self.attribute[ATR_DEXTERITY] < item.cond_value[2] {self.attribute[ATR_DEXTERITY] = item.cond_value[2] + rnd; }; } +
- else if item.cond_atr[2] == ATR_REGENERATEHP { if self.attribute[ATR_REGENERATEHP] < item.cond_value[2] {self.attribute[ATR_REGENERATEHP] = item.cond_value[2] + rnd; }; } +
- else if item.cond_atr[2] == ATR_REGENERATEMANA { if self.attribute[ATR_REGENERATEMANA] < item.cond_value[2] {self.attribute[ATR_REGENERATEMANA] = item.cond_value[2] + rnd; }; }; +
- +
- EquipItem(self,​waffenInstanz);​ +
-}; +
- +
-func void B_SetAttributForWeapons(var int nahKampfWaffe,​ var int ferKampfWaffe) +
-+
- if nahKampfWaffe != nothing +
-+
- B_SetAttributForWeapon(nahKampfWaffe);​ +
- }; +
- if ferKampfWaffe != nothing +
-+
- B_SetAttributForWeapon(ferKampfWaffe);​ +
- }; +
-}; +
- +
-==  Automatische Übertragung von Gegenständen von Opfer nach Hero ==+
  
 Das folgende Script ist zu ersetzten. Dann werden in eurem Mod zukünftig alle Items, außer Rüstungen, vom Opfer-Inventar in das Helden-Inventar transferiet. Das folgende Script ist zu ersetzten. Dann werden in eurem Mod zukünftig alle Items, außer Rüstungen, vom Opfer-Inventar in das Helden-Inventar transferiet.
Zeile 732: Zeile 337:
 D.h. Ihr könnt durch Hinzufügen von Abfragen zB einen Questerfolg auslösen. Das ist dann schon fast wie in G3, jedoch musste man auch dort manuell plündern. D.h. Ihr könnt durch Hinzufügen von Abfragen zB einen Questerfolg auslösen. Das ist dann schon fast wie in G3, jedoch musste man auch dort manuell plündern.
  
-Hier dir URL zu dem Script als Datei: +<code C>
-http://​nodrog.no.funpic.de/​Sekte/​B_GiveDeathInv.d +
 // ************************** // **************************
 // B_GiveDeathInv // B_GiveDeathInv
Zeile 1115: Zeile 718:
  self.aivar[AIV_DeathInvGiven] = TRUE;  self.aivar[AIV_DeathInvGiven] = TRUE;
 }; };
 +</​code>​
  
-==  Kill-Counter erstellen ==+===== Kill-Counter erstellen ​=====
  
 So, da das auch nicht so einfach ist, gebe ich hier mal ein Beispiel für einen Kill-Counter mit folgender Attributssteigerung. So, da das auch nicht so einfach ist, gebe ich hier mal ein Beispiel für einen Kill-Counter mit folgender Attributssteigerung.
  
-Erstmal müssen wir die ZS_Dead überarbeiten. Diese befindet sich im Verzeichnis "​[GOTHIC 2]\\_work\\data\\Scripts\\Content\\AI\\Human\\ZS_Human"​. Dort tragen wir bei dem Abschnitt unter dem Titel XP folgendermaßen:​+Erstmal müssen wir die ZS_Dead überarbeiten. Diese befindet sich im Verzeichnis "​[GOTHIC 2]\_work\data\Scripts\Content\AI\Human\ZS_Human"​. Dort tragen wir bei dem Abschnitt unter dem Titel XP folgendermaßen:​
  
- // ------ XP ------ +<code C> 
- if ( Npc_IsPlayer(other) || (other.aivar[AIV_PARTYMEMBER]==TRUE) ) +// ------ XP ------ 
- && (self.aivar[AIV_VictoryXPGiven] == FALSE)  +if ( Npc_IsPlayer(other) || (other.aivar[AIV_PARTYMEMBER]==TRUE) ) 
-+&& (self.aivar[AIV_VictoryXPGiven] == FALSE)  
- B_GivePlayerXP (self.level * XP_PER_VICTORY);​  +
- B_Counter (); + B_GivePlayerXP (self.level * XP_PER_VICTORY);​  
- self.aivar[AIV_VictoryXPGiven] = TRUE; + B_Counter (); 
- };+ self.aivar[AIV_VictoryXPGiven] = TRUE; 
 +}; 
 +</​code>​
  
-Wir tragen nach der B_GivePlayerXP noch B_Counter();​ ein. Das ruft dann unseren Counter auf, den wir im folgenden erstellen. +Wir tragen nach der ''​B_GivePlayerXP'' ​noch ''​B_Counter();​'' ​ein. Das ruft dann unseren Counter auf, den wir im folgenden erstellen. 
-Hierzu erstellen wir eine Datei mit dem Namen "B_Counter.d" ​im Verzeichnis ​"[GOTHIC 2]\\work\\data\\Scripts\\Content\\Story\\B_Story".+Hierzu erstellen wir eine Datei mit dem Namen ''​B_Counter.d'' ​im Verzeichnis ​''​[GOTHIC 2]\work\data\Scripts\Content\Story\B_Story''​.
  
 +<code C>
 // ******************************************** // ********************************************
 //​ B_Counter  //​ B_Counter
Zeile 1144: Zeile 751:
  kill_counter += 1;// Plus einen Kill  kill_counter += 1;// Plus einen Kill
 }; };
 +</​code>​
  
-Diese Funktion zählt jetzt eine Variable +1, da man einen NPC getötet hat. Nun müssen wir die Variable in die Story_Globals.d eintragen. Das kann ganz oben sein, ganz unten oder in der Mitte, ganz egal. Wir erstellen jetzt einfach einen neuen Abschnitt ganz oben in der Story_Globals.d:​+Diese Funktion zählt jetzt eine Variable +1, da man einen NPC getötet hat. Nun müssen wir die Variable in die ''​Story_Globals.d'' ​eintragen. Das kann ganz oben sein, ganz unten oder in der Mitte, ganz egal. Wir erstellen jetzt einfach einen neuen Abschnitt ganz oben in der ''​Story_Globals.d''​:
  
 +<code C>
 // ************************* // *************************
 // Globalvariablen für Story // Globalvariablen für Story
Zeile 1153: Zeile 762:
 // ------ NEU ------ // ------ NEU ------
 var int kill_counter = 0; var int kill_counter = 0;
 +</​code>​
 Danach folgt wieder der normale Rest der Datei. Danach folgt wieder der normale Rest der Datei.
  
-Nun müssen wir im Weiteren noch die B_Counter.d in der Gothic.src eintragen, die wir mit dem normalen Text-Editor öffnen können, so wie die Skripte (Verzeichnis der Gothic.src: ​"[GOTHIC 2]\\_work\\data\\Scripts\\Content"):+Nun müssen wir im Weiteren noch die ''​B_Counter.d'' ​in der ''​Gothic.src'' ​eintragen, die wir mit dem normalen Text-Editor öffnen können, so wie die Skripte (Verzeichnis der ''​Gothic.src''​''​[GOTHIC 2]\_work\data\Scripts\Content\Gothic.src''​):
  
-STORY\\Log_Entries\\Log_Constants_*.d +<​code>​ 
-STORY\\XP_Constants.d +STORY\Log_Entries\Log_Constants_*.d 
-STORY\\Story_Globals.d +STORY\XP_Constants.d 
-STORY\\NPC_Globals.d +STORY\Story_Globals.d 
-STORY\\svm.d +STORY\NPC_Globals.d 
-STORY\\Text.d +STORY\svm.d 
-STORY\\B_STORY\\B_Counter.d+STORY\Text.d 
 +STORY\B_STORY\B_Counter.d 
 +</​code>​
  
-Das ist jetzt nur der wichtigste Ausschnitt aus der Gothic.src. Die B_Counter darf NICHT über der Story_Globals .d stehen, da dann die Variable in der B_Counter nicht erkannt wird.+Das ist jetzt nur der wichtigste Ausschnitt aus der ''​Gothic.src''​. Die ''​B_Counter'' ​darf NICHT über der Story_Globals .d stehen, da dann die Variable in der B_Counter nicht erkannt wird.
  
  
Zeile 1172: Zeile 783:
 Hierzu öffnen wr nochmals die B_Counter.d und verändern sie wie folgt: Hierzu öffnen wr nochmals die B_Counter.d und verändern sie wie folgt:
  
 +<code C>
 func void B_Counter () func void B_Counter ()
 { {
Zeile 1189: Zeile 801:
 // ***************************************************************************************** // *****************************************************************************************
 const string PRINT_STEIGERUNG = "Die Stärke wurde um 5 gesteigert";​ const string PRINT_STEIGERUNG = "Die Stärke wurde um 5 gesteigert";​
 +</​code>​
  
 Nun folgt noch der Rest des Skripts, so wie es vorher auch war. Nun folgt noch der Rest des Skripts, so wie es vorher auch war.
- 
  
 Das war's, nun noch Skripte parsen und fertig ist euer Kill-Counter mit Learning by Doing-System. Das war's, nun noch Skripte parsen und fertig ist euer Kill-Counter mit Learning by Doing-System.
-Bei Fragen einfach per PN an Mantragon wenden. ;) 
  
-MfG +===== [für Fortgeschritene] Zufällige Attribute für Npcs ===== 
-Mantragon+ 
 +<code C> 
 +///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ 
 +// 
 +//​ B_SetAttributesRandom 
 +// - - - - - - - - - - - - - - - - - - - - - - - - 
 +// 
 +// Setzt die Attribute mit Hilfe eines Zufalls. 
 +// Nötig ist dafür die Stärkeklasse des Npc für Nah, Fern & Magie Kampf. 
 +// 
 +///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ 
 + 
 +/*  
 + Zur Erinnerung - Auszug AI_Constants.d:​ 
 + 
 + Stärkeklassen für die Zufalls-Attribute 
 + - - - - - - - - - - - - - - - - - - - 
 + 
 + const int COWARD = 0; //Lars, NK & FK der Magier 
 + const int NORMAL = 1;​ //​leichte Axt & Schwertkämpfer,​ Arbeiter und leichte NK Späher 
 + const int STRONG = 2;​ //​schwere Axt & Schwertkämpfer,​ Schwere Späher 
 + const int RAISED = 3;​ //​Wächter,​ Krieger, FK der Späher, Magier 
 + const int MASTER = 4; //alle Anführer. 
 + 
 +*/ 
 + 
 +func void B_SetAttributesRandom (var int nahKampf, var int fernKampf, var int magieKampf) 
 +
 + // - - - - - Resett for Random - - - - - -  
 + Hlp_Rand_Resett();​ 
 +  
 + var int rnd; 
 + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ 
 + //​ Allgemeine Attribute 
 + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ 
 + 
 + if nahKampf == MASTER 
 + || fernKampf == MASTER 
 + || magieKampf == MASTER 
 +
 + self.fight_tactic = FAI_HUMAN_MASTER;​  
 +  
 + // 40 - 60 
 + rnd = Hlp_Rand(20);​ 
 + self.level = 40 + rnd;​ //​nicht 0 wegen XP (10 * Level) 
 +
 + else if nahKampf == RAISED 
 + || fernKampf == RAISED 
 + || magieKampf == RAISED 
 +
 + self.fight_tactic = FAI_HUMAN_MASTER;​  
 +  
 + // 30 - 50 
 + rnd = Hlp_Rand(20);​ 
 + self.level = 30 + rnd;​ //​nicht 0 wegen XP (10 * Level) 
 +
 + else if nahKampf == STRONG 
 + || fernKampf == STRONG 
 + || magieKampf == STRONG 
 +
 + self.fight_tactic = FAI_HUMAN_COWARD;​  
 +  
 + // 20 - 40 
 + rnd = Hlp_Rand(20);​ 
 + self.level = 20 + rnd;​ //​nicht 0 wegen XP (10 * Level) 
 +
 + else if nahKampf == NORMAL 
 + || fernKampf == NORMAL 
 + || magieKampf == NORMAL 
 +
 + self.fight_tactic = FAI_HUMAN_NORMAL;​  
 + // 10 - 30 
 + rnd = Hlp_Rand(20);​ 
 + self.level = 10 + rnd;​ //​nicht 0 wegen XP (10 * Level) 
 +
 + else //Alles COWARD 
 +
 + self.fight_tactic = FAI_HUMAN_COWARD;​  
 + // 1 - 10 
 + rnd = Hlp_Rand(9);​ 
 + self.level = 1 + rnd;​ //​nicht 0 wegen XP (10 * Level) 
 +  
 + }; 
 +  
 + //- - - - - - Nach Level  - - - - - - - - - 
 + self.attribute[ATR_HITPOINTS_MAX] = (self.level + 1) * 10; 
 + self.attribute[ATR_HITPOINTS] = self.attribute[ATR_HITPOINTS_MAX];​ 
 +  
 + //  - - - - - - XP für NSCs - - - - - - 
 + self.exp = (500*[[self.level+1):​2)*(self.level+1]];​ 
 + self.exp_next = (500*[[self.level+2):​2)*(self.level+2]];​ 
 +  
 +  
 + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ 
 + //​ Nahkampf Attribute 
 + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ 
 + 
 + if nahKampf == NORMAL 
 +
 + // 10 - 60 
 + rnd = Hlp_Rand(50);​ 
 + self.attribute[ATR_STRENGTH] = 10 + rnd; 
 + self.aivar[REAL_STRENGTH] = self.attribute[ATR_STRENGTH];​ 
 +  
 + // 10 - 29 --> NICHTMAL 30 
 + rnd = Hlp_Rand(19);​ 
 + B_RaiseFightTalent (self, NPC_TALENT_1H,​ 10 + rnd); 
 + B_RaiseFightTalent (self, NPC_TALENT_2H,​ 10 + rnd); 
 +
 + else if nahKampf == STRONG 
 +
 + // 50 - 130 
 + rnd = Hlp_Rand(80);​ 
 + self.attribute[ATR_STRENGTH] = 50 + rnd; 
 + self.aivar[REAL_STRENGTH] = self.attribute[ATR_STRENGTH];​ 
 +  
 + // mind. 30 - max 59  
 + rnd = Hlp_Rand(29);​ 
 + B_RaiseFightTalent (self, NPC_TALENT_1H,​ 30 + rnd); 
 + B_RaiseFightTalent (self, NPC_TALENT_2H,​ 30 + rnd); 
 +
 + else if nahKampf == RAISED 
 +
 + // 120 - 180  
 + rnd = Hlp_Rand(60);​ 
 + self.attribute[ATR_STRENGTH] = 120 + rnd; 
 + self.aivar[REAL_STRENGTH] = self.attribute[ATR_STRENGTH];​ 
 +  
 + // 60 - 80 
 + rnd = Hlp_Rand(20);​ 
 + B_RaiseFightTalent (self, NPC_TALENT_1H,​ 60 + rnd); 
 + B_RaiseFightTalent (self, NPC_TALENT_2H,​ 60 + rnd); 
 +
 + else if nahKampf == MASTER 
 +
 + // 160 - 200  
 + rnd = Hlp_Rand(40);​ 
 + self.attribute[ATR_STRENGTH] = 160 + rnd; 
 + self.aivar[REAL_STRENGTH] = self.attribute[ATR_STRENGTH];​ 
 +  
 + // 80 - 100 
 + rnd = Hlp_Rand(20);​ 
 + B_RaiseFightTalent (self, NPC_TALENT_1H,​ 80 + rnd); 
 + B_RaiseFightTalent (self, NPC_TALENT_2H,​ 80 + rnd); 
 +
 + else 
 +
 + // max 10 
 + rnd = Hlp_Rand(9);​ 
 + self.attribute[ATR_STRENGTH] = 1 + rnd; 
 + self.aivar[REAL_STRENGTH] = self.attribute[ATR_STRENGTH];​ 
 + B_RaiseFightTalent (self, NPC_TALENT_1H,​ 1 + rnd); 
 + B_RaiseFightTalent (self, NPC_TALENT_2H,​ 1 + rnd); 
 + }; 
 +  
 + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ 
 + //​ Fernkampf-Attribute 
 + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ 
 + if fernKampf == NORMAL 
 +
 + // 10 - 60 
 + rnd = Hlp_Rand(50);​ 
 + self.attribute[ATR_DEXTERITY] = 10 + rnd; 
 + self.aivar[REAL_DEXTERITY] = self.attribute[ATR_DEXTERITY];​ 
 +  
 + // 10 - 29 --> NICHTMAL 30 
 + rnd = Hlp_Rand(19);​ 
 + B_RaiseFightTalent (self, NPC_TALENT_BOW,​    10 + rnd); 
 + B_RaiseFightTalent (self, NPC_TALENT_CROSSBOW,​ 10 + rnd); 
 +
 + else if fernKampf == STRONG 
 +
 + // 50 - 130 
 + rnd = Hlp_Rand(80);​ 
 + self.attribute[ATR_DEXTERITY] = 50 + rnd; 
 + self.aivar[REAL_DEXTERITY] = self.attribute[ATR_DEXTERITY];​ 
 +  
 + // mind. 30 - max 59  
 + rnd = Hlp_Rand(29);​ 
 + B_RaiseFightTalent (self, NPC_TALENT_BOW,​ 30 + rnd); 
 + B_RaiseFightTalent (self, NPC_TALENT_CROSSBOW, ​ 30 + rnd); 
 +
 + else if fernKampf == RAISED 
 +
 + // 120 - 180  
 + rnd = Hlp_Rand(60);​ 
 + self.attribute[ATR_DEXTERITY] = 120 + rnd; 
 + self.aivar[REAL_DEXTERITY] = self.attribute[ATR_DEXTERITY];​ 
 +  
 + // 60 - 80 
 + rnd = Hlp_Rand(20);​ 
 + B_RaiseFightTalent (self, NPC_TALENT_BOW,​ 60 + rnd); 
 + B_RaiseFightTalent (self, NPC_TALENT_CROSSBOW, ​ 60 + rnd); 
 +
 + else if fernKampf == MASTER 
 +
 + // 160 - 200  
 + rnd = Hlp_Rand(40);​ 
 + self.attribute[ATR_DEXTERITY] = 160 + rnd; 
 + self.aivar[REAL_DEXTERITY] = self.attribute[ATR_DEXTERITY];​ 
 +  
 + // 80 - 100 
 + rnd = Hlp_Rand(20);​ 
 + B_RaiseFightTalent (self, NPC_TALENT_BOW,​ 80 + rnd); 
 + B_RaiseFightTalent (self, NPC_TALENT_CROSSBOW, ​ 80 + rnd); 
 +
 + else 
 +
 + // max 10 
 + rnd = Hlp_Rand(9);​ 
 + self.attribute[ATR_DEXTERITY] = 1 + rnd; 
 + self.aivar[REAL_DEXTERITY] = self.attribute[ATR_DEXTERITY];​ 
 + B_RaiseFightTalent (self, NPC_TALENT_BOW,​ 1 + rnd); 
 + B_RaiseFightTalent (self, NPC_TALENT_CROSSBOW, ​ 1 + rnd); 
 + }; 
 +  
 + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ 
 + //​ Magie-Attribute 
 + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ 
 + // Vorsicht: Dieser Abschnitt setzt voraus, dass die AI an unterschiedliche Magiebenutzung angepasst ist. (zu betrachten: B_SelectSpell.d) 
 +  
 + // Gilt für Manchmal-Magier,​ zb Wächter 
 + if magieKampf == NORMAL 
 +
 + self.aivar[AIV_MagicUser] = MAGIC_SOMETIMES;​ 
 +  
 + // 50 - 100 
 + rnd = Hlp_Rand(50);​ 
 + self.attribute[ATR_MANA_MAX] = 50 + rnd; 
 + self.aivar[REAL_MANA_MAX] = self.attribute[ATR_MANA_MAX];​ 
 + self.attribute[ATR_MANA] = self.attribute[ATR_MANA_MAX];​ 
 +  
 + Npc_SetTalentSkill (self,​ NPC_TALENT_MAGE,​ 2); 
 +
 + // Gilt nur für Magier: 
 + else if magieKampf == STRONG 
 +
 + self.aivar[AIV_MagicUser] = MAGIC_ALWAYS;​ 
 +  
 + // 90 - 180 
 + rnd = Hlp_Rand(90);​ 
 + self.attribute[ATR_MANA_MAX] = 90 + rnd; 
 + self.aivar[REAL_MANA_MAX] = self.attribute[ATR_MANA_MAX];​ 
 + self.attribute[ATR_MANA] = self.attribute[ATR_MANA_MAX];​ 
 +  
 + Npc_SetTalentSkill (self,​ NPC_TALENT_MAGE,​ 3); 
 +
 + else if magieKampf == RAISED 
 +
 + self.aivar[AIV_MagicUser] = MAGIC_ALWAYS;​ 
 +  
 + // 170 - 260  
 + rnd = Hlp_Rand(90);​ 
 + self.attribute[ATR_MANA_MAX] = 170 + rnd; 
 + self.aivar[REAL_MANA_MAX] = self.attribute[ATR_MANA_MAX];​ 
 + self.attribute[ATR_MANA] = self.attribute[ATR_MANA_MAX];​ 
 +  
 + Npc_SetTalentSkill (self,​ NPC_TALENT_MAGE,​ 4); 
 +
 + else if magieKampf == MASTER 
 +
 + self.aivar[AIV_MagicUser] = MAGIC_ALWAYS;​ 
 +  
 + // 250 - 300  
 + rnd = Hlp_Rand(50);​ 
 + self.attribute[ATR_MANA_MAX] = 250 + rnd; 
 + self.aivar[REAL_MANA_MAX] = self.attribute[ATR_MANA_MAX];​ 
 + self.attribute[ATR_MANA] = self.attribute[ATR_MANA_MAX];​ 
 +  
 + Npc_SetTalentSkill (self,​ NPC_TALENT_MAGE,​ 6); 
 +
 + else // Alle NICHT-Magier 
 +
 + self.aivar[AIV_MagicUser] = MAGIC_NEVER;​ 
 +  
 + // max 10 
 + rnd = Hlp_Rand(9);​ 
 + self.attribute[ATR_MANA_MAX] = 1 + rnd; 
 + self.aivar[REAL_MANA_MAX] = self.attribute[ATR_MANA_MAX];​ 
 + self.attribute[ATR_MANA] = self.attribute[ATR_MANA_MAX];​ 
 +  
 + Npc_SetTalentSkill (self,​ NPC_TALENT_MAGE,​ 0); 
 + }; 
 +  
 + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ 
 + //​ Sonstige Talente 
 + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ 
 + if fernKampf >= STRONG 
 +
 + Npc_SetTalentSkill (self,​ NPC_TALENT_PICKLOCK,​ TRUE);  
 + Npc_SetTalentSkill (self,​ NPC_TALENT_SNEAK,​ TRUE); 
 + Npc_SetTalentSkill (self,​ NPC_TALENT_ACROBAT,​ TRUE); 
 + Npc_SetTalentSkill (self,​ NPC_TALENT_PICKPOCKET,​ TRUE);  
 + }; 
 +  
 + if nahKampf >= STRONG 
 +
 + Npc_SetTalentSkill (self,​ NPC_TALENT_SMITH,​ TRUE); 
 + }; 
 +  
 + if nahKampf >= STRONG || fernKampf >= STRONG 
 +
 + Npc_SetTalentSkill (self,​ NPC_TALENT_TAKEANIMALTROPHY,​ TRUE);​ 
 + }; 
 +  
 + if magieKampf >= STRONG 
 +
 + Npc_SetTalentSkill (self,​ NPC_TALENT_RUNES,​ TRUE); 
 + Npc_SetTalentSkill (self,​ NPC_TALENT_ALCHEMY,​ TRUE); 
 + }; 
 +}; 
 + 
 +///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ 
 +// 
 +//​ B_SetAttributForWeapons 
 +// - - - - - - - - - - - - - - - - - - - - - - 
 +// 
 +// Das Zufällige Austeilen von Attributen macht es nötig die Werte im Nachhinein an die Waffen anzupassen. 
 +// Diese Methode schreibt die Werte neu, wenn sie nicht ausreichen die gewollten Waffen zu tragen. 
 +// Dazu wird die Nebenmethode B_SetAttributForWeapon(waffe) benötigt. Die Methode setzt alle 3 Attribute und equipt die Waffe. 
 +// 
 +///////////////////////////////////////////////////////////////////////////////////////////////////////////////​ 
 +/* Zur Erinnerung die in der Waffe beschriebenen benötigten Attribute: (Classes.d) 
 +  
 + // Benötigte Attribute zum Benutzen des Items 
 + VAR INT cond_atr [3] ;​ 
 + VAR INT cond_value [3] ;​ 
 + 
 +(constants.d) 
 + 
 +const int ATR_HITPOINTS = ​ 0; // Lebenspunkte 
 +const int ATR_HITPOINTS_MAX = ​ 1; // Max. Lebenspunkte 
 +const int ATR_MANA = ​ 2; // Mana Mana 
 +const int ATR_MANA_MAX = ​ 3; // Mana Max 
 + 
 +const int ATR_STRENGTH = ​ 4; // Stärke 
 +const int ATR_DEXTERITY = ​ 5; // Geschick 
 +const int ATR_REGENERATEHP = ​ 6; // Regenerierung von HP alle x sekunden 
 +const int ATR_REGENERATEMANA = ​ 7;   // Regenerierung von Mana alle x sekunden 
 + 
 +*/ 
 + 
 +func void B_SetAttributForWeapon(var int waffenInstanz) 
 +
 + //- - - - - Resett for Random - - - - - - 
 + Hlp_Rand_Resett();​ 
 +  
 + var int rnd; rnd = Hlp_Rand(10);​ 
 +  
 + //​Notausstieg:​ 
 + if waffenInstanz == nothing //NO_ARMOR ist Ersatz für nil oder nothing 
 +
 + return;​  
 +
 + else 
 +
 + CreateInvItems (self,​ waffenInstanz,​ 1);​ 
 + }; 
 +  
 + if item.cond_atr[0] == ATR_HITPOINTS { if self.attribute[ATR_HITPOINTS] < item.cond_value[0] {self.attribute[ATR_HITPOINTS] = item.cond_value[0] + rnd; }; } 
 + else if item.cond_atr[0] == ATR_HITPOINTS_MAX { if self.attribute[ATR_HITPOINTS_MAX] < item.cond_value[0] {self.attribute[ATR_HITPOINTS_MAX] = item.cond_value[0] + rnd; }; } 
 + else if item.cond_atr[0] == ATR_MANA { if self.attribute[ATR_MANA] < item.cond_value[0] {self.attribute[ATR_MANA] = item.cond_value[0] + rnd; }; } 
 + else if item.cond_atr[0] == ATR_MANA_MAX { if self.attribute[ATR_MANA_MAX] < item.cond_value[0] {self.attribute[ATR_MANA_MAX] = item.cond_value[0] + rnd; }; } 
 + else if item.cond_atr[0] == ATR_STRENGTH { if self.attribute[ATR_STRENGTH] < item.cond_value[0] {self.attribute[ATR_STRENGTH] = item.cond_value[0] + rnd; }; } 
 + else if item.cond_atr[0] == ATR_DEXTERITY { if self.attribute[ATR_DEXTERITY] < item.cond_value[0] {self.attribute[ATR_DEXTERITY] = item.cond_value[0] + rnd; }; } 
 + else if item.cond_atr[0] == ATR_REGENERATEHP { if self.attribute[ATR_REGENERATEHP] < item.cond_value[0] {self.attribute[ATR_REGENERATEHP] = item.cond_value[0] + rnd; }; } 
 + else if item.cond_atr[0] == ATR_REGENERATEMANA { if self.attribute[ATR_REGENERATEMANA] < item.cond_value[0] {self.attribute[ATR_REGENERATEMANA] = item.cond_value[0] + rnd; }; }; 
 +  
 + if item.cond_atr[1] == ATR_HITPOINTS { if self.attribute[ATR_HITPOINTS] < item.cond_value[1] {self.attribute[ATR_HITPOINTS] = item.cond_value[1] + rnd; }; } 
 + else if item.cond_atr[1] == ATR_HITPOINTS_MAX { if self.attribute[ATR_HITPOINTS_MAX] < item.cond_value[1] {self.attribute[ATR_HITPOINTS_MAX] = item.cond_value[1] + rnd; }; } 
 + else if item.cond_atr[1] == ATR_MANA { if self.attribute[ATR_MANA] < item.cond_value[1] {self.attribute[ATR_MANA] = item.cond_value[1] + rnd; }; } 
 + else if item.cond_atr[1] == ATR_MANA_MAX { if self.attribute[ATR_MANA_MAX] < item.cond_value[1] {self.attribute[ATR_MANA_MAX] = item.cond_value[1] + rnd; }; } 
 + else if item.cond_atr[1] == ATR_STRENGTH { if self.attribute[ATR_STRENGTH] < item.cond_value[1] {self.attribute[ATR_STRENGTH] = item.cond_value[1] + rnd; }; } 
 + else if item.cond_atr[1] == ATR_DEXTERITY { if self.attribute[ATR_DEXTERITY] < item.cond_value[1] {self.attribute[ATR_DEXTERITY] = item.cond_value[1] + rnd; }; } 
 + else if item.cond_atr[1] == ATR_REGENERATEHP { if self.attribute[ATR_REGENERATEHP] < item.cond_value[1] {self.attribute[ATR_REGENERATEHP] = item.cond_value[1] + rnd; }; } 
 + else if item.cond_atr[1] == ATR_REGENERATEMANA { if self.attribute[ATR_REGENERATEMANA] < item.cond_value[1] {self.attribute[ATR_REGENERATEMANA] = item.cond_value[1] + rnd; }; }; 
 +  
 + if item.cond_atr[2] == ATR_HITPOINTS { if self.attribute[ATR_HITPOINTS] < item.cond_value[2] {self.attribute[ATR_HITPOINTS] = item.cond_value[2] + rnd; }; } 
 + else if item.cond_atr[2] == ATR_HITPOINTS_MAX { if self.attribute[ATR_HITPOINTS_MAX] < item.cond_value[2] {self.attribute[ATR_HITPOINTS_MAX] = item.cond_value[2] + rnd; }; } 
 + else if item.cond_atr[2] == ATR_MANA { if self.attribute[ATR_MANA] < item.cond_value[2] {self.attribute[ATR_MANA] = item.cond_value[2] + rnd; }; } 
 + else if item.cond_atr[2] == ATR_MANA_MAX { if self.attribute[ATR_MANA_MAX] < item.cond_value[2] {self.attribute[ATR_MANA_MAX] = item.cond_value[2] + rnd; }; } 
 + else if item.cond_atr[2] == ATR_STRENGTH { if self.attribute[ATR_STRENGTH] < item.cond_value[2] {self.attribute[ATR_STRENGTH] = item.cond_value[2] + rnd; }; } 
 + else if item.cond_atr[2] == ATR_DEXTERITY { if self.attribute[ATR_DEXTERITY] < item.cond_value[2] {self.attribute[ATR_DEXTERITY] = item.cond_value[2] + rnd; }; } 
 + else if item.cond_atr[2] == ATR_REGENERATEHP { if self.attribute[ATR_REGENERATEHP] < item.cond_value[2] {self.attribute[ATR_REGENERATEHP] = item.cond_value[2] + rnd; }; } 
 + else if item.cond_atr[2] == ATR_REGENERATEMANA { if self.attribute[ATR_REGENERATEMANA] < item.cond_value[2] {self.attribute[ATR_REGENERATEMANA] = item.cond_value[2] + rnd; }; }; 
 + 
 + EquipItem(self,​waffenInstanz);​ 
 +}; 
 + 
 +func void B_SetAttributForWeapons(var int nahKampfWaffe,​ var int ferKampfWaffe) 
 +
 + if nahKampfWaffe != nothing 
 +
 + B_SetAttributForWeapon(nahKampfWaffe);​ 
 + }; 
 + if ferKampfWaffe != nothing 
 +
 + B_SetAttributForWeapon(ferKampfWaffe);​ 
 + }; 
 +}; 
 +</​code>​
daedalus/nuetzliches.txt · Zuletzt geändert: 2016/12/31 10:11 von milky-way