Nie czyta warunku, dziwny problem 3252 2

O temacie

Autor Lobos

Zaczęty 26.01.2019 roku

Wyświetleń 3252

Odpowiedzi 2

Lobos

Lobos

Użytkownicy
posty594
Propsy360
Profesjabrak
  • Użytkownicy
Nie mogę się uporać z jednym skryptem.
Skrypt ma za zadanie pobierać złoto za naukę walki bronią.
Za naukę walki bronią jednoręczną pobiera złoto a za dwuręczną już nie. Cały problem polega na tym że oba skrypty 1H i 2H są identyczne. Po prostu je skopiowałem i w miejsce 1H dodałem 2H. Ale ten 2H nie działa. Ktoś ma pomysł dlaczego ?

Nie działa dokładnie ten warunek
var int realAttribute;
realAttribute = other.attribute[NPC_TALENT_2H];
if((realAttribute + 1) <= 75)
{
Npc_RemoveInvItems (other, itmi_gold,10);
};

A tu cały skrypt

// *************************************************
// TRAIN
// *************************************************
INSTANCE DIA_Franco_Teach(C_INFO)
{
npc = SLD_3225_Franco;
nr = 7;
condition = DIA_Franco_Teach_Condition;
information = DIA_Franco_Teach_Info;
permanent = TRUE;
description = "Zacznijmy trening.";
};                       

FUNC INT DIA_Franco_Teach_Condition()
{
//if (Wulfgar_Teach1H == TRUE)

//{
return TRUE;
//};
};
 
FUNC VOID DIA_Franco_Teach_Info()
{
AI_Output (other,self ,"DIA_Franco_Teach_15_00"); //Zacznijmy trening.

Info_ClearChoices (DIA_Franco_Teach);
Info_AddChoice (DIA_Franco_Teach, DIALOG_BACK ,DIA_Franco_Teach_Back);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn2h1 , B_GetLearnCostTalent(other, NPC_TALENT_2H, 1)) ,DIA_Franco_Teach_2H_1);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn2h5 , B_GetLearnCostTalent(other, NPC_TALENT_2H, 5)) ,DIA_Franco_Teach_2H_5);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn1h1 , B_GetLearnCostTalent(other, NPC_TALENT_1H, 1)) ,DIA_Franco_Teach_1H_1);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn1h5 , B_GetLearnCostTalent(other, NPC_TALENT_1H, 5)) ,DIA_Franco_Teach_1H_5);

};

FUNC VOID DIA_Franco_Teach_Back ()
{
Info_ClearChoices (DIA_Franco_Teach);
};


FUNC VOID DIA_Franco_Teach_1H_1 ()
{
if (Npc_HasItems (other, itmi_gold) >=10)
&& (hero.lp >= 1)
{
var int realAttribute;
realAttribute = other.attribute[NPC_TALENT_1H];
if((realAttribute + 1) <= 75)
{
Npc_RemoveInvItems (other, itmi_gold,10);
};
B_TeachFightTalentPercent (self, other, NPC_TALENT_1H, 1, 75);

Info_ClearChoices (DIA_Franco_Teach);
Info_AddChoice (DIA_Franco_Teach, DIALOG_BACK ,DIA_Franco_Teach_Back);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn2h1 , B_GetLearnCostTalent(other, NPC_TALENT_2H, 1)) ,DIA_Franco_Teach_2H_1);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn2h5 , B_GetLearnCostTalent(other, NPC_TALENT_2H, 5)) ,DIA_Franco_Teach_2H_5);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn1h1 , B_GetLearnCostTalent(other, NPC_TALENT_1H, 1)) ,DIA_Franco_Teach_1H_1);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn1h5 , B_GetLearnCostTalent(other, NPC_TALENT_1H, 5)) ,DIA_Franco_Teach_1H_5);
}
else
{
if (hero.lp == 0)
{
AI_Output (self, other ,"DIA_Franco_Teach_1H_1_15_00"); //Wróć gdy nabierzesz więcej doświadczenia
Info_ClearChoices (DIA_Franco_Teach);
}
else if (Npc_HasItems (other, Itmi_gold) <= 10)
{
AI_PrintScreen ("Brak złota !", -1, 30, FONT_ScreenSmall, 2);
Info_ClearChoices (DIA_Franco_Teach);
};
};

};
FUNC VOID DIA_Franco_Teach_1H_5 ()
{
if (Npc_HasItems (other, itmi_gold) >=50)
&& (hero.lp >= 5)
{
var int realAttribute;
realAttribute = other.attribute[NPC_TALENT_1H];
if((realAttribute + 5) <= 75)
{

Npc_RemoveInvItems (other, itmi_gold,50);
};

B_TeachFightTalentPercent (self, other, NPC_TALENT_1H, 5, 75);

Info_ClearChoices (DIA_Franco_Teach);
Info_AddChoice (DIA_Franco_Teach, DIALOG_BACK ,DIA_Franco_Teach_Back);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn2h1 , B_GetLearnCostTalent(other, NPC_TALENT_2H, 1)) ,DIA_Franco_Teach_2H_1);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn2h5 , B_GetLearnCostTalent(other, NPC_TALENT_2H, 5)) ,DIA_Franco_Teach_2H_5);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn1h1 , B_GetLearnCostTalent(other, NPC_TALENT_1H, 1)) ,DIA_Franco_Teach_1H_1);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn1h5 , B_GetLearnCostTalent(other, NPC_TALENT_1H, 5)) ,DIA_Franco_Teach_1H_5);
}
else
{
if (hero.lp <= 4)
{
AI_Output (self, other ,"DIA_Franco_Teach_1H_5_15_00"); //Wróć gdy nabierzesz więcej doświadczenia
Info_ClearChoices (DIA_Franco_Teach);
}
else if (Npc_HasItems (other, Itmi_gold) <= 49)
{
AI_PrintScreen ("Brak złota !", -1, 30, FONT_ScreenSmall, 2);
Info_ClearChoices (DIA_Franco_Teach);
};
};
};

FUNC VOID DIA_Franco_Teach_2H_1 ()
{
if (Npc_HasItems (other, itmi_gold) >=10)
&& (hero.lp >= 1)
{
var int realAttribute;
realAttribute = other.attribute[NPC_TALENT_2H];
if((realAttribute + 1) <= 75)
{
Npc_RemoveInvItems (other, itmi_gold,10);
};
B_TeachFightTalentPercent (self, other, NPC_TALENT_2H, 1, 75);

Info_ClearChoices (DIA_Franco_Teach);
Info_AddChoice (DIA_Franco_Teach, DIALOG_BACK ,DIA_Franco_Teach_Back);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn2h1 , B_GetLearnCostTalent(other, NPC_TALENT_2H, 1)) ,DIA_Franco_Teach_2H_1);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn2h5 , B_GetLearnCostTalent(other, NPC_TALENT_2H, 5)) ,DIA_Franco_Teach_2H_5);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn1h1 , B_GetLearnCostTalent(other, NPC_TALENT_1H, 1)) ,DIA_Franco_Teach_1H_1);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn1h5 , B_GetLearnCostTalent(other, NPC_TALENT_1H, 5)) ,DIA_Franco_Teach_1H_5);
}
else
{
if (hero.lp == 0)
{
AI_Output (self, other ,"DIA_Franco_Teach_2H_1_15_00"); //Wróć gdy nabierzesz więcej doświadczenia
Info_ClearChoices (DIA_Franco_Teach);
}
else if (Npc_HasItems (other, Itmi_gold) <= 10)
{
AI_PrintScreen ("Brak złota !", -1, 30, FONT_ScreenSmall, 2);
Info_ClearChoices (DIA_Franco_Teach);
};
};

};
FUNC VOID DIA_Franco_Teach_2H_5 ()
{
if (Npc_HasItems (other, itmi_gold) >=50)
&& (hero.lp >= 5)
{
var int realAttribute;
realAttribute = other.attribute[NPC_TALENT_2H];
if((realAttribute + 5) <= 75)
{

Npc_RemoveInvItems (other, itmi_gold,50);
};

B_TeachFightTalentPercent (self, other, NPC_TALENT_2H, 5, 75);

Info_ClearChoices (DIA_Franco_Teach);
Info_AddChoice (DIA_Franco_Teach, DIALOG_BACK ,DIA_Franco_Teach_Back);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn2h1 , B_GetLearnCostTalent(other, NPC_TALENT_2H, 1)) ,DIA_Franco_Teach_2H_1);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn2h5 , B_GetLearnCostTalent(other, NPC_TALENT_2H, 5)) ,DIA_Franco_Teach_2H_5);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn1h1 , B_GetLearnCostTalent(other, NPC_TALENT_1H, 1)) ,DIA_Franco_Teach_1H_1);
Info_AddChoice (DIA_Franco_Teach, B_BuildLearnString(PRINT_Learn1h5 , B_GetLearnCostTalent(other, NPC_TALENT_1H, 5)) ,DIA_Franco_Teach_1H_5);
}
else
{
if (hero.lp <= 4)
{
AI_Output (self, other ,"DIA_Franco_Teach_2H_5_15_00"); //Wróć gdy nabierzesz więcej doświadczenia
Info_ClearChoices (DIA_Franco_Teach);
}
else if (Npc_HasItems (other, Itmi_gold) <= 49)
{
AI_PrintScreen ("Brak złota !", -1, 30, FONT_ScreenSmall, 2);
Info_ClearChoices (DIA_Franco_Teach);
};
};
};

 

Bogdan Zwei

Bogdan Zwei

Użytkownicy
Wulgarny skurwiel pierdolony.
posty1864
Propsy541
Profesjabrak
  • Użytkownicy
  • Wulgarny skurwiel pierdolony.
Daj realAttribute jako zmienną globalną. Pewnego czasu nie naliczało mi regeneracji HP, bo zmienna była deklarowana i używana dwa razy w dwóch funkcjach dla HP i MP.
 
: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.

Lobos

Lobos

Użytkownicy
posty594
Propsy360
Profesjabrak
  • Użytkownicy
Coś jest ewidentnie z tym znaczkiem
<= Dałem w drugą stronę i nagle zadziałało ale dalej pobiera siano nawet jak już wymaxowaliśmy umiejętność u nauczyciela.

Post połączony: 2019-01-26, 14:18
Rozkminiłem o co chodziło

other.attribute - jest przypisane do atrybutów czyli siły many i zręki dlatego jak miałem 100 siły to gra czytała że wartość jest większa niż 75 i nie pobierało złota.

dałem other.HitChance i teraz śmiga

Można zamknąć
 


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