Page 1 of 2

Spiritmaster.lua

Posted: Sun Mar 05, 2017 5:51 pm
by ugel
Best one I could find in my archives :) Feel free rework it

Code: Select all

--[[

	--------------------------------------------------
	Copyright (C) 2011 Blastradius

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program 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 General Public License for more details.
	--------------------------------------------------
	
]]--

--- Find the spirit that belongs to the provided player.
--
-- @param	Integer Contains the player identifier.
-- @return	Entity

function FindSpirit( ID )

	-- Check the provided identifier to look for, otherwise use my own identifier.
	if ID == nil then
		ID = Player:GetID();
	end
	
	-- Loop through the available entities to find the spirit.
	for EntityID, Entity in DictionaryIterator( EntityList:GetList()) do
	
		-- Check if this monster is a spirit and belongs to me!
		if Entity:GetOwnerID() == ID and string.find( Entity:GetName(), "Spirit" ) ~= nil then
			return Entity;	
		end
		
	end

	-- Return nothing, the spirit has not been found.
	return nil;
	
end

--- Perform the attack routine on the selected target.
--
-- @param	Entity	Contains the entity we have targeted.
-- @param	double	Contains the distance to the target
-- @param	bool	Indicates whether or not the target is stunned.
-- @param	mixed	Indicates whether or not to ignore Lumiel's Effect for the fusion chain.
-- @return	bool

function Attack( Entity, Range, Stunned, Ignore )
	
	-- Curse of Water
	-- Dispel Magic (Enemy has states!)
	-- Fear
	-- Sandblaster (AOE, Long Duration)
	-- Spirit Wrath Position (Shield)
	
	-- Stone Skin
	-- Absorb Energy
	-- Spirit Absorption (30% mana regen from 10% spirit health)
	
	-- Retrieve the entity state of the target.
	local EntityState = Entity:GetState();
	
	-- Retrieve the entity of the player spirit
	local SpiritEntity = self:FindSpirit();
	
	-- Check if the entity state is correct.
	if EntityState == nil then
		return;
	end
	
	-- Check if the player spirit is valid.
	if SpiritEntity == nil then
		
		-- Summon 1: Summon Earth Spirit
		if Helper:CheckAvailable( "Summon Earth Spirit" ) then
			Helper:CheckExecute( "Summon Earth Spirit" );
			return false;
		end
		
		-- Cannot continue until a Spirit is available.
		return false;
		
	end
	
	-- Summon 2: Replenish Element
		if SpiritEntity:GetHealth() < 60 and Player:GetHealth() > 70 and Helper:CheckAvailable( "Replenish Element" ) then
			Helper:CheckExecute( "Replenish Element" );
			return;
		end
		
		-- Summon 3: Spirit Recovery
		if SpiritEntity:GetHealth() < 25 and Helper:CheckAvailable( "Spirit Recovery" ) then
			Helper:CheckExecute( "Spirit Recovery" );
			return;
		end
		
		-- Summon 4: Healing Spirit
		if SpiritEntity:GetHealth() < 30 and Helper:CheckAvailable( "Healing Spirit" ) then
			Helper:CheckExecute( "Healing Spirit" );
			return;
		end
		
		-- Spirit Buff 01: Elemental Spirit Armor
		if Helper:CheckAvailable( "Elemental Spirit Armor" ) and SpiritEntity:GetState():GetState( Helper:CheckName( "Elemental Spirit Armor" )) == nil then
			Helper:CheckExecute( "Elemental Spirit Armor" );
			return false;
		end
		
		-- Spirit Buff 01: Frenzied Spirit
		if Helper:CheckAvailable( "Frenzied Spirit" ) and SpiritEntity:GetState():GetState( Helper:CheckName( "Frenzied Spirit" )) == nil then
			Helper:CheckExecute( "Frenzied Spirit" );
			return false;
		end
		
		if Helper:CheckAvailable( "Sympathetic Mind" ) and SpiritEntity:GetState():GetState( Helper:CheckName( "Sympathetic Mind" )) == nil then
			Helper:CheckExecute( "Sympathetic Mind" );
			return false;
		end
		
		if Helper:CheckAvailable( "Stone Skin" ) and SpiritEntity:GetState():GetState( Helper:CheckName( "Stone Skin" )) == nil then
			Helper:CheckExecute( "Stone Skin" );
			return false;
		end
		
		-- Spirit Buff 01: Armor Spirit 
		if Helper:CheckAvailable( "Armor Spirit I" ) and SpiritEntity:GetState():GetState( Helper:CheckName( "Armor Spirit" )) == nil then
			Helper:CheckExecute( "Armor Spirit" );
			return false;
		end
		
		-- Spirit Buff 02: Spirit Armor of Darkness
		if ( Settings.SpiritMaster.AllowDP or Entity:IsPlayer()) and not Entity:IsDead() and Player:GetDP() >= 2000 and Helper:CheckAvailable( "Spirit Armor of Light" ) and Player:GetState():GetState( Helper:CheckName( "Spirit Armor of Light" )) == nil then
	    	Helper:CheckExecute( "Spirit Armor of Light" );
	    	return false;
	    end
		
		-- Spirit Buff 02: Spirit Armor of Darkness
		if ( Settings.SpiritMaster.AllowDP or Entity:IsPlayer()) and not Entity:IsDead() and Player:GetDP() >= 2000 and Helper:CheckAvailable( "Spirit Armor of Darkness" ) and Player:GetState():GetState( Helper:CheckName( "Spirit Armor of Darkness" )) == nil then
	    	Helper:CheckExecute( "Spirit Armor of Darkness" );
	    	return false;
	    end
		
		-- Buff 02: Spirit Preserve
	    if Helper:CheckAvailable( "Spirit Preserve" ) and Player:GetHealth() < 20 then
	    	Helper:CheckExecute( "Spirit Preserve" );
	    	return false;
    	end
	
    	-- Buff 03: Spirit Substitution
	    if Helper:CheckAvailable( "Spirit Substitution" ) and Player:GetHealth() < 30 then
	    	Helper:CheckExecute( "Spirit Substitution" );
	    	return false;
	    end 
		
		-- Check if this a new target and move the spirit when it is.
	if self._LastEntity == nil or self._LastEntity ~= Entity:GetID() then
		
		-- Check if Spirit Threat is available, do not continue until it is.
		if not Helper:CheckAvailable( "Spirit Threat" ) then
			if self._bPrepareThreat then
				self._LastEntity = Entity:GetID();
				self._bPrepareThreat = nil;
			end
			return false;
		-- Check if the entity has selected a target.
		elseif Entity:GetTargetID() ~= 0 then
			Helper:CheckExecute( "Spirit Threat" );
			self._bPrepareThreat = true;
			return false;
			
		-- Otherwise send the spirit to attack.
		elseif self._iClickTime == nil or self._iClickTime < Time() then
			DialogList:GetDialog( "pet_dialog/pet_cmd1" ):Click();
			self._iClickTime = Time() + 1000;
			self._bPrepareThreat = true;
			return false;
		-- For now, do nothing.
		else
			return false;
		end
		
	end
	
	-- Check if this a new target and move the spirit when it is.
	if self._LastEntity == nil or self._LastEntity ~= Entity:GetID() then
		
		-- Check if Spirit Threat is available, do not continue until it is.
		if not Helper:CheckAvailable( "Spirit Threat" ) then
			if self._bPrepareThreat then
				self._LastEntity = Entity:GetID();
				self._bPrepareThreat = nil;
			end
			return false;
		-- Check if the entity has selected a target.
		elseif Entity:GetTargetID() ~= 0 then
			Helper:CheckExecute( "Spirit Threat" );
			self._bPrepareThreat = true;
			return false;
			
		-- Otherwise send the spirit to attack.
		elseif self._iClickTime == nil or self._iClickTime < Time() then
			DialogList:GetDialog( "pet_dialog/pet_cmd1" ):Click();
			self._iClickTime = Time() + 1000;
			self._bPrepareThreat = true;
			return false;
		-- For now, do nothing.
		else
			return false;
		end
		
	end
	
	-- Chain 1: Remove Shock
	if Player:GetHealth() < 70 and Player:GetMana() < 85 and Helper:CheckAvailable( "Vengeful Backdraft" ) then
		Helper:CheckExecute( "Vengeful Backdraft" );
		return false;
	elseif Helper:CheckAvailable( "Flames of Anguish" ) then
		Helper:CheckExecute( "Flames of Anguish" );
		return false;
	elseif Helper:CheckAvailable( "Remove Shock" ) then
		Helper:CheckExecute( "Remove Shock" );
		return false;
	end
	
	-- Chain 2: Stone Shock
	if not Stunned and Helper:CheckAvailable( "Stone Shock" ) then
		Helper:CheckExecute( "Stone Shock" );
		return false;
	end
	
	-- Attack 01: Chain of Earth
	if Entity:GetHealthCurrent() > 1000 and Helper:CheckAvailable( "Chain of Earth" ) and EntityState:GetState( Helper:CheckName( "Chain of Earth" )) == nil then
		Helper:CheckExecute( "Chain of Earth" );
		return false;
	end
	
	-- Attack 02: Spirit Thunderbolt Claw
	if Helper:CheckAvailable( "Spirit Thunderbolt Claw" ) then
		Helper:CheckExecute( "Spirit Thunderbolt Claw" );
		return false;
	end
	
	-- Spirit Buff 02: Spirit Wrath Position
	if Helper:CheckAvailable( "Spirit Wrath Position" ) then 
		Helper:CheckExecute( "Spirit Wrath Position" );
		return false;
	end
	
	-- Buff 01: Summoning Alacrity
	if Helper:CheckAvailable( "Summoning Alacrity" ) then
		Helper:CheckExecute( "Summoning Alacrity" );
		return false;
	end
	
	-- Attack 03: Summon Earth Energy
	if Helper:CheckAvailable( "Summon Elemental Servant" ) then
		Helper:CheckExecute( "Summon Elemental Servant" );
		return false;
	end
	
	-- Attack 03: Summon Earth Energy
	if Helper:CheckAvailable( "Summon Fire Energy" ) then
		Helper:CheckExecute( "Summon Fire Energy" );
		return false;
	end
	
	-- Stigma 01: Summon Cyclone Servant
	if Helper:CheckAvailable( "Summon Wind Servan" ) then
		Helper:CheckExecute( "Summon Wind Servant" );
		return false;
	end
		
	-- Attack 03: Summon Earth Energy
	if Helper:CheckAvailable( "Summon Earth Energy" ) then
		Helper:CheckExecute( "Summon Earth Energy" );
		return false;
	end
	
	-- Stigma 01: Summon Cyclone Servant
	if Helper:CheckAvailable( "Summon Cyclone Servant" ) then
		Helper:CheckExecute( "Summon Cyclone Servant" );
		return false;
	end
	
	-- Attack 03: Summon Earth Energy
	if Helper:CheckAvailable( "Dispel Magic" ) then
		Helper:CheckExecute( "Dispel Magic" );
		return false;
	end
	
	-- Indicates whether or not to preserve mana. Damage-over-time skills are not applied after 50%.
	if not Settings.SpiritMaster.AllowPreserveMana or Entity:GetHealth() >= 50 then
	
		-- Attack 04: Erosion
		if Helper:CheckAvailable( "Erosion" ) and EntityState:GetState( Helper:CheckName( "Erosion" )) == nil then
			Helper:CheckExecute( "Erosion" );
			return false;
		end
		
		-- Stigma 02: Cyclone of Wrath
		if Helper:CheckAvailable( "Cyclone of Wrath" ) and EntityState:GetState( Helper:CheckName( "Cyclone of Wrath" )) == nil then
			Helper:CheckExecute( "Cyclone of Wrath" );
			return false;
		end
		
		-- Stigma 03: Infernal Pain
		if Helper:CheckAvailable( "Infernal Pain" ) then 
			Helper:CheckExecute( "Infernal Pain" );
			return false;
		end
		
		 -- Attack 05: Spirit Erosion
	    if Helper:CheckAvailable( "Spirit Erosion" ) and Entity:GetHealth() <= 700 then
	        Helper:CheckExecute( "Spirit Erosion" );
		    return false;
	   end
	
	end
	
	-- Attack 05: Spirit Disturbance
	if Helper:CheckAvailable( "Spirit Disturbance" ) and SpiritEntity:GetHealth() < 80 then
		Helper:CheckExecute( "Spirit Disturbance" );
		return false;
	end
	
	-- Attack 06: Backdraft
	if Helper:CheckAvailable( "Backdraft" ) and Player:GetHealth() < 80 and Player:GetMana() < 90 then
		Helper:CheckExecute( "Backdraft" );
		return false;
	end
	
	-- Attack 07: Spirit Detonation Claw
	if Helper:CheckAvailable( "Spirit Detonation Claw" ) then
		Helper:CheckExecute( "Spirit Detonation Claw" );
		return false;
	end
	
	-- Attack 08: Vacuum Choke
	if Helper:CheckAvailable( "Vacuum Chok" ) then
		Helper:CheckExecute( "Vacuum Choke" );
		return false;
	end
	
	-- Attack 08: Vacuum Choke
	if Helper:CheckAvailable( "Spirit Absorption" ) then
		Helper:CheckExecute( "Spirit Absorption" );
		return false;
	end
	
	-- Attack 08: Vacuum Choke
	if Helper:CheckAvailable( "Absorb Energy" ) then
		Helper:CheckExecute( "Absorb Energy" );
		return false;
	end
	
	-- Stigma 04: Weaken Spirit
	if Helper:CheckAvailable( "Weaken Spirit" ) then
		Helper:CheckExecute( "Weaken Spirit" );
		return false;
	end
	
--UTILITY SPELLS
	
	-- Stigma 05: Absorb Vitality
	if Helper:CheckAvailable( "Absorb Vitality" ) and Player:GetHealth() < 75 then
		Helper:CheckExecute( "Absorb Vitality" );
		return false;
	end
	
	-- Attack 09: Curse of Fire/Curse of Water
	if Helper:CheckAvailable( "Curse of Water" ) and Player:GetHealth() < 38 then
		Helper:CheckExecute( "Curse of Water" );
		return false;
	end
	
	-- Buff 02: Spirit Preserve
	if Helper:CheckAvailable( "Spirit Preserve" ) and Player:GetHealth() < 20 then
		Helper:CheckExecute( "Spirit Preserve" );
		return false;
	end
	
	-- Buff 03: Spirit Substitution
	if Helper:CheckAvailable( "Spirit Substitution" ) and Player:GetHealth() < 30 then
		Helper:CheckExecute( "Spirit Substitution" );
		return false;
	end
	
	-- Buff 04: Absorb Energy
	if Helper:CheckAvailable( "Absorb Energy" ) and Player:GetMana() < 90 then
		Helper:CheckExecute( "Absorb Energy" );
		return false;
	end
	
	-- Buff 05: Spirit Absorption
	if Helper:CheckAvailable( "Spirit Absorption" ) and Player:GetMana() < 65 then
		Helper:CheckExecute( "Spirit Absorption" );
		return false;
	end

	-- Check if this entity has the Stone Skin state.
	if Helper:CheckAvailable( "Sympathetic Mind" ) and EntityState:GetState( "Sympathetic Mind" ) == nil and EntityState:GetState( "Sympathetic Mind" ) == nil 
		and EntityState:GetState( "Sympathetic Mind" ) == nil and EntityState:GetState( "Sympathetic Mind" ) == nil and EntityState:GetState( "Sympathetic Mind" ) == nil then
		Helper:CheckExecute( "Sympathetic Mind" );
		return false;
	end
	
	-- Check if this entity has the Stone Skin state.
	if Helper:CheckAvailable( "Stone Skin" ) and EntityState:GetState( "Stone Skin I" ) == nil and EntityState:GetState( "Stone Skin II" ) == nil 
		and EntityState:GetState( "Stone Skin III" ) == nil and EntityState:GetState( "Stone Skin IV" ) == nil and EntityState:GetState( "Stone Skin V" ) == nil then
		Helper:CheckExecute( "Stone Skin" );
		return false;
	end
	
	-- Buff 04: Absorb Energy
	if Helper:CheckAvailable( "Absorb Energy" ) and Player:GetManaMaximum() - Player:GetManaCurrent() > 526 then
		Helper:CheckExecute( "Absorb Energy" );
		return false;
	end
	
	-- Buff 05: Stone Skin
	if Helper:CheckAvailable( "Stone Skin" ) and EntityState:GetState( Helper:CheckName( "Stone Skin" )) == nil then
		Helper:CheckExecute( "Stone Skin" );
		return false;
	end
	
	-- Buff 09: Fine Rally Serum
	if Helper:CheckAvailable( "Increase Natural Recovery Serum" ) and EntityState:GetState( Helper:CheckName( "Increase Natural Recovery Serum" )) == nil then
		Helper:CheckExecute( "Increase Natural Recovery Serum" );
		return false;
	end
	
	-- Buff 06: Blessing of Fire
	if Helper:CheckAvailable( "Blessing of Fir" ) and EntityState:GetState( Helper:CheckName( "Blessing of Fire" )) == nil then
		Helper:CheckExecute( "Blessing of Fire" );
		return false;
	end
	
	-- Buff 07: Sympathetic Mind
	if Helper:CheckAvailable( "Sympathetic Mind" ) and EntityState:GetState( Helper:CheckName( "Sympathetic Mind" )) == nil then
		Helper:CheckExecute( "Sympathetic Mind" );
		return false;
	end
	
	-- Buff 07: Sympathetic Mind
	if Helper:CheckAvailable( "Spirit Wrath Position" ) and EntityState:GetState( Helper:CheckName( "Spirit Wrath Position" )) == nil then
		Helper:CheckExecute( "Spirit Wrath Position" );
		return false;
	end
	
	-- Buff 07: Sympathetic Mind
	if Helper:CheckAvailable( "Spirit Armor of Darknes" ) and EntityState:GetState( Helper:CheckName( "Spirit Armor of Darkness" )) == nil then
		Helper:CheckExecute( "Spirit Armor of Darkness" );
		return false;
	end
	
	-- Buff 08: Spirit Absorption
	if Helper:CheckAvailable( "Spirit Absorption" ) and Player:GetMana() < 70 and self:FindSpirit() ~= nil then
		Helper:CheckExecute( "Spirit Absorption" );
		return false;
	end
end

Re: Spiritmaster.lua

Posted: Wed Apr 12, 2017 4:04 pm
by amad
Hello i'm trying to improve the script cuz actually is pretty outdated,anyone can help me? (actually don't work).
Here the script :

Code: Select all

--[[

	--------------------------------------------------
	Copyright (C) 2011 Blastradius

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program 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 General Public License for more details.
	--------------------------------------------------
	
]]--

--- Find the spirit that belongs to the provided player.
--
-- @param	Integer Contains the player identifier.
-- @return	Entity

function FindSpirit( ID )

	-- Check the provided identifier to look for, otherwise use my own identifier.
	if ID == nil then
		ID = Player:GetID();
	end
	
	-- Loop through the available entities to find the spirit.
	for EntityID, Entity in DictionaryIterator( EntityList:GetList()) do
	
		-- Check if this monster is a spirit and belongs to me!
		if Entity:GetOwnerID() == ID and string.find( Entity:GetName(), "Spirit" ) ~= nil then
			return Entity;	
		end
		
	end

	-- Return nothing, the spirit has not been found.
	return nil;
	
end

--- Perform the attack routine on the selected target.
--
-- @param	Entity	Contains the entity we have targeted.
-- @param	double	Contains the distance to the target
-- @param	bool	Indicates whether or not the target is stunned.
-- @param	mixed	Indicates whether or not to ignore Lumiel's Effect for the fusion chain.
-- @return	bool

function Attack( Entity, Range, Stunned, Ignore )
	
	-- Curse of Water
	-- Dispel Magic (Enemy has states!)
	-- Fear
	-- Sandblaster (AOE, Long Duration)
	-- Spirit Wrath Position (Shield)
	
	-- Stone Skin
	-- Absorb Energy
	-- Spirit Absorption (30% mana regen from 10% spirit health)
	
	-- Retrieve the entity state of the target.
	local EntityState = Entity:GetState();
	
	-- Retrieve the entity of the player spirit
	local SpiritEntity = self:FindSpirit();
	
	-- Check if the entity state is correct.
	if EntityState == nil then
		return;
	end
	
	-- Check if the player spirit is valid.
	if SpiritEntity == nil then
		
		-- Summon 1: Summon Earth Spirit
		if Helper:CheckAvailable( "Summon Earth Spirit" ) then
			Helper:CheckExecute( "Summon Earth Spirit" );
			return false;
		end
		
		-- Cannot continue until a Spirit is available.
		return false;
		
	end
	
	-- Summon 2: Replenish Element
		if SpiritEntity:GetHealth() < 60 and Player:GetHealth() > 70 and Helper:CheckAvailable( "Replenish Element" ) then
			Helper:CheckExecute( "Replenish Element" );
			return;
		end

if Helper:CheckAvailable( "Sympathetic Mind" ) and SpiritEntity:GetState():GetState( Helper:CheckName( "Sympathetic Mind" )) == nil then
			Helper:CheckExecute( "Sympathetic Mind" );
			return false;
		end
		
		if Helper:CheckAvailable( "Stone Skin" ) and SpiritEntity:GetState():GetState( Helper:CheckName( "Stone Skin" )) == nil then
			Helper:CheckExecute( "Stone Skin" );
			return false;
		end
		
		-- Spirit Buff 01: Armor Spirit 
		if Helper:CheckAvailable( "Armor Spirit I" ) and SpiritEntity:GetState():GetState( Helper:CheckName( "Armor Spirit" )) == nil then
			Helper:CheckExecute( "Armor Spirit" );
			return false;
		end
		
		-- Spirit Buff 02: Spirit Armor of Light
		if ( Settings.SpiritMaster.AllowDP or Entity:IsPlayer()) and not Entity:IsDead() and Player:GetDP() >= 2000 and Helper:CheckAvailable( "Spirit Armor of Light" ) and Player:GetState():GetState( Helper:CheckName( "Spirit Armor of Light" )) == nil then
	    	Helper:CheckExecute( "Spirit Armor of Light" );
	    	return false;
	    end
		
		-- Spirit Buff 02: Spirit Armor of Darkness
		if ( Settings.SpiritMaster.AllowDP or Entity:IsPlayer()) and not Entity:IsDead() and Player:GetDP() >= 2000 and Helper:CheckAvailable( "Spirit Armor of Darkness" ) and Player:GetState():GetState( Helper:CheckName( "Spirit Armor of Darkness" )) == nil then
	    	Helper:CheckExecute( "Spirit Armor of Darkness" );
	    	return false;
	    end
		
		-- Buff 02: Spirit Preserve
	    if Helper:CheckAvailable( "Spirit Preserve" ) and Player:GetHealth() < 20 then
	    	Helper:CheckExecute( "Spirit Preserve" );
	    	return false;
    	end
		
		-- Check if this a new target and move the spirit when it is.
	if self._LastEntity == nil or self._LastEntity ~= Entity:GetID() then
		-- Otherwise send the spirit to attack.
		elseif self._iClickTime == nil or self._iClickTime < Time() then
			DialogList:GetDialog( "pet_dialog/pet_cmd1" ):Click();
			self._iClickTime = Time() + 1000;
			self._bPrepareThreat = true;
			return false;
		-- For now, do nothing.
		else
			return false;
		end
		
	end
	-- Chain 1: Remove Shock
	if Player:GetHealth() < 70 and Player:GetMana() < 85 and Helper:CheckAvailable( "Vengeful Backdraft" ) then
		Helper:CheckExecute( "Vengeful Backdraft" );
		return false;
	elseif Helper:CheckAvailable( "Flames of Anguish" ) then
		Helper:CheckExecute( "Flames of Anguish" );
		return false;
	elseif Helper:CheckAvailable( "Remove Shock" ) then
		Helper:CheckExecute( "Remove Shock" );
		return false;
	end
	
	-- Chain 2: Stone Shock
	if not Stunned and Helper:CheckAvailable( "Stone Shock" ) then
		Helper:CheckExecute( "Stone Shock" );
		return false;
	end
	
	-- Attack 01: Chain of Earth
	if Entity:GetHealthCurrent() > 1000 and Helper:CheckAvailable( "Chain of Earth" ) and EntityState:GetState( Helper:CheckName( "Chain of Earth" )) == nil then
		Helper:CheckExecute( "Chain of Earth" );
		return false;
	end
	
	-- Spirit Buff 02: Spirit Wrath Position
	if Helper:CheckAvailable( "Spirit Wrath Position" ) then 
		Helper:CheckExecute( "Spirit Wrath Position" );
		return false;
	end
	
	-- Buff 01: Summoning Alacrity
	if Helper:CheckAvailable( "Summoning Alacrity" ) then
		Helper:CheckExecute( "Summoning Alacrity" );
		return false;
	end
	-- Indicates whether or not to preserve mana. Damage-over-time skills are not applied after 50%.
	if not Settings.SpiritMaster.AllowPreserveMana or Entity:GetHealth() >= 50 then
	
		-- Attack 04: Erosion
		if Helper:CheckAvailable( "Erosion" ) and EntityState:GetState( Helper:CheckName( "Erosion" )) == nil then
			Helper:CheckExecute( "Erosion" );
			return false;
		end
		
		-- Stigma 02: Cyclone of Wrath
		if Helper:CheckAvailable( "Cyclone of Wrath" ) and EntityState:GetState( Helper:CheckName( "Cyclone of Wrath" )) == nil then
			Helper:CheckExecute( "Cyclone of Wrath" );
			return false;
		end
		
		-- Stigma 03: Infernal Pain
		if Helper:CheckAvailable( "Infernal Pain" ) then 
			Helper:CheckExecute( "Infernal Pain" );
			return false;
		end
		
		 -- Attack 05: Spirit Erosion
	    if Helper:CheckAvailable( "Spirit Erosion" ) and Entity:GetHealth() <= 700 then
	        Helper:CheckExecute( "Spirit Erosion" );
		    return false;
	   end
	
	end
	
	-- Attack 05: Spirit Disturbance
	if Helper:CheckAvailable( "Spirit Disturbance" ) and SpiritEntity:GetHealth() < 80 then
		Helper:CheckExecute( "Spirit Disturbance" );
		return false;
	end
if Helper:CheckAvailable( "Command: Burn-to-Ashes" )  then
		Helper:CheckExecute( "Command: Burn-to-Ashes" );
		return false;
	end
if Helper:CheckAvailable( "Order: Elemental Discharge" )  then
		Helper:CheckExecute( "Order: Elemental Discharge" );
		return false;
	end
	
	-- Attack 06: Backdraft
	if Helper:CheckAvailable( "Backdraft" ) and Player:GetHealth() < 80 and Player:GetMana() < 90 then
		Helper:CheckExecute( "Backdraft" );
		return false;
	end
	-- Attack 08: Vacuum Choke
	if Helper:CheckAvailable( "Vacuum Choke" ) then
		Helper:CheckExecute( "Vacuum Choke" );
		return false;
	end
	
	
	
	
	
	-- Stigma 04: Weaken Spirit
	if Helper:CheckAvailable( "Weaken Spirit" ) then
		Helper:CheckExecute( "Weaken Spirit" );
		return false;
	end

if Entity:GetHealth() >= 90 and Helper:CheckAvailable( "Wilderness Rage" ) and Position:DistanceToPosition( Entity:GetPosition()) >= 12 then
		Helper:CheckExecute( "Wilderness Rage" );
		return false;
end	
--UTILITY SPELLS
	
	
	
	-- Attack 09: Curse of Fire/Curse of Water
	if Helper:CheckAvailable( "Curse of Water" ) and Player:GetHealth() < 38 then
		Helper:CheckExecute( "Curse of Water" );
		return false;
	end
	
	-- Buff 02: Spirit Preserve
	if Helper:CheckAvailable( "Spirit Preserve" ) and Player:GetHealth() < 20 then
		Helper:CheckExecute( "Spirit Preserve" );
		return false;
	end
	
	
	
	-- Buff 04: Absorb Energy
	if Helper:CheckAvailable( "Absorb Energy" ) and Player:GetMana() < 90 then
		Helper:CheckExecute( "Absorb Energy" );
		return false;
	end
	
	-- Buff 05: Spirit Absorption
	if Helper:CheckAvailable( "Spirit Absorption" ) and Player:GetMana() < 65 then
		Helper:CheckExecute( "Spirit Absorption" );
		return false;
	end

	-- Check if this entity has the Stone Skin state.
	if Helper:CheckAvailable( "Sympathetic Mind" ) and EntityState:GetState( "Sympathetic Mind" ) == nil and EntityState:GetState( "Sympathetic Mind" ) == nil 
		and EntityState:GetState( "Sympathetic Mind" ) == nil and EntityState:GetState( "Sympathetic Mind" ) == nil and EntityState:GetState( "Sympathetic Mind" ) == nil then
		Helper:CheckExecute( "Sympathetic Mind" );
		return false;
	end
	
	-- Check if this entity has the Stone Skin state.
	if Helper:CheckAvailable( "Stone Skin" ) and EntityState:GetState( "Stone Skin I" ) == nil and EntityState:GetState( "Stone Skin II" ) == nil 
		and EntityState:GetState( "Stone Skin III" ) == nil and EntityState:GetState( "Stone Skin IV" ) == nil and EntityState:GetState( "Stone Skin V" ) == nil then
		Helper:CheckExecute( "Stone Skin" );
		return false;
	end
	
	
	
	-- Buff 05: Stone Skin
	if Helper:CheckAvailable( "Stone Skin" ) and EntityState:GetState( Helper:CheckName( "Stone Skin" )) == nil then
		Helper:CheckExecute( "Stone Skin" );
		return false;
	end
	
	
	
	-- Buff 07: Sympathetic Mind
	if Helper:CheckAvailable( "Sympathetic Mind" ) and EntityState:GetState( Helper:CheckName( "Sympathetic Mind" )) == nil then
		Helper:CheckExecute( "Sympathetic Mind" );
		return false;
	end
	
	-- Buff 07: Sympathetic Mind
	if Helper:CheckAvailable( "Spirit Wrath Position" ) and EntityState:GetState( Helper:CheckName( "Spirit Wrath Position" )) == nil then
		Helper:CheckExecute( "Spirit Wrath Position" );
		return false;
	end
	
	-- Buff 07: Sympathetic Mind
	if Helper:CheckAvailable( "Spirit Armor of Darknes" ) and EntityState:GetState( Helper:CheckName( "Spirit Armor of Darkness" )) == nil then
		Helper:CheckExecute( "Spirit Armor of Darkness" );
		return false;
	end
	
	-- Buff 08: Spirit Absorption
	if Helper:CheckAvailable( "Spirit Absorption" ) and Player:GetMana() < 70 and self:FindSpirit() ~= nil then
		Helper:CheckExecute( "Spirit Absorption" );
		return false;
	end
end

Re: Spiritmaster.lua

Posted: Fri Jun 23, 2017 11:59 pm
by tanzer212002
Why does this script not work? Seems like it has everything but nada. Is it setup for EU possibly? Although all the skills look like the NA names so...confused.

Re: Spiritmaster.lua

Posted: Sat Jun 24, 2017 11:37 am
by nucular
If there are NA names you have to edit this file and put EU names in it.^^

Re: Spiritmaster.lua

Posted: Sat Jun 24, 2017 12:50 pm
by tanzer212002
Oh no I want it for NA lol, not EU. Was just wondering if EU names were similar to the NA ones because for some reason this profile doesn't work for me at all and I use the NA one. Just wondering if it's just not working or if it was an EU/NA naming issue.

Re: Spiritmaster.lua

Posted: Sat Jun 24, 2017 1:25 pm
by nucular
Well can't say as i don't own an Spiritmaster.
But this script should be easily fixable. (Changing Skill Names)

Re: Spiritmaster.lua

Posted: Sat Jun 24, 2017 2:51 pm
by tanzer212002
Yeah, I'm messing with it now, I got some of the stuff to work but it's going to take a lot of tweaking. Thanks for the info though, if I get something that's nice and workable I'll repost here.

Re: Spiritmaster.lua

Posted: Sat Jun 24, 2017 5:56 pm
by nucular
tanzer212002 wrote:
Sat Jun 24, 2017 2:51 pm
Yeah, I'm messing with it now, I got some of the stuff to work but it's going to take a lot of tweaking. Thanks for the info though, if I get something that's nice and workable I'll repost here.
Yes, that would be cool

Re: Spiritmaster.lua

Posted: Sun Jul 16, 2017 3:21 pm
by LordSnack
I have fixed it
But I do not know how with the pet it works on the mob goes by Spirit Attack Button
But the script goes even if it is a bad variant but it goes as one needs it
If one has the fix for the function with the pet please times post or insert directly into the script

Sry 4 Bad English xD its not my Language xD my Language is German :3

Code: Select all

--[[

	--------------------------------------------------
	Copyright (C) 2011 Blastradius

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program 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 General Public License for more details.
	--------------------------------------------------
	
]]--

--- Find the spirit that belongs to the provided player.
--
-- @param	Integer Contains the player identifier.
-- @return	Entity

function FindSpirit( ID )

	-- Check the provided identifier to look for, otherwise use my own identifier.
	if ID == nil then
		ID = Player:GetID();
	end
	
	-- Loop through the available entities to find the spirit.
	for EntityID, Entity in DictionaryIterator( EntityList:GetList()) do
	
		-- Check if this monster is a spirit and belongs to me!
		if Entity:GetOwnerID() == ID and string.find( Entity:GetName(), "Spirit" ) ~= nil then
			return Entity;	
		end
		
	end

	-- Return nothing, the spirit has not been found.
	return nil;
	
end

--- Perform the attack routine on the selected target.
--
-- @param	Entity	Contains the entity we have targeted.
-- @param	double	Contains the distance to the target
-- @param	bool	Indicates whether or not the target is stunned.
-- @param	mixed	Indicates whether or not to ignore Lumiel's Effect for the fusion chain.
-- @return	bool

function Attack( Entity, Range, Stunned, Ignore )
	
	-- Curse of Water
	-- Dispel Magic (Enemy has states!)
	-- Fear
	-- Sandblaster (AOE, Long Duration)
	-- Spirit Wrath Position (Shield)
	
	-- Stone Skin
	-- Backdraft
	-- Spirit Absorption (30% mana regen from 10% spirit health)
	
	-- Retrieve the entity state of the target.
	local EntityState = Entity:GetState();
	
	-- Retrieve the entity of the player spirit
	local SpiritEntity = self:FindSpirit();
	
	-- Check if the entity state is correct.
	if EntityState == nil then
		return;
	end
	
	-- Check if the player spirit is valid.
	if SpiritEntity == nil then
		
		-- Summon 1: Summon Earth Spirit
		if Helper:CheckAvailable( "Summon Earth Spirit" ) then
			Helper:CheckExecute( "Summon Earth Spirit" );
			return false;
		end
		
		-- Cannot continue until a Spirit is available.
		return false;
		
	end
	-- Spirit Attack Modus
	if Helper:CheckAvailable( "Command: Disturbance" ) and Helper:CheckAvailable( "Command: Disturbance") then
	   Helper:CheckExecute( "Command: Disturbance" );
	   return;
	   end
	   
	   --Next Spirit Attack
	if Helper:CheckAvailable( "Command: Ruinous Offensive" ) and Helper:CheckAvailable( "Command: Ruinous Offensive") then
	   Helper:CheckExecute( "Command: Ruinous Offensive" );
	   return;
	   end
	-- Summon 2: Replenish Element
		if SpiritEntity:GetHealth() < 60 and Player:GetHealth() > 70 and Helper:CheckAvailable( "Replenish Element" ) then
			Helper:CheckExecute( "Replenish Element" );
			return;
		end
		
		-- Summon 3: Healing Spirit
		if SpiritEntity:GetHealth() < 25 and Helper:CheckAvailable( "Healing Spirit" ) then
			Helper:CheckExecute( "Healing Spirit" );
			return;
		end
		
		-- Summon 4: Healing Spirit
		if SpiritEntity:GetHealth() < 30 and Helper:CheckAvailable( "Healing Spirit" ) then
			Helper:CheckExecute( "Healing Spirit" );
			return;
		end
		
		if Helper:CheckAvailable( "Sympathetic Mind" ) and SpiritEntity:GetState():GetState( Helper:CheckName( "Sympathetic Mind" )) == nil then
			Helper:CheckExecute( "Sympathetic Mind" );
			return false;
		end
		
		if Helper:CheckAvailable( "Stone Skin" ) and SpiritEntity:GetState():GetState( Helper:CheckName( "Stone Skin" )) == nil then
			Helper:CheckExecute( "Stone Skin" );
			return false;
		end
		
		-- Spirit Buff 01: Armor Spirit 
		if Helper:CheckAvailable( "Armor Spirit" ) and SpiritEntity:GetState():GetState( Helper:CheckName( "Armor Spirit" )) == nil then
			Helper:CheckExecute( "Armor Spirit" );
			return false;
		end
		
		-- Spirit Buff 02: Strengthening Spirit Holy Armor
		if ( Settings.SpiritMaster.AllowDP or Entity:IsPlayer()) and not Entity:IsDead() and Player:GetDP() >= 2000 and Helper:CheckAvailable( "Strengthening Spirit: Holy Armour" ) and Player:GetState():GetState( Helper:CheckName( "Strengthening Spirit: Holy Armour" )) == nil then
	    	Helper:CheckExecute( "Strengthening Spirit: Holy Armour" );
	    	return false;
	    end
		
		
		-- Check if this a new target and move the spirit when it is.
	--if self._LastEntity == nil or self._LastEntity ~= Entity:GetID() then
		
		-- Check if Spirit Threat is available, do not continue until it is.
		--if not Helper:CheckAvailable( "Command: Erosion" ) then
		--	if self._bPrepareThreat then
		--		self._LastEntity = Entity:GetID();
		--		self._bPrepareThreat = nil;
		--	end
		--	return false;
		-- Check if the entity has selected a target.
		--elseif Entity:GetTargetID() ~= 0 then
		--	Helper:CheckExecute( "Command: Erosion" );
		--	self._bPrepareThreat = true;
		--	return false;
			
		-- Otherwise send the spirit to attack.
		--elseif self._iClickTime == nil or self._iClickTime < Time() then
		--	DialogList:GetDialog( "pet_dialog/pet_cmd1" ):Click();
		--	self._iClickTime = Time() + 1000;
		--	self._bPrepareThreat = true;
		--	return false;
		-- For now, do nothing.
		--else
		--	return false;
		--end
		
	--end
	
	-- Check if this a new target and move the spirit when it is.
	--if self._LastEntity == nil or self._LastEntity ~= Entity:GetID() then
		
		-- Check if Spirit Threat is available, do not continue until it is.
		--if not Helper:CheckAvailable( "Command: Erosion" ) then
		--	if self._bPrepareThreat then
		--		self._LastEntity = Entity:GetID();
		--		self._bPrepareThreat = nil;
		--	end
		--	return false;
		-- Check if the entity has selected a target.
		--elseif Entity:GetTargetID() ~= 0 then
		--	Helper:CheckExecute( "Command: Erosion" );
		--	self._bPrepareThreat = true;
		--	return false;
			
		-- Otherwise send the spirit to attack.
		--elseif self._iClickTime == nil or self._iClickTime < Time() then
		--	DialogList:GetDialog( "pet_dialog/pet_cmd1" ):Click();
		--	self._iClickTime = Time() + 1000;
		--	self._bPrepareThreat = true;
		--	return false;
		-- For now, do nothing.
		--else
		--	return false;
		--end
		
	--end
	
	-- Chain 1: Remove Shock
	if Player:GetHealth() < 70 and Player:GetMana() < 85 and Helper:CheckAvailable( "Vengeful Backdraft" ) then
		Helper:CheckExecute( "Vengeful Backdraft" );
		return false;
	elseif Helper:CheckAvailable( "Flames of Anguish" ) then
		Helper:CheckExecute( "Flames of Anguish" );
		return false;
	elseif Helper:CheckAvailable( "Remove Shock" ) then
		Helper:CheckExecute( "Remove Shock" );
		return false;
	end
	
	-- Chain 2: Stone Shock
	if not Stunned and Helper:CheckAvailable( "Stone Shock" ) then
		Helper:CheckExecute( "Stone Shock" );
		return false;
	end
	
	-- Attack 01: Chain of Earth
	if Entity:GetHealthCurrent() > 1000 and Helper:CheckAvailable( "Chain of Earth" ) and EntityState:GetState( Helper:CheckName( "Chain of Earth" )) == nil then
		Helper:CheckExecute( "Chain of Earth" );
		return false;
	end
	
	-- Attack 02: Spirit Thunderbolt Claw
	if Helper:CheckAvailable( "Command: Detonation Claw" ) then
		Helper:CheckExecute( "Command: Detonation Claw" );
		return false;
	end
	
	-- Spirit Buff 02: Spirit Wrath Position
	if Helper:CheckAvailable( "Spirit Wrath Position" ) then 
		Helper:CheckExecute( "Spirit Wrath Position" );
		return false;
	end
	
	-- Buff 01: Summoning Alacrity
	if Helper:CheckAvailable( "Summoning Alacrity" ) then
		Helper:CheckExecute( "Summoning Alacrity" );
		return false;
	end
	
	-- Attack 03: Summon Earth Energy
	--if Helper:CheckAvailable( "Summon Elemental Servant" ) then
	--	Helper:CheckExecute( "Summon Elemental Servant" );
	--	return false;
	--end
	
	-- Attack 03: Summon Earth Energy
	--if Helper:CheckAvailable( "Summon Fire Energy" ) then
	--	Helper:CheckExecute( "Summon Fire Energy" );
	--	return false;
	--end
	
	-- Stigma 01: Summon Cyclone Servant
	if Helper:CheckAvailable( "Summon Wind Servant" ) then
		Helper:CheckExecute( "Summon Wind Servant" );
		return false;
	end
		
	-- Attack 03: Summon Earth Energy
	--if Helper:CheckAvailable( "Summon Earth Energy" ) then
	--	Helper:CheckExecute( "Summon Earth Energy" );
	--	return false;
	--end
	
	-- Stigma 01: Summon Cyclone Servant
	--if Helper:CheckAvailable( "Summon Cyclone Servant" ) then
	--	Helper:CheckExecute( "Summon Cyclone Servant" );
	--	return false;
	--end
	
	-- Attack 03: Dispel
	if Helper:CheckAvailable( "Dispel Magic" ) then
		Helper:CheckExecute( "Dispel Magic" );
		return false;
	end
	
	-- Indicates whether or not to preserve mana. Damage-over-time skills are not applied after 50%.
	if not Settings.SpiritMaster.AllowPreserveMana or Entity:GetHealth() >= 50 then
	
		-- Attack 04: Erosion
		if Helper:CheckAvailable( "Erosion" ) and EntityState:GetState( Helper:CheckName( "Erosion" )) == nil then
			Helper:CheckExecute( "Erosion" );
			return false;
		end
		
		-- Stigma 02: Cyclone of Wrath
		if Helper:CheckAvailable( "Cyclone of Wrath" ) and EntityState:GetState( Helper:CheckName( "Cyclone of Wrath" )) == nil then
			Helper:CheckExecute( "Cyclone of Wrath" );
			return false;
		end
		
		-- Stigma 03: Infernal Pain
		if Helper:CheckAvailable( "Infernal Pain" ) then 
			Helper:CheckExecute( "Infernal Pain" );
			return false;
		end
		
		 -- Attack 05: Spirit Erosion
	    if Helper:CheckAvailable( "Spirit Erosion" ) and Entity:GetHealth() <= 700 then
	        Helper:CheckExecute( "Spirit Erosion" );
		    return false;
	   end
	
	end
	
	-- Attack 05: Spirit Disturbance
	if Helper:CheckAvailable( "Spirit Disturbance" ) and SpiritEntity:GetHealth() < 80 then
		Helper:CheckExecute( "Spirit Disturbance" );
		return false;
	end
	
	-- Attack 06: Backdraft
	if Helper:CheckAvailable( "Backdraft" ) and Player:GetHealth() < 80 and Player:GetMana() < 90 then
		Helper:CheckExecute( "Backdraft" );
		return false;
	end
	
	-- Attack 07: Spirit Detonation Claw
	if Helper:CheckAvailable( "Spirit Detonation Claw" ) then
		Helper:CheckExecute( "Spirit Detonation Claw" );
		return false;
	end
	
	-- Attack 08: Vacuum Choke
	if Helper:CheckAvailable( "Vacuum Choke" ) then
		Helper:CheckExecute( "Vacuum Choke" );
		return false;
	end
	
	-- Attack 08: Vacuum Choke
	if Helper:CheckAvailable( "Spirit Absorption" ) then
		Helper:CheckExecute( "Spirit Absorption" );
		return false;
	end
	
	-- Attack 08: Vacuum Choke
	if Helper:CheckAvailable( "Backdraft" ) then
		Helper:CheckExecute( "Backdraft" );
		return false;
	end
	
	-- Stigma 04: Weaken Spirit
	if Helper:CheckAvailable( "Weaken Spirit" ) then
		Helper:CheckExecute( "Weaken Spirit" );
		return false;
	end
	
	-- Chain Weaken Spirit
	if Helper:CheckAvailable("Elemental Smash" ) then
		Helper:CheckExecute("Element Smash" );
		return false;
	end
		
--UTILITY SPELLS
	
	-- Stigma 05: Absorb Vitality
	--if Helper:CheckAvailable( "Absorb Vitality" ) and Player:GetHealth() < 75 then
	--	Helper:CheckExecute( "Absorb Vitality" );
	--	return false;
	--end
	
	-- Attack 09: Curse of Fire/Curse of Water
	--if Helper:CheckAvailable( "Curse of Water" ) and Player:GetHealth() < 38 then
	--	Helper:CheckExecute( "Curse of Water" );
	--	return false;
	--end
	
	-- Buff 02: Spirit Preserve
	if Helper:CheckAvailable( "Command: Preserve Spirit" ) and Player:GetHealth() < 20 then
		Helper:CheckExecute( "Command: Preserve Spirit" );
		return false;
	end
	
	-- Buff 03: Spirit Substitution
	if Helper:CheckAvailable( "Command: Protection" ) and Player:GetHealth() < 30 then
		Helper:CheckExecute( "Command: Protection" );
		return false;
	end
	
	-- Buff 04: Backdraft
	if Helper:CheckAvailable( "Backdraft" ) and Player:GetMana() < 90 then
		Helper:CheckExecute( "Backdraft" );
		return false;
	end
	
	-- Buff 05: Spirit Absorption
	--if Helper:CheckAvailable( "Spirit Absorption" ) and Player:GetMana() < 65 then
	--	Helper:CheckExecute( "Spirit Absorption" );
	--	return false;
	--end

	-- Check if this entity has the Stone Skin state.
	if Helper:CheckAvailable( "Sympathetic Mind" ) and EntityState:GetState( "Sympathetic Mind" ) == nil and EntityState:GetState( "Sympathetic Mind" ) == nil 
		and EntityState:GetState( "Sympathetic Mind" ) == nil and EntityState:GetState( "Sympathetic Mind" ) == nil and EntityState:GetState( "Sympathetic Mind" ) == nil then
		Helper:CheckExecute( "Sympathetic Mind" );
		return false;
	end
	
	-- Check if this entity has the Stone Skin state.
	if Helper:CheckAvailable( "Stone Skin" ) and EntityState:GetState( "Stone Skin I" ) == nil and EntityState:GetState( "Stone Skin II" ) == nil 
		and EntityState:GetState( "Stone Skin III" ) == nil and EntityState:GetState( "Stone Skin IV" ) == nil and EntityState:GetState( "Stone Skin V" ) == nil then
		Helper:CheckExecute( "Stone Skin" );
		return false;
	end
	
	-- Buff 04: Backdraft
	if Helper:CheckAvailable( "Backdraft" ) and Player:GetManaMaximum() - Player:GetManaCurrent() > 526 then
		Helper:CheckExecute( "Backdraft" );
		return false;
	end
	
	-- Buff 05: Stone Skin
	if Helper:CheckAvailable( "Stone Skin" ) and EntityState:GetState( Helper:CheckName( "Stone Skin" )) == nil then
		Helper:CheckExecute( "Stone Skin" );
		return false;
	end
	
	-- Buff 09: Fine Rally Serum
	if Helper:CheckAvailable( "Increase Natural Recovery Serum" ) and EntityState:GetState( Helper:CheckName( "Increase Natural Recovery Serum" )) == nil then
		Helper:CheckExecute( "Increase Natural Recovery Serum" );
		return false;
	end
	
	-- Buff 06: Blessing of Fire
	--if Helper:CheckAvailable( "Blessing of Fire" ) and EntityState:GetState( Helper:CheckName( "Blessing of Fire" )) == nil then
	--	Helper:CheckExecute( "Blessing of Fire" );
	--	return false;
	--end
	
	-- Buff 07: Sympathetic Mind
	if Helper:CheckAvailable( "Sympathetic Mind" ) and EntityState:GetState( Helper:CheckName( "Sympathetic Mind" )) == nil then
		Helper:CheckExecute( "Sympathetic Mind" );
		return false;
	end
	
	-- Buff 07: Sympathetic Mind
	if Helper:CheckAvailable( "Spirit Wrath Position" ) and EntityState:GetState( Helper:CheckName( "Spirit Wrath Position" )) == nil then
		Helper:CheckExecute( "Spirit Wrath Position" );
		return false;
	end
	
	-- Buff 07: Sympathetic Mind
	--if Helper:CheckAvailable( "Spirit Armor of Darknes" ) and EntityState:GetState( Helper:CheckName( "Spirit Armor of Darkness" )) == nil then
	--	Helper:CheckExecute( "Spirit Armor of Darkness" );
	--	return false;
	--end
	
	-- Buff 08: Spirit Absorption
	if Helper:CheckAvailable( "Spirit Absorption" ) and Player:GetMana() < 70 and self:FindSpirit() ~= nil then
		Helper:CheckExecute( "Spirit Absorption" );
		return false;
	end
end

Re: Spiritmaster.lua

Posted: Mon Aug 07, 2017 3:59 pm
by ewerson2
Temporary solution to the attack of the spirit :D

Code: Select all

-- Attack 02: Spirit Attack
if Entity:GetHealth() == 100 and Entity:GetPosition():DistanceToPosition( SpiritEntity:GetPosition()) >= 12 then
	PlayerInput:Console( "/Quickbar 1 1 1" );	
	return false;
end