chuyiwen_gmsv/magic/magic.c

907 lines
26 KiB
C
Raw Normal View History

2016-12-24 08:45:52 +08:00
#include "version.h"
#include <stdio.h>
#include <string.h>
#include "common.h"
#include "char_base.h"
#include "char_data.h"
#include "item.h"
#include "battle.h"
#include "magic_base.h"
#include "magic.h"
#include "magic_field.h"
#include "family.h"
#include "handletime.h"
#include "battle_magic.h"
#include "battle_event.h"
#include"lssproto_serv.h"
#ifdef _ITEM_ATTSKILLMAGIC
#include "pet_skill.h"
#endif
//#include "battle_event.h"
// shan add code
#define MP_RATE 0.7
int MAGIC_Use( int charaindex, int haveitemindex, int toindex)
{
int itemindex;
int magicid,marray,mp;
int ret;
MAGIC_CALLFUNC func;
itemindex = CHAR_getItemIndex( charaindex, haveitemindex);
if( !ITEM_CHECKINDEX( itemindex) ) return FALSE;
magicid = ITEM_getInt( itemindex, ITEM_MAGICID);
marray = MAGIC_getMagicArray( magicid);
if( marray == -1 ) return FALSE;
func = MAGIC_getMagicFuncPointer( MAGIC_getChar( marray, MAGIC_FUNCNAME));//MAGIC_NAME
if( (mp = ITEM_getInt( itemindex, ITEM_MAGICUSEMP)) < 0 ){
print("err mp:%d -%s-%d\n", mp, ITEM_getChar( itemindex, ITEM_NAME),
ITEM_getInt( itemindex, ITEM_ID) );
}
if(CHAR_getInt(charaindex,CHAR_LV)<100 && CHAR_getInt(charaindex,CHAR_TRANSMIGRATION)<1){ //CF<43><46>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0ת100<30><30>֮ǰ<D6AE><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
char magictmpbuf[32];
sprintf(magictmpbuf,",%d,",ITEM_getInt( itemindex, ITEM_MAGICID));
if(strstr(getNoMpMagic(),magictmpbuf)!=NULL){
mp = 0;
}
}
// shan add begin
if( CHAR_getInt( charaindex, CHAR_FMINDEX ) >= 1 ){
// <20>
if( CHAR_getInt( charaindex, CHAR_FMSPRITE ) == 0){
// if( (marray >=0 && marray <=121) || (marray >= 190 && marray <=300 )){
mp *= atof(getFmMagicMpRate(0));
//printf("\n<><6E><EFBFBD><EFBFBD><E2B5BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>壡mp=%d",mp);
// }
//if(strstr(MAGIC_getChar( marray, MAGIC_COMMENT),"[<5B><>]")!=NULL){
//mp *= atof(getFmMagicMpRate(0));
// }
}
// <20><><EFBFBD><EFBFBD>
if( CHAR_getInt( charaindex, CHAR_FMSPRITE ) == 1){
// if( (marray >=130 && marray <=189) || (marray >= 300 && marray <=500 )){
mp *= atof(getFmMagicMpRate(1));
// printf("\n<><6E><EFBFBD><EFBFBD>ڰ<EFBFBD><DAB0><EFBFBD><EFBFBD>壡mp=%d",mp);
// }
// if(strstr(MAGIC_getChar( marray, MAGIC_COMMENT),"[<5B><>]")!=NULL){
// mp *= atof(getFmMagicMpRate(1));
// }
}
}
// shan end
if( func ) {
ret = func( charaindex, toindex, marray, mp );
}else {
ret = FALSE;
}
return ret;
}
int MAGIC_GetArrayNo( int charaindex, int haveitemindex)
{
int itemindex;
int magicid;
itemindex = CHAR_getItemIndex( charaindex, haveitemindex);
if( !ITEM_CHECKINDEX( itemindex) ) return FALSE;
magicid = ITEM_getInt( itemindex, ITEM_MAGICID);
return magicid;
}
int MAGIC_DirectUse(
int charaindex,
int magicid,
int toindex,
int itemnum
)
{
MAGIC_CALLFUNC func;
int mp=0, ret, marray=0;
int itemindex=-1;
#ifdef _MAGIC_NOCAST//<2F><>Ĭ״̬<D7B4>޷<EFBFBD>ʩ<EFBFBD><CAA9>
if( CHAR_getWorkInt( charaindex, CHAR_WORKNOCAST ) > 0 ){
CHAR_talkToCli(charaindex, -1, "<EFBFBD><EFBFBD>Ĭ<EFBFBD><EFBFBD><EFBFBD>޷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", CHAR_COLORYELLOW);
return FALSE;
}
#endif
#ifdef _NO_MAGIC
int nomagicmap = CHAR_getInt(charaindex,CHAR_FLOOR);
int max;
for( max = 0 ; max < 30 ; max++){
if (nomagicmap == getnomagicmap(max)){
CHAR_talkToCli(charaindex, -1, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޷<EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD>κξ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", CHAR_COLORYELLOW);
return FALSE;
}
}
#endif
if( CHAR_getInt( charaindex, CHAR_WHICHTYPE) == CHAR_TYPEPLAYER){
itemindex = CHAR_getItemIndex( charaindex, itemnum);
if( !ITEM_CHECKINDEX( itemindex) ){
//print("ANDY err MAGIC_DirectUse() itemindex:%d !\n", itemindex);
return FALSE;
}
}else{
itemindex = itemnum;
}
marray = MAGIC_getMagicArray( magicid );
func = MAGIC_getMagicFuncPointer( MAGIC_getChar( marray, MAGIC_FUNCNAME ) );
if( (mp = ITEM_getInt( itemindex, ITEM_MAGICUSEMP )) < 0 ){
//return FALSE;
}
// shan add begin
if(CHAR_getInt(charaindex,CHAR_LV)<100 && CHAR_getInt(charaindex,CHAR_TRANSMIGRATION)<1){ //CF<43><46>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0ת100<30><30>֮ǰ<D6AE><C7B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
char magictmpbuf[32];
sprintf(magictmpbuf,",%d,",ITEM_getInt( itemindex, ITEM_MAGICID));
//print("\nid=%s\n",magictmpbuf);
if(strstr(getNoMpMagic(),magictmpbuf)!=NULL){
mp = 0;
}
}
if( CHAR_getInt( charaindex, CHAR_FMINDEX ) >= 1 ){
if( CHAR_getInt( charaindex, CHAR_FMSPRITE ) == 0){
mp *= atof(getFmMagicMpRate(0));
}
if( CHAR_getInt( charaindex, CHAR_FMSPRITE ) == 1){
mp *= atof(getFmMagicMpRate(1));
}
}
/*
if( CHAR_getInt( charaindex, CHAR_FMINDEX ) >= 1 ){
// <20>
if( CHAR_getInt( charaindex, CHAR_FMSPRITE ) == 0){
//if( (marray >=0 && marray <=31) ){
//mp *= MP_RATE;
// }
if(strstr(MAGIC_getChar( marray, MAGIC_COMMENT),"[<5B><>]")!=NULL){
mp *= atof(getFmMagicMpRate(0));
}
}
// <20><><EFBFBD><EFBFBD>
if( CHAR_getInt( charaindex, CHAR_FMSPRITE ) == 1){
//if( marray >=32 && marray <=81 ){
//mp *= MP_RATE;
// }
if(strstr(MAGIC_getChar( marray, MAGIC_COMMENT),"[<5B><>]")!=NULL){
mp *= atof(getFmMagicMpRate(1));
}
}
}
*/
if( func ) {
ret = func( charaindex, toindex, marray, mp );
}
else {
ret = FALSE;
}
return ret;
}
int MAGIC_Recovery( int charaindex, int toindex, int marray, int mp )
{
int battlemode;
if( CHAR_CHECKINDEX( charaindex ) == FALSE )return FALSE;
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE;
CHAR_setInt( charaindex, CHAR_MP,
CHAR_getInt( charaindex, CHAR_MP ) - mp );
if( IsBATTLING( charaindex ) == TRUE ){
#ifdef _PREVENT_TEAMATTACK //<2F><><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD> ʹ<>õз<C3B5>
int battleindex = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX );
if( CHAR_getInt( charaindex, CHAR_WHICHTYPE ) == CHAR_TYPEPLAYER &&
BattleArray[battleindex].type != BATTLE_TYPE_P_vs_P ){
if( BATTLE_CheckSameSide( charaindex, toindex) == 0 ){//<2F><>ͬ<EFBFBD><CDAC>
int battleindex = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX );
BATTLE_NoAction( battleindex, BATTLE_Index2No( battleindex, charaindex) );
CHAR_talkToCli( charaindex, -1, "<EFBFBD><EFBFBD><EFBFBD>ݾ<EFBFBD><EFBFBD><EFBFBD>..<2E><><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵз<D2B5><D0B7><EFBFBD>", CHAR_COLORYELLOW);
return FALSE;
}
}
#endif
if (toindex==22){print("jinchao err\n");return FALSE;} // shan(<28><>ȫ<EFBFBD><C8AB>ʹ<EFBFBD><CAB9>ħ<EFBFBD><C4A7><EFBFBD><EFBFBD>bug)<29><><EFBFBD>޸<EFBFBD><DEB8><EFBFBD>jinchao+2001/12/07
MAGIC_Recovery_Battle( charaindex, toindex, marray, mp );
}else{
if( CHAR_CHECKINDEX( toindex ) == FALSE )return FALSE; // shan(<28><>ȫ<EFBFBD><C8AB>ʹ<EFBFBD><CAB9>ħ<EFBFBD><C4A7><EFBFBD><EFBFBD>bug)<29><><EFBFBD>޸<EFBFBD><DEB8><EFBFBD>jinchao+2001/12/07
MAGIC_Recovery_Field( charaindex, marray);
}
return TRUE;
}
int MAGIC_OtherRecovery( int charaindex, int toindex, int marray, int mp )
{
int battlemode;
if( CHAR_CHECKINDEX( charaindex ) == FALSE )return FALSE; //<2F><><EFBFBD><EFBFBD>
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8>
CHAR_setInt( charaindex, CHAR_MP,
CHAR_getInt( charaindex, CHAR_MP ) - mp );
if( IsBATTLING( charaindex ) == TRUE ){
#ifdef _PREVENT_TEAMATTACK //<2F><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ʹ<EFBFBD>õз<C3B5>
int battleindex = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX );
if( CHAR_getInt( charaindex, CHAR_WHICHTYPE ) == CHAR_TYPEPLAYER &&
BattleArray[battleindex].type != BATTLE_TYPE_P_vs_P ){
if( BATTLE_CheckSameSide( charaindex, toindex) == 0 ){//<2F><>ͬ<EFBFBD><CDAC>
int battleindex = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX );
BATTLE_NoAction( battleindex, BATTLE_Index2No( battleindex, charaindex) );
CHAR_talkToCli( charaindex, -1, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>..<2E><><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҵз<D2B5><D0B7><EFBFBD>", CHAR_COLORYELLOW);
return FALSE;
}
}
#endif
MAGIC_Recovery_Battle( charaindex, toindex, marray, mp );
}else{
if( CHAR_CHECKINDEX( toindex ) == FALSE )return FALSE; //<2F><><EFBFBD><EFBFBD>
MAGIC_OtherRecovery_Field( charaindex, toindex, marray);
}
return TRUE;
}
// <20><>ū<EFBFBD><C5AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ë <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ܷ
int MAGIC_FieldAttChange( int charaindex, int toindex, int marray, int mp )
{
int battlemode;
// INDEX<45><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( CHAR_CHECKINDEX( charaindex ) == FALSE )return FALSE; //<2F><><EFBFBD><EFBFBD>
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8>
// <20><><EFBFBD><EFBFBD> ܷ<><DCB7> ɧ<><C9A7> <20><> <20>ƻ<EFBFBD> <20>У<EFBFBD>Ѩ<EFBFBD>̹ϵ<CCB9><CFB5><EFBFBD>ئ<EFBFBD>³<EFBFBD><C2B3><20><>
CHAR_setInt( charaindex, CHAR_MP,
CHAR_getInt( charaindex, CHAR_MP ) - mp );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( IsBATTLING( charaindex ) == TRUE ){
return MAGIC_FieldAttChange_Battle( charaindex, toindex, marray, mp );
}else{
// <20><> ƥئ<C6A5><D8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
return FALSE;
}
}
int MAGIC_StatusChange( int charaindex, int toindex, int marray, int mp )
{
int battlemode;
if( CHAR_CHECKINDEX( charaindex ) == FALSE )return FALSE;
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE;
CHAR_setInt( charaindex, CHAR_MP, CHAR_getInt( charaindex, CHAR_MP ) - mp );
if( IsBATTLING( charaindex ) == TRUE ){
#ifdef _PREVENT_TEAMATTACK //<2F>쳣״̬<D7B4><CCAC><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD>ѷ<EFBFBD>
int battleindex = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX );
if( CHAR_getInt( charaindex, CHAR_WHICHTYPE ) == CHAR_TYPEPLAYER &&
BattleArray[battleindex].type != BATTLE_TYPE_P_vs_P ){
if( BATTLE_CheckSameSide( charaindex, toindex) == 1 ){//ͬ<><CDAC>
int battleindex = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX );
BATTLE_NoAction( battleindex, BATTLE_Index2No( battleindex, charaindex) );
CHAR_talkToCli( charaindex, -1, "<EFBFBD>쳣״̬..<2E><><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9><EFBFBD>ѷ<EFBFBD><D1B7><EFBFBD>", CHAR_COLORYELLOW);
return FALSE;
}
}
#endif
return MAGIC_StatusChange_Battle( charaindex, toindex, marray, mp );
}else{
return FALSE;
}
}
#ifdef _OTHER_MAGICSTAUTS
int MAGIC_MagicStatusChange( int charaindex, int toindex, int marray, int mp )
{
int battlemode;
if( CHAR_CHECKINDEX( charaindex ) == FALSE ) return FALSE;
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE;
CHAR_setInt( charaindex, CHAR_MP, CHAR_getInt( charaindex, CHAR_MP ) - mp );
if( IsBATTLING( charaindex ) == TRUE ){
return MAGIC_MagicStatusChange_Battle( charaindex, toindex, marray, mp );
}else{
return FALSE;
}
}
#endif
#ifdef _MAGIC_DEEPPOISON//<2F><><EFBFBD><EFBFBD>ver2,<2C><>Ҫ<EFBFBD><EFBFBD><E8B6A8>״̬5<CCAC><35>δ<EFBFBD><CEB4>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ëܸ<C3AB><DCB8><EFBFBD><EFBFBD> ܷ
int MAGIC_StatusChange2( int charaindex, int toindex, int marray, int mp )
{
int battlemode;
// INDEX<45><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( CHAR_CHECKINDEX( charaindex ) == FALSE )return FALSE; //<2F><><EFBFBD><EFBFBD>
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
//<2F><><EFBFBD><EFBFBD>
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE;
CHAR_setInt( charaindex, CHAR_MP,
CHAR_getInt( charaindex, CHAR_MP ) - mp );
//call func
if( IsBATTLING( charaindex ) == TRUE ){
return MAGIC_StatusChange_Battle2( charaindex, toindex, marray, mp );
}else{
return FALSE;
}
}
#endif
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ټ<EFBFBD><D9BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ܷ
int MAGIC_StatusRecovery( int charaindex, int toindex, int marray, int mp )
{
int battlemode;
// INDEX<45><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( CHAR_CHECKINDEX( charaindex ) == FALSE )return FALSE; //<2F><><EFBFBD><EFBFBD>
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8>
// <20><><EFBFBD><EFBFBD> ܷ<><DCB7> ɧ<><C9A7> <20><> <20>ƻ<EFBFBD> <20>У<EFBFBD>Ѩ<EFBFBD>̹ϵ<CCB9><CFB5><EFBFBD>ئ<EFBFBD>³<EFBFBD><C2B3><20><>
CHAR_setInt( charaindex, CHAR_MP,
CHAR_getInt( charaindex, CHAR_MP ) - mp );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( IsBATTLING( charaindex ) == TRUE ){
return MAGIC_StatusRecovery_Battle( charaindex, toindex, marray, mp );
}else{
// <20><> ƥئ<C6A5><D8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
return FALSE;
}
}
int MAGIC_MagicDef( int charaindex, int toindex, int marray, int mp )
{
int battlemode;
if( CHAR_CHECKINDEX( charaindex ) == FALSE )return FALSE;
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE;
CHAR_setInt( charaindex, CHAR_MP, CHAR_getInt( charaindex, CHAR_MP ) - mp );
if( IsBATTLING( charaindex ) == TRUE ){
#ifdef _PREVENT_TEAMATTACK //<2F><EFBFBD><E2BEB5>..<2E><><EFBFBD><EFBFBD>ʹ<EFBFBD>õз<C3B5>
#ifdef _GJS_TYPE
if(getGjsType()==0){
#endif
if( CHAR_getInt( charaindex, CHAR_WHICHTYPE ) == CHAR_TYPEPLAYER
/*&& BattleArray[battleindex].type != BATTLE_TYPE_P_vs_P*/ ){
if( BATTLE_CheckSameSide( charaindex, toindex) == 0 ){//<2F><>ͬ<EFBFBD><CDAC>
int battleindex = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX );
BATTLE_NoAction( battleindex, BATTLE_Index2No( battleindex, charaindex) );
CHAR_talkToCli( charaindex, -1, "<EFBFBD><EFBFBD><EFBFBD>..<2E><><EFBFBD><EFBFBD>ʩ<EFBFBD><CAA9><EFBFBD>з<EFBFBD><D0B7><EFBFBD>", CHAR_COLORYELLOW);
return FALSE;
}
}
#ifdef _GJS_TYPE
}
#endif
#endif
return MAGIC_MagicDef_Battle( charaindex, toindex, marray, mp );
}else{
return FALSE;
}
}
// <20><><EFBFBD><E5A7BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٽ<EFBFBD><D9BD><EFBFBD><EFBFBD><EFBFBD> ܷ
int MAGIC_Ressurect( int charaindex, int toindex, int marray, int mp )
{
int battlemode;
// INDEX<45><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( CHAR_CHECKINDEX( charaindex ) == FALSE )return FALSE; //<2F><><EFBFBD><EFBFBD>
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8>
// <20><><EFBFBD><EFBFBD> ܷ<><DCB7> ɧ<><C9A7> <20><> <20>ƻ<EFBFBD> <20>У<EFBFBD>Ѩ<EFBFBD>̹ϵ<CCB9><CFB5><EFBFBD>ئ<EFBFBD>³<EFBFBD><C2B3><20><>
CHAR_setInt( charaindex, CHAR_MP,
CHAR_getInt( charaindex, CHAR_MP ) - mp );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( IsBATTLING( charaindex ) == TRUE ){
return MAGIC_Ressurect_Battle( charaindex, toindex, marray, mp );
}else{
// <20><> ƥئ<C6A5><D8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
return FALSE;
}
}
// <20><><EFBFBD><EFBFBD>ë <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ܷ
int MAGIC_AttReverse( int charaindex, int toindex, int marray, int mp )
{
int battlemode;
// INDEX<45><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( CHAR_CHECKINDEX( charaindex ) == FALSE )return FALSE; //<2F><><EFBFBD><EFBFBD>
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8>
// <20><><EFBFBD><EFBFBD> ܷ<><DCB7> ɧ<><C9A7> <20><> <20>ƻ<EFBFBD> <20>У<EFBFBD>Ѩ<EFBFBD>̹ϵ<CCB9><CFB5><EFBFBD>ئ<EFBFBD>³<EFBFBD><C2B3><20><>
CHAR_setInt( charaindex, CHAR_MP,
CHAR_getInt( charaindex, CHAR_MP ) - mp );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( IsBATTLING( charaindex ) == TRUE ){
return MAGIC_AttReverse_Battle( charaindex, toindex, marray, mp );
}else{
// <20><> ƥئ<C6A5><D8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
return FALSE;
}
}
// <20><><EFBFBD><E5A7BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>١<EFBFBD> ܷ <20><>
int MAGIC_ResAndDef( int charaindex, int toindex, int marray, int mp )
{
int battlemode;
// INDEX<45><58><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( CHAR_CHECKINDEX( charaindex ) == FALSE )return FALSE; //<2F><><EFBFBD><EFBFBD>
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĸ<EFBFBD><C4B8>
// <20><><EFBFBD><EFBFBD> ܷ<><DCB7> ɧ<><C9A7> <20><> <20>ƻ<EFBFBD> <20>У<EFBFBD>Ѩ<EFBFBD>̹ϵ<CCB9><CFB5><EFBFBD>ئ<EFBFBD>³<EFBFBD><C2B3><20><>
CHAR_setInt( charaindex, CHAR_MP,
CHAR_getInt( charaindex, CHAR_MP ) - mp );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( IsBATTLING( charaindex ) == TRUE ){
return MAGIC_ResAndDef_Battle( charaindex, toindex, marray, mp );
}else{
// <20><> ƥئ<C6A5><D8A6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
return FALSE;
}
}
#ifdef _ATTACK_MAGIC
int MAGIC_AttMagic( int charaindex , int toindex , int marray , int mp )
{
int battlemode;
if( FALSE == CHAR_CHECKINDEX( charaindex ) )
return FALSE;
battlemode = CHAR_getWorkInt( charaindex , CHAR_WORKBATTLEMODE );
if( BATTLE_CHARMODE_INIT == battlemode )
return FALSE;
// <20><><EFBFBD>dz<EFBFBD><C7B3><EFBFBD>ħ<EFBFBD><C4A7>,<2C><><EFBFBD><EFBFBD>mp
if(CHAR_getInt(charaindex,CHAR_WHICHTYPE) == CHAR_TYPEPLAYER)
{
if( CHAR_getInt( charaindex , CHAR_MP ) < mp )
return FALSE;
CHAR_setInt( charaindex , CHAR_MP , CHAR_getInt( charaindex , CHAR_MP ) - mp );
}
if( TRUE == IsBATTLING( charaindex ) )
return MAGIC_AttMagic_Battle( charaindex , toindex , marray , mp );
return FALSE;
}
#endif
#ifdef _ITEM_METAMO
int MAGIC_Metamo( int charaindex, int toindex, int marray, int mp )
{
int battlemode, haveindex, power, i;
char msg[128];
if( CHAR_CHECKINDEX( charaindex ) == FALSE ) return FALSE;
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( IsBATTLING( charaindex ) == TRUE ){
//MAGIC_Recovery_Battle( charaindex, toindex, marray, mp );
//return FALSE;
toindex = BATTLE_No2Index(
CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX ), toindex );
//print(" battle_metamo:%d ", toindex);
}
if( CHAR_CHECKINDEX( toindex ) == FALSE ) return FALSE;
if( CHAR_getInt( charaindex, CHAR_RIDEPET ) != -1 ){
CHAR_talkToCli( charaindex, -1, "<EFBFBD>޷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><EFBFBD>ܱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", CHAR_COLORWHITE );
return FALSE;
}
#ifdef _FIX_METAMORIDE
if( CHAR_CHECKJOINENEMY( charaindex) == TRUE ){
CHAR_talkToCli( charaindex, -1, "<EFBFBD>޷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><EFBFBD>ܱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", CHAR_COLORYELLOW );
return FALSE;
}
#else
if( CHAR_getInt( charaindex, CHAR_BASEIMAGENUMBER) == 100259 ){
CHAR_talkToCli( charaindex, -1, "<EFBFBD>޷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>в<EFBFBD><EFBFBD>ܱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", CHAR_COLORWHITE );
return FALSE;
}
#endif
#ifdef _FIXBUG_ATTACKBOW
{
int armindex = CHAR_getItemIndex( charaindex, CHAR_ARM);
if( ITEM_CHECKINDEX( armindex) == TRUE ) {
int armtype = BATTLE_GetWepon( charaindex);
if( armtype == ITEM_BOW || armtype == ITEM_BOUNDTHROW ||
armtype == ITEM_BREAKTHROW || armtype == ITEM_BOOMERANG) {
CHAR_talkToCli( charaindex, -1, "ʹ<EFBFBD><EFBFBD>Զ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>޷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", CHAR_COLORYELLOW );
return FALSE;
}
}
}
#endif
haveindex = -1;
for( i = 0; i < 5; i++ )
{
if( CHAR_getCharPet( charaindex, i) == toindex ) {
haveindex = i;
break;
}
}
if( haveindex == -1 && charaindex != toindex )
{
CHAR_talkToCli( charaindex, -1, "<EFBFBD>޷<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD>ܱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD>ij<EFBFBD><EFBFBD>", CHAR_COLORWHITE );
return FALSE;
}
if( CHAR_getInt( toindex, CHAR_BASEIMAGENUMBER) == 100259 ){
CHAR_talkToCli( charaindex, -1, "<EFBFBD><EFBFBD><EFBFBD>ܱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", CHAR_COLORWHITE );
return FALSE;
}
power = atoi(MAGIC_getChar( marray, MAGIC_OPTION ));
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE;
CHAR_setInt( charaindex, CHAR_MP,
CHAR_getInt( charaindex, CHAR_MP ) - mp );
CHAR_send_P_StatusString( charaindex , CHAR_P_STRING_MP);
if( toindex != charaindex ) {
CHAR_setWorkInt( charaindex, CHAR_WORKITEMMETAMO, NowTime.tv_sec +power);
sprintf( msg, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>%s<><73>", CHAR_getChar( toindex, CHAR_NAME) );
}
else {
CHAR_setWorkInt( charaindex, CHAR_WORKITEMMETAMO, 0);
sprintf( msg, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><EFBFBD><EFBFBD>");
}
CHAR_talkToCli( charaindex, -1, msg, CHAR_COLORWHITE );
CHAR_setInt( charaindex, CHAR_BASEIMAGENUMBER,
CHAR_getInt( toindex, CHAR_BASEBASEIMAGENUMBER) );
CHAR_complianceParameter( charaindex);
CHAR_sendCToArroundCharacter( CHAR_getWorkInt( charaindex , CHAR_WORKOBJINDEX ));
CHAR_send_P_StatusString( charaindex , CHAR_P_STRING_BASEBASEIMAGENUMBER);
//#endif
return TRUE;
}
#endif
#ifdef _ITEM_ATTSKILLMAGIC
int MAGIC_AttSkill( int charaindex, int toindex,int marray, int mp )
{
int battlemode;
int battleindex=-1;
char *magicarg, funName[256];
int skillID=-1;
PETSKILL_CALLFUNC func;
if( CHAR_CHECKINDEX( charaindex ) == FALSE ) return FALSE;
if( IsBATTLING( charaindex ) == FALSE ) return FALSE;
battleindex = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX );
if( BATTLE_CHECKINDEX( battleindex ) == FALSE ) return FALSE;
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
if( battlemode == BATTLE_CHARMODE_INIT ) return FALSE;
if( toindex < 0 || toindex > 19 ) return FALSE;
if( CHAR_getInt( charaindex, CHAR_MP ) < mp ) return FALSE;
memset( funName, 0, sizeof( char)*256 );
//MAGIC_Recovery_Battle( charaindex, toindex, marray, mp );
magicarg = MAGIC_getChar( marray, MAGIC_OPTION );
if ( magicarg == "\0") return FALSE;
if( strstr( magicarg, ";" ) != NULL ) {
char buff1[256];
if( getStringFromIndexWithDelim( magicarg, ";", 1, buff1, sizeof( buff1)) == FALSE )
return FALSE;
snprintf( funName, sizeof(funName), buff1);
if( getStringFromIndexWithDelim( magicarg, ";", 2, buff1, sizeof( buff1)) == FALSE )
return FALSE;
skillID = atoi( buff1);
}else
return FALSE;
func = PETSKILL_getPetskillFuncPointer( funName);
if( !func ){
print("\n *func not FOUND !!");
return FALSE;
}
if( func( charaindex, toindex, skillID, "MAGICSKILL" ) == FALSE ) return FALSE;
CHAR_setInt( charaindex, CHAR_MP, CHAR_getInt( charaindex, CHAR_MP ) - mp );
return TRUE;
}
#endif
#ifdef _MAGIC_BARRIER// vincent <20><><EFBFBD><EFBFBD><><C4A7>
int MAGIC_Barrier( int charaindex, int toindex, int marray, int mp )
{
int battlemode;
int i,turn,perStatus;
int ToList[SIDE_OFFSET*2+1];
char *magicarg;
int attackNo=0;
int battleindex,Success = 0;
char szTurn[] = "turn";
char szSuccess[] = "<EFBFBD><EFBFBD>";
char *pszP;
//check index
if( CHAR_CHECKINDEX( charaindex ) == FALSE )return FALSE;
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>//??
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
//mp<6D><70><EFBFBD><EFBFBD>
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE;
//<2F><><EFBFBD><EFBFBD>mp
CHAR_setInt( charaindex, CHAR_MP,
CHAR_getInt( charaindex, CHAR_MP ) - mp );
//ħ<><C4A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
magicarg = MAGIC_getChar( marray, MAGIC_OPTION );
if( magicarg == "\0" ) {
print("\n magicarg == NULL ");
return FALSE;
}
pszP = magicarg;
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>ûغ<C3BB><D8BA><EFBFBD>
if( ( pszP = strstr( pszP, szTurn ) ) != NULL){
pszP += sizeof( szTurn );
sscanf( pszP, "%d", &turn );
}
// <20><> ɬ<><C9AC>//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( ( pszP = strstr( pszP, szSuccess ) ) != NULL){
pszP += sizeof( szSuccess );
sscanf( pszP, "%d", &Success );
}
battleindex = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX );
attackNo = BATTLE_Index2No( battleindex, charaindex );
BATTLE_MultiList( battleindex, toindex, ToList );
//ʩħ<CAA9><C4A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7>
BATTLE_MagicEffect(battleindex, attackNo, ToList, MAGIC_EFFECT_USER, SPR_hoshi);
charaindex = BATTLE_No2Index( battleindex, attackNo );
//check<63>Ƿ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>
if( IsBATTLING( charaindex ) == TRUE )
{
for( i = 0; ToList[i] != -1; i ++ )
{
toindex = BATTLE_No2Index( battleindex, ToList[i] );
if( BATTLE_StatusAttackCheck( charaindex,toindex, BATTLE_ST_BARRIER, Success, 30, 1.0, &perStatus ) == TRUE )
{
CHAR_setWorkInt( toindex, CHAR_WORKBARRIER, turn+1 );
// BATTLE_BadStatusString( ToList[i], BATTLE_ST_BARRIER );
}
}
return TRUE;
}else{
return FALSE;
}
}
#endif
#ifdef _MAGIC_NOCAST// vincent <20><><EFBFBD><EFBFBD>:<3A><>Ĭ
int MAGIC_Nocast( int charaindex, int toindex, int marray, int mp )
{
int battlemode;
int i,turn,perStatus;
int ToList[SIDE_OFFSET*2+1];
char *magicarg;
int attackNo=0;
int battleindex,Success = 0;
char szTurn[] = "turn";
char szSuccess[] = "<EFBFBD><EFBFBD>";
char *pszP;
//check index
if( CHAR_CHECKINDEX( charaindex ) == FALSE )return FALSE;
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>//??
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
//mp<6D><70><EFBFBD><EFBFBD>
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE;
//<2F><><EFBFBD><EFBFBD>mp
CHAR_setInt( charaindex, CHAR_MP,
CHAR_getInt( charaindex, CHAR_MP ) - mp );
//ħ<><C4A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
magicarg = MAGIC_getChar( marray, MAGIC_OPTION );
if( magicarg == "\0" ) {
print("\n magicarg == NULL ");
return FALSE;
}
pszP = magicarg;
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD>ûغ<C3BB><D8BA><EFBFBD>
if( ( pszP = strstr( pszP, szTurn ) ) != NULL){
pszP += sizeof( szTurn );
sscanf( pszP, "%d", &turn );
}
// <20><> ɬ<><C9AC>//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
if( ( pszP = strstr( pszP, szSuccess ) ) != NULL){
pszP += sizeof( szSuccess );
sscanf( pszP, "%d", &Success );
}
// print("\nvincent-->MAGIC_Nocast use");
battleindex = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEINDEX );
attackNo = BATTLE_Index2No( battleindex, charaindex );
BATTLE_MultiList( battleindex, toindex, ToList );
//ʩħ<CAA9><C4A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD><D0A7>
BATTLE_MagicEffect(battleindex, attackNo, ToList, MAGIC_EFFECT_USER, SPR_hoshi);
charaindex = BATTLE_No2Index( battleindex, attackNo );
//check<63>Ƿ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>
if( IsBATTLING( charaindex ) == TRUE )
{
for( i = 0; ToList[i] != -1; i ++ )
{
toindex = BATTLE_No2Index( battleindex, ToList[i] );
if( BATTLE_StatusAttackCheck( charaindex,toindex, BATTLE_ST_NOCAST, Success, 30, 1.0, &perStatus ) == TRUE
&& CHAR_getInt( toindex, CHAR_WHICHTYPE) != CHAR_TYPEPET)
{
CHAR_setWorkInt( toindex, CHAR_WORKNOCAST, turn );
//<2F>޷<EFBFBD>չ<EFBFBD><D5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ
lssproto_NC_send( getfdFromCharaIndex( toindex ), 1);
//print("\nvincent-->NOCASTING2");
// BATTLE_BadStatusString( ToList[i], BATTLE_ST_NOCAST );
}
}
return TRUE;
}else{
return FALSE;
}
}
#endif
#ifdef _MAGIC_WEAKEN// vincent <20><><EFBFBD><EFBFBD>:<3A><><EFBFBD><EFBFBD>
int MAGIC_Weaken( int charaindex, int toindex, int marray, int mp )
{
int battlemode;
//check index
if( CHAR_CHECKINDEX( charaindex ) == FALSE )return FALSE;
battlemode = CHAR_getWorkInt( charaindex, CHAR_WORKBATTLEMODE );
// <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ݷ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>//??
if( battlemode == BATTLE_CHARMODE_INIT ){
return FALSE;
}
//mp<6D><70><EFBFBD><EFBFBD>
if( CHAR_getInt( charaindex, CHAR_MP ) < mp )return FALSE;
//<2F><><EFBFBD><EFBFBD>mp
CHAR_setInt( charaindex, CHAR_MP,
CHAR_getInt( charaindex, CHAR_MP ) - mp );
//check<63>Ƿ<EFBFBD>ս<EFBFBD><D5BD><EFBFBD><EFBFBD>
if( IsBATTLING( charaindex ) == TRUE ){
return MAGIC_ParamChange_Turn_Battle( charaindex, toindex, marray, mp );
}else{
return FALSE;
}
}
#endif
#ifdef _MAGIC_TOCALL
int MAGIC_ToCallDragon( int charaindex, int toindex,int marray, int mp )
{
int battlemode;
//print("MAGIC_ToCallDragon in .................\n");
if( FALSE == CHAR_CHECKINDEX( charaindex ) )
return FALSE;
battlemode = CHAR_getWorkInt( charaindex , CHAR_WORKBATTLEMODE );
if( BATTLE_CHARMODE_INIT == battlemode )
return FALSE;
if( CHAR_getInt( charaindex , CHAR_MP ) < mp )
return FALSE;
CHAR_setInt( charaindex , CHAR_MP , CHAR_getInt( charaindex , CHAR_MP ) - mp );
if( TRUE == IsBATTLING( charaindex ) )
return MAGIC_ToCallDragon_Battle( charaindex , toindex , marray , mp );
return FALSE;
}
#endif