L2Tower Discord Let's keep the community alive with discord. Discussions about plugins and scripts L2Tower Discord

Thread Closed 
 
Thread Rating:
  • 7 Vote(s) - 1.86 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GetMpPercent
Author Message
diukas Offline
Goblin Grave Robber
*

Posts: 15
Joined: Apr 2011
Reputation: 0
Version: 1.4.1.121
Post: #1
GetMpPercent

Hello i was scripting today, and found out that GetMpPercent() is broken. It returns not Mana percent, but some strange class ids(for example feoh = monk,othell = sword muse...). I think you guys should look up whats is wrong with it. Thx

    LUA Programming
repeat
ShowToClient("mana",L2Class2String(GetTarget():GetMpPercent());
Sleep(1000);
until false;

(This post was last modified: 06-26-2012 21:46 PM by diukas.)
06-26-2012 21:42 PM
Find all posts by this user
amiroooo Offline
Beta Tester

Posts: 1,270
Joined: Sep 2011
Reputation: 412
Version: 1.4.2.142
Post: #2
RE: GetMpPercent

lol
L2Class2String purpose is completely different.. it give you class name given the write class number.

you need to use tostring()
06-26-2012 21:50 PM
Find all posts by this user
Sakaszli Offline
I'm too pro to be pro.
*******

Posts: 1,189
Joined: Jan 2011
Reputation: 484
Version: 1.4.2.134.5b
Post: #3
RE: GetMpPercent

repeat
local temp = GetTarget();
if(temp ~= nil)
then
ShowToClient("mana",tostring(temp:GetMpPercent());
end;
Sleep(1000);

until false;
06-26-2012 21:52 PM
Visit this user's website Find all posts by this user
diukas Offline
Goblin Grave Robber
*

Posts: 15
Joined: Apr 2011
Reputation: 0
Version: 1.4.1.121
Post: #4
RE: GetMpPercent

but still if i make script it starts and never stop healing mana.

    LUA Programming
repeat
local lowmp = 0;
local members = GetPartyList();
for user in members.list do
if (user:GetMpPercent() < 90) then
lowmp = lowmp+1;
end;
end;
if (lowmp == 1) then
UseSkillRaw(Id,false,false);
Sleep(1500);
end;
Sleep(1000);
until false;

(This post was last modified: 06-26-2012 22:00 PM by diukas.)
06-26-2012 21:59 PM
Find all posts by this user
Thread Closed 




User(s) browsing this thread: