2019-06-18 22:55:32 -04:00
|
|
|
|
/*
|
|
|
|
|
===========================================================================
|
|
|
|
|
Copyright (C) 2015-2019 Project Meteor Dev Team
|
|
|
|
|
|
|
|
|
|
This file is part of Project Meteor Server.
|
|
|
|
|
|
|
|
|
|
Project Meteor Server is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General Public License as published by
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
Project Meteor Server is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
along with Project Meteor Server. If not, see <https:www.gnu.org/licenses/>.
|
|
|
|
|
===========================================================================
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using System;
|
2019-06-19 01:10:15 -04:00
|
|
|
|
using Meteor.Map.Actors;
|
2017-07-08 00:20:55 +01:00
|
|
|
|
|
2019-06-19 01:10:15 -04:00
|
|
|
|
namespace Meteor.Map.actors.chara.ai.controllers
|
2017-07-08 00:20:55 +01:00
|
|
|
|
{
|
2017-07-10 23:52:31 +01:00
|
|
|
|
class PetController : Controller
|
2017-07-08 00:20:55 +01:00
|
|
|
|
{
|
2017-07-10 23:52:31 +01:00
|
|
|
|
private Character petMaster;
|
|
|
|
|
|
2017-08-02 23:06:11 +01:00
|
|
|
|
public PetController(Character owner) :
|
|
|
|
|
base(owner)
|
2017-07-10 23:52:31 +01:00
|
|
|
|
{
|
|
|
|
|
this.lastUpdate = Program.Tick;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Update(DateTime tick)
|
|
|
|
|
{
|
2017-09-05 23:32:57 +01:00
|
|
|
|
// todo: handle pet stuff on tick
|
2017-07-10 23:52:31 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void ChangeTarget(Character target)
|
|
|
|
|
{
|
|
|
|
|
base.ChangeTarget(target);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool Engage(Character target)
|
|
|
|
|
{
|
|
|
|
|
// todo: check distance, last swing time, status effects
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-02 23:06:11 +01:00
|
|
|
|
public override void Disengage()
|
2017-07-10 23:52:31 +01:00
|
|
|
|
{
|
|
|
|
|
// todo:
|
2017-08-02 23:06:11 +01:00
|
|
|
|
return;
|
2017-07-10 23:52:31 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Cast(Character target, uint spellId)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void Ability(Character target, uint abilityId)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void RangedAttack(Character target)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Character GetPetMaster()
|
|
|
|
|
{
|
|
|
|
|
return petMaster;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetPetMaster(Character master)
|
|
|
|
|
{
|
|
|
|
|
petMaster = master;
|
2017-07-11 01:54:15 +01:00
|
|
|
|
|
|
|
|
|
if (master is Player)
|
|
|
|
|
owner.allegiance = CharacterTargetingAllegiance.Player;
|
|
|
|
|
else
|
|
|
|
|
owner.allegiance = CharacterTargetingAllegiance.BattleNpcs;
|
2017-07-10 23:52:31 +01:00
|
|
|
|
}
|
2017-07-08 00:20:55 +01:00
|
|
|
|
}
|
|
|
|
|
}
|