// TMW2 scripts. // Authors: // Jesusalva // Description: // Arcmage Cards Enhancer 033-1,157,89,0 script Nico Goethe NPC_PLAYER,{ function colorname; function gameinfo; mesn; mesq l("My name is Nico Goethe, an %s card player.", "[@@https://arcmage.org|Arcmage@@]"); next; mesn; mesq l("Would love to invite you to a card minigame... But alas, Kenton told me that minigames are a waste of time, and that I should not bother adventurers with it."); next; mesn; mesq l("However, I am still up for trading cards, if you wish."); mesc l("%s discreetly point out that cards only works well in Moubootaur Legends weapons, but this depends on your origin server.", .name$); next; goto L_Main; L_Main: select l("Trade a card"), l("Evolve a card"), l("Remove a card"), l("Lets play!"), l("Bye."); mes ""; switch (@menu) { // Trade Card case 1: mesn; mesq l("Give me a card and select another card of same class. I charge %d GP for simple exchanges.", 5000); next; if (Zeny < 5000) break; mes "##B" + l("Drag and drop an item from your inventory.") + "##b"; .@card = requestitem(); if (.@card <= 1) break; @menuret = 0; switch (.@card) { case HeroCard: case KnightCard: case ClericCard: case DruidCard: case MageCard: case NinjaCard: case NatureCard: case NecromancerCard: menuint "Sorry, I don't want to trade it.", 0, getitemname(HeroCard), HeroCard, getitemname(KnightCard), KnightCard, getitemname(ClericCard), ClericCard, getitemname(DruidCard), DruidCard, getitemname(MageCard), MageCard, getitemname(NinjaCard), NinjaCard, getitemname(NatureCard), NatureCard, getitemname(NecromancerCard), NecromancerCard; mes ""; break; case SpeedCard: case ReflectCard: case PowerCard: case WallCard: menuint "Sorry, I don't want to trade it.", 0, getitemname(SpeedCard), SpeedCard, getitemname(ReflectCard), ReflectCard, getitemname(PowerCard), PowerCard, getitemname(WallCard), WallCard; mes ""; break; case HeroCardS: case KnightCardS: case ClericCardS: case DruidCardS: case MageCardS: case NinjaCardS: case NatureCardS: case NecromancerCardS: menuint "Sorry, I don't want to trade it.", 0, getitemname(HeroCardS), HeroCardS, getitemname(KnightCardS), KnightCardS, getitemname(ClericCardS), ClericCardS, getitemname(DruidCardS), DruidCardS, getitemname(MageCardS), MageCardS, getitemname(NinjaCardS), NinjaCardS, getitemname(NatureCardS), NatureCardS, getitemname(NecromancerCardS), NecromancerCardS; mes ""; break; case SpeedCardS: case ReflectCardS: case PowerCardS: case WallCardS: menuint "Sorry, I don't want to trade it.", 0, getitemname(SpeedCardS), SpeedCardS, getitemname(ReflectCardS), ReflectCardS, getitemname(PowerCardS), PowerCardS, getitemname(WallCardS), WallCardS; mes ""; break; case HeroCardX: case KnightCardX: case ClericCardX: case DruidCardX: case MageCardX: case NinjaCardX: case NatureCardX: case NecromancerCardX: menuint "Sorry, I don't want to trade it.", 0, getitemname(HeroCardX), HeroCardX, getitemname(KnightCardX), KnightCardX, getitemname(ClericCardX), ClericCardX, getitemname(DruidCardX), DruidCardX, getitemname(MageCardX), MageCardX, getitemname(NinjaCardX), NinjaCardX, getitemname(NatureCardX), NatureCardX, getitemname(NecromancerCardX), NecromancerCardX; mes ""; break; case SpeedCardX: case ReflectCardX: case PowerCardX: case WallCardX: menuint "Sorry, I don't want to trade it.", 0, getitemname(SpeedCardX), SpeedCardX, getitemname(ReflectCardX), ReflectCardX, getitemname(PowerCardX), PowerCardX, getitemname(WallCardX), WallCardX; mes ""; break; default: mesn; mesq l("Sorry, I only deal with Arcmage cards."); break; } if (@menuret < 1) break; Zeny -= 5000; delitem .@card, 1; getitem @menuret, 1; break; // Evolve Card case 2: mesn; mesq l("Give me %s copies of the same card and %s GP, and I'll improve its tier.", b(l("three")), fnum(25000)); mesc l("Normal Cards can be upgraded to S-Tier, and S Cards can be upgraded to X-Tier. X-Tier cards cannot be upgraded."); next; if (Zeny < 25000) break; mes "##B" + l("Drag and drop an item from your inventory.") + "##b"; .@card = requestitem(); if (.@card <= 1) break; if (countitem(.@card) < 3) { mesn; mesq l("You don't have enough cards of this type to upgrade."); next; break; } switch (.@card) { case HeroCard: delitem .@card, 3; Zeny -= 25000; getitem HeroCardS, 1; break; case KnightCard: delitem .@card, 3; Zeny -= 25000; getitem KnightCardS, 1; break; case ClericCard: delitem .@card, 3; Zeny -= 25000; getitem ClericCardS, 1; break; case DruidCard: delitem .@card, 3; Zeny -= 25000; getitem DruidCardS, 1; break; case MageCard: delitem .@card, 3; Zeny -= 25000; getitem MageCardS, 1; break; case NinjaCard: delitem .@card, 3; Zeny -= 25000; getitem NinjaCardS, 1; break; case NatureCard: delitem .@card, 3; Zeny -= 25000; getitem NatureCardS, 1; break; case NecromancerCard: delitem .@card, 3; Zeny -= 25000; getitem NecromancerCardS, 1; break; case SpeedCard: delitem .@card, 3; Zeny -= 25000; getitem SpeedCardS, 1; break; case ReflectCard: delitem .@card, 3; Zeny -= 25000; getitem ReflectCardS, 1; break; case PowerCard: delitem .@card, 3; Zeny -= 25000; getitem PowerCardS, 1; break; case WallCard: delitem .@card, 3; Zeny -= 25000; getitem WallCardS, 1; break; case HeroCardS: delitem .@card, 3; Zeny -= 25000; getitem HeroCardX, 1; break; case KnightCardS: delitem .@card, 3; Zeny -= 25000; getitem KnightCardX, 1; break; case ClericCardS: delitem .@card, 3; Zeny -= 25000; getitem ClericCardX, 1; break; case DruidCardS: delitem .@card, 3; Zeny -= 25000; getitem DruidCardX, 1; break; case MageCardS: delitem .@card, 3; Zeny -= 25000; getitem MageCardX, 1; break; case NinjaCardS: delitem .@card, 3; Zeny -= 25000; getitem NinjaCardX, 1; break; case NatureCardS: delitem .@card, 3; Zeny -= 25000; getitem NatureCardX, 1; break; case NecromancerCardS: delitem .@card, 3; Zeny -= 25000; getitem NecromancerCardX, 1; break; case SpeedCardS: delitem .@card, 3; Zeny -= 25000; getitem SpeedCardX, 1; break; case ReflectCardS: delitem .@card, 3; Zeny -= 25000; getitem ReflectCardX, 1; break; case PowerCardS: delitem .@card, 3; Zeny -= 25000; getitem PowerCardX, 1; break; case WallCardS: delitem .@card, 3; Zeny -= 25000; getitem WallCardX, 1; break; default: mesn; mesq l("Sorry, I only deal with Arcmage cards."); break; } break; // Remove a card case 3: mesc l("You can drag and drop an item to the NPC window or select an item through your inventory."); delinventorylist(); getinventorylist(); .@item_index = requestitemindex(); .@item_id = @inventorylist_id[.@item_index]; mesn; mesq l("Your mind is set? You will probably lose all the dyes and/or cards during on the item during this process. You're bleaching a %s by the way, and THERE ARE NO REFUNDS even if the item go ablaze.", getitemlink(.@item_id)); if (askyesno() == ASK_YES) { mesn; mesq l("Sure, I'll be done in a jiff."); next; successremovecardsindex(.@item_index); // *should* return the card mesn; mesq l("Here it is, clean like a whistle!"); } else { mesn; mesq l("Is it truly a hard choice to make?"); } next; break; // Play minigame case 4: mesn; mesq l("...Are you trying to troll me?"); next; mesn; mesq l("Well, I can't offer you an %s match, but do you want to play something else? I would charge %d GP for a match.", "[@@https://arcmage.org|Arcmage@@]", .price); next; if (askyesno() == ASK_NO) { mesn; mesq l("Suit yourself."); next; break; } gameinfo(); mesn; mesq l("Ready to begin?"); if (askyesno() == ASK_YES) goto L_Start; break; // Leave default: closeclientdialog; goodbye; close; break; } goto L_Main; function colorname { switch (getarg(0)) { case 1: return "Green"; break; case 2: return "Blue"; break; case 3: return "Red"; break; case 4: return "Yellow"; break; case 5: return "Exit"; break; default: return l("ERROR: %d", getarg(0)); } } function gameinfo { showavatar NPC_FLOPPED_NOBLEMAN; mes ""; mesc l("Rules:"); mesc l("A color sequence will be displayed on the avatar frame."); mesc l("You must then repeat the sequence at the board which will show."); next; mesc l("Prizes:"); mesc l("You'll get %d GP every time you finish the sequence.", .prize); mesc l("If you finish %d sequences, you'll get a(n) %s!", 10, getitemlink(ArcmageBoxset)); next; return; } L_Start: showavatar AVATAR_SEQBOARD; mesc l("Pay attention to the sequence!"); next; Zeny -= .price; deletearray(@sequence); @streak=0; L_Sequence: // Configure setnpcdialogtitle l("Memorize the sequence!"); array_push(@sequence, 1+rand2(4)); sleep2(1000); // Display freeloop(true); for (.@i=0;.@i < getarraysize(@sequence);.@i++) { showavatar 1200+@sequence[.@i]; sleep2(1200-(@streak*20)); } freeloop(false); // Request setnpcdialogtitle l("What was the sequence?"); showavatar AVATAR_SEQBOARD; sleep2(500); for (.@i=0;.@i < getarraysize(@sequence);.@i++) { setskin "seqboard"; select l("Green"), l("Blue"), l("Red"), l("Yellow"), l("Exit"); .@ans=@menu; setskin ""; mes ""; mes l("%s", colorname(.@ans)); //next; setnpcdialogtitle strnpcinfo(1); // Exit if (.@ans == 5) goto L_Close; // Wrong reply if (.@ans != @sequence[.@i]) goto L_Wrong; // Correct! } mes ""; showavatar AVATAR_SEQBOARD_WELL; // Seems like everything is/was correct mesn; mesq l("Congratulations! Everything was correct!"); Zeny+=.prize; @streak+=1; // Winning Streak if (@streak % 10 == 0) getitem ArcmageBoxset, 1; mesc l("Your current win streak is @@!", @streak); next; // Game over if (@streak == 50) goto L_Close; // Otherwise, go ahead mesn; mesc l("Continue?"), 1; next; if (askyesno() == ASK_YES) goto L_Sequence; goto L_Close; L_Wrong: showavatar AVATAR_SEQBOARD_FAIL; mesn; mesq l("Oh no... That is wrong! %%3"); next; mesn; mesq l("Better luck next time!"); next; showavatar; goto L_Main; L_Close: showavatar; mesn; mesq l("Thanks for the match, it was fun!"); next; goto L_Main; OnInit: .@npcId = getnpcid(.name$); setunitdata(.@npcId, UDT_HEADTOP, TopHat); setunitdata(.@npcId, UDT_HEADMIDDLE, GoldenLightPlatemail); setunitdata(.@npcId, UDT_HEADBOTTOM, LeatherTrousers); setunitdata(.@npcId, UDT_WEAPON, ManaGloves); setunitdata(.@npcId, UDT_HAIRSTYLE, 24); setunitdata(.@npcId, UDT_HAIRCOLOR, 4); npcsit; .sex = G_MALE; .distance = 4; .price = 100; .prize = 25; end; }