From: Andrew C. <ac...@us...> - 2005-09-07 00:45:33
|
Update of /cvsroot/planeshift/planeshift/src/server/bulkobjects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28446/src/server/bulkobjects Modified Files: psspell.cpp Log Message: Patches from Nilaya for spell casting. Index: psspell.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/bulkobjects/psspell.cpp,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** psspell.cpp 30 Jul 2005 01:01:14 -0000 1.85 --- psspell.cpp 7 Sep 2005 00:45:25 -0000 1.86 *************** *** 208,213 **** if (!target) { ! *castingText = "You must have a target selected to cast a spell."; ! return NULL; } if (! caster->GetCharacterData()->CheckMagicKnowledge(GetSkill(), realm)) --- 208,217 ---- if (!target) { ! if ( spell_target & TARGET_SELF ) ! target = caster; ! else ! { ! castingText->Format( "You must select a target for %s!", name.GetData()); ! } } if (! caster->GetCharacterData()->CheckMagicKnowledge(GetSkill(), realm)) *************** *** 254,257 **** --- 258,265 ---- float min_range = varMinRange->GetValue(); + // If you can only cast it on yourself, do so. + if ( max_range == -1 ) + target = caster; + // Check the Target int target_type = client->GetTargetType( target ); *************** *** 263,278 **** if ( ( ( spell_target & TARGET_NONE ) == 0 ) && ( ( spell_target & target_type) == 0) ) { ! if ( target ) ! { ! csString targetTypeName; ! client->GetTargetTypeName(spell_target, targetTypeName); ! castingText->Format("You cannot cast %s on %s. You can only cast it on %s.", ! name.GetData(), target->GetName(), ! targetTypeName.GetData()); ! } ! else ! { ! castingText->Format("You need to select a target for %s.", name.GetData() ); ! } return NULL; } --- 271,278 ---- if ( ( ( spell_target & TARGET_NONE ) == 0 ) && ( ( spell_target & target_type) == 0) ) { ! csString targetTypeName; ! client->GetTargetTypeName( spell_target, targetTypeName ); ! castingText->Format( "You cannot cast %s on %s. You can only cast it on %s.", ! name.GetData(), target->GetName(), targetTypeName.GetData()); return NULL; } *************** *** 282,286 **** // All conditions for casting this spell are met! // START CASTING SPELL ! caster->SetMode( PSCHARACTER_MODE_SPELL_CASTING ); castingText->Format("You start casting spell %s",name.GetData()); --- 282,286 ---- // All conditions for casting this spell are met! // START CASTING SPELL ! caster->SetMode( PSCHARACTER_MODE_SPELL_CASTING ); castingText->Format("You start casting spell %s",name.GetData()); *************** *** 290,297 **** offset = csVector3(0,0,0); anchorID = caster->GetEntity()->GetID(); ! if ( target ) ! { ! targetID = target->GetEntity()->GetID(); ! } castingDuration = casting_duration; --- 290,294 ---- offset = csVector3(0,0,0); anchorID = caster->GetEntity()->GetID(); ! targetID = target->GetEntity()->GetID(); castingDuration = casting_duration; *************** *** 306,310 **** gemActor *caster = client->GetActor(); - int target_type = client->GetTargetType( target ); if (target) --- 303,306 ---- *************** *** 381,385 **** { i++; ! }; } return targetsInRange; --- 377,381 ---- { i++; ! } } return targetsInRange; |