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!

Effect Inventory fix Not 100%

Status
Not open for further replies.
Junior Spellweaver
Joined
Feb 7, 2011
Messages
120
Reaction score
12
hey this is for SwiftEmulator... Lets go :D
Search:
Code:
internal void AddEffect(int EffectId, int Duration)

and replace the void with:
Code:
internal void AddEffect(int EffectId, int Duration)
        {
            using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
            {
                adapter.runFastQuery(string.Concat(new object[] { "INSERT INTO user_effects (user_id,effect_id,total_duration,is_activated,activated_stamp) VALUES (", this.UserId, ",", EffectId, ",", Duration, ",0,0)" }));
            }
            
            this.Effects.Add(new AvatarEffect(EffectId, Duration, false, 0.0));
            this.GetClient().GetMessageHandler().GetResponse().Init(Outgoing.AddEffectToInventary);
            this.GetClient().GetMessageHandler().GetResponse().AppendInt32(EffectId);
            this.GetClient().GetMessageHandler().GetResponse().AppendInt32(0);
            this.GetClient().GetMessageHandler().GetResponse().AppendInt32(0);
            this.GetClient().GetMessageHandler().SendResponse();
        }


Image:




it's not 100%
 
Experienced Elementalist
Joined
Aug 7, 2011
Messages
257
Reaction score
37
I've fixed this way back :)
 
Newbie Spellweaver
Joined
Nov 7, 2011
Messages
81
Reaction score
14
I already see a fix like this in comments.. but ty, I'll test it :)
 
Experienced Elementalist
Joined
Aug 7, 2011
Messages
257
Reaction score
37
This was already fixed for Swift.

That fix didn't work for alot of people :)



Why don't you use something thats working? :)
Fast, clean and at your code I'm getting 2 effects after I bought 1 effect LOL?! Well not here ;p.

Code:
  internal void AddEffect(int EffectId, int Duration)
        {
            using (IQueryAdapter dbClient =ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.runFastQuery("INSERT INTO user_effects (user_id,effect_id,total_duration,is_activated,activated_stamp) VALUES (" + UserId + "," + EffectId + "," + Duration + ",'0',0)");
            }

            EffectCount++;
            Effects.Add(new AvatarEffect(EffectId, Duration, false, 0));

            GetClient().GetMessageHandler().GetResponse().Init(Outgoing.AddEffectToInventary);
            GetClient().GetMessageHandler().GetResponse().AppendInt32(EffectId);
            GetClient().GetMessageHandler().GetResponse().AppendInt32(Duration);
        }
 
Last edited:
Junior Spellweaver
Joined
Feb 7, 2011
Messages
120
Reaction score
12
That fix didn't work for alot of people :)



Why don't you use something thats working? :)
Fast, clean and at your code I'm getting 2 effects after I bought 1 effect LOL?! Well not here ;p.

Code:
  internal void AddEffect(int EffectId, int Duration)
        {
            using (IQueryAdapter dbClient =ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.runFastQuery("INSERT INTO user_effects (user_id,effect_id,total_duration,is_activated,activated_stamp) VALUES (" + UserId + "," + EffectId + "," + Duration + ",'0',0)");
            }

            EffectCount++;
            Effects.Add(new AvatarEffect(EffectId, Duration, false, 0));

            GetClient().GetMessageHandler().GetResponse().Init(Outgoing.AddEffectToInventary);
            GetClient().GetMessageHandler().GetResponse().AppendInt32(EffectId);
            GetClient().GetMessageHandler().GetResponse().AppendInt32(Duration);
        }

thanks. ;)
 
Initiate Mage
Joined
Aug 28, 2013
Messages
2
Reaction score
0
Where can I find this? internal void AddEffect(int EffectId, int Duration)
 
Initiate Mage
Joined
Aug 28, 2013
Messages
2
Reaction score
0
I can not Find It :I :( do you can help me? the directory is /Butterfly/Messages ? Sorry i dont find internal void AddEffect(int EffectId, int Duration) :/
 
Experienced Elementalist
Joined
Dec 27, 2013
Messages
214
Reaction score
9
That fix didn't work for alot of people :)



Why don't you use something thats working? :)
Fast, clean and at your code I'm getting 2 effects after I bought 1 effect LOL?! Well not here ;p.

Code:
  internal void AddEffect(int EffectId, int Duration)
        {
            using (IQueryAdapter dbClient =ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.runFastQuery("INSERT INTO user_effects (user_id,effect_id,total_duration,is_activated,activated_stamp) VALUES (" + UserId + "," + EffectId + "," + Duration + ",'0',0)");
            }

            EffectCount++;
            Effects.Add(new AvatarEffect(EffectId, Duration, false, 0));

            GetClient().GetMessageHandler().GetResponse().Init(Outgoing.AddEffectToInventary);
            GetClient().GetMessageHandler().GetResponse().AppendInt32(EffectId);
            GetClient().GetMessageHandler().GetResponse().AppendInt32(Duration);
        }
Thx for this =D
 
Status
Not open for further replies.
Back
Top