Jump to content
  • 0

Limited Item giver NPC


Erba

Question


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

Hello Rathena,

 

can someone help me how to script this kind of event?

 

This is my idea..

 

The NPC will only give specified items to first 50 players who will be able to talk to it, then once this npc is able to give items to 50 players the NPC will tell players this chat "YOURE TOO LATE SORRY the first 50Players already claimedthe items".

Announce every name who claimed the item and their IP address ( if possible )

NPC will Announce that all those first 50 players were able to gain the items.

One account claim only..

 

Thank youuuuuu


bump


bumpplease

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  52
  • Reputation:   3
  • Joined:  04/23/17
  • Last Seen:  

On 7/26/2014 at 1:37 PM, Normynator said:

//Script by Normynator v1.1
prontera,140,180,5    script    Item    80,{
function EndEvent;
    if(getgmlevel() >= 99){
        .@s = select("Start:Stop:Chancel");
        if(.@s == 1){
            mes "Start";
            set $giveaway, 0;
            announce "Give away has just started!!", 0;
            close;
        }else if(.@s == 2){
            mes "Stop";
            set $giveaway, 50;
            EndEvent;
            close;
        }else{
            close;
        }
    }
    if($giveaway == 50){
        mes "All items are gone!";
        close;
    }else{
        set .@left, 50 - $giveaway;
        mes "Hi";
        mes .@left + " Items left.";
        //mes $giveaway;
        if (#AlreadyGot){
            mes "You already got your item.";
            close;
        }
        set #AlreadyGot, 1;
        mes "An Apple for you";
        getitem 512, 1;
        set $giveaway, $giveaway + 1;
        if($giveaway == 50){
            EndEvent;
        }
        close;
    }
EndEvent:
        announce "Give away has just ended!!", 0;
        query_sql "DELETE FROM `rathena`.`global_reg_value` WHERE `str`='#AlreadyGot'";
    end;
}

Hope it works :)

Its not working

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  7
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   199
  • Joined:  05/03/13
  • Last Seen:  

//Script by Normynator v1.1
prontera,140,180,5    script    Item    80,{
function EndEvent;
    if(getgmlevel() >= 99){
        .@s = select("Start:Stop:Chancel");
        if(.@s == 1){
            mes "Start";
            set $giveaway, 0;
            announce "Give away has just started!!", 0;
            close;
        }else if(.@s == 2){
            mes "Stop";
            set $giveaway, 50;
            EndEvent;
            close;
        }else{
            close;
        }
    }
    if($giveaway == 50){
        mes "All items are gone!";
        close;
    }else{
        set .@left, 50 - $giveaway;
        mes "Hi";
        mes .@left + " Items left.";
        //mes $giveaway;
        if (#AlreadyGot){
            mes "You already got your item.";
            close;
        }
        set #AlreadyGot, 1;
        mes "An Apple for you";
        getitem 512, 1;
        set $giveaway, $giveaway + 1;
        if($giveaway == 50){
            EndEvent;
        }
        close;
    }
EndEvent:
        announce "Give away has just ended!!", 0;
        query_sql "DELETE FROM `rathena`.`global_reg_value` WHERE `str`='#AlreadyGot'";
    end;
}

Hope it works :)

Edited by Normynator
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  84
  • Topics Per Day:  0.02
  • Content Count:  550
  • Reputation:   9
  • Joined:  11/06/12
  • Last Seen:  

thank you for this one sir.. will try it later! thanks!

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