diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-09 17:58:00 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-09 17:58:00 +0000 |
commit | b15e0c4634b8c8f62f7110617ed5c3ccf2078d04 (patch) | |
tree | 9d1c713a81099d766b94186f76d3d715c854c7ba /src/map/skill.c | |
parent | 9f32d1bcd171917b444c0359c250b80b810f41c1 (diff) | |
download | hercules-b15e0c4634b8c8f62f7110617ed5c3ccf2078d04.tar.gz hercules-b15e0c4634b8c8f62f7110617ed5c3ccf2078d04.tar.bz2 hercules-b15e0c4634b8c8f62f7110617ed5c3ccf2078d04.tar.xz hercules-b15e0c4634b8c8f62f7110617ed5c3ccf2078d04.zip |
- Should have fixed a signed/unsigned warning in login-txt
- Moved the class-change code from battle_calc_weapon_attack to skill_additional_effect.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8211 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/skill.c')
-rw-r--r-- | src/map/skill.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/map/skill.c b/src/map/skill.c index e2239d84f..c541ad4ac 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -1454,6 +1454,32 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, int break; //Only one auto skill comes off at a time. } } + + //Polymorph + if(sd && sd->classchange && attack_type&BF_WEAPON && + dstmd && !(tstatus->mode&MD_BOSS) && !dstmd->guardian_data && + (dstmd->class_ < 1324 || dstmd->class_ > 1363) && //Treasure boxes + !mob_is_clone(dstmd->class_) && + (rand()%10000 < sd->classchange)) + { + struct mob_db *mob; + int class_; + skill = 0; + do { + do { + class_ = rand() % MAX_MOB_DB; + } while (!mobdb_checkid(class_)); + + rate = rand() % 1000000; + mob = mob_db(class_); + } while ( + (mob->status.mode&(MD_BOSS|MD_PLANT) || mob->summonper[0] <= rate) && + (skill++) < 2000); + if (skill < 2000) + mob_class_change(dstmd,class_); + } + + return 0; } |