Jump to content
  • 0

[IMPORTANT] DonationNpc.Txt


silent

Question


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  10/28/14
  • Last Seen:  

62ea8c7105.jpg

 

DonationNpc is bugged and even with an empty item it says im carrying to much weight

 

here is the script please mod it so it doesnt check for weight!

prontera,160,183,4	script	Donor Rewards Redeemer	987,{
	// ----------------- NPC Settings -----------------
	// --- SET THESE BEFORE LOADING THE SCRIPT! ---
	
	// Server Name
	set .serverName$,"Cloud Atlas";
	
	// NPC Name to display during chat.
	// Default: "[Donor Rewards Redeemer]"
	set .npcName$,"[Donor Rewards Redeemer]";
	
	// DO NOT CHANGE THIS!
	// Default: "cp_redeemlog"
	set .redeemTable$,"cp_redeemlog";
	
	// Display Credits to FluxCP Creators?
	// Help promote our product if its useful.
	// 0 = Disable. 1 = Enable.
	// Default: 1
	set .showCredits,1;
	
	// Max number of unique items to redeem at a time.
	// DO NOT RAISE THIS VALUE ABOVE 128 WITHOUT
	// MAKING THE NECESSARY SCRIPT ENGINE MODS
	// FOR SCRIPT ARRAY SIZING! DANGEROUS!
	// Default: 128
	set .numRedemptionsSimul,128; 
	// --------------- End NPC Settings ---------------

	// ----------------- Begin Script -----------------
	mes .npcName$;
	mes "Well hello there " + (Sex ? "good sir!" : "young madam!");
	mes "How may I be of assistance to you on this fine day?";
	next;
	prompt("I wish to redeem items:Who might you be?:I am merely perusing the area");
	mes .npcName$;
	switch(@menu) {
		case 1:
			query_sql "SELECT `id`, `nameid`, `quantity` FROM `" + escape_sql(.redeemTable$) + "` WHERE `account_id` = " + getcharid(3) + " AND `redeemed` = 0 LIMIT " + .numRedemptionsSimul,.@id,.@nameid,.@quantity;
			if (getarraysize(.@id) > 0) {
				mes "Items Pending Redemption: " + getarraysize(.@id);
				for (set .@i,0; .@i < getarraysize(.@id); set .@i,.@i+1)
					if (checkweight(.@nameid[.@i],.@quantity[.@i]) == 0) {
						mes "I'm terribly sorry, but you are carrying too much to accept " + (.@i ? "any more of " : " ") + "your rewards at this time.";
						mes "Please come back with fewer items.";
					} else {
						query_sql "UPDATE `" + escape_sql(.redeemTable$) + "` SET `char_id` = " + getcharid(0) + ", `redeemed` = 1, `redemption_date` = NOW() WHERE `id` = " + .@id[.@i];
						getitem .@nameid[.@i],.@quantity[.@i];
						mes .@quantity[.@i] + "x " + getitemname(.@nameid[.@i]);
					}
				if (.@i == getarraysize(.@id)) {
					mes "Thank you for your patronage " + (Sex ? "fine sir." : "ma'am.");
					mes "Please enjoy your stay on " + .serverName$ + "!";
				}
				if (.showCredits)
					callfunc "F_FluxCredits";
			} else {
				mes "My records indicate that there are no rewards awaiting to be redeemed.";
				mes "My deepest apologies for the misunderstanding.";
			}
		break;
		case 2:
			mes "I am here to allow for the redemption of rewards for donations to " + .serverName$ + ".";
			mes "Donations may be made to the server via the control panel.";
		break;
		default:
			mes "Very well then.";
			mes "Good day to you.";
		break;
	}
	close;
	// ------------------ End Script ------------------
}

// ------------ Credits to FluxCP Creators ------------
// - Please do not modify or delete this function or  -
// - its contents. To disable the credits from being  -
// - shown, set .showCredits to 0 in the NPC Settings -
// - at the top of this file.                         -
// ----------------------------------------------------

function	script	F_FluxCredits	{
	mes "-----------------------------------";
	mes "Powered by Flux Control Panel.";
	mes "Copyright © 2008-2012 Matthew Harris and Nikunj Mehta.";
	mes "http://fluxcp.googlecode.com/";
	return;
}

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  1479
  • Reputation:   172
  • Joined:  12/14/11
  • Last Seen:  

don't need to check weight?

just send the items directly to players?

if fail, then GG? ok

 

remove line 43 - 46 and 50:

prontera,160,183,4    script    Donor Rewards Redeemer    987,{
    // ----------------- NPC Settings -----------------
    // --- SET THESE BEFORE LOADING THE SCRIPT! ---
    
    // Server Name
    set .serverName$,"Cloud Atlas";
    
    // NPC Name to display during chat.
    // Default: "[Donor Rewards Redeemer]"
    set .npcName$,"[Donor Rewards Redeemer]";
    
    // DO NOT CHANGE THIS!
    // Default: "cp_redeemlog"
    set .redeemTable$,"cp_redeemlog";
    
    // Display Credits to FluxCP Creators?
    // Help promote our product if its useful.
    // 0 = Disable. 1 = Enable.
    // Default: 1
    set .showCredits,1;
    
    // Max number of unique items to redeem at a time.
    // DO NOT RAISE THIS VALUE ABOVE 128 WITHOUT
    // MAKING THE NECESSARY SCRIPT ENGINE MODS
    // FOR SCRIPT ARRAY SIZING! DANGEROUS!
    // Default: 128
    set .numRedemptionsSimul,128;
    // --------------- End NPC Settings ---------------

    // ----------------- Begin Script -----------------
    mes .npcName$;
    mes "Well hello there " + (Sex ? "good sir!" : "young madam!");
    mes "How may I be of assistance to you on this fine day?";
    next;
    prompt("I wish to redeem items:Who might you be?:I am merely perusing the area");
    mes .npcName$;
    switch(@menu) {
        case 1:
            query_sql "SELECT `id`, `nameid`, `quantity` FROM `" + escape_sql(.redeemTable$) + "` WHERE `account_id` = " + getcharid(3) + " AND `redeemed` = 0 LIMIT " + .numRedemptionsSimul,.@id,.@nameid,.@quantity;
            if (getarraysize(.@id) > 0) {
                mes "Items Pending Redemption: " + getarraysize(.@id);
                for (set .@i,0; .@i < getarraysize(.@id); set .@i,.@i+1) {
                    query_sql "UPDATE `" + escape_sql(.redeemTable$) + "` SET `char_id` = " + getcharid(0) + ", `redeemed` = 1, `redemption_date` = NOW() WHERE `id` = " + .@id[.@i];
                    getitem .@nameid[.@i],.@quantity[.@i];
                    mes .@quantity[.@i] + "x " + getitemname(.@nameid[.@i]);
                }
                if (.@i == getarraysize(.@id)) {
                    mes "Thank you for your patronage " + (Sex ? "fine sir." : "ma'am.");
                    mes "Please enjoy your stay on " + .serverName$ + "!";
                }
                if (.showCredits)
                    callfunc "F_FluxCredits";
            } else {
                mes "My records indicate that there are no rewards awaiting to be redeemed.";
                mes "My deepest apologies for the misunderstanding.";
            }
        break;
        case 2:
            mes "I am here to allow for the redemption of rewards for donations to " + .serverName$ + ".";
            mes "Donations may be made to the server via the control panel.";
        break;
        default:
            mes "Very well then.";
            mes "Good day to you.";
        break;
    }
    close;
    // ------------------ End Script ------------------
}

// ------------ Credits to FluxCP Creators ------------
// - Please do not modify or delete this function or  -
// - its contents. To disable the credits from being  -
// - shown, set .showCredits to 0 in the NPC Settings -
// - at the top of this file.                         -
// ----------------------------------------------------

function    script    F_FluxCredits    {
    mes "-----------------------------------";
    mes "Powered by Flux Control Panel.";
    mes "Copyright © 2008-2012 Matthew Harris and Nikunj Mehta.";
    mes "http://fluxcp.googlecode.com/";
    return;
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  5
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  10/28/14
  • Last Seen:  

640863e7e6.jpg

 

that script totally removes the donationnpc  /?? 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  1479
  • Reputation:   172
  • Joined:  12/14/11
  • Last Seen:  

oh, my bad.

prontera,160,183,4	script	Donor Rewards Redeemer	987,{
	// ----------------- NPC Settings -----------------
	// --- SET THESE BEFORE LOADING THE SCRIPT! ---
	
	// Server Name
	set .serverName$,"Cloud Atlas";
	
	// NPC Name to display during chat.
	// Default: "[Donor Rewards Redeemer]"
	set .npcName$,"[Donor Rewards Redeemer]";
	
	// DO NOT CHANGE THIS!
	// Default: "cp_redeemlog"
	set .redeemTable$,"cp_redeemlog";
	
	// Display Credits to FluxCP Creators?
	// Help promote our product if its useful.
	// 0 = Disable. 1 = Enable.
	// Default: 1
	set .showCredits,1;
	
	// Max number of unique items to redeem at a time.
	// DO NOT RAISE THIS VALUE ABOVE 128 WITHOUT
	// MAKING THE NECESSARY SCRIPT ENGINE MODS
	// FOR SCRIPT ARRAY SIZING! DANGEROUS!
	// Default: 128
	set .numRedemptionsSimul,128; 
	// --------------- End NPC Settings ---------------

	// ----------------- Begin Script -----------------
	mes .npcName$;
	mes "Well hello there " + (Sex ? "good sir!" : "young madam!");
	mes "How may I be of assistance to you on this fine day?";
	next;
	prompt("I wish to redeem items:Who might you be?:I am merely perusing the area");
	mes .npcName$;
	switch(@menu) {
		case 1:
			query_sql "SELECT `id`, `nameid`, `quantity` FROM `" + escape_sql(.redeemTable$) + "` WHERE `account_id` = " + getcharid(3) + " AND `redeemed` = 0 LIMIT " + .numRedemptionsSimul,.@id,.@nameid,.@quantity;
			if (getarraysize(.@id) > 0) {
				mes "Items Pending Redemption: " + getarraysize(.@id);
				for (set .@i,0; .@i < getarraysize(.@id); set .@i,.@i+1) {
					query_sql "UPDATE `" + escape_sql(.redeemTable$) + "` SET `char_id` = " + getcharid(0) + ", `redeemed` = 1, `redemption_date` = NOW() WHERE `id` = " + .@id[.@i];
					getitem .@nameid[.@i],.@quantity[.@i];
					mes .@quantity[.@i] + "x " + getitemname(.@nameid[.@i]);
				}
			}
				if (.@i == getarraysize(.@id)) {
					mes "Thank you for your patronage " + (Sex ? "fine sir." : "ma'am.");
					mes "Please enjoy your stay on " + .serverName$ + "!";
				}
				if (.showCredits)
					callfunc "F_FluxCredits";
			} else {
				mes "My records indicate that there are no rewards awaiting to be redeemed.";
				mes "My deepest apologies for the misunderstanding.";
			}
		break;
		case 2:
			mes "I am here to allow for the redemption of rewards for donations to " + .serverName$ + ".";
			mes "Donations may be made to the server via the control panel.";
		break;
		default:
			mes "Very well then.";
			mes "Good day to you.";
		break;
	}
	close;
	// ------------------ End Script ------------------
}

// ------------ Credits to FluxCP Creators ------------
// - Please do not modify or delete this function or  -
// - its contents. To disable the credits from being  -
// - shown, set .showCredits to 0 in the NPC Settings -
// - at the top of this file.                         -
// ----------------------------------------------------

function	script	F_FluxCredits	{
	mes "-----------------------------------";
	mes "Powered by Flux Control Panel.";
	mes "Copyright © 2008-2012 Matthew Harris and Nikunj Mehta.";
	mes "http://fluxcp.googlecode.com/";
	return;
}

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

×   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...