Jump to content

Schrwaizer

Members
  • Posts

    43
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Schrwaizer

  1. Basically:

    -	scrip	PmThisScript	-1,{
    OnWhisperGlobal:
    if(getgroupid != 99) end;
    if(!@whispervar0$)
    {
    	dispbottom "Be sure to tell me the ID of the item you want to prize all the online characters.";
    	dispbottom "[PM to npc:PmThisScript] : <item_id>#<item_quantity>";
    	dispbottom "Example:";
    	dispbottom "npc:PmThisScript | 999#10";
    	dispbottom "This will give 10 "+getitemname(999)+" to all online characters.";
    	end;
    }
    if( ! (.@give_this_id = atoi(@whispervar0$)) || ! (.@at_this_quantity = atoi(@whispervar1$) || ! getitemname(.@give_this_id) )
    {
    	dispbottom "The given ID couldn't be processed.";
    	dispbottom "Be sure to use only numeric values and checked item IDs.";
    	end;
    }
    
    .@return_to = getcharid(3);
    
    // After-checking, let's do the dirty job!
    query_sql("SELECT `account_id` FROM `login` DESC LIMIT 0,1", .@num);
    for( .@i = 2000000; .@i < .@num[0]; .@i++)
    {
    	if( isloggedin(.@i) )
    	{
    	attachrid(.@i);
    	getitem .@give_this_id, .@at_this_quantity;
    	}
    }
    
    if( ! attachrid(.@return_to) )
    {
    	debugmes "The Administrator couldn't be contacted through the ACCOUNT_ID["+.@return_to+"]!";
    	end;
    }
    dispbottom .@at_this_quantity+" "+getitemname(.@give_this_id)+" had been successfully given to all online characters!";
    end;
    I hadn't tested it, be sure to tell me if it doesn't work or if you want a modification on it.

    @Edit:

    Script fixed accordingly @@Capuche loop-warning. Thank him!

    Also removed unnecessary detachrid, as the rid is automatically detached with a new instance of the attachrid command.

    -- yet not tested --

  2. If you want it to be triggered when the player log in a map, use this:

    - /tab/ script /tab/ item_checker /tab/ -1,{
    OnPcLoadMapEvent:
    if(strcharinfo(3) == "prontera" && countitem(7227) )
    {
    	warp "Save",0,0;
    }
    end;
    }
    prontera /tab/ mapflag /tab/ loadevent
    
    You can just replace "common npc header" with your npc header, it has anything special on it. :P

    Also, if you will still use the previous script, remove the "!" before "countitem"... it shouldn't be there.

    Ask me if it don't work. :)

  3. common npc header,{
    set .@your_item_id, <here>;
    set .@your_item_qt, <here>;
    if(!countitem(.@your_item_id))
    {
        getitem .@your_item_id, .@your_item_qt;
    }
    end;
    }
     

    This will work, but if the player stores the item, it can get more. If you want to change this, tell me.

  4. prontera,156,172,1    script    portal1    45,2,2,{
       switch ( rand(3) ) {
           default: getitem 606,10; break;
           case 1: getitem 608,20; break;
           case 2: getitem 607,20;
       }
       warp "Save", 0,0;
       end;
    }

    no need OnTouch, if the npc already has 2,2 ... defined the radius, it automatically trigger as it is having an OnTouch

    I guess it needs Ontouch... because if the players clicks the portal, the effects will trigger. x_x

    I don't think that it is the point of a portal anw, just for semantic reasons.

    So, you can just add this to Annie's awesome script:

    prontera,156,172,1    script    portal1    45,2,2,{
       end; // Do nothing when the player clicks
       OnTouch: // Execute script when the player approaches
       switch ( rand(3) ) {
           default: getitem 606,10; break;
           case 1: getitem 608,20; break;
           case 2: getitem 607,20;
       }
       warp "Save", 0,0;
       end;
    }

    @edit: fixed typo at my bbcode

  5. Have you asked him the result the dice emoticon displayed? I've tested this script with some friends couple WoEs and it turned out to be flawless. /swt

    @edit:

    Oh, sorry! It's really permitting only one chance, I completely forgot this!

    Change the following parts in the script:

    This:

    	mes .@n$+"\rLet's roll!";
    close2;
    sleep2 1000;
    set @rdice, rand(1,6);
    setarray .@dicemots[1],58,59,60,61,62,63;
    emotion .@dicemots[@rdice];
    sleep2 2000;
    mes .@n$+"\rHere it is!";
    getitem .@id,@rdice;
    set .hasget, 1;
    close;
    

    Into this:

    	mes .@n$+"\rLet's roll!";
    close2;
    sleep2 1000;
    set @rdice, rand(1,6);
    setarray .@dicemots[1],58,59,60,61,62,63;
    emotion .@dicemots[@rdice];
    sleep2 2000;
       getitem .@id,@rdice;
       set .hasget, 1;
       mes .@n$+"\rHere it is!\rLet's roll once again!";
       close2;
       set @rdice, rand(1,6);
       sleep2 1000;
    mes .@n$+"\rHere it is!";
    getitem .@id,@rdice;
    set .hasget, 2;
    close;

    • Upvote 1
  6. Here it is!

    prontera,150,150,6	script	WoE Prize	403,{
    set .@n$,   "[WoE Prize]";					   // NPC name
    set .@id,   13825;							   // Prize ID
    set .@gid,  getcharid(2);						// Character's GuildID
    set .@gnm$, strcharinfo(2);					  // Character's GuildNAME
    set .@gld$, getguildmaster(.@gid);			   // Character's GuildMasterName
    set .@gcas, getcastledata("your castle here",1); // ID of the guild castle owner
    	if( .hasget )
    	{
    		mes .@n$+"\rThe prize has already been taken!";
    		close;
    	}
    	if( .@gcas != .@gid )
    	{
    		mes .@n$+"\rYour guild isn't this castle owner!";
    		next;
    		mes .@n$+"\rOnly the Guildmaster of this castle owner guild can have access to the prize!";
    		close;
    	}
    	if( strcharinfo(0) != .@gld$ )
    	{
    		mes .@n$+"\rYou're not the "+.@gnm$+"'s Guildmaster.";
    		next;
    		mes .@n$+"\rOnly the Guild Master have access to the Prize!";
    		close;
    	}
    mes .@n$+"\rHello, "+.@gnm$+" Guildmaster!";
    mes "I'm the WoE Prizer NPC, it looks like that you haver won this last WoE, huh!";
    next;
    mes .@n$+"\rAs the owner of this castle, you have the bonification of getting a prize.";
    next;
    mes .@n$+"\rI'll do you a sortition with /dice...";
    next;
    mes .@n$+"\rDon't be afraid, you don't have one-to-six chance to win!";
    next;
    mes .@n$+"\rYou will be rewarded wherever result comes out, the dice is just to define the quantity of it!";
    next;
    mes .@n$+"\rMay I start, then?";
    next;
    mes .@n$+"\rLet's roll!";
    close2;
    sleep2 1000;
    set @rdice, rand(1,6);
    setarray .@dicemots[1],58,59,60,61,62,63;
    emotion .@dicemots[@rdice];
    sleep2 2000;
    mes .@n$+"\rHere it is!";
    getitem .@id,@rdice;
    set .hasget, 1;
    close;
    
    
    OnAgitEnd:
    enablenpc strnpcinfo(3);
    end;
    
    OnAgitStart:
    OnInit:
    disablenpc strnpcinfo(3);
    set .hasget, 0;
    end;
    }

    I apologize my lateness, yesterday was reveillon party. :P

    If there's any error with the script, call me. Don't forget to change it's coordinates and "your castle here" (I used prtg_cas03 to test it).

    • Upvote 1
×
×
  • Create New...