• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Reputation for killing monsters, players.

pirl0

Scripter
Joined
Apr 16, 2009
Messages
172
Reaction score
0
If you killed the player or monsters you gain some points reputation.
Heres script, script is made by me!

data/creaturescripts/scripts/ create file reputation from monsters.lua
Lua:
function onKill(cid, target)
-- Config --
local storage = 666 -- Storage value of the script.
local script =
{
    name = getCreatureName(target), -- Do not edit.
    how_check = getPlayerStorageValue(cid,999), -- Do not edit.
    killed = getPlayerStorageValue(cid,storage), -- Do not edit.
    skull_check = getCreatureSkullType(target) -- Do not edit.
} 
local how = 3 -- How many monsters need to get reput point.
local rep_for_monster = 1 -- How many reputation give for kill monster.
local rep_for_player = 5 -- How many reputation give for kill player without skull.
local rep_for_whiteskull = 10 -- How many reputation give for kill player with white skull.
local rep_for_redskull = 15 -- How many reputation give for kill player with red skull.
local rep_for_blackskull = 20 -- How many reputation give for kill player with black skull.
local points = script.killed + 1
local msg = "You have now ".. points .." points."
local msg_monster = "Congratulations, you have slained ".. how .." monsters and you gained ".. rep_for_monster.." reputation point." -- Standard message for killing monster you can edit this.
local msg_player = "Congratulations, you have killed a ".. script.name .." and you gained ".. rep_for_player .." reputation points." -- Standard message for killing player without skull you can edit this.
local msg_white = "Congratulations, you have killed a ".. script.name .." and you gained ".. rep_for_whiteskull .." reputation points." -- Standard message for killing player with white skull you can edit this.
local msg_red = "Congratulations, you have killed a ".. script.name .." and you gained ".. rep_for_redskull .." reputation points." -- Standard message for killing player with red skull you can edit this.
local msg_black = "Congratulations, you have killed a ".. script.name .." and you gained ".. rep_for_blackskull .." reputation points." -- Standard message for killing player with black skull you can edit this.

-- Script --
if(getPlayerStorageValue(cid,999) >= how -1) then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_monster)
		doPlayerSendTextMessage(cid,22,msg_monster)
		doPlayerSendTextMessage(cid,23,msg)
		setPlayerStorageValue(cid, 999,0)
		return TRUE
elseif(isMonster(target) == TRUE) then
		setPlayerStorageValue(cid, 999,script.how_check + 1)
		return TRUE
elseif(isPlayer(target) == TRUE) then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_player)
		doPlayerSendTextMessage(cid,22,msg_player)
		doPlayerSendTextMessage(cid,23,msg)
		return TRUE
elseif(isPlayer(target) == TRUE) and skull_check == 3 then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_whiteskull)
		doPlayerSendTextMessage(cid,22,msg_white)
		doPlayerSendTextMessage(cid,23,msg)
		return TRUE
elseif(isPlayer(target) == TRUE) and skull_check == 4 then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_redskull)
		doPlayerSendTextMessage(cid,22,msg_red)
		doPlayerSendTextMessage(cid,23,msg)
		return TRUE
elseif(isPlayer(target) == TRUE) and skull_check == 5 then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_blackskull)
		doPlayerSendTextMessage(cid,22,msg_black)
		doPlayerSendTextMessage(cid,23,msg)
		return TRUE
	end
end

In creaturescripts.xml
Code:
<event type="kill" name="ReputationFromMonsters" event="script" value="reputation from monsters.lua"/>

In login.lua past
Code:
registerCreatureEvent(cid, "ReputationFromMonsters")

Now check the reputation!
data/talkactions/scripts create file getrep.lua
Lua:
  function onSay(cid, words, param, channel)
       
        -- Config --
       
        storage = 666
        local reputation = getPlayerStorageValue(cid,storage)
       
        -- Script --
       
        if reputation == 1 or reputation == 0 then
                doPlayerSendCancel(cid, "You have ".. reputation .." reputation point.")
        else
                doPlayerSendCancel(cid, "You have ".. reputation .." reputation points.")
        end
        return TRUE -- Here
end

In talkactions.xml

Code:
<talkaction words="!reputation" hide="yes" event="script" value="getrep.lua"/>
<talkaction words="/reputation" hide="yes" event="script" value="getrep.lua"/>

I make a website checker!
In characters.php at line ~~99 past below that
PHP:
$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Created:</TD><TD>'.date("j F Y, g:i a", $player->getCreated()).'</TD></TR>';
this script
PHP:
            if($config['site']['show_reputation'])
            {
                    $id = $player->getCustomField("id");
                if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
                    $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=10%>Reputation:</TD>';
                         $rep = $SQL->query('SELECT `value` FROM `player_storage` WHERE `player_id` = '.$id.' and `key` = '.$config['site']['show_reputation_storage'].';')->fetch();
                    if($id >= 0) {
                    $main_content .= '<TD><B>'.$rep[value].'</B></TD></TR>';

And config.php past this

PHP:
$config['site']['show_reputation_storage'] = 666;// the storage of reputation
$config['site']['show_reputation'] = 1;// show 1 = yes, 0 = no

Thanks and sorry for my bad english.
 
Last edited:
@Edit [***2***]

Version only for players :

Lua:
function onKill(cid, target)
-- Config --
local storage = 666 -- Storage value of the script.
local script =
{
    name = getCreatureName(target), -- Do not edit.
    how_check = getPlayerStorageValue(cid,999), -- Do not edit.
    killed = getPlayerStorageValue(cid,storage), -- Do not edit.
    skull_check = getCreatureSkullType(target) -- Do not edit.
}
local players =
{
	[0] = {points = 5, msg= "You have kill ".. getPlayerName(target) .." and you gained ".. players[0].points .." reputation point."}, --[Skull Type] = Points / MSG
	[3] = {points = 5, msg= "You have kill ".. getPlayerName(target) .." and you gained ".. players[3].points .." reputation point."},
	[4] = {points = 5, msg= "You have kill ".. getPlayerName(target) .." and you gained ".. players[4].points .." reputation point."},
	[5] = {points = 5, msg= "You have kill ".. getPlayerName(target) .." and you gained ".. players[5].points .." reputation point."}
}

local skull = script.skull_check
local points = players[skull].points
local msg = players[skull].msg
-- Script --
if(isPlayer(target) == TRUE) then
                setPlayerStorageValue(cid, storage,script.killed + points)
                doPlayerSendTextMessage(cid,22,msg)
                return TRUE
        end
end
(Not tested all bugs please reports!)

@Edit [***3***]

Version for custom monsters :

Lua:
  function onKill(cid, target)
-- Config --
local storage = 666 -- Storage value of the script.
local script =
{
    name = getCreatureName(target), -- Do not edit.
    how_check = getPlayerStorageValue(cid,999), -- Do not edit.
    killed = getPlayerStorageValue(cid,storage), -- Do not edit.
    skull_check = getCreatureSkullType(target) -- Do not edit.
}
local monsters =
{
	["Rat"] = {points = 1},
	["Demon"] = {points = 5},
	["Ferumbras"] = {points = 100},
}
local points = monsters[script.name].points
local pointss = script.killed + points
local msg = "You have now ".. pointss .." points."
local msg_monster = "You have slain ".. script.name .." and you get ".. points .." reputation point." -- Standard message for killing monster you can edit this.
local tbl = monsters[script.name]
-- Script --
if(not tbl) then
        return TRUE
end

if(tbl) and isMonster(target) == TRUE then
                setPlayerStorageValue(cid, storage,script.killed + points)
                doPlayerSendTextMessage(cid,22,msg_monster)
                doPlayerSendTextMessage(cid,23,msg)
                return TRUE
			end
		return TRUE
end
(Not tested all bugs please reports!)
 
Last edited:
Congraulations you have killed Rat and you gain 1 point reputation!

Should be:

Congratulations, you have killed a rat and you gained 1 reputation point!
 
@Up Fixed.
@Shawak you can use this to quest or something.
 
Are you Pearl from t-net? Reputation for killing monsters, players.-Tibia 8.50 - Tibia.net.pl Also the script is kind of bugged/not finished, while testing i've fixed lots of bugs.
__________________
klekSu.png

You are welcome on kleksoria.com!
Please visit new open tibia forum with it's own ots list. otservers.net!
 
Last edited:
Yup im Pearl from tnet
I have tested and i dont have bugs
 
good
 
Last edited:
Well done, I suggest you put it so only when you kill certain monsters (configurable in script's config) you get rep from them, not every monster because it would get annoying getting that message everytime, and it would be better to make it more complete.

Also, I think this is useful maybe for a system similar to "buy items with frags", but in this case it would be "buy items with rep" and it would be more complete since rep is accumulated, I dont know if "total" frags are.

Well those are my 2 cents, well done keep it up.
+Repped
 
Not also to a quest, but you can also add shops that require reputation and sell for more gold :)
 
Could you do what Guitar Freak said?
(Well done, I suggest you put it so only when you kill certain monsters (configurable in script's config) you get rep from them, not every monster because it would get annoying getting that message everytime, and it would be better to make it more complete.)
 
@Cyber Master
I have tested on original characters.php
I past here my characters.php

PHP:
<?PHP
$name = stripslashes(ucwords(strtolower(trim($_REQUEST['name']))));
if(empty($name)) {
	$main_content .= 'Here you can get detailed information about a certain player on '.$config['server']['serverName'].'.<BR>  <FORM ACTION="?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>';
}
else
{
	if(check_name($name)) {
		$player = $ots->createObject('Player');
		$player->find($name);
		if($player->isLoaded()) {
			$account = $player->getAccount();
			$main_content .= '<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><TR><TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Character Information</B></TD></TR>';
			if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
			$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=20%>Name:</TD><TD><font color="';
			$main_content .= ($player->isOnline()) ? 'green' : 'red';
			$main_content .= '"><b>'.$player->getName().'</b></font>';
			if($player->isDeleted())
				$main_content .= '<font color="red"> [DELETED]</font>';
			if($player->isNameLocked())
				$main_content .= '<font color="red"> [NAMELOCK]</font>';
			$main_content .= '</TD></TR>';
			if($player->getOldName())
			{
				if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
				if($player->isNameLocked())
					$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Proposition:</TD><TD>'.$player->getOldName().'</TD></TR>';
				else
					$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Old name:</TD><TD>'.$player->getOldName().'</TD></TR>';
			}
			/*
			$group = $player->getGroup();
			if($group->getId() != 1)
			{
				if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
				$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Position:</TD><TD>'.$group->getName().'</TD></TR>';
			}
			*/
			if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
			$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Sex:</TD><TD>';
			$main_content .= ($player->getSex() == 0) ? 'female' : 'male';
			$main_content .= '</TD></TR>';
			if($config['site']['show_marriage_info'])
			{
				if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
				$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Marital status:</TD><TD>';
				$marriage = new OTS_Player();
				$marriage->load($player->getMarriage());
				if($marriage->isLoaded())
					$main_content .= 'married to <a href="?subtopic=characters&name='.urlencode($marriage->getName()).'"><b>'.$marriage->getName().'</b></a></TD></TR>';
				else
					$main_content .= 'single</TD></TR>';
			}
			if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
			$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Profession:</TD><TD>'.$vocation_name[$player->getWorld()][$player->getPromotion()][$player->getVocation()].'</TD></TR>';
			if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
			$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Level:</TD><TD>'.$player->getLevel().'</TD></TR>';
			if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
			$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>World:</TD><TD>'.$config['site']['worlds'][$player->getWorld()].'</TD></TR>';
			if(!empty($towns_list[$player->getWorld()][$player->getTownId()]))
			{
				if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
				$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Residence:</TD><TD>'.$towns_list[$player->getWorld()][$player->getTownId()].'</TD></TR>';
			}
			$rank_of_player = $player->getRank();
			if(!empty($rank_of_player))
			{
				$guild_name = $rank_of_player->getGuild()->getName();
				if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
				$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Guild membership:</TD><TD>'.$rank_of_player->getName().' of the <a href="?subtopic=guilds&action=show&guild='.$guild_name.'">'.$guild_name.'</a></TD></TR>';
			}
			if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
			$lastlogin = $player->getLastLogin();
			if(empty($lastlogin))
				$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Last login:</TD><TD>Never logged in.</TD></TR>';
			else
				$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Last login:</TD><TD>'.date("j F Y, g:i a", $lastlogin).'</TD></TR>';
			if($config['site']['show_creationdate'] && $player->getCreated())
			{
				if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
							$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Created:</TD><TD>'.date("j F Y, g:i a", $player->getCreated()).'</TD></TR>';
			}
			if($config['site']['show_reputation'])
			{
           		 $id = $player->getCustomField("id");
				if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
         		   $main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=10%>Reputation:</TD>';
                         $rep = $SQL->query('SELECT `value` FROM `player_storage` WHERE `player_id` = '.$id.' and `key` = '.$config['site']['show_reputation_storage'].';')->fetch();
         		   if($id >= 0) {
        		    $main_content .= '<TD><B>'.$rep[value].'</B></TD></TR>';
          		  }
			$comment = $player->getComment();
			$newlines   = array("\r\n", "\n", "\r");
			$comment_with_lines = str_replace($newlines, '<br />', $comment, $count);
			if($count < 50)
				$comment = $comment_with_lines;
			if(!empty($comment))
			{
				if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
				$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD VALIGN=top>Comment:</TD><TD>'.$comment.'</TD></TR>';
			}
			}
			$main_content .= '</TABLE>';
			if($config['site']['show_skills_info'])
			{
				$main_content .= '<br><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=160><TR><TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD><TD><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=160><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Skills</B></TD></TR>';
				$main_content .= '<tr bgcolor="'.$config['site']['darkborder'].'"><td width="120">Magic level</td><td align="right">'.$player->getMagLevel().'</td></tr>';
				$main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td width="120">Fist Fighting</td><td align="right">'.$player->getSkill(0).'</td></tr>';
				$main_content .= '<tr bgcolor="'.$config['site']['darkborder'].'"><td width="120">Club Fighting</td><td align="right">'.$player->getSkill(1).'</td></tr>';
				$main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td width="120">Sword Fighting</td><td align="right">'.$player->getSkill(2).'</td></tr>';
				$main_content .= '<tr bgcolor="'.$config['site']['darkborder'].'"><td width="120">Axe Fighting</td><td align="right">'.$player->getSkill(3).'</td></tr>';
				$main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td width="120">Distance Fighting</td><td align="right">'.$player->getSkill(4).'</td></tr>';
				$main_content .= '<tr bgcolor="'.$config['site']['darkborder'].'"><td width="120">Shielding</td><td align="right">'.$player->getSkill(5).'</td></tr>';
				$main_content .= '<tr bgcolor="'.$config['site']['lightborder'].'"><td width="120">Fishing</td><td align="right">'.$player->getSkill(6).'</td></tr>';
				$main_content .= '</TABLE></TABLE>';
			}
			//deaths list
			$player_deaths = $SQL->query('SELECT * FROM player_deaths WHERE '.$player->getId().' = player_id ORDER BY date DESC');
			$dead_add_content .= '<br><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Deaths</B></TD></TR>';
			if(!empty($player_deaths))
			{
				$vowels = array("e", "y", "u", "i", "o", "a");
				foreach($player_deaths as $dead)
				{
					if(is_int($number_of_player_deaths / 2))
						$bgcolor = $config['site']['darkborder'];
					else
						$bgcolor = $config['site']['lightborder'];
					$number_of_player_deaths++;
					$dead_add_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=20%>'.date("j M Y, H:i", $dead['time']).'</TD><TD>Killed at Level '.$dead['level'].' by ';
					if(is_numeric($dead['killed_by']))
					{
						$player_char = new OTS_Player();
						$player_char->load($dead['killed_by']);
						if($player_char->isLoaded())
							$dead_add_content .= '<a href="?subtopic=characters&name='.urlencode($player_char->getName()).'"><b>'.$player_char->getName().'</b></a>';
						else
							$dead_add_content .= '<b>DELETED PLAYER</b>';
					}
					else
						if($dead['killed_by'] == "-1")
							$dead_add_content .= "item or field";
						else
						{
							if(in_array(substr(strtolower($dead['killed_by']), 0, 1), $vowels))
								$dead_add_content .= "an ";
							else
								$dead_add_content .= "a ";
							$dead_add_content .= $dead['killed_by'];
						}
					if(!empty($dead['altkilled_by']) && $dead['killed_by'] != $dead['altkilled_by'])
						if(is_numeric($dead['altkilled_by']))
						{
							$player_char = new OTS_Player();
							$player_char->load($dead['altkilled_by']);
							if($player_char->isLoaded())
								$dead_add_content .= ' and <a href="?subtopic=characters&name='.urlencode($player_char->getName()).'"><b>'.$player_char->getName().'</b></a>';
							else
								$dead_add_content .= '<b>DELETED PLAYER</b>';
						}
						else
							if($dead['altkilled_by'] == "-1")
								$dead_add_content .= "item or field";
							else
							{
								if(in_array(substr(strtolower($dead['altkilled_by']), 0, 1), $vowels))
									$dead_add_content .= " and an ";
								else
									$dead_add_content .= " and a ";
								$dead_add_content .= $dead['altkilled_by'];
							}					
					$dead_add_content .= '.</TD></TR>';
				}
			}
			$dead_add_content .= '</TABLE>';
			if($number_of_player_deaths > 0)
				$main_content .= $dead_add_content;
			if(!$player->getHideChar()) {
				$main_content .= '<br><TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=2 CLASS=white><B>Account Information</B></TD></TR>';
				if($account->getRLName())
				{
					if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
					$main_content .= '<TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Real name:</TD><TD>'.$account->getRLName().'</TD></TR>';
				}
				if($account->getLocation())
				{
					if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
					$main_content .= '<TR BGCOLOR='.$config['site']['darkborder'].'><TD WIDTH=20%>Location:</TD><TD>'.$account->getLocation().'</TD></TR>';
				}
				if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
				if($account->getLastLogin())
					$main_content .= '<TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Last login:</TD><TD>'.date("j F Y, g:i a", $account->getLastLogin()).'</TD></TR>';
				else
					$main_content .= '<TR BGCOLOR='.$config['site']['lightborder'].'><TD WIDTH=20%>Last login:</TD><TD>Never logged in.</TD></TR>';

				if(is_int($number_of_rows / 2)) { $bgcolor = $config['site']['darkborder']; } else { $bgcolor = $config['site']['lightborder']; } $number_of_rows++;
				$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD>Account*Status:</TD><TD>';
				$main_content .= ($account->isPremium()) ? '<b><font color="green">Premium Account</font></b>' : '<b><font color="red">Free Account</font></b>';
				if($account->isBanned())
					if($account->getBanTime() > 0)
						$main_content .= '<font color="red"> [Banished until '.date("j F Y, G:i", $account->getBanTime()).']</font>';
					else
						$main_content .= '<font color="red"> [Banished FOREVER]</font>';
				$main_content .= '</TD></TR></TABLE>';
				$main_content .= '<br><TABLE BORDER=0><TR><TD></TD></TR></TABLE><TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['site']['vdarkborder'].'><TD COLSPAN=5 CLASS=white><B>Characters</B></TD></TR>
				<TR BGCOLOR='.$config['site']['darkborder'].'><TD><B>Name</B></TD><TD><B>World</B></TD><TD><B>Level</B></TD><TD><b>Status</b></TD><TD><B>*</B></TD></TR>';
				$account_players = $account->getPlayersList();
				$account_players->orderBy('name');
				$player_number = 0;
				foreach($account_players as $player_list)
				{
					if(!$player_list->getHideChar())
					{
						$player_number++;
						if(is_int($player_number / 2))
							$bgcolor = $config['site']['darkborder'];
						else
							$bgcolor = $config['site']['lightborder'];
						if(!$player_list->isOnline())
							$player_list_status = '<font color="red">Offline</font>';
						else
							$player_list_status = '<font color="green">Online</font>';
						$main_content .= '<TR BGCOLOR="'.$bgcolor.'"><TD WIDTH=52%><NOBR>'.$player_number.'.*'.$player_list->getName();
						$main_content .= ($player_list->isDeleted()) ? '<font color="red"> [DELETED]</font>' : '';
						$main_content .= '</NOBR></TD><TD WIDTH=15%>'.$config['site']['worlds'][$player_list->getWorld()].'</TD><TD WIDTH=25%>'.$player_list->getLevel().' '.$vocation_name[$player_list->getWorld()][$player_list->getPromotion()][$player_list->getVocation()].'</TD><TD WIDTH="8%"><b>'.$player_list_status.'</b></TD><TD><TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0><FORM ACTION="?subtopic=characters" METHOD=post><TR><TD><INPUT TYPE=hidden NAME=name VALUE="'.$player_list->getName().'"><INPUT TYPE=image NAME="View '.$player_list->getName().'" ALT="View '.$player_list->getName().'" SRC="'.$layout_name.'/images/buttons/sbutton_view.gif" BORDER=0 WIDTH=120 HEIGHT=18></TD></TR></FORM></TABLE></TD></TR>';
					}
				}
				$main_content .= '</TABLE></TD><TD><IMG SRC="'.$layout_name.'/images/general/blank.gif" WIDTH=10 HEIGHT=1 BORDER=0></TD></TR></TABLE>';
			}
			$main_content .= '<BR><BR><FORM ACTION="?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 .= '</TABLE>';
		}
		else
			$search_errors[] = 'Character <b>'.$name.'</b> does not exist.';
	}
	else
		$search_errors[] = 'This name contains invalid letters. Please use only A-Z, a-z and space.';
	if(!empty($search_errors))
	{
		$main_content .= '<div class="SmallBox" >  <div class="MessageContainer" >    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeLeftTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeRightTop" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="ErrorMessage" >      <div class="BoxFrameVerticalLeft" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="BoxFrameVerticalRight" style="background-image:url('.$layout_name.'/images/content/box-frame-vertical.gif);" /></div>      <div class="AttentionSign" style="background-image:url('.$layout_name.'/images/content/attentionsign.gif);" /></div><b>The Following Errors Have Occurred:</b><br/>';
		foreach($search_errors as $search_error)
			$main_content .= '<li>'.$search_error;
		$main_content .= '</div>    <div class="BoxFrameHorizontal" style="background-image:url('.$layout_name.'/images/content/box-frame-horizontal.gif);" /></div>    <div class="BoxFrameEdgeRightBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>    <div class="BoxFrameEdgeLeftBottom" style="background-image:url('.$layout_name.'/images/content/box-frame-edge.gif);" /></div>  </div></div><br/>';
		$main_content .= '<BR><FORM ACTION="?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>';
	}
}
?>

@up
Code:
function onKill(cid, target)
local name = getCreatureName(target)
local killed = getPlayerStorageValue(cid,storage)
-- Config --
local storage = 666 -- Storage value of the script.
local how = 1 -- How many monsters need to get reput point.
local rep_for_monster = 1
local rep_for_player = 5
local msg_monster = "Congratulations, you have killed a ".. name .." and you gained ".. rep_for_monster.." reputation point" -- Standard message for killing monster you can edit this.
local msg_player = "Congratulations, you have killed a ".. name .." and you gained ".. rep_for_player .." reputation points" -- Standard message for killing player you can edit this.

-- Script --
if(isMonster(target) == TRUE and killed % how == 0 then
		setPlayerStorageValue(cid, storage,killed + rep_for_monster)
		doPlayerSendTextMessage(cid,22,msg_monster)
		return TRUE
elseif(isPlayer(target) == TRUE) then
		setPlayerStorageValue(cid, storage,killed + rep_for_player)
		doPlayerSendTextMessage(cid,22,msg_player)
		return TRUE
	end
end

2 version script
Code:
function onKill(cid, target)
local name = getCreatureName(target)
local killed = getPlayerStorageValue(cid,storage)
local how_check = getPlayerStorageValue(cid,999)
-- Config --
local storage = 666 -- Storage value of the script.
local how = 1 -- How many monsters need to get reput point.
local rep_for_monster = 1 -- How many reputation gain for killing monsters
local rep_for_player = 5 -- How many reputation gain for killing players
local msg_monster = "Congratulations, you have killed a ".. name .." and you gained ".. rep_for_monster.." reputation point" -- Standard message for killing monster you can edit this.
local msg_player = "Congratulations, you have killed a ".. name .." and you gained ".. rep_for_player .." reputation points" -- Standard message for killing player you can edit this.

-- Script --
if(isMonster(target) == TRUE) then
		setPlayerStorageValue(cid, 999,how_check + 1)
		return TRUE
elseif(isMonster(target) == TRUE and how_check >= how) then
		setPlayerStorageValue(cid, storage,killed + rep_for_monster)
		setPlayerStorageValue(cid, 999,0)
		doPlayerSendTextMessage(cid,22,msg_monster)
		return TRUE
elseif(isPlayer(target) == TRUE) then
		setPlayerStorageValue(cid, storage,killed + rep_for_player)
		doPlayerSendTextMessage(cid,22,msg_player)
		return TRUE
	end
end
I dont tested.

Version 3

Code:
function onKill(cid, target)
local script =
{
    name = getCreatureName(target), -- Do not edit.
    how_check = getPlayerStorageValue(cid,999), -- Do not edit.
	killed = getPlayerStorageValue(cid,storage) -- Do not edit.
} 
-- Config --
local storage = 666 -- Storage value of the script.
local how = 3 -- How many monsters need to get reput point.
local rep_for_monster = 1
local rep_for_player = 5
local msg_monster = "Congratulations, you have slained ".. how .." monsters and you gained ".. rep_for_monster.." reputation points." -- Standard message for killing monster you can edit this.
local msg_player = "Congratulations, you have killed a ".. script.name .." and you gained ".. rep_for_player .." reputation points." -- Standard message for killing player you can edit this.

-- Script --
if(getPlayerStorageValue(cid,999) >= how -1) then
		setPlayerStorageValue(cid, 666,script.killed + 1)
		doPlayerSendTextMessage(cid,22,msg_monster)
		setPlayerStorageValue(cid, 999,0)
		return TRUE
elseif(isMonster(target) == TRUE) then
		setPlayerStorageValue(cid, 999,script.how_check + 1)
		return TRUE
elseif(isPlayer(target) == TRUE) then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_player)
		doPlayerSendTextMessage(cid,22,msg_player)
		return TRUE
	end
end

Please test.
 
Last edited:
@HerberPcL
Thanks!

Code:
function onLook(cid, position)
	local target = getThingFromPos(position)
	local storage = 666
	if isPlayer(target.uid) == TRUE and getPlayerAccess(target.uid) < 3 then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Reputation: " .. getPlayerStorageValue(cid,storage))
	end
	return TRUE
end
 
Add to talkaction if storage == 1 then you get 1 reputation POINT and if > 1 then POINTS, no time to test it now, i'd also do if killing player with no skull then 3 points, if white skull then 1 point, if rs then 5 points, easy do add.
__________________
klekSu.png

You are welcome on kleksoria.com!
Please visit new open tibia forum with it's own ots list. otservers.net!
 
Last edited:
@up
Fixed, no test.

@up
Version 4 of the script.

Code:
function onKill(cid, target)
local script =
{
    name = getCreatureName(target), -- Do not edit.
    how_check = getPlayerStorageValue(cid,999), -- Do not edit.
	killed = getPlayerStorageValue(cid,storage), -- Do not edit.
	skull_check = getCreatureSkullType(cid) -- Do not edit.
} 
-- Config --
local storage = 666 -- Storage value of the script.
local how = 3 -- How many monsters need to get reput point.
local rep_for_monster = 1 -- How many reputation give for kill monster.
local rep_for_player = 5 -- How many reputation give for kill player without skull.
local rep_for_whiteskull = 10 -- How many reputation give for kill player with white skull.
local rep_for_redskull = 15 -- How many reputation give for kill player with red skull.
local rep_for_blackskull = 20 -- How many reputation give for kill player with black skull.
local msg_monster = "Congratulations, you have slained ".. how .." monsters and you gained ".. rep_for_monster.." reputation point" -- Standard message for killing monster you can edit this.
local msg_player = "Congratulations, you have killed a ".. script.name .." and you gained ".. rep_for_player .." reputation points" -- Standard message for killing player without skull you can edit this.
local msg_white = "Congratulations, you have killed a ".. script.name .." and you gained ".. rep_for_whiteskull .." reputation points" -- Standard message for killing player with white skull you can edit this.
local msg_red = "Congratulations, you have killed a ".. script.name .." and you gained ".. rep_for_redskull .." reputation points" -- Standard message for killing player with red skull you can edit this.
local msg_black = "Congratulations, you have killed a ".. script.name .." and you gained ".. rep_for_blackskull .." reputation points" -- Standard message for killing player with black skull you can edit this.

-- Script --
if(getPlayerStorageValue(cid,999) >= how -1) then
		setPlayerStorageValue(cid, 666,script.killed + 1)
		doPlayerSendTextMessage(cid,22,msg_monster)
		setPlayerStorageValue(cid, 999,0)
		return TRUE
elseif(isMonster(target) == TRUE) then
		setPlayerStorageValue(cid, 999,script.how_check + 1)
		return TRUE
elseif(isPlayer(target) == TRUE) then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_player)
		doPlayerSendTextMessage(cid,22,msg_player)
		return TRUE
elseif(isPlayer(target) == TRUE) and skull_check == 3 then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_whiteskull)
		doPlayerSendTextMessage(cid,22,msg_white)
		return TRUE
elseif(isPlayer(target) == TRUE) and skull_check == 4 then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_redskull)
		doPlayerSendTextMessage(cid,22,msg_red)
		return TRUE
elseif(isPlayer(target) == TRUE) and skull_check == 5 then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_blackskull)
		doPlayerSendTextMessage(cid,22,msg_black)
		return TRUE
	end
end

Dont tested.

Version 5!!

Code:
function onKill(cid, target)
local script =
{
    name = getCreatureName(target), -- Do not edit.
    how_check = getPlayerStorageValue(cid,999), -- Do not edit.
	killed = getPlayerStorageValue(cid,666), -- Do not edit.
	skull_check = getCreatureSkullType(target), -- Do not edit.
} 
-- Config --
local storage = 666 -- Storage value of the script.
local how = 3 -- How many monsters need to get reput point.
local rep_for_monster = 1 -- How many reputation give for kill monster.
local rep_for_player = 5 -- How many reputation give for kill player without skull.
local rep_for_whiteskull = 10 -- How many reputation give for kill player with white skull.
local rep_for_redskull = 15 -- How many reputation give for kill player with red skull.
local rep_for_blackskull = 20 -- How many reputation give for kill player with black skull.
local msg = "You have now ".. script.killed .." points."
local msg_monster = "Congratulations, you have slained ".. how .." monsters and you gained ".. rep_for_monster.." reputation point." -- Standard message for killing monster you can edit this.
local msg_player = "Congratulations, you have killed a ".. script.name .." and you gained ".. rep_for_player .." reputation points." -- Standard message for killing player without skull you can edit this.
local msg_white = "Congratulations, you have killed a ".. script.name .." and you gained ".. rep_for_whiteskull .." reputation points." -- Standard message for killing player with white skull you can edit this.
local msg_red = "Congratulations, you have killed a ".. script.name .." and you gained ".. rep_for_redskull .." reputation points." -- Standard message for killing player with red skull you can edit this.
local msg_black = "Congratulations, you have killed a ".. script.name .." and you gained ".. rep_for_blackskull .." reputation points." -- Standard message for killing player with black skull you can edit this.

-- Script --
if(getPlayerStorageValue(cid,999) >= how -1) then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_monster)
		doPlayerSendTextMessage(cid,23,msg_monster)
		doPlayerSendTextMessage(cid,23,msg)
		setPlayerStorageValue(cid, 999,0)
		return TRUE
elseif(isMonster(target) == TRUE) then
		setPlayerStorageValue(cid, 999,script.how_check + 1)
		return TRUE
elseif(isPlayer(target) == TRUE) then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_player)
		doPlayerSendTextMessage(cid,23,msg_player)
		doPlayerSendTextMessage(cid,23,msg)
		return TRUE
elseif(isPlayer(target) == TRUE) and skull_check == 3 then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_whiteskull)
		doPlayerSendTextMessage(cid,23,msg_white)
		doPlayerSendTextMessage(cid,23,msg)
		return TRUE
elseif(isPlayer(target) == TRUE) and skull_check == 4 then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_redskull)
		doPlayerSendTextMessage(cid,23,msg_red)
		doPlayerSendTextMessage(cid,23,msg)
		return TRUE
elseif(isPlayer(target) == TRUE) and skull_check == 5 then
		setPlayerStorageValue(cid, storage,script.killed + rep_for_blackskull)
		doPlayerSendTextMessage(cid,23,msg_black)
		doPlayerSendTextMessage(cid,23,msg)
		return TRUE
	end
end

Full working :)
 
Last edited:
As Guitar Freak suggested, could you redo it a bit? It would be nice to get rep points for killing certain monsters, like bosses and stuff. It could be very useful for some quests.
 
@up
Please test this
Code:
function onKill(cid, target)
-- Config --
local storage = 666 -- Storage value of the script.
local script =
{
    name = getCreatureName(target), -- Do not edit.
	killed = getPlayerStorageValue(cid,storage) -- Do not edit.
} 
local monsters = {'rat', 'cave rat'}
local rep = 1 -- How many reputation give for kill monster or boss.
local points = script.killed + 1
local msg = "You have now ".. points .." points."
local msg_monster = "Congratulations, you have killed a ".. script.name .." and you gained ".. rep_for_player .." reputation points." -- Standard message for killing monster you can edit this.

-- Script --
if getCreatureName(target) == monsters then
		setPlayerStorageValue(cid, storage,script.killed + rep)
		doPlayerSendTextMessage(cid,22,msg_monster)
		doPlayerSendTextMessage(cid,23,msg)
		return TRUE
	end
end
 
Back
Top