Jump to content
  • 0

Limited Item giver NPC


Question

Posted

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

3 answers to this question

Recommended Posts

  • 0
Posted
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

Posted (edited)
//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

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