Ejemplo n.º 1
0
        public string GetAbilityBehavior(bool ForFile)
        {
            string DOTA_ABILITY_BEHAVIOR   = "";
            string AbilityBehaviorForFiles = "";

            if (AbilityBehavior.Contains("NoTarget"))
            {
                DOTA_ABILITY_BEHAVIOR    = "DOTA_ABILITY_BEHAVIOR_NO_TARGET";
                AbilityBehaviorForFiles += "notarget";
            }
            else if (AbilityBehavior.Contains("TargetSystem"))
            {
                DOTA_ABILITY_BEHAVIOR    = "DOTA_ABILITY_BEHAVIOR_NO_TARGET";
                AbilityBehaviorForFiles += "targetsystem";
            }
            else if (AbilityBehavior.Contains("Point"))
            {
                DOTA_ABILITY_BEHAVIOR    = "DOTA_ABILITY_BEHAVIOR_POINT";
                AbilityBehaviorForFiles += "point";
            }
            else if (AbilityBehavior.Contains("Targeted"))
            {
                DOTA_ABILITY_BEHAVIOR    = "DOTA_ABILITY_BEHAVIOR_UNIT_TARGET";
                AbilityBehaviorForFiles += "targeted";
            }

            if (AbilityBehavior.Contains("Instant"))
            {
                //DOTA_ABILITY_BEHAVIOR += " | DOTA_ABILITY_BEHAVIOR_DONT_CANCEL_MOVEMENT";
                AbilityBehaviorForFiles += "_instant";
            }
            if (AbilityBehavior.Contains("Channeled"))
            {
                DOTA_ABILITY_BEHAVIOR   += " | DOTA_ABILITY_BEHAVIOR_CHANNELLED";
                AbilityBehaviorForFiles += "_channeled";
            }

            if (AbilityBehavior.Contains("AOE"))
            {
                DOTA_ABILITY_BEHAVIOR += " | DOTA_ABILITY_BEHAVIOR_AOE";
                //AbilityBehaviorForFiles += "_aoe";
            }

            if (AbilityBehavior.Contains("Toggle"))
            {
                DOTA_ABILITY_BEHAVIOR += " | DOTA_ABILITY_BEHAVIOR_TOGGLE";
                //AbilityBehaviorForFiles += "_aoe";
            }


            if (ForFile)
            {
                return(AbilityBehaviorForFiles);
            }

            return(DOTA_ABILITY_BEHAVIOR);
        }
Ejemplo n.º 2
0
        private string Point()
        {
            string Return = "";

            if (AbilityBehavior.Contains("Point"))
            {
                Return += "\n	local point			= self:GetCursorPosition()";
            }

            return(Return);
        }
Ejemplo n.º 3
0
        private string GetAOERadius()
        {
            string Return = "";

            if (AbilityBehavior.Contains("AOE"))
            {
                Return += "\n";
                Return += "\nfunction " + CodeName + ":GetAOERadius()";
                Return += "\n	return self:GetSpecialValueFor( \"AoERadius\" )";
                Return += "\nend";
            }

            return(Return);
        }
Ejemplo n.º 4
0
        private string GetVictims()
        {
            string Return = "";

            if (AbilityBehavior.Contains("AOE"))
            {
                Return += "\n	-- DOTA_UNIT_TARGET_TEAM_FRIENDLY; DOTA_UNIT_TARGET_TEAM_ENEMY; DOTA_UNIT_TARGET_TEAM_BOTH";
                Return += "\n	local units	= FindUnitsInRadius(team, point, nil, AoERadius, DOTA_UNIT_TARGET_TEAM_FRIENDLY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_NONE, FIND_ANY_ORDER, false)";
            }
            else if (AoERadius != "" && AoERadius != "-")
            {
                Return += "\n	-- DOTA_UNIT_TARGET_TEAM_FRIENDLY; DOTA_UNIT_TARGET_TEAM_ENEMY; DOTA_UNIT_TARGET_TEAM_BOTH";
                Return += "\n	local units	= FindUnitsInRadius(team, caster_loc, nil, AoERadius, DOTA_UNIT_TARGET_TEAM_FRIENDLY, DOTA_UNIT_TARGET_HERO + DOTA_UNIT_TARGET_BASIC, DOTA_UNIT_TARGET_FLAG_NONE, FIND_ANY_ORDER, false)";
            }

            return(Return);
        }
Ejemplo n.º 5
0
        private string CheckDistanceToTarget()
        {
            string Return = "";

            if (AbilityBehavior.Contains("TargetSystem") && AbilityCastRange != "" && AbilityCastRange != "-")
            {
                Return += "\n	local AbilityCastRange = self:GetSpecialValueFor(\"AbilityCastRange\")";
                Return += "\n";
                Return += "\n	-- Check Range --";
                Return += "\n	local timer1 = Timers:CreateTimer(0, function()";
                Return += "\n		local result = CheckDistanceToTarget(playerID, player, caster, AbilityCastRange,  \""+ CodeName + "\")";
                Return += "\n		if result then return 0.02";
                Return += "\n		else caster:Stop() return false end";
                Return += "\n	end)";
                Return += "\n	Timers:CreateTimer(self:GetCastPoint()-0.05, function()";
                Return += "\n		Timers:RemoveTimer(timer1)";
                Return += "\n	end)";
            }

            return(Return);
        }
Ejemplo n.º 6
0
        private string Target()
        {
            string Return = "";

            if (AbilityBehavior.Contains("NoTarget"))
            {
                Return += "\n	local victim		= caster";
                Return += "\n	local victim_loc	= victim:GetAbsOrigin()";
            }
            else if (AbilityBehavior.Contains("Targeted"))
            {
                Return += "\n	local victim		= self:GetCursorTarget()";
                Return += "\n	local victim_loc	= victim:GetAbsOrigin()";
            }
            else if (AbilityBehavior.Contains("TargetSystem"))
            {
                Return += "\n	local victim		= GameRules.PLAYER_HEROES_TARGET[playerID+1]";
                Return += "\n	local victim_loc	= victim:GetAbsOrigin()";
            }

            return(Return);
        }