Forum > Tutorials
[Tutorial][TC2Core] - Scale system + Morph system
(1/4) > >>
glararan:
Hi, it's too many long how i code it for my RP project, but i want to give you too this code.
So. 1)Open Player.cpp 2)Find - InitDisplayIds(); 3)Replace it with: [spoiler:xb4yxe79]// Morph system QueryResult result2 = CharacterDatabase.PQuery("SELECT morph FROM character_morph WHERE guid = %u", fields[0].GetUInt32()); if(result2) { Field *fields2 = result2->Fetch(); SetNativeDisplayId(fields2[0].GetUInt32()); SetDisplayId(fields2[0].GetUInt32()); } else InitDisplayIds();
// Scale system QueryResult result3 = CharacterDatabase.PQuery("SELECT scale FROM character_scale WHERE guid = %u", fields[0].GetFloat()); if(result3) { Field* fields3; fields3 = result3->Fetch(); float Scale; Scale = fields3[0].GetFloat(); SetFloatValue(OBJECT_FIELD_SCALE_X, Scale); } else { CharacterDatabase.PExecute("INSERT INTO character_scale VALUES (%u, 1, [CORE] - Basic Scale)", GetGUID());[/spoiler:xb4yxe79]
4)Save 5)Open CharacterDatabase 6)Insert: [spoiler:xb4yxe79]SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for character_morph -- ---------------------------- CREATE TABLE `character_morph` ( `guid` int(11) NOT NULL DEFAULT '0', `morph` int(11) DEFAULT NULL, PRIMARY KEY (`guid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- ---------------------------- -- Table structure for character_scale -- ---------------------------- CREATE TABLE `character_scale` ( `guid` int(11) NOT NULL, `scale` float NOT NULL, `comment` text, PRIMARY KEY (`guid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;[/spoiler:xb4yxe79]
7)Compile 8)ENJOY!
How to add scale or morph? 1)Open table of scale or morph 2)Add guid of character 3)Add scale or morph(DisplayID)
Zim4ik:
Does morph works after relogin?
glararan:
Of Course...its perma morph....if you login you have morph or scale, if you delete morph you have normal morph of your char.
Zim4ik:
WoW!!! You really help me) Thank You)
Mr.Patcher:
Very ty ^^
Navigation
[0] Message Index
[#] Next page
|