• 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.

TalkAction (6.1) Cyber's REPSystem w/Opinion Points for 0.4 && mAAC

Is this the best reputation system?

  • Yes.

    Votes: 131 66.2%
  • No.

    Votes: 30 15.2%
  • It's good but can be improved.

    Votes: 37 18.7%

  • Total voters
    198
  • Poll closed .
Status
Not open for further replies.
I dont have that reputation window on my webpage i use
gesior aac 0.3.8
i installed the script and query without having errors, any solution?
 
Yes, use Modern AAC ;d
thread shall be opened once rev0.7 is ready for both tfs 0.3.6 & 0.4_DEV versions
 
can anyone tell me how i change spells To Rep in my website?? i mean the icon name
 
Error at globalevents/shop.lua:
I've put
Code:
domodlib('repSystem')
at the top of shop.lua and followed every step at first post.
Code:
[10/07/2011 17:33:19] [Error - GlobalEvent Interface] 
[10/07/2011 17:33:19] data/globalevents/scripts/shop.lua:onThink
[10/07/2011 17:33:19] Description: 
[10/07/2011 17:33:19] data/globalevents/scripts/shop.lua:60: attempt to index global 'rep' (a nil value)
[10/07/2011 17:33:19] stack traceback:
[10/07/2011 17:33:19] 	data/globalevents/scripts/shop.lua:60: in function <data/globalevents/scripts/shop.lua:8>
[10/07/2011 17:33:19] [Error - GlobalEvents::think] Couldn't execute event: shop

EDIT: Fixed, I put domodlib('repSystem') under the first function...
 
Last edited:
look i have a problem with images

problem.jpg

FIXED

other problem.
PHP:
[10/07/2011 16:59:02] [Error - Action Interface] 
[10/07/2011 16:59:02] data/actions/scripts/quests/system.lua:onUse
[10/07/2011 16:59:02] Description: 
[10/07/2011 16:59:02] data/actions/scripts/quests/system.lua:98: attempt to index global 'rep' (a nil value)
[10/07/2011 16:59:02] stack traceback:
[10/07/2011 16:59:02] 	data/actions/scripts/quests/system.lua:98: in function <data/actions/scripts/quests/system.lua:10>
 
Last edited:
PHP:
[10/07/2011 16:59:02] [Error - Action Interface] 
[10/07/2011 16:59:02] data/actions/scripts/quests/system.lua:onUse
[10/07/2011 16:59:02] Description: 
[10/07/2011 16:59:02] data/actions/scripts/quests/system.lua:98: attempt to index global 'rep' (a nil value)
[10/07/2011 16:59:02] stack traceback:
[10/07/2011 16:59:02] 	data/actions/scripts/quests/system.lua:98: in function <data/actions/scripts/quests/system.lua:10>

Set the domodlib('repSystem') under the first function...
 
PHP:
domodlib('repSystem')
local specialQuests = {
	[2001] = 30015 --Annihilator
}

local questsExperience = {
	[30015] = 10000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF, cid)
		return true
	end

	local storage = specialQuests[item.actionid]
	if(not storage) then
		storage = item.uid
		if(storage > 65535) then
			return false
		end
	end

	if(getPlayerStorageValue(cid, storage) > 0) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		return true
	end

	local items = {}
	local reward = 0

	local size = isContainer(item.uid) and getContainerSize(item.uid) or 0
	if(size == 0) then
		reward = doCopyItem(item, false)
	else
		for i = 0, size do
			local tmp = getContainerItem(item.uid, i)
			if(tmp.itemid > 0) then
				table.insert(items, tmp)
			end
		end
	end

	size = table.maxn(items)
	if(size == 1) then
		reward = doCopyItem(items[1], true)
	end

	local result = ""
	if(reward ~= 0) then
		local ret = getItemDescriptions(reward.uid)
		if(reward.type > 0 and isItemRune(reward.itemid)) then
			result = reward.type .. " charges " .. ret.name
		elseif(reward.type > 0 and isItemStackable(reward.itemid)) then
			result = reward.type .. " " .. ret.plural
		else
			result = ret.article .. " " .. ret.name
		end
	else
		if(size > 20) then
			reward = doCopyItem(item, false)
		elseif(size > 8) then
			reward = getThing(doCreateItemEx(1988, 1))
		else
			reward = getThing(doCreateItemEx(1987, 1))
		end

		for i = 1, size do
			local tmp = doCopyItem(items[i], true)
			if(doAddContainerItemEx(reward.uid, tmp.uid) ~= RETURNVALUE_NOERROR) then
				print("[Warning] QuestSystem:", "Could not add quest reward")
			else
				local ret = ", "
				if(i == 2) then
					ret = " and "
				elseif(i == 1) then
					ret = ""
				end

				result = result .. ret
				ret = getItemDescriptions(tmp.uid)
				if(tmp.type > 0 and isItemRune(tmp.itemid)) then
					result = result .. tmp.type .. " charges " .. ret.name
				elseif(tmp.type > 0 and isItemStackable(tmp.itemid)) then
					result = result .. tmp.type .. " " .. ret.plural
				else
					result = result .. ret.article .. " " .. ret.name
				end
			end
		end
	end

	if(doPlayerAddItemEx(cid, reward.uid, false) ~= RETURNVALUE_NOERROR) then
		result = "You have found a reward weighing " .. getItemWeight(reward.uid) .. " oz. It is too heavy or you have not enough space."
	else
		result = "You have found " .. result .. "."
		setPlayerStorageValue(cid, storage, 1)
                rep.add(cid, 5
		if(questsExperience[storage] ~= nil) then
			doPlayerAddExp(cid, questsExperience[storage])
			doSendAnimatedText(getCreaturePosition(cid), questsExperience[storage], TEXTCOLOR_WHITE)
		end
	end

	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, result)
	return true
end

look
 
PHP:
domodlib('repSystem')
local specialQuests = {
	[2001] = 30015 --Annihilator
}

local questsExperience = {
	[30015] = 10000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF, cid)
		return true
	end

	local storage = specialQuests[item.actionid]
	if(not storage) then
		storage = item.uid
		if(storage > 65535) then
			return false
		end
	end

	if(getPlayerStorageValue(cid, storage) > 0) then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
		return true
	end

	local items = {}
	local reward = 0

	local size = isContainer(item.uid) and getContainerSize(item.uid) or 0
	if(size == 0) then
		reward = doCopyItem(item, false)
	else
		for i = 0, size do
			local tmp = getContainerItem(item.uid, i)
			if(tmp.itemid > 0) then
				table.insert(items, tmp)
			end
		end
	end

	size = table.maxn(items)
	if(size == 1) then
		reward = doCopyItem(items[1], true)
	end

	local result = ""
	if(reward ~= 0) then
		local ret = getItemDescriptions(reward.uid)
		if(reward.type > 0 and isItemRune(reward.itemid)) then
			result = reward.type .. " charges " .. ret.name
		elseif(reward.type > 0 and isItemStackable(reward.itemid)) then
			result = reward.type .. " " .. ret.plural
		else
			result = ret.article .. " " .. ret.name
		end
	else
		if(size > 20) then
			reward = doCopyItem(item, false)
		elseif(size > 8) then
			reward = getThing(doCreateItemEx(1988, 1))
		else
			reward = getThing(doCreateItemEx(1987, 1))
		end

		for i = 1, size do
			local tmp = doCopyItem(items[i], true)
			if(doAddContainerItemEx(reward.uid, tmp.uid) ~= RETURNVALUE_NOERROR) then
				print("[Warning] QuestSystem:", "Could not add quest reward")
			else
				local ret = ", "
				if(i == 2) then
					ret = " and "
				elseif(i == 1) then
					ret = ""
				end

				result = result .. ret
				ret = getItemDescriptions(tmp.uid)
				if(tmp.type > 0 and isItemRune(tmp.itemid)) then
					result = result .. tmp.type .. " charges " .. ret.name
				elseif(tmp.type > 0 and isItemStackable(tmp.itemid)) then
					result = result .. tmp.type .. " " .. ret.plural
				else
					result = result .. ret.article .. " " .. ret.name
				end
			end
		end
	end

	if(doPlayerAddItemEx(cid, reward.uid, false) ~= RETURNVALUE_NOERROR) then
		result = "You have found a reward weighing " .. getItemWeight(reward.uid) .. " oz. It is too heavy or you have not enough space."
	else
		result = "You have found " .. result .. "."
		setPlayerStorageValue(cid, storage, 1)
                rep.add(cid, 5
		if(questsExperience[storage] ~= nil) then
			doPlayerAddExp(cid, questsExperience[storage])
			doSendAnimatedText(getCreaturePosition(cid), questsExperience[storage], TEXTCOLOR_WHITE)
		end
	end

	doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, result)
	return true
end

look

Lua:
local specialQuests = { 
    [2001] = 30015 --Annihilator 
} 

local questsExperience = { 
    [30015] = 10000 
} 

function onUse(cid, item, fromPosition, itemEx, toPosition) 
domodlib('repSystem') 
    if(getPlayerCustomFlagValue(cid, PLAYERCUSTOMFLAG_GAMEMASTERPRIVILEGES)) then 
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF, cid) 
        return true 
    end 

    local storage = specialQuests[item.actionid] 
    if(not storage) then 
        storage = item.uid 
        if(storage > 65535) then 
            return false 
        end 
    end 

    if(getPlayerStorageValue(cid, storage) > 0) then 
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.") 
        return true 
    end 

    local items = {} 
    local reward = 0 

    local size = isContainer(item.uid) and getContainerSize(item.uid) or 0 
    if(size == 0) then 
        reward = doCopyItem(item, false) 
    else 
        for i = 0, size do 
            local tmp = getContainerItem(item.uid, i) 
            if(tmp.itemid > 0) then 
                table.insert(items, tmp) 
            end 
        end 
    end 

    size = table.maxn(items) 
    if(size == 1) then 
        reward = doCopyItem(items[1], true) 
    end 

    local result = "" 
    if(reward ~= 0) then 
        local ret = getItemDescriptions(reward.uid) 
        if(reward.type > 0 and isItemRune(reward.itemid)) then 
            result = reward.type .. " charges " .. ret.name 
        elseif(reward.type > 0 and isItemStackable(reward.itemid)) then 
            result = reward.type .. " " .. ret.plural 
        else 
            result = ret.article .. " " .. ret.name 
        end 
    else 
        if(size > 20) then 
            reward = doCopyItem(item, false) 
        elseif(size > 8) then 
            reward = getThing(doCreateItemEx(1988, 1)) 
        else 
            reward = getThing(doCreateItemEx(1987, 1)) 
        end 

        for i = 1, size do 
            local tmp = doCopyItem(items[i], true) 
            if(doAddContainerItemEx(reward.uid, tmp.uid) ~= RETURNVALUE_NOERROR) then 
                print("[Warning] QuestSystem:", "Could not add quest reward") 
            else 
                local ret = ", " 
                if(i == 2) then 
                    ret = " and " 
                elseif(i == 1) then 
                    ret = "" 
                end 

                result = result .. ret 
                ret = getItemDescriptions(tmp.uid) 
                if(tmp.type > 0 and isItemRune(tmp.itemid)) then 
                    result = result .. tmp.type .. " charges " .. ret.name 
                elseif(tmp.type > 0 and isItemStackable(tmp.itemid)) then 
                    result = result .. tmp.type .. " " .. ret.plural 
                else 
                    result = result .. ret.article .. " " .. ret.name 
                end 
            end 
        end 
    end 

    if(doPlayerAddItemEx(cid, reward.uid, false) ~= RETURNVALUE_NOERROR) then 
        result = "You have found a reward weighing " .. getItemWeight(reward.uid) .. " oz. It is too heavy or you have not enough space." 
    else 
        result = "You have found " .. result .. "." 
        setPlayerStorageValue(cid, storage, 1) 
                rep.add(cid, 5 
        if(questsExperience[storage] ~= nil) then 
            doPlayerAddExp(cid, questsExperience[storage]) 
            doSendAnimatedText(getCreaturePosition(cid), questsExperience[storage], TEXTCOLOR_WHITE) 
        end 
    end 

    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, result) 
    return true 
end
 
this happens when I kill any creature in the game.
the error is on while I'm in the game.
look pic:
error.jpg
Error:
PHP:
[12/07/2011 16:50:46] [Error - CreatureScript Interface] 
[12/07/2011 16:50:46] buffer:onKill
[12/07/2011 16:50:46] Description: 
[12/07/2011 16:50:46] (internalGetPlayerInfo) Player not found when requesting player info #3

[12/07/2011 16:50:46] [Error - CreatureScript Interface] 
[12/07/2011 16:50:46] buffer:onKill
[12/07/2011 16:50:46] Description: 
[12/07/2011 16:50:46] [string "loadBuffer"]:12: attempt to compare number with boolean
[12/07/2011 16:50:46] stack traceback:
[12/07/2011 16:50:46] 	[string "loadBuffer"]:12: in function <[string "loadBuffer"]:9>
 
Last edited:
yes I'm getting a similar problem when killing a monster.
Seems to be in newer revs. I have tryed it with TFSrev4389 and TFSrev4440 and I'm getting this server crashes after anyone kills a monster... If I remove the rep.xml from the mod folder everything works, so it must be this mod, hope you can fix it, I really like this system
 
Last edited:


HTML:
[14/07/2011 15:09:04] The Forgotten Server, version 0.4.0 (Crying Damson)
[14/07/2011 15:09:04] Compiled with GNU C++ version 3.4.5 (mingw special) at Jul 27 2010, 10:22:28.
[14/07/2011 15:09:04] A server developed by Cykotitan, Chev and fireelement.
[14/07/2011 15:09:04] Visit our forum for updates, support and resources: http://xtibia.com.
 
Status
Not open for further replies.
Back
Top