Lineage 2 Tower Forum

Full Version: How do my necr resummon skeleton when dead?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I can't figure out how to get the skeleton re summoned when its dead.
Can anyone help?
the summon ID is 1129 Summon Reanimated Man.

I imagine its just a short scripts in a few lines but im not so good in the programming.
    LUA Programming
SummonSkelet = idofsummoningskill; -- get summoning skill id, not pet, but skill
 
function GetSummonCount()
local petlistaround = GetPetList();
local count = 0;
 
	for Apet in petlistaround.list do
 if (Apet:GetNickName() == me:GetName()) then
 count = count +1;
 end;
	end;
	return count;
end;
 
 
 
repeat
 
if (GetSummonCount() < 1) then
 UseSkillRaw(SummonSkelet,false,false); 
 
 end;
 
 
 Sleep(1000);
 
until false


mby smth like this

btw u can do it by own hands, just editing wynn script Wink

.recstart skelet
summon pet
.recstop
open scripts folder
there will be skelet.lua,open and u will got skill id
This lines will erase your summon when less than 50% hp and resummon it

for script
    LUA Programming
repeat
	pet = GetPet();
	if pet == nil then
		UseSkillRaw(1129,false,false);
	elseif (pet:GetHpPercent() <= 50) and not pet:IsAlikeDeath() then
		UseSkillRaw(11152,false,false);
	end;
until false;



for plugin
    LUA Programming
function OnLTick500ms()
	pet = GetPet();
	if pet == nil then
		UseSkillRaw(1129,false,false);
	elseif (pet:GetHpPercent() <= 50) and not pet:IsAlikeDeath() then
		UseSkillRaw(11152,false,false);
	end;
end;

(10-20-2014 14:16 PM)TheQQmaster Wrote: [ -> ]
    LUA Programming
SummonSkelet = idofsummoningskill; -- get summoning skill id, not pet, but skill
 
function GetSummonCount()
local petlistaround = GetPetList();
local count = 0;
 
	for Apet in petlistaround.list do
 if (Apet:GetNickName() == me:GetName()) then
 count = count +1;
 end;
	end;
	return count;
end;
 
 
 
repeat
 
if (GetSummonCount() < 1) then
 UseSkillRaw(SummonSkelet,false,false); 
 
 end;
 
 
 Sleep(1000);
 
until false


mby smth like this

btw u can do it by own hands, just editing wynn script Wink

.recstart skelet
summon pet
.recstop
open scripts folder
there will be skelet.lua,open and u will got skill id

cant get it to work, now my char is just standing trying to summon even if the pet is out, and dont attack anymore.

(10-20-2014 17:21 PM)Tuxevil Wrote: [ -> ]This lines will erase your summon when less than 50% hp and resummon it

for script
    LUA Programming
repeat
	pet = GetPet();
	if pet == nil then
 UseSkillRaw(1129,false,false);
	elseif (pet:GetHpPercent() <= 50) and not pet:IsAlikeDeath() then
 UseSkillRaw(11152,false,false);
	end;
until false;



for plugin
    LUA Programming
function OnLTick500ms()
	pet = GetPet();
	if pet == nil then
 UseSkillRaw(1129,false,false);
	elseif (pet:GetHpPercent() <= 50) and not pet:IsAlikeDeath() then
 UseSkillRaw(11152,false,false);
	end;
end;


As soon i turn on this script, my client crash.
my works now too, tested

    LUA Programming
SummonSkelet = 1129; -- Summon Reanimated Man
 
function GetSummonCount()
local petlistaround = GetPetList();
local count = 0;
 
	for Apet in petlistaround.list do
 if (Apet:GetNickName() == GetMe():GetName()) then
 count = count +1;
 end;
	end;
	return count;
end;
 
 
 
repeat
 
if (GetSummonCount() < 1) then
 UseSkillRaw(SummonSkelet,false,false); 
 
 end;
 
 
 Sleep(1000);
 
until false



2nd guy script neeed sleep or it will crash

    LUA Programming
elseif (pet:GetHpPercent() <= 50) and not pet:IsAlikeDeath() then



if skill cd pet will be nil and in this line it will crash, coz no nil check of pet...
(10-20-2014 20:51 PM)TheQQmaster Wrote: [ -> ]my works now too, tested

    LUA Programming
SummonSkelet = 1129; -- Summon Reanimated Man
 
function GetSummonCount()
local petlistaround = GetPetList();
local count = 0;
 
	for Apet in petlistaround.list do
 if (Apet:GetNickName() == GetMe():GetName()) then
 count = count +1;
 end;
	end;
	return count;
end;
 
 
 
repeat
 
if (GetSummonCount() < 1) then
 UseSkillRaw(SummonSkelet,false,false); 
 
 end;
 
 
 Sleep(1000);
 
until false



2nd guy script neeed sleep or it will crash

    LUA Programming
elseif (pet:GetHpPercent() <= 50) and not pet:IsAlikeDeath() then



if skill cd pet will be nil and in this line it will crash, coz no nil check of pet...

How? Please show me, I cant see what you mean.
@kagekonen
    LUA Programming
elseif (pet ~= nil) and (pet:GetHpPercent() <= 50) and not pet:IsAlikeDeath() then
-- if pet not nil,he exists and pet get hp <=50% and not pet dead
-- and ofc u can add skill check and that owner of pet not dead to not spam skill : D
-- gl

Reference URL's