Thanks for the answer!
state ending begin -- the ending of a random quest
when 9003.chat."You are about to level up?" begin
say("Here is your reward.")
wait()
pc.give_exp2(150)
set_state(__complete__)
end
end
--Lets say I'm level 1 with pc.get_exp() == 150. This means, with this exp reward, I will reach level 2.
quest lv2quest begin -- This is the beginning of an another quest.
state newquest begin
state start begin
when login or levelup with pc.get_level() >= 2 then
set_state(newquestbegin)
end
end
end
--I receive my reward, reach level 2 by the quest reward (pc.give_exp2, at the end of the first quest), but "levelup" won't trigger,
--will not load up the new quest. When doing a relog, the "login" part triggers of course, but this does not seem very professional.
--It works simply with every other way -> If I level up via gm command or by killing monsters, everything works simply., all the quests load up as they
--should
--I tried and used set_quest_state, but there are a lot of possibilities, again, not a clean work. It works - but it's not realistic to use it.
I hope this way it becomes more understandable. The pc.give_exp2, that results in a level up will not trigger the "levelup" on other quests.