viewing paste Unknown #21730 | Athena

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
//SYNTAX: mapname,x,y,z<TABKEY>script<TABKEY>QuestNPC<TABKEY>89(use @disguise 89 to see what NPC would look like),{   <- Initiate script
prontera,150,150,4      script  QuestNPC        89,{
 
        //Name your variables whatever you please, does not matter.
        .ItemID = 501; // Red Potion
        .ItemAM = 10; // Amount of Red potions that we'll use.
       
 
        if(.FirstTalk == 0)             // basically "if your first talk equals 0, which it does because .@FirstTalk variable doesn't exist yet"
        {
       
                mes "Why hello there "+strcharinfo(0)+"."; // strcharinfo(0) means Character name
                mes "I have a request, could you bring me "+getitemname(.ItemID)+" x "+.ItemAM+" please?"; //getitemname + what you set .ItemID to, which would output Red Potion x item amount
                mes "Come back to me if you have the right ingredients, I'll reward you.";
                .FirstTalk++; //Added 1 integer to non-existant variable .FirstTalk
                close;
        }  else // this means ELSE if .@FirstTalk is NOT equal to 0, at the end of beginning NPC convo variable .@FirstTalk was added 1 variable, aka .@FirstTalk++; (Adds 1 integer to .@FirstTalk)
       
        if(.FirstTalk == 1)
        {
                if(countitem(.ItemID) >= .ItemAM )                      // so if (counts item of variable .ItemID is greater than or equal to .ItemAM whichis 10, aka >=, you will recieve reward.
                {
                        .FirstTalk++; // Now since .FirstTalk is equal to two, you already did quest, so script will say "Sorry but you finished my quest, thanks anyway!"
                        mes "Awesome job! You got me my items! Here's your reward.";
                        getitem 501, 100; // They got Red Potion x 100
                        close;
                } else
                        mes "Sorry man, but you don't have the required items, remember, it's"+getitemname(.ItemID)+" x "+.ItemAM+". Hurry up!";
                        close;
        } else
        mes "Sorry, but you finished my  quest, thanks anyway!";
        close;
}
Viewed 607 times, submitted by unknown.