[Help] Couple questions.. about npcs..

07/02/2009 21:18 n0mansland#1
Im using CoEmu

Hey just a couple questions for some codes before I release a new source :) Just questions about the remaining npcs'


1. If I was making Guild Director, guy what would the line be for Save Guild... Also if you make someone Deputy what would you put to save that spot.. (Guild seems too much of a hassle and probably won't put it in)

2. Anyone know the furniture NPC's Sub Type numbers? Like what they look like, It's not in npc.ini.

3. What would you put to add socket to weapon. Like

Code:
Hi I can add sockets to your weapon
Ok <--- If you click OK.  Add Socket.
No Thanks
4. What's the code to check an item and to delete and item.

Will add more if I need to :)


Don't worry probably might read C# tutorials in a few.


Thanks if you help.
07/02/2009 22:50 _Emme_#2
3.

Quote:
NpcText("Would you like me to socket your right hand weapon?");
NpcOption("Yes, please",1);
NpcOption("No thank you",255);
}
if (NpcOption == 1)
{
Item Weapon = Client.Equipment[4]; // I think 4 is righthand(?)
ushort DBCost = 1;
if (Weapon.Soc1 != 0 && Weapon.Soc2 == 0)
DBCost = 5;
if (Client.InventoryContains(1088000,DBCost)) // Usage: ItemID,Amount
{
if (Weapon.Soc1 == 0)
Weapon.Soc1 = 255;
else if (Weapon.Soc2 == 0)
Weapon.Soc2 = 255;
else
{
NpcText("Your weapon is already socketed twice!");
NpcOption("Oh, sorry..",255);
}
Client.RemoveItem(1088000,DBCost); // Usage: ItemID,Amount
Client.SendText("Your weapon has been socketed successfully!",ChatType.TopLeft);
}
else
{
Client.SendText("You don't have the required DragonBalls!",ChatType.TopLeft);
}
}
Just wrote it, not tested but meh hopefully you get what I'm saying (hopefully)

P.S: It won't work if you copy+paste, so don't.


Emme
07/02/2009 22:52 n0mansland#3
Sorry forgot to put I'm using CoEmu but I could use that to get an idea how to code it. Thanks.
07/02/2009 23:59 pro4never#4
Quote:
Originally Posted by EmmeTheCoder View Post
3.



Just wrote it, not tested but meh hopefully you get what I'm saying (hopefully)

P.S: It won't work if you copy+paste, so don't.


Emme
Ahh thanks I am gonna try to use a bit of that for my item socketer later. I have teh npc all scripted including the db counting/removal I just didn't have any code handy to check the item in slot and add a socket.

I'll mess around with it later but you at least cleared up some for me ^^