Hallo,
ist es möglich, folgende Quest so umzuschreiben, dass Pets den Namen des Pferdes haben?
Pferdezucker funktioniert und ändert den Namen.
Petname bleibt aber bei BlaBlaBlas Phönix, zB.
Würde für eine Lösung auch bezahlen.
Quest:
LUA
- quest pet_system begin
- state start begin
- function get_pet_info(itemVnum)
- pet_info_map = {
- -- [ITEM VNUM] MOB_VNUM, DEFAULT NAME, buff_idx, spawn_effect_idx
- [53001] = { 34001, "s Phönix", 2},
- [53002] = { 34002, "s Bambi", 3},
- [53003] = { 34003, "s Eisphönix", 8},
- [53004] = { 34004, "s Rentier", 8},
- [53005] = { 34004, "s Azrael", 1},
- [53006] = { 34009, "s Azrael (Gold)/m", 1},
- [53007] = { 34007, "s Porkie", 7},
- [53008] = { 34008, "s Rufus", 6},
- [53009] = { 34012, "s Bao Bao", 4},
- [53010] = { 34010, "s Khan", 5},
- [53011] = { 34011, "s Knuud", 0},
- [53012] = { 34012, "s Bao Bao", 0},
- [53013] = { 34013, "s Boney", 0},
- [53014] = { 34014, "s Henkerchen", 0},
- [53015] = { 34015, "s Henkerchen", 0},
- [53016] = { 34016, "s Sensenmann", 0},
- [53017] = { 34017, "s Phönix", 0}
- }
- itemVnum = tonumber(itemVnum)
- return pet_info_map[itemVnum]
- end
- function get_spawn_effect_file(idx)
- effect_table = {
- [0] = nil,
- [1] = "d:\\\\ymir work\\\\effect\\\\etc\\\\appear_die\\\\npc2_appear.mse",
- [2] = "d:\\\\ymir work\\\\effect\\\\etc\\\\appear_die\\\\redphoenix.mse",
- [3] = "d:\\\\ymir work\\\\effect\\\\etc\\\\appear_die\\\\icephoenix.mse",
- [4] = "d:\\\\ymir work\\\\effect\\\\etc\\\\appear_die\\\\leonidas.mse",
- [5] = "d:\\\\ymir work\\\\effect\\\\etc\\\\appear_die\\\\khan.mse",
- [6] = "d:\\\\ymir work\\\\effect\\\\etc\\\\appear_die\\\\rufus.mse",
- [7] = "d:\\\\ymir work\\\\effect\\\\etc\\\\appear_die\\\\porkie.mse",
- [8] = "d:\\\\ymir work\\\\effect\\\\etc\\\\appear_die\\\\rentier.mse",
- }
- return effect_table [idx]
- end
- when login with pc.getqf("pet_vnum") != 0 begin
- item.select(pc.getqf("pet_item_id"))
- pet_name = pet_system.get_pet_info(item.get_vnum())[2]
- pet.summon(pc.getqf("pet_vnum"), pet_name, false)
- end
- when 53001.use or
- 53002.use or
- 53003.use or
- 53004.use or
- 53005.use or
- 53006.use or
- 53007.use or
- 53008.use or
- 53009.use or
- 53010.use or
- 53011.use or
- 53012.use or
- 53013.use or
- 53014.use or
- 53015.use or
- 53016.use or
- 53017.use or
- 53018.use or
- 53019.use begin
- local pet_info = pet_system.get_pet_info(item.vnum)
- pc.setqf("pet_item_id", item.get_id())
- if null != pet_info then
- local mobVnum = pet_info[1]
- local petName = pet_info[2]
- local spawn_effect_file_name = pet_system.get_spawn_effect_file(pet_info[3])
- if true == pet.is_summon(mobVnum) then
- if spawn_effect_file_name != nil then
- pet.spawn_effect (mobVnum, spawn_effect_file_name)
- end
- pet.unsummon(mobVnum)
- pc.setqf("pet_vnum", 0)
- else
- if pet.count_summoned() < 1 then
- pet.summon(mobVnum, petName, false)
- pc.setqf("pet_vnum", mobVnum)
- else
- syschat("Du kannst kein weiteres Haustier rufen.")
- end
- if spawn_effect_file_name != nil then
- pet.spawn_effect (mobVnum, spawn_effect_file_name)
- end
- end -- if pet.is_summon
- end -- if null != pet_info
- end -- when
- end -- state
- end -- quest