Jump to content
  • 0

monster of the week problem


Question

Posted

I'm using this script

But when I set the monster for example to anubis while players have killed anubis BEFORE it became the week monster, the counter starts counting from there.

example: player has killed 20 anubis before it became monster of the week, when anubis became monster of week and a player kills a anubis, it'll start counting from 20, so the next kill would be 21/100. Also when the reward point is reached, this player wont get reward.

This player is now bugged forever with this monster, the counter wont reset even when weekly monster resets.

Does anyone know how to fix this please..?

10 answers to this question

Recommended Posts

Posted (edited)

Peopleperson's script is nice, but not exactly what I want. It does not give a reward and has no counter.

But I appreciate your effort for searching this! :)

Here is the script.


prontera,155,171,5 script Weekly Monster 437,{
mes "Current Weekly Monster Info :";
if ( getgmlevel() < 80 && $@WeeklyMobEvent == 0 ){
mes "There is No Weekly Monster Event now.";
close;
}
if ( $@WeeklyMobID == 0 ){
mes "^0000FFMonster^000000 : ^FF0000UNDECLARED MONSTERS^000000.";
}else{
mes "^0000FFMonster^000000 : ^FF0000"+getmonsterinfo($@WeeklyMobID,0)+"^000000.";
mes "^0000FFRequired^000000 : ^FF0000"+$@WeeklyKillAmount+"^000000 Kills.";
}
if ( $@WeeklyItemID == 0 ){
mes "^0000FFReward^000000 : ^FF0000UNDECLARED ITEMS^000000.";
}else{
mes "^0000FFReward^000000 : "+$@WeeklyAmount+" x ^FF0000"+getitemname($@WeeklyItemID)+"^000000.";
}
next;
if ( getgmlevel() < 80 ){
mes "I only serve for GM above level 80.";
close;
}else{
mes "How can i serve for you ..?";
}
next;
switch(select("CLOSE:^0000FFNEW SETTINGS^000000")) {
Case 1: 
mes "Come back when you are going to do new settings again.";
close;
Case 2:
do{
mes "Please Input the Monster ID.";
mes "^FF0000Example : 1002 = Poring^000000";
input $@WeeklyMobID,1001,32767;
next;
}
while( getmonsterinfo($@WeeklyMobID,0) == "null" );
do{
mes "Please Input Required Kills.";
mes "^FF0000Example : 100 = 100 Kills";
input $@WeeklyKillAmount,1,100000;
next;
}
while( $@WeeklyKillAmount == 0 );
do{
mes "Please Input Rewards when finished.";
mes "^FF0000Example : 909 = Jellopy";
input $@WeeklyItemID,501,32767;
next;
}
while( getitemname($@WeeklyItemID) == "null" );

do{
mes "Please Input Amount Of Rewards.";
mes "^FF0000Example : 100 = 100 each";
input $@WeeklyAmount,1,30000;
next;
} 
while( $@WeeklyAmount == 0 );
mes "New Settings has been Applied.";
close2;
set $@WeeklyMobEvent,1;
announce "[Weekly Monster] : "+$@WeeklyKillAmount+" each "+getmonsterinfo($@WeeklyMobID,0)+" ",0;
announce "[Weekly Monster Reward] : "+$@WeeklyAmount+" each "+getitemname($@WeeklyItemID)+" ",0;
end;
}

OnNPCKillEvent:
if ( $@WeeklyMobEvent != 1 || killedrid != $@WeeklyMobID ) end;
set #WeeklyKill,#WeeklyKill+1;
if ( #WeeklyKill == $@WeeklyKillAmount ){
mes "You have Finished the Weekly Monster Event.";
mes "And you have been rewarded with...";
mes "^FF0000"+$@WeeklyAmount+" each "+getitemname($@WeeklyItemID)+"^000000";
set #WeeklyKill,0;
getitem $@WeeklyItemID,$@WeeklyAmount;
close;
}else{
dispbottom "[Weekly Monster] : Killed [ "+#WeeklyKill+" / "+$@WeeklyKillAmount+" ] of [ "+getmonsterinfo($@WeeklyMobID,0)+" ]";
end;
} 

}

Edited by HristDead
Posted (edited)

You can try adding a query_sql select all #WeeklyKill to 0 before/after the line announce.

query_sql("UPDATE `global_reg_value` SET value=`0` WHERE str=`#WeeklyKill`");

Edited by darristan
Posted (edited)

it can only be countered by setting another variable, like #WeeklyKillID

example,

when a new week started and monster ID changed,

set $@WeeklyKilllID, rand(2000000000);

and do a check on player inside OnNPCKillEvent after initial if... check

if ( $@WeeklyKillID != #WeeklyKillID ) {

set #WeeklyKill, 0; set #WeeklyKillID, $@WeeklyKillID;

}

since this is Emistry's script, I believe he should be able to do something like this

Edited by AnnieRuru
Posted (edited)

your

do {
< all >
if ( getgmlevel() > x ) ....
< higher gm level >
} while ( getgmlevel() > x )

my usual method

while (1) {
< all >
if ( getgmlevel() < x ) close;
< higher gm level >
}

it seems you got yourself a sifu on your side ....

curious ... I'm still guessing who is it ... /hmm

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

nope,

OnInit:
OnSun0001:
do{
setarray .Monster[0],rand(1001,2380),100;
}while( getmonsterinfo( .Monster[0],0 ) == "null" );
set .eventID, rand(2000000000); // <-- add this
set .GMLevel,60;
end;

and change this

if( #MOBID != .Monster[0] ){
set #MOBID,.Monster[0];
set #AMOUNT,0;
}

into this

if ( #MOTW_ID != .eventID )
set #AMOUNT, 0;

get rid of the #MOBID entirely, its not needed

because the topic starter said if it somehow random back into same mob ID

<-- today .Monster[0] is Isis and tomorow .Monster[0] is Isis again

using if( #MOBID != .Monster[0] ) comparison will not work in this case

if you think there's in 1/2000000000 chances that will get same event ID

also can do it by increasing counter,

set .eventID, .eventID +1;

PS: I wonder is eventID++ works currently

Edited by AnnieRuru
  • Upvote 1
Posted (edited)

Personally, I'd use the ' set .eventID, .eventID +1; ' since it changes only once a week. Thus allowing for 2.5b+ weeks when using this method. And considering 50weeks/yr, it won't even reach its end before the server owner dies of old age, heck you can have 10,000 server owners living up to 100 years, and it'd still be growing strong lol. It's what i used in my Disguise Event NPC, and there have yet to be any issues regarding same event counters.

@OffTopic:

Welcome back Annie. I'm farily interested to see what kind of scripts you'll make using any new methods you learned / thought of in your absence.

Edited by GmOcean

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