problema quest

Totalitatea subiectelor care nu respectă regulamentul impus in sectiunea "Probleme şi Întrebări" vor fi stocate aici.
Închis
Avatar utilizator
jaqques
Nivel 1

Nivel 1
Mesaje: 98
Membru din: 03 Dec 2015, 20:49
Regat: Chunjo
Aprecieri: 6  
Mulţumiri: 1  
Medalii

Cand dau ./qc guild_building_melt.quest imi da core dumped. Care este problema? Imagine quest0ul (guild_building_melt.quest)
quest guild_building_melt begin
state start begin
function GetOreRefineCost(cost)
if pc.empire != npc.empire then
return 3 * cost
end
if pc.get_guild() == npc.get_guild() then
return cost * 0.9
end
return cost
end

function GetOreRefineGoodPct()
return 60
end

function GetOreRefineBadPct()
return 30
end

function GetMyRefineNum(race)
return race - 20060 + 50601
end

function IsRefinableRawOre(vnum)
return vnum >= 50601 and vnum <= 50613
end

function DoRefineDiamond(pct)
local from_postfix
local from_name = item_name(item.vnum)
local to_vnum = item.vnum + 20
local to_name = item_name(to_vnum)
local to_postfix

if under_han(from_name) then
from_postfix = "something"
else
from_postfix = "something"
end

if under_han(to_name) then
to_postfix = "after"
else
to_postfix = "with"
end
say_title("Alchemist:")
say("")
say("You must collect 100 " .. from_name .." so I can")
say("produce "..to_name .. ".")
say("")
if item.count >= 100 then
say("The success rate is "..pct.."% and you need "..guild_building_melt.GetOreRefineCost(10000).." Yang.")
say("")
say("Do you want to try it?")
say("")
local s = select("Yes", "No")
if s == 1 then
if pc.get_gold() < guild_building_melt.GetOreRefineCost(10000) then
say_title("Alchemist:")
say("")
say("Sorry but you need more Yang. It's not free.")
say("")
return
end

if pc.diamond_refine(10000, pct) then
say_title("Alchemist:")
say("")
say("Congratulations - the refining was successful!")
say("")
say("You now have:")
say("")
say_item(to_name, to_vnum, "")
say("")
else
say_title("Alchemist:")
say("")
say("The refining was not successful. Sorry.")
say("")
end
end
else
say("First collect 100 ores.")
end
end
function DoRefine(pct)
local from_postfix
local from_name = item_name(item.vnum)
local to_vnum = item.vnum + 20
local to_name = item_name(to_vnum)
local to_postfix

if under_han(from_name) then
from_postfix = "Object"
else
from_postfix = "Object"
end

if under_han(to_name) then
to_postfix = "After"
else
to_postfix = "With"
end
say_title("Alchemist:")
say("")
say("You must collect 100 " .. from_name .." and a " )
say("Spirit Stone +0, +1 or +2 to produce "..to_name..".")
say("")
if item.count >= 100 then
say("There is a "..pct.."% chance to succeed and you")
say("need "..guild_building_melt.GetOreRefineCost(3000).." Yang.")
say("")
say("Do you want to try it?")
say("")
local s = select("Yes", "No")
if s == 1 then
if pc.get_gold() < guild_building_melt.GetOreRefineCost(3000) then
say_title("Alchemist:")
say("")
say("Sorry, you need more Yang for this.")
say("")
return
end

local selected_item_cell = select_item()
if selected_item_cell == 0 then
say_title("Alchemist:")
say("")
say("Find the required materials and then talk to me.")
say("")
return
end
local old_item = item.get_id()

if not item.select_cell(selected_item_cell) then
say_title("Alchemist:")
say("")
say("That is not the item that is needed.")
say("")
return
end

-- check whether the material is
if item.vnum < 28000 or item.vnum >= 28300 then
say_title("Alchemist:")
say("")
say("You have chosen the wrong item.")
say("")
return
end

item.select(old_item)

if pc.ore_refine(3000, pct, selected_item_cell) then
----"123456789012345678901234567890123456789012345678901234567890"|
say_title("Alchemist:")
say("")
say("Congratulations - the refining was successful!")
say("")
say("You now have:")
say("")
say_item(to_name, to_vnum, "")
say("")
else
say_title("Alchemist:")
say("")
say("The refining was not successful. Sorry!")
say("")
end
end
else
say_title("Alchemist:")
say("")
say("Collect the required materials first.")
say("")
end
end

when
20060.take or
20061.take or
20062.take or
20063.take or
20064.take or
20065.take or
20066.take or
20067.take or
20068.take or
20069.take or
20070.take or
20071.take or
20072.take
with guild_building_melt.GetMyRefineNum(npc.race) == item.vnum
begin
if item.vnum == 50601 then
guild_building_melt.DoRefineDiamond(guild_building_melt.GetOreRefineGoodPct())
else
guild_building_melt.DoRefine(guild_building_melt.GetOreRefineGoodPct())
end
end

when
20060.take or
20061.take or
20062.take or
20063.take or
20064.take or
20065.take or
20066.take or
20067.take or
20068.take or
20069.take or
20070.take or
20071.take or
20072.take
with guild_building_melt.IsRefinableRawOre(item.vnum) and
guild_building_melt.GetMyRefineNum(npc.race) != item.vnum
begin
if item.vnum == 50601 then
guild_building_melt.DoRefineDiamond(guild_building_melt.GetOreRefineBadPct())
else
guild_building_melt.DoRefine(guild_building_melt.GetOreRefineBadPct())
end
end

when
20060.click or
20061.click or
20062.click or
20063.click or
20064.click or
20065.click or
20066.click or
20067.click or
20068.click or
20069.click or
20070.click or
20071.click or
20072.click begin
if npc.get_guild() == pc.get_guild() and pc.isguildmaster() then
say_title("Alchemist:")
say("")
say("If you own 3.000.000 Yang, you can replace your current")
say("alchemist with a different one.")
say("")
if pc.get_gold() < 3000000 then
say("")
say("Bring me 3.000.000 Yang.")
say("")
else

say("Which Alchemist do you want to create?")

local sel = 0
local timetable1 = {"Diamonds", "Fossils", "Copper", "Silver", "Gold", "Jade", "Next", "Close"}
local valuetable1 = {14043, 14045, 14046, 14047, 14048, 14049, 0, -1}
local timetable2 = {"Ebony", "Pearls", "White Gold", "Crystal", "Amethyst", "Heaven's Tear", "Next", "Close"}
local valuetable2 = {14050, 10451, 14052, 14053, 14054, 14055, 0, -1}
repeat
local s = select_table(timetable1)
sel = valuetable1
if sel == 0 then
local s = select_table(timetable2)
sel = valuetable2
end
until sel != 0
if sel != -1 then
npc_num = sel + 20060 - 14043
if npc_num == npc.get_race() then
say("It won't work with this item.")
else
pc.changegold(-3000000)
building.reconstruct(sel)
end
else
say("Close")
end
end
else
say_title("Alchemist:")
say("")
----"123456789012345678901234567890123456789012345678901234567890"|
say("Hello, I am the guild alchemist. If you bring 100 raw ores")
say("and a Spirit Stone +0, +1 or +2, I can try to refine them")
say("into a Gem.")
say("")
say("Refined gems can boost the properties of your accessories")
say("when inserted into sockets.")
say("")
say("To create a socket in an accessory, you will first need a")
say("refined Diamond.")
say("")
say("Come back anytime!")
say("")
end
end
end
end
Avatar utilizator
Robert
Traficant de ouă

Traficant de ouă
Mesaje: 1376
Membru din: 19 Feb 2015, 10:29
Server: Scorpions2
Regat: Chunjo
Aprecieri: 125  
Mulţumiri: 476  
Discord: Copiază ID
Medalii

Adauga functia under_han un quest functions.
Avatar utilizator
Filipino
Metin Master

Metin Master
Mesaje: 2789
Membru din: 03 Sep 2014, 21:02
Server: ▬▬▬▬▬▬
Aprecieri: 39  
Mulţumiri: 785  
Discord: Copiază ID
Medalii

Nu ai functia respectivă "under_han",pusă in fisierul quest_functions.
De unde ai luat quest-ul?

[ Mesaj scris via Android ] Imagine
Imagine
Afișează semnătura
Închis
Răspunsuri
6
Vizualizări
400
Răspunsuri
4
Vizualizări
221
Răspunsuri
4
Vizualizări
410
Răspunsuri
3
Vizualizări
735

Înapoi la “Arhivă Probleme şi Întrebări”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Semrush [Bot] și 86 vizitatori