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);
};
};
};