- Added code to remove a trap when it dies.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12566 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
zephyrus 2008-04-11 16:34:50 +00:00
parent 00a5bccbd3
commit 3f1e9f8d9b

View File

@ -9593,14 +9593,11 @@ int skill_unit_timer_sub (struct block_list* bl, va_list ap)
break;
case UNT_ANKLESNARE:
if( group->val2 > 0 ) { // used trap
struct block_list *target = map_id2bl(group->val2);
if(target)
status_change_end(target,SC_ANKLE,-1);
if( group->val2 > 0 ) {
// Used Trap don't returns back to item
skill_delunit(unit);
break;
}
// else fall through
case UNT_SKIDTRAP:
case UNT_LANDMINE:
case UNT_SHOCKWAVE:
@ -9610,8 +9607,8 @@ int skill_unit_timer_sub (struct block_list* bl, va_list ap)
case UNT_CLAYMORETRAP:
case UNT_TALKIEBOX:
{
struct block_list* src = map_id2bl(group->src_id);
if( src && src->type == BL_PC )
struct block_list* src;
if( unit->val1 > 0 && (src = map_id2bl(group->src_id)) != NULL && src->type == BL_PC )
{ // revert unit back into a trap
struct item item_tmp;
memset(&item_tmp,0,sizeof(item_tmp));
@ -9667,6 +9664,23 @@ int skill_unit_timer_sub (struct block_list* bl, va_list ap)
if( unit->val1 <= 0 && unit->limit + group->tick > tick + 700 )
unit->limit = DIFF_TICK(tick+700,group->tick);
break;
case UNT_SKIDTRAP:
case UNT_LANDMINE:
case UNT_SHOCKWAVE:
case UNT_SANDMAN:
case UNT_FLASHER:
case UNT_FREEZINGTRAP:
case UNT_TALKIEBOX:
case UNT_ANKLESNARE:
if( unit->val1 <= 0 ) {
if( group->unit_id == UNT_ANKLESNARE && group->val2 > 0 )
skill_delunit(unit);
else {
group->unit_id = UNT_USED_TRAPS;
group->limit = DIFF_TICK(tick, group->tick) + 1500;
}
}
break;
case UNT_TATAMIGAESHI:
if( unit->range >= 0 )
{ //Disable processed cell.