コード例 #1
0
def pythonActionPerformStorm(attachee, args, evt_obj):
    currentSequence = tpactions.get_cur_seq()
    spellPacket = currentSequence.spell_packet
    newSpellId = tpactions.get_new_spell_id()
    #evt_obj.d20a.spell_id = newSpellId
    spellPacket.caster_level = 17  #set caster level manually, SLA is cast as a level 17 cleric
    tpactions.register_spell_cast(spellPacket, newSpellId)
    tpactions.trigger_spell_effect(evt_obj.d20a.spell_id)
    return 0
コード例 #2
0
def ProjectileHit(d20action, proj, obj2):
    print "Imbue Arrow: Projectile Hit"

    game.create_history_from_id(d20action.roll_id_1)
    game.create_history_from_id(d20action.roll_id_2)
    game.create_history_from_id(d20action.roll_id_0)
    print "Projectile Hit Target: " + str(d20action.target)
    d20action.target.deal_attack_damage(d20action.performer, d20action.data1,
                                        d20action.flags, d20action.action_type)
    d20action.performer.apply_projectile_hit_particles(proj, d20action.flags)
    tpactions.trigger_spell_effect(d20action.spell_id)

    tpactions.trigger_spell_projectile(d20action.spell_id, proj)
    return 1
コード例 #3
0
def OnStudyTargetPerform(attachee, args, evt_obj):
	#print "Performing Death Attack - Study Target"
	if evt_obj.d20a.target == OBJ_HANDLE_NULL:
		print "no target! PLS HANDLE ME"
	old_spell_id = args.get_arg(2)
	if old_spell_id:
		spell_packet = tpdp.SpellPacket(old_spell_id)
		prev_tgt = spell_packet.get_target(0)
		if prev_tgt != OBJ_HANDLE_NULL and prev_tgt.d20_query("Is Death Attack Target"):
			prev_tgt.d20_send_signal("Death Attack Target End", old_spell_id)
			prev_tgt.float_text_line("Target removed", tf_white)

	# put the new spell_id in arg2
	new_spell_id = tpactions.get_new_spell_id()
	args.set_arg(2, new_spell_id)
	# register the spell in the spells_cast repository so it triggers the spell scripts (Spell3210 - Death Attack.py)
	cur_seq = tpactions.get_cur_seq()
	tpactions.register_spell_cast(cur_seq.spell_packet, new_spell_id)
	tpactions.trigger_spell_effect(new_spell_id)
	return 0
コード例 #4
0
def ImbueArrowActionFrame(attachee, args, evt_obj):
    #print "Imbue Arrow Action Frame"
    cur_seq = tpactions.get_cur_seq()

    tgt = evt_obj.d20a.target
    #print "Imbue Arrow Target: " + str(tgt)
    wpn = attachee.item_worn_at(item_wear_weapon_primary)
    if tgt != OBJ_HANDLE_NULL and wpn != OBJ_HANDLE_NULL:
        projectileProto = wpn.get_weapon_projectile_proto()
        tgtLoc = cur_seq.spell_packet.loc
        projectileHandle = evt_obj.d20a.create_projectile_and_throw(
            projectileProto, tgtLoc.loc_and_offsets)
        projectileHandle.obj_set_float(obj_f_offset_z, 60.0)
        cur_seq.spell_packet.spell_id = evt_obj.d20a.spell_id
        cur_seq.spell_packet.set_projectile(0, projectileHandle)
        ammoItem = OBJ_HANDLE_NULL
        if evt_obj.d20a.projectile_append(projectileHandle, ammoItem):
            #print "Imbue Arrow Action Frame: Projectile Appended"
            attachee.apply_projectile_particles(projectileHandle,
                                                evt_obj.d20a.flags)
            evt_obj.d20a.flags |= D20CAF_NEED_PROJECTILE_HIT
    else:
        tpactions.trigger_spell_effect(evt_obj.d20a.spell_id)
    return 0