hehhe. nice. +rep definetly
P.S. Lawl at Cardell. U gotta love these leechers.
hehhe. nice. +rep definetly
P.S. Lawl at Cardell. U gotta love these leechers.
Wish they had this on Retail, Or a Guild House...
all the people here mr link is using your script, because is very good, but with this error is a little problematic using it.
plz repair it
tbh.. i didnt even use mmowned till today.., thats a fact.
well very nicebtw u should really make an option where u can choose between some houses if u dont already haf it. still very good ^^ dont haf any private server so cant test ;/ well +rep anyway
EDIT: Dunno why but cant giv ya rep... says i cant to that post.
Last edited by Mitron; 05-05-2009 at 02:46 PM.
----------------------------------------------------------------
Isnt there a way to make people pay gold or something in order for them to get it, Also wouldnt this be doable an simpeler if it was scripted in lua?
Released version 2 (v.2).
Code:Changelog: Removed the annoying MySQL outgoing connection, so now you don't have to edit the code to get this working. Added a prize you can edit via Optional Config. No warnings now.
Why do I need a signature?
i can't understand where to put this:
/*
House System v.2
Made by Link_S of MMOwned, him and only.
Changelog:
Removed the annoying MySQL outgoing connection,
so now you don't have to edit the code to get this working.
Added a prize you can edit via Optional Config.
No warnings now.
*/
#include "StdAfx.h"
uint32 HOUSEPRIZE = 1064, HOUSETELEPORTPRIZE = 20; //Variables to store the prizes, Changeable via Optional Config
class HouseNPC : public GossipScript
{
public:
void GossipHello(Object * pObject, Player* plr, bool AutoSend)
{
GossipMenu *menu;
objmgr.CreateGossipMenuForPlayer(&menu, pObject->GetGUID(), 1, plr);
if(!plr->CombatStatus.IsInCombat())
{
//Merge the House prize with the menu options.
char m_1[512], m_2[512];
snprintf(m_1, 512, "Buy a house. %s g", HOUSEPRIZE);
snprintf(m_2, 512, "Take me to my house %s g", HOUSETELEPORTPRIZE);
//Add the options..
menu->AddItem(1, m_1, 1);
menu->AddItem(2, m_2, 2);
}
else
plr->BroadcastMessage("I don't want to talk to you when you're in combat.");
if(AutoSend)
menu->SendTo(plr);
};
void GossipSelectOption(Object * pObject, Player* plr, uint32 id, uint32 intId, const char * code)
{
switch(intId)
{
case 1: //The player wants a house
{
QueryResult * res = CharacterDatabase.Query("SELECT * FROM houses WHERE ownerguid = %u", plr->GetGUID());
if(res != NULL) //Appearantly the player alredy have a house.
{
plr->BroadcastMessage("You do alredy have a house.");
plr->Gossip_Complete();
return;
}
//Hmm, a House do also have a prize.
uint32 player_money = plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
if(player_money < (HOUSEPRIZE * 10000))
{
plr->BroadcastMessage("You don't afford a house.");
plr->Gossip_Complete();
return;
}
//Remove the money.
plr->SetUInt32Value(PLAYER_FIELD_COINAGE, (player_money - (HOUSEPRIZE * 10000)));
//Give the house.
CharacterDatabase.Execute("INSERT INTO houses VALUES(%u, 242.284, 0.74529, 1.75938, 59", plr->GetGUID());
plr->BroadcastMessage("Congratulations, you just bought a house.");
plr->Gossip_Complete();
}break;
case 2: //Teleport to your house
{
QueryResult * res = CharacterDatabase.Query("SELECT * FROM houses WHERE ownerguid = %u", plr->GetGUID());
if(res == NULL)
{
plr->BroadcastMessage("Sorry, you don't have a house.");
plr->Gossip_Complete();
return;
}
if(res->GetRowCount() > 1)
{
Log.Error("HouseSystem", "Report this error to Link_S of MMOwned : received to many rows out of query.");
plr->BroadcastMessage("Error occured. Operation aborted.");
return;
}
//Now draw the money, so the player don't get pissed off when he loses money and don't get teleported.
uint32 player_money = plr->GetUInt32Value(PLAYER_FIELD_COINAGE);
if(player_money < (HOUSEPRIZE * 10000))
{
plr->BroadcastMessage("You don't afford to teleport to your house.");
plr->Gossip_Complete();
return;
}
//Just some variables for teleportation, makes better structure.
float x, y, z;
uint32 mapid;
Field * f = res->Fetch();
x = f[1].GetFloat();
y = f[2].GetFloat();
z = f[3].GetFloat();
mapid = f[4].GetUInt32();
//Now teleport the player to their house.
plr->EventTeleport(mapid, x, y, z);
plr->Gossip_Complete();
}break;
}
};
void Destroy()
{
delete this;
};
};
void SetupHouseNPC(ScriptMgr * mgr)
{
HOUSEPRIZE = (uint32)Config.OptionalConfig.GetIntDefault("HouseSystem", "HousePrize", 1064);
HOUSETELEPORTPRIZE = (uint32)Config.OptionalConfig.GetIntDefault("HouseSystem", "HouseTeleportationPrize", 20);
if((HOUSEPRIZE < 0) || (HOUSETELEPORTPRIZE < 0))
{
Log.Error("HouseSystem", "HousePrize and HouseTeleportationPrize in Optional Config can't be under 0.");
return;
}
GossipScript * gs = (GossipScript*) new HouseNPC();
mgr->register_gossip_script(160000, gs);
};
@bgmaniaka - Follow any compilation guide of C++ projects at these forums.
@Nightfoxx - The tutorial is for the old script. It's changed so you can compile it normal way now. I'll go delete the old tutorial as fast as possible now.
I've been pushing the update further for a long time now. But I've updated. Didn't took me more than some minutes to be honoust.
Why do I need a signature?
Can someone tell me what should i do with this ?Code:/* House System v.2 Made by Link_S of MMOwned, him and only. Changelog: Removed the annoying MySQL outgoing connection, so now you don't have to edit the code to get this working. Added a prize you can edit via Optional Config. No warnings now. */ #include "StdAfx.h" uint32 HOUSEPRIZE = 1064, HOUSETELEPORTPRIZE = 20; //Variables to store the prizes, Changeable via Optional Config class HouseNPC : public GossipScript { public: void GossipHello(Object * pObject, Player* plr, bool AutoSend) { GossipMenu *menu; objmgr.CreateGossipMenuForPlayer(&menu, pObject->GetGUID(), 1, plr); if(!plr->CombatStatus.IsInCombat()) { //Merge the House prize with the menu options. char m_1[512], m_2[512]; snprintf(m_1, 512, "Buy a house. %s g", HOUSEPRIZE); snprintf(m_2, 512, "Take me to my house %s g", HOUSETELEPORTPRIZE); //Add the options.. menu->AddItem(1, m_1, 1); menu->AddItem(2, m_2, 2); } else plr->BroadcastMessage("I don't want to talk to you when you're in combat."); if(AutoSend) menu->SendTo(plr); }; void GossipSelectOption(Object * pObject, Player* plr, uint32 id, uint32 intId, const char * code) { switch(intId) { case 1: //The player wants a house { QueryResult * res = CharacterDatabase.Query("SELECT * FROM houses WHERE ownerguid = %u", plr->GetGUID()); if(res != NULL) //Appearantly the player alredy have a house. { plr->BroadcastMessage("You do alredy have a house."); plr->Gossip_Complete(); return; } //Hmm, a House do also have a prize. uint32 player_money = plr->GetUInt32Value(PLAYER_FIELD_COINAGE); if(player_money < (HOUSEPRIZE * 10000)) { plr->BroadcastMessage("You don't afford a house."); plr->Gossip_Complete(); return; } //Remove the money. plr->SetUInt32Value(PLAYER_FIELD_COINAGE, (player_money - (HOUSEPRIZE * 10000))); //Give the house. CharacterDatabase.Execute("INSERT INTO houses VALUES(%u, 242.284, 0.74529, 1.75938, 598)", plr->GetGUID()); plr->BroadcastMessage("Congratulations, you just bought a house."); plr->Gossip_Complete(); }break; case 2: //Teleport to your house { QueryResult * res = CharacterDatabase.Query("SELECT * FROM houses WHERE ownerguid = %u", plr->GetGUID()); if(res == NULL) { plr->BroadcastMessage("Sorry, you don't have a house."); plr->Gossip_Complete(); return; } if(res->GetRowCount() > 1) { Log.Error("HouseSystem", "Report this error to Link_S of MMOwned : received to many rows out of query."); plr->BroadcastMessage("Error occured. Operation aborted."); return; } //Now draw the money, so the player don't get pissed off when he loses money and don't get teleported. uint32 player_money = plr->GetUInt32Value(PLAYER_FIELD_COINAGE); if(player_money < (HOUSEPRIZE * 10000)) { plr->BroadcastMessage("You don't afford to teleport to your house."); plr->Gossip_Complete(); return; } //Just some variables for teleportation, makes better structure. float x, y, z; uint32 mapid; Field * f = res->Fetch(); x = f[1].GetFloat(); y = f[2].GetFloat(); z = f[3].GetFloat(); mapid = f[4].GetUInt32(); //Now teleport the player to their house. plr->EventTeleport(mapid, x, y, z); plr->Gossip_Complete(); }break; } }; void Destroy() { delete this; }; }; void SetupHouseNPC(ScriptMgr * mgr) { HOUSEPRIZE = (uint32)Config.OptionalConfig.GetIntDefault("HouseSystem", "HousePrize", 1064); HOUSETELEPORTPRIZE = (uint32)Config.OptionalConfig.GetIntDefault("HouseSystem", "HouseTeleportationPrize", 20); if((HOUSEPRIZE < 0) || (HOUSETELEPORTPRIZE < 0)) { Log.Error("HouseSystem", "HousePrize and HouseTeleportationPrize in Optional Config can't be under 0."); return; } GossipScript * gs = (GossipScript*) new HouseNPC(); mgr->register_gossip_script(160000, gs); };
or can someone show me an Guide of how should i put this into server ?
Last edited by punxphobia; 05-17-2009 at 10:14 AM.
For everyone who seems to be confused with this. This is a C++ scripted document. You need to compile this into a Dll and place it in the script_bin folder. It is many compilation guides around here at MMOwned, just use the search button.
Why do I need a signature?
Any pics or vids of this yet?
Im thinking 'bout making a server... just for me and my mates to mess around on (like 30 of us) and i'd love to add this.. but want to see it in action first <3
You say its instanced? So a group of 5 could have a 'house party' or possibly make it a raid and have 40 people for a guild meeting?
My life is simple
So Is Yours
But together, They arn't
Dont look too deeply into this or you will be lost forever.
@Enuf - Sorry but I have no picture, you could simply test this out at your server before considering adding it.
@Exiled1120 - Yes that's possible. If everyone owns a house. It's able to convert this to Aspire and abuse their phasing and make it individual for each player, and make them able to invite other players to their house. But this was made for ArcEmu. If you'd like it I could make a special for Aspire also.
@punxphobia - Please use the search button for once, you've just have to search for the keyword 'Compile script', or something like that. Then you'd be having a bounch of 'script' compilation guides in your face by this time.
Why do I need a signature?