forked from MagicBane/Server
mob attack delay
This commit is contained in:
@@ -50,6 +50,16 @@ public class MobAI {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int delay = 3000;
|
||||||
|
if(mob.charItemManager.getEquipped().get(Enum.EquipSlotType.RHELD) != null){
|
||||||
|
delay = (int)(mob.charItemManager.getEquipped().get(Enum.EquipSlotType.RHELD).template.item_weapon_wepspeed * 100);
|
||||||
|
}
|
||||||
|
if(mob.charItemManager.getEquipped().get(Enum.EquipSlotType.LHELD) != null && mob.charItemManager.getEquipped().get(Enum.EquipSlotType.LHELD).template.item_type.equals(Enum.ItemType.WEAPON)){
|
||||||
|
delay += (int)(mob.charItemManager.getEquipped().get(Enum.EquipSlotType.LHELD).template.item_weapon_wepspeed * 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
mob.lastAttackTime = System.currentTimeMillis() + delay;
|
||||||
if (target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) &&
|
if (target.getObjectType().equals(Enum.GameObjectType.PlayerCharacter) &&
|
||||||
!mob.canSee((AbstractCharacter) target)) {
|
!mob.canSee((AbstractCharacter) target)) {
|
||||||
mob.setCombatTarget(null);
|
mob.setCombatTarget(null);
|
||||||
@@ -120,7 +130,6 @@ public class MobAI {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
CombatManager.combatCycle(mob,mob.combatTarget);
|
CombatManager.combatCycle(mob,mob.combatTarget);
|
||||||
mob.lastAttackTime = System.currentTimeMillis();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.getPet() != null)
|
if (target.getPet() != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user