Lineage 2 Tower Forum

Full Version: GetMpPercent
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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;

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

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

until false;
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;

Reference URL's