Jump to content
Infarkt

Бонус карт

Recommended Posts

Подскажите пожалуйста как сделать что-бы работало только определенное количество карт в одной вещи ?

Допустим если вставить 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; },{},{}

Link to comment
Share on other sites

Я конечно не проверял, но попробуй... должно работать

// callfunc "GetCardCount",<CARD_ID>;

// Пример, если у игрока в каком либо предмете вставлены 3 карты Танатоса

// и мы хотим ограничиться 2-мя картами, то пишем.

// callfunc "GetCardCount",4399;

// 4399,(...),{ if(callfunc("GetCardCount",4399) < 3) { тут код } },{},{}

function script GetCardCount {

getinventorylist;

for(set [email protected],0; [email protected] < getarraysize(@inventorylist_id); set [email protected],[email protected]+1){
if(@inventorylist_card1[[email protected]] == getarg(0)) set [email protected],[email protected]+1;
else if(@inventorylist_card2[[email protected]] == getarg(0)) set [email protected],[email protected]+1;
else if(@inventorylist_card3[[email protected]] == getarg(0)) set [email protected],[email protected]+1;
else if(@inventorylist_card4[[email protected]] == getarg(0)) set [email protected],[email protected]+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 [email protected];
}

Edited by Lilith
Link to comment
Share on other sites

В скрипте вещи, первые скобки.

THAN заменить на Айди Танатос Карты к примеру.

  • if (isequipped(THAN)) { bonus bInt,0; }
  • if (isequipped(THAN) ==2) { bonus bInt,-25; }

и т.д.

Edited by Oxxy
Link to comment
Share on other sites

[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 [email protected],0; [email protected] < getarraysize(@inventorylist_id); set [email protected],[email protected]+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[[email protected]] == getarg(0)) set [email protected],[email protected]+1;

9 : else if(@inventorylist_card2[[email protected]] == getarg(0)) set [email protected],[email protected]+1;

10 : else if(@inventorylist_card3[[email protected]] == getarg(0)) set [email protected],[email protected]+1;

11 : else if(@inventorylist_card4[[email protected]] == getarg(0)) set [email protected],[email protected]+1;

12 : }

function script GetCardCount {

getinventorylist;

for(set [email protected],0; [email protected] < getarraysize(@inventorylist_id); set [email protected],[email protected]+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[[email protected]] == getarg(0)) set [email protected],[email protected]+1;
else if(@inventorylist_card2[[email protected]] == getarg(0)) set [email protected],[email protected]+1;
else if(@inventorylist_card3[[email protected]] == getarg(0)) set [email protected],[email protected]+1;
else if(@inventorylist_card4[[email protected]] == getarg(0)) set [email protected],[email protected]+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 [email protected];
}

Link to comment
Share on other sites

Забудь мой скрипт.

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 и более, то никакой эффект не проявляется...

Вероятно тут нужна модификация исходников.

  • Upvote 3
Link to comment
Share on other sites

Infarkt, читай внимательнее, я написал в код ВЕЩИ, а не в скрипт.

Link to comment
Share on other sites

Проверил на поринге - работает.

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;} },{},{}

Хорошая смекалка ;)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.