Używaj tagów code!
INSTANCE ItFo_Apple_01 (C_Item)
{
name = "Magiczne Jabłko";
mainflag = ITEM_KAT_FOOD;
flags = ITEM_MULTI;
value = 500;
visual = "ItFo_Apple.3DS";
material = MAT_LEATHER;
scemeName = "FOOD";
on_state[0] = Use_Apple_SaJwO;
description = name;
TEXT[1] = NAME_Bonus_HP;
COUNT[1] = 12;
TEXT[5] = NAME_Value;
COUNT[5] = 500;
};
FUNC VOID Use_Apple_SaJwO()
{
Npc_ChangeAttribute (self, ATR_HITPOINTS, 12);
const int Apple_SaJwO_Bonus = 0;
if (Npc_IsPlayer (self))
{
Apple_SaJwO_Bonus = Apple_SaJwO_Bonus + 1;
if (Apple_SaJwO_Bonus == 1)
{
PrintScreen ("Twoja siła wzrasta", 55, -1, FONT_Screen, 2);
B_RaiseAttribute (self, ATR_STRENGTH,3);
Snd_Play ("LevelUp");
};
if (Apple_SaJwO_Bonus == 1)
{
PrintScreen ("Twoja siła wzrasta", 55, -1, FONT_Screen, 2);
B_RaiseAttribute (self, ATR_DEXTERITY,3);
Snd_Play ("LevelUp");
};
if (Apple_SaJwO_Bonus == 1)
{
PrintScreen ("Twoja siła wzrasta", 55, -1, FONT_Screen, 2);
B_RaiseAttribute (self, ATR_MANA_MAX,3);
Snd_Play ("LevelUp");
};
if (Apple_SaJwO_Bonus == 1)
{
PrintScreen ("Twoja siła wzrasta", 55, -1, FONT_Screen, 2);
B_RaiseAttribute (self, ATR_HITPOINTS_MAX,3);
Snd_Play ("LevelUp");
};
};
};
Dosyć to zawiłe, dlaczego ten kawałek:
if (Apple_SaJwO_Bonus == 1)
{
PrintScreen ("Twoja siła wzrasta", 55, -1, FONT_Screen, 2);
B_RaiseAttribute (self, ATR_DEXTERITY,3);
Snd_Play ("LevelUp");
};
Pojawia się tam cztery razy?
const int Apple_SaJwO_Bonus = 0;
if (Npc_IsPlayer (self))
{
Apple_SaJwO_Bonus = Apple_SaJwO_Bonus + 1;
Dwie rady:
1. Używaj operatora ++ ;]
2. Stałej nie zmienisz... spróbuj usunąć const przed deklaracją zmiennej (teraz stałej...) i sprawdź.
Ahh... Dekster, ubiegłeś mnie.
Jeszcze się spotkamy... xD