Jump to content

Capuche

Developer
  • Posts

    2407
  • Joined

  • Last visited

  • Days Won

    51

Posts posted by Capuche

  1. The functionality mob + location is currently not implemented on rAthena (maybe later?)

    Currently supported:

     - Id: 22000
       Title: Fishy affair
       Targets:
         - Mob: VADON
           Count: 45
     - Id: 22000
       Title: Fishy affair
       Targets:
         - Id: 1
           Location: iz_dun01
           MapName: Undersea Tunnel B2

    Requires an update :

     - Id: 22000
       Title: Fishy affair
       Targets:
         - Mob: VADON
           Count: 45
           Location: iz_dun01
           MapName: Undersea Tunnel B2

    To do that find in quest.cpp

    			if (qi->objectives[j]->mob_id == md->mob_id)
    				objective_check = 6;
    			else if (qi->objectives[j]->mob_id == 0) {

    and replace the 3 lines by

    			if (qi->objectives[j]->mob_id == md->mob_id) {
    				objective_check = 5;
    				if (qi->objectives[j]->mapid < 0 || (qi->objectives[j]->mapid == sd->bl.m && md->spawn != nullptr))
    					objective_check++;
    				else if (qi->objectives[j]->mapid >= 0) {
    					struct map_data *mapdata = map_getmapdata(sd->bl.m);
    
    					if (mapdata->instance_id && mapdata->instance_src_map == qi->objectives[j]->mapid)
    						objective_check++;
    				}
    			}
    			else if (qi->objectives[j]->mob_id == 0) {

    (untested)

  2. To add a custom monster summon branch, the steps are:

    1.  Add MOBG_G_D_Branch_01 before MOBG_MAX in https://github.com/rathena/rathena/blob/2f311bd1ef6abf0de642f93690eb37bebbb34d14/src/map/mob.hpp#L116
    2.  Add MOBG_G_D_Branch_01 after export_constant(MOBG_TAEKWON_MISSION); in https://github.com/rathena/rathena/blob/2f311bd1ef6abf0de642f93690eb37bebbb34d14/src/map/script_constants.hpp#L4625
    3. After compiling your server should have created a folder named "import". Add your custom branch data in import/mob_summon.yml
    Header:
      Type: MOB_SUMMONABLE_DB
      Version: 1
    
    Body:
      - Group: G_D_Branch_01
        Default: MAYA
        Summon:
          - Mob: MAYA
            Rate: 100000
          - Mob: DEVILING
            Rate: 700000
          - Mob: Drake
            Rate: 700000

          4. In import/item_db.yml

      - Id: ****
        AegisName: name
        Name: name
        Type: Usable
        Buy: 10000
        Weight: 200
        Flags:
          BuyingStore: true
          DeadBranch: true
        Script: |
          monster "this",-1,-1,"--ja--",-1-MOBG_G_D_Branch_01,1,"";

     

    All other steps are unnecessary (I think you just forgot to compile according to the error in your first post).

    • Upvote 2
    • MVP 1
  3. The quest system already handle the timer. For example

      - Id: 9998
        Title: "Memorial Dungeon: Champion"
        TimeLimit: 4h
      - Id: 9999
        Title: "Memorial Dungeon: Champion"
        TimeLimit: +4h

    9998 is reset at every 4:00, 9999 is reset 4h after the quest is given.

    The issue of the topic owner was because he made some mistakes in the NPC script, the conditions on the timers were always false so the player could always recreate the instance.

    Sample of correction

    switch( checkquest(9998,PLAYTIME) ) {
    case -1:
    	break;
    case 0:
    case 1:
    	mes "^ff0000Memorial Dungeon cannot be reentered within 8 hours after your last entrance.^000000";
    	mes "Reset Every 04:00 AM";
    	close;
    case 2:
    	erasequest 9998;// Memorial Dungeon: Champion
    	break;
    }
    switch( checkquest(9999,PLAYTIME) ) {
    case -1:
    	break;
    case 0:
    case 1:
    	mes "^ff0000Memorial Dungeon cannot be reentered within 8 hours after your last entrance.^000000";
    	mes "Reset Every 04:00 AM";
    	close;
    case 2:
    	erasequest 9999;
    	break;
    }
    Create INSTANCE

     

  4. There is getunitdata to retrieve x y for monster. Sample untested :

    
    
    
    
    
    -	script	CustomDrop	FAKE_NPC,{
    function add_drop;
    
    OnNPCKillEvent:
    	if (!playerattached())
    		end;
    	.@mob_id = killedrid;
    	.@size = getd(".size_" + .@mob_id);
    	if (.@size < 1)
    		end;
    	getunitdata killedgid, .@v;
    	.@x = .@v[UMOB_X];
    	.@y = .@v[UMOB_Y];
    	.@map$ = strcharinfo(3);
    
    	for (.@i = 0; .@i < .@size; .@i++) {
    		.@chance = getd(".chance_" + .@mob_id + "[" + .@i + "]");
    		if (rand(10000) < .@chance) {
    			.@id = getd(".item_id_" + .@mob_id + "[" + .@i + "]");
    			.@amt = getd(".item_amount_" + .@mob_id + "[" + .@i + "]");
    			while (.@amt > 0) {
    				makeitem .@id, 1, .@map$, .@x, .@y;
    				.@amt--;
    			}
    		}
    	}
    	end;
    	
    OnInit:
    	// <mob_id>, <item_id>, <item_amount>, <chance>
    	// Chance ========================
    	// 10000 	= 100%
    	// 1000		= 10%
    	// 100		= 1%
    	// 99		= 0.99%
    	// 50		= 0.50%
    	// 1		= 0.01%
    	// ===============================
    	add_drop( 1002, 607, 2, 10000 );	// poring will drop 2 ygg berries on the floor with 100% chance
    	add_drop( 1002, 608, 3, 10000 ); // poring will drop 3 ygg seeds on the floor with 100% chance
    	end;
    
    function add_drop {
    	.@arg_count = getargcount();
    	if (.@arg_count % 4)
    		return;
    
    	for (.@i = 0; .@i < .@arg_count; .@i += 4) {
    		.@mob_id = getarg(.@i);
    		.@size = getd(".size_" + .@mob_id);
    		setd ".item_id_" + .@mob_id + "[" + .@size + "]", getarg(.@i+1);	// <item_id>
    		setd ".item_amount_" + .@mob_id + "[" + .@size + "]", getarg(.@i+2);	// <item_amount>
    		setd ".chance_" + .@mob_id + "[" + .@size + "]", getarg(.@i+3);	// <chance>
    		setd ".size_" + .@mob_id, .@size + 1;
    	}
    	return;
    }
    }

     

    • MVP 1
  5. Well there is no setting like Akkarin said, but this change in map.cpp should allow you to walk on cell where the npcs are hidden/disabled/invisible (untested)

    @@ -553,6 +553,11 @@ int map_count_oncell(int16 m, int16 x, int16 y, int type, int flag)
     	if (type&~BL_MOB)
     		for( bl = mapdata->block[bx+by*mapdata->bxs] ; bl != NULL ; bl = bl->next )
     			if(bl->x == x && bl->y == y && bl->type&type) {
    +				if (bl->type == BL_NPC) {
    +					struct npc_data *nd = (struct npc_data *)bl;
    +					if (nd && (nd->sc.option&(OPTION_INVISIBLE|OPTION_HIDE) || nd->class_ == JT_FAKENPC || nd->class_ == JT_HIDDEN_WARP_NPC))
    +						continue;
    +				}
     				if(flag&1) {
     					struct unit_data *ud = unit_bl2ud(bl);
     					if(!ud || ud->walktimer == INVALID_TIMER)

     

    • MVP 1
×
×
  • Create New...