int display_emotes_handler(window_info *win){ int i,pos; actor *act = get_actor_ptr_from_id(yourself); static int last_pos=0; //check if vbar has been moved pos=vscrollbar_get_pos(emotes_win, EMOTES_SCROLLBAR_ITEMS); if(pos!=last_pos){ last_pos=pos; update_selectables(); } //draw texts glEnable(GL_TEXTURE_2D); SET_COLOR(c_orange1); draw_string_small(20, 15, (unsigned char*)"Categories",1); draw_string_small(20, emotes_rect_y+30+5, (unsigned char*)"Emotes",1); for(i=0;i<EMOTES_CATEGORIES;i++){ if(cur_cat==i) SET_COLOR(c_blue2); else glColor3f(1.0f, 1.0f, 1.0f); draw_string_small(23, 32+13*i, (unsigned char*)emote_cats[i],1); } for(i=0;i<EMOTES_SHOWN;i++){ if(emote_sel[cur_cat]==selectables[i]) SET_COLOR(c_blue2); else glColor3f(1.0f, 1.0f, 1.0f); if(cur_cat&&act&&selectables[i]==act->poses[cur_cat-1]) SET_COLOR(c_green1); if(selectables[i]) draw_string_small(23, 30+emotes_rect_y+20+1+13*i, (unsigned char*)selectables[i]->name,1); } glColor3f(0.77f, 0.57f, 0.39f); //do grids glDisable(GL_TEXTURE_2D); rendergrid(1, 1, 20, 30, emotes_rect_x, emotes_rect_y); rendergrid(1, 1, 20, 30+emotes_rect_y+20, emotes_rect_x2, emotes_rect_y2); glEnable(GL_TEXTURE_2D); //draw description if(emote_sel[cur_cat]){ draw_string_small(20, emotes_menu_y_len-36, emote_str1,2); draw_string_small(20, emotes_menu_y_len-36+16, emote_str2,1); } #ifdef OPENGL_TRACE CHECK_GL_ERRORS(); #endif //OPENGL_TRACE return 1; }
/* stop or restart the harvesting eye candy effect depending on the harvesting state */ void check_harvesting_effect(void) { /* if the harvesting effect is on but we're not harvesting, stop it */ if ((!harvesting || !use_harvesting_eye_candy) && (harvesting_effect_reference != NULL)) { ec_recall_effect(harvesting_effect_reference); harvesting_effect_reference = NULL; } /* but if we are harvesting but there is no effect, start it if wanted */ else if (harvesting && use_eye_candy && use_harvesting_eye_candy && (harvesting_effect_reference == NULL)) { actor *act; LOCK_ACTORS_LISTS(); act = get_actor_ptr_from_id(yourself); if (act != NULL) harvesting_effect_reference = ec_create_ongoing_harvesting2(act, 1.0, 1.0, (poor_man ? 6 : 10), 1.0); UNLOCK_ACTORS_LISTS(); } }
void process_message_from_server(unsigned char *in_data, int data_lenght) { //see what kind of data we got switch (in_data[PROTOCOL]) { case RAW_TEXT: { // do filtering and ignoring data_lenght=filter_or_ignore_text(&in_data[3],data_lenght-3)+3; if(data_lenght > 3) { //how to display it if(interface_mode!=interface_opening) put_text_in_buffer(&in_data[3],data_lenght-3,0); else put_text_in_buffer(&in_data[3],data_lenght-3,54); //lets log it write_to_log(&in_data[3],data_lenght-3); } } break; case SMALL_WINDOW_TEXT: { add_text_to_small_text_buffer(in_data+3, data_lenght-3); display_small_text_window(); } break; case ADD_NEW_ACTOR: { add_actor_from_server(&in_data[3]); } break; case ADD_NEW_ENHANCED_ACTOR: { add_enhanced_actor_from_server(&in_data[3]); } break; case ADD_ACTOR_COMMAND: { add_command_to_actor(*((short *)(in_data+3)),in_data[5]); } break; case REMOVE_ACTOR: { destroy_actor(*((short *)(in_data+3))); } break; case KILL_ALL_ACTORS: { destroy_all_actors(); } break; case NEW_MINUTE: { game_minute=*((short *)(in_data+3)); new_minute(); } break; case LOG_IN_OK: { interface_mode=interface_game; previously_logged_in=1; } break; case HERE_YOUR_STATS: { get_the_stats((Sint16 *)(in_data+3)); } break; case SEND_PARTIAL_STAT: { get_partial_stat(*((Uint8 *)(in_data+3)),*((Sint32 *)(in_data+4))); } break; case GET_KNOWLEDGE_LIST: { get_knowledge_list(*(Uint16 *)(in_data+1)-1, in_data+3); } break; case GET_NEW_KNOWLEDGE: { get_new_knowledge(*(Uint16 *)(in_data+3)); } break; case HERE_YOUR_INVENTORY: { get_your_items(in_data+3); } break; case GET_NEW_INVENTORY_ITEM: { get_new_inventory_item(in_data+3); } break; case REMOVE_ITEM_FROM_INVENTORY: { remove_item_from_inventory(*((Uint8 *)(in_data+3))); } break; case INVENTORY_ITEM_TEXT: { put_small_text_in_box(&in_data[3],data_lenght-3,6*51+100,items_string); if(!(get_show_window(items_win)||get_show_window(trade_win))) { put_text_in_buffer(&in_data[3],data_lenght-3,0); } } break; case GET_KNOWLEDGE_TEXT: { put_small_text_in_box(&in_data[3],data_lenght-3,6*51+150,knowledge_string); } break; case CHANGE_MAP: { current_sector=-1; if(map_file_name[0]!=0) save_map(map_file_name); object_under_mouse=-1;//to prevent a nasty crash, while looking for bags, when we change the map close_dialogue(); // close the dialogue window if open destroy_all_particles(); if(!load_map(&in_data[4])){ // creating map if it does not exist int size=(in_data[3]&0x1f)<<4; new_map(size,size); dungeon=(in_data[3]&0x20)?1:0; strcpy(map_file_name,&in_data[4]); save_map(map_file_name); } kill_local_sounds(); #ifndef NO_MUSIC playing_music=0; #endif //NO_MUSIC get_map_playlist(); have_a_map=1; //also, stop the rain seconds_till_rain_starts=-1; seconds_till_rain_stops=-1; is_raining=0; rain_sound=0;//kill local sounds also kills the rain sound weather_light_offset=0; rain_light_offset=0; } break; case GET_TELEPORTERS_LIST: { add_teleporters_from_list(&in_data[3]); } break; case PLAY_MUSIC: { if(!no_sound)play_music(*((short *)(in_data+3))); } break; case PLAY_SOUND: { if(!no_sound)add_sound_object(*((short *)(in_data+3)),*((short *)(in_data+5)),*((short *)(in_data+7)),*((char *)(in_data+9)),*((short *)(in_data+10))); } break; case TELEPORT_OUT: { add_particle_sys_at_tile("./particles/teleport_in.part",*((short *)(in_data+3)),*((short *)(in_data+5))); if(!no_sound)add_sound_object(snd_tele_out,*((short *)(in_data+3)),*((short *)(in_data+5)),1,0); } break; case TELEPORT_IN: { add_particle_sys_at_tile("./particles/teleport_in.part",*((short *)(in_data+3)),*((short *)(in_data+5))); if(!no_sound)add_sound_object(snd_tele_in,*((short *)(in_data+3)),*((short *)(in_data+5)),1,0); } break; case LOG_IN_NOT_OK: { sprintf(log_in_error_str,"%s: %s",reg_error_str,invalid_pass); } break; case REDEFINE_YOUR_COLORS: { strcpy(log_in_error_str,redefine_your_colours); } break; case YOU_DONT_EXIST: { sprintf(log_in_error_str,"%s: %s",reg_error_str,char_dont_exist); } break; case CREATE_CHAR_NOT_OK: { sprintf(create_char_error_str,"%s: %s",reg_error_str,char_name_in_use); return; } break; case CREATE_CHAR_OK: { login_from_new_char(); } break; case YOU_ARE: { yourself=*((short *)(in_data+3)); } break; case START_RAIN: { seconds_till_rain_starts=*((Uint8 *)(in_data+3)); seconds_till_rain_stops=-1; } break; case STOP_RAIN: { seconds_till_rain_stops=*((Uint8 *)(in_data+3)); seconds_till_rain_starts=-1; } break; case THUNDER: { add_thunder(rand()%5,*((Uint8 *)(in_data+3))); } break; case SYNC_CLOCK: { server_time_stamp=*((int *)(in_data+3)); client_time_stamp=SDL_GetTicks(); client_server_delta_time=server_time_stamp-client_time_stamp; } break; case PONG: { Uint8 str[160]; sprintf(str,"%s: %i MS",server_latency, SDL_GetTicks()-*((Uint32 *)(in_data+3))); log_to_console(c_green1,str); } break; case UPGRADE_NEW_VERSION: { log_to_console(c_red1,update_your_client); log_to_console(c_red1,(char*)web_update_address); } break; case UPGRADE_TOO_OLD: { log_to_console(c_red1,client_ver_not_supported); log_to_console(c_red1,(char*)web_update_address); this_version_is_invalid=1; } break; case GET_NEW_BAG: { put_bag_on_ground(*((Uint16 *)(in_data+3)),*((Uint16 *)(in_data+5)),*((Uint8 *)(in_data+7))); } break; case GET_BAGS_LIST: { add_bags_from_list(&in_data[3]); } break; case SPAWN_BAG_PARTICLES: { add_particle_sys_at_tile("./particles/bag_in.part",*((Uint16 *)(in_data+3)),*((Uint16 *)(in_data+5))); } break; case GET_NEW_GROUND_ITEM: { get_bag_item(in_data+3); } break; case HERE_YOUR_GROUND_ITEMS: { get_bags_items_list(&in_data[3]); } break; case CLOSE_BAG: { hide_window(ground_items_win); } break; case REMOVE_ITEM_FROM_GROUND: { remove_item_from_ground(in_data[3]); } break; case DESTROY_BAG: { remove_bag(in_data[3]); } break; case NPC_TEXT: { put_small_text_in_box(&in_data[3],data_lenght-3,dialogue_menu_x_len-70,dialogue_string); display_dialogue(); if(in_data[3]>=127 && in_data[4]>=127) { add_questlog(&in_data[4],data_lenght-4); } } break; case SEND_NPC_INFO: { my_strcp(npc_name,&in_data[3]); cur_portrait=in_data[23]; } break; case NPC_OPTIONS_LIST: { build_response_entries(&in_data[3],*((Uint16 *)(in_data+1))); } break; case GET_TRADE_ACCEPT: { if(!in_data[3])trade_you_accepted=1; else trade_other_accepted=1; } break; case GET_TRADE_REJECT: { if(!in_data[3])trade_you_accepted=0; else trade_other_accepted=0; } break; case GET_TRADE_EXIT: { hide_window(trade_win); } break; case GET_YOUR_TRADEOBJECTS: { get_your_trade_objects(in_data+3); } break; case GET_TRADE_OBJECT: { put_item_on_trade(in_data+3); } break; case REMOVE_TRADE_OBJECT: { remove_item_from_trade(in_data+3); } break; case GET_TRADE_PARTNER_NAME: { get_trade_partner_name(&in_data[3],*((Uint16 *)(in_data+1))-1); } break; case GET_ACTOR_DAMAGE: { get_actor_damage(*((Uint16 *)(in_data+3)),in_data[5]); } break; case GET_ACTOR_HEAL: { get_actor_heal(*((Uint16 *)(in_data+3)),in_data[5]); } break; case ACTOR_UNWEAR_ITEM: { unwear_item_from_actor(*((Uint16 *)(in_data+3)),in_data[5]); } break; case ACTOR_WEAR_ITEM: { actor_wear_item(*((Uint16 *)(in_data+3)),in_data[5],in_data[6]); } break; case NPC_SAY_OVERTEXT: { add_displayed_text_to_actor( get_actor_ptr_from_id( *((Uint16 *)(in_data+3)) ), in_data+5 ); } break; case BUDDY_EVENT: { if(in_data[3]==1) add_buddy(&in_data[5],in_data[4],data_lenght-5); else if(in_data[3]==0) del_buddy(&in_data[4],data_lenght-4); } break; // BARREN MOON NEW MESSAGES case THIS_IS_ACTIVE_SECTOR: active_sector=*((Uint16 *)(in_data+3)); break; case GET_TILE_DATA: get_tile_data(in_data+3); break; case GET_3D_OBJECTS: get_3d_objects(in_data+3); break; case GET_2D_OBJECTS: get_2d_objects(in_data+3); break; case GET_LIGHT_OBJECTS: get_light_objects(in_data+3); break; case GET_PARTICLE_OBJECTS: get_particle_objects(in_data+3); break; case GET_3D_OBJECTS_FULL_ROTATION: get_3d_objects_full_rotation(in_data+3); break; case GET_CHECKSUMS: { actor *actor=pf_get_our_actor(); get_checksums(in_data+3, sector_get(actor->x_pos,actor->y_pos)); break; } case ADD_3D_OBJECT: add_3d_object(in_data+3); break; case ADD_3D_OBJECT_FULL_ROTATION: add_3d_object_fullrotation(in_data+3); break; case DELETE_3D_OBJECT: delete_3d_object(in_data+3); break; case REPLACE_3D_OBJECT: replace_3d_object(in_data+3); break; case ADD_2D_OBJECT: add_2d_object(in_data+3); break; case DELETE_2D_OBJECT: delete_2d_object(in_data+3); break; case REPLACE_2D_OBJECT: replace_2d_object(in_data+3); break; case ADD_LIGHT: add_lights(in_data+3); break; case DELETE_LIGHT: delete_light(in_data+3); break; case ADD_PARTICLE: add_particle(in_data+3); break; case DELETE_PARTICLE: delete_particle(in_data+3); break; case REPLACE_PARTICLE: replace_particle(in_data+3); break; default: { /* Unknown data type?? */; } break; } }
int parse_text_for_emote_commands(const char *text, int len) { int i=0, j = 0, wf=0,ef=0, itsme=0; char name[20]; // Yeah, this should be done correctly emote_dict emote_text; actor *act; //printf("parsing local for emotes\n"); //extract name while(text[i]&&i<20){ if (is_color(text[i])) {i++; continue;} name[j]=text[i]; if(text[i]==' ' || text[i]==':') { name[j]=0; if(text[i]==':') i++; break; } i++;j++; } if(j>=20||name[j]) return 0; //out of bound or not terminated //check if we are saying text LOCK_ACTORS_LISTS(); act = get_actor_ptr_from_id(yourself); if (!act){ UNLOCK_ACTORS_LISTS(); LOG_ERROR("Unable to find actor who just said local text?? name: %s", name); return 1; // Eek! We don't have an actor match... o.O } if (!(!strncasecmp(act->actor_name, name, strlen(name)) && (act->actor_name[strlen(name)] == ' ' || act->actor_name[strlen(name)] == '\0'))){ //we are not saying this text, return //UNLOCK_ACTORS_LISTS(); //return 0; itsme=0; } else itsme=1; j=0; do { if (is_color(text[i])) continue; if ((text[i]==' ' || text[i]==0)) { if (j&&j<=MAX_EMOTE_LEN) { wf++; emote_text.command[j]=0; ef+=match_emote(&emote_text,act,itsme); } else wf+= (j) ? 1:0; j=0; } else { if (j<MAX_EMOTE_LEN) emote_text.command[j]=text[i]; j++; } } while(text[i++]); //printf("ef=%i, wf=%i, filter=>%i\n",ef,wf,emote_filter); UNLOCK_ACTORS_LISTS(); return ((ef==wf) ? (emote_filter):(0)); }
void get_partial_stat(Uint8 name,Sint32 value) { switch(name) { case PHY_CUR: your_info.phy.cur=value;break; case PHY_BASE: your_info.phy.base=value;break; case COO_CUR: your_info.coo.cur=value;break; case COO_BASE: your_info.coo.base=value;break; case REAS_CUR: your_info.rea.cur=value;break; case REAS_BASE: your_info.rea.base=value;break; case WILL_CUR: your_info.wil.cur=value;break; case WILL_BASE: your_info.wil.base=value;break; case INST_CUR: your_info.ins.cur=value;break; case INST_BASE: your_info.ins.base=value;break; case VIT_CUR: your_info.vit.cur=value;break; case VIT_BASE: your_info.vit.base=value;break; case HUMAN_CUR: your_info.human_nex.cur=value;break; case HUMAN_BASE: your_info.human_nex.base=value;break; case ANIMAL_CUR: your_info.animal_nex.cur=value;break; case ANIMAL_BASE: your_info.animal_nex.base=value;break; case VEGETAL_CUR: your_info.vegetal_nex.cur=value;break; case VEGETAL_BASE: your_info.vegetal_nex.base=value;break; case INORG_CUR: your_info.inorganic_nex.cur=value;break; case INORG_BASE: your_info.inorganic_nex.base=value;break; case ARTIF_CUR: your_info.artificial_nex.cur=value;break; case ARTIF_BASE: your_info.artificial_nex.base=value;break; case MAGIC_CUR: your_info.magic_nex.cur=value;break; case MAGIC_BASE: your_info.magic_nex.base=value;break; case MAN_S_CUR: your_info.manufacturing_skill.cur=value;break; case MAN_S_BASE: floatingmessages_add_level(yourself, value, attributes.manufacturing_skill.name); { actor *_actor = get_actor_ptr_from_id(yourself); if (use_eye_candy == 1 && _actor != NULL) { ec_create_glow_level_up_default(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_man_left(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_man_right(_actor, (poor_man ? 6 : 10)); } } your_info.manufacturing_skill.base=value;break; case HARV_S_CUR: your_info.harvesting_skill.cur=value;break; case HARV_S_BASE: floatingmessages_add_level(yourself, value, attributes.harvesting_skill.name); { actor *_actor = get_actor_ptr_from_id(yourself); if (use_eye_candy == 1 && _actor != NULL) { ec_create_glow_level_up_default(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_har(_actor, (poor_man ? 6 : 10)); } } your_info.harvesting_skill.base=value;break; case ALCH_S_CUR: your_info.alchemy_skill.cur=value;break; case ALCH_S_BASE: floatingmessages_add_level(yourself, value, attributes.alchemy_skill.name); { actor *_actor = get_actor_ptr_from_id(yourself); if (use_eye_candy == 1 && _actor != NULL) { ec_create_glow_level_up_default(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_alc_left(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_alc_right(_actor, (poor_man ? 6 : 10)); } } your_info.alchemy_skill.base=value;break; case OVRL_S_CUR: your_info.overall_skill.cur=value;break; case OVRL_S_BASE: floatingmessages_add_level(yourself, value, attributes.overall_skill.name); { actor *_actor = get_actor_ptr_from_id(yourself); if (use_eye_candy == 1 && _actor != NULL) { ec_create_glow_level_up_default(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_oa(_actor, (poor_man ? 6 : 10)); } } your_info.overall_skill.base=value;break; case ATT_S_CUR: your_info.attack_skill.cur=value;break; case ATT_S_BASE: floatingmessages_add_level(yourself, value, attributes.attack_skill.name); { actor *_actor = get_actor_ptr_from_id(yourself); if (use_eye_candy == 1 && _actor != NULL) { ec_create_glow_level_up_default(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_att(_actor, (poor_man ? 6 : 10)); } } your_info.attack_skill.base=value;break; case DEF_S_CUR: your_info.defense_skill.cur=value;break; case DEF_S_BASE: floatingmessages_add_level(yourself, value, attributes.defense_skill.name); { actor *_actor = get_actor_ptr_from_id(yourself); if (use_eye_candy == 1 && _actor != NULL) { ec_create_glow_level_up_default(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_def(_actor, (poor_man ? 6 : 10)); } } your_info.defense_skill.base=value;break; case MAG_S_CUR: your_info.magic_skill.cur=value;break; case MAG_S_BASE: floatingmessages_add_level(yourself, value, attributes.magic_skill.name); { actor *_actor = get_actor_ptr_from_id(yourself); if (use_eye_candy == 1 && _actor != NULL) { ec_create_glow_level_up_default(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_mag(_actor, (poor_man ? 6 : 10)); } } your_info.magic_skill.base=value;break; case POT_S_CUR: your_info.potion_skill.cur=value;break; case POT_S_BASE: floatingmessages_add_level(yourself, value, attributes.potion_skill.name); { actor *_actor = get_actor_ptr_from_id(yourself); if (use_eye_candy == 1 && _actor != NULL) { ec_create_glow_level_up_default(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_pot_left(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_pot_right(_actor, (poor_man ? 6 : 10)); } } your_info.potion_skill.base=value;break; case CARRY_WGHT_CUR: your_info.carry_capacity.cur=value;break; case CARRY_WGHT_BASE: your_info.carry_capacity.base=value;break; case MAT_POINT_CUR: your_info.material_points.cur=value;break; case MAT_POINT_BASE: your_info.material_points.base=value;break; case ETH_POINT_CUR: { char str[5]; safe_snprintf(str, sizeof(str), "%d", value-your_info.ethereal_points.cur); add_floating_message(yourself, str, FLOATINGMESSAGE_MIDDLE, 0.3, 0.3, 1.0, 1500); your_info.ethereal_points.cur=value; break; } case ETH_POINT_BASE: your_info.ethereal_points.base=value;break; case ACTION_POINTS_CUR: { char str[5]; safe_snprintf(str, sizeof(str), "%d", value-your_info.action_points.cur); add_floating_message(yourself, str, FLOATINGMESSAGE_MIDDLE, 1.0, 0.0, 1.0, 2500); your_info.action_points.cur=value; break; } case ACTION_POINTS_BASE: your_info.action_points.base=value;break; case FOOD_LEV: your_info.food_level=value;break; case MAN_EXP: floatingmessages_compare_stat(yourself, your_info.manufacturing_exp, value, attributes.manufacturing_skill.shortname); set_last_skill_exp(SI_MAN, value-your_info.manufacturing_exp); increment_manufacturing_counter(); your_info.manufacturing_exp=value; break; case MAN_EXP_NEXT: your_info.manufacturing_exp_next_lev=value;break; case HARV_EXP: set_last_skill_exp(SI_HAR, value-your_info.harvesting_exp); floatingmessages_compare_stat(yourself, your_info.harvesting_exp, value, attributes.harvesting_skill.shortname); your_info.harvesting_exp=value; break; case HARV_EXP_NEXT: your_info.harvesting_exp_next_lev=value;break; case ALCH_EXP: set_last_skill_exp(SI_ALC, value-your_info.alchemy_exp); floatingmessages_compare_stat(yourself, your_info.alchemy_exp, value, attributes.alchemy_skill.shortname); increment_alchemy_counter(); your_info.alchemy_exp=value; break; case ALCH_EXP_NEXT: your_info.alchemy_exp_next_lev=value;break; case OVRL_EXP: set_last_skill_exp(SI_ALL, value-your_info.overall_exp); your_info.overall_exp=value;break; case OVRL_EXP_NEXT: your_info.overall_exp_next_lev=value;break; case DEF_EXP: set_last_skill_exp(SI_DEF, value-your_info.defense_exp); floatingmessages_compare_stat(yourself, your_info.defense_exp, value, attributes.defense_skill.shortname); your_info.defense_exp=value; break; case DEF_EXP_NEXT: your_info.defense_exp_next_lev=value;break; case ATT_EXP: set_last_skill_exp(SI_ATT, value-your_info.attack_exp); floatingmessages_compare_stat(yourself, your_info.attack_exp, value, attributes.attack_skill.shortname); your_info.attack_exp=value; break; case ATT_EXP_NEXT: your_info.attack_exp_next_lev=value;break; case MAG_EXP: set_last_skill_exp(SI_MAG, value-your_info.magic_exp); floatingmessages_compare_stat(yourself, your_info.magic_exp, value, attributes.magic_skill.shortname); your_info.magic_exp=value; break; case MAG_EXP_NEXT: your_info.magic_exp_next_lev=value;break; case POT_EXP: set_last_skill_exp(SI_POT, value-your_info.potion_exp); floatingmessages_compare_stat(yourself, your_info.potion_exp, value, attributes.potion_skill.shortname); increment_potions_counter(); your_info.potion_exp=value; break; case POT_EXP_NEXT: your_info.potion_exp_next_lev=value;break; case SUM_EXP: set_last_skill_exp(SI_SUM, value-your_info.summoning_exp); floatingmessages_compare_stat(yourself, your_info.summoning_exp, value, attributes.summoning_skill.shortname); increment_summon_manu_counter(); your_info.summoning_exp=value; break; case SUM_EXP_NEXT: your_info.summoning_exp_next_lev=value;break; case SUM_S_CUR: your_info.summoning_skill.cur=value;break; case SUM_S_BASE: floatingmessages_add_level(yourself, value, attributes.summoning_skill.name); { actor *_actor = get_actor_ptr_from_id(yourself); if (use_eye_candy == 1 && _actor != NULL) { ec_create_glow_level_up_default(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_sum(_actor, (poor_man ? 6 : 10)); } } your_info.summoning_skill.base=value;break; case CRA_EXP: set_last_skill_exp(SI_CRA, value-your_info.crafting_exp); floatingmessages_compare_stat(yourself, your_info.crafting_exp, value, attributes.crafting_skill.shortname); increment_crafting_counter(); your_info.crafting_exp=value; break; case CRA_EXP_NEXT: your_info.crafting_exp_next_lev=value;break; case CRA_S_CUR: your_info.crafting_skill.cur=value;break; case CRA_S_BASE: floatingmessages_add_level(yourself, value, attributes.crafting_skill.name); { actor *_actor = get_actor_ptr_from_id(yourself); if (use_eye_candy == 1 && _actor != NULL) { ec_create_glow_level_up_default(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_cra_left(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_cra_right(_actor, (poor_man ? 6 : 10)); } } your_info.crafting_skill.base=value;break; case ENG_EXP: set_last_skill_exp(SI_ENG, value-your_info.engineering_exp); floatingmessages_compare_stat(yourself, your_info.engineering_exp, value, attributes.engineering_skill.shortname); increment_engineering_counter(); your_info.engineering_exp=value; break; case ENG_EXP_NEXT: your_info.engineering_exp_next_lev=value;break; case ENG_S_CUR: your_info.engineering_skill.cur=value;break; case ENG_S_BASE: floatingmessages_add_level(yourself, value, attributes.engineering_skill.name); { actor *_actor = get_actor_ptr_from_id(yourself); if (use_eye_candy == 1 && _actor != NULL) { ec_create_glow_level_up_default(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_eng_left(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_eng_right(_actor, (poor_man ? 6 : 10)); } } your_info.engineering_skill.base=value;break; case TAIL_EXP: set_last_skill_exp(SI_TAI, value-your_info.tailoring_exp); floatingmessages_compare_stat(yourself, your_info.tailoring_exp, value, attributes.tailoring_skill.shortname); increment_tailoring_counter(); your_info.tailoring_exp=value; break; case TAIL_EXP_NEXT: your_info.tailoring_exp_next_lev=value;break; case TAIL_S_CUR: your_info.tailoring_skill.cur=value;break; case TAIL_S_BASE: floatingmessages_add_level(yourself, value, attributes.tailoring_skill.name); { actor *_actor = get_actor_ptr_from_id(yourself); if (use_eye_candy == 1 && _actor != NULL) { ec_create_glow_level_up_default(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_tai_left(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_tai_right(_actor, (poor_man ? 6 : 10)); } } your_info.tailoring_skill.base=value;break; case RANG_EXP: set_last_skill_exp(SI_RAN, value-your_info.ranging_exp); floatingmessages_compare_stat(yourself, your_info.ranging_exp, value, attributes.ranging_skill.shortname); your_info.ranging_exp=value; break; case RANG_EXP_NEXT: your_info.ranging_exp_next_lev=value;break; case RANG_S_CUR: your_info.ranging_skill.cur=value;break; case RANG_S_BASE: floatingmessages_add_level(yourself, value, attributes.ranging_skill.name); { actor *_actor = get_actor_ptr_from_id(yourself); if (use_eye_candy == 1 && _actor != NULL) { ec_create_glow_level_up_default(_actor, (poor_man ? 6 : 10)); ec_create_glow_level_up_ran(_actor, (poor_man ? 6 : 10)); } } your_info.ranging_skill.base=value;break; case RESEARCHING: your_info.researching=value; check_book_known(); break; case RESEARCH_COMPLETED: your_info.research_completed=value; check_book_known(); break; case RESEARCH_TOTAL: your_info.research_total=value; check_book_known(); break; default: LOG_ERROR("Server sent invalid stat number\n"); } //update spells //this must be here, atm spells depend on mana, magic level and alchemy (bones to gold) //but in the future they could involve other attributes/skills check_castability(); }