This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Roarl

Pages: [1]
1
"Retro-Porting" / [RELEASE] [WotLk] WoD npc models for WoTLK + textures
« on: December 22, 2015, 01:39:27 pm »


       Greetings folks! :D

Some of you were puzzled about the contents of this release so let me explain this more clearly.

This file contains WoD npc models and textures for WoTLK. This is for Humans, Kaldorei, Gnomes, Dwarves, Orcs, Trolls, Taurens and Scourge.
 Draenei and Sin'dorei are NOT included.

Did I just say npc models? Yes sir, these textures are the same as in Draenor. I didn't adapt them to WoTLK. DON'T HIT ME YET, read on please. I rather found easier to seperate the npc and the player models so that I could adapt the npc UV mapping to fit Draenor textures. Time-wise this is much more efficient than generating all the BakedNPCTextures for WoTLK.


So, let's recap :

Patch-5.MPQ contains

   
  • Npc models + textures (cfr. supported races above)
       
  • Animations for the models
       
  • BakedNPCTextures for the models

Patch-5.MPQ does NOT contain

   
  • Any dbc file
       
  • Hentai
       
  • Popcorn

Download : here

If you have questions/requests, there is some chance that you will find an appropriate answer in the FAQ below. Nonetheless, if your question doesn't appear in the FAQ feel free to ask it in the comments / by PM, I will answer it as soon as possible.

Be well and Merry Christmas.

Don't forget to unwrap your Christmas gift!


FAQ



"I already have those textures, please don't make me download them all again"
Do not worry dear friend, there is a separate download for you, you shall not have to go through this ordeal. You can find it right HERE.

     

"I have no clue on how to separate npc and player models"
Not so hard, see for yourself :
  • Open CreatureModelData.dbc.
  • You will find the models currently used for both players and creatures at rows 49 to 60.
  • For these, replace the model name (third row) by the names of the npc models provided in the patch ("CharacterHumanMaleHumanMale_npc.mdx" for instance). Once you have achieved that for every row (49-60), proceed to the next step.
  • Copy the same rows (all of them) to veeeery high entries (they don't have to be that high, let's just say higher than 3440).
  • Change the model names of the latter rows so that it fits the name of the HD model you are using for players ( E.G. "CharacterHumanMaleHumanMale_hd.mdx" )
  • Jot down the entries of these newly created rows, then save (make very sure you did it) and close the dbc file.
  • Open CreatureDisplayInfo.dbc.
  • Replace the number in the second column of rows 49-60 by the entries you noted down two steps ago (IN ORDER).
  • Done!

     

"I don't know what is a dbc file"

Holy Moses, really? Well son, you might want to learn a bit more about dbc files before you use this.

So let's get down to the brass tacks... From pxr.dk, "DBC (DataBaseClient) files are clientside databases containing data about items, NPCs, environment, world and a lot more". There are several ways of editing them, one of those being using MyDBCEditor.

     

"I downloaded your patch but I can't see any difference in-game"
Erm... yeah actually this is quite normal you first need to edit the proper .dbc files. In particular : CreatureModelData.dbc, CreatureModelInfo.dbc and CharSections.dbc.


"If your patch doesn't provide popcorn/hentai, where can I find some?"
Foremost, let us consider popcorn. Popcorn is very easy to prepare. Just go to your local grocery, buy some raw corn and once you get back home, prepare a pan (and a lid if you have no intension of getting your eye put out). Split up the raw corn then cook it in the pan on medium to high heat. After some time, you shall hear the sound of corn popping (tons of fun heh?). Wait until you hear it no more and TADAA the popcorn is ready for you to dust it with (icing) sugar and eat it. Bon appétit.


Now, as far as hentai is concerned, I can only recommand the HentaiFoundry.

2
Hi guys,

I've been using Draenor character models for 3.3.5 for every race, and since then some capes render really strange.

For instance, Drape of the Messenger just below, before and after using the WoD Models.

BEFORE


AFTER


Does anyone have any idea why this is happening? :)

Thanks already for your patience.

3
Hi guys,

I've been manually creating textures files for blood elves and high elves WoD models in WotLK.
It works flawlessly but well.... Making these textures is REEAALLLY time-consuming!



So I've been wondering... Isn't there a faster way to do this? LIke... in WMV7, you could just EXPORT the textures, which literally took 1 second.
Isn't there another program like WMV7 which works for Draenor and could output these textures?

Thanks a bunch for your help! :)

4
Miscellaneous / [SOLVED] In which DBC are mount sounds defined?
« on: November 17, 2015, 10:46:38 pm »
Hi everyone,

A very short and precise question :
In which DBC are mount sounds defined?

I mean, I added a custom mount in spell.dbc, works allright...
But it doesn't make any sound while at rest or moving...

So I went into creaturemodeldata.dbc to check how things worked for the chopper (iD 2862), saw it was linked to ID 2694 in CreatureSoundData.dbc and... Well it's a dratting dead end : EVERY column of this row is 0.
Not feeling discouraged yet, I still create a row in the latter DBC for my custom mount, fill SoundStandID and SoundFootstepID with references to two rows in SoundEntries.dbc and still no sound in-game.

Rows created in SoundEntries.dbc
Code: [Select]
18031,27,"SubaruImpreza-Standing","Standing.mp3","","","","","","","","","",1,1,1,1,1,1,1,1,1,1,"SoundCreatureSubaruImpreza",1.79999995232,0x0,7.0,30.0,0x0,0,
18032,27,"SubaruImpreza-Driving","Driving.mp3","","","","","","","","","",1,1,1,1,1,1,1,1,1,1,"SoundCreatureSubaruImpreza",1.79999995232,0x0,7.0,30.0,0x0,0,

Rows Created in CreatureSoundData.dbc
Code: [Select]
3109,0,0,0,0,,0,0,18031,18032,0,0,0,0,0,0,0,0,0,0,0,0x0,0x0,,0,0,0,0,0,0,0,0.0,0.0,0,0,0,0,0,

Of course, I did set the SoundData field of my custom mount's creaturemodeldata.dbc row to 3109.

Would someone bother telling me what I am doing wrong, pretty please?  =3 *pouts*

Regards.

UPDATE :
  • Tried setting the SoundData field of CreatureModelData.dbc to 2694 (same as Mekgineer's Chopper) didn't change anything in-game
  • Tried using all the same flags as Mekgineer's Chopper for my mount in creature_template (well, I now see the HUD of the chopper in the upper-left corner, as would be expected, but still no sound)

5
Texturing and 2D Art / [SOLVED] Custom minimap not appearing
« on: November 14, 2015, 07:49:19 pm »
Hi folks,

I followed Steff's minimap tut (very helpful btw!! :D) and... well as the title says it's not working, the minimap stays transparent... :/

So basically :
  • I did use tabs in md5translate.trs
  • I did put the md5translate.trs file and all the blp's in Textures/Minimap
  • I did make sure I used 256x256 textures which I converted with BLPConverter6
  • I also tried renaming "map2_2.blp" into "map2_02.blp" as Will mentioned at the last page of the tutorial thread, and I even moved all my adt's from [2;2]->[7,7] to [19; 13]->[24;18] to make sure it wasn't because I had only one figure per coordinate in my adt file names
  • Finally, I did sort the "dir:" list in alphabetical order

Here's my modification to md5translate.trs :
Code: [Select]
dir: Ashael
Ashaelmap19_13.blp Ashael22.blp
Ashaelmap19_14.blp Ashael23.blp
Ashaelmap19_15.blp Ashael24.blp
Ashaelmap19_16.blp Ashael25.blp
Ashaelmap19_17.blp Ashael26.blp
Ashaelmap19_18.blp Ashael27.blp
Ashaelmap20_13.blp Ashael32.blp
Ashaelmap20_14.blp Ashael33.blp
Ashaelmap20_15.blp Ashael34.blp
Ashaelmap20_16.blp Ashael35.blp
Ashaelmap20_17.blp Ashael36.blp
Ashaelmap20_18.blp Ashael37.blp
Ashaelmap21_13.blp Ashael42.blp
Ashaelmap21_14.blp Ashael43.blp
Ashaelmap21_15.blp Ashael44.blp
Ashaelmap21_16.blp Ashael45.blp
Ashaelmap21_17.blp Ashael46.blp
Ashaelmap21_18.blp Ashael47.blp
Ashaelmap22_13.blp Ashael52.blp
Ashaelmap22_14.blp Ashael53.blp
Ashaelmap22_15.blp Ashael54.blp
Ashaelmap22_16.blp Ashael55.blp
Ashaelmap22_17.blp Ashael56.blp
Ashaelmap22_18.blp Ashael57.blp
Ashaelmap23_13.blp Ashael62.blp
Ashaelmap23_14.blp Ashael63.blp
Ashaelmap23_15.blp Ashael64.blp
Ashaelmap23_16.blp Ashael65.blp
Ashaelmap23_17.blp Ashael66.blp
Ashaelmap23_18.blp Ashael67.blp
Ashaelmap24_13.blp Ashael67.blp
Ashaelmap24_14.blp Ashael73.blp
Ashaelmap24_15.blp Ashael74.blp
Ashaelmap24_16.blp Ashael75.blp
Ashaelmap24_17.blp Ashael76.blp
Ashaelmap24_18.blp Ashael77.blp
Does anyone have any idea why this is happening?

Thank you in advance for your time and consideration! :D

6
Serverside Modding / [RELEASE:WotlK] [C++] Stockmarket NPC
« on: November 12, 2015, 03:06:45 pm »
Hi guys!

Took me some time to post this because I couldn't find any fan for my laptop.... But I did some days ago so... Here you go!

As I said before, I acknowledge this is not much. But I just wanna play my part in Modcraft  as best as I can even if it doesn't mean a lot. :)

First you will need the tables and rows which the script uses : SQL File

Then the Creature Script : StockExchange.cpp
Code: [Select]
/*
1.0.0
StockExchange NPC Script

Description
-----------
The script uses data from DB to define 5 different stocks (Name, Worth (in gold coins), Scale (scale of the stock's variations), OwnedRatio(so that players can't acquire more than its worth)).
Players can buy and sell shares of those stocks, provided they have bought a licence first.



*/

#include "ScriptPCH.h"
#include "Config.h"
#include "ScriptedCreature.h"
#include "Language.h"
#include "time.h"

#define STOCKNUMBER 5
#define GOLDTOCOPPER 10000

namespace
{
class CS_StockExchange : public CreatureScript
{
public:
CS_StockExchange() : CreatureScript("Creature_StockExchange") { }

uint32 stock = 0;
void OnPlayerTextEmote(Player* player, uint32 textEmote, uint32 emoteNum, ObjectGuid guid) override
{

}

bool OnGossipHello(Player* plr, Creature* creature) override //MAIN MENU
{
//StockUpdate every 2 minutes
QueryResult result = WorldDatabase.PQuery("SELECT `UpdateTime`   FROM `stocks` WHERE iD = 0");
if (!result)
return false;
Field* field = result->Fetch();
uint32 stockPrevTime = field[0].GetUInt32();
uint32 realCurrTime = getMSTime();
uint32 stockDiff = getMSTimeDiff(stockPrevTime, realCurrTime);
if (stockDiff >= 120000)
{
uint32 timeMult;
timeMult = stockDiff / 120000;
if (StockUpdate(timeMult))
TC_LOG_INFO("server.worldserver", "Stocks have been updated (%u)", realCurrTime);
else
{
TC_LOG_INFO("server.worldserver", "Error while updating stocks...");
}
stockPrevTime = realCurrTime;
WorldDatabase.PExecute("UPDATE `stocks` SET `UpdateTime` = %u WHERE `iD` = 0", getMSTime());
}

WorldSession* session = plr->GetSession();
QueryResult licencetest = CharacterDatabase.PQuery("SELECT `1`, `2`, `3`, `4`, `5`  FROM `character_stockdata` WHERE iD = %u", plr->GetGUIDLow());
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Scroll_08:30:30:-18:0|tWhat are the current exchange rates?", GOSSIP_SENDER_MAIN, 2);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Book_11:30:30:-18:0|tHow many unsold shares are there left?", GOSSIP_SENDER_MAIN, 1);
if (!licencetest)
{
plr->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_MISC_NOTE_02:30:30:-18:0|tI'd like to acquire a trade licence.", GOSSIP_SENDER_MAIN, 12, "This will cost you", 400000, false);
}
else //Player can invest if he has a licence
{
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Coin_02:30:30:-18:0|tI'd like to manage my portfolio.", GOSSIP_SENDER_MAIN, 3);
}
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tIt was a pleasure to make business with you.", GOSSIP_SENDER_MAIN, 4);
plr->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
return true;
}

bool OnGossipSelect(Player* plr, Creature* creature, uint32 sender, uint32 uiAction) override
{

int32 amount = 0;
plr->PlayerTalkClass->ClearMenus();
WorldSession* session = plr->GetSession();
std::ostringstream message;
float ownedratio[5];
int worth[5];
for (int iter = 1; iter < 6; iter++)
{
QueryResult result = WorldDatabase.PQuery("SELECT `OwnedRatio`,`Worth`   FROM `stocks` WHERE iD = %u", iter);
if (!result)
return false;
Field* field = result->Fetch();
ownedratio[iter-1]= field[0].GetFloat();
worth[iter-1] = field[1].GetInt32();
}
switch (uiAction)
{
case 1: //REMAINING SHARES
message << "REMAINING SHARES (in gold coins)$BRavenholdt Manor : " << worth[0] * (1 - ownedratio[0]) << "$BBloodsail : " << worth[1] * (1 - ownedratio[1]) << "$BSteamwheedle Cartel : " << worth[2] * (1 - ownedratio[2]) << "$BTheramore Silk Traders : " << worth[3] * (1 - ownedratio[3]) << "$BEldoar'norore : " << worth[4] * (1 - ownedratio[4]);
creature->Whisper(message.str(), LANG_UNIVERSAL, plr);
plr->PlayerTalkClass->SendCloseGossip();
OnGossipHello(plr, creature);
break;
case 2: //CURRENT EXCHANGE RATES
message << "CURRENT EXCHANGE RATES (in gold coins)$BRavenholdt Manor : " << worth[0] << "$BBloodsail : " << worth[1] << "$BSteamwheedle Cartel : " << worth[2] << "$BTheramore Silk Traders : " << worth[3] << "$BEldoar'norore : " << worth[4];
creature->Whisper(message.str(), LANG_UNIVERSAL, plr);
plr->PlayerTalkClass->SendCloseGossip();
OnGossipHello(plr, creature);
break;
case 3: //MANAGE PORTFOLIO MENU (5-10)
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Helmet_30:30:30:-18:0|tRavenholdt Manor", GOSSIP_SENDER_MAIN, 5);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Helmet_66:30:30:-18:0|tBloodsail", GOSSIP_SENDER_MAIN, 6);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Bomb_03:30:30:-18:0|tSteamwheedle Cartel", GOSSIP_SENDER_MAIN, 7);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Chest_Cloth_56:30:30:-18:0|tTheramore Silk Traders", GOSSIP_SENDER_MAIN, 8);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_FireDancer_01:30:30:-18:0|tEldoar'norore", GOSSIP_SENDER_MAIN, 9);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tBack", GOSSIP_SENDER_MAIN, 10);
plr->SEND_GOSSIP_MENU(50002, creature->GetGUID());
break;
case 4: //CLOSE GOSSIP
plr->PlayerTalkClass->SendCloseGossip();
break;
case 5: //MANAGE RAVENHOLDT STOCK
stock = 1;
plr->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Letter_03:30:30:-18:0|tBuy shares", stock, 0, "How much gold would you like to invest?", 0, true);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Coin_16:30:30:-18:0|tSell all shares", stock, 11);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tBack...", GOSSIP_SENDER_MAIN, 3);
plr->SEND_GOSSIP_MENU(50002, creature->GetGUID());
return true;
break;
case 6: //MANAGE BLOODSAIL STOCK
stock = 2;
plr->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Letter_03:30:30:-18:0|tBuy shares", stock, 0, "How much gold would you like to invest?", 0, true);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Coin_16:30:30:-18:0|tSell all shares", stock, 11);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tBack...", GOSSIP_SENDER_MAIN, 3);
plr->SEND_GOSSIP_MENU(50002, creature->GetGUID());
break;
case 7: //MANAGE GOBLIN STOCK
stock = 3;
plr->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Letter_03:30:30:-18:0|tBuy shares", stock, 0, "How much gold would you like to invest?", 0, true);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Coin_16:30:30:-18:0|tSell all shares", stock, 11);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tBack...", GOSSIP_SENDER_MAIN, 3);
plr->SEND_GOSSIP_MENU(50002, creature->GetGUID());
break;
case 8: //MANAGE SILKTRADERS STOCK
stock = 4;
plr->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Letter_03:30:30:-18:0|tBuy shares", stock, 0, "How much gold would you like to invest?", 0, true);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Coin_16:30:30:-18:0|tSell all shares", stock, 11);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tBack...", GOSSIP_SENDER_MAIN, 3);
plr->SEND_GOSSIP_MENU(50002, creature->GetGUID());
break;
case 9: //MANAGE ELDOAR'NORORE STOCK
stock = 5;
plr->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Letter_03:30:30:-18:0|tBuy shares", stock, 0, "How much gold would you like to invest?", 0, true);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Coin_16:30:30:-18:0|tSell all shares", stock, 11);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tBack...", GOSSIP_SENDER_MAIN, 3);
plr->SEND_GOSSIP_MENU(50002, creature->GetGUID());
return true;
break;
case 11: //TRANSACTION = SELL
if (!SellStock(plr, stock, creature))
plr->GetSession()->SendNotification("Error while selling shares... Please contact the administrator.");
else
{

}
plr->PlayerTalkClass->SendCloseGossip();
OnGossipHello(plr, creature);

break;
case 12: //CREATE PLAYER LICENCE ( = ROW IN CHARACTER_STOCKDATA )
if (plr->GetMoney() >= 40*GOLDTOCOPPER)
{
if (CreateLicence(plr))
{
amount = 40*GOLDTOCOPPER;
plr->ModifyMoney(-amount);
message << "Your licence has been acquired successfully, " << plr->GetName() << "!";
   creature->Say(message.str(), LANG_UNIVERSAL, plr);
}
else
plr->GetSession()->SendNotification("Error while registering your licence. Please contact the administrator.");
}
else
{
message << "I am afraid you do not have these 40 gold coins, " << plr->GetName() << "...";
creature->Say(message.str().c_str(), LANG_UNIVERSAL, plr);
}

plr->PlayerTalkClass->SendCloseGossip();
OnGossipHello(plr, creature);
break;
default:
OnGossipHello(plr, creature);
break;
}

return true;
}
bool OnGossipSelectCode(Player* plr, Creature* creature, uint32 stock, uint32 uiAction, const char* code) override
{
plr->PlayerTalkClass->ClearMenus();
std::ostringstream message;
int32 amount = 0;

std::string investment = code;
static const char* allowedcharacters = "1234567890";
if (!investment.length() || investment.find_first_not_of(allowedcharacters) != std::string::npos) //If investment was specified incorrectly
{
plr->GetSession()->SendNotification("Your investment bust be declared using figures.(0123456789)");
}
else //If investment was specified properly
{
//Statements
uint32 investmentI = uint32(atol(code));
if (investmentI*GOLDTOCOPPER <= plr->GetMoney())
{
QueryResult result1 = WorldDatabase.PQuery("SELECT `OwnedRatio`,`Worth`  FROM `stocks` WHERE iD = %u", stock);
if (!result1)
return false;
Field* field = result1->Fetch();
float ownedratio = field[0].GetFloat();
int worth = field[1].GetInt32();
QueryResult result2 = CharacterDatabase.PQuery("SELECT `%u` FROM `character_stockdata` WHERE iD = %u", stock, plr->GetGUIDLow());
if (!result2)
return false;
field = result2->Fetch();
float initialratio = field[0].GetFloat();
float ratio = static_cast<float>(investmentI) / worth;
if (ratio <= (1-ownedratio)) //If enough stocks left
{
int amount = investmentI*GOLDTOCOPPER;
plr->ModifyMoney(-amount);  // substract it from player money
CharacterDatabase.PExecute("UPDATE `character_stockdata` SET `%u` = %f WHERE `iD` = %u", stock, initialratio + ratio, plr->GetGUIDLow());
WorldDatabase.PExecute("UPDATE `stocks` SET `OwnedRatio` = %f WHERE `iD` = %u", ownedratio + ratio, stock);
}
else
{
plr->GetSession()->SendNotification("There are not so many shares for you to acquire, check the remaining shares before trying to invest.");
}

}
else
{
message << "You do not have so much money, " << plr->GetName() << ".";
creature->Say(message.str().c_str(), LANG_UNIVERSAL, plr);
}
}

plr->PlayerTalkClass->SendCloseGossip();
OnGossipHello(plr, creature);
return true;
}

private :
bool SendMoneyByMail(ObjectGuid player, uint64 money, int32 stock)
{
MailSender sender(MAIL_CREATURE, 50038, MAIL_STATIONERY_DEFAULT);
std::string stockName;
switch (stock)
{
case 1:
stockName = "Ravenholdt Manor";
break;
case 2:
stockName = "Bloodsail";
break;
case 3:
stockName = "Steamwheedle Cartel";
break;
case 4:
stockName = "Theramore Silk Traders";
break;
case 5:
stockName = "Eldoar'norore";
break;
default:
return false;
}
std::ostringstream text;
text << "You have requested the General Exchange Hall to sell your shares of the " << stockName << " stock. This has yielded some " << money/GOLDTOCOPPER << " gold coins from which I have deducted " <<  money/10/GOLDTOCOPPER << " in the sake of various sale and accountancy costs. Enclosed to this letter are " << 9* money/10/GOLDTOCOPPER << " gold coins which come down to you.";
MailDraft draft("Share Sale", text.str().c_str());

draft.AddMoney(money * 9 / 10);

SQLTransaction letter = CharacterDatabase.BeginTransaction();

draft.SendMailTo(letter, MailReceiver(NULL, player.GetCounter()), sender);
CharacterDatabase.CommitTransaction(letter);
return true;
}

bool SellStock(Player* plr, int32 stock, Creature* creature) /*SELL ALL THE SHARES OF THE SPECIFIED STOCK */
{
QueryResult result2 = WorldDatabase.PQuery("SELECT `OwnedRatio`,`Worth`   FROM `stocks` WHERE iD = %u", stock);
if (!result2)
return false;
QueryResult result1 = CharacterDatabase.PQuery("SELECT `1`, `2`, `3`, `4`, `5`  FROM `character_stockdata` WHERE iD = %u", plr->GetGUIDLow());
if (!result1)
return false;
Field* field = result1->Fetch();
float ratio = field[stock - 1].GetFloat();
if (ratio == 0)
{
plr->GetSession()->SendNotification("You don't own any share of this stock...");
}
else //ONLY IF PLAYER OWNS SOMETHING
{
Field* field = result2->Fetch();
float newownedratio = field[0].GetFloat()-ratio;
int worth = field[1].GetInt32();
if (!SendMoneyByMail(plr->GetGUID(), worth*GOLDTOCOPPER*ratio, stock))
return false;
std::ostringstream text;
text << "I shall make the arragement for the sale, " << plr->GetName() << ", you will receive your money by mail soon enough.";
creature->Say(text.str().c_str(), LANG_UNIVERSAL);
CharacterDatabase.PExecute("UPDATE `character_stockdata` SET `%u` = 0 WHERE `iD` = %u", stock, plr->GetGUIDLow());
WorldDatabase.PExecute("UPDATE `stocks` SET `OwnedRatio` = %f WHERE `iD` = %u", newownedratio, stock);
}
return true;
}

bool CreateLicence(Player* plr)
{
SQLTransaction trans = CharacterDatabase.BeginTransaction();
trans->PAppend("REPLACE INTO `character_stockdata` (`iD`, `1`, `2`, `3`, `4`, `5`) VALUES (%u, 0, 0, 0, 0, 0)", plr->GetGUIDLow());
CharacterDatabase.CommitTransaction(trans);
return true;
}

bool StockUpdate(int timeMult)
{
int32 stockWorth[STOCKNUMBER], newStockWorth[STOCKNUMBER];
int32 stockScale[STOCKNUMBER];
float stockOwnedRatio[STOCKNUMBER];

srand(time(NULL));

// Load stock values from DB
for (int itr = 0; itr < STOCKNUMBER; itr++)
{
QueryResult result = WorldDatabase.PQuery("SELECT `Scale`,`OwnedRatio`,`Worth`  FROM `stocks` WHERE iD = %u", itr + 1);
if (!result)
return false;
Field* field = result->Fetch();
stockScale[itr] = field[0].GetInt32();
stockOwnedRatio[itr] = field[1].GetFloat();
stockWorth[itr] = field[2].GetInt32();
}

// Dicethrows and Upload values to DB
for (int itr = 0; itr < STOCKNUMBER; itr++)
{
char sign;
if (stockWorth[itr] + stockScale[itr]*timeMult > 200000) //Don't go over 200.000 gold coins
sign = -1;
else if (stockWorth[itr] - stockScale[itr]*timeMult < 0) //Nor below 0
sign = 1;
else
{
int dice = (rand() % 101) + floor(10 * stockOwnedRatio[itr]) - 55;
sign = dice / abs(dice);
}
newStockWorth[itr] = stockWorth[itr] + sign*stockScale[itr]*timeMult;
WorldDatabase.PExecute("UPDATE `stocks` SET `worth` = %u WHERE `iD` = %u", newStockWorth[itr], itr + 1);
}

return true;
}

};
}

void AddSC_Stock()
{
new CS_StockExchange();
}

I know this code ain't perfect but I'm still open for suggestions and critics. :)

Have a nice day.

7
Serverside Modding / [C++]  StockExchange NPC Script
« on: July 24, 2015, 10:14:24 pm »
Hi guys,
I've been trying to write a StockExchange NPC Script for some 20 hours now, but I can't get it working (no wonder tho, I'm still very new to C++ ... DON'T HIT ME PLEASE :3 )

This script would use data from two different tables
 1) 'stocks' in WorldDatabase
     It contains four different fields : iD (Primary key) as an int, Name (name of the stock) as text, Scale (I'd use that once to balance the stocks easily without havint to recompile) as an int, and OwnedRatio (represents which ratio of the stock is owned by players (-> available ratio is thus (1-OwnedRatio)
     There would be a row for every existing stock.
2) 'character_stockdata' in CharacterDatabase
     Contains iD (player GUID, Primary key), 1, 2, 3, 4 and 5 (these are fields for the five different stocks I want to use, could add some later if I ever feel like it). 1, 2, 3, 4, 5 are floats because they are ratios just like ownedratio.

So basically, I came here because it keeps crashing when I sell the stocks ingame.
(That would be, in the SellStock function (first function of the class if I remember correctly).
Buying stocks works just fine, the ratio bought by the player (saved in 1, 2, 3, 4, 5 according to the stock) is correctly added to OwnedRatio...

Could you guys have a look at it? I'll keep trying to solve that problem in the meantime of course, I'm no lazy shit (well at least not for wow modding heheh ).
Ow, also wanted to say that I entirely acknowledge this code's lack of comments and it's poor writing style... As I said I'm a beginner (very first C++ script), so I'm open to any suggestion.

I will translate this into English and release it here once it's properly working, in case it would interest someone. :)

Thanks for your time and consideration! :)

UP :  My CPU fan is out of service, soooo... The English translation and script cleanup might wait a trifle longer, time for me to get a replacement!

Here's the code :
 
Code: [Select]
/*
0.0.3
StockExchange NPC Script

Description
-----------
The script uses 5 different functions (as functions of time) to "represent" the exchange rates of 5 different stocks.
Players can buy and sell shares of those stocks, provided they have bought a licence first.


TODO
-----------
#1 DEMAND SHOULD AFFECT RATES => IMPROVE & CLEAN STOCKFUNCTION

Credits to Rochet2 for the nice menu look and for cleaning this script up a trifle ( OKAY, maybe it was a lot :3).
*/

#include "ScriptPCH.h"
#include "Config.h"
#include "ScriptedCreature.h"
#include "Language.h"
#include "time.h"
#include <cmath>

#define STOCKNUMBER 5

namespace
{
class CS_StockExchange : public CreatureScript
{
public:
CS_StockExchange() : CreatureScript("Creature_StockExchange") { }



bool OnGossipHello(Player* plr, Creature* creature) override //MAIN MENU
{
WorldSession* session = plr->GetSession();
QueryResult licencetest = CharacterDatabase.PQuery("SELECT `1`, `2`, `3`, `4`, `5`  FROM `character_stockdata` WHERE iD = %u", plr->GetGUIDLow());
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Scroll_08:30:30:-18:0|tQuels sont les cours actuels du marche?", GOSSIP_SENDER_MAIN, 2);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Book_11:30:30:-18:0|tQuelles actions sont en ventes?", GOSSIP_SENDER_MAIN, 1);
if (!licencetest)
{
plr->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_MISC_NOTE_02:30:30:-18:0|tJe veux acheter une licence d'investissement.", GOSSIP_SENDER_MAIN, 12, "Cette action vous coutera", 400000, false);
}
else //Player can invest if he has a licence
{
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Coin_02:30:30:-18:0|tJ'aimerais gerer mes investissements.", GOSSIP_SENDER_MAIN, 3);
}
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tUn plaisir d'avoir fait affaire avec vous.", GOSSIP_SENDER_MAIN, 4);
plr->SEND_GOSSIP_MENU(DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
return true;
}

bool OnGossipSelect(Player* plr, Creature* creature, uint32 sender, uint32 uiAction) override
{
uint32 stock = 0;
int32 amount = 0;
plr->PlayerTalkClass->ClearMenus();
WorldSession* session = plr->GetSession();
std::ostringstream message;
float ownedratio[5];
int scale[5];
for (int iter = 1; iter < 6; iter++)
{
QueryResult result = WorldDatabase.PQuery("SELECT `OwnedRatio`,`Scale`  FROM `stocks` WHERE iD = %u", iter);
if (!result)
return false;
Field* field = result->Fetch();
ownedratio[iter-1]= field[0].GetFloat();
scale[iter-1] = field[1].GetInt32();
}
switch (uiAction)
{
case 1: //REMAINING STOCKS
message << "ACTIONS A VENDRE SUR MARCHE$BManoir de Ravenholdt : " << StockFunction(1)*scale[0] * (1 - ownedratio[0]) << "$BLa Voile Sanglante : " << StockFunction(2)*scale[1] * (1 - ownedratio[1]) << "$BCartel Fusetincelle : " << StockFunction(3)*scale[2] * (1 - ownedratio[2]) << "$BMarchands de soie de Theramore : " << StockFunction(4)*scale[3] * (1 - ownedratio[3]) << "$BEldoar'norore : " << StockFunction(5)*scale[4] * (1 - ownedratio[4]);
creature->Whisper(message.str(), LANG_UNIVERSAL, plr);
plr->PlayerTalkClass->SendCloseGossip();
OnGossipHello(plr, creature);
break;
case 2: //CURRENT EXCHANGE RATES
message << "COURS ACTUELS DU MARCHE$BManoir de Ravenholdt : " << StockFunction(1)*scale[0] << "$BLa Voile Sanglante : " << StockFunction(2)*scale[1] << "$BCartel Fusetincelle : " << StockFunction(3)*scale[2] << "$BMarchands de soie de Theramore : " << StockFunction(4)*scale[3] << "$BEldoar'norore : " << StockFunction(5)*scale[4];
creature->Whisper(message.str(),LANG_UNIVERSAL, plr);
plr->PlayerTalkClass->SendCloseGossip();
OnGossipHello(plr, creature);
break;
case 3: //MANAGE PORTFOLIO MENU (5-10)
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Helmet_30:30:30:-18:0|tManoir de Ravenholdt", GOSSIP_SENDER_MAIN, 5);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Helmet_66:30:30:-18:0|tLa Voile Sanglante", GOSSIP_SENDER_MAIN, 6);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Bomb_03:30:30:-18:0|tCartel Fusetincelle", GOSSIP_SENDER_MAIN, 7);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Chest_Cloth_56:30:30:-18:0|tMarchands de soie de Theramore", GOSSIP_SENDER_MAIN, 8);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_FireDancer_01:30:30:-18:0|tEldoar'norore", GOSSIP_SENDER_MAIN, 9);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tRetour au menu principal", GOSSIP_SENDER_MAIN, 10);
plr->SEND_GOSSIP_MENU(50002, creature->GetGUID());
break;
case 4: //CLOSE GOSSIP
plr->PlayerTalkClass->SendCloseGossip();
break;
case 5: //MANAGE RAVENHOLDT STOCK
stock = 1;
plr->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Letter_03:30:30:-18:0|tAcheter des parts", stock, 0, "Combien de pieces d'or desirez-vous investir?", 0, true);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Coin_16:30:30:-18:0|tVendre les parts", stock, 11);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tRetour au menu precedent", GOSSIP_SENDER_MAIN, 3);
plr->SEND_GOSSIP_MENU(50002, creature->GetGUID());
return true;
break;
case 6: //MANAGE BLOODSAIL STOCK
stock = 2;
plr->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Letter_03:30:30:-18:0|tAcheter des parts", stock, 0, "Combien de pieces d'or desirez-vous investir?", 0, true);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Coin_16:30:30:-18:0|tVendre les parts", stock, 11);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tRetour au menu precedent", GOSSIP_SENDER_MAIN, 3);
plr->SEND_GOSSIP_MENU(50002, creature->GetGUID());
break;
case 7: //MANAGE GOBLIN STOCK
stock = 3;
plr->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Letter_03:30:30:-18:0|tAcheter des parts", stock, 0, "Combien de pieces d'or desirez-vous investir?", 0, true);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Coin_16:30:30:-18:0|tVendre les parts", stock, 11);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tRetour au menu precedent", GOSSIP_SENDER_MAIN, 3);
plr->SEND_GOSSIP_MENU(50002, creature->GetGUID());
break;
case 8: //MANAGE SILKTRADERS STOCK
stock = 4;
plr->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Letter_03:30:30:-18:0|tAcheter des parts", stock, 0, "Combien de pieces d'or desirez-vous investir?", 0, true);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Coin_16:30:30:-18:0|tVendre les parts", stock, 11);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tRetour au menu precedent", GOSSIP_SENDER_MAIN, 3);
plr->SEND_GOSSIP_MENU(50002, creature->GetGUID());
break;
case 9: //MANAGE ELDOAR'NORORE STOCK
stock = 5;
plr->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Letter_03:30:30:-18:0|tAcheter des parts", stock, 0, "Combien de pieces d'or desirez-vous investir?", 0, true);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/INV_Misc_Coin_16:30:30:-18:0|tVendre les parts", stock, 11);
plr->ADD_GOSSIP_ITEM(GOSSIP_ICON_MONEY_BAG, "|TInterface/ICONS/Ability_Spy:30:30:-18:0|tRetour au menu precedent", GOSSIP_SENDER_MAIN, 3);
plr->SEND_GOSSIP_MENU(50002, creature->GetGUID());
return true;
break;
case 11: //TRANSACTION = SELL
if (!SellStock(plr, stock))
plr->GetSession()->SendNotification("Erreur lors de la vente des parts");
plr->PlayerTalkClass->SendCloseGossip();
OnGossipHello(plr, creature);
break;
case 12: //CREATE PLAYER LICENCE ( = ROW IN CHARACTER_STOCKDATA )
if (plr->GetMoney() >= 400000)
{
if (CreateLicence(plr))
{
amount = 400000;
plr->ModifyMoney(-amount);
message << "Votre licence a ete achetee avec succes, " << plr->GetName() << "!";
   creature->Say(message.str(), LANG_UNIVERSAL, plr);
}
else
plr->GetSession()->SendNotification("Erreur lors de l'enregistrement de votre licence... Prenez contact avec l'administrateur.");
}
else
{
message << "Navre, " << plr->GetName() << ", vous n'avez pas ces quarantes pieces d'or...";
creature->Say(message.str().c_str(), LANG_UNIVERSAL, plr);
}

plr->PlayerTalkClass->SendCloseGossip();
OnGossipHello(plr, creature);
break;
default:
OnGossipHello(plr, creature);
break;
}

return true;
}
bool OnGossipSelectCode(Player* plr, Creature* creature, uint32 stock, uint32 uiAction, const char* code) override
{
plr->PlayerTalkClass->ClearMenus();
std::ostringstream message;
int32 amount = 0;

std::string investment = code;
static const char* allowedcharacters = "1234567890";
if (!investment.length() || investment.find_first_not_of(allowedcharacters) != std::string::npos) //If investment was specified incorrectly
{
plr->GetSession()->SendNotification("L'investissement doit-être declare en chiffres. N'utilisez que 0,1,2,3,4,5,6,7,8 et 9, stupide ignare que vous etes.");
}
else //If investment was specified properly
{
//Statements
uint32 investmentI = uint32(atol(code) * 10000);
if (investmentI <= plr->GetMoney())
{
double stockfunction = StockFunction(stock);

QueryResult result1 = WorldDatabase.PQuery("SELECT `OwnedRatio`,`Scale`  FROM `stocks` WHERE iD = %u", stock);
if (!result1)
return false;
Field* field = result1->Fetch();
float ownedratio = field[0].GetFloat();
int scale = field[1].GetInt32();
QueryResult result2 = CharacterDatabase.PQuery("SELECT `%u` FROM `character_stockdata` WHERE iD = %u", stock, plr->GetGUIDLow());
if (!result2)
return false;
field = result2->Fetch();
float initialratio = field[0].GetFloat();
float ratio = investmentI / scale / stockfunction;
if (ratio <= (1-ownedratio)) //If enough stocks left
{
int amount = investmentI;
plr->ModifyMoney(-amount);  // substract it from player money
CharacterDatabase.PExecute("UPDATE `character_stockdata` SET `%u` = %f WHERE `iD` = %u", stock, initialratio + ratio, plr->GetGUIDLow());
WorldDatabase.PExecute("UPDATE `stocks` SET `OwnedRatio` = %f WHERE `iD` = %u", ownedratio + ratio, stock);
}
else
{
plr->GetSession()->SendNotification("Il n'y a pas assez de parts a acheter pour le montant que vous voulez investir, consultez les parts restantes avant d'investir.");
}

}
else
{
message << "Vous n'avez pas tout cet argent a investir, " << plr->GetName() << ".";
creature->Say(message.str().c_str(), LANG_UNIVERSAL, plr);
}
}

plr->PlayerTalkClass->SendCloseGossip();
OnGossipHello(plr, creature);
return true;
}

private :
bool SellStock(Player* plr, uint32 stock) /*SELL ALL THE SHARES OF THE SPECIFIED STOCK */
{
QueryResult result2 = WorldDatabase.PQuery("SELECT `OwnedRatio`,`Scale`  FROM `stocks` WHERE iD = %u", stock);
if (!result2)
return false;
QueryResult result1 = CharacterDatabase.PQuery("SELECT `1`, `2`, `3`, `4`, `5`  FROM `character_stockdata` WHERE iD = %u", plr->GetGUIDLow());
if (!result1)
return false;
Field* field = result1->Fetch();
float ratio = field[stock - 1].GetFloat();
if (ratio == 0)
{
plr->GetSession()->SendNotification("Vous n'avez aucune part a vendre pour ce marche...");
}
else //ONLY IF PLAYER OWNS SOMETHING
{
Field* field = result2->Fetch();
float ownedratio = field[0].GetFloat();
int scale = field[1].GetInt32();
double stockfunction = StockFunction(stock);


plr->ModifyMoney(int32(scale*stockfunction*ratio));  // add it to player money
CharacterDatabase.PExecute("UPDATE `character_stockdata` SET `%u` = 0 WHERE `iD` = %u", stock, plr->GetGUIDLow());
WorldDatabase.PExecute("UPDATE `stocks` SET `OwnedRatio` = %f WHERE `iD` = %u", ownedratio - ratio, 1);
}
return true;
}

bool CreateLicence(Player* plr)
{
SQLTransaction trans = CharacterDatabase.BeginTransaction();
trans->PAppend("REPLACE INTO `character_stockdata` (`iD`, `1`, `2`, `3`, `4`, `5`) VALUES (%u, 0, 0, 0, 0, 0)", plr->GetGUIDLow());
CharacterDatabase.CommitTransaction(trans);
return true;
}

double StockFunction(uint32 stock) /* Works out the current exchange rate according to time ellapsed since stock market release */
{
// HOW MUCH TIME HAS PASSED...
time_t now;
struct tm y2k;
double minutes;

time(&now); //...UNTIL NOW...
y2k = *localtime(&now);
y2k.tm_hour = 18;   y2k.tm_min = 20; y2k.tm_sec = 0;
y2k.tm_year = 115; y2k.tm_mon = 6; y2k.tm_mday = 27; //...SINCE STOCK MARKET RELEASE (This date might be updated at some point)

minutes = abs(difftime(mktime(&y2k), now)) / 3600;

switch (stock)
{
case 1: //Ravenholdt
return (10 + 3 * sin(0.3* minutes) + sin(3 * minutes));
break;
case 2: //Bloodsail
return (-atan(tan(minutes)) + 2);
break;
case 3: //Goblin
return (2 + sin(30 * minutes)*cos(100 * minutes));
break;
case 4: //SilkTraders
return (atan(tan(minutes)) + 2 + 0.1*minutes);
break;
case 5: //Eldoar'norore
return (0.3*minutes + sin(5 * minutes)*cos(10 * minutes) + 1);
break;
default:
return 0;
break;
}
}
};
}

void AddSC_Stock()
{
new CS_StockExchange();
}


8
Hi,

I created another map using Talliis for the .wdt file and ADTAdder for the .adt from the .adt template "template_0_0.adt". Then I used, as usual, the OffsetFIx and added all these files in my custom MPQ patch (the Map.dbc in DBFilesClient, and the .wdt & .adt in world/maps/Misthearth (which is indeed the name of the map)).
Alas this once it won't even show in Noggit's map list, although I did add an entry in map.dbc...

I just don't get it because I just did everything as usual, and it usually works. :O

Oh, and I googled it and read every modcraft post I found about map not showing up in noggit, but none of the suggested solutions worked for me.

Thanks a lot for your help. :)

9
Hi Modcraft,

I followed the Worldbuilding Basics tutorial of Eluo (awesome tut' by the way! ) til the end and got my custom map working on a local TrinityCore (0ebc15e6f48b, doubt my trinity rev matters though  :D ) and using the last rev of Noggit of course (Noggit SDL 1.4 (beta)).

The only problem is that every single texture I used on the map renders reallly dark in-game, almost completely black. I can still distinguish sand from grass or dirt, but the colors are all dark.



Anyway I saw that sometimes textures rendered darker in-game... but THAT dark? :D

I tried using the flatten/blur tool with a large brush radius and tiny speed, because I read somewhere it could fix it in previous versions of Noggit.
I also tried reloading/resaving the map several times.
Eventually I tried resetting the texture on every adt and repainting them again...

As expected, these first attempts did not yield any result and the problem remains.

Would someone know how to fix this?


Thanks for your patience and consideration!! :)

Oh... dunno if it matters here but :
 log.txt :[Pastie]10089556
noggit.conf : [Pastie]10089558
(Sorry guys, can't insert links yet :/ )

Pages: [1]