Pastebin

New pastes are no longer accepted · Stats

Latest Pastes

eggs and spells from config.ini

  for(int i = 0 ; i < static_cast<int>(this->server->world->config["Magic_Scroll_Amount"]) ; i++)



if(id == static_cast<int>(this->server->world->config[util::to_string(i+1) + ".Magic_Scroll_Item_ID"]))



                {



                    if(this->player->character->intl < static_cast<int>(this->server->world->config[util::to_string(i+1) + ".Magic_Scroll_Min_Int"]) || this->player->character->wis < static_cast<int>(this->server->world->config[util::to_string(i+1) + ".Magic_Scroll_Min_wis"]))



                    {



                        this->player->character->ServerMsg("You do not have enough intelegance and wisdom!");



                    break;



                    }







                    if(this->player->character->AddSpell((static_cast<int>(this->server->world->config[util::to_string(i+1) + ".Magic_Scroll_Spell_ID"])),(static_cast<int>(this->server->world->config[util::to_string(i+1) + ".Magic_Scroll_Spell_Level"])))); //put the spell and level in here



                    {



                        PacketBuilder builder(PACKET_STATSKILL, PACKET_TAKE);



                        builder.SetID(PACKET_STATSKILL, PACKET_TAKE);



                        builder.AddShort(static_cast<int>(this->server->world->config[util::to_string(i+1) + ".Magic_Scroll_Spell_ID"])); //put the spell id in here



                        this->player->client->SendBuilder(builder);



                        CLIENT_SEND(builder);



                        this->player->character->Refresh();



                        this->player->character->Save();



                    }



            }





                for(int i = 0 ; i < static_cast<int>(this->server->world->config["Pet_Spawn_Amount"]) ; i++)



                if(id == static_cast<int>(this->server->world->config[util::to_string(i+1) + ".Pet_Spawn_Item_ID"]) && static_cast<int>(this->server->world->config["Items_Spawn_Pets"]) == 1)

                {





                     this->player->character->Save(); //this may be unnessasary

                     this->player->character->AddItem(id, 1);//adds back the item after it's use

                     this->player->character->Save();





                    if(!this->player->character->has_pet)

                    {



                        unsigned char index = this->player->character->map->GenerateNPCIndex();

                        if (index > 250)



                        {



                        break;



                        }



                        this->player->character->pet = new NPC(this->player->character->map, static_cast<int>(this->server->world->config[util::to_string(i+1) + ".Pet_Spawn_NPC_ID"]), this->player->character->x + 1,this->player->character->y, 1, 1, index, true, true);

                        this->player->character->pet->Spawn();

                        this->player->character->pet->SetOwner(this->player->character);

                        this->player->character->has_pet = true;

                        //this->player->character->AddItem(682, 1);

                        this->player->character->map->npcs.push_back(this->player->character->pet);





                        this->player->character->Save();



                    }

                }