Hello! This script makes potions work like Diablo2. If you have less than the potion restoration value*3 it restores the normal amount (like, a healing potion heals for 50 hp if you have less than 150 max hp), otherwise it restores a certain % of your total HP in 5 seconds, over time.
func void lowmana()
{
var int manunterzo; manunterzo = hero.attribute[ATR_MANA_MAX]/3;
Npc_ChangeAttribute(hero,ATR_MANA,manunterzo/25);
};
func void useitpo_mana_01_advanced()
{
if(Npc_IsPlayer(self))
{
if(hero.attribute[ATR_MANA_MAX] <= 90)
{
Npc_ChangeAttribute(self,ATR_MANA,MANA_ESSENZ);
}
else if (hero.attribute[ATR_MANA_MAX] > 90 && !FF_ACTIVE(LowMana))
{
FF_ApplyOnceExt(LowMana,200,25);
};
}
else if(!Npc_IsPlayer(self))
{
Npc_ChangeAttribute(self,ATR_MANA,1500);
};
};
func void medmana()
{
var int manunmezzo; manunmezzo = hero.attribute[ATR_MANA_MAX]/2;
Npc_ChangeAttribute(hero,ATR_MANA,manunmezzo/25);
};
func void useitpo_mana_02_advanced()
{
if(Npc_IsPlayer(self))
{
if(hero.attribute[ATR_MANA_MAX] <= 140)
{
Npc_ChangeAttribute(self,ATR_MANA,70);
}
else if (hero.attribute[ATR_MANA_MAX] > 140 && !FF_ACTIVE(MedMana))
{
FF_ApplyOnceExt(MedMana,200,25);
};
}
else if(!Npc_IsPlayer(self))
{
Npc_ChangeAttribute(self,ATR_MANA,1500);
};
};
func void Higmana()
{
var int manun; manun = hero.attribute[ATR_MANA_MAX];
Npc_ChangeAttribute(hero,ATR_MANA,manun/25);
};
func void useitpo_mana_03_advanced()
{
if(Npc_IsPlayer(self))
{
if(!FF_ACTIVE(HigMana))
{
FF_ApplyOnceExt(HigMana,200,25);
};
}
else if(!Npc_IsPlayer(self))
{
Npc_ChangeAttribute(self,ATR_MANA,1500);
};
};
instance ITPO_MANA_01(C_ITEM)
{
name = NAME_TRANK;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = VALUE_MANAESSENZ;
visual = "ITFO_POTION_MANA_01.3ds";
material = MAT_GLAS;
on_state[0] = useitpo_mana_01_advanced;
scemename = "POTIONFAST";
wear = WEAR_EFFECT;
////effect = "SPELLFX_MANAPOTION";
description = "Mana Essence";
text[1] = "Partially restores your mana";
text[2] = "Duration (seconds):";
count[2] = 5;
text[5] = NAME_VALUE;
count[5] = VALUE_MANAESSENZ;
};
instance ITPO_MANA_02(C_ITEM)
{
name = NAME_TRANK;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = VALUE_MANAEXTRAKT;
visual = "ITFO_POTION_MANA_02.3ds";
material = MAT_GLAS;
on_state[0] = useitpo_mana_02_advanced;
scemename = "POTIONFAST";
wear = WEAR_EFFECT;
////effect = "SPELLFX_MANAPOTION";
description = "Mana Extract";
text[1] = "Partially restores your mana";
text[2] = "Duration (seconds):";
count[2] = 5;
text[5] = NAME_VALUE;
count[5] = VALUE_MANAEXTRAKT;
};
instance ITPO_MANA_03(C_ITEM)
{
name = NAME_TRANK;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = VALUE_MANAELIXIER;
visual = "ITFO_POTION_MANA_03.3ds";
material = MAT_GLAS;
on_state[0] = useitpo_mana_03_advanced;
scemename = "POTIONFAST";
wear = WEAR_EFFECT;
//effect = "SPELLFX_MANAPOTION";
description = "Mana Elixir";
text[1] = "Completely restores your mana";
text[2] = "Duration (seconds):";
count[2] = 5;
text[5] = NAME_VALUE;
count[5] = VALUE_MANAELIXIER;
};
func void lowaccapi()
{
var int lifeunterzo; lifeunterzo = hero.attribute[ATR_HITPOINTS_MAX]/3;
Npc_ChangeAttribute(hero,ATR_HITPOINTS,lifeunterzo/25);
};
func void useitpo_health_01_advanced()
{
if(Npc_IsPlayer(self))
{
if(hero.attribute[ATR_HITPOINTS_MAX] <= 150)
{
Npc_ChangeAttribute(self,ATR_HITPOINTS,50);
}
else if (hero.attribute[ATR_HITPOINTS_MAX] > 150 && !FF_ACTIVE(Lowaccapi))
{
FF_ApplyOnceExt(Lowaccapi,200,25);
};
}
else if(!Npc_IsPlayer(self))
{
Npc_ChangeAttribute(self,ATR_HITPOINTS,50);
};
};
func void medaccapi()
{
var int lifeunmezzo; lifeunmezzo = hero.attribute[ATR_HITPOINTS_MAX]/2;
Npc_ChangeAttribute(hero,ATR_HITPOINTS,lifeunmezzo/25);
};
func void useitpo_health_02_advanced()
{
if(Npc_IsPlayer(self))
{
if(hero.attribute[ATR_HITPOINTS_MAX] <= 210)
{
Npc_ChangeAttribute(self,ATR_HITPOINTS,70);
}
else if (hero.attribute[ATR_HITPOINTS_MAX] > 210 && !FF_ACTIVE(medaccapi))
{
FF_ApplyOnceExt(medaccapi,200,25);
};
}
else if(!Npc_IsPlayer(self))
{
Npc_ChangeAttribute(self,ATR_HITPOINTS,70);
};
};
func void hiaccapi()
{
var int gharbl; gharbl = hero.attribute[ATR_HITPOINTS_MAX];
Npc_ChangeAttribute(hero,ATR_HITPOINTS,gharbl/25);
};
func void useitpo_health_03_advanced()
{
if(Npc_IsPlayer(self))
{
if(hero.attribute[ATR_HITPOINTS_MAX] <= 250)
{
Npc_ChangeAttribute(self,ATR_HITPOINTS, 120);
}
else if (hero.attribute[ATR_HITPOINTS_MAX] > 250 && !FF_ACTIVE(hiaccapi))
{
FF_ApplyOnceExt(hiaccapi,200,25);
};
}
else if(!Npc_IsPlayer(self))
{
Npc_ChangeAttribute(self,ATR_HITPOINTS,120);
};
};
instance ITPO_HEALTH_01(C_ITEM)
{
name = NAME_TRANK;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = VALUE_HPESSENZ;
visual = "ITFO_POTION_HEALTH_01.3ds";
material = MAT_GLAS;
on_state[0] = useitpo_health_01_advanced;
scemename = "POTIONFAST";
wear = WEAR_EFFECT;
//effect = "SPELLFX_HEALTHPOTION";
description = "Essence of Healing";
text[1] = "Partially restores your life";
text[2] = "Duration (seconds):";
count[2] = 5;
text[5] = NAME_VALUE;
count[5] = VALUE_HPESSENZ;
};
instance ITPO_HEALTH_02(C_ITEM)
{
name = NAME_TRANK;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = VALUE_HPEXTRAKT;
visual = "ITFO_POTION_HEALTH_02.3ds";
material = MAT_GLAS;
on_state[0] = useitpo_health_02_advanced;
scemename = "POTIONFAST";
wear = WEAR_EFFECT;
//effect = "SPELLFX_HEALTHPOTION";
description = "Extract of Healing";
text[1] = "Partially restores your life";
text[2] = "Duration (seconds):";
count[2] = 5;
text[5] = NAME_VALUE;
count[5] = VALUE_HPEXTRAKT;
};
instance ITPO_HEALTH_03(C_ITEM)
{
name = NAME_TRANK;
mainflag = ITEM_KAT_POTIONS;
flags = ITEM_MULTI;
value = VALUE_HPELIXIER;
visual = "ITFO_POTION_HEALTH_03.3ds";
material = MAT_GLAS;
on_state[0] = useitpo_health_03_advanced;
scemename = "POTIONFAST";
wear = WEAR_EFFECT;
//effect = "SPELLFX_HEALTHPOTION";
description = "Elixir of Healing";
text[1] = "Completely restores your life";
text[2] = "Duration (seconds):";
count[2] = 5;
text[5] = NAME_VALUE;
count[5] = VALUE_HPELIXIER;
};
Healing/Mana Essences restore 50 points if hp/mana is less than 150, or restore 1/3 of total hp/mana if above said value.
Healing/Mana Extracts restore 70 points if hp/mana is less than 210, or restore 1/2 of total hp/mana if above said value.
Healing/Mana Elixirs restore 120 points if hp/mana is less than 250, or fully restore hp/mana if above said value
Enjoy!