Scaling HP/MP Potions 5300 5

O temacie

Autor Vic7im

Zaczęty 10.04.2016 roku

Wyświetleń 5300

Odpowiedzi 5

Vic7im

Vic7im

Użytkownicy
posty84
Propsy92
Profesjabrak
  • Użytkownicy
Hello everyone and good morning.

Since you've all helped me a lot it's time I give something in return.
Presenting you: The scaling potions

The deal is that if you have enough HP they'll heal you for a portion of health instead of a flat amount.

Let's get to it. First

func void HP01()
{
if(hero.attribute[ATR_HITPOINTS_MAX] < 150)
{
Npc_ChangeAttribute(self,ATR_HITPOINTS,50);
}
else if(hero.attribute[ATR_HITPOINTS_MAX] >= 150)
{
var int CURHP;
CURHP = hero.attribute[ATR_HITPOINTS_MAX];
Npc_Changeattribute(self,atr_hitpoints,curhp/4);
};
};

This is the basic code, you can change whatever parameters you like to adapt it to any situation you want (should be pretty much self-explainatory)

Then in the IT_Potions.d file you replace the "func void useitpo_health_01" with this:

func void useitpo_health_01()
{
HP01();
};

You can adapt it to mana potions too, or even rejuvenation potions (combine the two scripts)
I don't want credit ofc, just have fun with it! :)
 

Bogdan Zwei

Bogdan Zwei

Użytkownicy
Wulgarny skurwiel pierdolony.
posty1864
Propsy541
Profesjabrak
  • Użytkownicy
  • Wulgarny skurwiel pierdolony.
You can also do it in a better way!

Healing 28% Health:
func void HP01()
{
if(hero.attribute[ATR_HITPOINTS_MAX] < 150)
{
Npc_ChangeAttribute(self,ATR_HITPOINTS,50);
}
else if(hero.attribute[ATR_HITPOINTS_MAX] >= 150)
{
var int CURHP;
CURHP = hero.attribute[ATR_HITPOINTS_MAX]*28;
Npc_Changeattribute(self,atr_hitpoints,curhp/100);
};
};

Healing 39% Health:
func void HP01()
{
if(hero.attribute[ATR_HITPOINTS_MAX] < 150)
{
Npc_ChangeAttribute(self,ATR_HITPOINTS,50);
}
else if(hero.attribute[ATR_HITPOINTS_MAX] >= 150)
{
var int CURHP;
CURHP = hero.attribute[ATR_HITPOINTS_MAX]*39;
Npc_Changeattribute(self,atr_hitpoints,curhp/100);
};
};

Healing 69% Health:
func void HP01()
{
if(hero.attribute[ATR_HITPOINTS_MAX] < 150)
{
Npc_ChangeAttribute(self,ATR_HITPOINTS,50);
}
else if(hero.attribute[ATR_HITPOINTS_MAX] >= 150)
{
var int CURHP;
CURHP = hero.attribute[ATR_HITPOINTS_MAX]*69;
Npc_Changeattribute(self,atr_hitpoints,curhp/100);
};
};
 
:ok: zachęca do dalszej pomocy. Nie zapominaj o tym!

Prywatne wiadomości typu "Ej, pomocy" kasuję od razu. Od tego jest forum, a nie PW.

To me, defeat in anything is merely temporary, and its punishment is but an urge for me to greater effort to achieve my goal. Defeat simply tells me that something is wrong in my doing; it is a path leading to success and truth.

In order to realize our true self we must be willing to live without being dependent upon the opinion of others.

Siemekk

Siemekk

Złote Wrota
posty2143
Propsy1154
ProfesjaProgramista
  • Złote Wrota
In BSM you have this function :F
Func Void HP_PROC (var int procenty){

if (Npc_IsPlayer(self)){

var int HP_PROC; HP_PROC = ((hero.attribute[ATR_HITPOINTS_MAX]*procenty)/100);

if (HP_PROC > 1){

hero.attribute[ATR_HITPOINTS] = hero.attribute[ATR_HITPOINTS] + HP_PROC;

}else{

hero.attribute[ATR_HITPOINTS] = hero.attribute[ATR_HITPOINTS] + 1;

};

if (hero.attribute[ATR_HITPOINTS] > hero.attribute[ATR_HITPOINTS_MAX]){
hero.attribute[ATR_HITPOINTS] = hero.attribute[ATR_HITPOINTS_MAX];
};

}else{

Npc_ChangeAttribute (self, ATR_HITPOINTS, procenty);

};

};

Example:
func void useitpo_health_01()
{
HP_PROC (30);
};
:D
 

P.S A Splash w szafie i nie ma psychy by mi dać bana.

G2Master

G2Master

Użytkownicy
posty22
Propsy1
ProfesjaSkrypter
  • Użytkownicy
Sory za odkopywanie tego tematu ale zauważyłem jeden błąd. Mianowicie jak chcemy dać taką miksturę towarzyszowi to i tak leczy mu życie w punktach a nie w procentach, można coś z tym zrobić?
 

Splash

Splash

Moderator
posty4209
Propsy3412
ProfesjaNierób
  • Moderator
Wywalić warunek sprawdzając czy postać używająca mikstury to gracz i zmienić instancję hero na self
 
Nie zajmuję się multiplayerami do Gothica. Przestańcie zawracać mi tym głowę...
Ps. Siemekk ma downa i śpi w pufie

G2Master

G2Master

Użytkownicy
posty22
Propsy1
ProfesjaSkrypter
  • Użytkownicy
Wywalić warunek sprawdzając czy postać używająca mikstury to gracz i zmienić instancję hero na self

Dzięki, teraz działa jak należy.
Masz jeszcze propsa za pomoc :-)
 


0 użytkowników i 1 Gość przegląda ten wątek.
0 użytkowników
Do góry