Home Gothic Gothic II Gothic 3 Gothic 4 Downloads Forums

 

Ergebnis 1 bis 4 von 4
  1. Beiträge anzeigen #1
    Adventurer Avatar von QuiG
    Registriert seit
    Mar 2011
    Ort
    Gothic 2
    Beiträge
    75
     
    QuiG ist offline

    [G2] Tutorial: Make the "Cry of the Dead" to not drain all mana

    Behind the Idea:
    i found my self trapped in the finding of a mana regenerator since i want to be able to fire the skull more than once like any other spell since you obviously fight more than one opponent when you've reached that level, it brings instant death to any mortal opponents (but not dragons)

    sometimes its 666 damage is not enough and leaves just a few hp left of them(like one of the militia gate guards, who has 740 hp, not to mention the immortality on top of that)

    so i don't count it as a super spell due to when i have 300 mana i could use the fire rain a couple of times and do way more damage since it upon fire does 500 damage, not to mention if you get a hold of the scrolls you can fire it with just a loss of 5 mana.

    How to make it:
    how do you make the skull(Cry of the Dead ingame code: insert itru_skull) to not deplete ALL mana?

    first, open up the script(Spell_Skull.d - located in the AI\Magic\Spells):
    Code:
    const int SPL_Cost_Skull = 250;
    const int SPL_Damage_Skull = 666;
    
    instance Spell_Skull(C_Spell_Proto)
    {
    	time_per_mana = 0;
    	damage_per_level = SPL_Damage_Skull;
    	damagetype = DAM_MAGIC;
    	targetCollectAlgo = TARGET_COLLECT_FOCUS_FALLBACK_NONE;
    };
    
    
    func int Spell_Logic_Skull(var int manaInvested)
    {
    	if(Npc_GetActiveSpellIsScroll(self) && (self.attribute[ATR_MANA] >= SPL_Cost_Scroll))
    	{
    		return SPL_SENDCAST;
    	}
    	else if(self.attribute[ATR_MANA] >= SPL_Cost_Skull)
    	{
    		return SPL_SENDCAST;
    	}
    	else
    	{
    		return SPL_SENDSTOP;
    	};
    };
    
    func void Spell_Cast_Skull()
    {
    	if(Npc_GetActiveSpellIsScroll(self))
    	{
    		self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
    	}
    	else
    	{
    		self.attribute[ATR_MANA] = 0;
    	};
    	self.aivar[AIV_SelectSpell] += 1;
    };
    It says that it requires 250 mana:
    Code:
    const int SPL_Cost_Skull = 250;
    But then uses all mana, here's why

    Take another look in the code about the cast action and compare it with a different spell (i chose the firebolt spell for simplicity)

    Skull(Cry of the Dead):
    Code:
    func void Spell_Cast_Skull()
    {
    	if(Npc_GetActiveSpellIsScroll(self))
    	{
    		self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
    	}
    	else
    	{
    		self.attribute[ATR_MANA] = 0;
    	};
    	self.aivar[AIV_SelectSpell] += 1;
    };
    Firebolt:
    Code:
    func void Spell_Cast_Firebolt()
    {
    	if(Npc_GetActiveSpellIsScroll(self))
    	{
    		self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Scroll;
    	}
    	else
    	{
    		self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Firebolt;
    	};
    	self.aivar[AIV_SelectSpell] += 1;
    };
    The only difference is the else statement when the cast is not from a Scroll.

    Code:
    self.attribute[ATR_MANA] = 0;
    Sets the attribute mana to 0
    while
    Code:
    self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Firebolt;
    Sets the attribute mana to what it was minus the mana cost of the spell

    So just change the
    Code:
    self.attribute[ATR_MANA] = 0;
    to
    Code:
    self.attribute[ATR_MANA] = self.attribute[ATR_MANA] - SPL_Cost_Skull;
    And the Skull(Cry of the Dead) Should no-longer deplete all mana, instead just use up 250.

    Hope this helps.
    Geändert von QuiG (20.03.2011 um 19:21 Uhr)

  2. Beiträge anzeigen #2
    Hero Avatar von Tratos
    Registriert seit
    Sep 2006
    Ort
    Coventry, United Kingdom
    Beiträge
    5.939
     
    Tratos ist offline
    4 posts merged. Please use the edit function instead.

  3. Beiträge anzeigen #3
    Adventurer Avatar von QuiG
    Registriert seit
    Mar 2011
    Ort
    Gothic 2
    Beiträge
    75
     
    QuiG ist offline
    Zitat Zitat von Tratos Beitrag anzeigen
    4 posts merged. Please use the edit function instead.
    no length limit to a single post? :O
    didn't know but now i do i usually don't do the edit function unless i notice a misspell somewhere, you seem to like that function tho :P

  4. Beiträge anzeigen #4
    Hero Avatar von Tratos
    Registriert seit
    Sep 2006
    Ort
    Coventry, United Kingdom
    Beiträge
    5.939
     
    Tratos ist offline
    Zitat Zitat von QuiG Beitrag anzeigen
    no length limit to a single post? :O
    I think there is, never reached it though.

    It's just our custom that we avoid double-posting, if possible. Purely an aesthetics matter.

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
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