Jump to content
  • 0
Sign in to follow this  
madtoyz

add function in item_db2 script

Question

hello,last a few years ago i have request henshin function in eAthena.ws/board but the forum already down.

im still save the script function but i forget how to add the function into item_db2 script

 

here is the function.

function	script	Henshin	{	set .@i,(HP*100/MaxHP*100)/100;	if (.@i < 10) {		specialeffect2 EF_HEAL;		specialeffect2 EF_POTION_BERSERK;		unittalk getcharid(3),"Henshin!!";		disguise 1785;		percentheal 100,0;		sleep2 10000;		undisguise;	}	end;}//-- eof --

when player HP below 10% using certain items that got this function will change become monster,if this function will disguise player become atros and will say HENSHIN.

 

Share this post


Link to post
Share on other sites

14 answers to this question

Recommended Posts

  • 0

Simply, in the OnUse script of a file (the first curly braces) make it to contain the following:

callfunc "Henshin";

 

This should make it work.

Share this post


Link to post
Share on other sites
  • 0

Simply, in the OnUse script of a file (the first curly braces) make it to contain the following:

callfunc "Henshin";

 

This should make it work.

 

like this ?

 

29018,kamenriderhelm,kamen rider helm,5,0,,0,,0,,0,0xFFFFFFFF,7,2,7168,,0,0,29018,{},{},{ callfunc "Henshin"; }

Share this post


Link to post
Share on other sites
  • 0

Yes, but on the first curlys, not in the last ones. The first is meant for when an item is used, the second is meant for when an equip is equipped (has almost no sense since the first curlys also get executed when you equip something) and the last ones are meant for the OnUnequip event.

 

Should be like this:

29018,kamenriderhelm,kamen rider helm,5,0,,0,,0,,0,0xFFFFFFFF,7,2,7168,,0,0,29018,{ callfunc "Henshin"; },{},{}

 

Test it before using it on a production server ;) .

 

EDIT: Corrected a big fail.

Share this post


Link to post
Share on other sites
  • 0

ive try it already but nothing happen.

 

the script i make it name Henshin.txt

and put it in npc/basicnpc/change/Henshin.txt

function	script	Henshin	{	set .@i,(HP*100/MaxHP*100)/100;	if (.@i < 30) {		specialeffect2 EF_HEAL;		specialeffect2 EF_POTION_BERSERK;		unittalk getcharid(3),"Henshin!!";		disguise 1785;		percentheal 100,0;		sleep2 10000;		undisguise;	}	end;}//-- eof --

 

in the scripts_custom.conf i already writedown like this.

 

npc: npc/basicnpc/change/Henshin.txt

 

in the item_db2 i put like this

29949,Batman_Helmet,Batman Helmet,5,0,,0,,0,,0,0xFFFFFFFF,7,2,3072,,0,0,2048,{},{},{ callfunc "Henshin"; }

when the user have 30% less HP,they will auto disguise become Atros (numid1785)

 

Share this post


Link to post
Share on other sites
  • 0

WHOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPS, big fail of mine, the script should go on the first curlies as I said but I didn't change it.

 

Try this:

29949,Batman_Helmet,Batman Helmet,5,0,,0,,0,,0,0xFFFFFFFF,7,2,3072,,0,0,2048,{ callfunc "Henshin"; },{},{}

 

Sorry!

Share this post


Link to post
Share on other sites
  • 0

WHOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOPS, big fail of mine, the script should go on the first curlies as I said but I didn't change it.

 

Try this:

29949,Batman_Helmet,Batman Helmet,5,0,,0,,0,,0,0xFFFFFFFF,7,2,3072,,0,0,2048,{ callfunc "Henshin"; },{},{}

 

Sorry!

 

i try it already but still same just before, not working ... 

 

29949,Batman_Helmet,Batman Helmet,5,0,,0,,0,,0,0xFFFFFFFF,7,2,3072,,0,0,2048,{ callfunc "Henshin"; },{},{}

loadnpc - npc/basicnpc/change/Henshing.txt - done. (have try but no working) then i try

server restart - done. (have try but no working)

 

 

Untitled_zps53423eec.jpg

Share this post


Link to post
Share on other sites
  • 0

Will try script on local server then edit. Trying ATM.

 

Edit:

 

Better in a new post since you replied =P

Edited by jaBote

Share this post


Link to post
Share on other sites
  • 0

It works on my side, but don't know any means of recording it.

 

Steps I've done:

[*]Copied over the item on my db/item_db2.txt

[*]Created a new NPC file on my folder, called henshin.txt (which is npc/custom/bote). No clientside files required, but I'll only see an Apple sprite.

[*]Opened server.

[*]Issued @loadnpc npc/custom/bote/henshin.txt (you should use the npc path in your server).

[*]Check @loadnpc feedback (script loaded) and the map server console to see if there was any warning/error. No errors.

[*]Use @item 29949 30. See that's a headgear so I dropped 29 of them :lol: .

[*]Damaged myself to almost death, then use the item. Item works.

Only issue I see is that the script executes twice without any known reason to me, maybe because it uses 2 equipment slots?

 

Pics:

cVsxuFY.jpgWqL7ayL.jpg

Share this post


Link to post
Share on other sites
  • 0

 

function    script    Henshin    {    set @sr,1;    specialeffect2 EF_HEAL;    specialeffect2 EF_POTION_BERSERK;    unittalk getcharid(3),"Henshin!!";    disguise 1785;    percentheal 100,0;    sleep2 10000;    undisguise;    set @sr,0;    end;}

 

 

autobonus2 "{if(((HP*100/MaxHP*100)/100) >=30 || @sr ) end; callfunc "Henshin"; }",10000,10000,BF_WEAPON|BF_MAGIC;

Share this post


Link to post
Share on other sites
  • 0

the problem here is,player will always can equip the items when reach HP 30% ...

i thought third curlys is the best way to put function script but its not support. /swt

 

i try put in the first curlys ( mean when HP 30%,player equip the costume headgear,function will working and after disguise is finish,player can unequip back the costume until HP 30% and HENSHIN again ) /huh

 

Share this post


Link to post
Share on other sites
  • 0

Don't understand very well, this is what I understood:

If user equips it with >30% this has no effect; else call the function Henshin.

 

Or maybe you meant:

User can't equip this with >30%; if equipped call Henshin function, then when its effect ends auto unequip the headgear.

Share this post


Link to post
Share on other sites
  • 0

 

function    script    Henshin    {    set @sr,1;    specialeffect2 EF_HEAL;    specialeffect2 EF_POTION_BERSERK;    unittalk getcharid(3),"Henshin!!";    disguise 1785;    percentheal 100,0;    sleep2 10000;    undisguise;    set @sr,0;    end;}

 

 

autobonus2 "{if(((HP*100/MaxHP*100)/100) >=30 || @sr ) end; callfunc "Henshin"; }",10000,10000,BF_WEAPON|BF_MAGIC;

 

After i try this autobonus2 put in the first curlys, no need to unequip item,they will auto HENSHIN..

and { callfunc "Henshin"; } also can use....

 

DONE. ( sorry for my mistake )

Edited by madtoyz

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
Answer this question...

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

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.