Jump to content
  • 0

Reward NPC


wisekreker

Question


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   1
  • Joined:  01/01/12
  • Last Seen:  

Hello,

My server is currently in BETA and I am giving freebies to the first 100 account that has lvl 99 or anyone that have rebirthed.

I was wondering maybe this is possible;

I'd like to request an NPC that automatically rewards the items I set as freebies to those lvl 99 and beyond but only acknowledges 1 account, if the account has 4 qualified characters an account can only get those freebies once, via any character in that account.

Here's a script overview:

1. User can config the item IDs of the rewards max of 10 items

2. Player talks to the npc, if account if account/character is qualified, NPC says "congratulations" and gives option to claim items now or later.

3. Player talks to npc, if the account/character doesn't qualify, NPC says "sorry no don't qualify".

I hope this is possbile. Thank you very very very much. God bless all.

Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

try this

prontera,155,181,4 script Sample 757,{
if( !#Freebies && $Freebies < 100 ){
for( set .@i,0; .@i < getarraysize( .Items ) - 1; set .@i,.@i + 2 )
 getitem .Items[.@i],.Items[.@i + 1];
mes "Congratulations.";
set #Freebies,1;
set $Freebies,$Freebies + 1;
}else{
mes "You cant take this anymore....";
}
close;

OnInit:
setarray .Items,607,1,608,2,501,3,515,4;
end;
}

Edit : Fixed some Bug and missing lines

Edited by Emistry
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   1
  • Joined:  01/01/12
  • Last Seen:  

Thanks very much Emistry, I have a question about this script. Does it qualify a level 1 character but already reborned? Thanks! /ok

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  658
  • Reputation:   57
  • Joined:  11/20/11
  • Last Seen:  

try this

prontera,155,181,4 script Sample 757,{
if( !#Freebies && $Freebies < 100 ){
for( set .@i,0; .@i < getarraysize( .Items ) - 1; set .@i,.@i + 1 )
 getitem .Items[.@i],.Items[.@i + 1];
mes "Congratulations.";
set #Freebies,1;
set $Freebies,$Freebies + 1;
}else{
mes "You cant take this anymore....";
}
close;
}

This script allows the Players to get the items if they talk to the NPC,you could add a baselevel requirement like this:

prontera,155,181,4 script Sample 757,{
if(Baselevel < 99) goto OnFree;
OnFree:
if( !#Freebies && $Freebies < 100 ){
for( set .@i,0; .@i < getarraysize( .Items ) - 1; set .@i,.@i + 1 )
 getitem .Items[.@i],.Items[.@i + 1];
mes "Congratulations.";
set #Freebies,1;
set $Freebies,$Freebies + 1;
}else{
mes "You cant take this anymore....";
}
close;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   1
  • Joined:  01/01/12
  • Last Seen:  

Rikimaru,

Thank you for this, would it be possible if we add a condition to qualify those players that have the been rebirthed too? Like a lvl 1 Novice High or any Rebirthed lower than lvl 99? and would it also be possible to add a condition that will only allow 1 character per account? Example: Even if an account has multiple qualified character, once the first character claimed the rewards, the other characters cannot get the rewards anymore.

Outline:

NPC:

GM: has a control panel option to assign/remove items to be rewarded. (only if this is not too much to ask)

Players:

1. A player talks to the NPC, NPC detects if the Character is above lvl 99 or rebirthed. If YES, the npc will give the reward. if NOT, the npc will say "I'm sorry you do not qualify to get the rewards." and will give close botton.

2. The character also remember the account ID or if possible IP address, if a character on the same account/IP already claimed the rewards before, the NPC will say "Sorry, you can only get rewards once." and give a close botton.

Thank you so much in advance.

Bumpin. Thanks.

Anyone can still help me? ^^ Thanks very much. Bump.

Link to comment
Share on other sites


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

First:

@Rikimaru:

if(BaseLevel < 99) goto OnFree;

OnFree:

What kind of nonsense is that?

Shouldn't the "goto OnFree;" be an "end;"?

And why creating an unnecesarry label?

Result:

if(BaseLevel < 99) end;

Or you could do:

if(BaseLevel < 99) goto OnDeny;
~ Level Requirement Pass - Code ~

OnDeny:
mes "You don't have the required level for an freebie.";
mes "Come back when you reached it - Base Level 99!";
close;

Please don't take that as an insult please, was just stating that mistake :(.

@TS:

About 2.:

"#variable" is already an permanent account bound variable.

That means it will be used for the whole account.

As for the IP Check:

That would require SQL and also there is the problem of dynamical IP's, which changes after each router restart (I think, I have a fixxed IP so I can't say for sure)

Regards,

Chris

Note: I already got a nice script on my notepad++, just have to test :), with some configs easily changeable :P.[/advertize]

Edited by llchrisll
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   1
  • Joined:  01/01/12
  • Last Seen:  

Thanks very much Chris!! You're awesome! :) Yeah let's just stick with the per account thing, I did not thought about the dynamic IPs which most of the players are on dynamic. Per account would be enough. Thank you very much Chris and Rikimaru and Emistry.

Thank you Thank you Thank YOu. :(

Rod

Link to comment
Share on other sites


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

Here is the script I made, I tested it and it worked.

Pastebin.com

But as far as I know my scripting skills, there can always be some bugs left.

In case you find some, please drop me an PM :P.

Regards,

Chris

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  13
  • Topics Per Day:  0.00
  • Content Count:  44
  • Reputation:   1
  • Joined:  01/01/12
  • Last Seen:  

Here is the script I made, I tested it and it worked. Pastebin.com But as far as I know my scripting skills, there can always be some bugs left. In case you find some, please drop me an PM :P. Regards, Chris

Chris,

You rock! :P Thanks for this. I'll go ahead and deploy this now.. Thank you very very much. :)

Regards,

Rod

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  25
  • Reputation:   1
  • Joined:  02/02/12
  • Last Seen:  

possible te re-up at pastebin agian?

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