Jump to content

Musika6988

Members
  • Posts

    53
  • Joined

  • Last visited

Posts posted by Musika6988

  1. May kaya po bang gumawa ng ganito script?

    [Function:]

    Pagpasok ng player for the first time sa server, magpaPOP UP yung tanong na "CHOOSE YOUR LEGACY" with the Option na "BLUE PILL" or "RED PILL".

    Pag nakaPili sila, iwaWarp sila sa magkaibang Map.

    Pag BLUE PILL ang pinili niya, magkakaroon siya ng "MARK" as blue pill user.

    Pag RED PILL naman, "MARK" as red pill user.

    Kumbaga siguro pweding parang magkakaroon ng Custom Colored Aura as MARK ganun pag Red Pill user and ibang color ng Aura din sa Blue Pill user para sa looks palang maDetermine kung Red Pill user or Blue Pill user yung player / character.

    And may magkaibang callfunction sila  para pwede silang iRESTRICT or iALLOW in particular MAPS, EVENTS, etc.

     

    Salamat po in advanced! Keep safe sa ating lahat!

  2. On 5/4/2020 at 6:49 AM, Musika6988 said:

    Actually that's what I ended up using instead. Worked like a charm. Thanks so much!

    By the way, If I may add. What if I wanted it to be like,

    The setarray .i1[0] automatically gives all items on it's list, then the only part where it uses chance % is with setarray .i2[0] and setarray .i3[0]? Is that even possible?

    up

  3. 15 hours ago, Cretino said:

    Yes, but I think is better you use the second solution I showed to you, you'll never change the rand always you add new items.

    Actually that's what I ended up using instead. Worked like a charm. Thanks so much!

    By the way, If I may add. What if I wanted it to be like,

    The setarray .i1[0] automatically gives all items on it's list, then the only part where it uses chance % is with setarray .i2[0] and setarray .i3[0]? Is that even possible?

  4. 15 hours ago, Cretino said:

    Here is the problem:

      Hide contents
    
    
    	setarray .i1[0],7539,7621; // Common Items
    	set .i1rand,rand(0,2); // Randomize Common Items; just change max amount if you add items

     

    The array '.i1' size is '2', and the '.i1rand' randomize values from '0' to '2' instead of '0' to '1'... so when you trying to give the common items prize, when '.i1rand' get value the random value '2', the array '.i1[2]' has empty values because the array has declared values until 'i1[1]'.

    You can do this to fix:

      Reveal hidden contents
    
    
    set .i1rand,rand(0,1); // Randomize Common Items; just change max amount if you add items

     

    Or this:

      Reveal hidden contents
    
    
    	setarray .i1[0],7539,7621; // Common Items
    	set .i1rand,rand(getarraysize(.i1)); // Randomize Common Items; Don't need to change if you add more items. :)
    	setarray .i2[0],14003,13607,12922,12912; // Rare Items
    	set .i2rand,rand(getarraysize(.i2)); // Randomize Rare Items; Don't need to change if you add more items. :)
    	setarray .i3[0],19568,31120,31121; // Super Rare Items
    	set .i3rand,rand(getarraysize(.i3)); //Randomize Super Rare Items; Don't need to change if you add more items. :)
    	set .chance, rand(50);

     

     

    Kindly correct me if I'm wrong, so, what I understand is that if setarray .i1[0],7539,7621; (Has 2 items), then my set .i1rand,rand should be set .i1rand,rand(0,1); but if the items on setarray .i1[0] are 3 items, then my set .i1rand,rand should be set .i1rand,rand(0,2);? or it should always stay as 1?

    Thanks so much by the way for the educational reply. ?

  5. Quote

     

    function    script    specialbox    {

        setarray .i1[0],7539,7621; // Common Items
        set .i1rand,rand(0,2); // Randomize Common Items; just change max amount if you add items
        setarray .i2[0],14003,13607,12922,12912; // Rare Items
        set .i2rand,rand(0,3); // Randomize Rare Items; just change max amount if you add items
        setarray .i3[0],19568,31120,31121; // Super Rare Items
        set .i3rand,rand(0,2); //Randomize Super Rare Items; just change max amount if you add items
        set .chance, rand(50);

            // Super Rare Item 3%
            if (.chance < 10){
            getitem .i3[.i3rand],1;
            announce "["+strcharinfo(0)+"] got a ["+getitemname(.i3[.i3rand])+"] from the Lucky Egg.",0;
            end;
            } 

            // Rare Item 15%
            else if (.chance < 15){
            getitem .i2[.i2rand],1;
            announce "["+strcharinfo(0)+"] got a ["+getitemname(.i2[.i2rand])+"] from the Lucky Egg.",0;
            end;
            } 

            // Common Items
            else {
            getitem .i1[.i1rand],1;
            end; 
            }
    }

     

    Hi rAthena!

    Can I pls ask a little help with this script.

    I'm getting a "buildin_getitem: NonExistant item 0 requested"

    Thanks in advanced!

  6. 15 minutes ago, sader1992 said:
    
    -    script    LevelUpQuotes    -1,{
    
    OnInit:
        setarray .q$,"I have advanced forward!","There's no stopping me now!","Look at me go!","There's more where that came from.","This isn't even my final form!";
        .num1 = getarraysize(.q$);
        end;
    
    OnPCBaseLvUpEvent:
    	if(!(BaseLevel%10)){
    		getitem 501,10;
    		.@r = rand(.num1); showscript strcharinfo(0)+" : "+.q$[.@r];
    	}
    end;
    }

     

    Thanks so much Senpai, i'll give this a try. Sorry for the lack of info on my post.

     

    Edited:

    Worked! 100% Thanks!

  7. -    script    LevelUpQuotes    -1,{
    end;
    
    OnInit:
        setarray .q$,"I have advanced forward!","There's no stopping me now!","Look at me go!","There's more where that came from.","This isn't even my final form!";
        .num1 = getarraysize(.q$);
        setarray .maxq$,"I've made it!","I never thought I'd become this strong...","I have reached my final form.";
        .num2 = getarraysize(.maxq$);
        end;
    
    OnPCBaseLvUpEvent:
        if( BaseLevel > 20 && getstatus(SC_ITEMBOOST) == 0 ) { sc_start SC_ITEMBOOST,180000,200; }
        if( BaseLevel > 30 && getstatus(SC_ITEMBOOST) == 0 ) { sc_start SC_ITEMBOOST,180000,200; }
        if( BaseLevel > 40 && getstatus(SC_ITEMBOOST) == 0 ) { sc_start SC_ITEMBOOST,180000,200; }
        if( BaseLevel > 50 && getstatus(SC_ITEMBOOST) == 0 ) { sc_start SC_ITEMBOOST,180000,200; }
        if( BaseLevel > 60 && getstatus(SC_ITEMBOOST) == 0 ) { sc_start SC_ITEMBOOST,180000,200; }
        if( BaseLevel > 70 && getstatus(SC_ITEMBOOST) == 0 ) { sc_start SC_ITEMBOOST,180000,200; }
        if( BaseLevel > 80 && getstatus(SC_ITEMBOOST) == 0 ) { sc_start SC_ITEMBOOST,180000,200; }
        if( BaseLevel > 90 && getstatus(SC_ITEMBOOST) == 0 ) { sc_start SC_ITEMBOOST,180000,200; }
        if( BaseLevel == 99 ) { .@r = rand(.num2); showscript strcharinfo(0)+" : "+.maxq$[.@r]; }
        else { .@r = rand(.num1); showscript strcharinfo(0)+" : "+.q$[.@r]; }
        if( getstatus(SC_INCREASEAGI) != 1 ) { sc_start SC_INCREASEAGI,30000,10; }
        end;
    }

    May I please ask for an additional function of this script?

    Instead of just Item boost for every 10 level, I want it to give a particular item, for example x10 Red Potion (501)

    Thanks in advanced!

    P.S

    Crdt to the script owner.

  8. 6 hours ago, AnnieRuru said:

    you can just use *setunitdata with UMOB_DMGIMMUNE flag to make the monsters invincible, so no players can kill these monsters

    But I want them to just tame it, not kill them?

    Thanks Mam Annie for the reply.

     

    10 hours ago, Radian said:

    Im not sure about this but you can try...

    
    prontera,150,150,4	script	Pokeeeee	100,{
    	.name$ = "["+strnpcinfo(0)+"]";
    	mes .name$;
    	mes "How can I help you today?";
    	next;
    	if(select("Enter Room:Just Passing by...") == 2) close;
    		if(!countitem(30820)){
    			mes .name$;
    			mes "I'm sorry but you dont have "+getitemname(30820)+", please come back when you have it in your inventory.";
    			close;
    		}
    	mes .name$;
    	warp "poring_w01",97,97;
    	end;
    }
    -	script	Mobs	FAKE_NPC,{
    
    OnInit:
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3178,1,strnpcinfo(3)+"::OnMobKilled";
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3179,1,strnpcinfo(3)+"::OnMobKilled";
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3180,1,strnpcinfo(3)+"::OnMobKilled";
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3181,1,strnpcinfo(3)+"::OnMobKilled";
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3182,1,strnpcinfo(3)+"::OnMobKilled";
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3183,1,strnpcinfo(3)+"::OnMobKilled";
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3184,1,strnpcinfo(3)+"::OnMobKilled";
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3185,1,strnpcinfo(3)+"::OnMobKilled";
    	end;
    	
    OnMobKilled:
    	dispbottom "Ash Catchem : How dare you kill a Pokemon!!";
    	warp "invek",146,161;
    	end;
    }
    
    poring_w01	mapflag	nowarp
    poring_w01	mapflag	nowarpto
    poring_w01	mapflag	noteleport
    poring_w01	mapflag	nosave
    poring_w01	mapflag	nomemo
    poring_w01	mapflag	nobranch
    poring_w01	mapflag	noloot
    poring_w01	mapflag	noskill
    poring_w01	mapflag	nopenalty

     

    Thanks a much Mam Radian, I'll give this a try!

     

    44 minutes ago, Musika6988 said:

    Thanks a much Mam Radian, I'll give this a try!

    No errors, NPC is working fine.. It's just that, I can still kill Pokemons and not be kicked out of the room.:(

     

    I got it working now!

    Thanks @Radianand @AnnieRuru^_^

    I made it like this..

    prontera,150,150,4	script	Pokeeeee	100,{
    	.name$ = "["+strnpcinfo(0)+"]";
    	mes .name$;
    	mes "How can I help you today?";
    	next;
    	if(select("Enter Room:Just Passing by...") == 2) close;
    		if(!countitem(30820)){
    			mes .name$;
    			mes "I'm sorry but you dont have "+getitemname(30820)+", please come back when you have it in your inventory.";
    			close;
    		}
    	mes .name$;
    	warp "pvp_n_1-5",99,100;
    	end;
    }
    -	script	Mobs	FAKE_NPC,{
    
    OnNPCKillEvent:
    	if ( strcharinfo(3) == "pvp_n_1-5" ) {
    	dispbottom "Ash Catchem : How dare you kill a Pokemon!!";
    	warp "invek",146,161;
    	end;
    }
    }
    poring_w01	mapflag	nowarp
    poring_w01	mapflag	nowarpto
    poring_w01	mapflag	noteleport
    poring_w01	mapflag	nosave
    poring_w01	mapflag	nomemo
    poring_w01	mapflag	nobranch
    poring_w01	mapflag	noloot
    poring_w01	mapflag	noskill
    poring_w01	mapflag	nopenalty

     

  9. Hi guys?

    Can anyone kindly help me with this script?

    -	script	Pokemon Room	-1,{
    
    
    OnPC:
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3178,1,"pokemonkill::OnMobKilled";
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3179,1,"pokemonkill::OnMobKilled";
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3180,1,"pokemonkill::OnMobKilled";
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3181,1,"pokemonkill::OnMobKilled";
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3182,1,"pokemonkill::OnMobKilled";
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3183,1,"pokemonkill::OnMobKilled";
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3184,1,"pokemonkill::OnMobKilled";
    	areamonster "pvp_n_1-5",0,0,0,0,"Pokemon",3185,1,"pokemonkill::OnMobKilled";
    }
    
    -	script	pokemonkill	-1,{
    
    OnMobKilled:
        dispbottom "Ash Catchem : How dare you kill a Pokemon!!";
        warp "invek",146,161;
        end;
    
    }
    // -- Mapflags
    
    poring_w01	mapflag	nowarp
    poring_w01	mapflag	nowarpto
    poring_w01	mapflag	noteleport
    poring_w01	mapflag	nosave
    poring_w01	mapflag	nomemo
    poring_w01	mapflag	nobranch
    poring_w01	mapflag	noloot
    poring_w01	mapflag	noskill
    poring_w01	mapflag	nopenalty

    I want it to be like, they are only allowed to catch a Pokemon.

    If they kill it, they will be sent back to town.

    And if possible, was hoping to have like an NPC that would require a Pokeball (30820) for them to be able to enter the Pokemon Room.

    Thanks in advanced!:wub:

  10. Hi rAthena!

    Can anyone kindly share a link on a "Latest Stable Client + Clean Server Files with working Title and Achievement System" 2015 and above maybe, if there is one?

    I'm willing to pay also if necessary just send me a PM and we'll talk about the price.

    Sorry, I can't seem to make my own because I'm using a very old PC. All it can manage is adding Custom Items, Monsters, Maps, etc. But building a server from scratch, some needed programs can't be installed.

    Hope someone will hear me out.

  11. 12 hours ago, Sehrentos said:

    Thank you for this share.

    I would suggest more loot options like:

    - Reward all near the boss and not just single party.

    - Selective where leader can select what item to who.

    And maby multiple events at once, but not in same map.

    Just Awesome!:D

    • Like 1
  12. Origin:

    So my inspiration for this script is taken from "Aura Kingdom".

    If you've played that, you'll know. lol

    And.. This is a small piece of my Servers Storyline so, my full gratitude goes to Sir Sehrentos for this!:D

    Mechanics:

    Triggers automatically.

    It will announce the name of the Monster to be spawned and what map it should spawn.

    You need a party to be able to kill it.

    Once killed, a Treasure Box will spawn but only the Party Leader can open the Treasure Box and Distribute the Rewards on Randomly to every Party Members.

    The Treasure Box reward has 4 tiers to choose from and it chooses Random List of Rewards everytime it is opened.

    Once all the reward has been distributed, you'll need to wait again for the next World Boss Spawn.

    You Can:

    Set on what time the World Boss you want to spawn automatically.

    Set any mobs you want to be the World Boss just replace the Mob IDs with your Custom ones.

    Set on what map you want the World Boss to spawn. (orignally set to random map)

    Set the Item Rewards from the Treasure Box.

    Credits:

    Basically, this was my idea, but Sir Sehrentos has given all his efforts on helping me with this script, so He deserves all the credit.^_^

     

    Main Script:

    [World Boss]

    https://pastebin.com/x1SGnE3e

     

    Anti Abuse:

    Cause CHAMPS has the tendency to lure the World Boss near the healer and just Heal + Asura then they can solo the World Boss which is againt's the original purpose.

    Healer NPC is deactivated when World Boss is active in a particular map.

    https://pastebin.com/CfL3tCb4

    Healer NPC Credit goes to Master Euphy!

     

    NOTE:

    If you have any suggestions for improvement, kindly comment it down.

    • Upvote 2
    • MVP 1
    • Like 2
  13. On 2/22/2018 at 9:17 AM, Sehrentos said:

    Okay, so you put the loop in the wrong place.

    Not to worry here is the option 1:

    
    if( prompt( "Distribute Loots", "Dispose Loots" ) == 1 ){
    	//getpartymember .@party_id, 0; // name
    	getpartymember .@party_id, 1; // cid
    	getpartymember .@party_id, 2; // aid
    	// Copy the temporary party data
    	.@party_size = $@partymembercount;
    	//copyarray .@party_name$[0], $@partymembername$[0], .@party_size;
    	copyarray .@party_cid[0], $@partymembercid[0], .@party_size;
    	copyarray .@party_aid[0], $@partymemberaid[0], .@party_size;
    	
    	// Loop through each reward
    	for( .@i = 0; .@i < @size; .@i++ ){
    		next;
    		mes "^777777 ~ " + getitemname( @reward[.@i] ) + "^000000";
    		if( prompt( "Cast Loots" ) == 1 ) {
    			.@rng = rand( .@party_size );
    			// If they are not online, nothing will happen
    			if( isloggedin( .@party_aid[.@rng], .@party_cid[.@rng] ) ) {
    				//message .@party_name$[.@rng], "Gained " + getitemname( @reward[.@i] ) + " ( Distributed Randomly )";
    				.@name$ = strcharinfo(0, .@party_cid[.@rng]);
    				message .@name$, "Gained " + getitemname( @reward[.@i] ) + " ( Distributed Randomly )";
    				getitem @reward[.@i], 1, .@party_aid[.@rng];
    
    				// DEBUG <label>Cast Loots!<player>,<reward>,<AID>
    				debugmes .@label$ + " Cast Loots! player= " + .@name$ + ", reward=" + @reward[.@i] + ", aid=" + .@party_aid[.@rng];
    			}
    		}
    
    	}
    }

    And this is option 2 which im not 100% sure about:

    
    if( prompt( "Distribute Loots", "Dispose Loots" ) == 1 ){
    	//getpartymember .@party_id, 0; // name
    	getpartymember .@party_id, 1; // cid
    	getpartymember .@party_id, 2; // aid
    	// Copy the temporary party data
    	.@party_size = $@partymembercount;
    	//copyarray .@party_name$[0], $@partymembername$[0], .@party_size;
    	copyarray .@party_cid[0], $@partymembercid[0], .@party_size;
    	copyarray .@party_aid[0], $@partymemberaid[0], .@party_size;
    	
    	// Loop through each party member
    	.@psize = .@party_size;
    	for( .@i = 0; .@i < .@psize; .@i++ ) {
    		// If they are not online, remove from array
    		if( !isloggedin( .@party_aid[.@i], .@party_cid[.@i] ) ){
    			deletearray .@party_cid[.@i], 1;
    			deletearray .@party_aid[.@i], 1;
    			.@party_size--;
    		}
    	}
    
    	// Loop through each reward
    	for( .@i = 0; .@i < @size; .@i++ ){
    		next;
    		mes "^777777 ~ " + getitemname( @reward[.@i] ) + "^000000";
    		if( prompt( "Cast Loots" ) == 1 ) {
    			.@rng = rand( .@party_size );
    			// If they are not online, nothing will happen
    			if( isloggedin( .@party_aid[.@rng], .@party_cid[.@rng] ) ) {
    				//message .@party_name$[.@rng], "Gained " + getitemname( @reward[.@i] ) + " ( Distributed Randomly )";
    				.@name$ = strcharinfo(0, .@party_cid[.@rng]);
    				message .@name$, "Gained " + getitemname( @reward[.@i] ) + " ( Distributed Randomly )";
    				getitem @reward[.@i], 1, .@party_aid[.@rng];
    
    				// DEBUG <label>Cast Loots!<player>,<reward>,<AID>
    				debugmes .@label$ + " Cast Loots! player= " + .@name$ + ", reward=" + @reward[.@i] + ", aid=" + .@party_aid[.@rng];
    			}
    		}
    
    	}
    }

    Update:

    Since this thread is marked as complete.

    You can PM me about your results and we can continue there, if you need more help with this :)

    Thanks Sir Sehrentos. I'll test this and if incase still doesnt work, let's try to fix this via PM lol.. Just got back from long drive.

  14. -	script	WorldBoss	-1,{
    
    OnTalk:
    	.@party_id = getcharid(1);
    	.@map$ = strcharinfo(3);
    	.@label$ = @label$;
        
        if( getcharid(0) != getpartyleader( .@party_id,2 ) ){
            message strcharinfo(0),"You're not Party Leader.";
            monster .@map$,rand(.@x,.@x-3),rand(.@y-3,.@y),"--ja--",1324,1,.@label$;
            end;
        }else{
            mes "[Loot Distributor]";
            mes "Please ensure you distribute the Rewards. If you cancelled this, your party might not able to receive any rewards.";
            next;
            mes "Reward List :";
            for( .@i = 0; .@i < @size; .@i++ )
                mes "^777777 ~ "+getitemname( @reward[.@i] )+"^000000";
            if( prompt( "Distribute Loots","Dispose Loots" ) == 1 ){
                getpartymember .@party_id;
                getpartymember .@party_id,1;
                .@party_size = $@partymembercount;
                copyarray .@party_aid[0],$@partymemberaid[0],.@party_size;
                copyarray .@party_name$[0],$@partymembername$[0],.@party_size;
                for( .@i = 0; .@i < $@partymembercount; .@i++ ){
                    if( isloggedin( $@partymemberaid[.@i],$@partymembercid[.@i] ) )
                        .@party_name_menu$ = .@party_name_menu$ + $@partymembername$[.@i];
                    .@party_name_menu$ = .@party_name_menu$ +":";
                }
    // Loop through each party member
    .@psize = .@party_size;
    for( .@i = 0; .@i < .@psize; .@i++ ) {
                    next;
                    mes "^777777 ~ "+getitemname( @reward[.@i] )+"^000000";
                    if( prompt( "Cast Loots" ) == 1 ) {
    			.@rng = rand( .@party_size );
    			if( !isloggedin( .@party_aid[.@i], .@party_cid[.@i] ) ){
        deletearray .@party_cid[.@i], 1;
        deletearray .@party_aid[.@i], 1;
        .@party_size--;
      }
    			.@name$ = strcharinfo(0, .@party_cid[.@rng]);
    			message .@name$, "Gained " + getitemname( @reward[.@i] ) + " ( Distributed Randomly )";
    			getitem @reward[.@i], 1, .@party_aid[.@rng];
                    }
                    getitem @reward[.@i],1,.@party_aid[.@name];
                }
            }
            mes "Congratulations!";
            mapannounce .@map$,"All Rewards have been distributed.",0;
            end;
        }
    OnClock0300:
    OnClock2359:
        set .RandMap,rand( getarraysize( .Map$ ) );
        set .RandMVP,rand( getarraysize( .MVP ) );
        killmonster .Map$,"All";
        .@mins = .sleep / 60000;
        announce "[World Boss] A rift on time and space is about to be opened! A World Boss will appear in " + .@mins + " minute! Prepare your Hunting Party!", bc_all, 0xFF0000;
        sleep .sleep;
        monster .Map$[ .RandMap ],0,0,"World Boss",.MVP[ .RandMVP ],1,strnpcinfo(0)+"::OnKilled";
        announce "[World Boss] A World Boss "+getmonsterinfo( .MVP[ .RandMVP ],0 )+" appeared in "+.Map$[ .RandMap ]+" to wreck havoc!! Form a Hunting Party and stop it!!", bc_all, 0xFF0000;    end;
        end;
        
    OnKilled:
    	.@party_id = getcharid(1);
    	.@party_name$ = getpartyname(.@party_id);
    	.@leader_id = getpartyleader(.@party_id, 2);
    	.@leader_name$ = strcharinfo(0, .@leader_id);
        announce "[World Boss] The "+getpartyname(getcharid(1))+" Hunting Party lead by "+strcharinfo(0, .@leader_id)+" killed the World Boss! Congratulations!", bc_all, 0xFF0000;
        getmapxy(.@map$,.@x,.@y,0);
        monster .@map$,rand(.@x,.@x-3),rand(.@y-3,.@y),"--ja--",1324,1,.npc_name$+"::OnBoxKill";
        end;
    
    OnBoxKill:
    	deletearray @reward;
    	@label$ = .npc_name$ + "::OnBoxKill";
    	//@size = getd( ".tier_reward_"+.tier+"_size" );
    	//copyarray @reward[0],getd( ".tier_reward_"+.tier+"[0]" ),@size;
    
    	// Select random tier set from a range 0-3
    	@range = rand(0, 3);
    	@size = getd( ".tier_reward_" + @range + "_size" );
    	//@size = getarraysize(getd(".tier_reward_" + @range));
    	copyarray @reward[0], getd(".tier_reward_" + @range + "[0]"), @size;
    
    	//doevent "WorldBoss::OnTalk";
    	doevent .npc_name$ + "::OnTalk";
    	end;
    
    OnInit:
    	// tier reward
    	setarray .tier_reward_0,7227,30804,30805,30806,30000,30001;
    	setarray .tier_reward_1,7227,7227,7227,7227,7227,7227;
    	setarray .tier_reward_2,30804,30804,30804,30804,30804,30804;
    	setarray .tier_reward_3,30805,30805,30805,30805,30805,30805;
    
    	.tier_reward_0_size = getarraysize( .tier_reward_0 );
    	.tier_reward_1_size = getarraysize( .tier_reward_1 );
    	.tier_reward_2_size = getarraysize( .tier_reward_2 );
    	.tier_reward_3_size = getarraysize( .tier_reward_3 );
    	
    	setarray .Map$[0],"prontera","morocc","geffen","payon","alberta","aldebaran","xmas","comodo","yuno","amatsu","gonryun","umbala","louyang","ayothaya","eibroch","hugel","rachel","veins","moscovia";
    	setarray .MVP[0],3165,3166,3167,3169,3175,3177;
    	.sleep = 60000;		 // 60000ms = 1min
    	.npc_name$ = strnpcinfo(0);	
    	setmapflag .map$,mf_partylock;
    	setmapflag .map$,mf_nomobloot;
    	setmapflag .map$,mf_nomvploot;
    	end;
    }

    I'm using this one.. Random Tier Reward is okay, but when i try to Cast loots, this is the error i get in the console..

    [Error]: buildin_strcharinfo: Player with char id '0' is not found.

     

  15. // Loop through each party member
    .@psize = .@party_size;
    for( .@i = 0; .@i < .@psize; .@i++ ) {
      // If they are not online, remove from array
      if( !isloggedin( .@party_aid[.@i], .@party_cid[.@i] ) ){
        deletearray .@party_cid[.@i], 1;
        deletearray .@party_aid[.@i], 1;
        .@party_size--;
      }
    }

    By the way, so sorry for being Noob in scripting but, I'm not sure where to insert these lines? should I insert it after the "Cast Loot" which mean I'll insert it between those lines or should I replace the next lines after "Cast Loots" with these that you have provided?:wacko:

    Sorry..:(

  16. 18 hours ago, Sehrentos said:

    Okay, there was no online check when distributing random reward. getitem will do nothing if user is offline.

    Try this (I commented out the party_name_menu since it's not in use):

    
    OnTalk:
    	.@party_id = getcharid(1);
    	.@map$ = strcharinfo(3);
    	.@label$ = @label$;
    	
    	if( getcharid(0) != getpartyleader( .@party_id,2 ) ){
    		message strcharinfo(0), "You're not Party Leader.";
    		monster .@map$, rand(.@x,.@x-3), rand(.@y-3,.@y), "--ja--", 1324, 1, .@label$;
    		end;
    	} else {
    		mes "[Loot Distributor]";
    		mes "Please ensure you distribute the Rewards. If you cancelled this, your party might not able to receive any rewards.";
    		next;
    		mes "Reward List :";
    		for( .@i = 0; .@i < @size; .@i++ )
    			mes "^777777 ~ " + getitemname( @reward[.@i] ) + "^000000";
    		if( prompt( "Distribute Loots", "Dispose Loots" ) == 1 ){
    			//getpartymember .@party_id, 0; // name
    			getpartymember .@party_id, 1; // cid
    			getpartymember .@party_id, 2; // aid
    			// Copy the temporary party data
    			.@party_size = $@partymembercount;
    			//copyarray .@party_name$[0], $@partymembername$[0], .@party_size;
    			copyarray .@party_cid[0], $@partymembercid[0], .@party_size;
    			copyarray .@party_aid[0], $@partymemberaid[0], .@party_size;
    			
    			// Create party member menu (NOT IN USE!!)
    			//for( .@i = 0; .@i < .@party_size; .@i++ ){
    			//	if( isloggedin( .@party_aid[.@i], .@party_cid[.@i] ) )
    			//		.@party_name_menu$ = .@party_name_menu$ + .@party_name$[.@i];
    			//	.@party_name_menu$ = .@party_name_menu$ + ":";
    			//}
    
    			// Loop through each reward
    			for( .@i = 0; .@i < @size; .@i++ ){
    				next;
    				mes "^777777 ~ " + getitemname( @reward[.@i] ) + "^000000";
    				if( prompt( "Cast Loots" ) == 1 ) {
    					.@rng = rand( .@party_size );
    					// If they are not online, nothing will happen
    					if( isloggedin( .@party_aid[.@rng], .@party_cid[.@rng] ) ) {
    						//message .@party_name$[.@rng], "Gained " + getitemname( @reward[.@i] ) + " ( Distributed Randomly )";
    						.@name$ = strcharinfo(0, .@party_cid[.@rng]);
    						message .@name$, "Gained " + getitemname( @reward[.@i] ) + " ( Distributed Randomly )";
    						getitem @reward[.@i], 1, .@party_aid[.@rng];
    
    						// DEBUG <label>Cast Loots!<player>,<reward>,<AID>
    						debugmes .@label$ + " Cast Loots! player= " + .@name$ + ", reward=" + @reward[.@i] + ", aid=" + .@party_aid[.@rng];
    					}
    				}
    	
    			}
    		}
    		mes "Congratulations!";
    		mapannounce .@map$, "All Rewards have been distributed.", 0;
    		end;
    	}

    Update: Other way of avoiding offline party members is to modify the party arrays.

    Here is a quick sample how to do it (not tested):

    
    // Loop through each party member
    .@psize = .@party_size;
    for( .@i = 0; .@i < .@psize; .@i++ ) {
      // If they are not online, remove from array
      if( !isloggedin( .@party_aid[.@i], .@party_cid[.@i] ) ){
        deletearray .@party_cid[.@i], 1;
        deletearray .@party_aid[.@i], 1;
        .@party_size--;
      }
    }

    This would go after the prompt "Cast Loots".

    Okay emma give this a try. ;)

  17. I'm not really sure but..

    It's like, it has an account limit or something?

    Because the first time I used it, it's all working fine.

    But now, it doesnt give any prizes anymore.

    I'm not a good scripter or anything but..

    if( prompt( "Cast Loots" ) == 1 ){
                        .@name = rand( .@party_size );
                        message .@party_name$[.@name],"Gained 

    Do you think that part has something to do with the problem?

    It announces "Gained Angeling Coin" but you won't recieve any.

    But then it doesn't show any debug mes or even erros on the console.

    Though the Random Tier is working fine i guess?

    We just need to fix the prize distribution..

    I appreciate your help with this Sir Sehrentos!

    Thanks for lending some time to help!

×
×
  • Create New...