ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/skills.C
(Generate patch)

Comparing deliantra/server/server/skills.C (file contents):
Revision 1.32 by root, Thu May 17 14:14:55 2007 UTC vs.
Revision 1.33 by root, Fri May 18 13:15:29 2007 UTC

815 object *tmp; 815 object *tmp;
816 maptile *m; 816 maptile *m;
817 817
818 if (pl->type != PLAYER) 818 if (pl->type != PLAYER)
819 return 0; /* only players use this skill */ 819 return 0; /* only players use this skill */
820
820 m = pl->map; 821 m = pl->map;
821 mflags = get_map_flags (m, &m, x, y, &x, &y); 822 mflags = get_map_flags (m, &m, x, y, &x, &y);
822 if (mflags & P_OUT_OF_MAP) 823 if (mflags & P_OUT_OF_MAP)
823 return 0; 824 return 0;
824 825
836 * on that space to charm. Same for multi space monsters and 837 * on that space to charm. Same for multi space monsters and
837 * special monsters - we don't allow them to be charmed, and there 838 * special monsters - we don't allow them to be charmed, and there
838 * is no reason to do further processing since they should be the 839 * is no reason to do further processing since they should be the
839 * only monster on the space. 840 * only monster on the space.
840 */ 841 */
841 if (tmp->type == PLAYER) 842 if (tmp->type == PLAYER
842 return 0; 843 || tmp->more || tmp->head_ () != tmp
843 if (tmp->more || tmp->head) 844 || tmp->msg)
844 return 0;
845 if (tmp->msg)
846 return 0; 845 return 0;
847 846
848 if (QUERY_FLAG (tmp, FLAG_MONSTER)) 847 if (QUERY_FLAG (tmp, FLAG_MONSTER))
849 break; 848 break;
850 } 849 }
878 { 877 {
879 /* you steal the follower. Perhaps we should really look at the 878 /* you steal the follower. Perhaps we should really look at the
880 * level of the owner above? 879 * level of the owner above?
881 */ 880 */
882 tmp->set_owner (pl); 881 tmp->set_owner (pl);
882 tmp->skill = skill->skill;
883
883 new_draw_info_format (NDI_UNIQUE, 0, pl, "You convince the %s to follow you instead!\n", query_name (tmp)); 884 new_draw_info_format (NDI_UNIQUE, 0, pl, "You convince the %s to follow you instead!\n", query_name (tmp));
884 /* Abuse fix - don't give exp since this can otherwise 885 /* Abuse fix - don't give exp since this can otherwise
885 * be used by a couple players to gets lots of exp. 886 * be used by a couple players to gets lots of exp.
886 */ 887 */
887 return 0; 888 return 0;
899 if (chance > 0 && tmp->level < (random_roll (0, chance - 1, pl, PREFER_HIGH) - 1)) 900 if (chance > 0 && tmp->level < (random_roll (0, chance - 1, pl, PREFER_HIGH) - 1))
900 { 901 {
901 new_draw_info_format (NDI_UNIQUE, 0, pl, "You convince the %s to become your follower.\n", query_name (tmp)); 902 new_draw_info_format (NDI_UNIQUE, 0, pl, "You convince the %s to become your follower.\n", query_name (tmp));
902 903
903 tmp->set_owner (pl); 904 tmp->set_owner (pl);
905 tmp->skill = skill->skill;
904 tmp->stats.exp = 0; 906 tmp->stats.exp = 0;
905 add_friendly_object (tmp); 907 add_friendly_object (tmp);
906 tmp->attack_movement = PETMOVE; 908 tmp->attack_movement = PETMOVE;
907 return calc_skill_exp (pl, tmp, skill); 909 return calc_skill_exp (pl, tmp, skill);
908 } 910 }
909
910 /* Charm failed. Creature may be angry now */ 911 /* Charm failed. Creature may be angry now */
911 else if ((skill->level + ((pl->stats.Cha - 10) / 2)) < random_roll (1, 2 * tmp->level, pl, PREFER_LOW)) 912 else if ((skill->level + ((pl->stats.Cha - 10) / 2)) < random_roll (1, 2 * tmp->level, pl, PREFER_LOW))
912 { 913 {
913 new_draw_info_format (NDI_UNIQUE, 0, pl, "Your speech angers the %s!\n", query_name (tmp)); 914 new_draw_info_format (NDI_UNIQUE, 0, pl, "Your speech angers the %s!\n", query_name (tmp));
914 if (QUERY_FLAG (tmp, FLAG_FRIENDLY)) 915 if (QUERY_FLAG (tmp, FLAG_FRIENDLY))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines