- Регистрация
- 27 Дек 2019
- Сообщения
- 1.643
- Реакции
- 1.680
- Баллы
- 261
- Лучшие ответы
- 78
@zauronix, а какой смысл гараду ржавое отдавать за заготовки если мы сами можем ржавье переплавить в заготовки?
Вот старая черновая версия. Активируется в диалоге когда бревно пилишь.
Сейчас вижу что с условиями накосячил. Оружие орков переплавится без навыка.
Да и не дело - через бревно оружие плавить.
Код:
instance PC_SMELTALL(C_INFO)
{
NPC = PC_Hero;
NR = 12;
CONDITION = PC_SMELTALL_CONDITION;
INFORMATION = PC_SMELTALL_INFO;
PERMANENT = TRUE;
DESCRIPTION = "Переплавить всё ржавое оружие";
};
func int PC_SMELTALL_CONDITION(){
if PLAYER_MOBSI_PRODUCTION == MOBSI_MAKEARROWS{
return (((knowhowtoorefus == true) && ((npc_hasitems(hero,itmw_1h_misc_sword) >= 10) || (npc_hasitems(hero,itmw_2h_sword_m_01) >= 10) || (npc_hasitems(hero,itmw_1h_misc_axe) >= 10))) || ((orcsweaponsteel == true) && ((npc_hasitems(hero,itmw_2h_orcaxe_01) >= 5) || (npc_hasitems(hero,itmw_2h_orcaxe_02) >= 5) || (npc_hasitems(hero,itmw_2h_orcaxe_03) >= 5) || (npc_hasitems(hero,itmw_2h_orcaxe_04) >= 5) || (npc_hasitems(hero,itmw_2h_orcsword_01) >= 5) || (npc_hasitems(hero,itmw_2h_orcsword_02) >= 5) || (npc_hasitems(hero,itmw_2h_orcsword_03) >= 5) || (npc_hasitems(hero,itmw_2h_orcsword_04) >= 5) || (npc_hasitems(hero,itmw_2h_orcmace_01) >= 5) || (npc_hasitems(hero,itmw_2h_orcmace_02) >= 5) || (npc_hasitems(hero,itmw_2h_draconsword_01) >= 5) || (npc_hasitems(hero,itmw_2h_draconsword_02) >= 5))));
};
};
func void PC_SMELTALL_INFO(){
var int count1;
var int count5;
var int count10;
var int counttotal;
var string concattext;
counttotal = 0;
if (npc_hasitems(hero,itmw_1h_misc_sword) >= 10){
count10 = npc_hasitems(hero,itmw_1h_misc_sword);
count1 = count10 / 10;
count10 = count1 * 10;
npc_removeinvitems(hero, itmw_1h_misc_sword, count10);
CREATEINVITEMS(hero, itmi_ironstuck, count1);
counttotal += count1;
};
if (npc_hasitems(hero,itmw_2h_sword_m_01) >= 10){
count10 = npc_hasitems(hero,itmw_2h_sword_m_01);
count1 = count10 / 10;
count10 = count1 * 10;
npc_removeinvitems(hero, itmw_2h_sword_m_01, count10);
CREATEINVITEMS(hero, itmi_ironstuck, count1);
counttotal += count1;
};
if (npc_hasitems(hero,itmw_1h_misc_axe) >= 10){
count10 = npc_hasitems(hero,itmw_1h_misc_axe);
count1 = count10 / 10;
count10 = count1 * 10;
npc_removeinvitems(hero, itmw_1h_misc_axe, count10);
CREATEINVITEMS(hero, itmi_ironstuck, count1);
counttotal += count1;
};
if (npc_hasitems(hero,itmw_2h_orcaxe_01) >= 5){
count5 = npc_hasitems(hero,itmw_2h_orcaxe_01);
count1 = count5 / 5;
count5 = count1 * 5;
npc_removeinvitems(hero, itmw_2h_orcaxe_01, count5);
CREATEINVITEMS(hero, itmi_ironstuck, count1);
counttotal += count1;
};
if (npc_hasitems(hero,itmw_2h_orcaxe_02) >= 5){
count5 = npc_hasitems(hero,itmw_2h_orcaxe_02);
count1 = count5 / 5;
count5 = count1 * 5;
npc_removeinvitems(hero, itmw_2h_orcaxe_02, count5);
CREATEINVITEMS(hero, itmi_ironstuck, count1);
counttotal += count1;
};
if (npc_hasitems(hero,itmw_2h_orcaxe_03) >= 5){
count5 = npc_hasitems(hero,itmw_2h_orcaxe_03);
count1 = count5 / 5;
count5 = count1 * 5;
npc_removeinvitems(hero, itmw_2h_orcaxe_03, count5);
CREATEINVITEMS(hero, itmi_ironstuck, count1);
counttotal += count1;
};
if (npc_hasitems(hero,itmw_2h_orcaxe_04) >= 5){
count5 = npc_hasitems(hero,itmw_2h_orcaxe_04);
count1 = count5 / 5;
count5 = count1 * 5;
npc_removeinvitems(hero, itmw_2h_orcaxe_04, count5);
CREATEINVITEMS(hero, itmi_ironstuck, count1);
counttotal += count1;
};
if (npc_hasitems(hero,itmw_2h_orcsword_01) >= 5){
count5 = npc_hasitems(hero,itmw_2h_orcsword_01);
count1 = count5 / 5;
count5 = count1 * 5;
npc_removeinvitems(hero, itmw_2h_orcsword_01, count5);
CREATEINVITEMS(hero, itmi_ironstuck, count1);
counttotal += count1;
};
if (npc_hasitems(hero,itmw_2h_orcsword_02) >= 5){
count5 = npc_hasitems(hero,itmw_2h_orcsword_02);
count1 = count5 / 5;
count5 = count1 * 5;
npc_removeinvitems(hero, itmw_2h_orcsword_02, count5);
CREATEINVITEMS(hero, itmi_ironstuck, count1);
counttotal += count1;
};
if (npc_hasitems(hero,itmw_2h_orcsword_03) >= 5){
count5 = npc_hasitems(hero,itmw_2h_orcsword_03);
count1 = count5 / 5;
count5 = count1 * 5;
npc_removeinvitems(hero, itmw_2h_orcsword_03, count5);
CREATEINVITEMS(hero, itmi_ironstuck, count1);
counttotal += count1;
};
if (npc_hasitems(hero,itmw_2h_orcsword_04) >= 5){
count5 = npc_hasitems(hero,itmw_2h_orcsword_04);
count1 = count5 / 5;
count5 = count1 * 5;
npc_removeinvitems(hero, itmw_2h_orcsword_04, count5);
CREATEINVITEMS(hero, itmi_ironstuck, count1);
counttotal += count1;
};
if (npc_hasitems(hero,itmw_2h_orcmace_01) >= 5){
count5 = npc_hasitems(hero,itmw_2h_orcmace_01);
count1 = count5 / 5;
count5 = count1 * 5;
npc_removeinvitems(hero, itmw_2h_orcmace_01, count5);
CREATEINVITEMS(hero, itmi_ironstuck, count1);
counttotal += count1;
};
if (npc_hasitems(hero,itmw_2h_orcmace_02) >= 5){
count5 = npc_hasitems(hero,itmw_2h_orcmace_01);
count1 = count5 / 5;
count5 = count1 * 5;
npc_removeinvitems(hero, itmw_2h_orcmace_02, count5);
CREATEINVITEMS(hero, itmi_ironstuck, count1);
counttotal += count1;
};
if (npc_hasitems(hero,itmw_2h_draconsword_01) >= 5){
count5 = npc_hasitems(hero,itmw_2h_draconsword_01);
count1 = count5 / 5;
count5 = count1 * 5;
npc_removeinvitems(hero, itmw_2h_orcaxe_01, count5);
CREATEINVITEMS(hero, itmw_2h_draconsword_01, count1);
counttotal += count1;
};
if (npc_hasitems(hero,itmw_2h_draconsword_02) >= 5){
count5 = npc_hasitems(hero,itmw_2h_draconsword_02);
count1 = count5 / 5;
count5 = count1 * 5;
npc_removeinvitems(hero, itmw_2h_draconsword_02, count5);
CREATEINVITEMS(hero, itmi_ironstuck, count1);
counttotal += count1;
};
concattext = "";
concattext = concatstrings(concattext, "Cлитков отлито: ");
concattext = concatstrings(concattext, inttostring(counttotal));
ai_printiteminfo("Информация", concattext, 2, 1);
};