Jump to content
  • 0
Sign in to follow this  
kalabasa

Cluckers Reward

Question

This was posted in rAthena but the code is for Herc

i tested but its not working

https://rathena.org/board/topic/125989-cluckers-and-disguise-events/

https://gist.github.com/AnnieRuru/e2a3a45306d22479ea0885cb67cf7750

 

//===== 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'.
//============================================================

prontera,155,185,4	script	Cluckers	4_NFCOCK,{
	.@GMAccess = 80;	// GM level required to access NPC

	if (.startcluck) {
		specialeffect2 EF_HIT3;
		switch(rand(15)) {
		case 1: 
			npctalk "CLUUUUUUCK!!!";
			specialeffect2 EF_SUI_EXPLOSION;
			unitkill playerattached();
			emotion ET_HUK;
			break;
		case 2:
			npctalk "Cluuuuuck!~";
			break;
		case 3:
			specialeffect2 EF_SUI_EXPLOSION;
			unitkill playerattached();
			break;
		case 4:
			sc_start SC_FREEZE, 1000, 0;
			break;
		case 5:
			npctalk "CLUUUUUUUUUCK!!!";
			specialeffect2 EF_SUI_EXPLOSION;
			unitkill playerattached();
			emotion ET_HUK;
			break;
		case 6:
			sc_start SC_SLEEP, 1000, 0;
			break;
		case 7:
			sc_start SC_STONE, 1000, 0;
			emotion ET_KIK;
			break;
		case 8:
			npctalk "CLUUUUUUCK!!!";
			specialeffect2 EF_SUI_EXPLOSION;
			unitkill playerattached();
			emotion ET_HUK;
			break;
		case 9:
			npctalk "Cluck! CLUUUCK!!";
			specialeffect2 EF_SUI_EXPLOSION;
			unitkill playerattached();
			emotion ET_HUK;
			break;
		case 10:
			sc_start SC_STUN, 1000, 0;
			break;
		case 11:
			sc_start SC_SLEEP, 1000, 0;
			emotion ET_KIK;
			break;
		case 12:
			sc_start SC_STUN, 1000, 0;
			break;
		case 13:
			npctalk "Cluck! Cluck!";
			break;
		case 14:
			specialeffect2 EF_SUI_EXPLOSION;
			unitkill playerattached();
			break;
		default:
			if (rand(50) < 4) {
				npctalk "WOOF!...........";
				specialeffect2 EF_SPHERE;
				announce "[Cluck! Cluck! Boom!] " + strcharinfo(0) + " squeezed out the prize! Well done!", bc_all;
				getitem $cluck_item_id, $cluck_item_amount;
				.startcluck = 0;
			} else {
				npctalk "Cluck! CLUUUCK!!";
				specialeffect2 EF_SUI_EXPLOSION;
				unitkill playerattached();
			}
		}
		end;
	}
	mes "[Cluckers]";
	if (getgmlevel() >= .@GMAccess) {
		mes "Cluck cluck! Cluuuuuck? ^FF0000~Hi GM " + strcharinfo(0) + ", Wanna play today?~^000000";
		mes "Cluck cluck... CLUCK! ^FF0000~Just tell me what to do!~^000000";
		next;
		while(true) {
			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 select the item ID.~^000000";
				next;
				.@s = select(.prize_menu$) -1;
				$cluck_item_id = .prize_id[.@s];
				$cluck_item_amount = .prize_amount[.@s];
				mes "[Cluckers]";
				mes "Cluck cluck..? Cluck. ^FF0000~So, the prize is^000000 ^008000"+ $cluck_item_amount +" "+ getitemname($cluck_item_id) +"^000000? ^FF0000Great.~^000000";
				emotion ET_OK;
				next;
				break;
			case 4:
				mes "[Cluckers]";
				mes "Cluck cluck cluck...";
				close;
			}
		}
	}
	mes "Cluck cluck! Cluuuuuck?";
	mes "Cluck....";
	close;

OnTimer1000:
	announce "Please hurry behind the fountain if you want to play with the crazy chicken!",bc_blue;
	end;
OnTimer2000:
	announce "Cluckers has eaten one of my items! I'm too scared to retrieve it!",bc_blue;
	end;
OnTimer3000:
	announce "Click the insane chicken and try squeeze out the item, if you're lucky you'll win! Are you ready?",bc_blue;
	end;
OnTimer4000:
	announce "GO! Click the chicken to get the prize!",bc_blue;
	stopnpctimer;
	.startcluck = 1;
	end;
OnInit:
	setarray .prize_id, 501,502,503,504,505;
	setarray .prize_amount, 1,2,3,4,5;

	.@prize_size = getarraysize(.prize_id);
	for (.@i = 0; .@i < .@prize_size; ++.@i)
		.prize_menu$ += .prize_amount[.@i] +"x "+ getitemname(.prize_id[.@i]) +":";
	if (!$cluck_item_id)
		$cluck_item_id = 501;
	if (!$cluck_item_amount)
		$cluck_item_amount = 1;
	end;
}

 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

My bad it's working properly. i didnt understand until i set the prize through npc . i want something like setting multiple prize at the script. 

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.