Jump to content

Question

Posted

I want to make a player that will be immune to frost by using this build :

45 base MDEF + 110 Luk = No Frost

Sorry for my bad english pls help.

up

19 answers to this question

Recommended Posts

Posted

use this setting

pc_max_status_def: 185

however this may affect other statuses

better use this...

@status.c

		if (sd) tick>>=1; //Half duration for players.
case SC_STONE:
case SC_FREEZE:
	sc_def = 3 +status->mdef;

	+if(sd && type == SC_FREEZE && sc_def >= 51 && status->luk >= 110)
	+	sc_def = battle_config.pc_max_sc_def;
	break;

then recompile

  • Upvote 1
Posted (edited)

I swear Frost is a Renewal Status.. How can it be in the eAthena emulator?

Unless you mean "Freeze" like malu wrote in the codebox lol

Edited by Mysterious
Posted

I can only see this

//Adjust tick according to status resistances

if( !(flag&(1|4)) )

{

tick = status_get_sc_def(bl, type, rate, tick, flag);

if( !tick ) return 0;

}

undead_flag = battle_check_undead(status->race,status->def_ele);

//Check for inmunities / sc fails

switch (type)

{

case SC_FREEZE:

case SC_STONE:

//Undead are immune to Freeze/Stone

if (undead_flag && !(flag&1))

return 0;

case SC_SLEEP:

case SC_STUN:

if (sc->opt1)

return 0; //Cannot override other opt1 status changes. [skotlex]

break;

case SC_SIGNUMCRUCIS:

//Only affects demons and undead element (but not players)

if((!undead_flag && status->race!=RC_DEMON) || bl->type == BL_PC)

return 0;

break;

Posted

wew.... seriously you can't find this piece of code??

//Applies SC defense to a given status change.
//Returns the adjusted duration based on flag values.
//the flag values are the same as in status_change_start.
int status_get_sc_def(struct block_list *bl, enum sc_type type, int rate, int tick, int flag)
{
int sc_def, tick_def = 0;
struct status_data* status;
struct status_change* sc;
struct map_session_data *sd;
nullpo_ret(bl);
//Status that are blocked by Golden Thief Bug card or Wand of Hermod
if (status_isimmune(bl))
switch (type)
{
case SC_DECREASEAGI:
case SC_SILENCE:
case SC_COMA:
case SC_INCREASEAGI:
case SC_BLESSING:
case SC_SLOWPOISON:
case SC_IMPOSITIO:
case SC_AETERNA:
case SC_SUFFRAGIUM:
case SC_BENEDICTIO:
case SC_PROVIDENCE:
case SC_KYRIE:
case SC_ASSUMPTIO:
case SC_ANGELUS:
case SC_MAGNIFICAT:
case SC_GLORIA:
case SC_WINDWALK:
case SC_MAGICROD:
case SC_HALLUCINATION:
case SC_STONE:
case SC_QUAGMIRE:
case SC_SUITON:
 return 0;
}

sd = BL_CAST(BL_PC,bl);
status = status_get_status_data(bl);
switch (type)
{
case SC_STUN:
case SC_POISON:
case SC_DPOISON:
case SC_SILENCE:
case SC_BLEEDING:
 sc_def = 3 +status->vit;
 break;
case SC_SLEEP:
 sc_def = 3 +status->int_;
 break;
case SC_DECREASEAGI:
 if (sd) tick>>=1; //Half duration for players.
case SC_STONE:
case SC_FREEZE:
 sc_def = 3 +status->mdef;
 break;
case SC_CURSE:
 //Special property: inmunity when luk is greater than level or zero
 if (status->luk > status_get_lv(bl) || status->luk == 0)
  return 0;
 else
  sc_def = 3 +status->luk;
 tick_def = status->vit;
 break;
case SC_BLIND:
 sc_def = 3 +(status->vit + status->int_)/2;
 break;
case SC_CONFUSION:
 sc_def = 3 +(status->str + status->int_)/2;
 break;
case SC_ANKLE:
 if(status->mode&MD_BOSS) // Lasts 5 times less on bosses
  tick /= 5;
 sc_def = status->agi / 2;
 break;
case SC_MAGICMIRROR:
case SC_ARMORCHANGE:
 if (sd) //Duration greatly reduced for players.
  tick /= 15;
 //No defense against it (buff).
default:
 //Effect that cannot be reduced? Likely a buff.
 if (!(rand()%10000 < rate))
  return 0;
 return tick?tick:1;
}

if (sd) {
 if (battle_config.pc_sc_def_rate != 100)
  sc_def = sc_def*battle_config.pc_sc_def_rate/100;
 if (sc_def < battle_config.pc_max_sc_def)
  sc_def += (battle_config.pc_max_sc_def - sc_def)*
   status->luk/battle_config.pc_luk_sc_def;
 else
  sc_def = battle_config.pc_max_sc_def;
 if (tick_def) {
  if (battle_config.pc_sc_def_rate != 100)
   tick_def = tick_def*battle_config.pc_sc_def_rate/100;
 }
} else {
 if (battle_config.mob_sc_def_rate != 100)
  sc_def = sc_def*battle_config.mob_sc_def_rate/100;
 if (sc_def < battle_config.mob_max_sc_def)
  sc_def += (battle_config.mob_max_sc_def - sc_def)*
   status->luk/battle_config.mob_luk_sc_def;
 else
  sc_def = battle_config.mob_max_sc_def;
 if (tick_def) {
  if (battle_config.mob_sc_def_rate != 100)
   tick_def = tick_def*battle_config.mob_sc_def_rate/100;
 }
}

sc = status_get_sc(bl);
if (sc && sc->count)
{
 if (sc->data[sC_SCRESIST])
  sc_def += sc->data[sC_SCRESIST]->val1; //Status resist
 else if (sc->data[sC_SIEGFRIED])
  sc_def += sc->data[sC_SIEGFRIED]->val3; //Status resistance.
}
//When no tick def, reduction is the same for both.
if( !tick_def && type != SC_STONE ) //Recent tests show duration of petrify isn't reduced by MDEF. [inkfish]
 tick_def = sc_def;
//Natural resistance
if (!(flag&8)) {
 rate -= rate*sc_def/100;
 //Item resistance (only applies to rate%)
 if(sd && SC_COMMON_MIN <= type && type <= SC_COMMON_MAX)
 {
  if( sd->reseff[type-SC_COMMON_MIN] > 0 )
   rate -= rate*sd->reseff[type-SC_COMMON_MIN]/10000;
  if( sd->sc.data[sC_COMMONSC_RESIST] )
   rate -= rate*sd->sc.data[sC_COMMONSC_RESIST]->val1/100;
 }
}
if (!(rand()%10000 < rate))
 return 0;
//Why would a status start with no duration? Presume it has
//duration defined elsewhere.
if (!tick) return 1;
//Rate reduction
 if (flag&2)
 return tick;
tick -= tick*tick_def/100;
// Changed to 5 seconds according to recent tests [Playtester]
if (type == SC_ANKLE && tick < 5000)
 tick = 5000;
return tick<=0?0:tick;
}

then how come there is a tick = status_get_sc_def(bl, type, rate, tick, flag); line in your code????

Posted

ok..if your using Visual Studio right click this part 'status_get_sc_def(bl, type, rate, tick, flag);' then select 'Go to Definition' then it will redirect you to the location of the code..if you can't still find it upload your status.c and I will be the one to do it...

Posted (edited)

malufett..

how if i want my server dont want to be frozen if they char have int ==100?

what to edit in src?

You take the same code:

		if (sd) tick>>=1; //Half duration for players.
case SC_STONE:
case SC_FREEZE:
	sc_def = 3 +status->mdef;

	+if(sd && type == SC_FREEZE && sc_def == 51 && status->luk == 110)
	+	sc_def = battle_config.pc_max_sc_def;
	break;

and change luk to INT and 110 to 100:

		if (sd) tick>>=1; //Half duration for players.
case SC_STONE:
case SC_FREEZE:
	sc_def = 3 +status->mdef;

	+if(sd && type == SC_FREEZE && sc_def == 51 && status->int == 100)
	+	sc_def = battle_config.pc_max_sc_def;
	break;

Should work the same way.

Edited by Mysterious

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...