Summon Movements

If you want to help us or give some corrections / codes, put it here ;)

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

Summon Movements

Postby rl2171 on Tue Aug 07, 2007 10:08 pm

Summon Movements by ???
********************************

Little fix to stop support summons attacking / moving. (Bonfire, Mana Flame etc)

(monster.cpp)


  1.  
  2. bool CMonster::UpdateValues( )
  3. {    
  4.     if(IsSummon( ) && CanMove( ))
  5.     {
  6.         CPlayer* thisclient = GetOwner( );
  7.         if(thisclient!=NULL)
  8.         {
  9.             if(!IsOnBattle( ) && thisclient->IsAttacking( ))
  10.             {
  11.                 Battle->target = thisclient->Battle->target;
  12.                 Battle->atktarget = Battle->target;
  13.                 Battle->atktype = NORMAL_ATTACK;
  14.                 Battle->contatk = true;
  15.                 CCharacter* Enemy = GetCharTarget( );
  16.                 if(Enemy!=NULL)
  17.                     StartAction( Enemy, NORMAL_ATTACK );
  18.             }
  19.             else
  20.             if(!IsOnBattle( ))
  21.             {
  22.                 Position->source = thisclient->Position->current;
  23.                 float distance = GServer->distance( Position->destiny , thisclient->Position->current );
  24.                 if((distance>15 && !IsOnBattle()) || distance>50)
  25.                     Move( );                
  26.             }
  27.         }
  28.         else
  29.         {
  30.             UnspawnMonster( );
  31.             return false;
  32.         }
  33.     }                          
  34.     if(!IsMoving( ) && !IsOnBattle( ) && CanMove( ))        
  35.     {        
  36.         clock_t etime = clock() - Position->lastMoveTime;  
  37.         if(etime > 20*CLOCKS_PER_SEC)
  38.             Move( );    
  39.     }
  40.     if(!IsSummon( ))
  41.     {
  42.         CPlayer* player = GetNearPlayer( 10 );
  43.         if(player!=NULL)
  44.             OnEnemyOnSight( (CCharacter*)player );
  45.     }
  46.     return true;
  47. }
  48.  
Image
rl2171
Admin
Admin
 
Posts: 1706
Joined: Mon Aug 06, 2007 5:17 pm
Location: Sacramento, CA USA - GMT-8

Return to Submit Code

Who is online

Users browsing this forum: No registered users and 2 guests