BANNED
Member # 4
written Tuesday, June 29 2004 21:49
Profile
Homepage
#0
// SUBORDINATE.txt // // by Jeremy "Terror's Martyr" LeVeque // // This script has the monster follow a "leader." // When the monster is within a certain number of spaces // of the leader, the monster recieves a bonus in the // form of regeneration, hasting, healing, and/or other // positive buffs. // // Cell 0 - Creature number of Leader // Cell 1 - Min. distance needed to receive bonus // The following are potential buffs. Any non-zero // value means that the monster receives the buff. // Cell 2 - Bless (Value given is amount, 0-250) // Cell 3 - Haste (Same as above) // Cell 4 - Regeneration (Value given is denominator healed) // Cell 5 - Shielding (Same as bless) begincreaturescript; variables; short i,target; short choice; body; beginstate INIT_STATE; break; beginstate DEAD_STATE; break; beginstate START_STATE; // if I have a target for some reason, go attack it if (target_ok()) { if (dist_to_char(get_target()) <= 16) set_state(3); else set_target(ME,-1); } // Look for a target, attack it if visible if (select_target(ME,8,0)) { do_attack(); set_state(3); } // Have I been hit? Strike back! if (who_hit_me() >= 0) { set_target(ME,who_hit_me()); do_attack(); set_state(3); } // If I have nothing better to do, check if I am in the set // distance from my leader... if (char_dist_to_loc(ME,char_loc_x(get_memory_cell(0)),char_loc_y(get_memory_cell(0))) > get_memory_cell(1)){ approach_char(ME,get_memory_cell(0),2); } // If not, then move towards him. If so, buff me. else{ if (get_memory_cell(2) > 0){ set_char_status(ME,1,get_memory_cell(2),1,0); put_effect_on_char(ME,9,2,1); } if (get_memory_cell(3) > 0){ set_char_status(ME,3,get_memory_cell(3),1,0); put_effect_on_char(ME,10,2,1); } if (get_memory_cell(5) > 0){ set_char_status(ME,2,get_memory_cell(5),1,0); put_effect_on_char(ME,8,2,1); } if (get_memory_cell(4) > 0){ change_char_health(ME,(get_max_health(ME)/get_memory_cell(4))); } run_animation(); } // End buffing. // if we're in combat and the above didn't give me anything to do, just // stop now. Otherwise, game will keep running script, and that eats up CPU time. if (am_i_doing_action() == FALSE) end_combat_turn(); break; beginstate 3; // attacking if (target_ok() == FALSE) set_state(START_STATE); do_attack(); break; beginstate TALKING_STATE; begin_talk_mode(1); break;
---- If any of you can tell me if this code works with you too, I'd appreciate it. Thanks.[ Wednesday, June 30, 2004 14:07: Message edited by: Lord Drebutane ] --------------------*
Posts: 6936 |
Registered: Tuesday, September 18 2001 07:00