Jump to content
  • 0

How to activate item autobonus script on specific maps


Question

Posted

asdasd

asdasd

I have an item and my intended effect is for variable to be added everytime a player attacks someone in a specific area when their HP is 10% or lower.

 

My rough script is:

autobonus "{ if ( readparam(Hp) <= readparam(MaxHP)/10 ) { set haki,haki+1; } }",1000,1000,0,"{}";

 

this part of the script works and I'm getting a variable everytime I hit someone when my HP falls below to 10%. How can I modify this so that it only works on specific maps? I tried it like:

 

1. autobonus "{ if ( readparam(Hp) <= readparam(MaxHP)/10 && strcharinfo(3) == "guild_vs1" ) { set haki,haki+1; } }",1000,1000,0,"{}"; = this one has an error in the map server. parse_callfunc: not enough arguements, expected ','. The 

 

2. if ( strcharinfo(3) == "guild_vs1" ) {

 autobonus "{ if ( readparam(Hp) <= readparam(MaxHP)/10 && strcharinfo(3) == "guild_vs1" ) { set haki,haki+1; } }",1000,1000,0,"{}"

end;

}

end;

 

and it did work on the specified map but when I leave the map, the autobonus part of the script still works, any fix on this?

 

1 answer to this question

Recommended Posts

  • 0
Posted

U can use Event Label OnPCLoadMapEvent.

Dont forget to add the loadevent map flag.

 

- script autobonus#haki -1,{

 

OnPCLoadMapEvent:

    if(strcharinfo(3)=="guild_vs1")

        autobonus "{ if(readparam(HP) <= readparam(MaxHP)/10 ) { set haki,haki+1; } }",1000,1000,0,"{}";

    end;

    

OnInit:

    end;

}

guild_vs1 mapflag loadevent

 

 

Rynbef~

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...