Jump to content

Quests, Games: Dice Event - Yet another version


Recommended Posts


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

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 .@mapflag,
        mf_nowarp,
        mf_nowarpto,
        mf_noskill,
        mf_noteleport,
        mf_nomemo,
        mf_nosave,
        mf_noicewall,
        mf_nobranch,
        mf_noreturn;
       
    for ( .@i = 0; .@i < getarraysize(.@mapflag); .@i++)
        setmapflag "quiz_02", .@mapflag[.@i];
       
    .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


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  737
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

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

Edited by Bringer
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  206
  • Reputation:   10
  • Joined:  08/30/19
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

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 ( .@j = 0; .@j < .@amt; .@j += 2 )
   getitem .item[.@j], .item[.@j+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


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  206
  • Reputation:   10
  • Joined:  08/30/19
  • Last Seen:  

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 ( .@j = 0; .@j < .@amt; .@j += 2 )
   getitem .item[.@j], .item[.@j+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


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

Dice_Event_v2.txt

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

Edit : updated to v 1.0.3

Edited by Mabuhay
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  206
  • Reputation:   10
  • Joined:  08/30/19
  • Last Seen:  

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 > .@time || .start ) end; // doesnt start if cd isn't done.

so it effect @dicestart also?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

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

if ( .event_time > .@time || .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


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.02
  • Content Count:  291
  • Reputation:   26
  • Joined:  12/16/17
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  206
  • Reputation:   10
  • Joined:  08/30/19
  • Last Seen:  

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

 

@BeWan

Edited by Takuyakii
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  206
  • Reputation:   10
  • Joined:  08/30/19
  • Last Seen:  

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


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

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 `.@timer` to `.@time`

Edited by Mabuhay
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  206
  • Reputation:   10
  • Joined:  08/30/19
  • Last Seen:  

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 `.@timer` to `.@time`

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

15 hours ago, Takuyakii said:

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

Same fix done from Poring Catcher :

Dice_Event_v2.txt

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  38
  • Topics Per Day:  0.02
  • Content Count:  206
  • Reputation:   10
  • Joined:  08/30/19
  • Last Seen:  

23 hours ago, Mabuhay said:

Same fix done from Poring Catcher :

Dice_Event_v2.txt 5.75 kB · 3 downloads

perfect !

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  303
  • Reputation:   117
  • Joined:  12/10/16
  • Last Seen:  

Isn't this based on my own modification?

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  446
  • Reputation:   229
  • Joined:  03/20/12
  • Last Seen:  

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