So i have this script.
-- Yes you can put this here..., it will be executed on script load time...
PlayerToBeNotified = "workforme" ;
raidbosses = { "Varka's Chief Horus", 25315, "Execution Grounds Watchman Guillotine", 25888, "Baium", 29020, "Queen Ant", 29001, "Ketra's Chief Brakki", 25305, "Flame of Splendor Barakiel", 25325, "Varka's Holy Altar", 31560, "Ketra's Holy Altar", 31558, "Ketra's Hero Hekaton", 25299, "Varka's Hero Shadith", 25309, }
SpanwedList = {} ;
function CheckIfInSpawnedTable(npcid)
if (SpanwedList ~= nil) then
for x,y in pairs(SpanwedList) do
if (y == npcid) then
return true;
end;
end;
end;
return false;
end;
function alert(npc)
if (CheckIfInSpawnedTable(npc:GetId()) == false) then
ShowToClient("RBCheck", "Raidboss ".. npc:GetName() .." at " .. os.date("%X") .. "!")
SendPM(PlayerToBeNotified, " > Raidboss ".. npc:GetName() .." < has spawned at " .. os.date("%X") .. " so go kill it!")
Command("@Raidboss ".. npc:GetName() .." has spawned at " .. os.date("%X") .. " so go kill it!")
PlaySound(GetDir() .. "alarm.wav")
table.insert(SpanwedList,npc:GetId())
end;
end;
function OnNpcInfo(npc)
--Event called when we get some info about some npc/monster (he spawn)
for k, v in pairs(raidbosses) do
if (type(v) == "string") and (string.upper(npc:GetName()) == string.upper(v)) then
alert(npc)
elseif (type(v) == "number") and (npc:GetNpcId() == v) then
alert(npc)
end;
end;
end;
And i dont know where to put the alarm.wav sound.
Can anyone help please?
There are some posts about this... use search...
In the same folder as the script.
I did search
you wont belive me, but i did.
Ty
Since other thread is closed, how i stop it from sending message at Clan chat? There is no @ symbol in the whole code!
...
...
...
Code:
SpanwedList = {} ;
ChestDetectionStamp = os.time();
function CheckIfInSpawnedTable(npcid)
if (SpanwedList ~= nil) then
for x,y in pairs(SpanwedList) do
if (y == npcid) then
return true;
end;
end;
end;
return false;
end;
function alert(npc)
if (CheckIfInSpawnedTable(npc:GetId()) == false) then
ShowToClient("RBCheck", "Raidboss ".. npc:GetName() .." has spawned so go kill it!")
SendPM(PlayerToBeNotified, "Raidboss ".. npc:GetName() .." has spawned now so go kill it!")
if (wavfilename ~= "") then
PlaySound(GetDir() .. wavfilename)
end;
table.insert(SpanwedList,npc:GetId())
end;
end;
function CheckForRaidsAndChests()
local MobList = GetMonsterList();
for npc in MobList.list do
for k, v in pairs(raidbosses) do
if (type(v) == "string") and (string.upper(npc:GetName()) == string.upper("Treasure Chest")) and (ChestDetectionStamp+60 < os.time()) then --
ShowToClient("Chest Detector", "A Treasure Chest is near ".. GetMe():GetName() .." on Coordinates (" .. npc:GetLocation().X .. "," .. npc:GetLocation().Y .. "," ..npc:GetLocation().Z .. ") so go Open it!")
ChestDetectionStamp = os.time();
elseif (type(v) == "string") and (string.upper(npc:GetName()) == string.upper(v)) then
alert(npc)
elseif (type(v) == "number") and (npc:GetNpcId() == v) then
alert(npc)
end;
end;
end;
end;
function OnLTick1s()
CheckForRaidsAndChests();
end;
Ok..
I just updated to .123
The below RBcheck scipt stopped working. Tested with RBs alive.
No PM at the receiver toon.
Code:
-- Yes you can put this here..., it will be executed on script load time...
PlayerToBeNotified = "charname" ;
raidbosses = { "RB1", XXXXX, }
SpanwedList = {} ;
function CheckIfInSpawnedTable(npcid)
if (SpanwedList ~= nil) then
for x,y in pairs(SpanwedList) do
if (y == npcid) then
return true;
end;
end;
end;
return false;
end;
function alert(npc)
if (CheckIfInSpawnedTable(npc:GetId()) == false) then
ShowToClient("RBCheck", "Raidboss ".. npc:GetName() .." at " .. os.date("%X") .. "!")
SendPM(PlayerToBeNotified, " > Raidboss ".. npc:GetName() .." < has spawned at " .. os.date("%X") .. " so go kill it!")
PlaySound(GetDir() .. "alarm.wav")
table.insert(SpanwedList,npc:GetId())
end;
end;
function OnNpcInfo(npc)
--Event called when we get some info about some npc/monster (he spawn)
for k, v in pairs(raidbosses) do
if (type(v) == "string") and (string.upper(npc:GetName()) == string.upper(v)) then
alert(npc)
elseif (type(v) == "number") and (npc:GetNpcId() == v) then
alert(npc)
end;
end;
end;
Any commands changed?
Bump!!
Anyone?
Not even this other script is working...
Code:
PlayerToBeNotified = "name" ; -- Set here name of the char that you want to recieve PM when any of raids spawn (you might want to minizmie window for spy and play another char meanwhile so u can get pm on it)
raidbosses = { "RB1", xxxxx, } ; -- Set here monster names or their NpcIds that you want to be warned of when they spawn near.
wavfilename = "" ; -- set here the filename of the sound you want to play when raid spawn it must be .wav and in l2tower folder or leave it empty.
SpanwedList = {} ;
ChestDetectionStamp = os.time();
function CheckIfInSpawnedTable(npcid)
if (SpanwedList ~= nil) then
for x,y in pairs(SpanwedList) do
if (y == npcid) then
return true;
end;
end;
end;
return false;
end;
function alert(npc)
if (CheckIfInSpawnedTable(npc:GetId()) == false) then
ShowToClient("RBCheck", "Raidboss ".. npc:GetName() .." has spawned so go kill it!")
SendPM(PlayerToBeNotified, "Raidboss ".. npc:GetName() .." has spawned now so go kill it!")
if (wavfilename ~= "") then
PlaySound(GetDir() .. wavfilename)
end;
table.insert(SpanwedList,npc:GetId())
end;
end;
function CheckForRaidsAndChests()
local MobList = GetMonsterList();
for npc in MobList.list do
for k, v in pairs(raidbosses) do
if (type(v) == "string") and (string.upper(npc:GetName()) == string.upper("Treasure Chest")) and (ChestDetectionStamp+60 < os.time()) then --
ShowToClient("Chest Detector", "A Treasure Chest is near ".. GetMe():GetName() .." on Coordinates (" .. npc:GetLocation().X .. "," .. npc:GetLocation().Y .. "," ..npc:GetLocation().Z .. ") so go Open it!")
ChestDetectionStamp = os.time();
elseif (type(v) == "string") and (string.upper(npc:GetName()) == string.upper(v)) then
alert(npc)
elseif (type(v) == "number") and (npc:GetNpcId() == v) then
alert(npc)
end;
end;
end;
end;
function OnLTick1s()
CheckForRaidsAndChests();
end;
URGENT guys....
Well. the small script gives me some "ding windows" sound when NPC found. (you know the
http://www.youtube.com/watch?feature=pla...b2HSM#t=17 one)
Means it catches the "RB" but cant send PM.
This function:
Code:
function OnNpcInfo(npc)
Works like this.. if I am near the boss spawned and start the plugin, nothing will happen.
Only if i am near the boss spot and he spawns after 30 sec then it will work the code inside.
If you are sure that the code is ok,(didn`t check it) then downgrade to another l2tower version.
Yeap. I need it to come to spot from far away.
Savior!