Jump to content
Sign in to follow this  
Graf

Приручение монстров

Recommended Posts

Приручение монстров

Взято с архива.

Немного моих мыслей... Думаю не только я замечал, что в коде игры имеются карты монстров, профессия "Animal tamer", что дает нам новую, уникальную профессию.

Так вот пример умения приручения монстров..

Открываем Server/resource/skillinfo.txt и пишем:

0496	Tame	1	-1,10	1,-1	1,-1	1,-1	-1	0	1	0	-1	-1	1	1	1	300	4	1	0	0	0	0	0	SkillSp_TAME	0	0	0	0	Skill_TAME_End	0	0	0	0	0	0	0	0	0	0	0	0	0	0	SkillCooldown_TAME	1	1	11	-1	40	-1	379	0	0	0,0	0,0	0	9	-1	0	0	-1	2	101	0	0	0	s0225.tga	0	0	Monster Skill	Monster Skill	0	0

Открываем Server/resource/script/skilleffect.lua и вставляем:

--Затраты маны
function SkillSp_TAME ( sklv )
	local sp_reduce = 10
	return sp_reduce
end
--Перезарядка умения
function SkillCooldown_TAME( sklv )
	local Cooldown = 35000
	return Cooldown
end

function Skill_TAME_Begin ( role , sklv )
	local sp = Sp(role)
	local sp_reduce = SkillSp_HLKJ ( sklv )
	if sp - sp_reduce < 0 then
	SkillUnable(role)
	return
end

	Sp_Red (role , sp_reduce )
end

function Skill_TAME_End ( ATKER , DEFER , sklv )
	local norm = Is_NormalMonster (DEFER)
	if norm == 0 then
	BickerNotice(ATKER,"Вы не можете использовать умение на игроках! ")
	return 0

	elseif norm == 1 then
	local mob_id = GetChaID(DEFER)
	--Запрет на использование умения на определенных монстрах
	if mob_id == 937 or mob_id == 938 or mob_id == 939 or mob_id == 940 or mob_id == 941 then
	BickerNotice(ATKER,"Вы не можете приручить этого монстра! ")
	return 0
else
	local hp_percent = math.ceil( (Hp (DEFER) / Mxhp (DEFER)) * 100)
	local xx = math.random(1, 20)
	if hp_percent > xx then
	BickerNotice(ATKER,"Приручение не удалось. Попробуйте снова! ")
	elseif hp_percent < xx then
	BickerNotice(ATKER,"Вы успешно приручили - "..GetChaDefaultName(DEFER).."! ")
	local MonsterID = GetChaID(DEFER)
	local x1, y1 = GetChaPos(ATKER)
	local mob = CreateCha(MonsterID, x1, y1, 145, 50)
	SetChaHost(mob, ATKER)
	SetChaAIType(mob, 13)
	SetChaLifeTime(mob, 10000000)
	local hp = Mxhp(ATKER)
	local Health = Mxhp(DEFER)
	hp_recover = 2 * Health
	Hp_Endure_Dmg ( DEFER , hp_recover )
	end
end
end
end

Надеюсь кому-то будет интересно и мы сможем увидеть новую профессию в деле.

Share this post


Link to post
Share on other sites

Что то не пойму что не так постоянно пишет что Приручение не удалось. Попробуйте снова! 

Share this post


Link to post
Share on other sites

@small666 Смею предположить, что ты не пытался изменить шанс на приручение.

local hp_percent = math.ceil( (Hp (DEFER) / Mxhp (DEFER)) * 100)

local xx = math.random(1, 20)

if hp_percent > xx then

BickerNotice(ATKER,"Приручение не удалось. Попробуйте снова! ")

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...