Commit 8833e29a76cdd28a125bbf66f967c45a3cdc7d57
1 parent
ce5897ed
Limmir will always make sure to provide a gem on his own when making an amulet
git-svn-id: http://svn.net-core.org/repos/t-engine4@3313 51575b47-30f0-44d4-a5cc-537603b46e54
Showing
1 changed file
with
3 additions
and
1 deletions
... | ... | @@ -46,7 +46,9 @@ local artifact_imbue_amulet = function(npc, player) |
46 | 46 | |
47 | 47 | require("engine.ui.Dialog"):yesnoPopup("Imbue cost", "You need to use "..price.." gold for the plating, do you accept?", function(ret) if ret then |
48 | 48 | player:incMoney(-price) |
49 | - local gem3 = game.zone:makeEntity(game.level, "object", {type="gem"}, nil, true) | |
49 | + local gem3, tries = nil, 10 | |
50 | + while gem3 == nil and tries > 0 do gem3 = game.zone:makeEntity(game.level, "object", {type="gem"}, nil, true) tries = tries - 1 end | |
51 | + if not gem3 then gem3 = rng.percent(50) and gem1 or gem2 end | |
50 | 52 | print("Imbue third gem", gem3.name) |
51 | 53 | |
52 | 54 | if gem1_item > gem2_item then | ... | ... |
-
Please register or login to post a comment