Ich checke einfach das System der Quest nicht, wie füge ich da neue Pets ein, so das ich sie rufen kann?
PHP Code:
quest haustiere begin
state start begin
-- Setzt den neuen Petnamen in die Datenbank ein
function set_pet_name(name)
mysql_query("DELETE FROM player.pet_name WHERE id = \\'"..pc.get_player_id().."\\'")
mysql_query("INSERT INTO player.pet_name(id, name) VALUES(\\'"..pc.get_player_id().."\\', \\'"..name.."\\')")
end
-- Holt sich den Petnamen aus der Datenbank
function get_pet_name()
local pet_name = mysql_query("SELECT * FROM player.pet_name WHERE id = \\'"..pc.get_player_id().."\\'")
return (pet_name.name or {pc.get_name().."'s Haustier"})[1]
end
-- Feuer-Phönix
when 53001.use begin
if pet.is_summon() then
pet.unsummon()
chat("Dein Haustier verabschiedet sich nun von dir!")
affect.remove_collect(apply.MAX_HP, 8000, 60*60*24*365*60)
else
local old_level = horse.get_level()
local old_name = horse.get_name()
horse.set_level(22)
horse.set_name(haustiere.get_pet_name())
pet.summon()
horse.set_level(old_level)
horse.set_name(old_name)
affect.add_collect(apply.MAX_HP, 8000, 60*60*24*365*60)
end
end
-- Baby-Panda
when 53002.use begin
if pet.is_summon() then
pet.unsummon()
chat("Dein Haustier verabschiedet sich nun von dir!")
affect.remove_collect(72, 8, 60*60*24*365*60)
else
local old_level = horse.get_level()
local old_name = horse.get_name()
horse.set_level(24)
horse.set_name(haustiere.get_pet_name())
pet.summon()
horse.set_level(old_level)
horse.set_name(old_name)
affect.add_collect(72, 8, 60*60*24*365*60)
end
end
-- Eis-Phönix
when 53003.use begin
if pet.is_summon() then
pet.unsummon()
chat("Dein Haustier verabschiedet sich nun von dir!")
affect.remove_collect(apply.MAX_HP, 8000, 60*60*24*365*60)
else
local old_level = horse.get_level()
local old_name = horse.get_name()
horse.set_level(23)
horse.set_name(haustiere.get_pet_name())
pet.summon()
horse.set_level(old_level)
horse.set_name(old_name)
affect.add_collect(apply.MAX_HP, 8000, 60*60*24*365*60)
end
end
-- Baby-Azrael
when 53005.use begin
if pet.is_summon() then
pet.unsummon()
chat("Dein Haustier verabschiedet sich nun von dir!")
affect.remove_collect(apply.ATT_BONUS_TO_MONSTER, 30, 60*60*24*365*60)
affect.remove_collect(apply.MAX_HP, 10000, 60*60*24*365*60)
else
local old_level = horse.get_level()
local old_name = horse.get_name()
horse.set_level(25)
horse.set_name(haustiere.get_pet_name())
pet.summon()
horse.set_level(old_level)
horse.set_name(old_name)
affect.add_collect(apply.ATT_BONUS_TO_MONSTER, 30, 60*60*24*365*60)
affect.add_collect(apply.MAX_HP, 10000, 60*60*24*365*60)
end
end
-- Baby-Hund
when 53006.use begin
if pet.is_summon() then
pet.unsummon()
chat("Dein Haustier verabschiedet sich nun von dir!")
affect.remove_collect(apply.ATT_BONUS_TO_MONSTER, 8, 60*60*24*365*60)
else
local old_level = horse.get_level()
local old_name = horse.get_name()
horse.set_level(26)
horse.set_name(haustiere.get_pet_name())
pet.summon()
horse.set_level(old_level)
horse.set_name(old_name)
affect.add_collect(apply.ATT_BONUS_TO_MONSTER, 8, 60*60*24*365*60)
end
end
-- Baby-Löwen
when 53007.use begin
if pet.is_summon() then
pet.unsummon()
chat("Dein Haustier verabschiedet sich nun von dir!")
affect.remove_collect(apply.MAX_HP, 5000, 60*60*24*365*60)
else
local old_level = horse.get_level()
local old_name = horse.get_name()
horse.set_level(27)
horse.set_name(haustiere.get_pet_name())
pet.summon()
horse.set_level(old_level)
horse.set_name(old_name)
affect.add_collect(apply.MAX_HP, 5000, 60*60*24*365*60)
end
end
-- Baby-Keiler
when 53008.use begin
if pet.is_summon() then
pet.unsummon()
chat("Dein Haustier verabschiedet sich nun von dir!")
affect.remove_collect(71, 8, 60*60*24*365*60)
else
local old_level = horse.get_level()
local old_name = horse.get_name()
horse.set_level(28)
horse.set_name(haustiere.get_pet_name())
pet.summon()
horse.set_level(old_level)
horse.set_name(old_name)
affect.add_collect(71, 8, 60*60*24*365*60)
end
end
-- Baby-Tiger
when 53009.use begin
if pet.is_summon() then
pet.unsummon()
chat("Dein Haustier verabschiedet sich nun von dir!")
affect.remove_collect(apply.ATT_GRADE_BONUS, 100, 60*60*8)
affect.remove_collect(apply.DEF_GRADE_BONUS, 100, 60*60*8)
affect.remove_collect(apply.MAX_HP, 1000, 60*60*8)
else
local old_level = horse.get_level()
local old_name = horse.get_name()
horse.set_level(29)
horse.set_name(haustiere.get_pet_name())
pet.summon()
horse.set_level(old_level)
horse.set_name(old_name)
affect.add_collect(apply.ATT_GRADE_BONUS, 100, 60*60*8)
affect.add_collect(apply.DEF_GRADE_BONUS, 100, 60*60*8)
affect.add_collect(apply.MAX_HP, 1000, 60*60*8)
end
end
-- Baby-Eisbär
when 53014.use begin
if pet.is_summon() then
pet.unsummon()
chat("Dein Haustier verabschiedet sich nun von dir!")
affect.remove_collect(72, 6, 60*60*24*365*60)
affect.remove_collect(71, 6, 60*60*24*365*60)
else
local old_level = horse.get_level()
local old_name = horse.get_name()
horse.set_level(30)
horse.set_name(haustiere.get_pet_name())
pet.summon()
horse.set_level(old_level)
horse.set_name(old_name)
affect.add_collect(72, 6, 60*60*24*365*60)
affect.add_collect(71, 6, 60*60*24*365*60)
end
end
-- Namenskette - Namensändung des Haustiers
when 71110.use begin
say_title("Namenskette :")
say("")
say("Hier kannst du deinem Haustier einen neuen")
say("Namen geben. Damit kannst du dein Haustier")
say("über alle anderen hervorheben.")
say("")
akna = haustiere.get_pet_name()
if string.len(akna) == 0 then
say_reward("Dein Haustier besitzt bis jetzt keinen Namen.")
else
say_reward("Der aktuelle Name deines Haustieres lautet: "..akna)
end
say("")
say("Möchtest du fortfahren?")
say("")
local s=select("Umbenennen", "Abbrechen")
if s==2 then
return
end
say_title("Namenskette :")
say("")
say("Bitte gib hier den neuen Namen deines")
say("Haustieres ein.")
local x = input()
if string.len(x) < 2 then
say_title("Namenskette :")
say("Der eingegeben Name ist zu kurz.")
say("")
say_reward("Der neue Name muss aus")
say_reward("mind. 2 Zeichen bestehen.")
say("")
return
elseif string.len(x) > 12 then
say_title("Namenskette :")
say("Der eingegeben Name ist zu lang.")
say("")
say_reward("Der neue Name darf max.")
say_reward("aus 12 Zeichen bestehen.")
say("")
return
end
haustiere.set_pet_name(x)
chat("Haustier erfolgreich umbenannt")
pc.remove_item(71110, 1)
end
end
end