Portal-Zone Gothic-Zone Gothic II-Zone Gothic 3-Zone Gothic 4-Zone Modifikationen-Zone Download-Zone Foren-Zone RPG-Zone Almanach-Zone Spirit of Gothic

 

Results 1 to 3 of 3
  1. View Forum Posts #1 Reply With Quote
    Ritter Moe's Avatar
    Join Date
    Jan 2009
    Location
    Oberösterreich
    Posts
    1,924
     
    Moe is offline

    Gilde Wassermagier nutzt falsche Zauber

    Ich hab in meiner B_SelectSpell der Gilde KDW eigentlich nur Wasserzauber zugewiesen, aber sie erhalten und nehmen trotzdem den Feuerball und den kleinen Feuersturm. Die Wasserzauber bekommen sie zwar auch ins Inventar, aber sie werden nicht genutzt.

    Woran liegt das?

    Code:
    func int B_SelectSpell(var C_Npc slf,var C_Npc oth)
    {
    	if((slf.npcType == NPCTYPE_FRIEND) && Npc_IsPlayer(oth) && (oth.guild < GIL_SEPERATOR_HUM))
    	{
    		if((slf.guild == GIL_KDF) || (slf.aivar[AIV_MagicUser] == MAGIC_ALWAYS))
    		{
    			if(Npc_HasItems(slf,ItRu_Sleep) == 0)
    			{
    				CreateInvItems(slf,ItRu_Sleep,1);
    			};
    			B_ReadySpell(slf,SPL_Sleep,SPL_Cost_Sleep);
    			return TRUE;
    		}
    		if((slf.guild == GIL_KDW) || (slf.aivar[AIV_MagicUser] == MAGIC_ALWAYS))
    		{
    			if(Npc_HasItems(slf,ItRu_Sleep) == 0)
    			{
    				CreateInvItems(slf,ItRu_Sleep,1);
    			};
    			B_ReadySpell(slf,SPL_Sleep,SPL_Cost_Sleep);
    			return TRUE;
    		}
    		else
    		{
    			return FALSE;
    		};
    	};
    	if((slf.guild == GIL_DMT) && (slf.aivar[AIV_MagicUser] == MAGIC_ALWAYS))
    	{
    		if(Hlp_GetInstanceID(slf) == Hlp_GetInstanceID(DMT_1299_OberDementor_DI))
    		{
    			if(Npc_HasItems(slf,ItRu_Deathball) == 0)
    			{
    				CreateInvItems(slf,ItRu_Deathball,1);
    			};
    			B_ReadySpell(slf,SPL_Deathball,SPL_COST_Deathball);
    		}
    		else if((MIS_ReadyforChapter4 == FALSE) && (Kapitel < 4))
    		{
    			if(Npc_HasItems(slf,ItRu_BeliarsRage) == 0)
    			{
    				CreateInvItems(slf,ItRu_BeliarsRage,1);
    			};
    			B_ReadySpell(slf,SPL_Energyball,SPL_Cost_Energyball);
    		}
    		else if(Kapitel < 6)
    		{
    			if(Npc_HasItems(slf,ItRu_BeliarsRage) == 0)
    			{
    				CreateInvItems(slf,ItRu_BeliarsRage,1);
    			};
    			B_ReadySpell(slf,SPL_Energyball,SPL_COST_Energyball);
    		}
    		else
    		{
    			if(Npc_HasItems(slf,ItRu_Deathbolt) == 0)
    			{
    				CreateInvItems(slf,ItRu_Deathbolt,1);
    			};
    			B_ReadySpell(slf,SPL_Deathbolt,SPL_COST_Deathbolt);
    		};
    		return TRUE;
    	};
    	if((slf.guild == GIL_KDF) || (slf.aivar[AIV_MagicUser] == MAGIC_ALWAYS))
    	{
    		if(Npc_HasItems(slf,ItRu_InstantFireball) == 0)
    		{
    			CreateInvItems(slf,ItRu_InstantFireball,1);
    		};
    		if(Npc_HasItems(slf,ItRu_InstantFirestorm) == 0)
    		{
    			CreateInvItems(slf,ItRu_InstantFirestorm,1);
    		};
    		if(Npc_HasItems(slf,ItRu_FullHeal) == 0)
    		{
    			CreateInvItems(slf,ItRu_FullHeal,1);
    		};
    		if(self.attribute[ATR_HITPOINTS] < 100)
    		{
    			B_ReadySpell(slf,SPL_FullHeal,SPL_Cost_FullHeal);
    			return TRUE;
    		}
    		else if(C_NpcHasAttackReasonToKill(self))
    		{
    			if(self.flags == NPC_FLAG_IMMORTAL)
    			{
    				B_ReadySpell(slf,SPL_InstantFirestorm,SPL_COST_InstantFirestorm);
    			}
    			else
    			{
    				B_ReadySpell(slf,SPL_InstantFireball,SPL_COST_InstantFireball);
    			};
    			return TRUE;
    		};
    	};	
    	if((slf.guild == GIL_KDW) || (slf.aivar[AIV_MagicUser] == MAGIC_ALWAYS))
    	{
    		if(Npc_HasItems(slf,ItRu_Waterfist) == 0)
    		{
    			CreateInvItems(slf,ItRu_Waterfist,1);
    		};
    		if(Npc_HasItems(slf,ItRu_Geyser) == 0)
    		{
    			CreateInvItems(slf,ItRu_Geyser,1);
    		};
    		if(Npc_HasItems(slf,ItRu_FullHeal) == 0)
    		{
    			CreateInvItems(slf,ItRu_FullHeal,1);
    		};
    		if(self.attribute[ATR_HITPOINTS] < 100)
    		{
    			B_ReadySpell(slf,SPL_FullHeal,SPL_Cost_FullHeal);
    			return TRUE;
    		}
    		else if(C_NpcHasAttackReasonToKill(self))
    		{
    			if(self.flags == NPC_FLAG_IMMORTAL)
    			{
    				B_ReadySpell(slf,SPL_Geyser,SPL_COST_Geyser);
    			}
    			else
    			{
    				B_ReadySpell(slf,SPL_Waterfist,SPL_COST_Waterfist);
    			};
    			return TRUE;
    		};
    	};
    	if(slf.guild == GIL_PAL)
    	{
    		if(slf.fight_tactic == FAI_NAILED)
    		{
    			return FALSE;
    		};
    		if(Npc_HasItems(slf,ItRu_PalHolyBolt) == 0)
    		{
    			CreateInvItems(slf,ItRu_PalHolyBolt,1);
    		};
    		if((Npc_GetDistToNpc(slf,oth) > FIGHT_DIST_MELEE) && C_NpcIsEvil(oth))
    		{
    			B_ReadySpell(slf,SPL_PalHolyBolt,SPL_Cost_PalHolyBolt);
    			return TRUE;
    		}
    		else
    		{
    			return FALSE;
    		};
    	};
    	if(slf.guild == GIL_SKELETON_MAGE)
    	{
    		if(Npc_HasItems(slf,ItRu_SumSkel) == 0)
    		{
    			CreateInvItems(slf,ItRu_SumSkel,1);
    		};
    		if(Npc_HasItems(slf,ItRu_IceCube) == 0)
    		{
    			CreateInvItems(slf,ItRu_IceCube,1);
    		};
    		if(Npc_HasItems(slf,ItRu_Icebolt) == 0)
    		{
    			CreateInvItems(slf,ItRu_Icebolt,1);
    		};
    		if(slf.aivar[AIV_SelectSpell] >= 6)
    		{
    			slf.aivar[AIV_SelectSpell] = 1;
    		};
    		if(!Npc_IsInState(oth,ZS_MagicFreeze) && (slf.aivar[AIV_SelectSpell] == 0))
    		{
    			B_ReadySpell(slf,SPL_IceCube,SPL_Cost_IceCube);
    			return TRUE;
    		}
    		else if(slf.aivar[AIV_SelectSpell] == 1)
    		{
    			B_ReadySpell(slf,SPL_SummonSkeleton,SPL_Cost_SummonSkeleton);
    			return TRUE;
    		}
    		else
    		{
    			B_ReadySpell(slf,SPL_Icebolt,SPL_COST_Icebolt);
    			return TRUE;
    		};
    	};
    	if(slf.guild == GIL_ICEGOLEM)
    	{
    		if(Npc_HasItems(slf,ItRu_IceCube) == 0)
    		{
    			CreateInvItems(slf,ItRu_IceCube,1);
    		};
    		if((Npc_GetDistToNpc(slf,oth) < FIGHT_DIST_MELEE) || Npc_IsInState(oth,ZS_MagicFreeze))
    		{
    			return FALSE;
    		}
    		else
    		{
    			B_ReadySpell(slf,SPL_IceCube,SPL_Cost_IceCube);
    			return TRUE;
    		};
    	};
    	if(slf.guild == GIL_FIREGOLEM)
    	{
    		if(Npc_HasItems(slf,ItRu_InstantFireball) == 0)
    		{
    			CreateInvItems(slf,ItRu_InstantFireball,1);
    		};
    		if(Npc_GetDistToNpc(slf,oth) > FIGHT_DIST_MELEE)
    		{
    			B_ReadySpell(slf,SPL_InstantFireball,SPL_COST_InstantFireball);
    			return TRUE;
    		}
    		else
    		{
    			return FALSE;
    		};
    	};	
    	if(slf.guild == GIL_GOBBO_MAGE)
    	{
    		if(Npc_HasItems(slf,ItRu_Zap) == 0)
    		{
    			CreateInvItems(slf,ItRu_Zap,1);
    		};
    		if(Npc_GetDistToNpc(slf,oth) > FIGHT_DIST_MELEE)
    		{
    			B_ReadySpell(slf,SPL_Zap,SPL_COST_Zap);
    			return TRUE;
    		}
    		else
    		{
    			return FALSE;
    		};
    		
    	};
    	if(slf.aivar[AIV_MM_REAL_ID] == ID_DRAGON_SWAMP)
    	{
    		if(Npc_HasItems(slf,ItRu_InstantFireball) == 0)
    		{
    			CreateInvItems(slf,ItRu_InstantFireball,1);
    		};
    		if(Npc_GetDistToNpc(slf,oth) > 1000)
    		{
    			B_ReadySpell(slf,SPL_InstantFireball,SPL_COST_InstantFireball);
    			return TRUE;
    		}
    		else
    		{
    			return FALSE;
    		};
    	};
    	if(slf.aivar[AIV_MM_REAL_ID] == ID_DRAGON_ROCK)
    	{
    		if(Npc_HasItems(slf,ItRu_InstantFireball) == 0)
    		{
    			CreateInvItems(slf,ItRu_InstantFireball,1);
    		};
    		if(Npc_GetDistToNpc(slf,oth) > 1000)
    		{
    			B_ReadySpell(slf,SPL_InstantFireball,SPL_COST_InstantFireball);
    			return TRUE;
    		}
    		else
    		{
    			return FALSE;
    		};
    	};
    	if(slf.aivar[AIV_MM_REAL_ID] == ID_DRAGON_FIRE)
    	{
    		if(Npc_HasItems(slf,ItRu_InstantFirestorm) == 0)
    		{
    			CreateInvItems(slf,ItRu_InstantFirestorm,1);
    		};
    		if(Npc_GetDistToNpc(slf,oth) > 1000)
    		{
    			B_ReadySpell(slf,SPL_InstantFireball,SPL_COST_InstantFireball);
    			return TRUE;
    		}
    		else
    		{
    			return FALSE;
    		};
    	};
    	if(slf.aivar[AIV_MM_REAL_ID] == ID_DRAGON_ICE)
    	{
    		if(Npc_HasItems(slf,ItRu_InstantFireball) == 0)
    		{
    			CreateInvItems(slf,ItRu_InstantFireball,1);
    		};
    		if(Npc_GetDistToNpc(slf,oth) > 1000)
    		{
    			B_ReadySpell(slf,SPL_InstantFireball,SPL_COST_InstantFireball);
    			return TRUE;
    		}
    		else
    		{
    			return FALSE;
    		};
    	};
    	if(slf.aivar[AIV_MM_REAL_ID] == ID_DRAGON_UNDEAD)
    	{
    		Npc_ClearAIQueue(self);
    		if(Npc_HasItems(slf,ItRu_Deathball) == 0)
    		{
    			CreateInvItems(slf,ItRu_Deathball,1);
    		};
    		if(Npc_GetDistToNpc(slf,oth) > 800)
    		{
    			B_ReadySpell(slf,SPL_Deathball,SPL_COST_Deathball);
    			return TRUE;
    		}
    		else
    		{
    			return FALSE;
    		};
    	};
    	if(slf.aivar[AIV_MM_REAL_ID] == ID_ORCSHAMAN)
    	{
    		if(Npc_HasItems(slf,ItRu_InstantFireball) == 0)
    		{
    			CreateInvItems(slf,ItRu_InstantFireball,1);
    		};
    		if(Npc_GetDistToNpc(slf,oth) > FIGHT_DIST_MELEE)
    		{
    			B_ReadySpell(slf,SPL_InstantFireball,SPL_COST_InstantFireball);
    			return TRUE;
    		}
    		else
    		{
    			return FALSE;
    		};
    	};
    	return FALSE;
    };

  2. View Forum Posts #2 Reply With Quote
    Ritter Draxes's Avatar
    Join Date
    Aug 2007
    Location
    Mainz
    Posts
    1,469
     
    Draxes is offline
    Entweder, deine Wassermagier haben aivar[AIV_MagicUser] auf MAGIC_ALWAYS gesetzt oder gehören ausversehen zur Gilde KDF. Das wären die zwei Möglichkeiten laut Code.

    Vermutlich wolltest du eher soetwas?

    Code:
    if((slf.guild == GIL_KDF) && (slf.aivar[AIV_MagicUser] == MAGIC_ALWAYS))

  3. View Forum Posts #3 Reply With Quote
    Ritter Moe's Avatar
    Join Date
    Jan 2009
    Location
    Oberösterreich
    Posts
    1,924
     
    Moe is offline
    Ja, genau! Dankeschön. Jetzt funktionierts.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Impressum | Link Us | intern
World of Gothic © by World of Gothic Team
Gothic, Gothic 2 & Gothic 3 are © by Piranha Bytes & Egmont Interactive & JoWooD Productions AG, all rights reserved worldwide