/////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // B_PickPocketInfos // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // // Wird aus ZS_TALK aufgerufen. --> den Aufrif müsstet ihr noch gestalten. // Beschreibt die Taschendiebstahl-Dialoge für JEDEN Human-NPC! // Dieser Dialog wird hiermit bei allen Menschen erscheinen die Gold haben. Die Schwierigkeit richtet sich wie gewohnt. // // /////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ************************************************************ // PICK POCKET // ************************************************************ INSTANCE DIA_PICKPOCKET(C_INFO) { nr = 900; condition = DIA_PICKPOCKET_Condition; information = DIA_PICKPOCKET_Info; permanent = TRUE; important = FALSE; }; FUNC INT DIA_PICKPOCKET_Condition() { if (Npc_GetTalentSkill (other,NPC_TALENT_PICKPOCKET) == TRUE) //Spieler kann das! && (self.aivar[AIV_PlayerHasPickedMyPocket] == FALSE) //Ich wurde noch nicht beklaut && (Npc_HasItems(self,ItMi_Gold) >= 1)// Es gibt was zu stehlen && (NpcObsessedByDMT == FALSE) { return TRUE; }; }; FUNC VOID DIA_PICKPOCKET_Info() { Info_ClearChoices (DIA_PICKPOCKET); Info_AddChoice (DIA_PICKPOCKET, DIALOG_ENDE ,DIA_PICKPOCKET_BACK); Info_AddChoice (DIA_PICKPOCKET, DIALOG_PICKPOCKET ,DIA_PICKPOCKET_DoIt); }; func void DIA_PICKPOCKET_DoIt() { var int randy; randy = Hlp_Random(Theftdiff); //SC hat fast soviel DEX wie NSC, dann Zufall oder sowieso mehr DEX if ( (other.attribute[ATR_DEXTERITY] >= self.attribute[ATR_DEXTERITY] - Theftdiff) && (other.attribute[ATR_DEXTERITY] < self.attribute[ATR_DEXTERITY]) && randy >= Theftdiff / 2 ) || ( other.attribute[ATR_DEXTERITY] >= self.attribute[ATR_DEXTERITY]) { B_GiveInvItems (self, other, ItMi_Gold, Npc_HasItems(other,ItMi_Gold)); self.aivar[AIV_PlayerHasPickedMyPocket] = TRUE; B_GiveThiefXP();//B_GivePlayerXP (XP_Ambient); Snd_Play ("Geldbeutel"); } else { B_ResetThiefLevel(); AI_StopProcessInfos (self); B_Attack (self, other, AR_Theft, 1); //reagiert trotz IGNORE_Theft mit NEWS }; Info_ClearChoices (DIA_PICKPOCKET); }; func void DIA_PICKPOCKET_BACK() { AI_StopProcessInfos(self); }; /* Zur Erinnerung: const string Pickpocket_20 = "(Es wäre ein Kinderspiel seinen Geldbeutel zu stehlen)"; const string Pickpocket_40 = "(Es wäre einfach seinen Geldbeutel zu stehlen)"; const string Pickpocket_60 = "(Es wäre gewagt seinen Geldbeutel zu stehlen)"; const string Pickpocket_80 = "(Es wäre schwierig seinen Geldbeutel zu stehlen)"; const string Pickpocket_100 = "(Es wäre verdammt schwierig seinen Geldbeutel zu stehlen)"; const string Pickpocket_120 = "(Es wäre fast unmöglich seinen Geldbeutel zu stehlen)"; const string Pickpocket_20_Female = "(Es wäre ein Kinderspiel ihren Geldbeutel zu stehlen)"; const string Pickpocket_40_Female = "(Es wäre einfach ihren Geldbeutel zu stehlen)"; const string Pickpocket_60_Female = "(Es wäre gewagt ihren Geldbeutel zu stehlen)"; const string Pickpocket_80_Female = "(Es wäre schwierig ihren Geldbeutel zu stehlen)"; const string Pickpocket_100_Female = "(Es wäre verdammt schwierig ihren Geldbeutel zu stehlen)"; const string Pickpocket_120_Female = "(Es wäre fast unmöglich ihren Geldbeutel zu stehlen)"; */ func void B_PickPocketInfos () { //EXIT IF... if Hlp_GetInstanceID(self) == Hlp_GetInstanceID(other) { return; }; //Func DIA_PICKPOCKET.npc = Hlp_GetInstanceID(self); if self.aivar[AIV_Gender] == MALE { if self.attribute[ATR_DEXTERITY] < 40 { DIA_PICKPOCKET.description = Pickpocket_20; } else if self.attribute[ATR_DEXTERITY] < 60 { DIA_PICKPOCKET.description = Pickpocket_40; } else if self.attribute[ATR_DEXTERITY] < 80 { DIA_PICKPOCKET.description = Pickpocket_60; } else if self.attribute[ATR_DEXTERITY] < 100 { DIA_PICKPOCKET.description = Pickpocket_80; } else if self.attribute[ATR_DEXTERITY] < 120 { DIA_PICKPOCKET.description = Pickpocket_100;} else { DIA_PICKPOCKET.description = Pickpocket_120;}; } else { if self.attribute[ATR_DEXTERITY] < 40 { DIA_PICKPOCKET.description = Pickpocket_20_Female; } else if self.attribute[ATR_DEXTERITY] < 60 { DIA_PICKPOCKET.description = Pickpocket_40_Female; } else if self.attribute[ATR_DEXTERITY] < 80 { DIA_PICKPOCKET.description = Pickpocket_60_Female; } else if self.attribute[ATR_DEXTERITY] < 100 { DIA_PICKPOCKET.description = Pickpocket_80_Female; } else if self.attribute[ATR_DEXTERITY] < 120 { DIA_PICKPOCKET.description = Pickpocket_100_Female;} else { DIA_PICKPOCKET.description = Pickpocket_120_Female;}; }; };
Constans.d-Auszug
// ****************** // Gilden // ****************** // Für mehr gilden const int AIV_GuildStufe = 90; const int GIL_STUFE_0 = 0; const int GIL_STUFE_1 = 1; const int GIL_STUFE_2 = 2; const int GIL_STUFE_3 = 3; const int GIL_STUFE_4 = 4; const int GIL_STUFE_5 = 5; const int GIL_STUFE_NONE = GIL_STUFE_0; const int GIL_STUFE_NEULING = GIL_STUFE_1; const int GIL_STUFE_KAEMPFER = GIL_STUFE_2; const int GIL_STUFE_KRIEGER = GIL_STUFE_3; const int GIL_STUFE_LEHRLING = GIL_STUFE_4; const int GIL_STUFE_MAGIER = GIL_STUFE_5; const int GIL_NONE = 0 ; // (keine) const int GIL_HUMAN = 1 ; // Special Guild -> To set Constants for ALL Human Guilds --> wird verwendet in Species.d const int GIL_ROT = 2; const int GIL_BLAU = 3; const int GIL_GRAU = 4; const int GIL_GRUEN = 5; const int GIL_SCHWARZ = 6; const int GIL_NOVIZE = 7; const int GIL_OUTLAENDER = 8; const int GIL_MAGIER_ROT = 10; const int GIL_MAGIER_BLAU = 11; const int GIL_MAGIER_GRAU = 12; const int GIL_MAGIER_GRUEN = 13; const int GIL_MAGIER_SCHWARZ = 14; const int GIL_HERO = 9;
Ich habe hier ein paar Beispiel Gilden zusammen gefügt.
Es gibt 5 Gruppen nach Farben sortiert.
Die Magier genießen hier als Beispiel einen besonderen Stand.
Es gibt noch ein paar Nebengilden und eine Gilde namens Hero,
damit sich alle Farben bekriegen „können“, aber den Spieler-Charakter nich angreifen.
//Alte gilden bekommen 1 const int GIL_OLD = 1; const int GIL_PAL = GIL_OLD ; // Paladin const int GIL_MIL = GIL_OLD ; // Miliz const int GIL_VLK = GIL_OLD ; // Bürger const int GIL_KDF = GIL_OLD ; // Magier const int GIL_NOV = GIL_OLD ; // Magier Novize const int GIL_DJG = GIL_OLD ; // Drachenjäger const int GIL_SLD = GIL_OLD ; // Söldner const int GIL_BAU = GIL_OLD ; // Bauer const int GIL_BDT = GIL_OLD ; // Bandit const int GIL_STRF = GIL_OLD ; // Prisoner, Sträfling const int GIL_DMT = GIL_OLD ; // Dementoren const int GIL_OUT = GIL_OLD ; // Outlander (z.B. kleine Bauernhöfe) const int GIL_PIR = GIL_OLD ; //Pirat const int GIL_KDW = GIL_OLD ; //KDW //Ende der alten gilden const int GIL_EMPTY_D = 15 ; // NICHT VERWENDEN! //- - - - - - - - - - - - - - - - - - - - - const int GIL_PUBLIC = 15 ; // für öffentliche Portalräume //- - - - - - - - - - - - - - - - - - - - - const int GIL_SEPERATOR_HUM = 16 ;
Dann… Text.d Auszug
// **************************************************************************************** // Gildennamen // ***************************************************************************************** var STRING TXT_GUILDS [GIL_MAX]; //FixMeHoshi Fokus und Spellnamen abgleichen. (auch im B_TEachTalentRunes!!)
Und hier noch zwei sachen:
Npc_Globals.d:
SetGuild_Text(); // ********************** if (Kapitel == 0) { Kapitel = 1; //HACK - wenn man mal wieder Xardas nicht anquatscht... }; Guild_Text.d (neue Datei --> muss in die gothic.src) func void SetGuild_Text () { // - Charakterblatt (Text der Spielergilde) // - Debuganzeige (Taste "G") TXT_GUILDS[0] = "Gildenlos"; . . . --> Alle Gildennamen festlegen . . . //Orks TXT_GUILDS[59] = "Ork" ; TXT_GUILDS[60] = "Ork" ; TXT_GUILDS[61] = "Untoter Ork" ; TXT_GUILDS[62] = "Drakonier" ; TXT_GUILDS[63] = "X" ; TXT_GUILDS[64] = "Y" ; TXT_GUILDS[65] = "Z" ; };
und hier ein Auszug aus einer Npc_Datei:
// - - - - - - NSC - - - - - - name = "Nodrog"; guild = GIL_MAGIER_ROT; id = 1401; voice = VOICE_NODROG; flags = NPC_FLAG_IMMORTAL; //NPC_FLAG_IMMORTAL oder 0 npcType = NPCTYPE_MAIN; aivar[ AIV_MagicUser] = MAGIC_ALWAYS; aivar[ AIV_GuildStufe] = GIL_STUFE_MAGIER;
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.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // Hlp_Rand // - - - - - - - - - - - - - - - - - - - - - - - - - - // // Eine neue Zufallsfunktion errechnet durch die ModuloMethode. // Durch 8 Resettbare Startwerte wird die ZufallsZahl nicht reanimierbar. // Der Resett erfolgt durch die bereits vorhandene Zufallsfunktion Hlp_Random. // Diese weist eine ungleichmäßige statistische Verteilung auf. Diese wird durch 3 Modulo-Operationen neutralisiert. // /////////////////////////////////////////////////////////////////////////////////////////////////////////////// var int start1; var int start2; var int start3; var int start4; var int start5; var int start6; var int start7; var int start8; func int Hlp_Rand (var int Obergrenze) { // Der Später zurückzugebene Wert. var int ret; //Berechnung des Zufalls wertes ret = (start1*start2+start3) % Obergrenze; //Neutralisierung der Verteilung start1 = (start4*start5+start6) % start7; start2 = (start1*ret+start3) % start8; return ret; }; func void Hlp_Rand_Resett () { start1 = Hlp_Random(1034); start2 = Hlp_Random(3345); start3 = Hlp_Random(7986); start4 = Hlp_Random(5624); start5 = Hlp_Random(3188); start6 = Hlp_Random(1655); start7 = Hlp_Random(6481); start8 = Hlp_Random(4263); };
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.
Damit ist dem Spieler das manuelle Plündern von zB Tieren wie Wölfen abgenommen.
Es hat noch einen weiteren Vorteil!
Der Scripter ist nun in der Situation, Questereignisse durch die Entnahme von Items auszulösen.
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.
// ************************** // B_GiveDeathInv // -------------- // für Menschen und Monster // gibt Monstern AnimalTrophy // self == victm // other == attacker // ************************** var int B_GiveDeathInv_amount; func void B_GiveDeathInv_GiveAllTheInv (var int slot) { var int amount; //setzt item amount = Npc_GetInvItemBySlot(self, slot, slot); if item.mainflag == ITEM_KAT_ARMOR && amount > 0 { B_GiveDeathInv_GiveAllTheInv(slot + 1); } else if amount > 0 { var int itemInstance; itemInstance = Hlp_GetInstanceID(item); CreateInvItems (other, itemInstance , amount); Npc_RemoveInvItems (self,itemInstance,amount); B_GiveDeathInv_amount += amount; B_GiveDeathInv_GiveAllTheInv(slot); }; }; func void B_GiveDeathInv () { // EXIT IF... //-------- NUR beim ersten Durchlauf weitermachen (AIV_DeathInvGiven ist dann FALSE, wird hier (unten) auf TRUE gesetzt) -------- if (self.aivar[AIV_DeathInvGiven] == TRUE) { return; }; // ------ Zähne verteilen ------ if (PLAYER_TALENT_TAKEANIMALTROPHY[TROPHY_Teeth] == TRUE) { if (self.aivar[AIV_MM_REAL_ID] == ID_WOLF) { CreateInvItems (self, ItAt_Teeth , 2); }; if (self.aivar[AIV_MM_REAL_ID] == ID_ICEWOLF) { CreateInvItems (self, ItAt_Teeth , 2); }; if (self.aivar[AIV_MM_REAL_ID] == ID_WARG) { CreateInvItems (self, ItAt_Teeth , 2); }; if (self.aivar[AIV_MM_REAL_ID] == ID_SNAPPER) { CreateInvItems (self, ItAt_Teeth , 2); }; if (self.aivar[AIV_MM_REAL_ID] == ID_DRAGONSNAPPER) { CreateInvItems (self, ItAt_Teeth , 2); }; if (self.aivar[AIV_MM_REAL_ID] == ID_RAZOR) { CreateInvItems (self, ItAt_Teeth , 2); }; if (self.aivar[AIV_MM_REAL_ID] == ID_SHADOWBEAST) { CreateInvItems (self, ItAt_Teeth , 2); }; if (self.aivar[AIV_MM_REAL_ID] == ID_BLOODHOUND) { CreateInvItems (self, ItAt_Teeth , 2); }; if (self.aivar[AIV_MM_REAL_ID] == ID_SWAMPSHARK) { CreateInvItems (self, ItAt_SharkTeeth, 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_TROLL) { CreateInvItems (self, ItAt_TrollTooth, 2); }; if (self.aivar[AIV_MM_REAL_ID] == ID_TROLL_BLACK) { CreateInvItems (self, ItAt_TrollTooth, 4); }; }; // ------ Krallen verteilen ------ if (PLAYER_TALENT_TAKEANIMALTROPHY[TROPHY_Claws] == TRUE) { if (self.aivar[AIV_MM_REAL_ID] == ID_WARAN) { CreateInvItems (self, ItAt_Claw , 2); }; if (self.aivar[AIV_MM_REAL_ID] == ID_FIREWARAN) { CreateInvItems (self, ItAt_Claw , 4); }; if (self.aivar[AIV_MM_REAL_ID] == ID_SNAPPER) { CreateInvItems (self, ItAt_Claw , 2); }; if (self.aivar[AIV_MM_REAL_ID] == ID_RAZOR) { CreateInvItems (self, ItAt_Claw , 2); }; if (self.aivar[AIV_MM_REAL_ID] == ID_DRAGONSNAPPER) { CreateInvItems (self, ItAt_Claw , 4); }; if (self.aivar[AIV_MM_REAL_ID] == ID_SHADOWBEAST) { CreateInvItems (self, ItAt_Claw , 4); }; if (self.aivar[AIV_MM_REAL_ID] == ID_BLOODHOUND) { CreateInvItems (self, ItAt_Claw , 4); }; if (self.aivar[AIV_MM_REAL_ID] == ID_LURKER) { CreateInvItems (self, ItAt_LurkerClaw, 1); }; }; // ------ Fell und Häute verteilen ------ if (PLAYER_TALENT_TAKEANIMALTROPHY[TROPHY_Fur] == TRUE) { if (self.aivar[AIV_MM_REAL_ID] == ID_SHEEP) { CreateInvItems (self, ItAt_SheepFur , 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_WOLF) { CreateInvItems (self, ItAt_WolfFur , 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_ICEWOLF) { CreateInvItems (self, ItAt_WolfFur , 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_WARG) { CreateInvItems (self, ItAt_WargFur , 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_SHADOWBEAST) { CreateInvItems (self, ItAt_ShadowFur , 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_TROLL) { CreateInvItems (self, ItAt_TrollFur , 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_TROLL_BLACK) { CreateInvItems (self, ItAt_TrollBlackFur , 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_Keiler) { CreateInvItems (self, ItAt_Addon_KeilerFur, 1); }; }; // ------ Fell und Häute verteilen ------ if (PLAYER_TALENT_TAKEANIMALTROPHY[TROPHY_ReptileSkin] == TRUE) { if (self.aivar[AIV_MM_REAL_ID] == ID_LURKER) { CreateInvItems (self, itat_LurkerSkin, 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_SNAPPER) { CreateInvItems (self, itat_LurkerSkin, 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_RAZOR) { CreateInvItems (self, itat_LurkerSkin, 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_DRAGONSNAPPER) { CreateInvItems (self, itat_LurkerSkin, 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_WARAN) { CreateInvItems (self, itat_LurkerSkin, 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_FIREWARAN) { CreateInvItems (self, itat_LurkerSkin, 1); }; // --------------------------------------------------------------------------------------------------- if (self.aivar[AIV_MM_REAL_ID] == ID_SWAMPSHARK) { CreateInvItems (self, ItAt_SharkSkin , 1); }; }; // ------ Herzen verteilen ------ if (PLAYER_TALENT_TAKEANIMALTROPHY[TROPHY_Heart] == TRUE) { if (self.aivar[AIV_MM_REAL_ID] == ID_STONEGOLEM) { CreateInvItems (self, ItAt_StoneGolemHeart , 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_FIREGOLEM) { CreateInvItems (self, ItAt_FireGolemHeart , 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_ICEGOLEM) { CreateInvItems (self, ItAt_IceGolemHeart , 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_DEMON) { CreateInvItems (self, ItAt_DemonHeart, 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_DEMON_LORD) { CreateInvItems (self, ItAt_DemonHeart, 1); }; }; // ------ Horn eines Shadowbeasts ------ if (PLAYER_TALENT_TAKEANIMALTROPHY[TROPHY_ShadowHorn] == TRUE) { if (self.aivar[AIV_MM_REAL_ID] == ID_SHADOWBEAST) { CreateInvItems (self, ItAt_ShadowHorn, 1); }; }; // ------ Zunge eines Feuerwarans ------ if (PLAYER_TALENT_TAKEANIMALTROPHY[TROPHY_FireTongue] == TRUE) { if (self.aivar[AIV_MM_REAL_ID] == ID_FIREWARAN) { CreateInvItems (self, ItAt_WaranFiretongue, 1); }; }; // ------ Blutfliegen-Flügel ------ if (PLAYER_TALENT_TAKEANIMALTROPHY[TROPHY_BFWing] == TRUE) { if (self.aivar[AIV_MM_REAL_ID] == ID_BLOODFLY) { CreateInvItems (self, ItAt_Wing, 2); }; }; // ------ Blutfliegen-Stachel ------ if (PLAYER_TALENT_TAKEANIMALTROPHY[TROPHY_BFSting] == TRUE) { if (self.aivar[AIV_MM_REAL_ID] == ID_BLOODFLY) { CreateInvItems (self, ItAt_Sting, 1); }; }; // ------ Zangen von Giant_Bugs und Crawlern ------ if (PLAYER_TALENT_TAKEANIMALTROPHY[TROPHY_Mandibles] == TRUE) { if (self.aivar[AIV_MM_REAL_ID] == ID_GIANT_BUG) { CreateInvItems (self, ItAt_BugMandibles, 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_MINECRAWLER) { CreateInvItems (self, ItAt_CrawlerMandibles, 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_MINECRAWLERWARRIOR) { CreateInvItems (self, ItAt_CrawlerMandibles, 1); }; }; // ------ Crawler-Platten ------ if (PLAYER_TALENT_TAKEANIMALTROPHY[TROPHY_CrawlerPlate] == TRUE) { if (self.aivar[AIV_MM_REAL_ID] == ID_MINECRAWLER) { CreateInvItems (self, ItAt_CrawlerPlate, 1); }; if (self.aivar[AIV_MM_REAL_ID] == ID_MINECRAWLERWARRIOR) { CreateInvItems (self, ItAt_CrawlerPlate, 2); }; }; // ------ Drachensnapperhorn ------ if (PLAYER_TALENT_TAKEANIMALTROPHY[TROPHY_DrgSnapperHorn] == TRUE) { if (self.aivar[AIV_MM_REAL_ID] == ID_DRAGONSNAPPER) { CreateInvItems (self, ItAt_DrgSnapperHorn, 2); }; }; // ------ Verteilung von ANFANG AN ------ if (self.aivar[AIV_MM_REAL_ID] == ID_MEATBUG) { CreateInvItems (self, ItAt_MeatbugFlesh, 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_DRAGON_UNDEAD) { CreateInvItems (self, ItAt_UndeadDragonSoulStone , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_DRAGON_FIRE) { CreateInvItems (self, ItAt_FireDragonHeart , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_DRAGON_ICE) { CreateInvItems (self, ItAt_IceDragonHeart , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_DRAGON_ROCK) { CreateInvItems (self, ItAt_RockDragonHeart , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_DRAGON_SWAMP) { CreateInvItems (self, ItAt_SwampDragonHeart , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_GOBBO_SKELETON){ CreateInvItems (self, ItAt_GoblinBone , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_SKELETON) { CreateInvItems (self, ItAt_SkeletonBone , 1); } //----------------ADDON----------------------- else if (self.aivar[AIV_MM_REAL_ID] == ID_BLATTCRAWLER) { CreateInvItems (self, ItAt_Addon_BCKopf , 1);}; //ROHES FLEISCH IN NPC_SCRIPTEN!!! - HOGE // ------ Gobbo Green Inventory ------ GoblinGreen_Randomizer = Hlp_Random (100); if (self.aivar[AIV_MM_REAL_ID] == ID_GOBBO_GREEN) && (GoblinGreen_Randomizer == 0) { CreateInvItems (self, ItMi_SilverRing , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_GOBBO_GREEN) && (GoblinGreen_Randomizer <= 5) { CreateInvItems (self, ItPl_Mushroom_01 , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_GOBBO_GREEN) && (GoblinGreen_Randomizer <= 15) { CreateInvItems (self, Itmi_Gold , 5); } else if (self.aivar[AIV_MM_REAL_ID] == ID_GOBBO_GREEN) && (GoblinGreen_Randomizer <= 30) { CreateInvItems (self, ItFo_Fish , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_GOBBO_GREEN) && (GoblinGreen_Randomizer <= 50) { CreateInvItems (self, ItMi_Gold , 2); }; // ------ Gobbo Black Inventory ------ GoblinBlack_Randomizer = Hlp_Random (100); if (self.aivar[AIV_MM_REAL_ID] == ID_GOBBO_BLACK) && (GoblinBlack_Randomizer == 0) { CreateInvItems (self, ItMi_GoldRing , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_GOBBO_BLACK) && (GoblinBlack_Randomizer <= 5) { CreateInvItems (self, ItFo_Fish , 1); } //CreateInvItems (self, ItPl_Dex_Herb_01 , 1); else if (self.aivar[AIV_MM_REAL_ID] == ID_GOBBO_BLACK) && (GoblinBlack_Randomizer <= 15) { CreateInvItems (self, Itmi_Gold , 10); } else if (self.aivar[AIV_MM_REAL_ID] == ID_GOBBO_BLACK) && (GoblinBlack_Randomizer <= 30) { CreateInvItems (self, ItPl_Mushroom_02 , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_GOBBO_BLACK) && (GoblinBlack_Randomizer <= 50) { CreateInvItems (self, ItMi_Gold , 5); }; // ------ Orc Inventory ----- Orc_Randomizer = Hlp_Random (10); //------ Orcwarrior ----- if (self.aivar[AIV_MM_REAL_ID] == ID_ORCWARRIOR) && (Orc_Randomizer == 0) { CreateInvItems (self, ItPo_Health_02 , 1); CreateInvItems (self, ItMI_Gold , 2); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCWARRIOR) && (Orc_Randomizer == 1) { CreateInvItems (self, ItPo_Health_01 , 1); CreateInvItems (self, ItFoMuttonRaw , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCWARRIOR) && (Orc_Randomizer == 2) { CreateInvItems (self, ItPo_Health_01 , 2); CreateInvItems (self, ItMI_Gold , 18); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCWARRIOR) && (Orc_Randomizer == 3) { CreateInvItems (self, ItFo_Booze , 1); CreateInvItems (self, ItMi_SilverRing , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCWARRIOR) && (Orc_Randomizer == 4) { CreateInvItems (self, ItPl_Health_Herb_01 , 1); CreateInvItems (self, ItMI_Gold , 4); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCWARRIOR) && (Orc_Randomizer <= 7) { CreateInvItems (self, ItMI_Gold , 9); }; //----- OrcShamane ----- if (self.aivar[AIV_MM_REAL_ID] == ID_ORCSHAMAN) && (Orc_Randomizer == 0) { CreateInvItems (self, ItPo_Mana_03 , 1); CreateInvItems (self, ItMI_Gold , 5); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCSHAMAN) && (Orc_Randomizer == 1) { CreateInvItems (self, ItPo_Mana_02 , 2); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCSHAMAN) && (Orc_Randomizer == 2) { CreateInvItems (self, ItPo_Mana_02 , 1); CreateInvItems (self, ItMi_Coal,1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCSHAMAN) && (Orc_Randomizer == 3) { CreateInvItems (self, ItPo_Mana_01 , 2); CreateInvItems (self, ItMI_Gold , 12); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCSHAMAN) && (Orc_Randomizer == 4) { CreateInvItems (self, ItPo_Mana_01 , 1); CreateInvItems (self, ItMi_Sulfur,1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCSHAMAN) && (Orc_Randomizer <= 8) { CreateInvItems (self,ItPl_Mana_Herb_02,2); CreateInvItems (self, ItMI_Gold , 8); }; //----- OrcElite ----- if (self.aivar[AIV_MM_REAL_ID] == ID_ORCELITE ) && (Orc_Randomizer == 0) { CreateInvItems (self,ItAt_WolfFur,1); CreateInvItems (self,ItPo_Health_03,1); CreateInvItems (self,ItFoMutton,2); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCELITE) && (Orc_Randomizer == 1) { CreateInvItems (self,ItMi_GoldRing,1); CreateInvItems (self,ItPo_Health_01,1); CreateInvItems (self,ItMi_Gold,26); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCELITE) && (Orc_Randomizer == 2) { CreateInvItems (self,ItSc_LightHeal,1); CreateInvItems (self,ItLSTorch,2); CreateInvItems (self,ItAt_Teeth,1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCELITE) && (Orc_Randomizer <= 5) { CreateInvItems (self,ItMi_Gold,19); CreateInvItems (self,ItPo_Health_02,1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCELITE) && (Orc_Randomizer == 6) { CreateInvItems (self,ItAt_WargFur,1); //CreateInvItems (self,ItPl_Strength_Herb_01,1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_ORCELITE) && (Orc_Randomizer <= 9) { CreateInvItems (self,ItMi_Gold ,22); CreateInvItems (self,ItPo_Health_01,1); }; //-------- Dämonen ----- if (self.aivar[AIV_MM_REAL_ID] == ID_DEMON) && (Orc_Randomizer == 0) { CreateInvItems (self, ItPo_Mana_03 , 2); CreateInvItems (self, ItMi_GoldRing , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_DEMON) && (Orc_Randomizer <= 2) { CreateInvItems (self, ItPo_Mana_03 , 1); CreateInvItems (self, ItPo_Health_02 , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_DEMON) && (Orc_Randomizer <= 6) { CreateInvItems (self, ItPo_Mana_02 , 2); CreateInvItems (self, ItMi_Pitch,1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_DEMON) { CreateInvItems (self, ItPo_Mana_02 , 1); CreateInvItems (self, ItPo_Health_02 , 1); }; //-------- Dämonen Lord----- if (self.aivar[AIV_MM_REAL_ID] == ID_DEMON_LORD) && (Orc_Randomizer <= 1) { CreateInvItems (self, ItPo_Mana_03 , 2); CreateInvItems (self, ItPo_Health_03 , 2); CreateInvItems (self, ItSc_SumDemon , 1); } else if (self.aivar[AIV_MM_REAL_ID] == ID_DEMON_LORD) && (Orc_Randomizer <= 5) { CreateInvItems (self, ItPo_Mana_03 , 2); CreateInvItems (self, ItPo_Health_03 , 2); } else if (self.aivar[AIV_MM_REAL_ID] == ID_DEMON_LORD) { CreateInvItems (self, ItPo_Mana_03 , 1); CreateInvItems (self, ItPo_Health_03 , 1); }; if Npc_IsPlayer(other){ //Sonstige Items schmeißen: B_GiveDeathInv_GiveAllTheInv (0); if B_GiveDeathInv_amount == 1 { PrintScreen(PRINT_ItemErhalten,-1,YPOS_ItemTaken,FONT_ScreenSmall,10); }else if B_GiveDeathInv_amount >1 { PrintScreen(PRINT_ItemsErhalten,-1,YPOS_ItemTaken,FONT_ScreenSmall,10); }; }; //-------- AIV setzen, damit INV-Items nur EINMAL vergeben werden -------- self.aivar[AIV_DeathInvGiven] = TRUE; };
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:
// ------ XP ------ if ( Npc_IsPlayer(other) || (other.aivar[AIV_PARTYMEMBER]==TRUE) ) && (self.aivar[AIV_VictoryXPGiven] == FALSE) { B_GivePlayerXP (self.level * XP_PER_VICTORY); B_Counter (); self.aivar[AIV_VictoryXPGiven] = TRUE; };
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
.
// ******************************************** // B_Counter // ------------------------ // Kill-Counter // zählt die Kills für Learning by doing // ******************************************** func void B_Counter () { kill_counter += 1;// Plus einen Kill };
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
:
// ************************* // Globalvariablen für Story // ************************* // ------ NEU ------ var int kill_counter = 0;
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\Gothic.src
):
STORY\Log_Entries\Log_Constants_*.d STORY\XP_Constants.d STORY\Story_Globals.d STORY\NPC_Globals.d STORY\svm.d STORY\Text.d STORY\B_STORY\B_Counter.d
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.
So, damit wäre der Counter fertig. Nun erstellen wir noch eine zusätzliche Funktion in der B_Counter.d, nämlich ein Feature, das bei 30 Kills die Stärke um 5 erhöht.
Hierzu öffnen wr nochmals die B_Counter.d und verändern sie wie folgt:
func void B_Counter () { kill_counter += 1; if kill_counter == 30//Wenn der Counter die Zahl 30 erreicht hat, DANN: { hero.attribute[ATR_STRENGTH] += 5;//Stärke um 5 erhöhen Print (PRINT_STEIGERUNG);//Dem Spieler bescheid geben, dass die Stärke erhöht wurde kill_couter = 0;//Resetten, da später wieder der 30. Kill gezählt werden muss }; }; So, nun noch die neue Variable PRINT_STEIGERUNG in die Text.d eintragen, auch wieder ganz oben: // ***************************************************************************************** // NEU NEU NEU // ***************************************************************************************** const string PRINT_STEIGERUNG = "Die Stärke wurde um 5 gesteigert";
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.
/////////////////////////////////////////////////////////////////////////////////////////////////////////////// // // 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); }; };