Lucas Roberto Administrador
Mensagens : 711
| Assunto: Spell que Persegue Ter 12 Jul 2011, 21:46 | |
| Bom eu tinha postado em outro tópico só que pra deixar um pouco mais organizado to criando o tópico aqui .::Descrição::. •É uma spell onde você da target em algum player ou npc ela persegue até atingirVa no Main.txt no final adicione isto: - Código:
-
Sub HomingPlayer(index, Dist, Damage, map, x, y, target, Spell) If Dist = 0 Then Call RemoveTimer("HomingPlayer " & index & "," & Dist & "," & Damage & "," & map & "," & x & "," & y & "," & Target & "," & Spell) Else If isplaying(target) = False Then Call RemoveTimer("HomingPlayer " & index & "," & Dist & "," & Damage & "," & map & "," & x & "," & y & "," & Target & "," & Spell) Exit Sub End If Call RemoveTimer("HomingPlayer " & index & "," & Dist & "," & Damage & "," & map & "," & x & "," & y & "," & Target & "," & Spell) Call SpellAnim(Spell, map, x, y) If StandingHere(map, x, y) <> "0" Then Call CheckAttackNPC(index, map, x, y, Damage) Call CheckAttackPlayer(index, map, x, y, Damage) Exit Sub End If If map <= GetPlayerMap(target) Then Exit Sub End If If x > GetPlayerX(target) Then x = Int(x) + 1 End If If x < GetPlayerX(target) Then x = Int(x) + 1 End If If Int(y) > GetPlayerY(target) Then y = Int(y) + 1 End If If Int(y) < GetPlayerY(target) Then y = Int(y) + 1 End If Dist = Int(Dist) - 1 Call SetTimer("HomingPlayer " & index & "," & Dist & "," & Damage & "," & map & "," & x & "," & y & "," & Target & "," & Spell, 75) End If End Sub
Sub HomingNPC(index, Dist, Damage, map, x, y, target, Spell) If Dist = 0 Then Call RemoveTimer("HomingNPC " & index & "," & Dist & "," & Damage & "," & map & "," & x & "," & y & "," & Target & "," & Spell) Else Call RemoveTimer("HomingNPC " & index & "," & Dist & "," & Damage & "," & map & "," & x & "," & y & "," & Target & "," & Spell) Call SpellAnim(Spell, map, x, y) If StandingHere(map, x, y) > 0 Then Call CheckAttackNPC(index, map, x, y, Damage) Call CheckAttackPlayer(index, map, x, y, Damage) Exit Sub End If If x > getnpcx(map, target) Then x = x - 1 ElseIf x < getnpcx(map, target) Then x = x + 1 End If If y > getnpcy(map, target) Then y = y - 1 ElseIf y < getnpcy(map, target) Then y = y + 1 End If Dist = Int(Dist) - 1 Call SetTimer("HomingNPC " & index & "," & Dist & "," & Damage & "," & map & "," & x & "," & y & "," &Target & "," & Spell, 75) End If End Sub
Sub CheckAttackNPC(index, map, x, y, Damage) Dim count count = 1 Do While count < 16 If getnpcx(map, count) = x and getnpcy(map, count) = y Then Call DamageNPC(index, count, Damage) Exit Sub End If count = count + 1 Loop End Sub
Sub CheckAttackPlayer(index, map, x, y, Damage) Dim count count = 1 Do While count < 51 If count <> index Then If isplaying(count) Then If GetPlayerMap(count) = map and GetPlayerX(count) = x and GetPlayerY(count) = y Then Call DamagePlayer(index, count, Damage) End If End If End If count = count + 1 Loop End Sub
Sub CheckAnimNPC(index, map, x, y, Spell) Dim count count = 1 Do While count < 16 If getnpcx(map, count) = x and getnpcy(map, count) = y Then Call SpellAnim(Spell, map, x, y) Exit Sub End If count = count + 1 Loop End Sub
Sub CheckAnimPlayer(index, map, x, y, Spell) Dim count count = 1 Do While count < 51 If count <> index Then If isplaying(count) Then If GetPlayerMap(count) = map and GetPlayerX(count) = x and GetPlayerY(count) = y Then Call SpellAnim(Target, map, x, y) End If End If End If count = count + 1 Loop End Sub - Código:
-
Sub XXXXX(index, Dist, Damage, SpellNo, Speed) If getplayertarget(index) > 0 Then Call SetTimer("HomingPlayer " & index & "," & Dist & "," & Damage & "," & GetPlayerMap(index) & "," & getplayerdirx(index) & "," & getplayerdiry(index) & "," & GetPlayertarget(index) & "," & SpellNo, Speed) ElseIf getplayertargetnpc(index) > 0 Then Call SetTimer("HomingNPC " & index & "," & Dist & "," & Damage & "," & GetPlayerMap(index) & "," & getplayerdirx(index) & "," & getplayerdiry(index) & "," & GetPlayertargetNPC(index) & "," & SpellNo, Speed) Else Call PlayerMSG(index, "No Target Selected!", 4) End If End Sub XXXXX= Nome Da Spell Em seguida procure pela sub ScriptedSpell e adicione: - Código:
-
Case Y 'spell perseguidora Call PlayerMsg(Index, "This scripted spell has no apparent use.", WHITE) Call XXXXX(index, DISTANCIA, DAMAGE, Nº DA SPELL ANIMATION, VELOCIDADE) Exit Sub Y = Nº da SpellAnim Créditos dg1423 - Do forum oficialDesculpe pelos os erros português. | |
|