Идеально переписсаный Аганимчик

Adam Smith

Друзья CG
4 Окт 2014
472
3
18
18
Реакции
3 0 0
#1
Написал нормальный аганим, не то говно что у Pizzalol
Код:
		"item_recipe_ultimate_scepter"
		{
			// General
			//-------------------------------------------------------------------------------------------------------------
			"ID"							"7007"														// unique ID number for this item. Do not change this once established or it will invalidate collected stats.
			"BaseClass"				"item_datadriven"
			// Item Info
			//-------------------------------------------------------------------------------------------------------------
			"ItemCost"						"800"
			"ItemShopTags"				""

			// Recipe
			//-------------------------------------------------------------------------------------------------------------
			"ItemRecipe"					"1"
			"ItemResult"					"item_ultimate_scepter"
			"ItemRequirements"
			{
				"01"						"item_point_booster;item_staff_of_wizardry;item_ogre_axe;item_blade_of_alacrity"
			}
		}

		//=================================================================================================================
		// Scepter
		//=================================================================================================================
		"item_ultimate_scepter"
		{
			// General
			//-------------------------------------------------------------------------------------------------------------
			"ID"												"7008"														// unique ID number for this item. Do not change this once established or it will invalidate collected stats.
			"AbilityBehavior"						"DOTA_ABILITY_BEHAVIOR_PASSIVE"
			"AbilityUnitTargetTeam"			"DOTA_UNIT_TARGET_TEAM_FRIENDLY"
			"AbilityUnitTargetType"			"DOTA_UNIT_TARGET_HERO"
			"AbilityUnitTargetFlags"		"DOTA_UNIT_TARGET_FLAG_NOT_CREEP_HERO"
	  "ItemSellable"							"0"
			"AbilityCastRange"					"600"
			"BaseClass"									"item_lua"
			"ScriptFile"								"items/item_ultimate_scepter.lua"
			"AbilityTextureName"				"item_ultimate_scepter"


			// Item Info
			//-------------------------------------------------------------------------------------------------------------
			"ItemCost"									"5000"
			"ItemShopTags"							"int;str;agi;mana_pool;health_pool;hard_to_tag"
			"ItemQuality"								"rare"
			"ItemAliases"								"ultimate;aghanim's scepter"
			//"ItemDisassembleRule"			"DOTA_ITEM_DISASSEMBLE_NEVER"		// heroes for whom this is a problem solve it in their code - ogre magi, meepo
			"ItemDeclarations"					"DECLARE_PURCHASES_TO_TEAMMATES | DECLARE_PURCHASES_IN_SPEECH | DECLARE_PURCHASES_TO_SPECTATORS"

			// Special
			//-------------------------------------------------------------------------------------------------------------
			"AbilitySpecial"
			{
				"01"
				{
					"var_type"				"FIELD_INTEGER"
					"bonus_all_stats"		"25"
				}
				"02"
				{
					"var_type"				"FIELD_INTEGER"
					"bonus_health"			"200"
				}
				"03"
				{
					"var_type"				"FIELD_INTEGER"
					"bonus_mana"			"150"
				}
			}
		}
Код:
if item_ultimate_scepter == nil then
	item_ultimate_scepter = class({})
end

function item_ultimate_scepter:CastFilterResultTarget( hTarget )

	if hTarget:HasModifier("modifier_item_ultimate_scepter_consumed") then
		return UF_FAIL_CUSTOM
	end

	local nResult = UnitFilter( hTarget, DOTA_UNIT_TARGET_TEAM_FRIENDLY, DOTA_UNIT_TARGET_HERO, DOTA_UNIT_TARGET_FLAG_MAGIC_IMMUNE_ENEMIES, self:GetCaster():GetTeamNumber() )
	if nResult ~= UF_SUCCESS then
		return nResult
	end

	return UF_SUCCESS
end

--------------------------------------------------------------------------------

function item_ultimate_scepter:GetCustomCastErrorTarget( hTarget )
	if hTarget:HasModifier("modifier_item_ultimate_scepter_consumed") then
		return "#dota_hud_error_cant_cast_scepter_buff"
	end

	return ""
end


function item_ultimate_scepter:GetBehavior()
	if self:GetCaster():GetUnitName() == "npc_dota_hero_alchemist" then
			behav = DOTA_ABILITY_BEHAVIOR_UNIT_TARGET
	else
		 behav = DOTA_ABILITY_BEHAVIOR_PASSIVE
	end
	return behav
end

function item_ultimate_scepter:GetIntrinsicModifierName()
	return "modifier_item_ultimate_scepter"
end


function item_ultimate_scepter:OnSpellStart()
		local target = self:GetCursorTarget()
 	target:AddNewModifier( self:GetCaster(), self, "modifier_item_ultimate_scepter_consumed", nil )
  local nFXIndex = ParticleManager:CreateParticle( "particles/units/heroes/hero_sven/sven_spell_warcry.vpcf", PATTACH_ABSORIGIN_FOLLOW, self:GetCaster() )
  ParticleManager:SetParticleControlEnt( nFXIndex, 2, self:GetCaster(), PATTACH_POINT_FOLLOW, "attach_head", self:GetCaster():GetOrigin(), true )
  ParticleManager:ReleaseParticleIndex( nFXIndex )
  EmitSoundOn( "Hero_Alchemist.Scepter.Cast", self:GetCaster() )
		self:RemoveSelf()
end
 
Последнее редактирование модератором:

Илья

Супермодератор
Команда форума
25 Сен 2015
2,348
40
48
27
Реакции
40 0 0
#2
Ну что, молодец))
 

UZzip

Продвинутый
2 Янв 2016
282
0
16
26
Реакции
0 0 0
#3
В исходниках Жизни на арене не хуже. ;)
 
Реклама: