mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-06-14 00:14:40 +02:00
Updated Map Server namespace. Moved all other data folders (www and sql) to data folder. Renamed boot name to Project Meteor.
This commit is contained in:
parent
18ef69f3d1
commit
91549bff7a
1823 changed files with 102704 additions and 901 deletions
108
Map Server/Actors/Chara/Ai/Controllers/PlayerController.cs
Normal file
108
Map Server/Actors/Chara/Ai/Controllers/PlayerController.cs
Normal file
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
===========================================================================
|
||||
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;
|
||||
using Meteor.Map.Actors;
|
||||
|
||||
namespace Meteor.Map.actors.chara.ai.controllers
|
||||
{
|
||||
class PlayerController : Controller
|
||||
{
|
||||
private new Player owner;
|
||||
public PlayerController(Player owner) :
|
||||
base(owner)
|
||||
{
|
||||
this.owner = owner;
|
||||
this.lastUpdate = DateTime.Now;
|
||||
}
|
||||
|
||||
public override void Update(DateTime tick)
|
||||
{
|
||||
/*
|
||||
if (owner.newMainState != owner.currentMainState)
|
||||
{
|
||||
if (owner.newMainState == SetActorStatePacket.MAIN_STATE_ACTIVE)
|
||||
{
|
||||
owner.Engage();
|
||||
}
|
||||
else
|
||||
{
|
||||
owner.Disengage();
|
||||
}
|
||||
owner.currentMainState = (ushort)owner.newMainState;
|
||||
}*/
|
||||
}
|
||||
|
||||
public override void ChangeTarget(Character target)
|
||||
{
|
||||
owner.target = target;
|
||||
base.ChangeTarget(target);
|
||||
}
|
||||
|
||||
public override bool Engage(Character target)
|
||||
{
|
||||
var canEngage = this.owner.aiContainer.InternalEngage(target);
|
||||
if (canEngage)
|
||||
{
|
||||
if (owner.statusEffects.HasStatusEffect(StatusEffectId.Sleep))
|
||||
{
|
||||
// That command cannot be performed.
|
||||
owner.SendGameMessage(Server.GetWorldManager().GetActor(), 32553, 0x20);
|
||||
return false;
|
||||
}
|
||||
// todo: adjust cooldowns with modifiers
|
||||
}
|
||||
return canEngage;
|
||||
}
|
||||
|
||||
public override void Disengage()
|
||||
{
|
||||
// todo:
|
||||
base.Disengage();
|
||||
return;
|
||||
}
|
||||
|
||||
public override void Cast(Character target, uint spellId)
|
||||
{
|
||||
owner.aiContainer.InternalCast(target, spellId);
|
||||
}
|
||||
|
||||
public override void WeaponSkill(Character target, uint weaponSkillId)
|
||||
{
|
||||
owner.aiContainer.InternalWeaponSkill(target, weaponSkillId);
|
||||
}
|
||||
|
||||
public override void Ability(Character target, uint abilityId)
|
||||
{
|
||||
owner.aiContainer.InternalAbility(target, abilityId);
|
||||
}
|
||||
|
||||
public override void RangedAttack(Character target)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void UseItem(Character target, uint slot, uint itemId)
|
||||
{
|
||||
owner.aiContainer.InternalUseItem(target, slot, itemId);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue