Jump to content

laonglaing

Members
  • Posts

    35
  • Joined

  • Last visited

Posts posted by laonglaing

  1. 1 hour ago, Winterfox said:

    It is possible, but you have to write the respawn logic yourself. Here is an untested example:
     

    -	script	DYNAMIC_MOB_SPAWN	-1,{
    	OnInit:
    		.mob_id = 1002;
    		.mob_amount = 10;
    		.mob_map$ = "prontera";
    		.mob_start_coords_x = 150;
    		.mob_start_coords_y = 150;
    		.mob_end_coords_x = 160;
    		.mob_end_coords_y = 160;
    
    		.no_spawn_start_hour = 16;
    		.no_spawn_end_hour = 18;
    
    		if(callsub("S_No_Respawn_Hour")) {
    			.@curr_mob_amount = .mob_amount - $dead_mobs_amount;
    
    			if(.@curr_mob_amount) {
    				callsub("S_Spawn_Mobs", .@curr_mob_amount);
    			}
    
    			.no_respawn = 1;
    			end;
    		}
    
    		$dead_mobs_amount = 0;
    		callsub("S_Spawn_Mobs", .mob_amount);
    	end;
    
    	OnMobDead:
    		if(.no_respawn) {
    			$dead_mobs_amount++;
    			end;
    		}
    
    		callsub("S_Spawn_Mobs", 1);
    	end;
    
    	OnHour00:
    	OnHour01:
    	OnHour02:
    	OnHour03:
    	OnHour04:
    	OnHour05:
    	OnHour06:
    	OnHour07:
    	OnHour08:
    	OnHour09:
    	OnHour10:
    	OnHour11:
    	OnHour12:
    	OnHour13:
    	OnHour14:
    	OnHour15:
    	OnHour16:
    	OnHour17:
    	OnHour18:
    	OnHour19:
    	OnHour20:
    	OnHour21:
    	OnHour22:
    	OnHour23:
    		if(callsub("S_No_Respawn_Hour")) {
    			.no_respawn = 1;
    			end;
    		}
    
    		.no_respawn = 0;
    		if(!$dead_mobs_amount) end;
    
    		callsub("S_Spawn_Mobs", $dead_mobs_amount);
    		$dead_mobs_amount = 0;
    	end;
    
    	S_Spawn_Mobs:
    		areamonster(.mob_map$, .mob_start_coords_x, .mob_start_coords_y, , .mob_end_coords_x, .mob_end_coords_y, "--ja--", .mob_id, getarg(0), "DYNAMIC_MOB_SPAWN::OnMobDead");
    		return;
    
    	S_No_Respawn_Hour:
    		.@curr_hour = gettime(DT_HOUR);
    		if(.@curr_hour >= .no_spawn_start_hour && .@curr_hour < .no_spawn_end_hour) {
    			return 1;
    		}
    
    		return 0;
    }

     

    thank you for this @Winterfox! will try and test this. gonna update this thread for the outcome.

     

  2. is it possible to dynamically control wether the mobs in a map will spawn or not? my goal is to stop the mobs/monster spawn in a map at certain time within the day.
    I can't find any solution/functions to do this, might need to update the source itself? 
     

  3. hello guys! i tried implementing this custom mapflag of cydh unfortunately, even though i add it in the script_mapflags.. it doesnt work.

     
    im assuming that the mapflag is not being recognize. im not sure where is the definition where, gvg_noally is link to mf_gvg_noally that was defined in the emulator

    tried to check on how to add custom mapflags from this thread

     but i cant find the part where you need to do some changes in npc.cpp as the thread/article mentioned.

    checked also the rathena wiki but it seems its already outdated?

    hoping anyone can help me on this.

     

     

  4. as what the title ask, im trying to modify some AoE skills that damages specific race only in the area. saw this method -> status_get_status_data(bl) but im unable to use it in this specific line of code since it directly targets to to BC_ENEMY already
                    map_foreachinallarea(skill_area_sub,
                        src->m, x - i, y - i, x + i, y + i, BL_CHAR,
                        src, skill_id, skill_lv, tick, flag | BCT_ENEMY | 1,
                        skill_castend_damage_id);

    im trying to modify skills in skill.cpp under below method which doesn't pass the information of bl.
    int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, uint16 skill_lv, t_tick tick, int flag)

    any idea or suggestion for this?

  5. Hello!
    I would like to ask where in the code i must check in order to make specific skill where attack type is "misc" to have a chance to get status/curse card effect from enemies card armor (ea, dark frame card..).

×
×
  • Create New...