|
267 | 267 |
|
268 | 268 | function M.UseItem(user, sourceItem) |
269 | 269 |
|
| 270 | + if sourceItem.id == Item.candles then |
| 271 | + return |
| 272 | + end |
| 273 | + |
270 | 274 | if not passesCheckForStackSizeAndPosition(user, sourceItem) then |
271 | 275 | return |
272 | 276 | end |
@@ -351,28 +355,55 @@ end |
351 | 355 |
|
352 | 356 | function M.LookAtItem(user, sourceItem) |
353 | 357 |
|
| 358 | + local rareTexts = { |
| 359 | + {value = 2, text = {english = "So uncommonly pristine, it is sure to burn longer than normal.", german = "So ungewöhnlich makellos, dass es sicher länger als gewöhnlich brennt."}}, |
| 360 | + {value = 3, text = {english = "Of such rarely seen pristinity, it is sure to burn longer than normal.", german = "Von einer derart selten gesehenen Makellosigkeit, dass es sicher länger als gewöhnlich brennt."}}, |
| 361 | + {value = 4, text = {english = "So uniquely pristine, it is sure to burn longer than normal, as if blessed by Brágon himself.", german = "So einzigartig makellos, dass es sicher länger als gewöhnlich brennt, als wäre es von Brágon selbst gesegnet."}} |
| 362 | + } |
| 363 | + |
| 364 | + |
| 365 | + local rareness, craftedRare = tonumber(sourceItem:getData("rareness")), sourceItem:getData("craftedRare") |
| 366 | + |
| 367 | + local preText = {english = "", german = ""} |
| 368 | + |
| 369 | + if craftedRare == "true" and rareness then |
| 370 | + for _, rareText in pairs(rareTexts) do |
| 371 | + if rareText.value == rareness then |
| 372 | + preText.english = rareText.text.english |
| 373 | + preText.german = rareText.text.german |
| 374 | + if not sourceItem.id == Item.candles and not sourceItem.id == Item.lampOil then |
| 375 | + preText.english = preText.english.."\n\n" |
| 376 | + preText.german = preText.german.."\n\n" |
| 377 | + end |
| 378 | + end |
| 379 | + end |
| 380 | + end |
| 381 | + |
| 382 | + |
354 | 383 | if(LightsOn[sourceItem.id]) then |
355 | 384 | local TimeLeftI = sourceItem.wear |
356 | 385 | if(TimeLeftI == 255) then |
357 | | - lookat.SetSpecialDescription(sourceItem, "Sie wird nie ausbrennen.", "It will never burn down.") |
| 386 | + lookat.SetSpecialDescription(sourceItem, preText.german.."Sie wird nie ausbrennen.", preText.english.."It will never burn down.") |
358 | 387 | elseif (TimeLeftI == 0) then |
359 | | - lookat.SetSpecialDescription(sourceItem, "Sie wird sofort ausbrennen.", "It will burn down immediately.") |
| 388 | + lookat.SetSpecialDescription(sourceItem, preText.german.."Sie wird sofort ausbrennen.", preText.english.."It will burn down immediately.") |
360 | 389 | elseif (TimeLeftI == 1) then |
361 | | - lookat.SetSpecialDescription(sourceItem, "Sie wird demnächst ausbrennen.", "It will burn down anytime soon.") |
| 390 | + lookat.SetSpecialDescription(sourceItem, preText.german.."Sie wird demnächst ausbrennen.", preText.english.."It will burn down anytime soon.") |
362 | 391 | elseif (TimeLeftI == 2) then |
363 | | - lookat.SetSpecialDescription(sourceItem, "Sie wird bald ausbrennen.", "It will burn down soon.") |
| 392 | + lookat.SetSpecialDescription(sourceItem, preText.german.."Sie wird bald ausbrennen.", preText.english.."It will burn down soon.") |
364 | 393 | elseif (TimeLeftI <= 4) then |
365 | | - lookat.SetSpecialDescription(sourceItem, "Sie wird nach einer Weile ausbrennen.", "It will burn down in a while.") |
| 394 | + lookat.SetSpecialDescription(sourceItem, preText.german.."Sie wird nach einer Weile ausbrennen.", preText.english.."It will burn down in a while.") |
366 | 395 | elseif (TimeLeftI <= DEFAULT_WEAR) then |
367 | | - lookat.SetSpecialDescription(sourceItem, "Sie wird nicht allzu bald ausbrennen.", "It will not burn down anytime soon.") |
| 396 | + lookat.SetSpecialDescription(sourceItem, preText.german.."Sie wird nicht allzu bald ausbrennen.", preText.english.."It will not burn down anytime soon.") |
368 | 397 | elseif (TimeLeftI > DEFAULT_WEAR) then |
369 | | - lookat.SetSpecialDescription(sourceItem, "Sie wird nach langer Zeit ausbrennen.", "It will burn down in a long time.") |
| 398 | + lookat.SetSpecialDescription(sourceItem, preText.german.."Sie wird nach langer Zeit ausbrennen.", preText.english.."It will burn down in a long time.") |
370 | 399 | end |
371 | 400 | elseif (LightsOff[sourceItem.id]) then |
372 | | - lookat.SetSpecialDescription(sourceItem, "Sie ist nicht angezündet.", "It is not lit, yet.") |
| 401 | + lookat.SetSpecialDescription(sourceItem, preText.german.."Sie ist nicht angezündet.", preText.english.."It is not lit, yet.") |
| 402 | + else |
| 403 | + lookat.SetSpecialDescription(sourceItem, preText.german, preText.english) |
373 | 404 | end |
374 | 405 |
|
375 | | - return lookat.GenerateLookAt(user, sourceItem, lookat.NONE) |
| 406 | + return lookat.GenerateLookAt(user, sourceItem, lookat.NONE, nil, nil, nil, true) |
376 | 407 | end |
377 | 408 |
|
378 | 409 | return M |
0 commit comments