Jump to content

Kenpachi

Core Developers
  • Content Count

    204
  • Joined

  • Last visited

  • Days Won

    32

Posts posted by Kenpachi


  1. Hi.

     

    In src/map/battle.c find function battle_calc_misc_attack() and replace:

    		switch(skill_id){
    			case HT_LANDMINE:
    			case MA_LANDMINE:
    			case HT_BLASTMINE:
    			case HT_CLAYMORETRAP:
    			case RA_CLUSTERBOMB:
    #ifdef RENEWAL
    				break;
    #endif
    			default:
    				md.damage = 1;
    		}

    With:

    		switch(skill_id){
    			case HT_BLASTMINE:
    				break;
    			case HT_LANDMINE:
    			case MA_LANDMINE:
    			case HT_CLAYMORETRAP:
    			case RA_CLUSTERBOMB:
    #ifdef RENEWAL
    				break;
    #endif
    			default:
    				md.damage = 1;
    		}

     

     

    ~Kenpachi


  2. Hi.

     

    Replace:

    set .AnnounceFlag$, "bc_all";

    With:

    set .AnnounceFlag, bc_all;

     

     

    In line 189, 191, 193 and 273 replace:

    16|.announce

    With:

     .AnnounceFlag, .AnnounceColor$

     

     

    In line 221 replace:

    announce strcharinfo(0) +" , Stop killing "+ rid2name(killedrid) + " !!!",0;

    With:

    announce strcharinfo(0) +" , Stop killing "+ rid2name(killedrid) + " !!!", .AnnounceFlag, .AnnounceColor$;

     

     

    In line 294, 295, 303, 304, 310, 311, 317, 318, 324 and 325 replace:

    16

    With:

     .AnnounceFlag, .AnnounceColor$

     

     

    No you can change the color by modifying .AnnounceColor$.

     

     

    ~Kenpachi


  3. Just in case someone else wants to know how to add the sound...

    Add (for the character who obtained the item):

    clif->soundeffect(sd, &sd->bl, "sound_file_name.wav", 0);

    Below this line:

    clif->message(sd->fd, output);

     

    Add (for party members):

    clif->soundeffect(p_sd, &p_sd->bl, "sound_file_name.wav", 0);

    Below this line:

    clif->message(p_sd->fd, output);

     

    The sound file is read from data\wav folder, must be in the PCM format, and the file name should have a maximum length of 23 characters including the ".wav" extension.

     

     

    ~Kenpachi


  4. Okay, I misunderstood you here. The code I posted caps the total tolerance at 50%, but - if I get it right - you want to cap the additional (respectively bonus) tolerance at 50%.

    Now you have to be a bit more specific because the tolerances are modified by 3 different things:

    • Skills - for example Dragonology (SA_DRAGONOLOGY) or Eucharistica (AB_EUCHARISTICA)
    • Status changes - for example Skull Scroll (ID: 12745) (SC_SKELSCROLL) or Royal Scroll (ID: 12747) (SC_ROYALSCROLL)
    • Equipment bonuses - for example Weeder Knife (ID: 1227) or Combat Knife (ID: 1228)

     

    If you don't want to distinguish between those 3 cases, you just have to replace the 50 with 150. This way the bonus tolerance is capped at 50% regardless of how the bones was applied.

    Otherwise please tell me how to handle each case.

     

    //BTW: I'll move this topic to the Source Support section.

     

     

    ~Kenpachi


  5. I guess you applied the changes manually and accidentally broke something.

     

    I used a untouched copy of Hercules and applied the patch file with TortoiseGit. -> No issue.
    showdrop.thumb.png.1b76c7ac8e9c87ec1021b909a427f7cb.png

     

     

    ~Kenpachi


  6. Hi.

     

    Unfortunately I were not able to create a plugin, because I couldn't hook at all required spots.

    But if you want to, you can use this patch: showdrop.patch

    Just tell me if something doesn't work as intended or needs modification.

     

     

    ~Kenpachi


  7. Quote

     

    If you are in a Party and someone found an item with 1% or below,

    announcement will be shown like:

    Playername found a Poring Card [dropchance]

     

    The "someone" is confusing me.

    This is how I understand your description:

    -> Player A, B and C are in the same party.

    -> Player A uses @showdrop.
    -> Player A, B or C loots an item with a drop chance of 1% or below.

    -> Show message to player A, B and C.

    I don't think this is a good idea, since player A affects the gameplay of player B and C even if they don't want it. Even worse: They won't know about @showdrop being enabled until the first drop message is shown.

    If I misunderstood your description, please correct me.

     

     

    ~Kenpachi


  8. Hi.

     

    In src/map/unit.c find function unit_walktobl() and replace:

    	if (unit->walk_toxy_sub(bl) == 0 && (flag & 2) != 0) {
    		set_mobstate(bl);
    		return 1;
    	}

    with:

    	if (unit->walk_toxy_sub(bl) == 0) {
    		if ((flag & 2) != 0)
    			set_mobstate(bl);
    
    		return 1;
    	}

     

    And re-compile. :)

     

     

    ~Kenpachi


  9. Hi.

     

    Here you go:

    Spoiler
    
    //Morphogenic Hat Script
    //Allows a player to change their look to absolutely any hat available or to a defined upper limit. Check the "OnInit" label for information on this.
    //
    //By Slam
    
    -	script	Morpho	FAKE_NPC,{
    
    OnWhisperGlobal:
    	.@keyword$ = @whispervar0$;
    	.@item_id = atoi(@whispervar1$);
    
    
    
    	if (.@item_id != 0 && (getiteminfo(.@item_id, ITEMINFO_TYPE) != IT_ARMOR || (getiteminfo(.@item_id, ITEMINFO_LOC) & EQP_HELM) == 0)) {
    		dispbottom("---------------[Morpho Helper]---------------");
    		dispbottom(" ");
    		dispbottom("Item " + .@item_id + " is not a headgear!");
    		dispbottom(" ");
    		end;
    	}
    
    
    
    	if ((.@keyword$ == "upper" && !isequipped(.top_morpho))
    	    || (.@keyword$ == "middle" && !isequipped(.mid_morpho))
    	    || (.@keyword$ == "lower" && !isequipped(.low_morpho))) {
    		dispbottom("---------------[Morpho Helper]---------------");
    		dispbottom(" ");
    		dispbottom("Sorry, you do not currently have your Morpho equipped.");
    		dispbottom("Please equip it and try again!");
    		dispbottom(" ");
    		end;
    	}
    
    
    
    	if ((.@keyword$ == "upper" || .@keyword$ == "middle" || .@keyword$ == "lower")
    	    && !callfunc("MorphoValidateLocation", .@keyword$, .@item_id)) {
    		dispbottom("---------------[Morpho Helper]---------------");
    		dispbottom(" ");
    		dispbottom("Sorry, this headgear was not designed for this headgear slot.");
    		dispbottom(" ");
    		end;
    	}
    
    
    
    	.@view_id = getiteminfo(.@item_id, ITEMINFO_VIEWSPRITE);
    
    	if ((.@keyword$ == "upper" || .@keyword$ == "middle" || .@keyword$ == "lower") && .@view_id <= 0) {
    		dispbottom("---------------[Morpho Helper]---------------");
    		dispbottom(" ");
    		dispbottom("Invalid headgear ID.");
    		dispbottom(" ");
    		end;
    	}
    
    
    
    	//for (.@i = 0; .@i < getarraysize(.morpho_disallowed); .@i++) {
    	//	if (.@item_id == .morpho_disallowed[.@i]) {
    	//		dispbottom("---------------[Morpho Helper]---------------");
    	//		dispbottom(" ");
    	//		dispbottom("Sorry, you cannot change your Morpho into this headgear.");
    	//		dispbottom("Please try another.");
    	//		dispbottom(" ");
    	//		end;
    	//	}
    	//}
    
    
    
    	if (.@keyword$ == "help") {
    		dispbottom("---------------[Morpho Helper]---------------");
    		dispbottom(" ");
    		dispbottom("Welcome to the Morpho Settings NPC!");
    		dispbottom("I can help you set what your Morphohat looks like");
    		dispbottom(" ");
    		dispbottom("To use this NPC, whisper NPC:Morpho (you should");
    		dispbottom("know this already) with upper/middle/lower or ");
    		dispbottom("wing. The wing section is not yet implemented");
    		dispbottom("however. Now, to set your Morphohat use the ");
    		dispbottom("following layout:");
    		dispbottom(" ");
    		dispbottom("upper#5232 - This will make it a Pink Kitty");
    		dispbottom(" ");
    		dispbottom("Protip: Use RateMyServer.net for item IDs.");
    		dispbottom(" ");
    		end;
    	}
    
    
    
    	if (.@keyword$ == "info") {
    		dispbottom("---------------[Morpho Helper]---------------");
    		dispbottom(" ");
    		dispbottom("You currently have the following items set for your Morpho hat:");
    		dispbottom("Upper - " + ((morpho_id_top == 0) ? "None" : getitemname(morpho_id_top)));
    		dispbottom("Middle - " + ((morpho_id_mid == 0) ? "None" : getitemname(morpho_id_mid)));
    		dispbottom("Lower - " + ((morpho_id_low == 0) ? "None" : getitemname(morpho_id_low)));
    		dispbottom(" ");
    		end;
    	}
    
    
    
    	if (.@keyword$ == "clear") {
    		morpho_id_top = 0;
    		morpho_id_mid = 0;
    		morpho_id_low = 0;
    
    		if (getequipid(EQI_HEAD_TOP) == .top_morpho)
    			setlook(LOOK_HEAD_TOP, 0);
    
    		if (getequipid(EQI_HEAD_MID) == .mid_morpho)
    			setlook(LOOK_HEAD_MID, 0);
    
    		if (getequipid(EQI_HEAD_LOW) == .low_morpho)
    			setlook(LOOK_HEAD_BOTTOM, 0);
    
    		dispbottom("---------------[Morpho Helper]---------------");
    		dispbottom(" ");
    		dispbottom("Your Morphing Hats list has been cleared.");
    		dispbottom(" ");
    		end;
    	}
    
    
    
    	if (.@keyword$ == "upper" || .@keyword$ == "middle" || .@keyword$ == "lower") {
    		if (.@keyword$ == "upper") {
    			morpho_id_top = .@item_id;
    			setlook(LOOK_HEAD_TOP, .@view_id);
    		}
    
    		if (.@keyword$ == "middle") {
    			morpho_id_mid = .@item_id;
    			setlook(LOOK_HEAD_MID, .@view_id);
    		}
    
    		if (.@keyword$ == "lower") {
    			morpho_id_low = .@item_id;
    			setlook(LOOK_HEAD_BOTTOM, .@view_id);
    		}
    
    		dispbottom("---------------[Morpho Helper]---------------");
    		dispbottom(" ");
    		dispbottom("Selected headgear ID: " + .@item_id);
    		dispbottom(" ");
    		end;
    	}
    
    
    
    	dispbottom("---------------[Morpho Helper]---------------");
    	dispbottom(" ");
    	dispbottom("Sorry, I didn't understand the option you have");
    	dispbottom("have given me. Please type 'help' for more info");
    	dispbottom(" ");
    	end;
    
    
    
    OnInit:
    	// Change this to the upper limit of the headgears that you wish to make available
    	setarray(.morpho_disallowed[0],	9001, 5386, 5387, 5391, 5394, 5407, 5408, 5419, 5428, 5436,
    					5437, 5438, 5439, 5440, 5441, 5442, 5443, 5444, 5445, 5446,
    					5447, 5448, 5449, 5459, 5481, 5486, 5487, 5488, 5492, 5493,
    					5494, 5495, 5508, 5516, 5517, 5520, 5532, 5533, 5534, 5535,
    					5540, 5541, 5542, 5543, 5544, 5551, 5552, 5553, 5560, 5561,
    					5562, 5571, 5575, 5576, 5577, 5578, 5583, 5584, 5587, 5595,
    					5600, 5601, 5602, 5603, 5604, 5605, 5606, 5607, 5608, 5609,
    					5610, 5611, 5612, 5613, 5614, 5615, 5616, 5617, 5618, 5619,
    					5620, 5621, 5622, 5623, 5624, 5625, 5626, 5627, 5628, 5629,
    					5630, 5631, 5632, 5633, 5634, 5635, 5636, 5637, 5638, 5639,
    					5640, 5641, 5642, 5643, 5644, 5645, 5646, 5647, 5648, 5649,
    					5650, 5651, 5652, 5653, 5654, 5655, 5656, 5657, 5658, 5659,
    					5660, 5661, 5662, 5663, 5664, 5665, 5666, 5667, 5668, 5669,
    					5670, 5671, 5672, 5673, 5674, 5675, 5676, 5677, 5678, 5679,
    					5680, 5681, 5682, 5683, 5684, 5685, 5686, 5687, 5688, 5689,
    					5690, 5691, 5692, 5693, 5694, 5695, 5696, 5697, 5698, 5699,
    					5700, 5701, 5702, 5703, 5704, 5705, 5706, 5707, 5708, 5709,
    					5710, 5711, 5712, 5713, 5714, 5715, 5716, 5717, 5718, 5719,
    					5720, 5721, 5722, 5723, 5724, 5725, 5726, 5727, 5728, 5729,
    					5730, 5731, 5732, 5733, 5734, 5735, 5736, 5737, 5738, 5739,
    					5740, 5741, 5742, 5743, 5744, 5745, 5746, 5747, 5748, 5749,
    					5750, 5751, 5752, 5753, 5754, 5755, 5756, 5757, 5758, 5759,
    					5760, 5761, 5762, 5763, 5764, 5765, 5766, 5767, 5768, 5769,
    					5770, 5771, 5772, 5773, 5774, 5775, 5776, 5777, 5778, 5779,
    					5780, 5781, 5782, 5783, 5784, 5785, 5786, 5787, 5788, 5789,
    					5790, 5791, 5792, 5793, 5794, 5795, 5796, 5797, 5798, 5799,
    					5809, 5812, 5814, 5824, 23134, 5070); //inb4OVERNINETHOUSAND
    
    	// Equip IDs - Change these to the ID numbers of the hat you wish to designate as the Morphing hat
    	.top_morpho = 25092;
    	.mid_morpho = 25093;
    	.low_morpho = 25094;
    	end;
    }
    
    
    
    // If you wish to make the "Morph" an Account bound variable, simply change all instances of "morpho_id_*" with "#morpho_id_"
    function	script	MorphoEquip	{
    	.@equipslot = getarg(0);
    
    	switch(.@equipslot) {
    	case 1: // Upper
    		if (morpho_id_top == 0)
    			dispbottom("No headgear set for upper. PM \"NPC:Morpho\" with the word \"help\" for more information.");
    		else
    			setlook(LOOK_HEAD_TOP, getiteminfo(morpho_id_top, ITEMINFO_VIEWSPRITE));
    
    		end;
    	case 2: // Mid
    		if (morpho_id_mid == 0)
    			dispbottom("No headgear set for middle. PM \"NPC:Morpho\" with the word \"help\" for more information.");
    		else
    			setlook(LOOK_HEAD_MID, getiteminfo(morpho_id_mid, ITEMINFO_VIEWSPRITE));
    
    		end;
    	case 3: // Lower
    		if (morpho_id_low == 0)
    			dispbottom("No headgear set for lower. PM \"NPC:Morpho\" with the word \"help\" for more information.");
    		else
    			setlook(LOOK_HEAD_BOTTOM, getiteminfo(morpho_id_low, ITEMINFO_VIEWSPRITE));
    
    		end;
    	}
    }
    
    
    
    
    // Validates if a headgear fits in the passed location.
    //
    // getarg(0) - The location keyword ("upper", "middle", "lower")
    // getarg(1) - The item ID of the desired headgear
    //
    // Returns 1 on success, or 0 on failure.
    function	script	MorphoValidateLocation	{
    	.@keyword$ = getarg(0);
    	.@location = getiteminfo(getarg(1), ITEMINFO_LOC);
    
    	// Upper and Upper+Mid only. Comment out the two lines below to remove this functionality.
    	//if (.@keyword$ == "upper" && .@location != EQP_HEAD_TOP && .@location != (EQP_HEAD_TOP | EQP_HEAD_MID))
    	//	return 0;
    
    	// Mid and Mid+Lower only. Comment out the two lines below to remove this functionality.
    	//if (.@keyword$ == "middle" && .@location != EQP_HEAD_MID && .@location != (EQP_HEAD_MID | EQP_HEAD_LOW))
    	//	return 0;
    
    	// Lower only. Comment out the two lines below to remove this functionality.
    	//if (.@keyword$ == "lower" && .@location != EQP_HEAD_LOW)
    	//	return 0;
    
    	return 1;
    }

     

     

    I re-wrote the original script, so if you have modifications in your version, you have to apply them again. Sorry.

     

     

    ~Kenpachi


  10. Hi.

     

    For those errors replace:

    case INF_ATTACK_SKILL:
    	struct enemyskilldata enemyskill_;
    	enemyskill_.skill_id = skill_id;
    	enemyskill_.event = aStrdup(VECTOR_INDEX(tempskill, i).event);
    	VECTOR_ENSURE( enemyskill, 1, 1 );
    	VECTOR_PUSH( enemyskill, enemyskill_ );
    	break;
    case INF_SUPPORT_SKILL:
    	struct friendskilldata friendskill_;
    	friendskill_.skill_id = skill_id;
    	friendskill_.event = aStrdup(VECTOR_INDEX(tempskill, i).event);
    	VECTOR_ENSURE( friendskill, 1, 1 );
    	VECTOR_PUSH( friendskill, friendskill_ );
    	break;
    case INF_GROUND_SKILL:
    	struct placeskilldata placeskill_;
    	placeskill_.skill_id = skill_id;
    	placeskill_.event = aStrdup(VECTOR_INDEX(tempskill, i).event);
    	VECTOR_ENSURE( placeskill, 1, 1 );
    	VECTOR_PUSH( placeskill, placeskill_ );
    	break;
    case INF_SELF_SKILL:
    	struct selfskilldata selfskill_;
    	selfskill_.skill_id = skill_id;
    	selfskill_.event = aStrdup(VECTOR_INDEX(tempskill, i).event);
    	VECTOR_ENSURE( selfskill, 1, 1 );
    	VECTOR_PUSH( selfskill, selfskill_ );
    	break;

    with:

    case INF_ATTACK_SKILL: {
    	struct enemyskilldata enemyskill_;
    	enemyskill_.skill_id = skill_id;
    	enemyskill_.event = aStrdup(VECTOR_INDEX(tempskill, i).event);
    	VECTOR_ENSURE( enemyskill, 1, 1 );
    	VECTOR_PUSH( enemyskill, enemyskill_ );
    	break;
    }
    case INF_SUPPORT_SKILL: {
    	struct friendskilldata friendskill_;
    	friendskill_.skill_id = skill_id;
    	friendskill_.event = aStrdup(VECTOR_INDEX(tempskill, i).event);
    	VECTOR_ENSURE( friendskill, 1, 1 );
    	VECTOR_PUSH( friendskill, friendskill_ );
    	break;
    }
    case INF_GROUND_SKILL: {
    	struct placeskilldata placeskill_;
    	placeskill_.skill_id = skill_id;
    	placeskill_.event = aStrdup(VECTOR_INDEX(tempskill, i).event);
    	VECTOR_ENSURE( placeskill, 1, 1 );
    	VECTOR_PUSH( placeskill, placeskill_ );
    	break;
    }
    case INF_SELF_SKILL: {
    	struct selfskilldata selfskill_;
    	selfskill_.skill_id = skill_id;
    	selfskill_.event = aStrdup(VECTOR_INDEX(tempskill, i).event);
    	VECTOR_ENSURE( selfskill, 1, 1 );
    	VECTOR_PUSH( selfskill, selfskill_ );
    	break;
    }

     

    That's just a fix for the posted error messages. There may be more issues...

     

     

    ~Kenpachi


  11. Hi.

     

    If you want to change the minimum damage for specific skills, you have to modify battle_calc_magic_attack() in src/map/battle.c.

    If you want to change the it generally, you have to modify the MATK calculation in status_get_matk_sub() (RE) or status_base_matk_min() (pre-RE) in src/map/status.c.

     

    And to answer your question in

    On 3/15/2020 at 5:20 PM, Zero Human said:

    Give's any src tutorials to learn source edits?

    No specific tutorial for Hercules. But there are tons of "C for beginners" guides available on the web.

     

     

    ~Kenpachi


  12. Quote

    Example: Stalker copied a skill from a Wizard Player [Storm Gust Level 10], and went to farm from monster but forgot to use preserve skill. On my suggestion even stalker forgot the preserve skill, it will not copy the skill from monster and lose the storm gust level 10. (Normally he/she will lose the Storm Gust Skill, and gets the skill from monster once he/she got hit) In short, Stalker can only copy skills from player-player not player-monster.

    in src/map/skill.c -> skill_attack()

    // Change:
    if (damage > 0 && dmg.flag&BF_SKILL && tsd
     && pc->checkskill(tsd,RG_PLAGIARISM)
     && (!sc || !sc->data[SC_PRESERVE])
     && damage < tsd->battle_status.hp
    
    // To:
    if (damage > 0 && dmg.flag&BF_SKILL && tsd
     && pc->checkskill(tsd,RG_PLAGIARISM)
     && (!sc || !sc->data[SC_PRESERVE])
     && damage < tsd->battle_status.hp
     && src->type == BL_PC // Skill was cast by a character.

     

     

    Quote

    Made this and tried to the test server, the EDP skill is not cancelled. (see attached file)

    Okay, misunderstood you here. I though you want to end the poison status when a Lord Knight casts Berserk or a Monk casts Fury.

    In this case I need an explanation. I don't know what you want to achieve.

     

     

    Quote

     

    It only set which skill will be affected by HealPower,

    I mean on this is, capping the healpower to 100%, example: bacsojin card give 30% heal power, even Player equip 4 bacsojin cards it will only read 100% heal power instead of 120%.

     

    In src/map/pc.c -> pc_bonus()

    // Change:
    case SP_ADD_HEAL_RATE:
    	if(sd->state.lr_flag != 2)
    		sd->bonus.add_heal_rate += val;
    	break;
    case SP_ADD_HEAL2_RATE:
    	if(sd->state.lr_flag != 2)
    		sd->bonus.add_heal2_rate += val;
    	break;
    
    // To:
    case SP_ADD_HEAL_RATE:
    	if(sd->state.lr_flag != 2)
    		sd->bonus.add_heal_rate += val;
    
    	sd->bonus.add_heal_rate = min(sd->bonus.add_heal_rate, 100);
    	break;
    case SP_ADD_HEAL2_RATE:
    	if(sd->state.lr_flag != 2)
    		sd->bonus.add_heal2_rate += val;
    
    	sd->bonus.add_heal2_rate = min(sd->bonus.add_heal2_rate, 100);
    	break;
    
    // ###################################################################################################
    
    // Change:
    case SP_SKILL_HEAL:
    	if(sd->state.lr_flag == 2)
    		break;
    	ARR_FIND(0, ARRAYLENGTH(sd->skillheal), i, sd->skillheal[i].id == 0 || sd->skillheal[i].id == type2);
    	if (i == ARRAYLENGTH(sd->skillheal)) {
    		// Better mention this so the array length can be updated. [Skotlex]
    		ShowDebug("script->run: bonus2 bSkillHeal reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n",
    			  ARRAYLENGTH(sd->skillheal), type2, val);
    		break;
    	}
    	if (sd->skillheal[i].id == type2)
    		sd->skillheal[i].val += val;
    	else {
    		sd->skillheal[i].id = type2;
    		sd->skillheal[i].val = val;
    	}
    	break;
    case SP_SKILL_HEAL2:
    	if(sd->state.lr_flag == 2)
    		break;
    	ARR_FIND(0, ARRAYLENGTH(sd->skillheal2), i, sd->skillheal2[i].id == 0 || sd->skillheal2[i].id == type2);
    	if (i == ARRAYLENGTH(sd->skillheal2)) {
    		// Better mention this so the array length can be updated. [Skotlex]
    		ShowDebug("script->run: bonus2 bSkillHeal2 reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n",
    			  ARRAYLENGTH(sd->skillheal2), type2, val);
    		break;
    	}
    	if (sd->skillheal2[i].id == type2)
    		sd->skillheal2[i].val += val;
    	else {
    		sd->skillheal2[i].id = type2;
    		sd->skillheal2[i].val = val;
    	}
    	break;
    
    // To:
    case SP_SKILL_HEAL:
    	if(sd->state.lr_flag == 2)
    		break;
    	ARR_FIND(0, ARRAYLENGTH(sd->skillheal), i, sd->skillheal[i].id == 0 || sd->skillheal[i].id == type2);
    	if (i == ARRAYLENGTH(sd->skillheal)) {
    		// Better mention this so the array length can be updated. [Skotlex]
    		ShowDebug("script->run: bonus2 bSkillHeal reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n",
    			  ARRAYLENGTH(sd->skillheal), type2, val);
    		break;
    	}
    	if (sd->skillheal[i].id == type2)
    		sd->skillheal[i].val += val;
    	else {
    		sd->skillheal[i].id = type2;
    		sd->skillheal[i].val = val;
    	}
    
    	sd->skillheal[i].val = min(sd->skillheal[i].val, 100);
    	break;
    case SP_SKILL_HEAL2:
    	if(sd->state.lr_flag == 2)
    		break;
    	ARR_FIND(0, ARRAYLENGTH(sd->skillheal2), i, sd->skillheal2[i].id == 0 || sd->skillheal2[i].id == type2);
    	if (i == ARRAYLENGTH(sd->skillheal2)) {
    		// Better mention this so the array length can be updated. [Skotlex]
    		ShowDebug("script->run: bonus2 bSkillHeal2 reached it's limit (%d skills per character), bonus skill %d (+%d%%) lost.\n",
    			  ARRAYLENGTH(sd->skillheal2), type2, val);
    		break;
    	}
    	if (sd->skillheal2[i].id == type2)
    		sd->skillheal2[i].val += val;
    	else {
    		sd->skillheal2[i].id = type2;
    		sd->skillheal2[i].val = val;
    	}
    
    	sd->skillheal2[i].val = min(sd->skillheal2[i].val, 100);
    	break;

     

     

    Quote

     

    Tried to search this lines, I cant find it on status.c

    On this, I wanted to make look like this

    Bonus to minimum MATK every 5 INT

    Bonus to maximum MATK every 7 INT

     

    That's done in the functions I posted. I can't believe your status.c doesn't contain them.

     

     

    Quote

     

    I have a question, I just want to clarify does.

    SCB_MDEF - Hard Defense? (Equipment Status Defense)

    SCB_MDEF2 - Soft Defense? (Int status defense)

     

    Well, I guess one could call them like this.

     

     

    ~Kenpachi


  13. Hi.

     

    Quote

     

    I would like to change the @follow command so that it is only available on the same map

    and aborts when changing the map as long as it is used by a GM level below 90.

     

    at_follow.diff

     

     

    Quote

    To block @follow on some maps, a custom mapflag "nofollow" would be helpful to keep the settings simple.

    Create a new zone in db/(pre-)re/map_zone_db.conf. For example:

    {
    	name: "NoFollow"
    
    	disabled_commands: {
    		follow: 90
    	}
    }

    And add the maps where you want to disable @follow to npc/mapflag/zone.txt, For example:

    geffen	mapflag	zone	NoFollow
    payon	mapflag	zone	NoFollow
    yuno	mapflag	zone	NoFollow

     

     

    ~Kenpachi


  14. Hi.

     

    Quote

    Stalker - cannot copy skill from monster when got attacked

    More details please. I'm not sure what you really want to do.

     

     

    Quote

    Stalker - Reject Sword will also work on Spear,  and Axe Weapons (Original effect work only for Sword, Dagger)

    In src/map/battle.c -> battle_calc_weapon_attack()

    // Change:
    && (sd == NULL || sd->weapontype1 == W_DAGGER || sd->weapontype1 == W_1HSWORD || sd->weapontype == W_2HSWORD)
    
    // To:
    && (sd == NULL || (sd->weapontype1 >= W_DAGGER && sd->weapontype1 <= W_2HAXE))

     

     

    Quote

    Assassin X - Enchant Deadly Poison will be cancelled (Specifically), if used Fury/Berserk.

    In src/map/skills.c -> skill_castend_nodamage_id()

    // Change:
    case SU_ARCLOUSEDASH:
    	clif->skill_nodamage(src,bl,skill_id,skill_lv,
    		sc_start(src,bl,type,100,skill_lv,skill->get_time(skill_id,skill_lv)));
    	break;
    
    // To:
    case SU_ARCLOUSEDASH:
    	clif->skill_nodamage(src, bl, skill_id, skill_lv,
    		sc_start(src, bl, type, 100, skill_lv, skill->get_time(skill_id, skill_lv)));
    
    	if (sd != NULL && (skill_id == LK_BERSERK || skill_id == MO_EXPLOSIONSPIRITS))
    		status_change_end(src, SC_DPOISON, INVALID_TIMER);
    
    	break;

     

     

    Quote

    Sniper - Blitz Beat will not miss/affected by Pneuma & Reverse Tatami

    In src/map/battle.c -> battle_calc_damage()

    // Change:
    if( ( sc->data[SC_PNEUMA] && (flag&(BF_MAGIC|BF_LONG)) == BF_LONG ) || sc->data[SC__MANHOLE] ) {
    	d->dmg_lv = ATK_BLOCK;
    	return 0;
    }
    
    // To:
    if ((sc->data[SC_PNEUMA] != NULL && (flag & (BF_MAGIC | BF_LONG)) == BF_LONG) || sc->data[SC__MANHOLE] != NULL) {
    	if (sc->data[SC_PNEUMA] == NULL // Not Pneuma but Man Hole -> Block attack!
    	    || skill_id != HT_BLITZBEAT // Not Blitz Beat -> Block attack!
    	    || s_sd == NULL // Attacker is not a character -> Block attack!
    	    || s_sd->job != MAPID_SNIPER) { // Attacker is not a Sniper -> Block attack!
    		d->dmg_lv = ATK_BLOCK;
    		return 0;
    	}
    }
    
    // ##############################################################################################
    
    // Change:
    if(sc->data[SC_NJ_TATAMIGAESHI] && (flag&(BF_MAGIC|BF_LONG)) == BF_LONG)
    	return 0;
    
    // To:
    if (sc->data[SC_NJ_TATAMIGAESHI] != NULL && (flag & (BF_MAGIC | BF_LONG)) == BF_LONG) {
    	if (skill_id != HT_BLITZBEAT // Not Blitz Beat -> Block attack!
    	    || s_sd == NULL // Attacker is not a character -> Block attack!
    	    || s_sd->job != MAPID_SNIPER) { // Attacker is not a Sniper -> Block attack!
    		return 0;
    	}
    }

     

     

    Quote

    Healing Skill max. limit or cap will be 100%. Having 101% or 150% Increase Effectiveness of Healing Skill will be limit to 100% only.

    Modify skill_add_heal_rate in conf/map/battle/skill.conf.

     

     

    Quote

     

    True Sight Skill (Sniper)I cannot find the source code to modify. Checked battle.c/h skill.c/.h, and status.c

    Mind Breaker (MATK Buff), Deluge(HP Buff), Violent Gale (Flee Buff), and Volcano (Attack Buff) I can't also find their source code.

     

    I guess you want to modify the bonus stats. Therefor just search for these constants in src/map/status.c:

    SC_TRUESIGHT
    SC_MINDBREAKER
    SC_DELUGE
    SC_VIOLENTGALE
    SC_VOLCANO

     

     

    Quote

    Where can I modify / edit minimum & maximum MATK Formulas (Derives Player Base Level, Status INT)

    In src/map/status.c have a look at these functions:

    status_base_matk_min()
    status_base_matk_max()

     

     

    Quote

    Where can I modify the MATKModifier, the Original Calculation for MATK = (StatusMATK + WeaponMATK + EquipMATK) × MATKModifier, I wanted to make MATK = StatusMATK * MATKModifier (means even I have equipment with high MATK, It wont affected by MATKModifier

    That's not as easy as you may think. To keep it simple, just don't apply the bMatk and bMatkRate bonuses.
    In src/map/pc.c -> pc_bonus()

    // Change:
    case SP_MATK_RATE:
    	if(sd->state.lr_flag != 2)
    		sd->matk_rate += val;
    	break;
    
    // To:
    case SP_MATK_RATE:
    	   break;
    
    // ##############################################################################################
    
    // Change:
    case SP_EMATK:
    	   if(sd->state.lr_flag != 2)
    		   sd->bonus.ematk += val;
    	   break;
    
    // To:
    case SP_EMATK:
    	   break;

     

     

     

    ~Kenpachi


  15. Quote

    this will make max resist for all Race only 50% right?

    No, since you can't use RC_ALL.

     

     

    Quote

    EDIT: Doesn;t work with RC_ALL (added each one of Race, excluding 

    RC_NonDemiHuman,RC_NonPlayer,RC_DemiPlayer,RC_NonDemiPlayer,RC_All which gives me problem compiling when those are included.)

    You can only use the following races. The other ones are combined types.

    RC_FORMLESS	///< Formless
    RC_UNDEAD	///< Undead
    RC_BRUTE	///< Beast/Brute
    RC_PLANT	///< Plant
    RC_INSECT	///< Insect
    RC_FISH		///< Fish
    RC_DEMON	///< Demon
    RC_DEMIHUMAN	///< Demi-Human (not including Player)
    RC_ANGEL	///< Angel
    RC_DRAGON	///< Dragon
    RC_PLAYER	///< Player
    RC_BOSS		///< Boss
    RC_NONBOSS	///< Non-boss

     

     

    Quote

    Also, im currently using Pre Renewal, does this work also on pre renewal if compiled?

    Yes.  The renewal code won't be compiled. But if you want to, you can add only pre-RE code. (Note the 'n' in #ifndef. This means "if NOT defined RENEWAL".)

    #ifndef RENEWAL
    	sd->subrace[RC_FORMLESS] = max(sd->subrace[RC_FORMLESS], 50);
    	sd->subrace[RC_UNDEAD] = max(sd->subrace[RC_UNDEAD], 50);
    	sd->subrace[RC_BRUTE] = max(sd->subrace[RC_BRUTE], 50);
    	sd->subrace[RC_PLANT] = max(sd->subrace[RC_PLANT], 50);
    	sd->subrace[RC_INSECT] = max(sd->subrace[RC_INSECT], 50);
    	sd->subrace[RC_FISH] = max(sd->subrace[RC_FISH], 50);
    	sd->subrace[RC_DEMON] = max(sd->subrace[RC_DEMON], 50);
    	sd->subrace[RC_DEMIHUMAN] = max(sd->subrace[RC_DEMIHUMAN], 50);
    	sd->subrace[RC_ANGEL] = max(sd->subrace[RC_ANGEL], 50);
    	sd->subrace[RC_DRAGON] = max(sd->subrace[RC_DRAGON], 50);
    	sd->subrace[RC_PLAYER] = max(sd->subrace[RC_PLAYER], 50);
    	sd->subrace[RC_BOSS] = max(sd->subrace[RC_BOSS], 50);
    	sd->subrace[RC_NONBOSS] = max(sd->subrace[RC_NONBOSS], 50);
    #endif

     

     

    ~Kenpachi

×
×
  • Create New...

Important Information

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