• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Looking for Respect System (8.54)

Permamently

New Member
Joined
Jul 23, 2015
Messages
34
Reaction score
3
Hello i'm looking for Respect System for TFS 0.3.6 8.54 it should work like: We have got skill Respect instead Axe Fighting and when we making quests, tasks etc this skill goes up.

Sorry for bad english.
 
Code:
doCreatureSetStorage(cid, 45001, getCreatureStorage(cid, 45001) + 1) -- Finds current value and add's +1 to it.
doPlayerSetStorageValue(uid, key, newValue) -- creaturestorage might be a compat. You can replace with player storage.
Code:
if msgcontains(msg, "quest") and (getPlayerStorageValue(cid,45001) < 1) then
if msgcontains(msg, "quest") and (getPlayerStorageValue(cid,45001) == 1) then
if msgcontains(msg, "quest") and (getPlayerStorageValue(cid,45001) == 2) then
Is this what your wanting?
 
Depends how you want to script it.

Create a login event to give all players storage value 45001, 0.
Use ""doCreatureSetStorage(cid, 45001, getCreatureStorage(cid, 45001) + 1)"" in any quest that gives a player more 'respect'.
Use a check to see if a player has enough 'respect' for whatever your looking to do.

Player needs 20 respect to talk to the Imperial Guards.
Complete random missions around town to gain respect.
Any missions completed by imperial guards gain double respect points.
Once respect is 60+ you may talk with the Magistrate.
Once 150+ you can speak with The King.
If your respect is above 50, you get reduced boat fares/ potions cheaper/ shops in general cheaper.

Literally just script it however you want.
Whenever you reward the player, just give them more respect at the same time.
You could make a simple talkaction to allow players to see their current 'respect'.

Anyways,

Cheers,


Xikini
 
Well you just need to incorporate this into your existing scripts.
Wherever it gives the reward simply add the 'reputation' as another line there.
When I get home I'll give you a couple of examples.
 
Last edited by a moderator:
Alright, imagine you have a simple chest script like below.
Code:
<action actionid="45001" event="script" value="simple_simple_chest.lua"/>
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if getPlayerStorageValue(cid, 45002) < 1 then
     doPlayerAddItem(cid, 2520, 1)
     setPlayerStorageValue(cid, 45001, 2)
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a ".. getItemNameById(2520) ..".")
   else
     return doPlayerSendCancel(cid, "The chest is empty.")
   end
   return true
end
------
You would want to change it like this..

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
   if getPlayerStorageValue(cid, 45002) < 1 then
     -- this is the reward part
     doPlayerAddItem(cid, 2520, 1)
     setPlayerStorageValue(cid, 45002, 1)
     -- doCreatureSetStorage(cid, 45001, getCreatureStorage(cid, 45001) + 1)
     doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a ".. getItemNameById(2520) ..".")
     -- add it anywhere inside here
   else
     return doPlayerSendCancel(cid, "The chest is empty.")
   end
   return true
end
--------
Here's a simple talkaction to check the player current reputation.

Code:
<talkaction words="!rep" event="script" value="reputation.lua"/>
Code:
function onSay(cid, words, param, channel)
   doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have " ..  getPlayerStorageValue(cid, 45001) .. " reputation.")
   return true
end
-------
and a quick login script.. (to ensure the talkaction shows the correct reputation.(As all player normally start with -1 as the default storage value.))
(creaturescripts)

Code:
<event type="login" name="SetDefaultReputation" script="set_default_reputation.lua"/>
Code:
function onLogin(cid)
   if getPlayerStorageValue(cid, 45001) < 0 then
     setPlayerStorageValue(cid, 45001, 0)
   end
   return true
end
login.lua
Code:
registerCreatureEvent(cid, "SetDefaultReputation")
 
Back
Top