Jump to content
  • 0

Question

Posted (edited)

I remember a event like this:

Its a Poring NPC, with a small chance to win, if you fail you are warped few steps away from the Poring. The first player that hits correct wins.

Someone have something like that? or can give me instruction how to do it? Thanks Adv.

(sorry for my bad english)

Edited by Hyoru

22 answers to this question

Recommended Posts

Posted (edited)

no... its a NPC, when you click him, you have a chance to win and lose, if you lose you are warped some steps away from him, and if you win he disappear and you get the prize. With a low chance to win...

look how this works:

If you fail, you'll back some steps away from him and run to "talk" again.... first lucky person, wins.

Edited by Hyoru
Posted · Hidden by Shikka, April 21, 2012 - to early postet
Hidden by Shikka, April 21, 2012 - to early postet

rontera,100,100,0 scriptYggdrasil Gatekeeper 111,8,8,{

Posted (edited)

loadeventnpc:

- script loadporingevent -1,{

//choose 1 of the 2 options.
//disable the others or delete them
//you can use to enable:
if (gettime(4) == 0) enablenpc "poring#event1"; // enable on sunday at 0 am (saturday -> sunday)
//or:
if (gettime(4) == 0 && gettime(3) == 8) enablenpc "poring#event1"; // enable on sunday at 8 am


//and to disable again:
if (gettime(4) == 0 && gettime(3) == 10) disablenpc "poring#event1"; // if no one wins in 2 hours it would be disabled again
}

// don't add the following to your npc:

gettime(x) // x can be one of the following numbers.

1 - Seconds (of a minute)

2 - Minutes (of an hour)

3 - Hour (of a day)

4 - Week day (0 for Sunday, 6 is Saturday)

5 - Day of the month.

6 - Number of the month.

7 - Year.

8 - Day of the year.

event npc:

prontera,100,100,0	script	poring#event1	1002,{ // 1002 = poring sprite? - i dunno if it works ^^

if ($won == 1) {sorry, but one player already won.}
set @rand,rnd(1,100000) // 1,100000 = 1-100000 you can edit the chance to win or lose 

//choose 1 of this options.
//disable the others or delete them
//you can use:
if (@rand == 1) {set $won,1;goto win;} // mean only the user with getting random 1 is able to win and $won will end the clickable npc for all others
//or:
if (@rand < 2) {set $won,1;goto win;} // means the user with a number under 2 will win and $won will end the clickable npc for all others
//even this is an option:
if (@rand > 2) {set $won,1;goto win;} // means the user with a number higher then 2 will win... a really good chance to win at 1 up to 100000... xD and $won will end the clickable npc for all others
goto lose;

win:
if ($win != getcharid(0)) {sorry, but another player already won.} // prevents that more than one player can win
set $win,getcharid(0); // prevents that more than one player can win at a time
mes "wow..."
mes "You've won!";
next;
mes "Here is your Reward";
getitem xy,1; // xy = the item-id
close2;
disablenpc "poring#event1";
end;

lose:
warp "prontera",105,105;
end;
}

don't forgett to delete or // the sentences who wont fit your request.

didn't test it, but should work.

hope i understood the request :)

if i didn't, just tell me, i'll write another one, if you want

Edited by Shikka
  • Upvote 1
Posted (edited)

sorry, wrote to fast xD

if ($won == 1) {sorry, but one player already won.} <--- wrong

if ($won == 1) {mes "sorry, but one player already won.";} <--- right

to start the event everyday you've to write this:

- script loadporingevent -1,{

OnInit: // forgott this command in the npc above

OnHour16: // forgott this command in the npc above

if (gettime(4) >= 0 && gettime(4) <= 6 && gettime(3) == 16) enablenpc "poring#event1"; // enable on all days at 4 pm

(should work, but i did not test it)

}

Edited by Shikka
Posted (edited)

yeah, just one more thing, when i win, he says:

sorry but one player already won.

wow...

you've won!

and give me prize

Edited by Hyoru
Posted (edited)

I'll write the npc's new, gimme one minute

1 npc

- script loadporingevent -1,{

OnInit: // forgott this command in the npc above

OnHour16: // forgott this command in the npc above

if (gettime(4) >= 0 && gettime(4) <= 6 && gettime(3) == 16) enablenpc "poring#event1"; // enable on all days at 4 pm

}

2 npc

prontera,100,100,0 script poring#event1 1002,{ // 1002 = poring sprite? - i dunno if it works ^^

if ($won == 1) {mes "sorry, but one player already won."; close;}

set @rnd,rand(1,100000) // 1,100000 = 1-100000 you can edit the chance to win or lose :)

//choose 1 of this options.

//disable the others or delete them

//you can use:

if ($won == 1){mes "sorry, but another player already won.";close;}

if (@rnd == 1) {set $won,1; set $win,getcharid(0); goto win;} // mean only the user with getting random 1 is able to win and $won will end the clickable npc for all others

//or:

if (@rnd < 2) {set $won,1; set $win,getcharid(0); goto win;} // means the user with a number under 2 will win and $won will end the clickable npc for all others

//even this is an option:

if (@rnd > 2) {set $won,1; set $win,getcharid(0); goto win;} // means the user with a number higher then 2 will win... a really good chance to win at 1 up to 100000... xD and $won will end the clickable npc for all others

goto lose;

win:

if ($win != getcharid(0)) {mes "sorry, but another player already won.";close;} // prevents that more than one player can win

mes "wow..."

mes "You've won!";

next;

mes "Here is your Reward";

getitem xy,1; // xy = the item-id

close2;

disablenpc "poring#event1";

end;

lose:

warp "prontera",105,105;

end;

}

so, this should be it...

because i've changed the @rnd,rand(1,100000)

you had to change the if(@rand == 1) to if (@rnd == 1) too.

so... i hope i've fixed all...

Edited by Shikka
Posted (edited)

thanks Nameless2you, sorry, i'm not good at scripting in one minute =D don't have much time at the moment (doing many things at the same time) xD

sorry for that bad scripts ^^

just tried to help a lil bit xD

Edited by Shikka

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...