Jump to content
  • 0

Cluckers Reward Choose in NPC instead of Inserting Id# and amount


balanar12321

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  20
  • Reputation:   0
  • Joined:  04/11/15
  • Last Seen:  

//===== Hercules Script =======================================
//= Cluck! Cluck! Boom!
//===== By: ==================================================
//= Keale
//===== Current Version: =====================================
//= 1.2a
//===== Description: =========================================
//= Click the chicken and try retrieve the item at a low
//= chance. If you fail he will nuke, freeze, stone,
//= stun, or make you fall asleep.
//= The prize is configurable and triggered by the NPC.
//===== Additional Comments: =================================
//= 1.0 First release.
//= 1.1 Using 'switch rand' instead.
//= 1.2 Cleaned and standardized. [Euphy]
//= 1.2a Switched 'atcommand' to 'unitskilluseid'.
//============================================================

payon,160,226,4    script    Cluckers    4_NFCOCK,{

    set .@GMAccess,80;    // GM level required to access NPC

    if (.startcluck) {
        specialeffect(EF_HIT3, AREA, playerattached());
        switch(rand(15)) {
            case 0: npctalk "CLUUUUUUCK!!!"; unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; emotion 23; break;
            case 1: npctalk "Cluuuuuck!~"; break;
            case 2: unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; break;
            case 3: sc_start SC_FREEZE,1000,0; break;
            case 4: npctalk "CLUUUUUUUUUCK!!!"; unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; emotion 23; break;
            case 5: sc_start SC_SLEEP,1000,0; break;
            case 6: sc_start SC_STONE,1000,0; emotion 29; break;
            case 7: npctalk "CLUUUUUUCK!!!"; unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; emotion 23; break;
            case 8: npctalk "Cluck! CLUUUCK!!"; unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; emotion 23; break;
            case 9: sc_start SC_STUN,1000,0; break;
            case 10: sc_start SC_SLEEP,1000,0; emotion 29; break;
            case 11: npctalk "Cluck! Cluck!"; break;
            case 12: sc_start SC_STUN,1000,0; break;
            case 13: unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1; break;
            default:
                if (rand(50) < 4) {
                    npctalk "WOOF!...........";
                    specialeffect(EF_SPHERE, AREA, playerattached());
                    announce "[Cluck! Cluck! Boom!] " + strcharinfo(PC_NAME) + " squeezed out the prize! Well done!",0;
                    getitem $cluck_item_id,$cluck_item_amount;
                    set .startcluck,0;
                } else {
                    npctalk "Cluck! CLUUUCK!!";
                    unitskilluseid getcharid(CHAR_ID_ACCOUNT),"NPC_SELFDESTRUCTION",1;
                }
                break;
        }
        end;
    }
    mes "[Cluckers]";
    if (getgmlevel() >= .@GMAccess) {
        mes "Cluck cluck! Cluuuuuck? ^FF0000~Hi GM " + strcharinfo(PC_NAME) + ", Wanna play today?~^000000";
        mes "Cluck cluck... CLUCK! ^FF0000~Just tell me what to do!~^000000";
        next;
        while(1) switch(select("Start Event", "Check Prize", "Set Prize", "Not today Cluckers")) {
            case 1:
                mes "[Cluckers]";
                mes "CLUCK! ^FF0000~Sure thing!~^000000";
                emotion 33;
                close2;
                announce "[Cluck! Cluck! Boom!] is about to start in Prontera!",bc_blue;
                initnpctimer;
                end;
            case 2:
                mes "[Cluckers]";
                mes "Cluck, cluck cluck... Cluck! ^FF0000~The current prize is^000000 ^008000"+ $cluck_item_amount +" "+ getitemname($cluck_item_id) +".^000000";
                next;
                break;
            case 3:
                mes "[Cluckers]";
                mes "Cluck cluck? Cluck??? ^FF0000~What should the prize for winning be? Please input the ID.~^000000";
                input($cluck_item_id, 0);
                next;
                mes "[Cluckers]";
                mes "Cluck? cluuuck? ^FF0000~How many if this item should I give away?~^000000";
                input($cluck_item_amount, 0);
                next;
                mes "[Cluckers]";
                mes "Cluck cluck..? Cluck. ^FF0000~So, the prize is^000000 ^008000"+ $cluck_item_amount +" "+ getitemname($cluck_item_id) +"^000000? ^FF0000Great.~^000000";
                emotion 33;
                next;
                break;
            case 4:
                mes "[Cluckers]";
                mes "Cluck cluck cluck...";
                close;
        }
    }
    mes "Cluck cluck! Cluuuuuck?";
    mes "Cluck....";
    close;

OnTimer10000:
    announce "Please hurry behind the fountain if you want to play with the crazy chicken!",bc_blue;
    end;
OnTimer20000:
    announce "Cluckers has eaten one of my items! I'm too scared to retrieve it!",bc_blue;
    end;
OnTimer30000:
    announce "Click the insane chicken and try squeeze out the item, if you're lucky you'll win! Are you ready?",bc_blue;
    end;
OnTimer40000:
    announce "GO! Click the chicken to get the prize!",bc_blue;
    stopnpctimer;
    if (!$cluck_item_id) set $cluck_item_id,512;
    if (!$cluck_item_amount) set $cluck_item_amount,1;
    set .startcluck,1;
    end;
}


 

cluckers.txt

Edited by Patskie
codebox
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  911
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

getitem $cluck_item_id,$cluck_item_amount;
 

prontera,1,1,3	script	TestNPC	99,{
	mes "You need to select one of this to change the current reward";
	mes "This is your current reward "+$cluck_item_id+"";
	mes "This is your current reward Amount "+$cluck_item_amount+"";

	switch(select("This item will need to configure to case 1","This item will need to configure to case 2","This item will need to configure to case 3","This item will need to configure to case 4")){
		next;
          case 1:
                  set $cluck_item_id,"Put here the Item ID for reward 1";
          case 2:
                  set $cluck_item_id,"Put here the Item ID for reward 2";
          case 3:
                  set $cluck_item_id,"Put here the Item ID for reward 3";
		  case 4:
				mes "Please Input the amount";
				input .Amount;
				set $cluck_item_amount,.Amount;
				next;
				mes "The event item amount has been successfully change";
				close;
 	 }
}


Not tested im a lazy person so i give you the idea that i think you want to make it . But if you want to manually set the reward and amount i think the cluckers event is already build to that kind of thing . Unless you want to make it everytime your server up this specific item will be use as a default . To do that you need to add this

 

OnInit: // Below is the code you want to initialize when the server is up

	end;

 

Edited by Poring King
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...