Updated Cultivation plant spawn formula (#2910)

* Fixes #2892.
* Corrected level 2 Cultivation formula for spawning plants.
Thanks to @mrjnumber1!
This commit is contained in:
Aleos 2018-02-15 21:49:12 -05:00 committed by GitHub
parent 2ecb30abb2
commit a40b1da4d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 4 deletions

View File

@ -44,6 +44,11 @@ struct guardian_data;
enum MOBID {
MOBID_PORING = 1002,
MOBID_RED_PLANT = 1078,
MOBID_BLUE_PLANT,
MOBID_GREEN_PLANT,
MOBID_YELLOW_PLANT,
MOBID_WHITE_PLANT,
MOBID_SHINING_PLANT,
MOBID_BLACK_MUSHROOM = 1084,
MOBID_MARINE_SPHERE = 1142,
MOBID_EMPERIUM = 1288,

View File

@ -11981,16 +11981,38 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
if (rnd()%100 < 50) {
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
} else {
TBL_MOB* md = mob_once_spawn_sub(src, src->m, x, y, "--ja--",(skill_lv < 2 ? MOBID_BLACK_MUSHROOM + rnd()%2 : MOBID_RED_PLANT + rnd()%6),"", SZ_SMALL, AI_NONE);
int t;
if (!md) break;
TBL_MOB* md = NULL;
int t, mob_id;
if (skill_lv == 1)
mob_id = MOBID_BLACK_MUSHROOM + rnd() % 2;
else {
int rand_val = rnd() % 100;
if (rand_val < 30)
mob_id = MOBID_GREEN_PLANT;
else if (rand_val < 55)
mob_id = MOBID_RED_PLANT;
else if (rand_val < 80)
mob_id = MOBID_YELLOW_PLANT;
else if (rand_val < 90)
mob_id = MOBID_WHITE_PLANT;
else if (rand_val < 98)
mob_id = MOBID_BLUE_PLANT;
else
mob_id = MOBID_SHINING_PLANT;
}
md = mob_once_spawn_sub(src, src->m, x, y, "--ja--", mob_id, "", SZ_SMALL, AI_NONE);
if (!md)
break;
if ((t = skill_get_time(skill_id, skill_lv)) > 0)
{
if( md->deletetimer != INVALID_TIMER )
delete_timer(md->deletetimer, mob_timer_delete);
md->deletetimer = add_timer (tick + t, mob_timer_delete, md->bl.id, 0);
}
mob_spawn (md);
mob_spawn(md);
}
}
break;