Jump to content
  • 0

help with status.c (poison,stun,silence,freeze...)


Question

Posted

Hi... im helping a friend to edit some stuff on a rathena server but im kinda outdate about ragnarok and this source.... so i need some help the server max stat is 500, with wings and everything is 600~620 so... i need a way that they got affect from these effects:

poison,curse,sleep,silence,etc... and i want that the only way to get "inmunity" its with cards...

 

 

i got this:

switch (type) {
		case SC_POISON:
		case SC_DPOISON:
			sc_def = status->vit*700;
			sc_def2 = status->luk*10 + status_get_lv(bl)*10 - status_get_lv(src)*10;
			if (sd) {
				// For players: 60000 - 450*vit - 100*luk
				tick_def = status->vit*75;
				tick_def2 = status->luk*100;
			} else {
				// For monsters: 30000 - 200*vit
				tick>>=1;
				tick_def = (status->vit*200)/3;
			}
			break;
		case SC_STUN:
			sc_def = status->vit*700;
			sc_def2 = status->luk*10 + status_get_lv(bl)*10 - status_get_lv(src)*10;
			tick_def2 = status->luk*10;
			break;
		case SC_SILENCE:
#ifndef RENEWAL
			sc_def = status->vit*500;
			sc_def2 = status->luk*10 + status_get_lv(bl)*10 - status_get_lv(src)*10;
#else
			sc_def = status->int_*500;
			sc_def2 = (status->vit + status->luk) * 5 + status_get_lv(bl)*10 - status_get_lv(src)*10;
#endif
			tick_def2 = status->luk*10;
			break;
		case SC_BLEEDING:
#ifndef RENEWAL
			sc_def = status->vit*500;
			sc_def2 = status->luk*10 + status_get_lv(bl)*10 - status_get_lv(src)*10;
#else
			sc_def = status->agi*500;
			sc_def2 = status->luk*10 + status_get_lv(bl)*10 - status_get_lv(src)*10;
#endif
			tick_def2 = status->luk*10;
			break;
		case SC_SLEEP:
#ifndef RENEWAL
			sc_def = status->int_*500;
			sc_def2 = status->luk*10 + status_get_lv(bl)*10 - status_get_lv(src)*10;
#else
			sc_def = status->agi*500;
			sc_def2 = (status->int_ + status->luk) * 5 + status_get_lv(bl)*10 - status_get_lv(src)*10;
#endif
			tick_def2 = status->luk*10;
			break;
		case SC_STONE:
			sc_def = status->mdef*100;
			sc_def2 = status->luk*10 + status_get_lv(bl)*10 - status_get_lv(src)*10;
			tick_def = 0; // No duration reduction
			break;
		case SC_FREEZE:
			sc_def = status->mdef*100;
			sc_def2 = status->luk*10 + status_get_lv(bl)*10 - status_get_lv(src)*10;
			tick_def2 = status_src->luk*-10; // Caster can increase final duration with luk
			break;
		case SC_CURSE:
			// Special property: immunity when luk is zero
			if (status->luk == 0)
				return 0;
			sc_def = status->luk*500;
			sc_def2 = status->luk*10 - status_get_lv(src)*10; // Curse only has a level penalty and no resistance
			tick_def = status->vit*100;
			tick_def2 = status->luk*10;
			break;
		case SC_BLIND:
			sc_def = (status->vit + status->int_)*500;
			sc_def2 = status->luk*10 + status_get_lv(bl)*10 - status_get_lv(src)*10;
			tick_def2 = status->luk*10;
			break;
		case SC_CONFUSION:
			sc_def = (status->str + status->int_)*500;
			sc_def2 = status_get_lv(src)*10 - status_get_lv(bl)*10 - status->luk*10; // Reversed sc_def2
			tick_def2 = status->luk*10;
			break;

so... anyone have any idea what im talking about? pl i need solve this problem in short words... i want that characters need like... 900 of X Stat for get inmunity...

 

Thx for at least read ^^

  • Like 1

5 answers to this question

Recommended Posts

Posted (edited)

Do you still want having X amount of a stat to shorten the duration?

 

Whatever, justa add this to the beginning of each status based on the stat you want and the amount of stat you want them to have to have.

			if (status->luk == 900)// This means if(Luk = 900) Player is immune.
				return 0;

Change "luk" to the stat you want required for each.  This made status require 900 luk to prevent it.

 

For example

		case SC_STUN:
			if (status->vit == 900)// This means if(Vit = 900) Player is immune to being stunned.
				return0;
			sc_def = status->vit*700;
			sc_def2 = status->luk*10 + status_get_lv(bl)*10 - status_get_lv(src)*10;
			tick_def2 = status->luk*10;
			break;

This would make someone with 900 vit immune to stun.

 

But you also have to change the tick_def2 timer or status will still be shortened by much lower stats.

Edited by Terrinigma
  • Upvote 1
  • Like 1
Posted (edited)

i tried to edit but im kinda new with this... so idk what should i edit to make impossible get these status resistence by stats

 

i just want that the only way to protec about em be by cards effs or something about get "900" of X Stats

Edited by ItsFree

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