Jump to content

Emistry

Forum Moderator
  • Posts

    10017
  • Joined

  • Days Won

    407

Posts posted by Emistry

  1. 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;
    	}
    	
    	.@getmapusers = getmapusers(strcharinfo(3));
    	if (.@getmapusers < 0) {
    		dispbottom "invalid map '"+.map$+"', event stopped.";
    	}
    	else if (.@getmapusers <= 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 "+.@player_name$+"!", bc_map;
    		donpcevent strnpcinfo(3)+"::OnStop";
    	}
    	else {
    		.@i = rand(.player_aid_pool_size);
    		mapannounce .map$, "Round "+.current_round+": we killed "+rid2name(.player_aid_pool[.@i])+" out of "+.player_aid_pool_size+" players in this map.", bc_map;
    		unitkill .player_aid_pool[.@i];
    		specialeffect2 EF_GROUND_EXPLOSION, AREA, .@player_name$[.@i];
    		initnpctimer;
    		deletearray .player_aid_pool[.@i], 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
  2. a simplified version.

    -	script	gm_is_online	-1,{
    
    OnPCLoginEvent:
    	.@gm_level = getgmlevel();
    	
    	if (.@gm_level == 99)
    		callsub(L_GM, "Admin");
    	else if (.@gm_level >= 90)
    		callsub(L_GM, "Co-Admin");
    	else if (.@gm_level >= 10)
    		callsub(L_GM, "Head GM");
    	else if (.@gm_level >= 4)
    		callsub(L_GM, "Event GM");
    	else if (.@gm_level >= 3)
    		callsub(L_GM, "Support GM");
    	else if (.@gm_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;
    		
    }

     

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

    required the Pull: 5112 mentioned above.

    • Love 1
    • MVP 1
  4. 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;
    	}
    	
    	.@getmapusers = getmapusers(strcharinfo(3));
    	if (.@getmapusers < 0) {
    		dispbottom "invalid map '"+.map$+"', event stopped.";
    	}
    	else if (.@getmapusers <= 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;
    	}
    	.@total_count = getmapunits(BL_PC, .map$, .@player_name$);
    	.@owner_index = inarray(.@player_name$, .gm_name$);
    	if (.@owner_index != -1) {
    		// offset GM himself
    		deletearray .@player_name$[.@i], 1;
    		.@total_count--;
    	}
    	.current_round++;
    	if (.@total_count <= 0) {
    		mapannounce .map$, "Round "+.current_round+": no more player, event stopped...", bc_map;
    		donpcevent strnpcinfo(3)+"::OnStop";
    	}
    	else if (.@total_count <= 1) {
    		mapannounce .map$, "Round "+.current_round+": we have a winner "+.@player_name$+"!", bc_map;
    		donpcevent strnpcinfo(3)+"::OnStop";
    	}
    	else {
    		.@i = rand(.@total_count);
    		mapannounce .map$, "Round "+.current_round+": we killed "+.@player_name$[.@i]+" out of "+.@total_count+" players in this map.", bc_map;
    		unitkill convertpcinfo(.@player_name$[.@i], CPC_ACCOUNT);
    		specialeffect2 EF_GROUND_EXPLOSION, AREA, .@player_name$[.@i];
    		initnpctimer;
    	}
    	end;
    	
    OnStop:
    	stopnpctimer;
    	.running = 0;
    	.current_round = 0;
    	.map$ = "";
    	.gm_name$ = "";
    	end:
    }

     

    • Love 1
  5. 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.

  6. 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(.@atcmd_parameters$[0], "reset")) {
    		if (.@atcmd_parameters$[1] == "all") {
    			for (.@i = 0; .@i < .max_slot; .@i++)
    				dispbottom .@atcmd_command$+" removed "+getmonsterinfo(#killcount_mob_id[.@i], MOB_NAME)+" from slot "+.@i+" successfully.";
    			deletearray #killcount_mob_id;
    			deletearray #killcount_amount;
    		}
    		else if (.@atcmd_parameters$[1] != "") {
    			.@index = atoi(.@atcmd_parameters$[1]);
    			if (.@index < 0 || .@index >= .max_slot) {
    				dispbottom .@atcmd_command$+" invalid slot #"+.@index+" (min = 0, max = "+.max_slot+").";
    				end;
    			}
    		}
    		else {
    			dispbottom .@atcmd_command$+" removed "+getmonsterinfo(#killcount_mob_id[.@index], MOB_NAME)+" from slot "+.@index+" successfully.";
    			#killcount_mob_id[.@index] = 0;
    			#killcount_amount[.@index] = 0;
    		}
    		#killcount_mob_id$ = "#";
    		for (.@i = 0; .@i < .max_slot; .@i++)
    			#killcount_mob_id$ = #killcount_mob_id$ + #killcount_mob_id[.@i] + "#";
    	}
    	else if (getmonsterinfo(atoi(.@atcmd_parameters$[0]), MOB_NAME) != "null") {
    		.@killcount_mob_id = atoi(.@atcmd_parameters$[0]);
    		if (.@atcmd_parameters$[1] != "") {
    			.@index = atoi(.@atcmd_parameters$[1]);
    			if (.@index < 0 || .@index >= .max_slot) {
    				dispbottom .@atcmd_command$+" invalid slot #"+.@index+" (min = 0, max = "+.max_slot+").";
    				end;
    			}
    		}
    		
    		.@temp_index = inarray(#killcount_mob_id, .@killcount_mob_id);
    		if (.@temp_index != -1) {
    			dispbottom .@atcmd_command$+" already registerd "+getmonsterinfo(#killcount_mob_id[.@temp_index], MOB_NAME)+" at slot "+.@temp_index+" with current "+F_InsertComma(#killcount_amount[.@index])+" kills.";
    			end;
    		}
    		
    		if (.@killcount_mob_id != #killcount_mob_id) {
    			#killcount_mob_id[.@index] = .@killcount_mob_id;
    			#killcount_amount[.@index] = 0;
    			dispbottom .@atcmd_command$+" registered "+getmonsterinfo(#killcount_mob_id[.@index], MOB_NAME)+" at slot "+.@temp_index+", will start counting.";
    		}
    		#killcount_mob_id$ = "#";
    		for (.@i = 0; .@i < .max_slot; .@i++)
    			#killcount_mob_id$ = #killcount_mob_id$ + #killcount_mob_id[.@i] + "#";
    	}
    	else if (compare(.@atcmd_parameters$[0], "list")) {
    		for (.@i = 0; .@i < .max_slot; .@i++)
    			dispbottom getmonsterinfo(#killcount_mob_id[.@i], MOB_NAME)+" Kill: "+F_InsertComma(#killcount_amount[.@i]);
    	}
    	else {
    		dispbottom .@atcmd_command$+" failed. Usage: "+.@atcmd_command$+" <list|reset|mob_id> {slot}";
    	}
    	end;
    	
    OnNPCKillEvent:
    	.@killedrid = killedrid;
    	if (compare(#killcount_mob_id$, "#"+.@killedrid+"#")) {
    		.@index = inarray(#killcount_mob_id, .@killedrid);
    		#killcount_amount[.@index]++;
    		dispbottom getmonsterinfo(.@killedrid, MOB_NAME)+" Kill: "+F_InsertComma(#killcount_amount[.@index]);
    	}
    	end;
    }

     

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

     

  8. 7 minutes ago, GM Winter said:

    hello what i mean is the emperium is rotating but in the permanent place

    that's how the monster sprite work, if you want to remove the rotation, you have to remove the animation from the act file.

    download the ACT Editor, open the Emperium ACT file, then remove the animation, save it, and put it in your GRF to override the existing ACT file.

     

    if you want it to walk around, then follow what has been mentioned in previous post.

    Emperium by default, doesn't walk, it has no walking mode set to it.

  9. kill a player

    *unitkill <GID>;
    
    This command will kill a <GID>.

    or adjust EXP / Level

    BaseLevel   - Character's base level.
    JobLevel    - Character's job level.
    BaseExp     - Amount of base experience points.
    JobExp      - Amount of job experience points.
    NextBaseExp - Amount of base experience points needed to reach the next level.
    NextJobExp  - Amount of job experience points needed to reach the next level.

     

  10. instead of using the built-in vip system, you probably have to use a different approach.

    Give the item to player as rental items (may use rentitem(...) script commands)

    then make the item not tradable/storeable, need to be character bound.

    then every time check if the item exists in player inventory before proceed to access VIP features.

    However, you lost all the benefits of using the built-in VIP system that come with EXP bonus etc.

    • Like 1
  11. the account_id has been deprecated from the database long time ago, simply adding back the column wont make it work since the column wont have any values stored in it.

    You have to change the SQL statement to retrieve the info that you needed.

    @total_guild_member = query_sql( "SELECT `account_id`, `char_id` FROM `char` WHERE `guild_id` = "+ .@guild_id, @accountid_member, @charid_member );

     

    or a simple attempts

    -    script    guild_announce    -1,{
    OnWhisperGlobal:
    	if (!getcharid(2)) end;
    	.message_owner$ = strcharinfo(0);
    	.message$ = "";
    	for (.@i = 0; .@i < 10; .@i++)
    		.message$ = .message$ + ((.@i > 0) ? "#":"") + @whispervar0$;
    	addrid(3, 0, getcharid(2));
    	announce "[ "+ .message_owner$ +" ]: "+ .message$, bc_self;
    	end;
    }

     

  12. if you just want the Emperium to walk around randomly, just set the monster mode to be walkable, there is no need to use additional npc script to control the movement unless u want a specific walking patterns/behaviours.

  13. try this

    31002,Bônus_Eletrônico,Bônus Eletrônico,2,10000,,2500,,,,,0xFFFFFFFF,7,2,,,,,,{ callfunc("F_PartyEarnCash"); },{},{}

    load this npc script

    function	script	F_PartyEarnCash	{
    	.@amount = rand(1, 100);
    	#CASHPOINTS += .@amount; 
    	dispbottom "PowkRO: Você Ganhou "+F_InsertComma(.@amount)+" Rops.";
    		
    	.@party_id = getcharid(1);
    	if (.@party_id) {
    		.@owner_aid = getcharid(3);
    		.@owner_cid = getcharid(0);
    		
    		getpartymember .@party_id, 2;
    		.@partymembercount = $@partymembercount;
    		for (.@i = 0; .@i < .@partymembercount; .@i++) {
    			if ($@partymemberaid[.@i] == .@owner_aid) 
    				continue;
    				
    			if (attachrid($@partymemberaid[.@i])) {
    				.@amount = rand(1, 50);
    				#CASHPOINTS += .@amount; 
    				dispbottom "PowkRO: Você Ganhou "+F_InsertComma(.@amount)+" Rops.";
    				dispbottom "PowkRO: '"+strcharinfo(0)+"' gained "+F_InsertComma(.@amount)+" Rops.", 0x00FF00, .@owner_cid;
    				detachrid;
    			}
    		}
    	}
    	return;
    }

     

    • Upvote 1
  14. On 1/27/2022 at 2:13 PM, lLoydxx said:

    2 - I'm using the standard EndlessTower of the emulator but with an extra getitem I added, I tried to make the leader of the group receive 30 Bloody Twigs when killing Naght Sieger but nothing happens. This was the part I tried to add to make it work.

    all instance's monster have their own event label, you have to find the event label for the monster, and edit there.

    OnTimer10500:
    	set .@map$, instance_mapname("6@tower");
    	mapannounce .@map$,"You'll soon know. Mine is the face of death!",bc_map,"0x00ffcc";
    	stopnpctimer;
    	monster .@map$,156,147,"Naght Sieger",1956,1,instance_npcname("#4th Beeper")+"::OnMyMobDead";   // <-------------- FIND THIS
    	end;
    
    OnMyMobDead:   // <-------------- FIND THIS
    	donpcevent instance_npcname("Lost Soul#102")+"::OnEnable";
    
    	// ADD THESE
    	//announce "[Torre Sem Fim]: O grupo "+ getpartyname( getcharid(1) ) +" acaba de matar Naght Sieger que dropou 30 Galhos Sangrentos como recompensa! Parab閚s a todos!", bc_all, "0x00ff99";
    	announce "[Torre Sem Fim]: Naght Sieger acaba de ser morto pelo grupo "+ getpartyname(getcharid(1)) +", eles receberam 30 Galhos Sangrentos como recompensa! Parabéns!", bc_all, "0x00ff99";
    	getitem 12103,30;
    	end;
    }

     

×
×
  • Create New...