Jump to content
  • 0
Sign in to follow this  
Helena

Annie's mission board, drop missions on reborn?

Question

Hello annie and other scripters~

 

This is the problem with the script. I have missions with level brackets, but my players have discovered to accept a mission a level 99, hunt the items/monsters, and hand in the mission after they have reborn, which gives them so much EXP to instantly become level 60+ :(

 

My request is if someone can help me make all their missions reset when they reborn? Here is the drop mission part, I believe something like this needs to be played with?

 

Thank you so much.

 

note that this isnt functioning at all yet, except for the first 3 lines. >.<

 

 

OnPCLoadMapEvent:

if ( Class == Novice_High && BaseLevel == 1 ){

dispbottom "You have reborn, all missions shall automatically be dropped!";
set @slot, select(
"#1 "+( ( @ms_b_m_1[0] )?"^0000FF"+ getd("$ms_b_m_"+ @ms_b_m_1[0] +"$[0]"):"^FF0000Empty" )+"^000000",
"#2 "+( ( @ms_b_m_2[0] )?"^0000FF"+ getd("$ms_b_m_"+ @ms_b_m_2[0] +"$[0]"):"^FF0000Empty" )+"^000000",
"#3 "+( ( @ms_b_m_3[0] )?"^0000FF"+ getd("$ms_b_m_"+ @ms_b_m_3[0] +"$[0]"):"^FF0000Empty" )+"^000000",
"#4 "+( ( @ms_b_m_4[0] )?"^0000FF"+ getd("$ms_b_m_"+ @ms_b_m_4[0] +"$[0]"):"^FF0000Empty" )+"^000000");
if ( getd("@ms_b_m_"+ @slot +"[0]") == 0 ) {
mes "It appears that you have selected a empty slot!";
close;
}
callsub L_showprogress;
mes "Are you sure that you want to give up this mission?";
mes "^777777NOTE: Any progress you've made for this mission will be lost!^000000";
next;
if ( select ( "Yes", "No" ) == 2 ) close;
mes "["+ strnpcinfo(1) +"]";
mes "^0000FF"+ getd("$ms_b_m_"+ getd("@ms_b_m_"+ @slot +"[0]") +"$[0]") +"^000000";
mes " ";
mes "Mission has given up successfully";
deletearray getd("@ms_b_m_"+ @slot);
setd "ms_b_m_"+ @slot +"$", "";
deltimer "ms_b_::OnQuest"+ @slot +"TimeUp";
set @slot, 0;
close;
Edited by Helena

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Aw, why write from scratch? This is a great script and works with all emulators. :o

not sure you can understand, but I have level up my scripting skill 3 times

2006~2007 just learned how to script

2007~2009 2nd generation

2010~2011 3rd generation

2013~ now 4th generation

 

let me just brief you my past scripting techniques

example like search a value in array

http://upaste.me/91c4109597fd86270

 

in other words, any script that I made before 2012 is consider outdated script for me

.

.


.

.

...hmm.. is it possible to attach the reset to the jobmaster?

stupid maki ... make eathena forum down again

luckily I still have the plans in my old backup-disk

 

mission require permanent global var 4

$ms_b_m_ID$[0] - mission name {70}

$ms_b_m_ID$[1]- description {210}

$ms_b_m_ID$[2]- others {105}

$ms_b_m_ID$[3]- target mob + item requirement + item reward {189}

 

mission require npc array : 4

.ms_b_m_ID$[]

getd -> mission ID

[0] mission name {70}

[1] description {210}

[2] job limitation in bits {10}

[3] level requirement - min level {4}

[4] level requirement - max level {4}

[5] time limit {10}

[6] mission reset - [Repeatedly], [Everyday], [Only Once] {1}

[7] base exp reward {10}

[8] job exp reward {10}

[9] zeny reward {10}

[10] cash reward {10}

[11] npc id {3}

[12] require quest id {4}

[13] quest for id {4}

10 + 4 + 4 + 10 + 1 + 10 + 10 + 10 + 10 + 3 + 4 + 4

= 92 strings + 13 seperator

= 105 total

 

$ms_b_t_ID$[]

this is the combination variable of target mob, item requirement and item rewards

and this will explode into 3 arrays

 

.ms_b_t_ID[]

[0] target mob 1 id {4}

[1] target mob 1 amount {3}

[2] target mob 2 id

[3] target mob 2 amount

[4] target mob 3 id

[5] target mob 3 amount

[6] target mob 4 id

[7] target mob 4 amount

[8] target mob 5 id

[9] target mob 5 amount

[10] target mob 6 id

[11] target mob 6 amount

[12] target mob 7 id

[13] target mob 7 amount

[14] target mob 8 id

[15] target mob 8 amount

[16] target mob 9 id

[17] target mob 9 amount

[18] target mob 10 id

[19] target mob 10 amount

= ( 4 + 3 + 1 ) x 10 - 1 = 79

 

.ms_b_ir_ID[]

[0] item requirement 1 id {5}

[1] item requirement 1 amount {5}

[2] item requirement 2 id

[3] item requirement 2 amount

[4] item requirement 3 id

[5] item requirement 3 amount

[6] item requirement 4 id

[7] item requirement 4 amount

[8] item requirement 5 id

[9] item requirement 5 amount

= ( 5 + 5 + 1 ) x 5 - 1 = 54

 

.ms_b_ia_ID[]

[0] item reward 1 id {5}

[1] item reward 1 amount {5}

[2] item reward 2 id

[3] item reward 2 amount

[4] item reward 3 id

[5] item reward 3 amount

[6] item reward 4 id

[7] item reward 4 amount

[8] item reward 5 id

[9] item reward 5 amount

= ( 5 + 5 + 1 ) x 5 - 1 = 54

 

79 + 54 + 54 + 2 seperator = 189

 

$ms_b_n_$[ npc_id ]

each npc has its own permanent global variable,

which may explode, for telling that npc having which mission id

 

.ms_b_name$[ npc_id ]

there is an npc array to hold npc names, using snippet below

 

total global var =

each mission generate 4 global var

each npc generate 1 global var

+1 for mission ID increment

 

========================================================================

 

player variable -

ms_b_m_QID$

each player allow to take up to 5 missions

each mission save use 1 permanent player variable

<mission id>#<mission time tick>#<mob 1 killed amount>#<mob 2 killed amount>#....

@ms_b_m_QID[]

which may explode into temporal player array

[0] mission id

[1] mission time tick

[2] mob 1 killed amount

[3] mob 2 killed amount

.... and so on, limit at 10 types of mob killed amount

 

ms_b_n_NPCID$

if that player completed each missions from that npc

that player will save another variable for that npc ID

<date saved>#<completed mission ID 1>#<completed mission ID 2>

@ms_b_n_NPCID$[]

which may explode into temporal player array

[0] data save -> gettimestr("%Y%m%d", 9)

[1] completed mission ID 1

[2] completed mission ID 2

.... and so on, limit at 40

 

 

so the script should be

http://upaste.me/058f109570518cb1f

with the source modification of

http://upaste.me/6e0710958b3a393e1

Share this post


Link to post
Share on other sites
  • 0

http://upaste.me/6a67109559565b02b

 

- fix when players when finished a daily type mission on previous day, on the next day talk to npc will cause infinite loop (already fixed)

- fix a bug the players can submit the quest outside the level range limitation

Share this post


Link to post
Share on other sites
  • 0
 

http://upaste.me/6a67109559565b02b

- fix when players when finished a daily type mission on previous day, on the next day talk to npc will cause infinite loop (already fixed)
- fix a bug the players can submit the quest outside the level range limitation

 

Wow thanks annie!

Although, I like that they can submit their mission at any level. The only thing that I don't like is that a novice high can submit a previously accepted (high level) mission, hence why the reset on reborn request. >.<

 

Is that possible? 

 

(On a different note, because you fixed the infinite loop, does the goto count still need to be increased? Just curious~)

 

Anyway thanks annie, you're the best scripter! :)

Edited by Helena

Share this post


Link to post
Share on other sites
  • 0

Although, I like that they can submit their mission at any level. The only thing that I don't like is that a novice high can submit a previously accepted (high level) mission, hence why the reset on reborn request. >.<

 

Is that possible?

I actually has a list of TODO for mission board 2.5 during year 2011, but it was never done

 

/*TODO:

- shorten the player side loading time by running multiple timer

- shorten all loading time by using sleep2 (condition)*1; instead if (condition) sleep2 1;

- fix a minor bug that players still can submit quest even though the level or job requirement has changed

eg: a quest limited level 20~30 but can submit quest on level 31, I tried other games I can't submit anymore

- update int__ function

- add timeleft__ function

- bring out the player side dynamic menu when accepting mission to prevent server process same data repeatedly

- add when whisper npc:mission it cast a viewpoint in the mini-map

- optimize the monster kill part if the kill count already reach the limit, it shouldn't increase more count

*/

 

<=== now I've level up, I think its better for me scrap this whole script and make a new one ...

I've only done the red part, the rest was never done

 

I've played on a mmorpg game called Perfect World, I can't submit a quest when I'm level 41 that is meant for level30~40

so the behavior should be like this

 

so if they took a mission for 90~99,

they can keep this mission but they have to level up all the way until level90, then only can submit it

which ... kills the purpose though

 

what you are asking probably needs OnPCJobLvUpEvent: ..

I don't think there's a need for that ...

.

.

(On a different note, because you fixed the infinite loop, does the goto count still need to be increased? Just curious~)

I actually made this script with my test server having 20480 check_gotocount ... so its still better to increase it

Share this post


Link to post
Share on other sites
  • 0

Aw, why write from scratch? This is a great script and works with all emulators. :o

 

...hmm.. is it possible to attach the reset to the jobmaster

 

For example:

 

"Do you want to reborn?"

- Yes

- No

(If yes)

                mes "Congratulations, you are reborn. All previously accepted missions have been dropped.";

                "#1 "+( ( @ms_b_m_1[0] )?"^0000FF"+ getd("$ms_b_m_"+ @ms_b_m_1[0] +"$[0]"):"^000000",
                "#2 "+( ( @ms_b_m_2[0] )?"^0000FF"+ getd("$ms_b_m_"+ @ms_b_m_2[0] +"$[0]")"^000000",
                "#3 "+( ( @ms_b_m_3[0] )?"^0000FF"+ getd("$ms_b_m_"+ @ms_b_m_3[0] +"$[0]")"^000000",
                "#4 "+( ( @ms_b_m_4[0] )?"^0000FF"+ getd("$ms_b_m_"+ @ms_b_m_4[0] +"$[0]")"^000000");
                close;
 
 
obviously not the right code. idk the code for it... >.<

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.