- Added function mob_respawn which makes a mob respawn on spot 3 seconds after deafeat if SC_KAIZEL is active.

- Modified NPC_REBIRTH to use Kaizel level 1.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5240 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex 2006-02-09 19:43:13 +00:00
parent 1e53de04f6
commit 66a453cc74
4 changed files with 48 additions and 17 deletions

View File

@ -4,8 +4,10 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EVERYTHING ELSE IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EVERYTHING ELSE
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/02/09 2006/02/09
* Added function mob_respawn which makes a mob respawn on spot 3 seconds
after defeat if SC_KAIZEL is active. [Skotlex]
* Modified NPC_REBIRTH to use Kaizel level 1. [Skotlex]
* Added setting max_exp_gain_rate which caps how much exp you can get from * Added setting max_exp_gain_rate which caps how much exp you can get from
a single kill. See battle/exp.txt for details. [Skotlex] a single kill. See battle/exp.txt for details. [Skotlex]
* pc_readdb will now cap experience required per level to UINT_MAX, it will * pc_readdb will now cap experience required per level to UINT_MAX, it will

View File

@ -2166,6 +2166,32 @@ int mob_deleteslave(struct mob_data *md)
map_foreachinmap(mob_deleteslave_sub, md->bl.m, BL_MOB,md->bl.id); map_foreachinmap(mob_deleteslave_sub, md->bl.m, BL_MOB,md->bl.id);
return 0; return 0;
} }
// Mob respawning through KAIZEL or NPC_REBIRTH [Skotlex]
int mob_respawn(int tid, unsigned int tick, int id,int data )
{
struct mob_data *md = (struct mob_data*)map_id2bl(id);
if (!md || md->bl.type != BL_MOB)
return 0;
//Mob must be dead and not in a map to respawn!
if (md->bl.prev != NULL || md->state.state != MS_DEAD)
return 0;
md->state.state = MS_IDLE;
md->state.skillstate = MSS_IDLE;
md->timer = -1;
md->last_thinktime = tick;
md->next_walktime = tick+rand()%50+5000;
md->attackabletime = tick;
md->canmove_tick = tick;
md->last_linktime = tick;
map_addblock(&md->bl);
mob_heal(md,data*status_get_max_hp(&md->bl)/100);
skill_unit_move(&md->bl,tick,1);
clif_spawnmob(md);
mobskill_use(md, tick, MSC_SPAWN);
return 1;
}
/*========================================== /*==========================================
* It is the damage of sd to damage to md. * It is the damage of sd to damage to md.
@ -2324,16 +2350,6 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
if(md->hp > 0) if(md->hp > 0)
return damage; return damage;
//Not the most correct way ever, but this is totally custom anyway.... [Skotlex]
if (md->sc.data[SC_KAIZEL].timer != -1) {
max_hp = status_get_max_hp(&md->bl);
mob_heal(md, 10*md->sc.data[SC_KAIZEL].val1*max_hp/100);
clif_resurrection(&md->bl, 1);
status_change_start(&md->bl,SkillStatusChangeTable[PR_KYRIE],100,10,0,0,0,skill_get_time2(SL_KAIZEL, md->sc.data[SC_KAIZEL].val1),0);
status_change_end(&md->bl,SC_KAIZEL,-1);
return damage;
}
// ----- ±±©çŽ€S<E28093>ˆ<CB86> ----- // ----- ±±©çŽ€S<E28093>ˆ<CB86> -----
mode = status_get_mode(&md->bl); //Mode will be used for various checks regarding exp/drops. mode = status_get_mode(&md->bl); //Mode will be used for various checks regarding exp/drops.
@ -2342,9 +2358,21 @@ int mob_damage(struct block_list *src,struct mob_data *md,int damage,int type)
//I just recycled ret because it isn't used until much later and I didn't want to add a new variable for it. //I just recycled ret because it isn't used until much later and I didn't want to add a new variable for it.
ret = (md->sc.data[SC_RICHMANKIM].timer != -1)?(25 + 11*md->sc.data[SC_RICHMANKIM].val1):0; ret = (md->sc.data[SC_RICHMANKIM].timer != -1)?(25 + 11*md->sc.data[SC_RICHMANKIM].val1):0;
md->state.skillstate = MSS_DEAD;
mobskill_use(md,tick,-1); //On Dead skill.
if (md->sc.data[SC_KAIZEL].timer != -1) {
//Revive in a bit.
max_hp = 10*md->sc.data[SC_KAIZEL].val1; //% of life to rebirth with
mob_changestate(md,MS_DEAD,0);
clif_clearchar_area(&md->bl,1);
map_delblock(&md->bl);
add_timer(gettick()+3000, mob_respawn, md->bl.id, max_hp);
return damage;
}
map_freeblock_lock(); map_freeblock_lock();
mob_changestate(md,MS_DEAD,0); mob_changestate(md,MS_DEAD,0);
mobskill_use(md,tick,-1); // 死亡時スキル
memset(tmpsd,0,sizeof(tmpsd)); memset(tmpsd,0,sizeof(tmpsd));
memset(pt,0,sizeof(pt)); memset(pt,0,sizeof(pt));
@ -5016,6 +5044,7 @@ int do_init_mob(void)
add_timer_func_list(mobskill_castend_pos,"mobskill_castend_pos"); add_timer_func_list(mobskill_castend_pos,"mobskill_castend_pos");
add_timer_func_list(mob_timer_delete,"mob_timer_delete"); add_timer_func_list(mob_timer_delete,"mob_timer_delete");
add_timer_func_list(mob_spawn_guardian_sub,"mob_spawn_guardian_sub"); add_timer_func_list(mob_spawn_guardian_sub,"mob_spawn_guardian_sub");
add_timer_func_list(mob_respawn,"mob_respawn");
add_timer_interval(gettick()+MIN_MOBTHINKTIME,mob_ai_hard,0,0,MIN_MOBTHINKTIME); add_timer_interval(gettick()+MIN_MOBTHINKTIME,mob_ai_hard,0,0,MIN_MOBTHINKTIME);
add_timer_interval(gettick()+MIN_MOBTHINKTIME*10,mob_ai_lazy,0,0,MIN_MOBTHINKTIME*10); add_timer_interval(gettick()+MIN_MOBTHINKTIME*10,mob_ai_lazy,0,0,MIN_MOBTHINKTIME*10);

View File

@ -4949,9 +4949,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, in
break; break;
case NPC_REBIRTH: case NPC_REBIRTH:
if (md && md->state.state == MS_DEAD) { //New rebirth System uses Kaizel lv1. [Skotlex]
mob_setdelayspawn (md->bl.id); status_change_start(bl,SkillStatusChangeTable[skillid],100,1,0,0,0,skill_get_time(SL_KAIZEL,skilllv),0);
}
break; break;
case NPC_DARKBLESSING: case NPC_DARKBLESSING:

View File

@ -131,7 +131,8 @@ int SkillStatusChangeTable[]={
-1, -1,
SC_STAN, SC_STAN,
SC_HALLUCINATION, SC_HALLUCINATION,
-1,-1, SC_KAIZEL,
-1,
/* 210- */ /* 210- */
-1,-1,-1,-1,-1, -1,-1,-1,-1,-1,
SC_STRIPWEAPON, SC_STRIPWEAPON,