Jump to content
  • 0

[SOLVED] Global Quest Variable


JeffShadow90

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   0
  • Joined:  11/26/11
  • Last Seen:  

Hi.

I need to change the fact that when I compleate the quest the dungeon allow all the account and not only the player character

dabbey3:
if(checkquest(abbey2)==-1){
mes "[Warper]";
mes "To gain access to the MVP level you have to bring me ^FF3300250 Torn Magic Book^000000, then you'll be able to enter as many time as you like.";
announce "New Quest: Abbey Lv 3 MvP",bc_blue|bc_self;
setquest abbey2;
close2;
cutin "fly_trock",255;
end;
}
else if(checkquest(abbey2)==1){
if(countitem(7117)<250){
mes "[Warper]";
mes "Bring me ^FF3300250 Torn Magic Book^000000, then you'll be able to enter as many time as you like.";
close2;
cutin "fly_trock",255;
end;
}else{
mes "[Warper]";
mes "excellent, you have all the objects, now you can warp as many time as you like.";
delitem 7117,250;
announce "Quest Completed: Abbey Lv 3 MvP",bc_blue|bc_self;
completequest abbey2;
close2;
set lastmap$,"abbey03";
set lastx,120;
set lasty,10;
warp "abbey03.gat",120,10;
end;
}}else if(checkquest(abbey2)==2){
set lastmap$,"abbey03";
set lastx,120;
set lasty,10;
warp "abbey03.gat",120,10;
end;
}else if(checkquest(abbey2)==0){
mes "[Warper]";
mes "The quest has not been activated.";
cutin "fly_trock",255;
close;
end;
}

cutin "fly_trock",255;
}

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

if (checkquest(abbey2) == -1) {

Quest variables are character-based.

If you want the quest to be per-account, you'll have to use a permanent account variable instead.

For example, when the finish the quest do:

set #abbey2, 1;

and to check if they have completed the quest (on any char on their account):

if (#abbey2 == 1) {

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Just one thing about the Questlog System o.o,

I thought that only the ID which are added in the db/quest_db.txt can be used...

I mean JeffShadow90 uses "if(checkquest(abbey02)" etc, does that also work o.o?

Regards,

Chris

Edited by llchrisll
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Correct, checkquest() takes an integer argument, the quest_id.

So in JeffShadow90's script it would have only worked if the permanent

char variable 'abbey2' was set to the quest_id.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  626
  • Reputation:   188
  • Joined:  11/19/11
  • Last Seen:  

Correct, checkquest() takes an integer argument, the quest_id.

So in JeffShadow90's script it would have only worked if the permanent

char variable 'abbey2' was set to the quest_id.

If you explain it like that it's logic ...., my stupid brain didn't wanted to think logically o.o.

Thanks for the info Brian :).

Regards,

Chris

  • Upvote 1
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
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.

×
×
  • Create New...