Jump to content
dragontechi

set function class

Recommended Posts

 

How can I add a function that gives you a bonus per class when having this death set example cleric bolt x5 with 50 for 5 seconds random

2817	[Last] Death Torso 	e1041	10110002	0000920002	0001930002	0002991002	0003010302	0	00	27	10	0	0	0	1	1	1	1	1	1	1	180000	-1	75	-1	0	0	2	-1	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	120,120	140,140	0,0	0,0	0,0	0,0	0,0	200,200	0,0	0,0	0,0	5,5	0,0	5,5	10,10	5,5	0,0	0,0	0,0	0,0	0,0	110,110	880,880	0,0	0,0	0,0	0,0	0,0	6,6	0,0	0,0	0,0	32,33	0	7000,7000	20000,20000	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	Lv 75 Champion Boss Tattoo	
2818	[Last] Death Gloves 	e1039	10110003	0000920003	0001930003	0002991003	0003010303	0	00	23	0	0	0	0	1	1	1	1	1	1	1	120000	-1	75	-1	0	0	3	-1	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	5,5	5,5	5,5	5,5	5,5	0,0	0,0	0,0	20,20	0,0	60,70	220,220	100,100	0,0	70,70	0,0	0,0	5,5	5,5	0,0	0,0	0,0	0	7000,7000	20000,20000	3	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	Champion 75 Boss Gloves	
2819	[Last] Death Boots 	e1040	10110004	0000920004	0001930004	0002991004	0003010304	0	00	24	0	0	0	0	1	1	1	1	1	1	1	120000	-1	75	-1	0	0	4	-1	0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	0,0	5,5	5,5	5,5	5,5	0,0	0,0	0,0	0,0	0,0	0,0	45,50	300,300	0,0	55,55	0,0	0,0	0,0	8,8	0,0	0,0	0,0	0,0	0	7000,7000	20000,20000	3	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	Lv75 Champion Boss Boots	

Share this post


Link to post
Share on other sites

Hello @dragontechi!

 

Write a function that will check that your set is equipped on the character.

 

functions.lua

function is_dragontechi_set_equipped(role)

	local body_id = GetItemID( GetChaItem(role, 1, 2) )
	local hand_id = GetItemID( GetChaItem(role, 1, 3) )
	local foot_id = GetItemID( GetChaItem(role, 1, 4) )
	
	return (body_id == 2817 and hand_id == 2818 and foot_id == 2819)

end

Then open the function of the skill you are interested in and write the code that will give the bonus for the set.

 

For example, skilleffect.lua, function Skill_Xlcz_End (Spiritual Bolt)

-- ID: 99 Spiritual Bolt
function Skill_Xlcz_End(ATKER, DEFER, sklv) 
	
	. . . 
	
	dmg_fin = dmg_fin + dmg_ElfSkill
	
	-- Check that the set is equipped on the character
	if ( is_dragontechi_set_equipped(ATKER) == true ) then
		
		-- Add some bonus for the set - increase damage by 100 units
		dmg_fin = dmg_fin + 100
	
	end
	
	Hp_Endure_Dmg(DEFER, dmg_fin) 
	
	. . .
	
end 

 

  • Like 1

Share this post


Link to post
Share on other sites

 

functions.lua

-- death set test

		local death_BODY = GetEquipItemP( role, 2 )
		local death_BODY_ID = GetItemID ( death_BODY )
		local death_GLOVE = GetEquipItemP( role, 3 )
		local death_GLOVE_ID = GetItemID ( death_GLOVE )
		local death_SHOES = GetEquipItemP( role, 4 )
		local death_SHOES_ID = GetItemID ( death_SHOES )

		
		if(death_BODY_ID == 2817 and death_GLOVE_ID == 2818 and death_SHOES_ID == 2819)then
			local statelv = 1
			local statetime = 3600
			AddState ( role , role , State_deathcruss , statelv , statetime )			

		else
			local state_State_deathcruss = GetChaStateLv ( role , State_deathcruss )
			if state_State_deathcruss ~= 0 then
				RemoveState ( role , State_deathcruss )
			end
		end

 

skilleffect.lua

 

function State_deathcruss_Add ( role , statelv )
local job = GetChaAttr(role, ATTR_JOB)
if job == 9 then --cruss

	local str_dif = 12
	local strsb = StrSb( role ) + str_dif
	SetCharaAttr( strsb , role , ATTR_STATEV_STR )
	local agi_dif = 5
	local agisb = AgiSb( role ) + agi_dif
	SetCharaAttr( agisb , role , ATTR_STATEV_AGI )
	local con_dif = 4
	local consb = ConSb( role ) + con_dif
	SetCharaAttr( consb , role , ATTR_STATEV_CON )	
	
	SystemNotice(role, "<Crusader Death Bonus>:Active!")
	SystemNotice(role, "<STR>12:!")
	SystemNotice(role, "<AGI>5:!")
	SystemNotice(role, "<CON>4:!")		
	ALLExAttrSet(role)
	RefreshCha(role)
end
if job == 8 then --Champ

	local str_dif = 12
	local strsb = StrSb( role ) + str_dif
	SetCharaAttr( strsb , role , ATTR_STATEV_STR )
	local con_dif = 10
	local consb = ConSb( role ) + con_dif
	SetCharaAttr( consb , role , ATTR_STATEV_CON )	
	local hrecsb_dif = 8
	local hrecsb = HrecSb( role ) + hrecsb_dif
	SetCharaAttr( hrecsb , role , ATTR_STATEV_HREC )

	SystemNotice(role, "<Champion Death Bonus>:Active!")
	SystemNotice(role, "<STR>12:!")
	SystemNotice(role, "<CON>10:!")
	SystemNotice(role, "<HPrecovery>8:!")		
	ALLExAttrSet(role)
	RefreshCha(role)
end

if job == 12 then --ss

	local dex_dif = 12
	local dexsb = DexSb( role ) + dex_dif
	SetCharaAttr( dexsb , role , ATTR_STATEV_DEX )
	local agi_dif = 5
	local agisb = AgiSb( role ) + agi_dif
	SetCharaAttr( agisb , role , ATTR_STATEV_AGI )
	local con_dif = 4
	local consb = ConSb( role ) + con_dif
	SetCharaAttr( consb , role , ATTR_STATEV_CON )	
	
	SystemNotice(role, "<Sharpshooter Death Bonus>:Active!")
	SystemNotice(role, "<ACC>12:!")
	SystemNotice(role, "<AGI>5:!")
	SystemNotice(role, "<CON>4:!")		
	ALLExAttrSet(role)
	RefreshCha(role)
end
end
---- remover deatttttth
function State_deathcruss_Rem ( role , statelv )
local job = GetChaAttr(role, ATTR_JOB)
if job == 9 then --Crusader
	local str_dif = 12
	local strsb = StrSb( role ) - str_dif
	SetCharaAttr( strsb , role , ATTR_STATEV_STR )
	local agi_dif = 5
	local agisb = AgiSb( role ) - agi_dif
	SetCharaAttr( agisb , role , ATTR_STATEV_AGI )
	local con_dif = 4
	local consb = ConSb( role ) - con_dif
	SetCharaAttr( consb , role , ATTR_STATEV_CON )	
	
	SystemNotice(role, "<Crusader Death Bonus>:Remove!")
	SystemNotice(role, "<STR>12:!")
	SystemNotice(role, "<AGI>5:!")
	SystemNotice(role, "<CON>4:!")		
	ALLExAttrSet(role)
	RefreshCha(role)
end
if job == 8 then --Champion

	local str_dif = 12
	local strsb = StrSb( role ) - str_dif
	SetCharaAttr( strsb , role , ATTR_STATEV_STR )
	local con_dif = 10
	local consb = ConSb( role ) - con_dif
	SetCharaAttr( consb , role , ATTR_STATEV_CON )	
	local hrecsb_dif = 8
	local hrecsb = HrecSb( role ) - hrecsb_dif
	SetCharaAttr( hrecsb , role , ATTR_STATEV_HREC )

	SystemNotice(role, "<Champion Death Bonus>:Remove!")
	SystemNotice(role, "<STR>12:!")
	SystemNotice(role, "<CON>10:!")
	SystemNotice(role, "<HPrecovery>8:!")		
	ALLExAttrSet(role)
	RefreshCha(role)
end
if job == 12 then --Sharpshooter

	local dex_dif = 12
	local dexsb = DexSb( role ) - dex_dif
	SetCharaAttr( dexsb , role , ATTR_STATEV_DEX )
	local agi_dif = 5
	local agisb = AgiSb( role ) - agi_dif
	SetCharaAttr( agisb , role , ATTR_STATEV_AGI )
	local con_dif = 4
	local consb = ConSb( role ) - con_dif
	SetCharaAttr( consb , role , ATTR_STATEV_CON )	
	
	SystemNotice(role, "<Sharpshooter Death Bonus>:Remove!")
	SystemNotice(role, "<ACC>12:!")
	SystemNotice(role, "<AGI>5:!")
	SystemNotice(role, "<CON>4:!")		
	ALLExAttrSet(role)
	RefreshCha(role)
end
end

I can not use this function that I already did since there it is for a job already added

Edited by dragontechi
farta de infomacion

Share this post


Link to post
Share on other sites
On 1/6/2022 at 6:46 PM, V3ct0r said:

Hello @dragontechi!

 

Write a function that will check that your set is equipped on the character.

 

functions.lua


function is_dragontechi_set_equipped(role)

	local body_id = GetItemID( GetChaItem(role, 1, 2) )
	local hand_id = GetItemID( GetChaItem(role, 1, 3) )
	local foot_id = GetItemID( GetChaItem(role, 1, 4) )
	
	return (body_id == 2817 and hand_id == 2818 and foot_id == 2819)

end

Then open the function of the skill you are interested in and write the code that will give the bonus for the set.

 

For example, skilleffect.lua, function Skill_Xlcz_End (Spiritual Bolt)


-- ID: 99 Spiritual Bolt
function Skill_Xlcz_End(ATKER, DEFER, sklv) 
	
	. . . 
	
	dmg_fin = dmg_fin + dmg_ElfSkill
	
	-- Check that the set is equipped on the character
	if ( is_dragontechi_set_equipped(ATKER) == true ) then
		
		-- Add some bonus for the set - increase damage by 100 units
		dmg_fin = dmg_fin + 100
	
	end
	
	Hp_Endure_Dmg(DEFER, dmg_fin) 
	
	. . .
	
end 

 

image.png.01524e9351be43f0a5729993af6c12e6.pngimage.png.73020356269706b2fb0e5de1ee4fc3c0.png

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.


×
×
  • Create New...