Jump to content
Mabuhay

Quests, Games: Dice Event - Yet another version

Recommended Posts

Dice Event - Yet another version


UPDATE:

version 1 = I removed all my modifications on this script
version 2 = Has timers and will most likely be in-conflict with other event scripts i made.

 

In response to this post

 

OnInit:
    // item reward
    setarray .item,
        501, 10,
        502, 5;
 
    // @dicestart - gm manual start
    bindatcmd "dicestart", strnpcinfo(0)+"::OnStart",60,60;
   
    // @dice - player join event
    bindatcmd "dice", strnpcinfo(0)+"::OnJoinEvent";
   
    // Mapflags
    setarray [email protected],
        mf_nowarp,
        mf_nowarpto,
        mf_noskill,
        mf_noteleport,
        mf_nomemo,
        mf_nosave,
        mf_noicewall,
        mf_nobranch,
        mf_noreturn;
       
    for ( [email protected] = 0; [email protected] < getarraysize([email protected]); [email protected]++)
        setmapflag "quiz_02", [email protected][[email protected]];
       
    .event_time_m = gettime(DT_MINUTE);
    .event_time_s = gettime(DT_SECOND);
    end;

 

I took some dice script by someone named sandbox and modified it the way how I understand this posts suggests to make.

instead of using @event to check the time schedule of dice, I incorporate it to @dice command.

This will show you an hourly countdown as to when will the event will be re-starting.

And this dice event should be working on latest rathena.

 

Compatibility is your Responsibility.

 

PS : if there are any broken event scripts ( due to old versions ), just DM me the link and I might be interested in updating it.

PPS: I will only FIX it and not modify it at all. 🙂

 


 

  • Upvote 1
Link to comment
Share on other sites

On 11/7/2019 at 8:09 PM, Bringer said:

The Timer is not updating once you use @dice timer stay current time when you use it

Thanks for that, I have recently made changes. We'll have to wait for mods to approve..

If you cant wait, here is the copy Dice_Event_v2.txt (recent update down below)

 

On 11/8/2019 at 7:32 AM, Takuyakii said:

how to make this random reward ? in your script i would like to get random reward. ty

Change :

for ( [email protected] = 0; [email protected] < [email protected]; [email protected] += 2 )
   getitem .item[[email protected]], .item[[email protected]+1];

To simple F_Rand function:

getitem F_Rand(501,502,503), 1; // random 501, 502, 503 x 1 pc

 

Edited by Mabuhay
  • Upvote 1
Link to comment
Share on other sites

On 11/8/2019 at 10:12 AM, Mabuhay said:

Thanks for that, I have recently made changes. We'll have to wait for mods to approve..

If you cant wait, here is the copy Dice_Event_v2.txt

 

Change :

for ( [email protected] = 0; [email protected] < [email protected]; [email protected] += 2 )
   getitem .item[[email protected]], .item[[email protected]+1];

To simple F_Rand function:

getitem F_Rand(501,502,503), 1; // random 501, 502, 503 x 1 pc

 

Thaaaanks ! it Works ! 
Hope to have or same like this about Disguise and Poring (Y) 
your script and details was so friendly for newbie

@Mabuhay i try the v2, but @dicestart are not working. no error on map.

Link to comment
Share on other sites

On 11/10/2019 at 10:39 PM, Mabuhay said:

Dice_Event_v2.txt 5.5 kB · 0 downloads

My bad. seems like i forgot to add proper end to the event. That should be fixed

What are the changes?

if ( .event_time > [email protected] || .start ) end; // doesnt start if cd isn't done.

so it effect @dicestart also?

Link to comment
Share on other sites

On 11/10/2019 at 11:06 PM, Takuyakii said:

if ( .event_time > [email protected] || .start ) end; // doesnt start if cd isn't done.

 

so it effect @dicestart also?

Ah yes you're right. If it is on cd, it wont start. 

I might do some changes later to make it force start regardless of the cd time. 

Took me a while to realize. 

 

This should be the one : (Untested but surely it should work.)

 

Dice_Event_v2.txt

Edited by Mabuhay
  • Upvote 1
Link to comment
Share on other sites

46 minutes ago, Mabuhay said:

Ah yes you're right. If it is on cd, it wont start. 

I might do some changes later to make it force start regardless of the cd time. 

Took me a while to realize. 

 

This should be the one : (Untested but surely it should work.)

 

Dice_Event_v2.txt 5.54 kB · 1 download

It works now! Thanks a lot! ❤️ 

Link to comment
Share on other sites

7 minutes ago, Takuyakii said:

@Mabuhayis there posibility to put percent on reward? from random reward then random percents? of each item on this reward?

 

@BeWan

Yes it is possible to add percentage on drop. However, it is pointless to do so. It will only complicate this simple event which most probably be ignored by players as your server runs. 

  • Upvote 1
Link to comment
Share on other sites

On 11/13/2019 at 12:38 AM, Mabuhay said:

Yes it is possible to add percentage on drop. However, it is pointless to do so. It will only complicate this simple event which most probably be ignored by players as your server runs. 

Yea, i guess so, but incase, can i request like that or not ? btw forgot thanks for this script. +1 rep

@Mabuhay got error on dice event when no one participating and no winners: 

it keep announcing no dice winner for 5 times.

in map server i got this error

 

Data: number vaule =1
Function: mapannounce
Source NPC: EVENT_DICE
 
mapindex_normalize_name( Map name "there were no winner clear in all of the event. The event is now over.' is too long!
map_mapname2mapid mapindex_name2id: map "There were "not found index list!
Link to comment
Share on other sites

On 11/13/2019 at 8:19 PM, Takuyakii said:

@Mabuhay got error on dice event when no one participating and no winners: 

it keep announcing no dice winner for 5 times.

in map server i got this error

 

Data: number vaule =1
Function: mapannounce
Source NPC: EVENT_DICE
 
mapindex_normalize_name( Map name "there were no winner clear in all of the event. The event is now over.' is too long!
map_mapname2mapid mapindex_name2id: map "There were "not found index list!

add

.start = false;

in :

		} else if( .@players < 1 ) {
			.@end = true;
			.start = false;
			announce "There was no winner on the Dice Event.",bc_all,0x0ceedb;

 

 

also :

mapannounce "There were no winner clear in all of the event. The event is now over.",bc_map,0x0ceedb;

edit to:

mapannounce "quiz_02","There were no winner clear in all of the event. The event is now over.",bc_map,0x0ceedb;

 

 

Dice_Event_v2.txt

uploading another version in a bit. dl link is this for the update in-case mods cant approve immediately

 

Dice_Event_v2.txt

A newer version to fix the timer when event starts. just change `[email protected]` to `[email protected]`

Edited by Mabuhay
Link to comment
Share on other sites

23 hours ago, Mabuhay said:

add

.start = false;

in :

		} else if( .@players < 1 ) {
			.@end = true;
			.start = false;
			announce "There was no winner on the Dice Event.",bc_all,0x0ceedb;

 

 

also :

mapannounce "There were no winner clear in all of the event. The event is now over.",bc_map,0x0ceedb;

edit to:

mapannounce "quiz_02","There were no winner clear in all of the event. The event is now over.",bc_map,0x0ceedb;

 

 

Dice_Event_v2.txt 5.58 kB · 3 downloads

uploading another version in a bit. dl link is this for the update in-case mods cant approve immediately

 

Dice_Event_v2.txt 5.57 kB · 3 downloads

A newer version to fix the timer when event starts. just change `[email protected]` to `[email protected]`

on this new version , the event are not auto starting.

Link to comment
Share on other sites

2 minutes ago, n0tttt said:

Isn't this based on my own modification?

The var names and announce hex colors are even the same. 🤔

I dunno, somebody just asked me to fix this. So, I did. :s

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
Reply to this topic...

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

Important Information

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