Infarkt Posted January 29, 2012 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 17 Reputation: 1 Joined: 01/13/12 Last Seen: March 15, 2012 Share Posted January 29, 2012 Подскажите пожалуйста как сделать что-бы работало только определенное количество карт в одной вещи ? Допустим если вставить 3 танатос карты в одно оружие, то работать будут только 2 ? Напримере данной карты: 4399,Thanatos_Card,Memory of Thanatos Card,6,20,,10,,,,,,,,2,,,,,{ bonus bMaxHPrate,5; bonus bMatkRate,10; bonus bAtkRate,10; bonus bDef,-15; bonus bFlee,-15; },{},{} Quote Link to comment Share on other sites More sharing options...
Lilith Posted January 29, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 407 Reputation: 159 Joined: 11/18/11 Last Seen: November 15, 2014 Share Posted January 29, 2012 (edited) Я конечно не проверял, но попробуй... должно работать // callfunc "GetCardCount",<CARD_ID>; // Пример, если у игрока в каком либо предмете вставлены 3 карты Танатоса // и мы хотим ограничиться 2-мя картами, то пишем. // callfunc "GetCardCount",4399; // 4399,(...),{ if(callfunc("GetCardCount",4399) < 3) { тут код } },{},{} function script GetCardCount { getinventorylist; for(set .@a,0; .@a < getarraysize(@inventorylist_id); set .@a,.@a+1){ if(@inventorylist_card1[.@a] == getarg(0)) set .@b,.@b+1; else if(@inventorylist_card2[.@a] == getarg(0)) set .@b,.@b+1; else if(@inventorylist_card3[.@a] == getarg(0)) set .@b,.@b+1; else if(@inventorylist_card4[.@a] == getarg(0)) set .@b,.@b+1; } deletearray @inventorylist_id[0],getarraysize(@inventorylist_id); deletearray @inventorylist_amount[0],getarraysize(@inventorylist_amount); deletearray @inventorylist_equip[0],getarraysize(@inventorylist_equip); deletearray @inventorylist_refine[0],getarraysize(@inventorylist_refine); deletearray @inventorylist_identify[0],getarraysize(@inventorylist_identify); deletearray @inventorylist_attribute[0],getarraysize(@inventorylist_attribute); deletearray @inventorylist_card1[0],getarraysize(@inventorylist_card1); deletearray @inventorylist_card2[0],getarraysize(@inventorylist_card2); deletearray @inventorylist_card3[0],getarraysize(@inventorylist_card3); deletearray @inventorylist_card4[0],getarraysize(@inventorylist_card4); deletearray @inventorylist_expire[0],getarraysize(@inventorylist_expire); return .@b; } Edited January 29, 2012 by Lilith Quote Link to comment Share on other sites More sharing options...
Infarkt Posted January 29, 2012 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 17 Reputation: 1 Joined: 01/13/12 Last Seen: March 15, 2012 Author Share Posted January 29, 2012 Нет, работает больше 2-х карт. Quote Link to comment Share on other sites More sharing options...
Oxxy Posted January 30, 2012 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 106 Reputation: 3 Joined: 01/01/12 Last Seen: March 29, 2023 Share Posted January 30, 2012 (edited) В скрипте вещи, первые скобки. THAN заменить на Айди Танатос Карты к примеру. if (isequipped(THAN)) { bonus bInt,0; } if (isequipped(THAN) ==2) { bonus bInt,-25; } и т.д. Edited January 31, 2012 by Oxxy Quote Link to comment Share on other sites More sharing options...
Infarkt Posted January 31, 2012 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 17 Reputation: 1 Joined: 01/13/12 Last Seen: March 15, 2012 Author Share Posted January 31, 2012 [Error]: Loading NPC file: npc/flower/GetCardCount.txt script error on npc/flower/GetCardCount.txt line 7 parse_simpleexpr: unmatch ')' 2 : 3 : getinventorylist; 4 : 5 : for(set .@a,0; .@a < getarraysize(@inventorylist_id); set .@a,.@a+1){ 6 : if (isequipped(4399)) { bonus bAllStats,5; bonus bMaxHPrate,5; bonus bM atkRate,10; bonus bAtkRate,10; bonus bDef,-15; bonus bFlee,-15; }; * 7 : if(iseequipped'('4399) ==2) { bonus bAllStats,-5; bonus bMaxHPrate,-5; bonus bMatkRate,-10; bonus bAtkRate,-10; bonus bDef,-15; bonus bFlee,-15; }; 8 : if(@inventorylist_card1[.@a] == getarg(0)) set .@b,.@b+1; 9 : else if(@inventorylist_card2[.@a] == getarg(0)) set .@b,.@b+1; 10 : else if(@inventorylist_card3[.@a] == getarg(0)) set .@b,.@b+1; 11 : else if(@inventorylist_card4[.@a] == getarg(0)) set .@b,.@b+1; 12 : } function script GetCardCount { getinventorylist; for(set .@a,0; .@a < getarraysize(@inventorylist_id); set .@a,.@a+1){ if (isequipped(4399)) { bonus bAllStats,5; bonus bMaxHPrate,5; bonus bMatkRate,10; bonus bAtkRate,10; bonus bDef,-15; bonus bFlee,-15; }; if (iseequipped(4399) ==2) { bonus bAllStats,-5; bonus bMaxHPrate,-5; bonus bMatkRate,-10; bonus bAtkRate,-10; bonus bDef,-15; bonus bFlee,-15; }; if(@inventorylist_card1[.@a] == getarg(0)) set .@b,.@b+1; else if(@inventorylist_card2[.@a] == getarg(0)) set .@b,.@b+1; else if(@inventorylist_card3[.@a] == getarg(0)) set .@b,.@b+1; else if(@inventorylist_card4[.@a] == getarg(0)) set .@b,.@b+1; } deletearray @inventorylist_id[0],getarraysize(@inventorylist_id); deletearray @inventorylist_amount[0],getarraysize(@inventorylist_amount); deletearray @inventorylist_equip[0],getarraysize(@inventorylist_equip); deletearray @inventorylist_refine[0],getarraysize(@inventorylist_refine); deletearray @inventorylist_identify[0],getarraysize(@inventorylist_identify); deletearray @inventorylist_attribute[0],getarraysize(@inventorylist_attribute); deletearray @inventorylist_card1[0],getarraysize(@inventorylist_card1); deletearray @inventorylist_card2[0],getarraysize(@inventorylist_card2); deletearray @inventorylist_card3[0],getarraysize(@inventorylist_card3); deletearray @inventorylist_card4[0],getarraysize(@inventorylist_card4); deletearray @inventorylist_expire[0],getarraysize(@inventorylist_expire); return .@b; } Quote Link to comment Share on other sites More sharing options...
Lilith Posted January 31, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 407 Reputation: 159 Joined: 11/18/11 Last Seen: November 15, 2014 Share Posted January 31, 2012 Забудь мой скрипт. 4399,Thanatos_Card,Memory of Thanatos Card,6,20,,10,,,,,,,,2,,,,,{ if(isequippedcnt(4399) < 3) { bonus bMaxHPrate,5; bonus bMatkRate,10; bonus bAtkRate,10; bonus bDef,-15; bonus bFlee,-15; } },{},{} НО в таком случае если карты 3 и более, то никакой эффект не проявляется... Вероятно тут нужна модификация исходников. 3 Quote Link to comment Share on other sites More sharing options...
Infarkt Posted January 31, 2012 Group: Members Topic Count: 5 Topics Per Day: 0.00 Content Count: 17 Reputation: 1 Joined: 01/13/12 Last Seen: March 15, 2012 Author Share Posted January 31, 2012 Спасибо, пусть будет хоть так. Quote Link to comment Share on other sites More sharing options...
Oxxy Posted January 31, 2012 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 106 Reputation: 3 Joined: 01/01/12 Last Seen: March 29, 2023 Share Posted January 31, 2012 Infarkt, читай внимательнее, я написал в код ВЕЩИ, а не в скрипт. Quote Link to comment Share on other sites More sharing options...
Evil Posted July 9, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 25 Reputation: 2 Joined: 12/25/11 Last Seen: February 19, 2014 Share Posted July 9, 2012 (edited) Мое решение: http://rus-ea.ru/for...posts&p=165#165 Сейчас не могу опробовать, но хотел бы узнать, верно или нет Edited July 9, 2012 by Evil 1 Quote Link to comment Share on other sites More sharing options...
Lilith Posted July 9, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 407 Reputation: 159 Joined: 11/18/11 Last Seen: November 15, 2014 Share Posted July 9, 2012 Проверил на поринге - работает. 4001,Poring_Card,Poring Card,6,20,,10,,,,,,,,16,,,,,{ d+=1; if( d < 2) { bonus bLuk,2; bonus bFlee2,1; } if (isequippedcnt(4001) == d ) {d = 0;} },{},{} Хорошая смекалка Quote Link to comment Share on other sites More sharing options...
Evil Posted July 10, 2012 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 25 Reputation: 2 Joined: 12/25/11 Last Seen: February 19, 2014 Share Posted July 10, 2012 Спасибо. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.