Jump to content
  • 0
Sign in to follow this  
JoyRo

Donation Redeem NPC

Question

Hello,

 

I had a question about a npc i use i wanna add a extra feature.
When people buy a donation item that cost like 6 credits i want them to get also an aditional 6 old purple boxes.
Any idea what line i should add? I think it shoul dbe here somewhere.
 

                     }
                     query_sql "UPDATE `"+escape_sql($redeemtable$)+"` SET `char_id` = '"+escape_sql(getcharid(0))+"', `redeemed` = '1', `redemption_date` = NOW() WHERE `id` = '"+escape_sql(.@id[.@loop])+"'";
                     getitem .@nameid[.@loop],.@quantity[.@loop];
                     mes .@quantity[.@loop]+"x "+getitemname(.@nameid[.@loop]);
                  } else {

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

getitem Old_Violet_Box, .@quantity[.@loop];
just guessing

I don't know where you got that script from

Share this post


Link to post
Share on other sites
  • 0

Thank you AnnieRuru,

 

The line you gave me adds indeed a old purple box to the ammouth items you get from the redeem npc.

I have the script somewhere from rathena i think.

But i have items that you can get with 50 pieces now it gives you also 50 opb.

This is the script.

// NPC Settings - SET THESE BEFORE LOADING THE SCRIPT!   set $servername$,"Joy-Ro";   set $npcname$,"[Item Redeemer]"; // NPC Name to display during chat. Default: "[Item Redeemer]"   set $redeemtable$,"cp_redeemlog"; // Default: "cp_redeemlog"   set $showcredits,1; // Display Credits to FluxCP Creators? 0 = Disable. 1 = Enable. Default: 1   // End NPC Settings.    // Server Settings   // DON'T CHANGE THIS UNLESS YOU KNOW WHAT YOU'RE DOING AND HAVE MADE THE APPROPRIATE SOURCE MODS!   set $maxinventorysize,100; // Max amount of unique items able to be held in inventory.   set $maxquantity,30000; // Max amount of an item able to be held in inventory.   // End Server Settings.    // Begin NPC   mes $npcname$;   if (Sex)      mes "Well hello there good sir!";   else      mes "Well hello there young madam!";   mes "How may I be of assistance to you on this fine day?";   next;   switch(select("I wish to redeem items:Who might you be?:I am merely perusing the area")) {      case 1:         mes $npcname$;         deletearray @inventorylist_id;         deletearray @inventorylist_amount;         set @inventorylist_count,0;         getinventorylist;         if (@inventorylist_count < $maxinventorysize) {            query_sql "SELECT `id`, `nameid`, `quantity`  FROM `"+escape_sql($redeemtable$)+"` WHERE `account_id` = '"+escape_sql(getcharid(3))+"' AND `redeemed` = '0' LIMIT 128",.@id,.@nameid,.@quantity;            mes "Items Pending Redemption: "+getarraysize(.@id);            if (getarraysize(.@id) > 0) {               for( set .@loop, 0; .@loop < getarraysize(.@id); set .@loop,.@loop+1) {                  deletearray @inventorylist_id;                  deletearray @inventorylist_amount;                  set @inventorylist_count,0;                  getinventorylist;                  if (@inventorylist_count < $maxinventorysize) {                     for( set .@loop_inner,0; .@loop_inner < @inventorylist_count; set .@loop_inner,.@loop_inner+1) {                        deletearray @inventorylist_id;                        deletearray @inventorylist_amount;                        set @inventorylist_count,0;                        getinventorylist;                        if (@inventorylist_id[.@loop_inner] == .@nameid[.@loop]) {                           if (@inventorylist_amount[.@loop_inner]+.@quantity[.@loop] > $maxquantity) {                              mes "I'm terribly sorry, but you cannot hold more than "+$maxquantity+" of "+getitemname(.@nameid[.@loop])+" at a time!";                              mes "Please come back when you carry less of this item.";                              close;                           } else if (checkweight(.@nameid[.@loop],.@quantity[.@loop]) == 0) {                              mes "I'm terribly sorry, but you are carrying too much to accept your rewards.";                              mes "Please come again with less weight.";                              close;                           }                        }                     }                     query_sql "UPDATE `"+escape_sql($redeemtable$)+"` SET `char_id` = '"+escape_sql(getcharid(0))+"', `redeemed` = '1', `redemption_date` = NOW() WHERE `id` = '"+escape_sql(.@id[.@loop])+"'";                     getitem .@nameid[.@loop],.@quantity[.@loop];					 getitem Old_Violet_Box, .@quantity[.@loop];                     mes .@quantity[.@loop]+"x "+getitemname(.@nameid[.@loop]);					                  } else {                     mes "I'm terribly sorry, but you cannot hold more than "+$maxinventorysize+" items in your inventory.";                     mes "Please come again with less items.";                     close;                  }               }               if (Sex)                  mes "Thank you for your patronage fine sir.";               else                  mes "Thank you for your patronage ma'am.";               mes "Please enjoy your stay on our server, "+$servername$+".";               close;			    } else {               mes "My records indicate that there are no rewards awaiting to be redeemed.";               mes "My deepest apologies for the misunderstanding.";               close;            }         } else {            mes "I'm terribly sorry, but you cannot hold more than "+$maxinventorysize+" items in your inventory.";            mes "Please come again with less items.";            close;         }         close;      case 2:         mes $npcname$;         mes "I am here to allow for the redemption of rewards for donations to our server, "+$servername$;         mes "Donations may be made to the server via the control panel.";         close;      case 3:         mes $npcname$;         mes "Very well then.";         mes "Good day to you.";         close;   }}

Share this post


Link to post
Share on other sites
  • 0

nope not this script

this script houses the item awaiting players to redeem their items

like you add items to the player in the control panel, then it add an entry in the `cp_redeemlog` table

then player can redeem their items in-game through this npc

 

since you said

When people buy a donation item that cost like 6 credits i want them to get also an aditional 6 old purple boxes.

this is not the script you are looking for

 

when people buy donation item ...

actually its better to do it via #CASHPOINTS

Share this post


Link to post
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
Answer this question...

×   Pasted as rich text.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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