Jump to content

Emistry

Forum Moderator
  • Posts

    10017
  • Joined

  • Days Won

    407

Posts posted by Emistry

  1. something like this ?

    prontera,155,181,5	script	Sample	757,{
    	mes "You need 20 "+getitemname(501);
    	mes "You need "+F_InsertComma(10000000)+" Zeny";
    	if (select("Confirm", "Cancel") == 1) {
    		if (countitem(501) >= 20 && Zeny >= 10000000) {
    			delitem 501, 20;
    			Zeny -= 10000000;
    			// random assign 200 stats
    			for (.@i = 0; .@i <= 200; .@i++) {
    				.@stat = rand(bStr, bLuk);
    				.@stats[.@stat - bStr]++;
    			}
    			// 5% to get 100 stats each.
    			for (.@i = bStr; .@i <= bLuk; .@i++) {
    				if (rand(100) < 5)
    					.@stats[.@stat - bStr] = 100;
    			}
    			for (.@i = bStr; .@i <= bLuk; .@i++)
    				sc_start (SC_STRFOOD + .@i - 1), 1200000, .@stats[.@stat - bStr];
    		}
    	}
    	close;
    }

     

  2. -	script	Samepl	-1,{
    	
    	OnInit:
    		bindatcmd "test",strnpcinfo(3) + "::OnAtcommand";
    		end;
    		
    	OnAtcommand:
    		if (getmapusers(.@atcmd_parameters$[0]) != -1) {
    			message strcharinfo(0), "Map not found.";
    			
    		}
    		else if (getmapflag(.@atcmd_parameters$[0], MF_NOWARPTO) && getgmlevel() < 99) {
    			message strcharinfo(0), "You are not authorized to warp to this map.";
    		}
    		else if (getmapflag(.@atcmd_parameters$[0], MF_NOWARP) && getgmlevel() < 99) {
    			message strcharinfo(0), "You are not authorized to warp from your current map.";
    		}
    		else {
    			message strcharinfo(0), "Warped to " + .@atcmd_parameters$[0];
    			warp .@atcmd_parameters$[0], 0, 0;
    		}
    		end;
    }

    just add the mapflag MF_NOWARPTO to any map that you want prevent player to warp into those maps.

     

    or change the warp atcommand to enforce random warp

    https://github.com/rathena/rathena/blob/master/src/map/atcommand.cpp#L600

    mapindex = mapindex_name2idx(map_name, nullptr);
    x = 0;
    y = 0;

     

  3. Super Convex Mirror


    Description :

    The NPC are capable to search for MVP in the whole server or specific maps.

    Back in eAthena, there exists a script command (forgotten the name, perhaps a mobcount(...) with parameter changed) which allow us to check for specific monster id exists in the map or not, but it was removed.

    Then we could use mobcount(...) script command to get similar results, but we need to manually append an NPC event to each monster.

    Now, we could also do the same by using getunits(...)getmapunits(...) script commands.

    Of course there are pro and cons for each version, I'll just leave it to you to decide for yourself whether to use it or not.

    The origin of script came from @Brian

     

    Preview :

    ViPqqMz.jpg

     

    Settings :

    		// Enable player to warp to MVP?
    		// 0 = disabled
    		// 1 = enabled 
    		// 2 = enabled + SC_BOSSMAPINFO
    		.warp_to_mvp = 2;

    Enable this setting if you wish to allow NPC to warp into the monster map.

    		// enable this setting to fully utilize the NPC script. (use at your own risk)
    		// read more info at /conf/battle/monster.conf
    		setbattleflag("dynamic_mobs", 0);

    By default, the dynamic_mobs configuration are set to yes. This help you save some server resources if the maps aren't access by any players recently by saving the monster data into the cache.

    The downside of using dynamic_mobs, monsters are cached, NPC can't search for the monster data if they are cached. FYI, monsters that spawned by NPC scripts aren't cached.

    		// list of MVP map.
    		setarray .map$,
    			// enable this if you want it search whole server. (unable to use warp to mvp option)
    			// "all", 

    Enable this if you wish to enable to NPC to search the whole server, incase you missed what other maps have MVP (including showing mvp from restricted areas, like Guild Dungeon) 

    FYI, searching the whole server would take a longer time, use at your own risk.

     

    Notes :

    The NPC are capable to search any MVP monsters in the map, including monster summoned by Bloody Branch, or Class Change Skill (from Sage's Abracadabra), as long as the monster have MVP EXP.

     

    Why do we need this if we already have Convex Mirror Item?

    I am sure everyone has used Convex Mirror before, but there are few reason that its frustrating to use it:

    • Each convex mirror only can search current map of player.
    • Convex mirror are wasted if the map doesn't have any MVP or killed.
    • Convex mirror can't search for monster that summoned by NPC script.

    This NPC could serve as compensation for player, imagine the use case where you spend a Convex Mirror to know which MVPs are still alive instead of letting it go wasted knowing that the MVP in current map is dead or not found.

     


    • Submitter
    • Submitted
      04/24/2022
    • Category
    • Video
    • Content Author
      Brian, Emistry

     

    • Upvote 2
  4. try

    getinventorylist;
    for(.@i = @inventorylist_count - 1; .@i >= 0; .@i--) {
    	if (@inventorylist_identify[.@i])
    		continue;
    	
    	if (getiteminfo(@inventorylist_id[.@i], ITEMINFO_LOCATIONS) != EQP_ARMOR)
    		continue;
    	
    	deletearray .@opt;
    	deletearray .@val;
    	deletearray .@indx;
    	
    	// first enchant
    	if (rand(100) < 30) {
    		.@indx[0] = 0;
    		.@opt[0], F_rand(3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
    		if (.@opt[0] == 9 || .@opt[0] == 10)
    			.@val[0] = rand(3, 7);
    		else if(.@opt[0] == 11 || .@opt[0] == 12)
    			.@val[0] = rand(1, 20);
    		else 
    			.@val[0] = rand(1, 4);
    	}
    	
    	// second enchant
    	if (rand(100) < 30) {
    		.@indx[1] = 1;
    		.@opt[1], F_rand(3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
    		if (.@opt[1] == 9 || .@opt[1] == 10)
    			.@val[1] = rand(3, 7);
    		else if(.@opt[1] == 11 || .@opt[1] == 12)
    			.@val[1] = rand(1, 20);
    		else 
    			.@val[1] = rand(1, 4);
    	}
    	
    	delitemidx @inventorylist_idx[.@i];
    	getitem3 @inventorylist_id[.@i], 1, 1, 0, 0, 0, 0, 0, 0, .@opt, .@val, .@indx;
    }

     

  5. prontera,181,157,0	warp	prace_warp_portal	1,1,p_track01,52,41
    OnClock2100:
    	//if( gettime(3)%2 ) end;
    	set .access_Prace, 1;
    	announce "Poring Race is now open!",0,0xFFAB54;
    	setnpctimer 100000,"Bidder#prace0";
    	startnpctimer "Bidder#prace0";
    
    	enablenpc "prace_warp_portal";		// <--- ADD THESE
    	sleep 60000;                            // <--- ADD THESE
    	disablenpc "prace_warp_portal";         // <--- ADD THESE
    	end;

    and also

    OnInit:
    	disablenpc "prace_warp_portal";         // <--- ADD THESE
    	end;

     

    • Love 1
  6. your value shouldn't exceed 

    NPC_RANGE3_END
    JT_NEW_NPC_3RD_END = 19999,
    JT_gprecruit = 20100,
    NPC_RANGE3_END, // Officia: JT_NEW_NPC_3RD_END=20101

    now you have set the NPC ID at 20100, and you have 100 free slot in front  to cater official server adding more NPC in future.

    its not recommend to jump to a high number since it wasting your server memory

     

    or ... just adjust this if you are confident.

    //Checks if a given id is a valid npc id. [Skotlex]
    //Since new npcs are added all the time, the max valid value is the one before the first mob (Scorpion = 1001)
    #define npcdb_checkid(id) ( ( (id) > NPC_RANGE1_START && (id) < NPC_RANGE1_END ) || (id) == JT_HIDDEN_WARP_NPC || ( (id) > NPC_RANGE2_START && (id) < NPC_RANGE2_END ) || (id) == JT_INVISIBLE || ( (id) > NPC_RANGE3_START && (id) < NPC_RANGE3_END ) || ( (id) >= 30000 && (id) <= 31000))

    then you can use id between 30000 ~ 31000.

×
×
  • Create New...