function onSay(cid, words, param, channel)
local player = Player(cid)
local tmp = param:split(",")
if not(tmp[1]) then
return doPlayerPopupFYI(cid,"Params:\n\nTurn the cast on: '!cast on'\n\nTurn the cast off: '!cast off'\n\nSet a cast password: '!cast password,YourPassword'\n\nSet a description: '!cast,desc,YourDescription'\n\nBan a viewer: '!cast ban,ViewerName'\n\nUnban a viwer: '!cast unban,ViewerName'\n\nBan list: '!cast bans'\n\nMute a viewer: '!cast mute,ViewerName'\n\nUnmute a viewer: '!cast unmute,ViewerName'\n\nMute list: '!cast mutes'\n\nList of viewers: '!cast viewers'\n\nCast status: '!cast status'")
end
if tmp[1] == "on" then
if getPlayerCast(cid).status == false then
doPlayerSetCastState(cid, true)
doPlayerSendTextMessage(cid, 21, "You have started casting.")
else
doPlayerSetCastState(cid, false)
doPlayerSendTextMessage(cid, 21, "You have stopped casting.")
end
return false
elseif tmp[1] == "off" then
if getPlayerCast(cid).status == true then
doPlayerSetCastState(cid, false)
doPlayerSendTextMessage(cid, 21, "You have stopped casting.")
else
doPlayerSetCastState(cid, true)
doPlayerSendTextMessage(cid, 21, "You have started casting.")
end
return false
elseif isInArray({"pass", "password", "p"}, tmp[1]) then
if not(tmp[2]) then
return doPlayerSendCancel(cid, "You need to set a password")
end
if tmp[2]:len() > 10 then
return doPlayerSendCancel(cid, "The password is too long. (Max.: 10 letters)")
end
if tmp[2] == "off" then
doPlayerSetCastPassword(cid, "")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast password has been removed.")
else
doPlayerSetCastPassword(cid, tmp[2])
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast password has been changed to: "..tmp[2])
end
return false
elseif isInArray({"desc", "description", "d"}, tmp[1]) then
local d = param:gsub(tmp[1]..(tmp[2] and " " or ""), "")
if not(d) or d:len() == 0 then
return doPlayerSendCancel(cid, "You need to specify a description.")
end
if d:len() > 50 then
return doPlayerSendCancel(cid, "The description is too long. (Max.: 50 letters)")
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cast description was set to: ")
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, d)
doPlayerSetCastDescription(cid, d)
return false
elseif tmp[1] == "ban" then
if not(tmp[2]) then
return doPlayerSendCancel(cid, "Specify a spectator that you want to ban.")
end
if doPlayerAddCastBan(cid, tmp[2]) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been banned.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be banned.")
end
return false
elseif tmp[1] == "unban" then
if not(tmp[2]) then
return doPlayerSendCancel(cid, "Specify the person you want to unban.")
end
if doPlayerRemoveCastBan(cid, tmp[2]) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been unbanned.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be unbanned.")
end
return false
elseif param == "bans" then
local t = getCastBans(cid)
local text = "Cast Bans:\n\n"
if t ~= nil then
for k, v in pairs(t) do
text = text .. "*" .. v.name .. "\n"
end
end
if text == "Cast Bans:\n\n" then
text = text .. "No bans."
end
doShowTextDialog(cid, 2597, text)
return false
elseif tmp[1] == "mute" then
if not(tmp[2]) then
return doPlayerSendCancel(cid, "Specify a spectator that you want to mute.")
end
if doPlayerAddCastMute(cid, tmp[2]) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been muted.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be muted.")
end
return false
elseif tmp[1] == "unmute" then
if not(tmp[2]) then
return doPlayerSendCancel(cid, "Specify the person you want to unmute.")
end
if doPlayerRemoveCastMute(cid, tmp[2]) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' has been unmuted.")
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Spectator '" .. tmp[2] .. "' could not be unmuted.")
end
return false
elseif param == "mutes" then
local t = getCastMutes(cid)
local text = "Cast Mutes:\n\n"
if t ~= nil then
for k, v in pairs(t) do
text = text .. "*" .. v.name .. "\n"
end
end
if text == "Cast Bans:\n\n" then
text = text .. "No mutes."
end
doShowTextDialog(cid, 2597, text)
return false
elseif param == "viewers" then
local t = getCastViewers(cid)
local text, count = "Cast Viewers:\n#Viewers: |COUNT|\n\n", 0
if t ~= nil then
for _,v in pairs(t) do
count = count + 1
text = text .. "*" .. v.name .."\n"
end
end
if text == "Cast Viewers:\n#Viewers: |COUNT|\n\n" then text = "Cast Viewers:\n\nNo viewers." end
text = text:gsub("|COUNT|", count)
doShowTextDialog(cid, 2597, text)
return false
elseif param == "status" then
local t, c = getCastViewers(cid), getPlayerCast(cid)
local count = 0
for _,v in pairs(t) do count = count + 1 end
doShowTextDialog(cid, 2597, "Cast Status:\n\n*Viewers:\n " .. count .. "\n*Description:\n "..(c.description == "" and "Not set" or c.description).."\n*Password:\n " .. (c.password == "" and "Not set" or "Set - '"..c.password.."'"))
return false
end
return true
end
<?PHP
$order = $_REQUEST['order'];
if($order == 'name') {
$orderby = 'name';
}
if($order == 'level') {
$orderby = 'level';
}
if($order == 'vocation') {
$orderby = 'vocation';
}
if(empty($orderby)) {
$orderby = 'name';
}
if(count($config['site']['worlds']) > 1)
{
$worlds .= '<i>Select world:</i> ';
foreach($config['site']['worlds'] as $idd => $world_n)
{
if($idd == (int) $_GET['world'])
{
$world_id = $idd;
$world_name = $world_n;
}
}
}
if($idd == (int) $_GET['world'])
{
$world_id = $idd;
$world_name = $world_n;
}
if(!isset($world_id))
{
$world_id = 0;
$world_name = $config['server']['serverName'];
}
if(count($config['site']['worlds']) > 1)
{
$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD>
<FORM ACTION="?subtopic=whoisonline" METHOD=get><INPUT TYPE=hidden NAME=subtopic VALUE=whoisonline><INPUT TYPE=hidden NAME=list VALUE=experience>
<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>World Selection</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['lightborder'].'">
<TABLE BORDER=0 CELLPADDING=1><TR><TD>World: </TD><TD><SELECT SIZE="1" NAME="world"><OPTION VALUE="" SELECTED>(choose world)</OPTION>';
foreach($config['site']['worlds'] as $id => $world_n)
{
$main_content .= '<OPTION VALUE="'.$id.'">'.$world_n.'</OPTION>';
}
$main_content .= '</SELECT> </TD><TD><INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></TABLE></TABLE></FORM></TABLE><br>';
}
$players_online_data = $SQL->query('SELECT * FROM players WHERE online > 0 AND cast = 1 AND world_id = '.$world_id.' ORDER BY '.$orderby);
$number_of_players_online = 0;
foreach($players_online_data as $player)
{
$number_of_players_online++;
if($config['site']['show_flag'])
{
$account = $SQL->query('SELECT * FROM accounts WHERE id = '.$player['account_id'].'')->fetch();
$flag = '<image src="images/flags/'.$account['flag'].'.png"/> ';
}
if(is_int($number_of_players_online / 2))
{
$bgcolor = $config['site']['darkborder'];
}
else
{
$bgcolor = $config['site']['lightborder'];
}
$players_rows .= '
<TR BGCOLOR='.$bgcolor.'>
<TD WIDTH=40%>'.$flag.'<A HREF="index.php?subtopic=characters&name='.urlencode($player['name']).'">'.$player['name'].'</A><br/>'.$player['level'].' '.$vocation_name[$player['world_id']][$player['promotion']][$player['vocation']].'</TD>
<TD WIDTH=40%>'.($player['castDescription'] == "" ? '-' : $player['castDescription']).'</TD>
<TD WIDTH=20%>'.$player['castViewers'].'/50</TD>
</TR>';
}
if($number_of_players_online == 0)
{
//server status - server empty
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently there are no active casts on '.$config['server']['serverName'].'.</TD></TR></TABLE></TD></TR></TABLE><BR>';
}
else
{
//server status - someone is online
$main_content .= '
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
<TR BGCOLOR="'.$config['site']['vdarkborder'].'">
<TD CLASS=white><B>Server Status</B></TD>
</TR>
<TR BGCOLOR='.$config['site']['darkborder'].'>
<TD>';
$main_content .= 'Currently there are '.$number_of_players_online.' active live casts';
$main_content .= ' on '.$world_name.' gameworlds.<br>
</TD>
</TR>
</TABLE><BR>';
//list of players
$main_content .= '
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
<TR BGCOLOR="'.$config['site']['vdarkborder'].'">
<TD><A HREF="index.php?subtopic=whoisonline&order=name" CLASS=white>Name</A></TD>
<TD><A HREF="index.php?subtopic=whoisonline&order=level" CLASS=white>Description</A></TD>
<TD><A HREF="index.php?subtopic=whoisonline&order=vocation" CLASS=white>Viewers</TD>
</TR>
'.$players_rows.'</TABLE>';
//search bar
//$main_content .= '<BR><FORM ACTION="index.php?subtopic=characters" METHOD=post> <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
}
$main_content .= '<BR><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Description</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><h4 style="margin: 0px;">Commands (owner):</h4><i>/cast {on/off}</i> - Create or close your own cast<br/><i>/cast password |password|</i> - Sets a password for the cast<br/><i>/cast desc |description|</i> - Set a description for the cast<br/><i>/cast status</i> - Information about your cast (viewer amount, description, password)<br/><i>/cast viewers</i> - Displays the name of all viewers<br/><i>/cast {ban/unban} "name"</i> - Bans a viewer from joining your cast/Removes the ban<br/><i>/cast {mute/unmute} "name"</i> - Mutes a viewer on your cast/Removes the mute<br/><i>/cast bans</i> - Displays a list of banned viewers<br/><i>/cast mutes</i> - Displays a list of muted viewers<br/><i>/cast update</i> - Updates the description and status on the website<br/><br/><h4 style="margin: 0px;">Commands (viewer):</h4><i>/nick newNick</i> - Changes the viewer\'s name<br><i>/info</i> - Displays a list of all viewers</TD></TR></TABLE>';
?>
Of my way I do a colum on players_online with cast default = 0 when player is in cast put this cast = 1...
$players_online_data = $SQL->query('SELECT * FROM players WHERE online > 0 AND cast = 1 AND world_id = '.$world_id.' ORDER BY '.$orderby);
Hint:
Code:$players_online_data = $SQL->query('SELECT * FROM players WHERE online > 0 AND cast = 1 AND world_id = '.$world_id.' ORDER BY '.$orderby);
Where to put that?
Hint:
Code:$players_online_data = $SQL->query('SELECT * FROM players WHERE online > 0 AND cast = 1 AND world_id = '.$world_id.' ORDER BY '.$orderby);
$players_online_data = $SQL->query('SELECT * FROM players WHERE online > 1 AND cast = 1 AND world_id = '.$world_id.' ORDER BY '.$orderby);
I have same problem.
castsystem.php
<img id="ContentBoxHeadline" class="Title" src="layouts/tibiacom/images/header/cast.png" alt="Contentbox headline">
<?php
if(!defined('INITIALIZED'))
exit;
$order = $_REQUEST['order'];
if($order == 'name') {
$orderby = 'name';
}
if($order == 'level') {
$orderby = 'level';
}
if($order == 'vocation') {
$orderby = 'vocation';
}
if(empty($orderby)) {
$orderby = 'name';
}
if(count($config['site']['worlds']) > 1)
{
$worlds .= '<i>Select world:</i> ';
foreach($config['site']['worlds'] as $idd => $world_n)
{
if($idd == (int) $_GET['world'])
{
$world_id = $idd;
$world_name = $world_n;
}
}
}
if($idd == (int) $_GET['world'])
{
$world_id = $idd;
$world_name = $world_n;
}
if(!isset($world_id))
{
$world_id = 0;
$world_name = $config['server']['serverName'];
}
if(count($config['site']['worlds']) > 1)
{
$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD>
<FORM ACTION="?subtopic=whoisonline" METHOD=get><INPUT TYPE=hidden NAME=subtopic VALUE=whoisonline><INPUT TYPE=hidden NAME=list VALUE=experience>
<TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>World Selection</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['lightborder'].'">
<TABLE BORDER=0 CELLPADDING=1><TR><TD>World: </TD><TD><SELECT SIZE="1" NAME="world"><OPTION VALUE="" SELECTED>(choose world)</OPTION>';
foreach($config['site']['worlds'] as $id => $world_n)
{
$main_content .= '<OPTION VALUE="'.$id.'">'.$world_n.'</OPTION>';
}
$main_content .= '</SELECT> </TD><TD><INPUT TYPE=image NAME="Submit" ALT="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18>
</TD></TR></TABLE></TABLE></FORM></TABLE><br>';
}
$players_online_data = $SQL->query('SELECT * FROM players WHERE level > 0 AND cast = 1 ORDER BY '.$orderby);
$number_of_players_online = 0;
foreach($players_online_data as $player)
{
$number_of_players_online++;
if($config['site']['show_flag'])
{
$account = $SQL->query('SELECT * FROM accounts WHERE id = '.$player['account_id'].'')->fetch();
$flag = '<image src="images/flags/'.$account['flag'].'.png"/> ';
}
if(is_int($number_of_players_online / 2))
{
$bgcolor = $config['site']['darkborder'];
}
else
{
$bgcolor = $config['site']['lightborder'];
}
$players_rows .= '
<TR BGCOLOR='.$bgcolor.'>
<TD WIDTH=40%>'.$flag.'<A HREF="index.php?subtopic=characters&name='.urlencode($player['name']).'">'.$player['name'].'</A><br/>'.$player['level'].' '.$vocation_name[$player['world_id']][$player['promotion']][$player['vocation']].'</TD>
<TD WIDTH=20%><font color="#008000">ONLINE</font></TD>
</TR>';
}
if($number_of_players_online == 0)
{
//server status - server empty
$main_content .= '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR="'.$config['site']['vdarkborder'].'"><TD CLASS=white><B>Server Status</B></TD></TR><TR BGCOLOR='.$config['site']['darkborder'].'><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=1><TR><TD>Currently there are no active casts on '.$config['server']['serverName'].'.</TD></TR></TABLE></TD></TR></TABLE><BR>';
}
else
{
//server status - someone is online
$main_content .= '
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
<TR BGCOLOR="'.$config['site']['vdarkborder'].'">
<TD CLASS=white><B>Server Status</B></TD>
</TR>
<TR BGCOLOR='.$config['site']['darkborder'].'>
<TD>';
$main_content .= 'Currently there are '.$number_of_players_online.' active live casts';
$main_content .= ' on '.$world_name.' gameworlds.<br>
</TD>
</TR>
</TABLE><BR>';
//list of players
$main_content .= '
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>
<TR BGCOLOR="'.$config['site']['vdarkborder'].'">
<TD><A HREF="index.php?subtopic=whoisonline&order=name" CLASS=white>Name</A></TD>
<TD><A HREF="index.php?subtopic=whoisonline&order=vocation" CLASS=white>Status</TD>
</TR>
'.$players_rows.'</TABLE>';
//search bar
//$main_content .= '<BR><FORM ACTION="index.php?subtopic=characters" METHOD=post> <TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Search Character</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><TABLE BORDER=0 CELLPADDING=1><TR><TD>Name:</TD><TD><INPUT NAME="name" VALUE=""SIZE=29 MAXLENGTH=29></TD><TD><INPUT TYPE=image NAME="Submit" SRC="'.$layout_name.'/images/buttons/sbutton_submit.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></TABLE></TD></TR></TABLE></FORM>';
}
$main_content .= '<BR><TABLE WIDTH=100% BORDER=0 CELLSPACING=1 CELLPADDING=4><TR><TD BGCOLOR="'.$config['site']['vdarkborder'].'" CLASS=white><B>Description</B></TD></TR><TR><TD BGCOLOR="'.$config['site']['darkborder'].'"><h4 style="margin: 0px;">Commands (owner):</h4><i>!cast {on/off}</i> - Create or close your own cast<br/><i>!cast password, |password|</i> - Sets a password for the cast<br/><i>!cast,desc, |description|</i> - Set a description for the cast<br/><i>!cast status</i> - Information about your cast (viewer amount, description, password)<br/><i>!cast viewers</i> - Displays the name of all viewers<br/><i>!cast {ban/unban},"name"</i> - Bans a viewer from joining your cast/Removes the ban<br/><i>!cast {mute/unmute} "name"</i> - Mutes a viewer on your cast/Removes the mute<br/><i>!cast bans</i> - Displays a list of banned viewers<br/><i>!cast mutes</i> - Displays a list of muted viewers<br/><i>!cast update</i> - Updates the description and status on the website<br/><br/><h4 style="margin: 0px;">Commands (viewer):</h4><i>!nick newNick</i> - Changes the viewer\'s name<br><i>!info</i> - Displays a list of all viewers</TD></TR></TABLE>';
CREATE TABLE IF NOT EXISTS `players` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`group_id` int(11) NOT NULL DEFAULT '1',
`account_id` int(11) NOT NULL DEFAULT '0',
`level` int(11) NOT NULL DEFAULT '1',
`vocation` int(11) NOT NULL DEFAULT '0',
`health` int(11) NOT NULL DEFAULT '150',
`healthmax` int(11) NOT NULL DEFAULT '150',
`experience` bigint(20) NOT NULL DEFAULT '0',
`lookbody` int(11) NOT NULL DEFAULT '0',
`lookfeet` int(11) NOT NULL DEFAULT '0',
`lookhead` int(11) NOT NULL DEFAULT '0',
`looklegs` int(11) NOT NULL DEFAULT '0',
`looktype` int(11) NOT NULL DEFAULT '136',
`lookaddons` int(11) NOT NULL DEFAULT '0',
`maglevel` int(11) NOT NULL DEFAULT '0',
`mana` int(11) NOT NULL DEFAULT '0',
`manamax` int(11) NOT NULL DEFAULT '0',
`manaspent` int(11) unsigned NOT NULL DEFAULT '0',
`soul` int(10) unsigned NOT NULL DEFAULT '0',
`town_id` int(11) NOT NULL DEFAULT '0',
`posx` int(11) NOT NULL DEFAULT '0',
`posy` int(11) NOT NULL DEFAULT '0',
`posz` int(11) NOT NULL DEFAULT '0',
`conditions` blob NOT NULL,
`cap` int(11) NOT NULL DEFAULT '0',
`sex` int(11) NOT NULL DEFAULT '0',
`lastlogin` bigint(20) unsigned NOT NULL DEFAULT '0',
`lastip` int(10) unsigned NOT NULL DEFAULT '0',
`save` tinyint(1) NOT NULL DEFAULT '1',
`skull` tinyint(1) NOT NULL DEFAULT '0',
`skulltime` int(11) NOT NULL DEFAULT '0',
`lastlogout` bigint(20) unsigned NOT NULL DEFAULT '0',
`blessings` tinyint(2) NOT NULL DEFAULT '0',
`onlinetime` int(11) NOT NULL DEFAULT '0',
`deletion` bigint(15) NOT NULL DEFAULT '0',
`balance` bigint(20) unsigned NOT NULL DEFAULT '0',
`offlinetraining_time` smallint(5) unsigned NOT NULL DEFAULT '43200',
`offlinetraining_skill` int(11) NOT NULL DEFAULT '-1',
`stamina` smallint(5) unsigned NOT NULL DEFAULT '2520',
`skill_fist` int(10) unsigned NOT NULL DEFAULT '10',
`skill_fist_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
`skill_club` int(10) unsigned NOT NULL DEFAULT '10',
`skill_club_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
`skill_sword` int(10) unsigned NOT NULL DEFAULT '10',
`skill_sword_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
`skill_axe` int(10) unsigned NOT NULL DEFAULT '10',
`skill_axe_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
`skill_dist` int(10) unsigned NOT NULL DEFAULT '10',
`skill_dist_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
`skill_shielding` int(10) unsigned NOT NULL DEFAULT '10',
`skill_shielding_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
`skill_fishing` int(10) unsigned NOT NULL DEFAULT '10',
`skill_fishing_tries` bigint(20) unsigned NOT NULL DEFAULT '0',
`deleted` tinyint(1) NOT NULL DEFAULT '0',
`description` varchar(255) NOT NULL DEFAULT '',
`comment` text NOT NULL,
`create_ip` int(11) NOT NULL DEFAULT '0',
`create_date` int(11) NOT NULL DEFAULT '0',
`hide_char` int(11) NOT NULL DEFAULT '0',
`cast` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`),
KEY `account_id` (`account_id`),
KEY `vocation` (`vocation`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1715 ;
$players_online_data = $SQL->query('SELECT * FROM players WHERE level > 0 AND cast = 1 ORDER BY '.$orderby);
function onLogout(cid)
db.query("UPDATE `players` SET `cast` = 0 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
return true
end
-- ordered as in creaturescripts.xml
local events = {
'pythiusDead',
'bossesGrayIsland',
'ElementalSpheres',
'ElementalSpheresKill',
'ElementalSpheresLogin',
'WarzoneThree',
'WarzoneTwo',
'bossesWarzone',
'SvargrondArenaKill',
'PharaoKillPortal',
'inServiceOfYalaharQuestsDiseased',
'inServiceOfYalaharQuestsMorik',
'inServiceOfYalaharQuestsQuara',
'inquisitionQuestBosses',
'inquisitionQuestUngreez',
'killingInTheNameOfQuestKills',
'TaskCustom',
'Yielothax',
'Energized',
'Raging',
'MastersVoiceServants',
'wrathBoss',
'wrathZalamon',
'PlayerDeath',
'ThievesGuildNomad',
'AdvanceSave',
'SpikeDrillworm',
'SecretServiceBlackKnight'
}
function onLogin(cid)
local player = Player(cid)
local loginStr = 'Welcome to ' .. configManager.getString(configKeys.SERVER_NAME) .. '!'
if player:getLastLoginSaved() <= 0 then
loginStr = loginStr .. ' Please choose your outfit.'
player:sendTutorial(1)
else
if loginStr ~= '' then
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
end
loginStr = string.format('Your last visit was on %s.', os.date('%a %b %d %X %Y', player:getLastLoginSaved()))
db.query("UPDATE `players` SET `cast` = 0 WHERE `id` = " .. getPlayerGUID(cid) .. ";")
end
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
for i = 1, #events do
player:registerEvent(events[i])
end
return true
end