Open Zbig281 opened 7 months ago
It would be better to add this as separate modification or add multiple language support to the original.
It would be better to add this as separate modification or add multiple language support to the original.
@Zbig281 would you like to attempt making it multi language supported or do publish an alternative mod using polish language?
/**
*/
if (!isObject(LiFxKillFeed)) { new ScriptObject(LiFxKillFeed) { }; }
package LiFxKillFeed { function LiFxKillFeed::setup() { //$LiFx::hooks::onDeathCallbacks = JettisonArray("onDeathCallbacks"); //$LiFx::hooks::onKillCallbacks = JettisonArray("onKillCallbacks"); //$LiFx::hooks:: = JettisonArray("onSuicideCallbacks"); //LiFx::registerCallback($LiFx::hooks::onKillCallbacks, onKnockout, LiFxKillFeed); LiFx::registerCallback($LiFx::hooks::onKillCallbacks, onKill, LiFxKillFeed); LiFx::registerCallback($LiFx::hooks::onSuicideCallbacks, onSuicide, LiFxKillFeed); } function LiFxKillFeed::version() { return "1.0.0"; } function LiFxKillFeed::addCustomText(%this, %resultSet) { if(%resultSet.ok() && %resultSet.nextRecord()) { %RootContainerID = %resultSet.getFieldValue("RootContainerID"); %Name = %resultSet.getFieldValue("Name") SPC %resultSet.getFieldValue("LastName"); dbi.Select(LiFxKillFeed, "addFeature","INSERT INTO
custom_texts
(Custom_text
) VALUES ('" @ %Name @ "') RETURNING ID, " @ %RootContainerID @ " as RootContainerID"); } dbi.remove(%resultSet); %resultSet.delete(); } function LiFxKillFeed::addFeature(%this, %resultSet) { if(%resultSet.ok() && %resultSet.nextRecord()) { %ReturnID = %resultSet.getFieldValue("ID"); %RootContainerID = %resultSet.getFieldValue("RootContainerID"); dbi.Select(LiFxKillFeed, "addFeatureToItem","INSERT INTOfeatures
(CustomtextID
) VALUES (" @ %ReturnID @ ") RETURNING ID, " @ %RootContainerID @ " as RootContainerID"); } dbi.remove(%resultSet); %resultSet.delete(); }function LiFxKillFeed::addFeatureToItem(%this, %resultSet) { if(%resultSet.ok() && %resultSet.nextRecord()) { %ReturnID = %resultSet.getFieldValue("ID"); %RootContainerID = %resultSet.getFieldValue("RootContainerID"); dbi.Update("UPDATE
items
SET FeatureID = " @ %ReturnID @ " WHERE ID = (SELECT ID FROMitems
WHERE ObjectTypeID = 1409 and ContainerID = " @ %RootContainerID @ " ORDER BY ID desc LIMIT 1)"); } dbi.remove(%resultSet); %resultSet.delete(); } function LiFxKillFeed::MessageAllWithCustomText(%this, %resultSet) { if(%resultSet.ok() && %resultSet.nextRecord()) { LiFxUtility::messageAll(2480, %resultSet.getFieldValue("Message")); } dbi.remove(%resultSet); %resultSet.delete(); }function LiFxKillFeed::onKill(%this, %CharID, %KillerID, %isKnockout, %Tombstone) { if(!%isKnockout) { LiFx::debugEcho(%this SPC %CharID SPC %isKnockout SPC %Tombstone); if(%KillerID $= "4294967294") { dbi.Select(LiFxKillFeed, "MessageAllWithCustomText", "SELECT CONCAT(CONCAT((SELECT CONCAT(Name, ' ',LastName) FROM
character
where ID = " @ %CharID @ "), ' został(a) zabity(a) przez NPC, NPC już zabiły łącznie '),' ' ,(SELECT COUNT() FROM chars_deathlog WHERE KillerID != CharID and IsKnockout = 0 and KillerID = " @ %KillerID @ "), ' graczy na dzikim terenie') as Message"); } else { dbi.Select(LiFxKillFeed, "MessageAllWithCustomText", "SELECT CONCAT(CONCAT((SELECT CONCAT(Name, ' ',LastName) FROMcharacter
where ID = " @ %CharID @ "), ' został(a) poćwiartowany(a) przez '), (SELECT CONCAT(Name, ' ',LastName) fromcharacter
where ID = " @ %KillerID @ "),' popełnił(a) już ' ,(SELECT COUNT() FROM chars_deathlog WHERE KillerID != CharID and IsKnockout = 0 and KillerID = " @ %KillerID @ "), ' morderstw łącznie') as Message");} } }
// function LiFxKillFeed::onKnockout(%this, %CharID, %KillerID, %LargeBag) { // if(%isKnockout) { // LiFx::debugEcho(%this SPC %CharID SPC %KillerID SPC %Tombstone); // dbi.Select(LiFxKillFeed, "MessageAllWithCustomText", "SELECT CONCAT(CONCAT((SELECT CONCAT(Name, ' ',LastName) FROM
character
where ID = " @ %CharID @ "), ' został(a) znokautowany(a) przez '), (SELECT CONCAT(Name, ' ',LastName) fromcharacter
where ID = " @ %KillerID @ "),' ' ,(SELECT COUNT(*) FROM chars_knockoutlog WHERE KnockoutID != CharID and CharID = " @ %CharID @ "), ' Łączna ilość znokautowań') as Message"); // } // }function LiFxKillFeed::onSuicide(%this, %CharID, %isKnockout, %Tombstone) {
// SELECT CONCAT((SELECT CONCAT(Name, ' ',LastName) FROM
character
where ID = " @ %CharID @ "), ' Poddał(a) się życiowej rezygnacji i popełnił(a) samobójstwo. ', (SELECT COUNT() FROM chars_deathlog WHERE KillerID = CharID and CharID = " @ %CharID @ "), ' samobójstw') as Message dbi.Select(LiFxKillFeed, "MessageAllWithCustomText", "SELECT CONCAT((SELECT CONCAT(Name, ' ',LastName) FROMcharacter
where ID = " @ %CharID @ "), ' Zrezygnował(a) z życia i popełnił(a) samobójstwo. ', (SELECT COUNT() FROM chars_deathlog WHERE KillerID = CharID and CharID = " @ %CharID @ "), ' Łączna ilość samobójstw') as Message");} }; activatePackage(LiFxKillFeed);