PDA

View Full Version : #summonitem - augments


Strake
07-24-2007, 04:25 AM
I'm trying to remove item stacking, while allowing augments, so I've narrowed it down to:

void command_summonitem(Client *c, const Seperator *sep)
{
if (!sep->IsNumber(1))
c->Message(0, "Usage: #summonitem [item id] [charges], charges are optional");
else {
int32 itemid = atoi(sep->arg[1]);
if (database.GetItemStatus(itemid) > c->Admin())
c->Message(13, "Error: Insufficient status to summon this item.");
else if (sep->argnum==2 && sep->IsNumber(2)) {
c->SummonItem(itemid, atoi(sep->arg[2]) );
else {
c->SummonItem(itemid);
}
}
}


I was wondering if there was some kind of "is item an augment" thing (kinda like sep->IsNumber(2) but for augments)

Thanks,
Dillon

John Adams
07-24-2007, 11:59 AM
You don't want anything to stack? ~confused~

Strake
07-24-2007, 12:18 PM
like #summonitem 11000 11000 11000 11000 11000 to get 5x the stats

techguy84
07-24-2007, 01:01 PM
Quick hide that post otherwise your players are going to be running around with high powered rifles and then you have to go through and find out which ones are, and people arent always honest.

Strake
07-24-2007, 03:30 PM
heh, no stackers left on my server.

SELECT * FROM eqemu.inventory WHERE augslot1 > 0 OR augslot2 > or OR augslot3 > 0 OR augslot4 > 0 OR augslot5 > 0;

and then

UPDATE eqemu.inventory SET augslot1=0, augslot2=0, augslot3=0, augslot4=0, augslot5=0;

and that one will remove ALL stacked items and turn them to normal. =p

techguy84
07-24-2007, 04:41 PM
Ooo, I only say this in dire times, but I have to here.



...... Pwned.......


Cheers Strake. Is this on Krushers? I seen a post I think about item mods in Server Discussion. Now if you can just figure out what code allows this nifty little hack.

Strake
07-24-2007, 06:35 PM
It's already in place, I'm trying to REMOVE it due to abuse.

KLS
07-24-2007, 07:39 PM
Hmm, I'm a bit confused so bare with me.

If you wanted to remove the ability to summon items with charges that were augments you could probably just change your code to(I haven't tested this btw =p)

void command_summonitem(Client *c, const Seperator *sep)
{
if (!sep->IsNumber(1))
c->Message(0, "Usage: #summonitem [item id] [charges], charges are optional");
else {
int32 itemid = atoi(sep->arg[1]);
if (database.GetItemStatus(itemid) > c->Admin())
c->Message(13, "Error: Insufficient status to summon this item.");
else if (sep->argnum==2 && sep->IsNumber(2)) {
const Item_Struct* itm = database.GetItem(itemid);
if(itm){
if(itm->AugType == 0){
c->SummonItem(itemid, atoi(sep->arg[2]) );
}
else
{
c->SummonItem(itemid);
}
}
else {
c->SummonItem(itemid);
}
}
}

Though again I'm a little confused as to what's trying to be accomplished, fixing some exploit I don't know about I guess.

Strake
07-25-2007, 01:16 AM
I mean, if not augment then tell it no, if so augment allow. Some minor tweaking to that and it'll work. Thanks a ton man! I'm new to source editing and still trying to get the hang of it. Haven't found all of the options for everything, like AugType and such.

Thanks again!,
Dillon

Strake
07-27-2007, 03:45 AM
Okay, before I compile it and break everything, does this look good to everyone else?
(Reminder: I'm trying to allow #summonitem with augments and items with charges while not allowing people to stack item stats. I figured, since 100 is the max number of charges, and 1001 is the lowest item number, there's no chance of item stacking)


void command_summonitem(Client *c, const Seperator *sep)
{
if (!sep->IsNumber(1))
c->Message(0, "Usage: #summonitem [item id] [charges], charges are optional");
else {
int32 itemid = atoi(sep->arg[1]);
if (database.GetItemStatus(itemid) > c->Admin())
c->Message(13, "Error: Insufficient status to summon this item.");
else if (sep->argnum==2 && sep->IsNumber(2)) {
const Item_Struct* itm = database.GetItem(itemid);
if(itm){
if(itm->AugType == 0 || atoi(sep->arg[2]) > 100){
c->SummonItem(itemid);
}
else
{
c->SummonItem(itemid, atoi(sep->arg[2]) );
}
}
else {
c->SummonItem(itemid);
}
}
}


-Dillon