diff options
author | shennetsind <ind@henn.et> | 2015-01-18 11:57:42 -0200 |
---|---|---|
committer | shennetsind <ind@henn.et> | 2015-01-18 11:57:42 -0200 |
commit | ca3f103a32221eda0929927563e4f9961472afdf (patch) | |
tree | 515c6310199ae4f5ac60a35b57332cdcd52dcf61 | |
parent | df961e808a5256031ad3697650ab5f4ba5ddbe16 (diff) | |
download | hercules-ca3f103a32221eda0929927563e4f9961472afdf.tar.gz hercules-ca3f103a32221eda0929927563e4f9961472afdf.tar.bz2 hercules-ca3f103a32221eda0929927563e4f9961472afdf.tar.xz hercules-ca3f103a32221eda0929927563e4f9961472afdf.zip |
Replacing rand leftovers with the mt19937ar
Signed-off-by: shennetsind <ind@henn.et>
-rw-r--r-- | src/char/pincode.c | 2 | ||||
-rw-r--r-- | src/map/battle.c | 10 | ||||
-rw-r--r-- | src/map/clif.c | 2 | ||||
-rw-r--r-- | src/map/irc-bot.c | 2 | ||||
-rw-r--r-- | src/map/mob.c | 2 | ||||
-rw-r--r-- | src/map/skill.c | 8 | ||||
-rw-r--r-- | src/map/status.c | 2 |
7 files changed, 14 insertions, 14 deletions
diff --git a/src/char/pincode.c b/src/char/pincode.c index 02c71b3b6..325a705a5 100644 --- a/src/char/pincode.c +++ b/src/char/pincode.c @@ -104,7 +104,7 @@ void pincode_setnew(int fd, struct char_session_data* sd) { void pincode_sendstate(int fd, struct char_session_data* sd, uint16 state) { WFIFOHEAD(fd, 12); WFIFOW(fd, 0) = 0x8b9; - WFIFOL(fd, 2) = sd->pincode_seed = rand() % 0xFFFF; + WFIFOL(fd, 2) = sd->pincode_seed = rnd() % 0xFFFF; WFIFOL(fd, 6) = sd->account_id; WFIFOW(fd,10) = state; WFIFOSET(fd,12); diff --git a/src/map/battle.c b/src/map/battle.c index a5090c641..331de1162 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -2672,7 +2672,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam } } - if( sc->data[SC_ZEPHYR] && ((flag&BF_LONG) || rand()%100 < 10) ) { + if( sc->data[SC_ZEPHYR] && ((flag&BF_LONG) || rnd()%100 < 10) ) { d->dmg_lv = ATK_BLOCK; return 0; } @@ -3042,7 +3042,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam status_change_end(bl, SC_KYRIE, INVALID_TIMER); } - if( sc->data[SC_MEIKYOUSISUI] && rand()%100 < 40 ) // custom value + if( sc->data[SC_MEIKYOUSISUI] && rnd()%100 < 40 ) // custom value damage = 0; @@ -3850,14 +3850,14 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list * case KO_MUCHANAGE: md.damage = skill->get_zeny(skill_id ,skill_lv); - md.damage = md.damage * (50 + rand()%50) / 100; + md.damage = md.damage * (50 + rnd()%50) / 100; if ( is_boss(target) || (sd && !pc->checkskill(sd,NJ_TOBIDOUGU)) ) md.damage >>= 1; break; case NJ_ZENYNAGE: md.damage = skill->get_zeny(skill_id ,skill_lv); if (!md.damage) md.damage = 2; - md.damage = rand()%md.damage + md.damage; + md.damage = rnd()%md.damage + md.damage; if (is_boss(target)) md.damage=md.damage / 3; else if (tsd) @@ -5540,7 +5540,7 @@ void battle_reflect_damage(struct block_list *target, struct block_list *src, st delay += 100;/* gradual increase so the numbers don't clip in the client */ } - if( sc->data[SC_LG_REFLECTDAMAGE] && rand()%100 < (30 + 10*sc->data[SC_LG_REFLECTDAMAGE]->val1) ) { + if( sc->data[SC_LG_REFLECTDAMAGE] && rnd()%100 < (30 + 10*sc->data[SC_LG_REFLECTDAMAGE]->val1) ) { bool change = false; NORMALIZE_RDAMAGE(damage * sc->data[SC_LG_REFLECTDAMAGE]->val2 / 100); diff --git a/src/map/clif.c b/src/map/clif.c index 57e01278b..4c6b7d2f9 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2756,7 +2756,7 @@ void read_channels_config(void) { } if( libconfig->setting_lookup_string(settings, "irc_channel_nick", &irc_nick) ) { if( strcmpi(irc_nick,"Hercules_chSysBot") == 0 ) { - sprintf(clif->hChSys->irc_nick, "Hercules_chSysBot%d",rand()%777); + sprintf(clif->hChSys->irc_nick, "Hercules_chSysBot%d",rnd()%777); } else safestrncpy(clif->hChSys->irc_nick, irc_nick, 40); } else { diff --git a/src/map/irc-bot.c b/src/map/irc-bot.c index bd35a9867..36c19ccbd 100644 --- a/src/map/irc-bot.c +++ b/src/map/irc-bot.c @@ -58,7 +58,7 @@ int irc_identify_timer(int tid, int64 tick, int id, intptr_t data) { if( !ircbot->isOn ) return 0; - sprintf(send_string, "USER HerculesWS%d 8 * : Hercules IRC Bridge",rand()%777); + sprintf(send_string, "USER HerculesWS%d 8 * : Hercules IRC Bridge",rnd()%777); ircbot->send(send_string); sprintf(send_string, "NICK %s", clif->hChSys->irc_nick); ircbot->send(send_string); diff --git a/src/map/mob.c b/src/map/mob.c index 0eb1a9833..3d883a2f1 100644 --- a/src/map/mob.c +++ b/src/map/mob.c @@ -2508,7 +2508,7 @@ int mob_dead(struct mob_data *md, struct block_list *src, int type) { for(i = 0; i < MAX_MVP_DROP; i++) { while( 1 ) { - int va = rand()%MAX_MVP_DROP; + int va = rnd()%MAX_MVP_DROP; if( !mdrop_id[va] || !md->db->mvpitem[i].nameid ) { mdrop_id[va] = md->db->mvpitem[i].nameid; mdrop_p[va] = md->db->mvpitem[i].p; diff --git a/src/map/skill.c b/src/map/skill.c index 6b0c99522..05cb887f9 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1219,9 +1219,9 @@ int skill_additional_effect(struct block_list* src, struct block_list *bl, uint1 case LG_HESPERUSLIT: if ( sc && sc->data[SC_BANDING] ) { if ( sc->data[SC_BANDING]->val2 == 4 ) // 4 banding RGs: Targets will be stunned at 100% chance for 4 ~ 8 seconds, irreducible by STAT. - status->change_start(src, bl, SC_STUN, 10000, skill_lv, 0, 0, 0, 1000*(4+rand()%4), SCFLAG_FIXEDTICK); + status->change_start(src, bl, SC_STUN, 10000, skill_lv, 0, 0, 0, 1000*(4+rnd()%4), SCFLAG_FIXEDTICK); else if ( sc->data[SC_BANDING]->val2 == 6 ) // 6 banding RGs: activate Pinpoint Attack Lv1-5 - skill->castend_damage_id(src,bl,LG_PINPOINTATTACK,1+rand()%5,tick,0); + skill->castend_damage_id(src,bl,LG_PINPOINTATTACK,1+rnd()%5,tick,0); } break; case LG_PINPOINTATTACK: @@ -2677,7 +2677,7 @@ int skill_attack(int attack_type, struct block_list* src, struct block_list *dsr // This ensures the storm randomly pushes instead of exactly a cell backwards per official mechanics. case WZ_STORMGUST: if(!battle_config.stormgust_knockback) - dir = rand()%8; + dir = rnd()%8; break; case WL_CRIMSONROCK: dir = map->calc_dir(bl,skill->area_temp[4],skill->area_temp[5]); @@ -9663,7 +9663,7 @@ int skill_castend_nodamage_id(struct block_list *src, struct block_list *bl, uin case KO_JYUSATSU: if( dstsd && tsc && !tsc->data[type] - && rand()%100 < (10 * (5 * skill_lv - status_get_int(bl) / 2 + 45 + 5 * skill_lv)) + && rnd()%100 < (10 * (5 * skill_lv - status_get_int(bl) / 2 + 45 + 5 * skill_lv)) ) { clif->skill_nodamage(src, bl, skill_id, skill_lv, status->change_start(src, bl, type, 10000, skill_lv, 0, 0, 0, skill->get_time(skill_id, skill_lv), SCFLAG_NOAVOID)); diff --git a/src/map/status.c b/src/map/status.c index e61c1df19..6836d9b70 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -9025,7 +9025,7 @@ int status_change_start(struct block_list *src, struct block_list *bl, enum sc_t { int hp = status_get_hp(bl), sp = status_get_sp(bl), lv = 5; - if( rand()%100 > (25 + 10 * val1) - status_get_int(bl) / 2) + if( rnd()%100 > (25 + 10 * val1) - status_get_int(bl) / 2) return 0; PER( 100 / (status_get_max_hp(bl) / hp), lv ); |