Jump to content

Emistry

Forum Moderator
  • Posts

    9,746
  • Joined

  • Days Won

    305

Posts posted by Emistry

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

  2. you can also try something like this.

    -	script	atcmd_example	-1,{
    OnInit:
    	bindatcmd "start", strnpcinfo(3) + "::OnAtcommand", 99;
    	end;
    	
    OnAtcommand:
    	if (.running) {
    		dispbottom "event currently running at '"+.map$+"' by '"+.gm_name$+"'.";
    		end;
    	}
    	
    	[email protected] = getmapusers(strcharinfo(3));
    	if ([email protected] < 0) {
    		dispbottom "invalid map '"+.map$+"', event stopped.";
    	}
    	else if ([email protected] <= 2) {
    		dispbottom "this map lack of user to start event, required at least another 2 users (excluding yourself).";
    	}
    	else {
    		deletearray .player_aid_pool;
    		.player_aid_pool_size = 0;
    		
    		.running = 1;
    		.current_round = 0;
    		.map$ = strcharinfo(3);
    		.gm_name$ = strcharinfo(0);
    		initnpctimer;
    		
    		dispbottom "event started at '"+.map$+"' by '"+.gm_name$+"'. ";
    		mapannounce .map$, "event started at '"+.map$+"' by '"+.gm_name$+"'.", bc_all;
    		
    		if (getmapflag(.map$, MF_LOADEVENT))
    			setmapflag(.map$, MF_LOADEVENT);
    			
    		mapwarp .map$, .map$, 0, 0;
    	}
    	end;
    	
    OnPCLoadMapEvent:
    	if (.running && !getgmlevel()) {
    		.player_aid_pool[.player_aid_pool_size] = getcharid(3);
    		.player_aid_pool_size++;
    		dispbottom "You are registered as "+.player_aid_pool_size+"th in this event.";
    	}
    	end;
    	
    OnTimer10000:
    	if (!.running) {
    		stopnpctimer;
    		end;
    	}
    	
    	.current_round++;
    	if (.player_aid_pool_size <= 0) {
    		mapannounce .map$, "Round "+.current_round+": no more player, event stopped...", bc_map;
    		donpcevent strnpcinfo(3)+"::OnStop";
    	}
    	else if (.player_aid_pool_size <= 1) {
    		mapannounce .map$, "Round "+.current_round+": we have a winner "[email protected]_name$+"!", bc_map;
    		donpcevent strnpcinfo(3)+"::OnStop";
    	}
    	else {
    		[email protected] = rand(.player_aid_pool_size);
    		mapannounce .map$, "Round "+.current_round+": we killed "+rid2name(.player_aid_pool[[email protected]])+" out of "+.player_aid_pool_size+" players in this map.", bc_map;
    		unitkill .player_aid_pool[[email protected]];
    		specialeffect2 EF_GROUND_EXPLOSION, AREA, [email protected]_name$[[email protected]];
    		initnpctimer;
    		deletearray .player_aid_pool[[email protected]], 1;
    		.player_aid_pool_size--;
    	}
    	end;
    	
    OnStop:
    	stopnpctimer;
    	.running = 0;
    	.current_round = 0;
    	.map$ = "";
    	.gm_name$ = "";
    	deletearray .player_aid_pool;
    	.player_aid_pool_size = 0;
    	if (getmapflag(.map$, MF_LOADEVENT))
    		removemapflag(.map$, MF_LOADEVENT);
    	end:
    }

     

    • Love 1
  3. a simplified version.

    -	script	gm_is_online	-1,{
    
    OnPCLoginEvent:
    	[email protected]_level = getgmlevel();
    	
    	if ([email protected]_level == 99)
    		callsub(L_GM, "Admin");
    	else if ([email protected]_level >= 90)
    		callsub(L_GM, "Co-Admin");
    	else if ([email protected]_level >= 10)
    		callsub(L_GM, "Head GM");
    	else if ([email protected]_level >= 4)
    		callsub(L_GM, "Event GM");
    	else if ([email protected]_level >= 3)
    		callsub(L_GM, "Support GM");
    	else if ([email protected]_level >= 2)
    		callsub(L_GM, "Helper GM");
    	
    	if (readparam(bStr) > 99 || readparam(bAgi) > 99 || readparam(bVit) > 99 || readparam(bInt) > 99 || readparam(Dex) > 99 || readparam(bLuk) > 99){
    		mes "[^FF0000Anti Cheat System^000000]";
    		mes "We have detected you having stats over the limit. You will be disconnected shortly. If this is an error please contact the Game Master immediately.";
    		setpcblock PCBLOCK_ALL, true;
    		close2;
    		atcommand "@kick "+strcharinfo(0);
    		end;
    	}
    	end;
    	
    	L_GM:
    		atcommand "@speed 1";
    		announce "[ "+getarg(0)+" ] "+strcharinfo(0)+" is online",bc_all,0x00ff66;
    		specialeffect2 377;
    		specialeffect2 381;
    		end;
    		
    }

     

  4. -	script	sample	-1,{
    	OnInit:
    		setarray .map$, "prontera", "izlude";
    		.map_size = getarraysize(.map$);
    		end;
    		
    	OnHour00:
    		for ([email protected] = 0; [email protected] < .map_size; [email protected]++) {
    			[email protected] = instance_list(.map$[[email protected]]);
    			for ([email protected] = 0; [email protected] < [email protected]; [email protected]++) {
    				instance_announce [email protected]_list[[email protected]], "<SYSTEM> Instance are destroyed upon reached 12AM everyday.", bc_map;
    				instance_destroy [email protected]_list[[email protected]]);
    			}
    		}
    		end;
    }

    required the Pull: 5112 mentioned above.

    • Love 1
  5. something like this

    -	script	atcmd_example	-1,{
    OnInit:
    	bindatcmd "start", strnpcinfo(3) + "::OnAtcommand", 99;
    	end;
    	
    OnAtcommand:
    	if (.running) {
    		dispbottom "event currently running at '"+.map$+"' by '"+.gm_name$+"'.";
    		end;
    	}
    	
    	[email protected] = getmapusers(strcharinfo(3));
    	if ([email protected] < 0) {
    		dispbottom "invalid map '"+.map$+"', event stopped.";
    	}
    	else if ([email protected] <= 2) {
    		dispbottom "this map lack of user to start event, required at least another 2 users (excluding yourself).";
    	}
    	else {
    		.running = 1;
    		.current_round = 0;
    		.map$ = strcharinfo(3);
    		.gm_name$ = strcharinfo(0);
    		initnpctimer;
    		dispbottom "event started at '"+.map$+"' by '"+.gm_name$+"'.";
    		mapannounce .map$, "event started at '"+.map$+"' by '"+.gm_name$+"'.", bc_map;
    	}
    	end;
    	
    OnTimer10000:
    	if (!.running) {
    		stopnpctimer;
    		end;
    	}
    	[email protected]_count = getmapunits(BL_PC, .map$, [email protected]_name$);
    	[email protected]_index = inarray([email protected]_name$, .gm_name$);
    	if ([email protected]_index != -1) {
    		// offset GM himself
    		deletearray [email protected]_name$[[email protected]], 1;
    		[email protected]_count--;
    	}
    	.current_round++;
    	if ([email protected]_count <= 0) {
    		mapannounce .map$, "Round "+.current_round+": no more player, event stopped...", bc_map;
    		donpcevent strnpcinfo(3)+"::OnStop";
    	}
    	else if ([email protected]_count <= 1) {
    		mapannounce .map$, "Round "+.current_round+": we have a winner "[email protected]_name$+"!", bc_map;
    		donpcevent strnpcinfo(3)+"::OnStop";
    	}
    	else {
    		[email protected] = rand([email protected]_count);
    		mapannounce .map$, "Round "+.current_round+": we killed "[email protected]_name$[[email protected]]+" out of "[email protected]_count+" players in this map.", bc_map;
    		unitkill convertpcinfo([email protected]_name$[[email protected]], CPC_ACCOUNT);
    		specialeffect2 EF_GROUND_EXPLOSION, AREA, [email protected]_name$[[email protected]];
    		initnpctimer;
    	}
    	end;
    	
    OnStop:
    	stopnpctimer;
    	.running = 0;
    	.current_round = 0;
    	.map$ = "";
    	.gm_name$ = "";
    	end:
    }

     

    • Love 1
  6. implement the cell_pvp source mod, then set the area to be PVP area.

    Search the forum for cell_pvp source mod, probably you have to update it to be compatible with your hosted version.

  7. On 9/16/2021 at 7:30 AM, Eross said:

    How about making it up to max 5 mob id ???

    -	script	atcmd_example	-1,{
    OnInit:
    	.max_slot = 5;
    	bindatcmd "killcount", strnpcinfo(3) + "::OnAtcommand";
    	end;
    	
    OnAtcommand:
    	if (compare([email protected]_parameters$[0], "reset")) {
    		if ([email protected]_parameters$[1] == "all") {
    			for ([email protected] = 0; [email protected] < .max_slot; [email protected]++)
    				dispbottom [email protected]_command$+" removed "+getmonsterinfo(#killcount_mob_id[[email protected]], MOB_NAME)+" from slot "[email protected]+" successfully.";
    			deletearray #killcount_mob_id;
    			deletearray #killcount_amount;
    		}
    		else if ([email protected]_parameters$[1] != "") {
    			[email protected] = atoi([email protected]_parameters$[1]);
    			if ([email protected] < 0 || [email protected] >= .max_slot) {
    				dispbottom [email protected]_command$+" invalid slot #"[email protected]+" (min = 0, max = "+.max_slot+").";
    				end;
    			}
    		}
    		else {
    			dispbottom [email protected]_command$+" removed "+getmonsterinfo(#killcount_mob_id[[email protected]], MOB_NAME)+" from slot "[email protected]+" successfully.";
    			#killcount_mob_id[[email protected]] = 0;
    			#killcount_amount[[email protected]] = 0;
    		}
    		#killcount_mob_id$ = "#";
    		for ([email protected] = 0; [email protected] < .max_slot; [email protected]++)
    			#killcount_mob_id$ = #killcount_mob_id$ + #killcount_mob_id[[email protected]] + "#";
    	}
    	else if (getmonsterinfo(atoi([email protected]_parameters$[0]), MOB_NAME) != "null") {
    		[email protected]_mob_id = atoi([email protected]_parameters$[0]);
    		if ([email protected]_parameters$[1] != "") {
    			[email protected] = atoi([email protected]_parameters$[1]);
    			if ([email protected] < 0 || [email protected] >= .max_slot) {
    				dispbottom [email protected]_command$+" invalid slot #"[email protected]+" (min = 0, max = "+.max_slot+").";
    				end;
    			}
    		}
    		
    		[email protected]_index = inarray(#killcount_mob_id, [email protected]_mob_id);
    		if ([email protected]_index != -1) {
    			dispbottom [email protected]_command$+" already registerd "+getmonsterinfo(#killcount_mob_id[[email protected]_index], MOB_NAME)+" at slot "[email protected]_index+" with current "+F_InsertComma(#killcount_amount[[email protected]])+" kills.";
    			end;
    		}
    		
    		if ([email protected]_mob_id != #killcount_mob_id) {
    			#killcount_mob_id[[email protected]] = [email protected]_mob_id;
    			#killcount_amount[[email protected]] = 0;
    			dispbottom [email protected]_command$+" registered "+getmonsterinfo(#killcount_mob_id[[email protected]], MOB_NAME)+" at slot "[email protected]_index+", will start counting.";
    		}
    		#killcount_mob_id$ = "#";
    		for ([email protected] = 0; [email protected] < .max_slot; [email protected]++)
    			#killcount_mob_id$ = #killcount_mob_id$ + #killcount_mob_id[[email protected]] + "#";
    	}
    	else if (compare([email protected]_parameters$[0], "list")) {
    		for ([email protected] = 0; [email protected] < .max_slot; [email protected]++)
    			dispbottom getmonsterinfo(#killcount_mob_id[[email protected]], MOB_NAME)+" Kill: "+F_InsertComma(#killcount_amount[[email protected]]);
    	}
    	else {
    		dispbottom [email protected]_command$+" failed. Usage: "[email protected]_command$+" <list|reset|mob_id> {slot}";
    	}
    	end;
    	
    OnNPCKillEvent:
    	[email protected] = killedrid;
    	if (compare(#killcount_mob_id$, "#"[email protected]+"#")) {
    		[email protected] = inarray(#killcount_mob_id, [email protected]);
    		#killcount_amount[[email protected]]++;
    		dispbottom getmonsterinfo([email protected], MOB_NAME)+" Kill: "+F_InsertComma(#killcount_amount[[email protected]]);
    	}
    	end;
    }

     

  8. 1.

    save the current appearance data into a variable

    then change the appearance to new appearance based on item

    when unequipped, load the appearance from the stored variable data

     

    2.

    retrieve and store existing cards or enchantment into a temporary variable, then use script command items like getitem2, getitem3....etc to create the new items along with old and new enchantments

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.