emistry mission board problem

niniyoh143

New member
Messages
5
Points
0
Emulator
Hello Ms. Cute Cute Cute Scripter @Annie
default_smile.png
Sorry to Interrupt or disturb you but I really badly need you help about this script


http://rathena.org/board/topic/91042-utility-sql-mission-board/?hl=%2Bsql+%2Bmission



The SQL Mission Board is really cool but the saddest part of it is that
the Mission Repeatable/Limit/Re-do is not working :'( I badly need those
features in a script for my Server... I hope that you can help me with
it. Thank you so much.

and again sorry to Interrupt you po..

 
Please be patient and Stop bumping your thread.

Posts in the support sections may be bumped with more information no less than 24 hours after the last post; if you have new information within less than 24h, edit your previous post.
 
@niniyoh143

don't triple post

@quesoph

Backseat moderating is discouraged. Please use the Report button (available at the bottom right of each post).
just click the report button.

.

.

Code:
 // check completed how many times.if( .@repeatable[.@i] ){query_sql( "SELECT COUNT(`id`),TIMESTAMPDIFF( HOUR,`completion`,NOW() ),DATE_ADD( `completion`, INTERVAL "+.@redo_delay+" HOUR) FROM `player_mission` WHERE `mission_id` = "+.@id[.@i]+" AND `completion` <> '0000-00-00 00:00:00'",.@mission_completed,.@diff_delay,.@day$ );if( .@repeatable[.@i] && ( ( .@mission_completed >= .@repeatable[.@i] ) || ( .@diff_delay && .@diff_delay <= .@redo_delay ) ) ){next;mes "^0055FF[ "+.@npc_name$+" ]^000000";mes " ";if( .@mission_completed >= .@repeatable[.@i] ){mes "You cant pick this mission, you have mission completion reach the max repeatable attempt of "+.@mission_completed+" times.";close;}if( .@diff_delay && .@diff_delay <= .@redo_delay ){mes "You cant pick this mission, you have mission redo delay isnt finish yet.";mes "Approximate : ^FF0000"+.@day$+"^000000";close;}}}
when I read this chunk of code, I immediately spotted 3 errors

1.

Code:
query_sql( "UPDATE `player_mission` SET `completion` = NOW() WHERE `cid` = "+getcharid(0)+" AND `mission_id` = "+.@mission_id );
as I thought

the correct way to update the missions should only update the mission that are not yet completion

but he update every rows included those has already completed

it should be update ... and completion = '000...'

2.

.@repeatable[.@i] ... that .@i isn't needed because the query_sql already did a limit 1 previously ...

and the .@i was conditioned before when listing all the quest list

so if there is more than 1 mission in the npc, this will always return 0

emistry probably test this part when he only has 1 mission in the npc .. he needs to setup more

3.

I wonder why he put both redo-delay and repeatable only with the repeatable condition ..

if admin setup the mission with only redo-delay but not repeatable, the redo-delay condition will not be read

they need to be split out in 2 different conditions ...

....

means you see it as 1 single bug

but there is actually 3 ...

this is not a simple script, I can't fix this immediately

will do this after dinner ... now I have to go out and eat

 
Last edited by a moderator:
I'm really very sorry for my desperation
default_sad.png
@quesoph & @annie


I'm really very grateful that you're helping me with my problem
default_wub.png
  it's Highly appreciated you're really the best @annie

 

 
Last edited by a moderator:
Back
Top