There's some bugs associated with these spells, and I didn't see any snippets to limit them so I wrote this. Probably some people will be using tf_spells_enabled 1, since it's available now. Basically, teleport allows people to escape maps, and tiny bugs out and allows people to fall through maps when they become normal sized (sometimes).
You'll still get the infinite jump/rapid fire boost from the cond though. I replaced teleport with a respawn and random high tier spell summon. Also, since there's no limit on how many spell drops can spawn (if you get some kind of loop where players die a lot, or you set the tf_player_spell_drop_on_death_rate to 1 and such, you may get tons of spells. You can limit that by time. I set it to 2 seconds.
PHP Code:
#include <sourcemod>
#include <sdktools>
#include <tf2_stocks>
#include <sdkhooks>
public Plugin:myinfo =
{
name = "Spell Limits",
author = "Friagram",
description = "Derp",
version = "1.1",
url = "http://steamcommunity.com/groups/poniponiponi"
};
public TF2_OnConditionAdded(client, TFCond:condition)
{
if(condition == TFCond_HalloweenTiny)
{
TF2_RemoveCondition(client, TFCond_HalloweenTiny);
}
}
public OnEntityCreated(entity, const String:classname[])
{
static lastspell;
if(StrEqual(classname, "tf_projectile_spelltransposeteleport"))
{
SDKHook(entity, SDKHook_SpawnPost, CheckSpellSpawn);
}
else if(StrEqual(classname, "tf_spell_pickup"))
{
new time = GetTime();
if(lastspell > time)
{
SDKHook(entity, SDKHook_SpawnPost, PickupSpawn);
}
lastspell = time + 2;
}
}
public Action:PickupSpawn(entity)
{
AcceptEntityInput(entity, "Kill");
}
public Action:CheckSpellSpawn(entity)
{
RequestFrame(CheckSpellOwner, EntIndexToEntRef(entity));
SDKUnhook(entity, SDKHook_SpawnPost, CheckSpellSpawn);
}
public CheckSpellOwner(any:ref)
{
new entity = EntRefToEntIndex(ref);
if(entity != INVALID_ENT_REFERENCE)
{
new client = GetEntPropEnt(entity, Prop_Send, "m_hOwnerEntity");
if(client >0 && client<=MaxClients && IsClientInGame(client))
{
AcceptEntityInput(client, "RollRareSpell");
}
AcceptEntityInput(entity, "Kill");
}
}
__________________