#230 (neatz) need a GiveTitle function to work on items/quests

已关闭
image3 年之前创建 · 1 条评论
image 评论于 3 年之前

SQL Updates:

update commands set handler=286 where command='title' and subcommand='list';
update commands set handler=287 where command='title' and subcommand='setprefix';
update commands set handler=288 where command='title' and subcommand='setsuffix';
update commands set handler=289 where command='title' and subcommand='fix';
alter table character_details modify column prefix_title int(10) not null default -1;
alter table character_details modify column suffix_title int(10) not null default -1;

New LUA Functions:

AddMasterTitle(titleName, isPrefix) -- adds a new title all characters can use, isPrefix is 0 or 1, 1 for prefix, 0 for suffix
- returns master title id (sint32) -- if the title already exists, then it re-uses that id

AddCharacterTitle(Spawn, titleName) -- adds a character title to a spawn if not already present

- returns character title index id (sint32)

SetCharacterTitleSuffix(Spawn, titleName) -- sets the players suffix name, must have title already, otherwise AddCharacterTitle needs to be called first
SetCharacterTitlePrefix(Spawn, titleName) -- sets the players suffix name, must have title already, otherwise AddCharacterTitle needs to be called first

ResetCharacterTitleSuffix(Spawn) - empties title suffix
ResetCharacterTitlePrefix(Spawn) - empties title prefix
SQL Updates: ``` update commands set handler=286 where command='title' and subcommand='list'; update commands set handler=287 where command='title' and subcommand='setprefix'; update commands set handler=288 where command='title' and subcommand='setsuffix'; update commands set handler=289 where command='title' and subcommand='fix'; alter table character_details modify column prefix_title int(10) not null default -1; alter table character_details modify column suffix_title int(10) not null default -1; ``` New LUA Functions: ``` AddMasterTitle(titleName, isPrefix) -- adds a new title all characters can use, isPrefix is 0 or 1, 1 for prefix, 0 for suffix - returns master title id (sint32) -- if the title already exists, then it re-uses that id AddCharacterTitle(Spawn, titleName) -- adds a character title to a spawn if not already present - returns character title index id (sint32) SetCharacterTitleSuffix(Spawn, titleName) -- sets the players suffix name, must have title already, otherwise AddCharacterTitle needs to be called first SetCharacterTitlePrefix(Spawn, titleName) -- sets the players suffix name, must have title already, otherwise AddCharacterTitle needs to be called first ResetCharacterTitleSuffix(Spawn) - empties title suffix ResetCharacterTitlePrefix(Spawn) - empties title prefix ```
image 评论于 3 年之前
协作者

As an example this adds the prefix 'Developer' title to the player Spawn, then sets it as the active prefix, already an existing title in the database.

	AddCharacterTitle(Spawn, "Developer") -- adds to character_titles
	SetCharacterTitlePrefix(Spawn, "Developer") -- updates character_details
As an example this adds the prefix 'Developer' title to the player Spawn, then sets it as the active prefix, already an existing title in the database. ``` AddCharacterTitle(Spawn, "Developer") -- adds to character_titles SetCharacterTitlePrefix(Spawn, "Developer") -- updates character_details ```
image3 年之前 关闭
登录 并参与到对话中。
正在加载...
取消
保存
这个人很懒,什么都没留下。