Jump to content
dragontechi

effect to equipme function

Recommended Posts

Well now you can perform the task of adding the effect to function, the only problem is that when you unequip the equipment, the bonus remains

-- death set test
function Setdeath_Timer( ignore, role, freq, time )
		local statelv = 1
		local statetime = 3600
		local death_BODY = GetEquipItemP( role, 2 )
		local death_GLOVE = GetEquipItemP( role, 3 )
		local death_SHOES = GetEquipItemP( role, 4 )
		local death_BODY_ID = GetItemID ( death_BODY )
		local death_GLOVE_ID = GetItemID ( death_GLOVE )
		local death_SHOES_ID = GetItemID ( death_SHOES )
		local Fdeath_BODY_ID = GetItemAttr ( death_BODY , ITEMATTR_VAL_FUSIONID )
		local Fdeath_GLOVE_ID = GetItemAttr ( death_GLOVE , ITEMATTR_VAL_FUSIONID )
		local Fdeath_SHOES_ID = GetItemAttr ( death_SHOES , ITEMATTR_VAL_FUSIONID )

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

		elseif(Fdeath_BODY_ID == 2817 and Fdeath_GLOVE_ID == 2818 and Fdeath_SHOES_ID == 2819)then
			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
		end
Hook:AddPostHook("cha_timer", Setdeath_Timer)

 

Share this post


Link to post
Share on other sites

@dragontechi

 

Try this condition:

local body  = (death_BODY_ID  == 2817 or Fdeath_BODY_ID  == 2817)
local glove = (death_GLOVE_ID == 2818 or Fdeath_GLOVE_ID == 2818)
local shoes = (death_SHOES_ID == 2819 or Fdeath_SHOES_ID == 2819)

if ( (body == true) and (glove == true) and (shoes == true) ) then
	
	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

 

  • Like 1

Share this post


Link to post
Share on other sites

only death is giving the bonus

 

-- Cloak System
-- Author: techi
-- Version 1.0 (compatible with version 1.36+ Files)
print(">> Death Set Buff")
-- death set test
function Setdeath_Timer( ignore, role, freq, time )
		local statelv = 1
		local statetime = 3600
		local death_BODY = GetEquipItemP( role, 2 )
		local death_GLOVE = GetEquipItemP( role, 3 )
		local death_SHOES = GetEquipItemP( role, 4 )
		local death_BODY_ID = GetItemID ( death_BODY )
		local death_GLOVE_ID = GetItemID ( death_GLOVE )
		local death_SHOES_ID = GetItemID ( death_SHOES )
		local body  = (death_BODY_ID  == 2817 or Fdeath_BODY_ID  == 2817)
		local glove = (death_GLOVE_ID == 2818 or Fdeath_GLOVE_ID == 2818)
		local shoes = (death_SHOES_ID == 2819 or Fdeath_SHOES_ID == 2819)

if ( (body == true) and (glove == true) and (shoes == true) ) then
	
	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
		end
Hook:AddPostHook("cha_timer", Setdeath_Timer)

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
32 minutes ago, V3ct0r said:

@dragontechi

 

Pruebe esta condición:




	
	

	
	
		

 

 

image.png.67bcd114822a6ee0c60abf6f94f630e3.pngimage.png.f8dfadf5720c9cdb1aebf3a4541bfa64.png

 

Share this post


Link to post
Share on other sites

This have lots of bugs with cha_timer, Eviles had a nice script that included Add/Rem effects, along with cloak and the prawn dump bugs/fairy poss. I have his script he wrote long ago, but I rather not without his permission. Maybe if you can contact him, he may be able to sell it to you, it's organized and works well.


Nissan-GT-R.gif

Share this post


Link to post
Share on other sites
23 hours ago, Dan said:

Esto tiene muchos errores con cha_timer, Eviles tenía un buen script que incluía efectos Add/Rem, junto con cloak y los bugs/fairy poss de volcado de gambas. Tengo su guión que escribió hace mucho tiempo, pero prefiero no hacerlo sin su permiso. Tal vez si puede contactarlo, él puede vendérselo, está organizado y funciona bien.

 

Thank you very much but I prefer to finish the script and share it publicly

Share this post


Link to post
Share on other sites
On 1/7/2022 at 8:22 PM, Dan said:

This have lots of bugs with cha_timer, Eviles had a nice script that included Add/Rem effects, along with cloak and the prawn dump bugs/fairy poss. I have his script he wrote long ago, but I rather not without his permission. Maybe if you can contact him, he may be able to sell it to you, it's organized and works well.

 

On 1/7/2022 at 5:35 AM, V3ct0r said:

@dragontechi

 

Try this condition:


local body  = (death_BODY_ID  == 2817 or Fdeath_BODY_ID  == 2817)
local glove = (death_GLOVE_ID == 2818 or Fdeath_GLOVE_ID == 2818)
local shoes = (death_SHOES_ID == 2819 or Fdeath_SHOES_ID == 2819)

if ( (body == true) and (glove == true) and (shoes == true) ) then
	
	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

 

Thank you very much after being able to make the scrint start correctly

Edited by dragontechi
farta de infomacion

Share this post


Link to post
Share on other sites
6 hours ago, dragontechi said:

 

Thank you very much but I prefer to finish the script and share it publicly

I am just saying, it will work, but regardless, when you use prawn dump/fairy poss/cloaks etc it will cause a lot of bugs because of cha_timer.

 

 

  • Like 1

Nissan-GT-R.gif

Share this post


Link to post
Share on other sites
2 hours ago, Dan said:

Solo digo que funcionará, pero de todos modos, cuando usas gambas, poses de hadas, capas, etc., causará muchos errores debido a cha_timer.

If I already removed that errors I am fine-tuning the script right now

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...