Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] Stars fix.

Newbie Spellweaver
Joined
Oct 19, 2007
Messages
20
Reaction score
0
When you are dropping stars, it will drop only 1 from the stars, and when you are looting stars it will add them to the exist set...
This fix will fix it and when you will drop stars set, it will drop all the set, and when you will loot stars set it wont add it to exist one.

Open Inventory.cpp

find:

Code:
void Inventory::addItem(Player* player, Item* item, bool is){
    for(int i=0; i<player->inv->getItemNum(); i++){
        if(player->inv->getItem(i)->id == item->id && Drops::items[player->inv->getItem(i)->id].type == item->inv && player->inv->getItem(i)->amount < Drops::items[item->id].maxslot){
            Item* olditem = player->inv->getItem(i);
            if(item->amount + olditem->amount > Drops::items[item->id].maxslot){
                int amount = Drops::items[item->id].maxslot-olditem->amount;
                item->amount-=amount;
                olditem->amount = Drops::items[item->id].maxslot;
                InventoryPacket::addItem(player, olditem, is);
            }
            else{
                item->amount += olditem->amount;
                item->pos = olditem->pos;
                player->inv->deleteItem(i);
                player->inv->addItem(item);
                InventoryPacket::addItem(player, item, is);
                return;
            }
        }
    }
    InventoryPacket::addNewItem(player, item, is);
    player->inv->addItem(item);
}
replace with:

Code:
void Inventory::addItem(Player* player, Item* item, bool is){
    if (!ISSTAR(item->id))
    {
        for(int i=0; i<player->inv->getItemNum(); i++){
            if(player->inv->getItem(i)->id == item->id && Drops::items[player->inv->getItem(i)->id].type == item->inv && player->inv->getItem(i)->amount < Drops::items[item->id].maxslot){
                Item* olditem = player->inv->getItem(i);
                if(item->amount + olditem->amount > Drops::items[item->id].maxslot){
                    int amount = Drops::items[item->id].maxslot-olditem->amount;
                item->amount-=amount;
                    olditem->amount = Drops::items[item->id].maxslot;
                    InventoryPacket::addItem(player, olditem, is);
                }
                else{
                    item->amount += olditem->amount;
                    item->pos = olditem->pos;
                player->inv->deleteItem(i);
                    player->inv->addItem(item);
                    InventoryPacket::addItem(player, item, is);
                    return;
                }
            }
        }
    }
    InventoryPacket::addNewItem(player, item, is);
    player->inv->addItem(item);
}
find:

Code:
if(item->amount - amount == 0){
add above:
Code:
if (ISSTAR(item->id)) amount = item->amount;
Save & compile, and have fun :p

EDIT1:
Fix for attacking with stars ^_^

open Mobs.cpp

find ~In damageMobS function~:
Code:
    if(skillid > 0)
        Skills::useAttackSkill(player, skillid);
    for(int i=0; i<howmany; i++){
        int mobid = getInt(packet+19+i*(22+4*(hits-1)));

add above:
Code:
    if (skillid == 4111005)
        Inventory::takeItemSlot(player, pos, 2, 3);
    else
        Inventory::takeItemSlot(player, pos, 2, hits);

find:
Code:
#include "Skills.h"

add below:
Code:
#include "Inventory.h"

done :p have fun~
 
Experienced Elementalist
Joined
Dec 7, 2006
Messages
294
Reaction score
0
[mouse]Wasn't this posted a while back? Not sure, just asking[/mouse]
 
Junior Spellweaver
Joined
Apr 12, 2008
Messages
103
Reaction score
0
[mouse]Wasn't this posted a while back? Not sure, just asking[/mouse]

The one posted awhile back consumed normally when using a regular attack, but took the whole set of stars when using skills.
 
Junior Spellweaver
Joined
Apr 10, 2008
Messages
131
Reaction score
45
Seems to work. Nice release.

I managed to glitch it by using !item to spawn another set of stars with 1 (which overwrote the original stack), then I tossed it out and picked it back up and it had the original amount of stars in it. Not sure if it's related to your code. Then again, I also crashed my client by messing with inventory slots and using !item.

See if you can stop them from being merged if you attempt to swap stars between slots.

EDIT: Looks like I can duplicate the client crash. Have 3 slots of stars and throw slot 1 out. Then move slot 3 to slot 1. It should crash the client. Again, not sure if it's related to your code, but it's certainly not normal behavior.
 
Junior Spellweaver
Joined
Apr 6, 2008
Messages
116
Reaction score
0
hmm when I have a set star like Ilbi, and I loot a dropped Ilbi, it's gone, just away, like cleardrops
When I try to give me an Ilbi (!item 2070006) while I have 1, I don't get a new star or pack
 
Newbie Spellweaver
Joined
Nov 18, 2007
Messages
85
Reaction score
0
Works for me...now I just got to get them to consume.
 
Newbie Spellweaver
Joined
Oct 19, 2007
Messages
20
Reaction score
0
~Added fix for consume from the stars when attacking :p
 
Junior Spellweaver
Joined
Apr 6, 2008
Messages
116
Reaction score
0
Cool =) now it works for me too =) ty

but the problem is: we can't recharge -.-
 
Newbie Spellweaver
Joined
Apr 11, 2008
Messages
12
Reaction score
0
it works well...
but when i use Shadow Partner, it will reduce just 3 stars, and it should be 6
can you fix it?
 
Last edited:
Newbie Spellweaver
Joined
Apr 6, 2008
Messages
55
Reaction score
0
it works well...
but when i use Shadow Partner, it will reduce just 3 stars, and it should be 6
can you fix it?

if (skillid == 4111005)
Inventory::takeItemSlot(player, pos, 2, 3);
else
if (skillid == Shadowpartnerid)
Inventory::takeItemSlot(player, pos, 2, 6);
else
Inventory::takeItemSlot(player, pos, 2, hits);
 
Newbie Spellweaver
Joined
Aug 21, 2006
Messages
36
Reaction score
0
if (skillid == 4111005)
Inventory::takeItemSlot(player, pos, 2, 3);
else
if (skillid == Shadowpartnerid)
Inventory::takeItemSlot(player, pos, 2, 6);
else
Inventory::takeItemSlot(player, pos, 2, hits);

for the releaser thx alot!
1q1q thanks alot, it fixes it!
guys, you see the red line? you need to change it to shadow partner ID
it is: 4111002


 
Experienced Elementalist
Joined
Apr 4, 2008
Messages
216
Reaction score
0
need to check for a way to see if player have shadowpartner on and off
if so to double stars for each skill (eg triple throw(3) ucky seven (2) and avenger(1)) and normal attack
 
Newbie Spellweaver
Joined
Mar 21, 2008
Messages
10
Reaction score
0
Amazing! Thank you.
But i have another problem, i can't recharge the stars in my server =\
Do you know how to fix it?
 
Newbie Spellweaver
Joined
Apr 6, 2008
Messages
55
Reaction score
0
for the releaser thx alot!
1q1q thanks alot, it fixes it!
guys, you see the red line? you need to change it to shadow partner ID
it is: 4111002


I didn't feel like searching for the skill ID, so i just put that >.>
 
Newbie Spellweaver
Joined
Apr 11, 2008
Messages
12
Reaction score
0
if (skillid == 4111005)
Inventory::takeItemSlot(player, pos, 2, 3);
else
if (skillid == Shadowpartnerid)
Inventory::takeItemSlot(player, pos, 2, 6);
else
Inventory::takeItemSlot(player, pos, 2, hits);
does it really work?i doubt...
since ShadowPartner is not an attack skill
I'm going to test this
even if it works i think check the ShadowPartner is on or off is a better way
 
Newbie Spellweaver
Joined
Apr 6, 2008
Messages
55
Reaction score
0
It does work, well it should.
It does check if it is on or off. (Btw, replace ShadowerpartnerId with 4111002)


Its saying, if the skill is active.. take 6 stars, not 3.

Just like with triple throw.
 
Newbie Spellweaver
Joined
Aug 21, 2006
Messages
36
Reaction score
0
It works perfectly!
Everything work yq34..
 
Newbie Spellweaver
Joined
Jan 8, 2007
Messages
73
Reaction score
0
bugs:

-cant recharge the stars
-when the set of stars get to zero the set disapire

(sorry for my english)
 
Back
Top