Jump to content
  • 0

How to activate item autobonus script on specific maps


ran0120

Question


  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.04
  • Content Count:  25
  • Reputation:   0
  • Joined:  05/18/23
  • Last Seen:  

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?

 

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  898
  • Reputation:   119
  • Joined:  05/23/12
  • Last Seen:  

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~

Link to comment
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.   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.

×
×
  • Create New...