[reg]npc-s Into Shop

Submit your code requests, and if you are good at coding come help others with their requests.
Post Reply
txc55
noob
Posts: 10
Joined: Fri Jan 27, 2006 12:53 pm

Post by txc55 »

i need code-i want to put warehouse man/magic man into shop..put they dont work...i cant buy spells and put items to bank...
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

hum... i know there is a check structure somewhere to prevent peoples to learn spells from other maps than Wizzard tower. That was the bug that prevented players to learn spells from book somewhere else from Wizzard tower.

I think there is a similar check for the Bank items to prevent player to store items when they are hunting at D4 or ToH...


Didn't checked in source but i'm pretty sure you'll find something like this ;)
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
Drajwer
&lt;3 bd long time
Posts: 841
Joined: Fri Dec 10, 2004 3:24 pm

Post by Drajwer »

bIsInsideWarehouse or bIsInsideMagictower - remove that checks or just initialize these vars as TRUE.

ps. not sure about names.
<img src='http://img440.imageshack.us/img440/2627/15pt.jpg' border='0' alt='user posted image' /><br><br>HBPolska characters:<br><br>Hellios 150+ Aresden Hero Mage<br>TheBill 120 Aresden plrider<br>Kill_Me 100 Full-Hero plrider<br>Rockeater 110+ Aresden Plate Mage<br><br><a href='http://www.helbreath.org' target='_blank'>http://www.helbreath.org</a> come and play (250 ppl online)
diuuude
Outpost bitch
Posts: 592
Joined: Wed Dec 28, 2005 11:57 pm

Post by diuuude »

a better way to do it and keep preventing hacks would be checking for the new NPC place (ie Shop).

Just change the code to check if you're in shop instead of checking for Wiz tower or WH
<a href='http://www.technohell.net' target='_blank'><b><span style='color:red'>>>> Helbreath Ressources Website Here <<<</span></b></a><br>C++ Sources, Tools, Server Files, Help on Forum, C++ Snippets, Toplist... Updated often, come visit us !
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

In function RequestStudyMagicHandler comment out this codes...
if (m_pClientList[iClientH]->m_bIsInsideWizardTower == FALSE && bIsPurchase) return;
in function bSetItemToBankItem comment out this codes...
if (m_pClientList[iClientH]->m_bIsInsideWarehouse == FALSE) return FALSE;
in function RequestRetrieveItemHandler comment out this codes...
if (m_pClientList[iClientH]->m_bIsInsideWarehouse == FALSE) return;
QUOTE (ADDKiD @ Dec 1 2006, 4:01 PM) <br>You guys make me laugh alot, half the shit I say, is bullshit...<br><br><img src='http://img485.imageshack.us/img485/492/banssig1ng.gif' border='0' alt='user posted image' /><br><br><b>I see no changes at all, wake up in the morning and ask myself...<br>Is life worth living? Should I blast myself?</b><br><br><b><a href='http://2paclegacy.com' target='_blank'>2PacLegacy.com</a></b>
txc55
noob
Posts: 10
Joined: Fri Jan 27, 2006 12:53 pm

Post by txc55 »

okei that code is simple...
Find

Code: Select all

if (memcmp(m_pClientList[iClientH]->m_cMapName, "wzdtwr", 6) == 0 ||
    m_pClientList[iClientH]->m_bIsInsideWizardTower = TRUE; 
else
     m_pClientList[iClientH]->m_bIsInsideWizardTower = FALSE;
}
change to

Code: Select all

 if (memcmp(m_pClientList[iClientH]->m_cMapName, "wzdtwr", 6) == 0 ||
     memcmp(m_pClientList[iClientH]->m_cMapName, "gshop_1", 7) == 0 || 
     memcmp(m_pClientList[iClientH]->m_cMapName, "gshop_2", 7) == 0)
     m_pClientList[iClientH]->m_bIsInsideWizardTower = TRUE;
else
     m_pClientList[iClientH]->m_bIsInsideWizardTower = FALSE;
}
now u can buy spells in shop:Dwhen your gandalf is in shop.

find

Code: Select all

if (memcmp(m_pClientList[iClientH]->m_cMapName, "wrhus", 5) == 0 ||
    memcmp(m_pClientList[iClientH]->m_cMapName, "arewrhus", 8) == 0 ||
    memcmp(m_pClientList[iClientH]->m_cMapName, "elvwrhus", 8) == 0
    m_pClientList[iClientH]->m_bIsInsideWarehouse = TRUE;
else
     m_pClientList[iClientH]->m_bIsInsideWarehouse = FALSE;
change to

Code: Select all

if (memcmp(m_pClientList[iClientH]->m_cMapName, "wrhus", 5) == 0 ||
    memcmp(m_pClientList[iClientH]->m_cMapName, "arewrhus", 8) == 0 ||
    memcmp(m_pClientList[iClientH]->m_cMapName, "elvwrhus", 8) == 0 ||
    memcmp(m_pClientList[iClientH]->m_cMapName, "gshop_1", 7) == 0 ||
    memcmp(m_pClientList[iClientH]->m_cMapName, "gshop_2", 7) == 0)
    m_pClientList[iClientH]->m_bIsInsideWarehouse = TRUE;
else
    m_pClientList[iClientH]->m_bIsInsideWarehouse = FALSE;
now u can but items into bank when your warehouse keeper is in shop.
when theres something wrong..just tell me!
I have tested it and it works
locobans
Outpost Junkie
Posts: 2264
Joined: Tue Jul 13, 2004 3:51 am
Location: Behind You
Contact:

Post by locobans »

erm...the thing I told him to do...works...and find it much easier.
QUOTE (ADDKiD @ Dec 1 2006, 4:01 PM) <br>You guys make me laugh alot, half the shit I say, is bullshit...<br><br><img src='http://img485.imageshack.us/img485/492/banssig1ng.gif' border='0' alt='user posted image' /><br><br><b>I see no changes at all, wake up in the morning and ask myself...<br>Is life worth living? Should I blast myself?</b><br><br><b><a href='http://2paclegacy.com' target='_blank'>2PacLegacy.com</a></b>
Post Reply