displayGuilds = displayTitles...

Runes of Magic/Radiant Arcana (http://www.runesofmagic.com)
Post Reply
Message
Author
User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

displayGuilds = displayTitles...

#1 Post by MiesterMan »

Ok, so I wrote this a while back and forgot about it. I dunno if you can find a use for it but it's changed now. This function used to display the guildnames of players and NPCs around. Now it displays the titles of players.

Code: Select all

local guild_ptr_offset = 0x298;

local function roundIt(_number)
	if _number > (math.floor(_number) + 0.5) then
		return math.ceil(_number);
	else
		return math.floor(_number);
	end
end

local function fixString(_string,_length)
	_string = _string:sub(1,_length);
	xTra = _length-_string:len();
	if xTra > 0 then
		for i=1,xTra do
		_string = _string .. " ";
		end
	end
	return _string;
end

function displayGuilds()
	local objectList = CObjectList();
	objectList:update();
	local objSize = objectList:size();
	cprintf(cli.yellow,"X\tZ\tY\tNPC Name                 Guild Name      Id     Address\n")
	cprintf(cli.yellow,"-\t-\t-\t--------                 ----------      --     -------\n")
	local lncolor,obj;
	for i = 0,objSize do 
		obj = objectList:getObject(i);
		obj.GuildName = memoryReadString(getProc(),memoryReadInt(getProc(), obj.Address + guild_ptr_offset))
		if obj.Guildobj.GuildName ~= "" then
			if (i == 0) or ((i / 2) == (math.floor(i/2))) then
				_lncolor = cli.lightgray;
			else
				_lncolor = cli.white;
			end
			cprintf(_lncolor,"%d",roundIt(obj.X));
			cprintf(_lncolor,"\t%d",roundIt(obj.Z));
			cprintf(_lncolor,"\t%d",roundIt(obj.Y));
			cprintf(_lncolor,"\t%s",fixString(obj.Name,24));
			cprintf(_lncolor," %s",fixString(obj.GuildName,15));
			cprintf(_lncolor," %s",fixString(tostring(obj.Id),7));
			cprintf(_lncolor,"%x\n",obj.Address);
		end
	end
end
I'm sure the new offset for guilds isn't too far off.
User avatar
MiesterMan
Posts: 543
Joined: Tue Jul 06, 2010 9:15 pm
Location: Between the Second and Third Circles of Hell

Re: displayGuilds = displayTitles...

#2 Post by MiesterMan »

lolz, yea, wasn't far off, + 4

The reason I wanted the guild offset before was in COO to complete the bag quests you needed to be able to differentiate the kinds of adventurers in static laforea.

neways, for this thread, if it's of interest for adding some info,

Code: Select all

pawnTitle_offset = 0x298
pawnGuild_offset = 0x29C
Post Reply