[Pets rufen gescheitert]

09/21/2013 17:03 rakuz123456#1
[Pets rufen gescheitert]
Wenn ich auf mein Pets Siegel drücke passiert nichts.
PHP Code:
SYSERRSep 21 14:30:03 :: RunStateLUA_ERROR: [string "haustiere"]:1attempt to index global `pet' (a nil value)
SYSERR: Sep 21 14:30:03 :: WriteRunningStateToSyserr: LUA_ERROR: quest haustiere.start click 
09/21/2013 17:35 ProfessorEnte#2
Dann solltest du dazu mal die Quest posten. :)
09/21/2013 17:40 rakuz123456#3
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.CRITICAL_PCT_GRADE_BONUS1560*60*8)   
                
affect.remove_collect(apply.MAX_HP200060*60*8)
            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.CRITICAL_PCT_GRADE_BONUS1560*60*8)
                
affect.add_collect(apply.MAX_HP200060*60*8)
            
end
        end
        
-- Rentierjunges
        when 53002.
use begin
            
if pet.is_summon() then
                pet
.unsummon()
                
chat("Dein Haustier verabschiedet sich nun von dir!")
                
affect.remove_collect(apply.CRITICAL_PCT_GRADE_BONUS1560*60*8)   
                
affect.remove_collect(apply.MAX_HP100060*60*8)
            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(apply.CRITICAL_PCT_GRADE_BONUS1560*60*8)
                
affect.add_collect(apply.MAX_HP100060*60*8)
            
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.ATT_GRADE_BONUS10060*60*8)
                
affect.remove_collect(apply.DEF_GRADE_BONUS10060*60*8)   
                
affect.remove_collect(apply.MAX_HP100060*60*8)
            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.ATT_GRADE_BONUS10060*60*8)
                
affect.add_collect(apply.DEF_GRADE_BONUS10060*60*8)
                
affect.add_collect(apply.MAX_HP100060*60*8)
            
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.CRITICAL_PCT_GRADE_BONUS2560*60*8)   
                
affect.remove_collect(apply.MAX_HP500060*60*8)
            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.CRITICAL_PCT_GRADE_BONUS2560*60*8)
                
affect.add_collect(apply.MAX_HP500060*60*8)
            
end
        end
        
-- Baby-Wolfs
        when 53006.
use begin
            
if pet.is_summon() then
                pet
.unsummon()
                
chat("Dein Haustier verabschiedet sich nun von dir!")
                
affect.remove_collect(apply.ATT_GRADE_BONUS10060*60*8)
                
affect.remove_collect(apply.DEF_GRADE_BONUS10060*60*8)   
                
affect.remove_collect(apply.MAX_HP100060*60*8)
            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_GRADE_BONUS10060*60*8)
                
affect.add_collect(apply.DEF_GRADE_BONUS10060*60*8)
                
affect.add_collect(apply.MAX_HP100060*60*8)
            
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.ATT_GRADE_BONUS10060*60*8)
                
affect.remove_collect(apply.DEF_GRADE_BONUS10060*60*8)   
                
affect.remove_collect(apply.MAX_HP100060*60*8)
            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.ATT_GRADE_BONUS10060*60*8)
                
affect.add_collect(apply.DEF_GRADE_BONUS10060*60*8)
                
affect.add_collect(apply.MAX_HP100060*60*8)
            
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(apply.ATT_GRADE_BONUS10060*60*8)
                
affect.remove_collect(apply.DEF_GRADE_BONUS10060*60*8)   
                
affect.remove_collect(apply.MAX_HP100060*60*8)
            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(apply.ATT_GRADE_BONUS10060*60*8)
                
affect.add_collect(apply.DEF_GRADE_BONUS10060*60*8)
                
affect.add_collect(apply.MAX_HP100060*60*8)
            
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_BONUS10060*60*8)
                
affect.remove_collect(apply.DEF_GRADE_BONUS10060*60*8)   
                
affect.remove_collect(apply.MAX_HP100060*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_BONUS10060*60*8)
                
affect.add_collect(apply.DEF_GRADE_BONUS10060*60*8)
                
affect.add_collect(apply.MAX_HP100060*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(apply.ATT_GRADE_BONUS10060*60*8)
                
affect.remove_collect(apply.DEF_GRADE_BONUS10060*60*8)   
                
affect.remove_collect(apply.MAX_HP100060*60*8)
            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(apply.ATT_GRADE_BONUS10060*60*8)
                
affect.add_collect(apply.DEF_GRADE_BONUS10060*60*8)
                
affect.add_collect(apply.MAX_HP100060*60*8)
            
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(711101)
        
end
    end
end